/* ================= RESET & BIẾN MÀU ================= */
:root {
    --primary-blue: #1890d5;
    --dark-blue: #006db3;
    --light-blue: #46b2f0;
    --green-btn: #52c41a;
    --green-hover: #43a613;
    --bg-light: #f2f6fa;
    --text-dark: #2c3e50;
    --text-muted: #7f8c8d;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 15px;
}

.logo-fallback {
    font-size: 26px;
    font-weight: 900;
    color: var(--white);
    letter-spacing: 1px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* ================= DESKTOP HEADER ================= */
.pc-header {
    background: linear-gradient(180deg, #1b9ee0 0%, #0d7ec2 100%);
    color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.pc-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    padding-bottom: 10px;
}

.pc-header .logo img {
    height: 44px;
    object-fit: contain;
    display: block;
}

.pc-login-bar {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.input-group {
    position: relative;
}

.pc-login-bar input {
    height: 34px;
    width: 170px;
    padding: 0 12px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
}

.password-group input {
    padding-right: 32px;
}

.toggle-pass {
    position: absolute;
    right: 10px;
    top: 10px;
    color: #888;
    cursor: pointer;
    font-size: 14px;
}

.forgot-link {
    display: block;
    text-align: right;
    font-size: 11px;
    color: #e6f7ff;
    margin-top: 3px;
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn {
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-login-pc {
    height: 34px;
    padding: 0 18px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: var(--white);
    font-size: 13px;
}

.btn-login-pc:hover {
    background: rgba(255, 255, 255, 0.35);
}

.btn-register-pc {
    height: 34px;
    padding: 0 20px;
    background: var(--green-btn);
    color: var(--white);
    font-size: 13px;
}

.btn-register-pc:hover {
    background: var(--green-hover);
}

/* Desktop Navigation */
.pc-nav {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.pc-nav-list {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    padding-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.pc-nav-list a {
    font-size: 12.5px;
    font-weight: 600;
    color: #eaf6ff;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.pc-nav-list a i {
    font-size: 10px;
}

.pc-nav-list a:hover,
.pc-nav-list a.active {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

/* Desktop Marquee */
.marquee-bar {
    background: #848b94;
    color: var(--white);
    height: 30px;
    display: flex;
    align-items: center;
    font-size: 13px;
}

.marquee-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    overflow: hidden;
}

.marquee-track {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.marquee-track span {
    display: inline-block;
    padding-left: 100%;
    animation: marqueeScroll 20s linear infinite;
}

@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ================= BANNER SLIDER (DÙNG CHUNG PC & MOBILE) ================= */
.banner-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #d9ecfa;
}

.slider-track {
    display: flex;
    transition: transform 0.55s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform;
}

.slide {
    min-width: 100%;
    user-select: none;
}

.slide img {
    width: 100%;
    height: 660px;
    object-fit: cover;
    display: block;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.35);
    color: var(--white);
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.slider-btn:hover {
    background: rgba(0, 0, 0, 0.6);
}

.prev-btn { left: 16px; }
.next-btn { right: 16px; }

.slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.slider-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: all 0.25s;
}

.slider-dot.active {
    width: 24px;
    border-radius: 10px;
    background: var(--white);
}

/* ================= DESKTOP CATEGORY CARDS ================= */
.pc-main {
    padding-top: 22px;
    padding-bottom: 40px;
}

.pc-category-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}

.pc-cat-card {
    display: block;
    background: transparent;
    border: none;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.pc-cat-card:hover {
    transform: translateY(-6px);
    filter: drop-shadow(0 8px 14px rgba(13, 126, 194, 0.3));
}

.pc-cat-card img {
    width: 100%;
    height: auto;
    display: block;
}

/* Floating Widgets Desktop */
.pc-float-left,
.pc-float-right {
    position: fixed;
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pc-float-left {
    left: 10px;
    bottom: 60px;
    background: rgba(15, 23, 42, 0.85);
    padding: 10px 6px;
    border-radius: 14px;
}

.pc-float-right {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.pc-float-left a,
.pc-float-right a {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #29a9eb, #0f74b8);
    border: 2px solid var(--white);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.pc-float-left a img,
.pc-float-right a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ================= ẨN GIAO DIỆN MOBILE TRÊN PC ================= */
.mb-header,
.mb-main,
.mb-bottom-nav {
    display: none;
}

/* ================= GIAO DIỆN ĐIỆN THOẠI (MOBILE <= 768px) ================= */
@media (max-width: 768px) {
    body {
        padding-bottom: 66px;
        background: #f4f7fb;
    }

    /* Ẩn các thành phần PC */
    .pc-header,
    .pc-only,
    .pc-main,
    .pc-float-left,
    .pc-float-right {
        display: none !important;
    }

    /* Hiện Header Mobile */
    .mb-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: linear-gradient(90deg, #1b9de0 0%, #1085c9 100%);
        padding: 8px 12px;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .mb-logo img {
        height: 34px;
        object-fit: contain;
        display: block;
    }

    .mb-header-actions {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .btn-mb-login {
        background: var(--green-btn);
        color: var(--white);
        padding: 6px 12px;
        font-size: 12px;
        border-radius: 6px;
    }

    .btn-mb-register {
        background: #a6b4bf;
        color: var(--white);
        padding: 6px 12px;
        font-size: 12px;
        border-radius: 6px;
    }

    .btn-mb-chat {
        background: transparent;
        border: 1.5px solid rgba(255, 255, 255, 0.85);
        border-radius: 6px;
        width: 30px;
        height: 30px;
        color: var(--white);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .btn-mb-chat img {
        width: 20px;
        height: 20px;
        object-fit: contain;
    }

    /* Banner trên Mobile */
    .slide img {
        height: 165px;
    }

    .slider-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .prev-btn { left: 8px; }
    .next-btn { right: 8px; }

    /* Mobile Main */
    .mb-main {
        display: block;
    }

    /* Thanh thông báo Mobile */
    .mb-notice-bar {
        display: flex;
        align-items: center;
        gap: 8px;
        background: var(--white);
        padding: 6px 10px;
        border-bottom: 1px solid #e6edf5;
    }

    .mb-notice-icon {
        color: var(--primary-blue);
        font-size: 15px;
    }

    .mb-notice-track {
        flex: 1;
        overflow: hidden;
        white-space: nowrap;
        font-size: 12px;
        color: #6c7a89;
    }

    .mb-notice-track span {
        display: inline-block;
        padding-left: 100%;
        animation: marqueeScroll 15s linear infinite;
    }

    .mb-notice-btn {
        background: linear-gradient(90deg, #32a6eb, #1786d1);
        color: var(--white);
        border: none;
        border-radius: 14px;
        padding: 4px 10px;
        font-size: 11px;
        font-weight: 600;
        flex-shrink: 0;
    }

    /* 5 Nút chức năng nhanh Mobile */
    .mb-quick-actions {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        background: var(--white);
        padding: 10px 6px;
        margin-bottom: 8px;
        border-radius: 0 0 14px 14px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    .quick-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        font-size: 11px;
        color: #1678b8;
        font-weight: 500;
    }

    .quick-icon {
        width: 34px;
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 22px;
        color: #2091d9;
    }

    .quick-icon img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    /* Bố cục Sidebar trái + Lưới game 2 cột phải */
    .mb-game-layout {
        display: flex;
        gap: 8px;
        padding: 0 8px 16px;
        align-items: flex-start;
    }

    .mb-sidebar {
        width: 72px;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        gap: 8px;
        position: sticky;
        top: 56px;
    }

    .mb-cat-btn {
        background: var(--white);
        border: none;
        border-radius: 12px;
        padding: 10px 4px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        color: #7b8a99;
        font-size: 10px;
        font-weight: 700;
        cursor: pointer;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
        transition: all 0.2s;
    }

    .mb-cat-btn img {
        width: 26px;
        height: 26px;
        object-fit: contain;
    }

    .mb-cat-btn i {
        font-size: 20px;
    }

    .mb-cat-btn.active {
        background: linear-gradient(180deg, #4eb6ff 0%, #2b7de9 100%);
        color: var(--white);
        box-shadow: 0 4px 10px rgba(43, 125, 233, 0.35);
    }

    /* Lưới thẻ game Mobile 2 cột */
.mb-game-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.mb-game-card {
    position: relative;
    display: block;
    background: transparent;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease;
}

.mb-game-card:active {
    transform: scale(0.97);
}

.mb-game-card .game-bg {
    width: 100%;
    height: auto;
    display: block;
}

/* Giữ lại icon tim góc phải (bỏ đoạn này nếu không cần) */
.mb-game-card .fav-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #95a5a6;
    font-size: 14px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.8);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

    /* Thanh điều hướng dưới cùng Mobile */
    .mb-bottom-nav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 58px;
        background: var(--white);
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
        z-index: 100;
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: #7f8c8d;
        font-size: 10.5px;
        font-weight: 600;
    }

    .bottom-nav-item img {
        width: 22px;
        height: 22px;
        object-fit: contain;
    }

    .bottom-nav-item i {
        font-size: 18px;
    }

    .bottom-nav-item.active {
        color: var(--primary-blue);
    }
}
/* ================= MODAL ĐĂNG NHẬP / ĐĂNG KÝ (MÁY TÍNH) ================= */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.auth-overlay.show {
    display: flex;
}

.auth-wrapper {
    width: 100%;
    max-width: 820px;
}

.auth-mb-logo {
    display: none;
}

.auth-box {
    position: relative;
    background: #ffffff;
    border-radius: 10px;
    padding: 28px 36px 34px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
}

.auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #d0d7de;
    background: #f5f7fa;
    color: #555;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-close:hover {
    background: #e2e8f0;
}

.auth-title {
    font-size: 22px;
    font-weight: 600;
    color: #21a6df;
    padding-bottom: 12px;
    margin-bottom: 24px;
    border-bottom: 1px solid #d9e2ec;
}

.auth-row {
    display: grid;
    grid-template-columns: 165px 250px 1fr;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.auth-row label {
    text-align: right;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.auth-row .req {
    color: #21a6df;
    margin-right: 3px;
}

.auth-input-wrap {
    position: relative;
    width: 100%;
}

.auth-input-wrap input {
    width: 100%;
    height: 38px;
    padding: 0 36px 0 12px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    outline: none;
    background: #fff;
}

.auth-input-wrap input:focus {
    border-color: #21a6df;
    box-shadow: 0 0 0 2px rgba(33, 166, 223, 0.15);
}

.auth-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    cursor: pointer;
    font-size: 15px;
}

.auth-hint {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.auth-agree {
    text-align: center;
    margin: 20px 0 16px;
    font-size: 13.5px;
    color: #444;
}

.auth-agree input[type="checkbox"] {
    accent-color: #21a6df;
    margin-right: 6px;
    vertical-align: middle;
    width: 15px;
    height: 15px;
}

.auth-agree a {
    color: #21a6df;
}

.auth-error {
    text-align: center;
    color: #e53935;
    font-size: 13px;
    font-weight: 600;
    min-height: 18px;
    margin-bottom: 12px;
}

.auth-actions {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 8px;
}

.auth-btn-back,
.auth-btn-submit {
    min-width: 145px;
    height: 42px;
    border-radius: 22px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s;
}

.auth-btn-back {
    background: #a5a5a5;
}

.auth-btn-submit {
    background: #29a4e3;
}

.auth-btn-back:hover,
.auth-btn-submit:hover {
    opacity: 0.9;
}

.auth-switch-wrap {
    text-align: center;
    margin-top: 14px;
}

.auth-switch-btn {
    background: none;
    border: none;
    color: #21a6df;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
}

.auth-footer-links {
    display: none;
}

/* ================= MODAL ĐĂNG NHẬP / ĐĂNG KÝ (ĐIỆN THOẠI <= 768px) ================= */
@media (max-width: 768px) {
    .auth-overlay {
        background: linear-gradient(160deg, rgba(16, 40, 68, 0.88), rgba(62, 48, 36, 0.92));
        backdrop-filter: blur(8px);
        padding: 16px;
        align-items: center;
    }

    .auth-wrapper {
        max-width: 370px;
    }

    .auth-mb-logo {
        display: block;
        text-align: center;
        margin-bottom: 14px;
    }

    .auth-mb-logo img {
        height: 52px;
        object-fit: contain;
    }

    .auth-box {
        background: linear-gradient(180deg, rgba(242, 245, 248, 0.94) 0%, rgba(235, 228, 218, 0.94) 100%);
        border-radius: 18px;
        padding: 20px 20px 24px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    }

    .auth-close {
        top: 12px;
        right: 12px;
        width: 30px;
        height: 30px;
        background: #6c7a89;
        color: #fff;
        border: 2px solid #fff;
    }

    .auth-title {
        text-align: center;
        font-size: 19px;
        color: #19a0e6;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        padding-bottom: 10px;
        margin-bottom: 16px;
    }

    .auth-row {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
        margin-bottom: 12px;
    }

    .auth-row label {
        text-align: left;
        font-size: 13px;
        color: #21a6df;
        padding-left: 4px;
    }

    .auth-row .req {
        color: #f39c12;
    }

    .pc-colon {
        display: none;
    }

    .auth-input-wrap input {
        height: 44px;
        border-radius: 24px;
        border: none;
        background: rgba(78, 72, 65, 0.82);
        color: #ffffff;
        padding: 0 40px 0 18px;
        font-size: 14px;
    }

    .auth-input-wrap input::placeholder {
        color: rgba(255, 255, 255, 0.72);
    }

    .auth-eye {
        color: rgba(255, 255, 255, 0.8);
        right: 15px;
    }

    .auth-hint {
        font-size: 12px;
        color: #21a6df;
        padding-left: 6px;
    }

    .auth-agree {
        text-align: left;
        font-size: 12px;
        color: #21a6df;
        margin: 12px 0;
    }

    .auth-agree input[type="checkbox"] {
        accent-color: #6ab04c;
    }

    .auth-actions {
        margin-top: 10px;
    }

    .auth-btn-back {
        display: none;
    }

    .auth-btn-submit {
        width: 100%;
        height: 44px;
        border-radius: 24px;
        background: linear-gradient(90deg, #1d9bf0, #1283dc);
        font-size: 16px;
    }

    .auth-switch-btn {
        color: #444;
        font-size: 14px;
    }

    .auth-footer-links {
        display: flex;
        justify-content: center;
        gap: 24px;
        margin-top: 14px;
        font-size: 12.5px;
        color: #444;
    }
}