/* ==========================================
   Poki Games - CrazyGames-Inspired Dark Theme
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
    --bg-primary: #0C0D14;
    --bg-secondary: #111219;
    --bg-card: #1A1B28;
    --bg-card-hover: #212233;
    --bg-nav: #0C0D14;
    --bg-sidebar: #0A0B12;
    --accent: #6C5CE7;
    --accent-hover: #8B7CF7;
    --accent-glow: rgba(108, 92, 231, 0.25);
    --text-primary: #F0F0F7;
    --text-secondary: #AAADBE;
    --text-muted: #6B6D7B;
    --border: #1E1F2E;
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --sidebar-width: 240px;
    --transition: all 0.25s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
    font-weight: 600;
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--text-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

/* ===== SIDEBAR ===== */
.site-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    z-index: 1001;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    transition: transform 0.3s ease;
}

.site-sidebar::-webkit-scrollbar { width: 4px; }
.site-sidebar::-webkit-scrollbar-track { background: transparent; }
.site-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-brand {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-brand .logo-text {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text-primary);
}

.sidebar-brand img { height: 32px; }

.sidebar-nav { padding: 12px 0; }

.sidebar-section {
    padding: 0 12px;
    margin-bottom: 8px;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 12px 6px;
}

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

.sidebar-link:hover {
    background: rgba(108, 92, 231, 0.1);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

.sidebar-link .cat-count {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
}

/* ===== TOP NAVBAR ===== */
.top-navbar {
    position: sticky;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: 60px;
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 1000;
    margin-left: var(--sidebar-width);
    backdrop-filter: blur(12px);
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
}

.search-box {
    position: relative;
    max-width: 480px;
    flex: 1;
}

.search-box input {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 50px;
    padding: 9px 18px 9px 40px;
    width: 100%;
    font-size: 14px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    transition: var(--transition);
}

.search-box input::placeholder { color: var(--text-muted); }

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-card);
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.search-results-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1002;
    display: none;
    box-shadow: 0 12px 40px rgba(0,0,0,.5);
}

.search-results-dropdown.show { display: block; }

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    color: var(--text-primary);
}

.search-result-item:hover { background: var(--bg-card-hover); }
.search-result-item img { width: 48px; height: 27px; border-radius: 6px; object-fit: cover; }
.search-result-item .title { font-weight: 700; font-size: 13px; }
.search-result-item .cat { font-size: 11px; color: var(--text-muted); }

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-right a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 50px;
    transition: var(--transition);
}

.nav-right a:hover { background: var(--bg-card); color: var(--text-primary); }

/* ===== MAIN CONTENT AREA ===== */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 24px;
    min-height: 100vh;
}

/* ===== SECTION HEADER ===== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.section-title i { color: var(--accent); font-size: 1rem; }

.view-more {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.view-more:hover { color: var(--accent); }

/* ===== CAROUSEL ===== */
.game-carousel-wrapper {
    position: relative;
    margin-bottom: 32px;
}

.game-carousel {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.game-carousel::-webkit-scrollbar { display: none; }

.game-carousel .game-card {
    min-width: 200px;
    max-width: 220px;
    flex-shrink: 0;
}

.game-carousel .game-card.game-card-lg {
    min-width: 260px;
    max-width: 280px;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
}

.game-carousel-wrapper:hover .carousel-arrow {
    opacity: 1;
    pointer-events: auto;
}

.carousel-arrow:hover { background: var(--accent); border-color: var(--accent); }
.carousel-arrow.arrow-left { left: -8px; }
.carousel-arrow.arrow-right { right: -8px; }

/* ===== GAME GRID ===== */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

/* ===== BENTO GRID (Desktop Featured) ===== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: auto;
    gap: 8px;
    margin-bottom: 32px;
}

.bento-grid .game-card:first-child {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}

.bento-grid .game-card:first-child .thumb {
    aspect-ratio: auto;
    height: 100%;
}

.bento-grid .game-card:first-child .card-title-overlay {
    padding: 40px 16px 14px;
}

.bento-grid .game-card:first-child .card-game-title {
    font-size: 20px;
}

.bento-grid .game-card-grid .thumb {
    aspect-ratio: 1/1;
}

/* ===== SEE MORE BUTTON ===== */
.see-more-btn {
    display: block;
    text-align: center;
    padding: 12px 24px;
    margin: 16px auto 0;
    background: var(--accent);
    color: #fff;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    max-width: 280px;
    transition: background 0.2s, transform 0.2s;
}
.see-more-btn:hover { background: var(--accent-hover); transform: scale(1.03); color: #fff; }
.see-more-btn i { margin-right: 6px; }

/* ===== FEATURED HERO CARD (Mobile) ===== */
.featured-hero-card {
    display: block;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 16px;
    background: var(--bg-card);
}

.featured-hero-bg {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
}

.featured-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-hero-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(transparent, rgba(0,0,0,.8));
}

.featured-hero-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
}

.featured-hero-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 2px solid rgba(255,255,255,.2);
}

.featured-hero-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-hero-icon i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--text-muted);
    font-size: 18px;
}

.featured-hero-text {
    flex: 1;
    min-width: 0;
}

.featured-hero-title {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

.featured-hero-play {
    background: #10B981;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    padding: 8px 20px;
    border-radius: 50px;
    flex-shrink: 0;
}

.featured-hero-card:hover .featured-hero-play {
    background: #059669;
}

/* Hide featured hero on desktop, show on mobile */
.mobile-featured-hero { display: none; }
.desktop-bento { display: block; }

/* ===== GAME CARD ===== */
.game-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background: var(--bg-card);
    display: block;
}

.game-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    z-index: 2;
}

.game-card .thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bg-secondary);
}

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

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

/* Title overlay on thumbnail */
.card-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 10px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,.85));
}

.card-game-title {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
}

.game-card-lg .card-game-title { font-size: 14px; }

/* ===== GRID CARD VARIANT (square, title below) ===== */
.game-card.game-card-grid {
    border-radius: 14px;
    background: transparent;
}

.game-card.game-card-grid .thumb {
    aspect-ratio: 1/1;
    border-radius: 14px;
}

.card-title-below {
    padding: 8px 6px 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Badges */
.badge-hot {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #FF6B35;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 3;
}

.badge-new {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #10B981;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 3;
}

.badge-hot + .badge-new { left: auto; right: 8px; }

.badge-updated {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #3B82F6;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    z-index: 3;
}

/* No thumbnail placeholder */
.no-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1A1B28, #212233);
    color: var(--text-muted);
    font-size: 28px;
}

/* ===== GAME PLAYER PAGE ===== */
.game-player-wrapper {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    margin-bottom: 0;
}

.game-player-wrapper iframe { display: block; }

/* Game Preview (Play button overlay) */
.game-preview {
    position: relative;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-preview-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.3);
    transform: scale(1.1);
}

.game-preview-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 20px;
}

.game-preview-icon {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    border: 3px solid rgba(255,255,255,.15);
}

.game-preview-icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 36px;
}

.game-preview-title {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 900;
    text-align: center;
    text-shadow: 0 2px 12px rgba(0,0,0,.7);
    margin: 0;
}

.game-play-btn {
    background: #2ecc40;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 48px;
    font-size: 18px;
    font-weight: 900;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 20px rgba(46,204,64,.4);
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-play-btn:hover {
    background: #27ae60;
    transform: scale(1.05);
    box-shadow: 0 6px 28px rgba(46,204,64,.5);
}

.game-play-btn i { font-size: 16px; }

/* Action Bar */
.game-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 10px 16px;
    margin-bottom: 20px;
}

.game-action-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.game-action-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.game-action-icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 14px;
}

.game-action-title {
    font-weight: 800;
    font-size: 15px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-action-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.game-action-plays {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 8px;
}

.game-action-plays i { color: var(--accent); font-size: 11px; }

.game-action-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.game-action-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.game-action-btn.liked { color: #e94560; }
.game-action-btn.liked:hover { background: #e94560; color: #fff; }

/* Two-column game layout */
.game-layout {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.game-info-section {
    flex: 1;
    min-width: 0;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    align-self: flex-start;
}

.game-info-section h1 {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 8px;
}

.game-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }

.game-meta-badge {
    background: var(--accent);
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}
.game-meta-badge:hover { opacity: .85; color: #fff; }

.game-meta-item {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.game-meta-item i { color: var(--accent); }

.game-description { color: var(--text-secondary); font-size: 14px; line-height: 1.7; margin-top: 12px; }
.game-description h3 { color: var(--text-primary); font-size: 1rem; font-weight: 900; margin-top: 16px; margin-bottom: 8px; }

.game-desc-collapsed { max-height: 120px; overflow: hidden; position: relative; }
.game-desc-collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(transparent, var(--bg-card));
    pointer-events: none;
}

.show-more-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 0;
    font-family: 'Nunito', sans-serif;
    display: flex;
    align-items: center;
    gap: 5px;
}
.show-more-btn:hover { text-decoration: underline; }
.show-more-btn i { transition: transform .2s; font-size: 11px; }
.show-more-btn.expanded i { transform: rotate(180deg); }

.game-instructions { margin-top: 16px; }

.game-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.game-tag {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid var(--border);
    transition: var(--transition);
}
.game-tag:hover { border-color: var(--accent); color: var(--accent); }

/* Related Games Sidebar (desktop) */
.game-sidebar {
    width: 320px;
    flex-shrink: 0;
    align-self: flex-start;
    position: sticky;
    top: 70px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.game-sidebar-header {
    margin-bottom: 12px;
}

.game-sidebar-header h3 {
    font-size: 1rem;
    font-weight: 900;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.game-sidebar-header h3 i { color: var(--accent); }

.game-sidebar-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* Mobile related carousel (hidden on desktop) */
.game-related-mobile { display: none; }

/* ===== PAGINATION ===== */
.pagination { margin-top: 24px; }
.pagination .page-link {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-secondary);
    border-radius: 6px;
    margin: 0 2px;
    font-weight: 700;
    font-size: 13px;
    transition: var(--transition);
}

.pagination .page-link:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ===== BREADCRUMB ===== */
.breadcrumb { background: none; padding: 0; margin-bottom: 14px; }
.breadcrumb-item a { color: var(--text-muted); font-size: 13px; font-weight: 700; }
.breadcrumb-item a:hover { color: var(--accent); }
.breadcrumb-item.active { color: var(--text-muted); font-size: 13px; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

/* ===== FOOTER ===== */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 40px 0 20px;
    margin-top: 60px;
    margin-left: var(--sidebar-width);
}

.site-footer h5 { color: var(--text-primary); font-size: 15px; font-weight: 800; margin-bottom: 14px; }
.site-footer a { color: var(--text-muted); font-size: 13px; font-weight: 600; }
.site-footer a:hover { color: var(--accent); }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 16px; text-align: center; color: var(--text-muted); font-size: 12px; }

/* ===== AD SLOTS ===== */
.ad-slot { text-align: center; margin: 16px 0; overflow: hidden; }
.ad-header { margin-bottom: 20px; }
.ad-footer { margin-top: 20px; }
.ad-sidebar { margin-bottom: 20px; }
.ad-before_game, .ad-after_game { margin: 12px 0; }

/* ===== STATIC PAGE ===== */
.page-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 30px;
    border: 1px solid var(--border);
    line-height: 1.8;
    color: var(--text-secondary);
}

.page-content h1, .page-content h2, .page-content h3 { color: var(--text-primary); font-weight: 900; margin-bottom: 12px; }
.page-content p { margin-bottom: 14px; }
.page-content a { color: var(--accent); }

/* ===== MOBILE BOTTOM NAV ===== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #12131C;
    border-top: 1px solid var(--border);
    z-index: 1001;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    padding: 6px 10px;
    transition: var(--transition);
    position: relative;
}

.mobile-bottom-nav a i { font-size: 20px; }
.mobile-bottom-nav a.active { color: var(--accent); }
.mobile-bottom-nav a.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--accent);
    border-radius: 0 0 3px 3px;
}
.mobile-bottom-nav a:hover { color: var(--accent); }

/* ===== MOBILE SEARCH OVERLAY ===== */
.mobile-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 1100;
    flex-direction: column;
    padding: 0;
}

.mobile-search-overlay.show { display: flex; }

.mobile-search-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: #12131C;
}

.mobile-search-header .back-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

.mobile-search-header input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 50px;
    padding: 10px 18px;
    font-size: 15px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
}

.mobile-search-header input::placeholder { color: var(--text-muted); }
.mobile-search-header input:focus { outline: none; border-color: var(--accent); }

.mobile-search-results {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0;
}

.mobile-search-results .search-result-item {
    padding: 12px 16px;
}

.mobile-search-results .search-result-item img {
    width: 56px;
    height: 32px;
    border-radius: 8px;
}

.mobile-search-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.mobile-search-empty i { font-size: 40px; margin-bottom: 12px; display: block; color: var(--border); }

/* ===== MOBILE BROWSE SHEET ===== */
.mobile-browse-sheet {
    display: none;
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    max-height: 60vh;
    background: #12131C;
    border-top: 1px solid var(--border);
    border-radius: 18px 18px 0 0;
    z-index: 1050;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.mobile-browse-sheet.show { display: flex; }

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

.browse-sheet-header h3 {
    font-size: 16px;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0;
}

.browse-sheet-header .close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

.browse-sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.browse-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    background: var(--bg-card);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    transition: var(--transition);
    border: 1px solid transparent;
}

.browse-chip i { font-size: 20px; color: var(--accent); }
.browse-chip:hover { border-color: var(--accent); color: var(--text-primary); background: var(--bg-card-hover); }

.browse-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1049;
}
.browse-overlay.show { display: block; }

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 1000;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .game-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .bento-grid { grid-template-columns: repeat(3, 1fr); }
    .game-carousel .game-card { min-width: 170px; max-width: 190px; }
    .game-carousel .game-card.game-card-lg { min-width: 220px; max-width: 240px; }
}

@media (max-width: 768px) {
    .site-sidebar { transform: translateX(-100%); }
    .site-sidebar.show { transform: translateX(0); }

    .top-navbar { margin-left: 0; left: 0; height: 50px; padding: 0 12px; gap: 10px; }
    .main-content { margin-left: 0; padding: 12px; padding-bottom: 76px; }
    .site-footer { margin-left: 0; }

    .mobile-menu-btn { display: block; font-size: 24px; padding: 6px; }
    .mobile-bottom-nav { display: flex; }
    .sidebar-overlay.show { display: block; }

    /* Cards: rounder, shadow, stronger gradient */
    .game-card { border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
    .card-title-overlay { padding: 28px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,.9)); }
    .card-game-title { font-size: 12px; }

    /* Grid: 2 columns with big cards on mobile */
    .game-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .game-card-grid { border-radius: 12px; }
    .game-card-grid .thumb { border-radius: 12px; }
    .card-title-below { font-size: 14px; padding: 8px 6px 4px; }

    /* Featured hero visible on mobile, bento hidden */
    .mobile-featured-hero { display: block; }
    .desktop-bento { display: none; }

    /* Bento grid fallback to scroll on mobile */
    .bento-grid { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .bento-grid::-webkit-scrollbar { display: none; }
    .bento-grid .game-card { min-width: 150px; max-width: 170px; flex-shrink: 0; scroll-snap-align: start; }

    /* Carousel: snap scroll, no scrollbar */
    .game-carousel { scroll-snap-type: x mandatory; -ms-overflow-style: none; }
    .game-carousel .game-card { min-width: 150px; max-width: 170px; scroll-snap-align: start; }
    .game-carousel .game-card.game-card-lg { min-width: 200px; max-width: 220px; scroll-snap-align: start; }

    .game-info-section { padding: 14px; }
    .game-info-section h1 { font-size: 1.15rem; }
    .section-title { font-size: 15px; }
    .section-header { margin-bottom: 10px; }
    .view-more { font-size: 12px; }
    .nav-right { display: none; }

    .carousel-arrow { display: none; }

    /* Game page: single column, edge-to-edge player */
    .game-player-wrapper { border-radius: 0; margin-left: -12px; margin-right: -12px; }
    .game-action-bar { margin-left: -12px; margin-right: -12px; border-radius: 0; border-left: none; border-right: none; margin-bottom: 12px; }
    .game-layout { flex-direction: column; gap: 12px; }
    .game-sidebar { display: none; }
    .game-related-mobile { display: block; }

    .game-preview-icon { width: 72px; height: 72px; border-radius: 16px; }
    .game-preview-title { font-size: 1.2rem; }
    .game-play-btn { padding: 12px 36px; font-size: 16px; }

    /* Game meta compact */
    .game-meta { gap: 8px; margin-bottom: 10px; }
    .game-meta-item { font-size: 12px; }

    /* Carousel wrapper edge-to-edge */
    .game-carousel-wrapper { margin-left: -12px; margin-right: -12px; }
    .game-carousel { padding-left: 12px; padding-right: 12px; }
    .game-carousel-wrapper .section-header { padding-left: 12px; padding-right: 12px; }

    /* Search box full width */
    .search-box { max-width: none; }
    .search-box input { font-size: 13px; padding: 8px 14px 8px 36px; }
}

@media (max-width: 480px) {
    .game-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .card-title-below { font-size: 12px; padding: 6px 4px 3px; }
    .main-content { padding: 10px; padding-bottom: 76px; }

    .game-carousel .game-card { min-width: 135px; max-width: 155px; }
    .game-carousel .game-card.game-card-lg { min-width: 180px; max-width: 200px; }

    /* Carousel edge padding */
    .game-carousel { padding-left: 10px; padding-right: 10px; }
    .game-carousel-wrapper .section-header { padding-left: 10px; padding-right: 10px; }
    .game-carousel-wrapper { margin-left: -10px; margin-right: -10px; }

    .game-player-wrapper { margin-left: -10px; margin-right: -10px; }
    .game-action-bar { margin-left: -10px; margin-right: -10px; }
    .game-info-section { padding: 12px; border-radius: 10px; }
    .game-info-section h1 { font-size: 1.1rem; }

    /* Browse sheet 2 columns on tiny screens */
    .browse-sheet-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== LOADING ===== */
.game-card img { background: var(--bg-secondary); }
img[loading="lazy"] { opacity: 0; transition: opacity 0.3s; }
img.loaded, img[loading="lazy"][src] { opacity: 1; }
