/* ═══════════════════════════════════════════════════════
   ARCADE THEME — CrazyGames-inspired dark gaming portal
   ═══════════════════════════════════════════════════════ */

:root {
    --bg-primary: #0C0D14;
    --bg-surface: #181A27;
    --bg-card: #212233;
    --bg-card-hover: #2A2C40;
    --bg-input: #373952;
    --text-primary: #F9FAFF;
    --text-secondary: #AAADBE;
    --text-muted: #6B6E82;
    --accent: #6842FF;
    --accent-hover: #7B5AFF;
    --accent-glow: rgba(104, 66, 255, 0.25);
    --border: #2D2F42;
    --success: #2ED573;
    --error: #FF4757;
    --warning: #FFA502;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --sidebar-width: 240px;
    --topbar-height: 64px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── LIGHT THEME OVERRIDES ──────────────────────── */
.theme-light {
    --bg-primary: #F0F2F5;
    --bg-surface: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F5F5F7;
    --bg-input: #E8E9ED;
    --text-primary: #1A1A2E;
    --text-secondary: #4A4D5E;
    --text-muted: #6B6E82;
    --accent: #6842FF;
    --accent-hover: #5A35E0;
    --accent-glow: rgba(104, 66, 255, 0.18);
    --border: #D8DAE5;
    color-scheme: light;
}

.theme-light .arcade-topbar {
    background: rgba(255, 255, 255, 0.88) !important;
    border-bottom-color: var(--border);
}

.theme-light .topbar-icon-btn {
    background: rgba(0,0,0,0.06);
    color: var(--text-primary);
}
.theme-light .topbar-icon-btn:hover {
    background: rgba(0,0,0,0.10);
}

.theme-light .topbar-search-pill .search-suggestions-input {
    background: rgba(0,0,0,0.05) !important;
    border-color: var(--border) !important;
    color: var(--text-primary);
}

.theme-light .arcade-sidebar {
    background: var(--bg-surface);
    border-right-color: var(--border);
}

.theme-light .sidebar-link {
    color: var(--text-secondary);
}
.theme-light .sidebar-link:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.theme-light .arcade-footer {
    background: var(--bg-surface);
    border-top-color: var(--border);
}

.theme-light .game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.theme-light .game-info-main,
.theme-light .game-meta-card {
    background: var(--bg-surface);
    border-color: var(--border);
}

.theme-light .notification-dropdown,
.theme-light .profile-dropdown {
    background: var(--bg-surface);
    border-color: var(--border);
}

.theme-light .notif-badge {
    border-color: var(--bg-surface) !important;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; }

/* ── LAYOUT ─────────────────────────────────────── */
.arcade-layout {
    display: flex;
    min-height: 100vh;
}

.arcade-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 50;
    transition: transform 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-input) var(--bg-surface);
}

.arcade-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding-top: var(--topbar-height);
    transition: margin-left 0.3s ease;
}

.arcade-topbar {
    height: var(--topbar-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 60;
    backdrop-filter: blur(20px);
    background: rgba(24, 26, 39, 0.85);
    overflow: visible;
}

.arcade-content {
    padding: 16px;
}

/* ── COLLAPSED SIDEBAR (Desktop) ────────────────── */
body.sidebar-collapsed .arcade-sidebar {
    transform: translateX(-100%);
}

body.sidebar-collapsed .arcade-main {
    margin-left: 0;
}

/* ── SIDEBAR ────────────────────────────────────── */
.sidebar-logo {
    display: none; /* Hidden since logo is now in topbar */
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #4338CA);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.sidebar-logo-text {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #818CF8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.sidebar-section {
    padding: 12px 12px 4px;
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 8px;
    margin-bottom: 8px;
}

.sidebar-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: rgba(104, 66, 255, 0.12);
    color: var(--accent);
}

.sidebar-link .icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.sidebar-link .count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-input);
    padding: 2px 8px;
    border-radius: 20px;
    color: var(--text-muted);
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 20px;
}

/* Sidebar close button — hidden desktop, shown mobile via media query */
.sidebar-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    z-index: 10;
    transition: all 0.2s;
}
.sidebar-close-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* ── TOPBAR (CrazyGames-style) ──────────────────────── */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.topbar-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    color: var(--text-secondary);
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: color 0.2s;
}
.topbar-hamburger:hover { color: var(--text-primary); }

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.topbar-logo-img {
    height: 32px;
    width: auto;
    aspect-ratio: 31 / 35;
    object-fit: contain;
    border-radius: 8px;
}
.topbar-logo-text {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #818CF8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

/* Search pill */
.topbar-search-pill {
    flex: 1;
    max-width: 480px;
    position: relative;
    margin: 0 auto;
}
.topbar-search-pill-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 2;
    pointer-events: none;
}
.topbar-search-pill .search-suggestions-wrap { flex: 1; }
.topbar-search-pill .search-suggestions-input {
    background: rgba(255,255,255,0.06) !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    border-radius: 999px !important;
    padding: 10px 40px 10px 16px !important;
    font-size: 14px;
}
.topbar-search-pill .search-suggestions-input::placeholder { color: var(--text-muted); }
.topbar-search-pill .search-suggestions-input:focus {
    box-shadow: 0 0 0 2px var(--accent-glow) !important;
}

/* Mobile search icon */
.topbar-search-mobile-btn {
    display: none;
    background: none;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: var(--radius-sm);
}

.profile-dropdown-item-mobile-theme {
    display: none;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 180px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    z-index: 200;
    overflow: hidden;
}

.topbar-mobile-sheet-header {
    display: none;
}

.topbar-mobile-sheet-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}

/* Right section */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.topbar-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    transition: all 0.2s;
}
.topbar-icon-btn:hover {
    background: rgba(255,255,255,0.12);
}

.topbar-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    transition: background 0.2s;
}
.topbar-user-info:hover { background: var(--bg-card); }

.topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #4338CA);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.topbar-username {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-login-btn {
    background: var(--accent);
    color: white !important;
    padding: 8px 20px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
    white-space: nowrap;
}
.topbar-login-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.topbar-admin-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary) !important;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}
.topbar-admin-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary) !important;
}

/* Hide old topbar search classes (keep for backwards compat) */
.topbar-search { display: none; }
.topbar-search-icon { display: none; }
.topbar-actions { display: none; }
.topbar-btn { display: none; }
.mobile-menu-btn { display: none; }

/* ── CTA ROW ───────────────────────────────────── */
.cta-row {
    display: flex;
    gap: 10px;
    padding: 0 0 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.cta-row::-webkit-scrollbar { display: none; }

.cta-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 80px;
    padding: 14px 12px 10px;
    border-radius: 12px;
    text-align: center;
    color: white;
    text-decoration: none;
    transition: all 0.25s ease;
    flex-shrink: 0;
}
.cta-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    filter: brightness(1.1);
}
.cta-emoji {
    font-size: 28px;
    line-height: 1;
    margin-bottom: 6px;
}
.cta-text {
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.2;
}



/* ── HERO / FEATURED ────────────────────────────── */
.hero-section {
    position: relative;
    margin-bottom: 32px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 200px 200px;
    gap: 8px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Hero grid desktop: 1 grande (col-span-3, row-span-2) + 6 normales (3x2) */
@media (min-width: 1025px) {
    .hero-grid {
        grid-template-columns: repeat(6, 1fr);
        grid-template-rows: 220px 220px;
        gap: 10px;
    }
    .hero-card:first-child {
        grid-column: 1 / 4;
        grid-row: 1 / 3;
    }
    .hero-card:not(:first-child) {
        grid-column: auto;
        grid-row: auto;
    }
    .hero-card-title {
        font-size: 18px;
    }
    .hero-card:first-child .hero-card-title {
        font-size: 28px;
    }
}

.hero-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.hero-card:first-child {
    grid-row: 1 / 3;
}

.hero-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.hero-card:hover img {
    transform: scale(1.05);
}

.hero-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(12, 13, 20, 0.9) 0%, transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    color: #fff;
}

.hero-card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.hero-card:first-child .hero-card-title {
    font-size: 24px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
    width: fit-content;
}

.badge-new { background: var(--accent); color: white; }
.badge-hot { background: var(--error); color: white; }
.badge-top { background: var(--warning); color: #000; }
.badge-updated { background: var(--success); color: #000; }

/* ── GAME GRID ──────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* ── GAME PAGE LAYOUT ──────────── */
.game-page-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

.game-page-left {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.game-page-right {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.related-games-sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    content-visibility: auto;
    contain-intrinsic-size: auto 520px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-more {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s;
}

.section-more:hover { gap: 8px; }

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 32px;
    content-visibility: auto;
    contain-intrinsic-size: auto 560px;
}

/* ── DESKTOP GAME GRID (solo >= 1025px) ─────────── */
@media (min-width: 1025px) {
    .game-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 12px;
    }
    .arcade-content {
        padding: 20px 24px;
    }
}

@media (min-width: 1280px) {
    .game-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 12px;
    }
}

@media (min-width: 1536px) {
    .game-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 12px;
    }
}

.game-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    transition: all 0.25s ease;
    cursor: pointer;
    aspect-ratio: 4/3;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover img {
    transform: scale(1.08);
}

.game-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(12, 13, 20, 0.85) 0%, transparent 50%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.game-card:hover .game-card-overlay {
    opacity: 1;
}

.game-card-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 1025px) {
    .game-card-title {
        font-size: 14px;
    }
    .hero-badge {
        font-size: 12px;
        padding: 4px 12px;
    }
}

.game-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
}

.game-card-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 20px var(--accent-glow);
    transition: transform 0.25s ease;
    z-index: 3;
}

.game-card:hover .game-card-play {
    transform: translate(-50%, -50%) scale(1);
}

/* ── GAME DETAIL PAGE ───────────────────────────── */
.game-player-container {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
}

.game-player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.game-info-main {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
}

.game-info-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.game-meta-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border);
}

.game-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.game-meta-row:last-child { border-bottom: none; }
.game-meta-label { color: var(--text-muted); }
.game-meta-value { font-weight: 600; }

.game-actions {
    display: flex;
    gap: 12px;
    margin: 20px 0;
}

.btn-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.btn-action:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: rgba(104, 66, 255, 0.08);
}

.btn-action-favorite {
    gap: 6px;
}

.fullscreen-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(0,0,0,0.6);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    backdrop-filter: blur(8px);
    transition: background 0.2s;
}

.fullscreen-btn:hover { background: var(--accent); }

/* ── CATEGORY PILLS ─────────────────────────────── */
.category-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.category-pill {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.category-pill:hover,
.category-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* ── FOOTER ─────────────────────────────────────── */
.arcade-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 40px 24px 20px;
    margin-top: 60px;
    content-visibility: auto;
    contain-intrinsic-size: auto 320px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent); }

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    margin-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* ── PAGINATION ─────────────────────────────────── */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 32px 0;
}

.pagination-wrapper a,
.pagination-wrapper span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.pagination-wrapper a:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.pagination-wrapper .active span {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* ── RESPONSIVE ─────────────────────────────────── */

@media (max-width: 1024px) {
    .game-page-layout {
        grid-template-columns: 1fr;
    }
    .related-games-sidebar {
        grid-template-columns: repeat(4, 1fr);
    }
    .arcade-sidebar {
        top: 0;
        transform: translateX(-100%);
    }
    .arcade-sidebar.open {
        transform: translateX(0);
    }
    .arcade-main {
        margin-left: 0;
    }
    .topbar-hamburger {
        display: flex;
    }
    .hero-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 200px 150px;
    }
    .hero-card:first-child {
        grid-column: 1 / 3;
    }
    .game-info {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Sidebar close button — mobile only */
    .sidebar-close-btn {
        display: flex;
    }
}

@media (max-width: 768px) {
    /* ── HEADER MOBILE ── */
    .arcade-topbar {
        padding: 0 12px !important;
        gap: 10px !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    .topbar-left {
        gap: 10px !important;
    }
    .topbar-right-cluster {
        gap: 8px !important;
        min-width: 0;
        overflow: visible;
    }
    .topbar-logo-img {
        height: 36px;
    }
    .topbar-logo-text {
        font-size: 16px;
    }
    .topbar-search-pill {
        display: none;
    }
    .topbar-search-container.mobile-active {
        display: block !important;
        position: fixed;
        top: 0; left: 0; right: 0;
        max-width: 100%;
        padding: 12px 16px;
        background: var(--bg-surface);
        z-index: 60;
        border-bottom: 1px solid var(--border);
    }
    .topbar-search-container.mobile-active .topbar-search-pill {
        display: block;
        max-width: 100%;
    }
    .topbar-search-mobile-btn {
        display: flex !important;
    }
    .topbar-search-container {
        display: none !important;
    }
    .topbar-icon-btn.topbar-icon-user { display: none; }
    .topbar-icon-hideable { display: flex !important; }
    .topbar-theme-toggle { display: none !important; }
    .topbar-user-info { display: none; }
    .topbar-username { display: none; }
    .topbar-icon-btn,
    .topbar-avatar {
        width: 34px;
        height: 34px;
    }
    .topbar-icon-btn svg {
        width: 18px;
        height: 18px;
    }
    .topbar-login-btn {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }
    .topbar-mobile-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 14px 16px;
        border-bottom: 1px solid var(--border);
        font-size: 14px;
        font-weight: 700;
    }
    .topbar-mobile-sheet-close {
        display: inline-flex;
    }
    .topbar-admin-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    /* ── GRIDS MOBILE ── */
    .game-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        overflow: hidden;
    }
    .related-games-sidebar {
        grid-template-columns: repeat(3, 1fr);
    }
    .arcade-content {
        overflow-x: hidden;
    }

    /* ── CTA MOBILE ── */
    .cta-card {
        min-width: 100px;
    }

    /* ── GAME PAGE MOBILE ── */
    .game-actions {
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 8px;
        padding-bottom: 4px;
    }
    .game-actions::-webkit-scrollbar {
        display: none;
    }
    .btn-action {
        flex: 0 0 auto;
        flex-direction: column;
        padding: 10px 14px;
        font-size: 12px;
        gap: 4px;
        min-width: 72px;
    }
    .btn-action-favorite {
        min-width: 52px;
        padding-left: 12px;
        padding-right: 12px;
    }
    .btn-action-favorite .btn-action-favorite-text {
        display: none;
    }
}

@media (max-width: 640px) {
    .arcade-content {
        padding: 12px;
    }
    .hero-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 180px 120px;
    }
    .hero-card:first-child {
        grid-column: 1 / 3;
    }
    .hero-grid .hero-card:nth-child(n+4) {
        display: none;
    }
    .section-title {
        font-size: 16px;
    }

    /* ── FOOTER MOBILE COMPACT ── */
    .arcade-footer {
        padding: 24px 16px 16px;
        margin-top: 40px;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .footer-title {
        font-size: 12px;
        margin-bottom: 8px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-muted);
    }
    .footer-links {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px 12px;
    }
    .footer-links a {
        font-size: 12px;
    }
    .footer-bottom {
        margin-top: 16px;
        padding-top: 16px;
        font-size: 11px;
    }

    .related-games-sidebar {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── SIDEBAR OVERLAY ────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 45;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active { display: block; }

/* ── EMPTY STATE ────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state-text {
    color: var(--text-muted);
    font-size: 14px;
}

/* ═══ LANGUAGE SELECTOR ═══════════════════════ */
.language-selector {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-md, 8px);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s ease;
}

.lang-option:hover {
    background: var(--bg-input, #373952);
    color: var(--text-primary);
}

.lang-option.active {
    background: var(--accent, #6842FF);
    color: white;
    font-weight: 600;
}

.lang-flag {
    font-size: 16px;
    line-height: 1;
}

.lang-name {
    white-space: nowrap;
}

/* ═══ AD CONTAINER ════════════════════════════ */
.arcade-ad-container {
    margin: 20px 0;
    text-align: center;
    min-height: 0;
}

.arcade-ad-container:empty {
    display: none;
}

/* ═══ BREADCRUMB ══════════════════════════════ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumb a:hover {
    color: var(--accent, #6842FF);
}

.breadcrumb-sep {
    color: var(--text-muted);
}

/* ═══ SIDEBAR RECENTLY PLAYED ═════════════════ */
.sidebar-recent-game {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 6px 12px !important;
}

.sidebar-recent-thumb {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.sidebar-recent-title {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* ═══ SEARCH SUGGESTIONS ═════════════════════ */
.search-suggestions-wrap {
    flex: 1;
    position: relative;
}

.search-suggestions-inner {
    position: relative;
}

.search-suggestions-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 16px 10px 6px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
    font-family: var(--font);
}

.search-suggestions-input::placeholder { color: var(--text-muted); }
.search-suggestions-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-suggestions-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    z-index: 100;
    max-height: 420px;
    overflow-y: auto;
    animation: dropdownFadeIn 0.15s ease;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border);
}

.search-suggestion-item:last-of-type {
    border-bottom: none;
}

.search-suggestion-item:hover {
    background: rgba(104, 66, 255, 0.08);
}

.suggestion-thumb {
    width: 44px;
    height: 33px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.suggestion-info {
    flex: 1;
    min-width: 0;
}

.suggestion-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-category {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.search-suggestion-all {
    display: block;
    padding: 12px 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    border-top: 1px solid var(--border);
    transition: background 0.15s;
}

.search-suggestion-all:hover {
    background: rgba(104, 66, 255, 0.06);
}

.search-no-results {
    padding: 20px 14px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ═══ NOTIFICATION DROPDOWN ══════════════════ */
[x-cloak] { display: none !important; }

.notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: -8px;
    width: 360px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    z-index: 200;
    overflow: hidden;
}

.notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.notification-item:hover {
    background: rgba(104, 66, 255, 0.06);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.notification-item-msg {
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

.notification-item-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ═══ PROFILE DROPDOWN ═══════════════════════ */
.topbar-avatar-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    z-index: 200;
    overflow: hidden;
}

.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.profile-dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #4338CA);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
}

.profile-dropdown-item:hover {
    background: rgba(104, 66, 255, 0.06);
    color: var(--text-primary);
}

.profile-dropdown-item span:first-child {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* ═══ DROPDOWN MOBILE ADJUSTMENTS ════════════ */
@media (max-width: 768px) {
    .language-dropdown,
    .notification-dropdown {
        position: fixed;
        top: calc(var(--topbar-height) + 8px);
        bottom: auto;
        left: 12px;
        right: 12px;
        width: auto;
        min-width: 0;
        border-radius: var(--radius-lg, 12px);
        max-height: calc(100vh - var(--topbar-height) - 20px);
        z-index: 9999;
        padding-bottom: env(safe-area-inset-bottom, 0);
        overflow-y: auto;
    }
    .language-dropdown {
        left: auto;
        right: 24px;
        width: min(180px, calc(100vw - 48px));
    }
    .profile-dropdown {
        position: absolute;
        top: calc(100% + 8px);
        bottom: auto;
        left: auto;
        right: 0;
        width: min(320px, calc(100vw - 24px));
        border-radius: var(--radius-lg, 12px);
        max-height: calc(100vh - 88px);
        overflow-y: auto;
        z-index: 9999;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .language-dropdown a,
    .notification-item {
        min-width: 0;
    }
    .notification-dropdown-header {
        gap: 12px;
    }
    .notification-dropdown-list {
        max-height: none !important;
    }
    .profile-dropdown-header {
        align-items: flex-start;
    }
    .profile-dropdown-item-mobile-theme {
        display: flex;
    }
}

/* ── DESKTOP ── */
.arcade-home-seo {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 40px;
  margin: 48px 0 32px;
  color: var(--text-primary);
  overflow: visible;
  content-visibility: auto;
  contain-intrinsic-size: auto 420px;
}

.arcade-home-seo-inner {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.arcade-home-seo h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.arcade-home-seo h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.arcade-home-seo h4 {
    font-size: 17px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.arcade-home-seo p {
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.arcade-home-seo ul {
    list-style: disc;
    padding-left: 24px;
    margin-bottom: 12px;
}

.arcade-home-seo li {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.arcade-home-seo a {
    color: #6842FF;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.arcade-home-seo a:hover {
    color: #8862FF;
    text-decoration: underline;
}

.arcade-home-seo strong {
    color: var(--text-primary);
    font-weight: 600;
}

.arcade-home-seo em {
    font-style: italic;
}

/* ── MOBILE ONLY — no tocar desktop ── */
@media (max-width: 768px) {
  .arcade-home-seo {
    width: auto !important;
    margin: 32px 16px !important;
    box-sizing: border-box !important;
    padding: 24px 20px !important;
    border-radius: 16px !important;
  }

  .arcade-home-seo *,
  .arcade-home-seo h2,
  .arcade-home-seo h3,
  .arcade-home-seo p,
  .arcade-home-seo a,
  .arcade-home-seo li {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Home SEO Preview (admin) */
.home-seo-preview h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #F9FAFF;
}
.home-seo-preview h3 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #F9FAFF;
}
.home-seo-preview p {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 10px;
    color: #AAADBE;
}
.home-seo-preview a {
    color: #6842FF;
    font-weight: 600;
    text-decoration: none;
}
.home-seo-preview a:hover {
    color: #8862FF;
    text-decoration: underline;
}

@media (max-width: 768px) {
  body, html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  .arcade-layout,
  .arcade-main,
  .arcade-content,
  .arcade-topbar {
    max-width: 100vw !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .topbar-logo-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
  }

  .cta-row {
    overflow-x: hidden;
  }
}

/* ── PWA INSTALL BANNER ────────────────────────── */
.pwa-banner {
    width: 100%;
    background: linear-gradient(135deg, #6842FF 0%, #8B5CF6 100%);
    color: #F9FAFF;
    padding: 12px 20px;
    z-index: 40;
    position: sticky;
    top: 0;
}

.pwa-banner-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.pwa-banner-icon {
    border-radius: 10px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.pwa-banner-emoji {
    font-size: 28px;
    flex-shrink: 0;
}

.pwa-banner-text {
    flex: 1;
    min-width: 0;
}

.pwa-banner-text strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
}

.pwa-banner-text span {
    display: block;
    font-size: 12px;
    opacity: 0.85;
}

.pwa-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-banner-btn {
    border: none;
    border-radius: 20px;
    padding: 8px 18px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s, opacity 0.15s;
}

.pwa-banner-btn:active {
    transform: scale(0.96);
}

.pwa-btn-install {
    background: #F9FAFF;
    color: #6842FF;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.pwa-btn-dismiss {
    background: rgba(255,255,255,0.15);
    color: #F9FAFF;
    border: 1px solid rgba(255,255,255,0.3);
}

.pwa-btn-dismiss:hover {
    background: rgba(255,255,255,0.25);
}

@media (max-width: 768px) {
    .pwa-banner {
        padding: 12px 14px;
    }
    .pwa-banner-inner {
        flex-wrap: wrap;
    }
    .pwa-banner-text {
        flex: 1 1 0;
        min-width: 120px;
    }
    .pwa-banner-text strong {
        font-size: 13px;
    }
    .pwa-banner-text span {
        font-size: 11px;
    }
    .pwa-banner-actions {
        width: 100%;
        gap: 8px;
    }
    .pwa-banner-btn {
        flex: 1;
        text-align: center;
        padding: 10px 12px;
        font-size: 13px;
    }
}
