/* ==========================================================================
   QuickPlayHub - Modern Dark Gaming Theme (Inspired by k4.games)
   ========================================================================== */

:root {
    --bg-main: #131324;
    --bg-surface: #1a1a2e;
    --bg-surface-elevated: #24243e;
    --bg-pill: #2c2c4e;
    --bg-glass: rgba(26, 26, 46, 0.85);

    --accent-purple: #a855f7;
    --accent-purple-dark: #6b21a8;
    --accent-gradient: linear-gradient(135deg, #5f3dc4, #40397e, #2c2c4a);
    --btn-gradient: linear-gradient(135deg, #8b5cf6, #d946ef);
    --glow-gradient: linear-gradient(135deg, #00f0ff, #a855f7, #ec4899);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.45);

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(168, 85, 247, 0.4);

    --header-height: 60px;
    --sidebar-width: 68px;
    --sidebar-expanded-width: 220px;
    --drawer-width: 380px;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-card: 15px;
    --radius-full: 9999px;

    --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(168, 85, 247, 0.35);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* Fonts — matching k4.games (Geist + Geist Mono by Vercel) */
    --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'Geist Mono', 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

/* Monospace elements use Geist Mono */
code, kbd, pre, samp {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* Base resets */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: var(--header-height);
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    outline: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #0d0d17;
}
::-webkit-scrollbar-thumb {
    background: #2a2a46;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3e3e68;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* ==========================================================================
   Fixed Header (k4.games style)
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 50;
    padding: 0 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
}

.header-container {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}
.sidebar-toggle-btn:hover {
    background: var(--bg-pill);
    color: var(--text-primary);
}

.brand-logo {
    display: flex;
    align-items: center;
    height: 36px;
}
.brand-logo img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

/* Header Search */
.header-center {
    flex: 1;
    max-width: 580px;
    display: none;
}
@media (min-width: 768px) {
    .header-center {
        display: block;
    }
}

.search-pill {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background: var(--bg-pill);
    border-radius: var(--radius-full);
    padding: 8px 18px;
    border: 1px solid transparent;
    transition: var(--transition);
}
.search-pill:focus-within {
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

.search-pill input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    padding-right: 28px;
}
.search-pill input::placeholder {
    color: var(--text-secondary);
}
.search-pill .search-icon {
    position: absolute;
    right: 14px;
    color: var(--text-secondary);
    pointer-events: none;
}

/* Header Right Actions */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: var(--bg-pill);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.icon-btn:hover {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    transform: translateY(-1px);
}
.icon-btn.active {
    color: var(--accent-purple);
    border: 1px solid var(--accent-purple);
}

.badge-count {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ec4899;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-surface);
}

.btn-surprise {
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--accent-gradient);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: var(--transition);
}
.btn-surprise:hover {
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
    transform: scale(1.03);
}
@media (min-width: 900px) {
    .btn-surprise {
        display: flex;
    }
}

/* ==========================================================================
   Left Sidebar Navigation (Desktop Icon Bar + Mobile Drawer)
   ========================================================================== */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 45;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.site-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    z-index: 46;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
}

/* Hover expand on desktop */
@media (min-width: 1024px) {
    .site-sidebar.expanded {
        width: var(--sidebar-expanded-width);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
    }
}

/* Mobile Sidebar Drawer */
@media (max-width: 1023px) {
    .site-sidebar {
        width: 260px;
        transform: translateX(-100%);
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.6);
    }
    .site-sidebar.mobile-open {
        transform: translateX(0);
    }
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 12px 8px;
    gap: 6px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
}
.sidebar-nav-item:hover {
    background: var(--accent-gradient);
    color: var(--text-primary);
}
.sidebar-nav-item.active {
    background: var(--accent-gradient);
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(95, 61, 196, 0.4);
}

.sidebar-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}
.sidebar-nav-item:hover .sidebar-icon,
.sidebar-nav-item.active .sidebar-icon {
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-label {
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.2s, transform 0.2s;
}
@media (max-width: 1023px) {
    .sidebar-label {
        opacity: 1;
        transform: translateX(0);
    }
}
.site-sidebar.expanded .sidebar-label {
    opacity: 1;
    transform: translateX(0);
}

.sidebar-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 8px 4px;
}

/* Tooltip on desktop collapsed sidebar removed per user request */
.site-sidebar .sidebar-nav-item::after,
.site-sidebar .sidebar-nav-item::before {
    display: none !important;
    content: none !important;
}


/* ==========================================================================
   Main Page Layout
   ========================================================================== */
.main-wrapper {
    margin-left: 0;
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (min-width: 1024px) {
    .main-wrapper {
        margin-left: var(--sidebar-width);
    }
}

.content-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 24px 20px 60px;
    width: 100%;
}

/* ==========================================================================
   Carousels & Horizontal Game Trays (k4.games style)
   ========================================================================== */
.carousel-section {
    position: relative;
    margin-bottom: 36px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 0 4px;
}

.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title-wrap h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}
.section-title-wrap .title-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-purple);
}

.section-view-all {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-purple);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}
.section-view-all:hover {
    color: #ffffff;
    transform: translateX(3px);
}

/* Carousel Track & Navigation Arrows */
.carousel-container {
    position: relative;
    overflow: visible;
}

.carousel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 8px 4px 16px;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
}

.carousel-track.is-dragging {
    cursor: grabbing !important;
    scroll-snap-type: none !important;
    scroll-behavior: auto !important;
}

.carousel-track.is-dragging a,
.carousel-track.is-dragging .game-card {
    pointer-events: none;
}

.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.2s ease;
}
.carousel-container:hover .carousel-nav-btn {
    opacity: 0.95;
    pointer-events: auto;
}
.carousel-nav-btn:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 24px rgba(168, 85, 247, 0.5);
}
.carousel-nav-prev {
    left: -12px;
}
.carousel-nav-next {
    right: -12px;
}

/* ==========================================================================
   Game Cards System (Square, Portrait, Hero)
   ========================================================================== */

/* 1. Square Game Card (125px x 125px on k4.games) */
.card-square {
    flex-shrink: 0;
    width: 125px;
    height: 125px;
    border-radius: var(--radius-card);
    overflow: hidden;
    position: relative;
    background: var(--bg-surface);
    box-shadow: var(--shadow-card);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
    cursor: pointer;
}
.card-square img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.card-square:hover {
    transform: scale(1.07);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7), 0 0 20px rgba(168, 85, 247, 0.4);
    z-index: 5;
}
.card-square:hover img {
    transform: scale(1.08);
}
.card-square .card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.85) 100%);
    display: flex;
    align-items: flex-end;
    padding: 8px;
    opacity: 0.9;
}
.card-square .card-title {
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* 2. Portrait Game Card (170px x 250px) */
.card-portrait {
    flex-shrink: 0;
    width: 180px;
    height: 250px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    background: var(--bg-surface);
    box-shadow: var(--shadow-card);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
    cursor: pointer;
    border: 1px solid var(--border-subtle);
}
.card-portrait:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.8), 0 0 25px rgba(168, 85, 247, 0.4);
    border-color: var(--border-highlight);
    z-index: 5;
}
.card-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.card-portrait:hover img {
    transform: scale(1.06);
}
.card-portrait .card-details {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 12px 10px;
    background: linear-gradient(180deg, rgba(19, 19, 36, 0) 0%, rgba(19, 19, 36, 0.95) 60%, #131324 100%);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.card-portrait .card-title {
    font-size: 14px;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-portrait .card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
}
.card-portrait .card-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #facc15;
    font-weight: 700;
}
.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: rgba(19, 19, 36, 0.85);
    backdrop-filter: blur(4px);
    color: var(--accent-purple);
    border: 1px solid var(--border-highlight);
    z-index: 2;
}

/* 2b. Giant rank numeral for "Top 10 Games" — sits behind/left of its card,
   overlapping the previous card's edge. */
.rank-number {
    flex-shrink: 0;
    align-self: flex-end;
    font-family: 'Geist', Arial, Helvetica, sans-serif;
    font-size: 112px;
    font-weight: 900;
    line-height: 1;
    color: rgba(255, 255, 255, 0.1);
    -webkit-text-stroke: 1px rgba(168, 85, 247, 0.18);
    margin: 0 -34px 6px 4px;
    position: relative;
    z-index: 0;
    user-select: none;
    pointer-events: none;
}
.card-portrait.ranked {
    position: relative;
    z-index: 1;
}
@media (max-width: 600px) {
    .rank-number {
        font-size: 80px;
        margin: 0 -22px 4px 2px;
    }
}

/* 3. Hero Featured Banner (240px x 320px or Full Split) */
.featured-hero-row {
    margin-bottom: 40px;
}
.hero-card {
    position: relative;
    flex-shrink: 0;
    width: 250px;
    height: 330px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-surface);
    box-shadow: var(--shadow-card);
    transition: transform 0.25s ease, box-shadow 0.25s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.hero-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(168, 85, 247, 0.4);
    border-color: var(--accent-purple);
}
.hero-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(11, 14, 20, 0.95) 85%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 18px;
}
.hero-title {
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 4px;
}
.hero-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.btn-play-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--btn-gradient);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 800;
    width: fit-content;
}

/* ==========================================================================
   Split Promo Section ("Play with friends!" banner from k4.games)
   ========================================================================== */
.promo-split-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}
@media (min-width: 1024px) {
    .promo-split-section {
        flex-direction: row;
        align-items: stretch;
    }
}

.promo-banner {
    flex: 1;
    max-width: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 10px 30px rgba(95, 61, 196, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
@media (min-width: 1024px) {
    .promo-banner {
        max-width: 360px;
    }
}
.promo-banner h2 {
    font-size: 28px;
    font-weight: 900;
    line-height: 1.15;
    color: #ffffff;
}
.promo-banner-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    margin-top: 10px;
}
.promo-banner-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.promo-grid-wrap {
    flex: 2;
    position: relative;
    overflow: hidden;
}
.promo-grid-scroll {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 152px;
    grid-template-rows: repeat(2, 96px);
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
}
.promo-mini-card {
    width: 152px;
    height: 96px;
    border-radius: var(--radius-md);
    background: var(--bg-pill);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
}
.promo-mini-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-highlight);
    background: var(--bg-surface-elevated);
}
.promo-mini-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent-purple);
    flex-shrink: 0;
}
.promo-mini-icon svg {
    width: 20px;
    height: 20px;
}
.promo-mini-label {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    line-height: 1.2;
    padding: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
@media (max-width: 600px) {
    .promo-grid-scroll {
        grid-auto-columns: 128px;
        grid-template-rows: repeat(2, 88px);
    }
    .promo-mini-card { width: 128px; height: 88px; }
}

/* ==========================================================================
   Right Slide-Over "My Games" Drawer (k4.games exact structure)
   ========================================================================== */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 58;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.my-games-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: var(--drawer-width);
    max-width: 90vw;
    background-color: var(--bg-surface);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.7);
    z-index: 59;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid var(--border-subtle);
}
.my-games-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-subtle);
}
.drawer-header h2 {
    font-size: 18px;
    font-weight: 800;
}
.drawer-close-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}
.drawer-close-btn:hover {
    background: var(--bg-pill);
    color: #ffffff;
}

/* Drawer Tabs */
.drawer-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-subtle);
}
.drawer-tab {
    flex: 1;
    padding: 14px 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
    position: relative;
    transition: color 0.2s;
}
.drawer-tab:hover {
    color: var(--text-primary);
}
.drawer-tab.active {
    color: #ffffff;
}
.drawer-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--accent-purple);
    border-radius: 3px;
    box-shadow: 0 0 10px var(--accent-purple);
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.drawer-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-muted);
    padding: 24px;
}
.drawer-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 12px rgba(168, 85, 247, 0.4));
}
.drawer-empty-text {
    font-size: 14px;
    line-height: 1.5;
    max-width: 240px;
}

.drawer-game-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    transition: var(--transition);
    border: 1px solid transparent;
}
.drawer-game-item:hover {
    border-color: var(--border-highlight);
    transform: translateX(4px);
}
.drawer-game-thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
}
.drawer-game-info {
    flex: 1;
    overflow: hidden;
}
.drawer-game-title {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.drawer-game-category {
    font-size: 11px;
    color: var(--accent-purple);
    font-weight: 600;
}
.drawer-game-remove {
    color: var(--text-muted);
    padding: 4px;
    transition: color 0.2s;
}
.drawer-game-remove:hover {
    color: #ef4444;
}

/* ==========================================================================
   Live Search Modal / Autocomplete
   ========================================================================== */
.search-modal {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    width: 600px;
    max-width: 92vw;
    background: var(--bg-surface);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), var(--shadow-glow);
    z-index: 65;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.search-modal.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.search-modal-header {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
}
.search-modal-header input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
}
.search-results-list {
    max-height: 380px;
    overflow-y: auto;
    padding: 8px;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.search-result-item:hover,
.search-result-item.selected {
    background: var(--bg-pill);
}
.search-result-item img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
}

/* ==========================================================================
   Ad Zone Placeholders
   ========================================================================== */
.ad-slot-container {
    background: rgba(26, 26, 46, 0.6);
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
    padding: 12px;
    margin: 24px 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.ad-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.ad-banner-leaderboard {
    width: 100%;
    max-width: 728px;
    height: 90px;
    background: linear-gradient(90deg, #151828 0%, #1e2438 50%, #151828 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}
.ad-native-box {
    width: 100%;
    height: 100%;
    min-height: 180px;
    background: #1a1a2e;
    border: 1px dashed rgba(168, 85, 247, 0.3);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* ==========================================================================
   Game Play View & Theater Player
   ========================================================================== */
.game-play-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.player-theater-wrapper {
    position: relative;
    width: 100%;
    background: #090c13;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
    border: 1px solid var(--border-subtle);
    transition: var(--transition);
}

.player-frame-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect */
    background: #000;
}
.player-frame-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.player-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 12px;
}

.player-game-info {
    display: flex;
    align-items: center;
    gap: 14px;
}
.player-game-info img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
}
.player-game-title {
    font-size: 18px;
    font-weight: 800;
}
.player-game-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
}

.player-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-pill);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    transition: var(--transition);
}
.btn-action:hover {
    background: var(--bg-surface-elevated);
    color: #ffffff;
}
.btn-action.liked {
    color: #ec4899;
    background: rgba(236, 72, 153, 0.15);
}
.btn-action.favorited {
    color: #facc15;
    background: rgba(250, 204, 21, 0.15);
}

/* Fullscreen / Theater Mode styling */
.player-theater-wrapper.theater-mode {
    position: fixed;
    inset: 0;
    z-index: 100;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}
.player-theater-wrapper.theater-mode .player-frame-container {
    flex: 1;
    padding-top: 0;
    height: calc(100vh - 65px);
}

/* Details & Instructions tabs */
.game-info-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.game-info-card h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--accent-purple);
}
.game-info-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}
.controls-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.control-key {
    background: var(--bg-pill);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #00f0ff;
}

/* ==========================================================================
   SEO Content Block & Footer
   ========================================================================== */
.seo-content-block {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-top: 40px;
    color: var(--text-secondary);
}
.seo-content-block h2 {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 14px;
}
.seo-content-block h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-purple);
    margin: 20px 0 8px;
}
.seo-content-block p {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 14px;
}

/* ==========================================================================
   Listing Pages (category.php, allcategories.php) & Page Header
   ========================================================================== */
.page-header {
    margin-bottom: 24px;
}
.breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.breadcrumb a {
    color: var(--text-secondary);
}
.breadcrumb a:hover {
    color: var(--accent-purple);
}
.page-header h1 {
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 8px;
}
.page-header p {
    color: var(--text-secondary);
    font-size: 14px;
    max-width: 720px;
}

.games-grid-page {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 18px;
}
@media (min-width: 1024px) {
    .games-grid-page {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}
.games-grid-page .card-portrait {
    width: 100%;
    height: 230px;
}

.empty-state-block {
    background: var(--bg-surface);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    color: var(--text-secondary);
}

.category-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.category-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px;
    transition: var(--transition);
}
.category-tile:hover {
    border-color: var(--border-highlight);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}
.category-tile .tile-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-purple);
    flex-shrink: 0;
}
.category-tile .tile-name {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
}
.category-tile .tile-count {
    font-size: 12px;
    color: var(--text-muted);
}

.site-footer {
    background: #0d0d18;
    border-top: 1px solid var(--border-subtle);
    padding: 48px 24px 24px;
    margin-top: auto;
}
.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    margin-bottom: 40px;
}
.footer-col h4 {
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}
.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-links a {
    color: var(--text-secondary);
    font-size: 13px;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: var(--accent-purple);
}
.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 99;
}
.toast {
    background: #1a1a2e;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-highlight);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}