/* =========================================================
   FixMode.in — Premium White Modern Design System
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
    --bg: #ffffff;
    --bg-soft: #fafafa;
    --bg-elev: #ffffff;
    --surface: #ffffff;
    --border: #ececec;
    --border-strong: #d4d4d4;

    --text: #0a0a0a;
    --text-2: #404040;
    --text-3: #737373;
    --text-muted: #a3a3a3;

    --accent: #0f172a;          /* premium near-black */
    --accent-2: #1e293b;
    --brand: #059669;           /* refined emerald */
    --brand-dark: #047857;
    --brand-soft: #ecfdf5;

    --gold: #b45309;
    --gold-soft: #fffbeb;

    --danger: #dc2626;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08), 0 4px 8px rgba(15, 23, 42, 0.04);
    --shadow-focus: 0 0 0 3px rgba(5, 150, 105, 0.15);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 999px;

    --header-h: 64px;

    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    font-size: 15px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    padding-bottom: 60px;
}

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

::selection { background: var(--brand); color: #fff; }

/* ---------- Header ---------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

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

.menu-btn, .icon-btn, .back-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text);
    transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.menu-btn svg, .icon-btn svg, .back-btn svg { stroke: var(--text); }
.menu-btn:hover, .icon-btn:hover, .back-btn:hover {
    background: var(--bg-soft);
}
.menu-btn:active, .icon-btn:active, .back-btn:active { transform: scale(0.96); }

.icon-btn.favorite-active svg { stroke: var(--danger); fill: var(--danger); }

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 20px;
    filter: grayscale(0.1);
}

.dot { color: var(--brand); }

/* ---------- Search Overlay ---------- */
.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    flex-direction: column;
    padding: 20px;
}
.search-overlay.active { display: flex; }

.search-overlay .search-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 6px 6px 18px;
    box-shadow: var(--shadow-xs);
}
.search-overlay #searchInput {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 16px;
    padding: 12px 0;
    color: var(--text);
}
.search-overlay #searchInput::placeholder { color: var(--text-muted); }
.search-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    transition: background 0.2s;
}
.search-close:hover { background: var(--bg-soft); }
.search-close svg { stroke: var(--text-2); }

.search-results {
    margin-top: 20px;
    overflow-y: auto;
    flex: 1;
}
.search-hint, .no-results {
    text-align: center;
    color: var(--text-3);
    padding: 60px 20px;
    font-size: 14px;
}
.search-count {
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 14px;
    padding: 0 4px;
    font-weight: 500;
}
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.search-result-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    cursor: pointer;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s;
}
.search-result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}
.search-result-thumb {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 8px;
    font-size: 36px;
}
.search-result-thumb img { width: 100%; height: 100%; object-fit: cover; }
.search-result-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-category {
    font-size: 11px;
    color: var(--text-3);
    text-transform: capitalize;
}

/* ---------- Sidebar ---------- */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s var(--ease), visibility 0.25s;
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    background: #fff;
    z-index: 160;
    transform: translateX(-100%);
    transition: transform 0.32s var(--ease);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-right: 1px solid var(--border);
    box-shadow: 0 0 0 rgba(0,0,0,0);
}
.sidebar.open,
.sidebar.active {
    transform: translateX(0);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18), 0 8px 16px rgba(15, 23, 42, 0.08);
}

/* premium top brand block */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 22px 20px;
    background: linear-gradient(180deg, var(--bg-soft) 0%, #ffffff 100%);
    border-bottom: 1px solid var(--border);
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    position: sticky;
    top: 0;
    z-index: 2;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}
.sidebar-header strong { font-size: 16px; line-height: 1.1; }

/* nav links – refined with leading icon container & active accent strip */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 2px 12px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
    position: relative;
    transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
    -webkit-tap-highlight-color: transparent;
}
.sidebar-link:hover {
    background: var(--bg-soft);
    color: var(--text);
}
.sidebar-link:active { transform: scale(0.98); }
.sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translate(-14px, -50%);
    width: 3px;
    height: 18px;
    background: var(--brand);
    border-radius: 0 3px 3px 0;
    opacity: 0;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.sidebar-link.active {
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-weight: 600;
}
.sidebar-link.active::before {
    opacity: 1;
    transform: translate(-14px, -50%) scaleY(1);
}
.sidebar-link.active .link-icon {
    background: #fff;
    box-shadow: var(--shadow-xs);
}

.sidebar-link .link-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.18s, transform 0.18s var(--ease);
}
.sidebar-link:hover .link-icon { background: #fff; box-shadow: var(--shadow-xs); }

.sidebar-link-small {
    font-size: 13px;
    padding: 9px 14px;
    color: var(--text-3);
    font-weight: 500;
}
.sidebar-link-small .link-icon {
    width: 26px;
    height: 26px;
    font-size: 13px;
    background: transparent;
}
.sidebar-link-small:hover { color: var(--text-2); }

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

.sidebar-section-title {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 26px 8px;
}

/* ---------- Promo Banner / Earn section ---------- */
.earn-section {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    padding: 20px;
}
.earn-label {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--text-3);
    text-transform: uppercase;
    margin-bottom: 14px;
}
.earn-buttons-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    justify-content: center;
    flex-wrap: wrap;
    scrollbar-width: none;
}
.earn-buttons-row::-webkit-scrollbar { display: none; }
.earn-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    box-shadow: var(--shadow-xs);
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s;
}
.earn-btn .btn-icon { font-size: 14px; }
.earn-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}
/* keep original variants but neutralize gradients */
.earn-btn-1, .earn-btn-2, .earn-btn-3,
.earn-btn-4, .earn-btn-5, .earn-btn-6 {
    background: #fff;
    color: var(--text);
}
.earn-btn-2 { color: var(--brand-dark); border-color: var(--brand-soft); }
.earn-btn-3 { color: var(--gold); border-color: var(--gold-soft); }

/* ---------- Hero Poster ---------- */
.hero-poster-wrap {
    display: block;
    margin: 24px auto 8px;
    max-width: 1100px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    background: #fff;
    aspect-ratio: 1024 / 220;
}
.hero-poster-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s var(--ease);
}
.hero-poster-wrap:hover img { transform: scale(1.03); }

.poster-overlay-badge {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    letter-spacing: 0.04em;
    box-shadow: var(--shadow-md);
    z-index: 2;
}

@media (max-width: 639px) {
    .hero-poster-wrap { aspect-ratio: 16 / 7; }
}
@media (min-width: 1200px) {
    .hero-poster-wrap { aspect-ratio: 1024 / 200; }
}

/* ---------- Category Tabs ---------- */
.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 16px 20px;
    background: var(--bg);
    scrollbar-width: none;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: var(--header-h);
    z-index: 50;
    backdrop-filter: blur(12px);
}
.category-tabs::-webkit-scrollbar { display: none; }
.tab-btn {
    flex-shrink: 0;
    padding: 9px 16px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s var(--ease);
}
.tab-btn:hover {
    border-color: var(--border-strong);
    color: var(--text);
}
.tab-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.tab-icon { font-size: 14px; }

/* ---------- Promo Grid ---------- */
.promo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 20px;
}
.promo-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s;
    box-shadow: var(--shadow-xs);
}
.promo-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}
.promo-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.promo-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.promo-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-3);
}
.promo-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.promo-desc {
    font-size: 11.5px;
    color: var(--text-3);
}
.promo-arrow {
    color: var(--text-muted);
    font-size: 18px;
    transition: transform 0.2s, color 0.2s;
}
.promo-card:hover .promo-arrow {
    color: var(--text);
    transform: translateX(2px);
}

/* tint promo categories subtly */
.promo-action .promo-icon  { background: #fef2f2; }
.promo-puzzle .promo-icon  { background: #eff6ff; }
.promo-racing .promo-icon  { background: #fffbeb; }
.promo-arcade .promo-icon  { background: #f5f3ff; }

/* ---------- Sections ---------- */
.game-section { padding: 8px 0 28px; }
.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 20px;
    margin-bottom: 14px;
}
.section-title-wrap { display: flex; flex-direction: column; gap: 2px; }
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.title-icon { font-size: 18px; }
.section-subtitle {
    font-size: 12px;
    color: var(--text-3);
    font-weight: 400;
}
.see-all {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    letter-spacing: 0.04em;
    transition: color 0.2s;
    white-space: nowrap;
}
.see-all:hover { color: var(--brand); }

/* ---------- Scroll Row & Game Grid ---------- */
.scroll-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 20px 12px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-row .game-card {
    flex-shrink: 0;
    width: 150px;
    scroll-snap-align: start;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    padding: 4px 20px;
}

.game-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), border-color 0.2s;
    box-shadow: var(--shadow-xs);
}
.game-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
}

.game-thumbnail {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 44px;
    position: relative;
}
.game-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease);
}
.game-card:hover .game-thumbnail img { transform: scale(1.06); }
.game-emoji, .fallback-emoji { font-size: 44px; }

.game-info {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.game-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 34px;
}
.game-category-mini {
    font-size: 11px;
    color: var(--text-3);
    text-transform: capitalize;
}

.game-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 50%, rgba(15, 23, 42, 0.7) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s var(--ease);
}
.game-card:hover .game-overlay { opacity: 1; }
.play-overlay-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transform: translateY(8px);
    transition: transform 0.25s var(--ease);
    font-size: 18px;
    font-weight: 700;
}
.game-card:hover .play-overlay-btn { transform: translateY(0); }

/* ---------- Feature Strip ---------- */
.feature-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 28px 20px;
    padding: 20px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.feature-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}
.feature-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: var(--shadow-xs);
}
.feature-text { display: flex; flex-direction: column; line-height: 1.2; }
.feature-text strong { font-size: 13px; font-weight: 600; color: var(--text); }
.feature-text span { font-size: 11px; color: var(--text-3); }

/* ---------- Footer ---------- */
.app-footer, .app-footer-main {
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    padding: 40px 20px 24px;
    margin-top: 40px;
}
.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    gap: 32px;
    grid-template-columns: 1fr;
}
@media (min-width: 720px) {
    .footer-content {
        grid-template-columns: 1.2fr 2fr;
    }
}
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.footer-tagline {
    font-size: 13px;
    color: var(--text-3);
    line-height: 1.5;
    max-width: 340px;
}
.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.footer-column { display: flex; flex-direction: column; gap: 10px; }
.footer-column h4 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.footer-column a {
    font-size: 13px;
    color: var(--text-3);
    transition: color 0.18s;
}
.footer-column a:hover { color: var(--brand); }

.footer-bottom {
    max-width: 1100px;
    margin: 32px auto 0;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    text-align: center;
}
.footer-bottom p {
    font-size: 12px;
    color: var(--text-3);
}
.footer-owner strong { color: var(--text-2); font-weight: 600; }

/* ---------- Page Loader ---------- */
.page-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
}
.page-loader.active { display: flex; }
.loader-spinner, .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- games.html specifics ---------- */
.search-container {
    margin: 16px 20px 8px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 14px;
    display: flex;
    align-items: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-container:focus-within {
    border-color: var(--brand);
    box-shadow: var(--shadow-focus);
}
.search-input {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    padding: 12px 0;
    color: var(--text);
}
.search-input::placeholder { color: var(--text-muted); }

.games-count {
    padding: 8px 20px 16px;
    font-size: 12px;
    color: var(--text-3);
    font-weight: 500;
}
.games-count span {
    color: var(--text);
    font-weight: 700;
}

.main-content { padding-top: 8px; }

/* ---------- game-player.html ---------- */
.game-player-container {
    position: relative;
    background: #0a0a0a;
    margin: 16px 20px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 4 / 5;
    max-height: 70vh;
}
.game-full-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
.loading-screen {
    position: absolute;
    inset: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--text-3);
    font-size: 13px;
    transition: opacity 0.3s;
    z-index: 2;
}
.loading-screen.hidden { opacity: 0; pointer-events: none; }

.game-info-section {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin: 20px;
    padding: 24px;
    box-shadow: var(--shadow-xs);
}
.game-details-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}
.game-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.game-category-badge {
    display: inline-flex;
    padding: 4px 12px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.game-controls {
    display: inline-flex;
    padding: 4px 12px;
    background: var(--bg-soft);
    color: var(--text-2);
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    font-weight: 500;
    border: 1px solid var(--border);
}
.game-description {
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 22px;
}
.game-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s, transform 0.2s var(--ease);
}
.action-btn:hover { background: var(--accent-2); transform: translateY(-1px); }
.action-btn:nth-child(2) {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}
.action-btn:nth-child(2):hover { background: var(--bg-soft); }

.related-section { padding: 16px 0 32px; }

/* ---------- about / blog / static page content ---------- */
.about-content,
.blog-content,
.contact-content,
.legal-content,
.privacy-content,
.terms-content,
.disclaimer-content {
    max-width: 760px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}
.about-section,
.legal-section {
    margin-bottom: 36px;
}
.about-section h2,
.legal-section h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    letter-spacing: -0.01em;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.about-section p,
.legal-section p {
    color: var(--text-2);
    font-size: 14.5px;
    line-height: 1.7;
    margin-bottom: 12px;
}

.about-features { margin-bottom: 36px; }
.about-features h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 18px;
    letter-spacing: -0.01em;
}
.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    transition: box-shadow 0.2s, transform 0.2s var(--ease);
}
.feature-item:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.feature-emoji {
    font-size: 24px;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.feature-item .feature-text h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.feature-item .feature-text p {
    font-size: 13px;
    color: var(--text-3);
    line-height: 1.5;
}

.owner-card {
    padding: 22px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.owner-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.owner-role {
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-dark);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.owner-card p { color: var(--text-2); font-size: 14px; line-height: 1.65; margin-bottom: 8px; }

.values-list {
    display: grid;
    gap: 10px;
}
.value-item {
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-2);
}
.value-item strong { color: var(--text); font-weight: 600; }

/* contact / blog generics */
.contact-content h1, .blog-content h1, .about-content h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 8px;
}
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-top: 18px;
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--brand);
    box-shadow: var(--shadow-focus);
}
.contact-form textarea { min-height: 120px; resize: vertical; }
.contact-form button,
.btn-primary {
    align-self: flex-start;
    padding: 12px 22px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s, transform 0.2s var(--ease);
}
.contact-form button:hover,
.btn-primary:hover { background: var(--accent-2); transform: translateY(-1px); }

/* blog cards */
.blog-list { display: grid; gap: 14px; margin-top: 18px; }
.blog-card {
    padding: 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: box-shadow 0.2s, transform 0.2s var(--ease);
}
.blog-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.blog-card h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.blog-card p { font-size: 13.5px; color: var(--text-3); line-height: 1.6; }

/* ---------- Featured Offers Image ---------- */
.offers-image-link {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
    -webkit-tap-highlight-color: transparent;
}
.offers-image-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.offers-image-link:active { transform: scale(0.99); }
.offers-image-link img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius);
}

/* =========================================================
   ADVANCED MOBILE-FIRST RESPONSIVE SYSTEM
   Breakpoints: 360 (small phone) | 480 (large phone) |
                640 (tablet) | 960 (laptop) | 1200 (desktop)
   ========================================================= */

/* ---- Base: Mobile-first (≤ 359px tiny phones) ---- */
:root {
    --pad-x: 16px;       /* horizontal padding scales up at breakpoints */
}

html { font-size: 15px; }

body {
    /* iOS safe-area support (notch / home indicator) */
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    width: 100%;
}

/* fluid headings using clamp(min, fluid, max) */
.section-title { font-size: clamp(16px, 4.2vw, 18px); }
.section-subtitle { font-size: clamp(11px, 3vw, 12px); }
.header-title { font-size: clamp(15px, 4.4vw, 17px); }
.game-name { font-size: clamp(12px, 3.4vw, 13px); }
.about-content h1, .contact-content h1, .blog-content h1 { font-size: clamp(22px, 6vw, 28px); }
.game-details-header h2 { font-size: clamp(18px, 5vw, 22px); }

/* ensure all interactive controls hit min 44px touch target */
.menu-btn, .icon-btn, .back-btn, .search-close,
.tab-btn, .earn-btn, .action-btn,
.contact-form button, .play-overlay-btn { min-height: 44px; }

/* horizontal padding tokens */
.app-header,
.category-tabs,
.earn-section,
.section-header,
.scroll-row,
.games-grid,
.promo-grid,
.games-count,
.search-container { padding-left: var(--pad-x); padding-right: var(--pad-x); }

.hero-poster-wrap,
.feature-strip,
.game-player-container,
.game-info-section { margin-left: var(--pad-x); margin-right: var(--pad-x); }

/* tiny phones: 1-col promo grid, smaller cards */
@media (max-width: 359px) {
    :root { --pad-x: 12px; }
    .promo-grid { grid-template-columns: 1fr; gap: 10px; padding: 14px var(--pad-x); }
    .games-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .scroll-row .game-card { width: 130px; }
    .feature-strip { grid-template-columns: 1fr; gap: 14px; padding: 16px; }
    .footer-links { grid-template-columns: 1fr 1fr; gap: 18px; }
    .earn-section { padding: 14px var(--pad-x); }
    .section-header { margin-bottom: 10px; }
    .game-section { padding: 4px 0 22px; }
}

/* small phones (360px – 479px): default mobile-first values */
@media (min-width: 360px) {
    .promo-grid { grid-template-columns: repeat(2, 1fr); }
    .games-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .scroll-row .game-card { width: 145px; }
}

/* large phones (480px+) */
@media (min-width: 480px) {
    :root { --pad-x: 20px; }
    .games-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
    .scroll-row .game-card { width: 155px; }
    .feature-strip { grid-template-columns: repeat(3, 1fr); }
}

/* tablets (640px+) */
@media (min-width: 640px) {
    :root { --pad-x: 24px; }
    .promo-grid { grid-template-columns: repeat(4, 1fr); }
    .games-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
    .scroll-row .game-card { width: 170px; }
    .game-player-container { aspect-ratio: 16 / 10; max-height: 65vh; }
    .footer-content { grid-template-columns: 1.2fr 2fr; }
}

/* laptops (960px+) */
@media (min-width: 960px) {
    :root { --pad-x: 32px; }
    .games-grid { grid-template-columns: repeat(5, 1fr); gap: 18px; }
    .scroll-row .game-card { width: 190px; }
    .game-player-container { aspect-ratio: 16 / 9; }
    .game-info-section { padding: 32px; }
    /* sidebar can stay closed by default; nicer max-width on huge content */
    .about-content, .blog-content, .contact-content,
    .legal-content, .privacy-content, .terms-content,
    .disclaimer-content { padding: 48px var(--pad-x) 80px; }
}

/* desktops (1200px+) – cap line length */
@media (min-width: 1200px) {
    :root { --pad-x: 48px; }
    .games-grid { grid-template-columns: repeat(6, 1fr); gap: 20px; }
    .scroll-row .game-card { width: 200px; }
    main#mainContent,
    .feature-strip,
    .footer-content { max-width: 1320px; margin-left: auto; margin-right: auto; }
}

/* ---- Mobile-specific ergonomics ---- */
@media (max-width: 639px) {
    /* prevent iOS zoom on focus by ensuring inputs >= 16px */
    .search-input, #searchInput,
    .contact-form input, .contact-form textarea { font-size: 16px; }

    /* horizontal scroll hint – fade edge */
    .category-tabs { -webkit-overflow-scrolling: touch; scroll-padding-left: var(--pad-x); }
    .scroll-row { -webkit-overflow-scrolling: touch; scroll-padding-left: var(--pad-x); }

    /* sidebar wider on phones for thumb reach */
    .sidebar { width: min(86vw, 320px); }

    /* game player slightly taller on phones */
    .game-player-container { aspect-ratio: 9 / 12; max-height: 78vh; }

    /* tighter section spacing */
    .game-section { padding: 6px 0 22px; }
    .section-header { margin-bottom: 12px; }
    .hero-poster-wrap { margin-top: 16px; border-radius: var(--radius); }
    .hero-poster-wrap img { max-height: 200px; }

    /* footer stacked & centered */
    .footer-brand { text-align: center; align-items: center; }
    .footer-tagline { margin-left: auto; margin-right: auto; }

    /* smaller game-info section on phones */
    .game-info-section { padding: 18px; margin: 14px var(--pad-x); }
    .game-actions { flex-direction: column; }
    .action-btn { justify-content: center; width: 100%; }
}

/* landscape phone — keep player low height */
@media (max-width: 900px) and (orientation: landscape) {
    .game-player-container { aspect-ratio: 16 / 9; max-height: 86vh; }
}

/* hover-only refinements (skip on touch) */
@media (hover: none) {
    .game-card:hover { transform: none; box-shadow: var(--shadow-xs); }
    .game-overlay { opacity: 0; }   /* don't trap touch users in hover state */
    .promo-card:hover { transform: none; }
    .earn-btn:hover { transform: none; box-shadow: var(--shadow-xs); }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* high-DPI / retina sharpness on images */
img { image-rendering: -webkit-optimize-contrast; }

/* small focus state */
:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ============================================================
   ===== PRODUCTION COMPONENTS (added in this iteration) =====
   ============================================================ */

/* ---- Back to Top button ---- */
.back-to-top {
    position: fixed;
    bottom: 22px;
    right: 22px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    border: none;
    box-shadow: 0 8px 22px rgba(16, 124, 65, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.9);
    transition: all 0.28s var(--ease);
    z-index: 80;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.back-to-top:hover {
    background: var(--brand-dark);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 28px rgba(16, 124, 65, 0.45);
}
.back-to-top:active { transform: translateY(0) scale(0.96); }
@media (max-width: 480px) {
    .back-to-top {
        bottom: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }
}

/* ---- Cookie Consent Banner ---- */
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: 720px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
    padding: 18px 22px;
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transform: translateY(24px);
    transition: all 0.35s var(--ease);
}
.cookie-banner.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.cookie-content {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.cookie-text { flex: 1 1 280px; min-width: 0; }
.cookie-text strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.cookie-text p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
}
.cookie-text a { color: var(--brand); font-weight: 600; text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-btn {
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.2s var(--ease);
    font-family: inherit;
    min-height: 40px;
}
.cookie-btn.primary {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}
.cookie-btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.cookie-btn.ghost {
    background: #fff;
    color: var(--text-muted);
    border-color: var(--border);
}
.cookie-btn.ghost:hover { background: #f3f4f6; color: var(--text); }
@media (max-width: 480px) {
    .cookie-banner { left: 10px; right: 10px; bottom: 10px; padding: 14px 16px; }
    .cookie-actions { width: 100%; }
    .cookie-btn { flex: 1; }
}

/* ---- Toast notifications ---- */
.toast-stack {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 23, 42, 0.94);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
    transition: all 0.25s var(--ease);
    max-width: 90vw;
}
.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.toast-icon { font-size: 16px; }

/* ---- Favorite button active state ---- */
.fav-toggle-btn.favorite-active {
    background: rgba(225, 29, 72, 0.08);
    border-color: rgba(225, 29, 72, 0.25);
}
.fav-toggle-btn.favorite-active .fav-svg {
    animation: heartPop 0.4s var(--ease);
}
@keyframes heartPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* ---- Clear history button (sized like see-all) ---- */
.see-all-btn {
    background: none;
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-muted);
    font-family: inherit;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    transition: all 0.2s var(--ease);
}
.see-all-btn:hover {
    color: #ef4444;
    border-color: #fecaca;
    background: #fef2f2;
}

/* ---- Empty state (used in favorites filter) ---- */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state .empty-emoji {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.6;
}
.empty-state h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px;
}
.empty-state p { margin: 0; font-size: 14px; }

/* ---- 404 / Error page ---- */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.error-card {
    max-width: 480px;
    width: 100%;
    text-align: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    box-shadow: var(--shadow-md);
}
.error-emoji {
    font-size: 72px;
    margin-bottom: 8px;
    animation: float 3s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.error-code {
    font-size: clamp(56px, 14vw, 88px);
    font-weight: 900;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0;
    letter-spacing: -0.04em;
    line-height: 1;
}
.error-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    margin: 8px 0 12px;
}
.error-text {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 28px;
}
.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.error-btn {
    padding: 12px 22px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s var(--ease);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.error-btn.primary {
    background: var(--brand);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.error-btn.primary:hover { background: var(--brand-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.error-btn.ghost {
    background: #fff;
    color: var(--text);
    border: 1.5px solid var(--border);
}
.error-btn.ghost:hover { background: #f3f4f6; }
