/*
Theme Name: Flushee Games
Theme URI: https://flusheegames.com
Author: Flushee Games
Description: Mobile-optimized WordPress games theme with hero slider, trending & latest games grid, category boxes and sidebar — games managed as Posts.
Version: 2.0
Text Domain: flushee-games
*/

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

/*
 * Theme variables — switch via [data-theme="dark"] / [data-theme="light"] on <html> or <body>.
 * Default (no attribute) = dark, matching the site's default look.
 * --accent      = buttons only
 * --text-accent = category/badge/icon accent text & borders (kept separate on purpose:
 *                 changing button color should never make badges/icons invisible)
 */
:root,
[data-theme="dark"] {
    --bg: #0d0d12;
    --bg-alt: #16161d;
    --surface: #1a1a22;
    --border: #26262f;
    --text-primary: #f2f2f5;
    --text-secondary: #c2c2ca;
    --text-muted: #9a9aa5;

    --accent: #e0263c;
    --accent-dark: #b3162a;
    --text-accent: #ff4d6d;
    --star: #f5b400;

    --radius: 12px;
    --max-width: 1400px;
}

[data-theme="light"] {
    --bg: #f4f4f7;
    --bg-alt: #ffffff;
    --surface: #ffffff;
    --border: #e2e2e8;
    --text-primary: #17171d;
    --text-secondary: #45454f;
    --text-muted: #767680;

    --accent: #e0263c;
    --accent-dark: #b3162a;
    --text-accent: #d81b4a;
    --star: #b8860b;
}

/* Backward-compatible aliases used throughout the existing CSS below */
:root {
    --primary: var(--accent);
    --primary-dark: var(--accent-dark);
    --card: var(--surface);
    --card-border: var(--border);
    --text: var(--text-primary);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: 14px; border: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: rgba(255,255,255,0.06); color: var(--text); border: 1px solid var(--card-border); }
.btn-outline:hover { background: rgba(255,255,255,0.12); }

/* ===================== SVG Icons ===================== */
.icon {
    display: inline-block;
    flex-shrink: 0;
    vertical-align: -3px;
    color: currentColor;
}
.logo-icon { display: flex; align-items: center; justify-content: center; }
.logo-icon .icon { color: #fff; vertical-align: middle; }
.category-box .cat-icon { display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; }
.category-box .cat-icon .icon { color: var(--primary); }
.cat-pill { display: inline-flex !important; align-items: center; }
.cat-pill .icon { vertical-align: -1px; }
.cat-list .cat-label { display: flex; align-items: center; gap: 8px; }
.rating { display: inline-flex; align-items: center; gap: 4px; }
.rating .icon { color: var(--star); }
.search-toggle-form button,
.sidebar-search button { display: flex; align-items: center; justify-content: center; }
.search-toggle-form button .icon,
.sidebar-search button .icon { color: #fff; }
.section-header h2 { display: flex; align-items: center; gap: 8px; }
.section-header h2 .icon { color: var(--primary); }
.hero-meta span { display: flex; align-items: center; gap: 5px; }
.footer-social a { display: flex; align-items: center; justify-content: center; }
.game-card .meta-row span,
.single-game-meta span { display: inline-flex; align-items: center; gap: 4px; }
.sidebar-widget h3 { display: flex; align-items: center; gap: 8px; }

.hero-logo-img { max-width: 320px; max-height: 140px; width: auto; height: auto; margin-bottom: 14px; filter: drop-shadow(0 6px 16px rgba(0,0,0,0.5)); }

/* ===================== Header ===================== */
.site-header {
    position: sticky; top: 0; z-index: 999;
    background: rgba(13,13,18,0.97);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--card-border);
}
.site-header .header-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0; gap: 16px;
}
.site-branding { display: flex; align-items: center; gap: 10px; }
.site-branding .logo-icon {
    width: 38px; height: 38px; background: var(--primary); border-radius: 8px;
    display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.site-branding .logo-text { line-height: 1.1; }
.site-branding .logo-text a { font-size: 20px; font-weight: 800; color: var(--text); display: block; }
.site-branding .logo-text a span { color: var(--primary); }
.site-branding .logo-tagline { font-size: 10px; color: var(--text-muted); letter-spacing: 0.5px; text-transform: uppercase; }

.main-navigation ul { display: flex; gap: 26px; align-items: center; }
.main-navigation a { font-weight: 500; font-size: 14.5px; color: var(--text); padding: 6px 0; }
.main-navigation li.current-menu-item > a,
.main-navigation a:hover { color: var(--primary); }

.header-right { display: flex; align-items: center; gap: 14px; }
.search-toggle-form { display: flex; align-items: center; background: var(--card); border: 1px solid var(--card-border); border-radius: 8px; overflow: hidden; }
.search-toggle-form input[type="search"] {
    background: transparent; border: none; color: var(--text); padding: 9px 12px; font-size: 13.5px; width: 220px;
}
.search-toggle-form input[type="search"]:focus { outline: none; }
.search-toggle-form button {
    background: var(--primary); border: none; color: #fff; padding: 9px 14px; display: flex; align-items: center;
}
.header-icon-btn {
    width: 36px; height: 36px; border-radius: 50%; background: var(--card); border: 1px solid var(--card-border);
    display: flex; align-items: center; justify-content: center; color: var(--text); font-size: 16px;
}
.menu-toggle { display: none; background: none; border: none; font-size: 24px; color: var(--text); }

/* ===================== Hero Slider ===================== */
.hero-slider { position: relative; margin: 20px 0; border-radius: var(--radius); overflow: hidden; }
.hero-slide {
    position: relative; min-height: 340px; display: flex; align-items: center;
    background-size: cover; background-position: center; border-radius: var(--radius); overflow: hidden;
}
.hero-slide::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(13,13,18,0.95) 10%, rgba(13,13,18,0.55) 45%, rgba(13,13,18,0.15) 100%);
}
.hero-slide-content { position: relative; z-index: 2; padding: 40px; max-width: 560px; }
.hero-badge {
    display: inline-block; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700;
    padding: 5px 12px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 14px;
}
.hero-slide-content h1 {
    font-size: 42px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px;
    color: #f0d98c; text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
.hero-meta { display: flex; gap: 18px; font-size: 13px; color: var(--text-muted); margin-bottom: 14px; flex-wrap: wrap; }
.hero-meta span { display: flex; align-items: center; gap: 5px; }
.hero-desc { color: #d5d5db; font-size: 14.5px; margin-bottom: 22px; max-width: 480px; }
.hero-actions { display: flex; gap: 12px; }
.hero-nav-btn {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
    width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.15);
    color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.hero-prev { left: 16px; } .hero-next { right: 16px; }
.hero-dots { position: absolute; bottom: 16px; right: 20px; z-index: 3; display: flex; gap: 6px; }
.hero-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.35); }
.hero-dots span.active { background: var(--primary); width: 20px; border-radius: 4px; }

/* ===================== Category Strip ===================== */
.category-strip {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; margin-bottom: 34px;
}
.category-box {
    background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
    padding: 18px 10px; text-align: center; transition: transform .15s ease, border-color .15s ease;
}
.category-box:hover { transform: translateY(-3px); border-color: var(--primary); }
.category-box .cat-icon { font-size: 26px; margin-bottom: 8px; }
.category-box .cat-name { font-weight: 700; font-size: 13.5px; }
.category-box .cat-count { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ===================== Main Layout ===================== */
.main-layout { display: grid; grid-template-columns: 1fr 320px; gap: 26px; align-items: start; }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-header h2 { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.section-header .view-all { font-size: 13px; color: var(--primary); font-weight: 600; }
.section-block { margin-bottom: 38px; }

/* ===================== Game Cards Grid ===================== */
.games-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.games-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.game-card {
    background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
    overflow: hidden; transition: transform .15s ease, box-shadow .15s ease;
}
.game-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(224,38,60,0.2); border-color: var(--primary); }

.game-card .thumb-link { position: relative; display: block; aspect-ratio: 3/4; overflow: hidden; background: #000; }
.game-card .thumb-link img { width: 100%; height: 100%; object-fit: cover; }
.game-card .cat-pill {
    position: absolute; top: 8px; left: 8px; background: rgba(13,13,18,0.85); color: var(--text);
    font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 4px; text-transform: uppercase;
    display: flex; align-items: center; gap: 4px;
}
.game-card .body { padding: 10px 12px 12px; }
.game-card .game-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-card .meta-row { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--text-muted); margin-bottom: 10px; flex-wrap: wrap; }
.game-card .meta-row span { display: flex; align-items: center; gap: 4px; }
.game-card .bottom-row { display: flex; align-items: center; justify-content: space-between; }
.game-card .rating { display: flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--star); }
.game-card .view-btn {
    background: var(--primary); color: #fff; font-size: 11.5px; font-weight: 700; padding: 6px 12px; border-radius: 6px;
}
.game-card .view-btn:hover { background: var(--primary-dark); }

/* Latest releases card variant with overlay play */
.game-card.latest .thumb-link::after {
    content: "\25B6"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 30px; color: #fff; background: rgba(0,0,0,0.25); opacity: 0; transition: opacity .15s ease;
}
.game-card.latest:hover .thumb-link::after { opacity: 1; }

/* ===================== Sidebar ===================== */
.sidebar-widget {
    background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
    padding: 18px; margin-bottom: 20px;
}
.sidebar-widget h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.sidebar-search { display: flex; margin-bottom: 4px; background: var(--bg-alt); border: 1px solid var(--card-border); border-radius: 8px; overflow: hidden; }
.sidebar-search input { flex: 1; background: transparent; border: none; color: var(--text); padding: 10px 12px; font-size: 13px; }
.sidebar-search button { background: var(--primary); border: none; color: #fff; padding: 0 14px; }

.mini-game-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--card-border); }
.mini-game-item:last-child { border-bottom: none; padding-bottom: 0; }
.mini-game-item img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.mini-game-item .mgi-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.mini-game-item .mgi-meta { font-size: 11px; color: var(--text-muted); }

.cat-list li { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--card-border); font-size: 13.5px; }
.cat-list li:last-child { border-bottom: none; }
.cat-list .cat-label { display: flex; align-items: center; gap: 8px; }
.cat-list .cat-count-badge { color: var(--text-muted); font-size: 12px; }

.discord-widget { background: linear-gradient(135deg, #4c3ea8, #5865f2); border: none; text-align: center; }
.discord-widget h3 { justify-content: center; }
.discord-widget p { font-size: 12.5px; color: rgba(255,255,255,0.85); margin-bottom: 14px; }
.discord-widget .btn { width: 100%; justify-content: center; background: #fff; color: #5865f2; }

.newsletter-widget input {
    width: 100%; background: var(--bg-alt); border: 1px solid var(--card-border); color: var(--text);
    padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 10px;
}
.newsletter-widget .btn { width: 100%; justify-content: center; }

/* ===================== Pagination ===================== */
.pagination-nav { display: flex; justify-content: center; gap: 8px; padding: 30px 0 10px; }
.pagination-nav a, .pagination-nav span {
    background: var(--card); border: 1px solid var(--card-border); color: var(--text); padding: 8px 14px; border-radius: 8px; font-size: 13.5px;
}
.pagination-nav .current { background: var(--primary); border-color: var(--primary); }

/* ===================== Single Game Page ===================== */
.game-play-wrapper {
    background: #000; border-radius: var(--radius); overflow: hidden; margin: 20px 0; position: relative;
    width: 100%; aspect-ratio: 16/9;
}
.game-play-wrapper iframe, .game-play-wrapper img { width: 100%; height: 100%; border: 0; object-fit: contain; }
.single-game-title { font-size: 26px; font-weight: 800; margin-top: 10px; }
.single-game-meta { color: var(--text-muted); font-size: 13px; margin: 8px 0 20px; display: flex; gap: 16px; flex-wrap: wrap; }
.game-description { background: var(--card); border: 1px solid var(--card-border); padding: 20px; border-radius: var(--radius); margin-bottom: 30px; }
.game-description h2 { font-size: 17px; margin-bottom: 10px; }
.game-description p { color: var(--text-muted); font-size: 14.5px; }

/* ===================== Footer ===================== */
.site-footer { border-top: 1px solid var(--card-border); margin-top: 40px; padding: 40px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 30px; margin-bottom: 30px; }
.footer-brand .logo-text a { font-size: 19px; font-weight: 800; }
.footer-brand p { color: var(--text-muted); font-size: 13px; margin-top: 10px; max-width: 320px; }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a { width: 34px; height: 34px; border-radius: 50%; background: var(--card); border: 1px solid var(--card-border); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.footer-col h4 { font-size: 14px; margin-bottom: 14px; }
.footer-col ul li { margin-bottom: 9px; }
.footer-col ul li a { color: var(--text-muted); font-size: 13.5px; }
.footer-col ul li a:hover { color: var(--primary); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--card-border); padding-top: 18px; font-size: 12.5px; color: var(--text-muted); flex-wrap: wrap; gap: 10px; }
.age-badge { display: flex; align-items: center; gap: 10px; }
.age-badge .badge-circle { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; color: var(--primary); }

/* ===================== Download Manager — Frontend ===================== */
.dl-open-popup {
    display: inline-flex; align-items: center; gap: 10px; position: relative; padding-right: 22px;
}
.dl-count-pill {
    background: rgba(0,0,0,0.25); padding: 4px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600;
}

.dl-popup-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center; z-index: 2000; padding: 20px;
}
.dl-popup-overlay.active { display: flex; }

.dl-popup {
    background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
    padding: 28px; max-width: 460px; width: 100%; position: relative;
}
.dl-popup h3 { font-size: 19px; margin-bottom: 6px; }
.dl-popup-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 18px; }
.dl-popup-close {
    position: absolute; top: 14px; right: 14px; background: none; border: none; color: var(--text-muted); cursor: pointer;
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
.dl-popup-close:hover { background: rgba(255,255,255,0.08); color: var(--text); }

.dl-server-list { display: flex; flex-direction: column; gap: 10px; }
.dl-server-btn {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    background: var(--bg-alt); border: 1px solid var(--card-border); border-radius: 10px;
    padding: 14px 16px; color: var(--text); font-weight: 600; font-size: 14.5px; cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.dl-server-btn:hover { border-color: var(--primary); }
.dl-server-btn.dl-waiting { border-color: var(--star); background: rgba(245,180,0,0.08); }
.dl-server-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; }
.dl-server-status.is-live { color: #2ecc71; }
.dl-server-status.is-soon { color: var(--star); }

/* Game Info grid on single page */
.dl-info-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 20px; margin-top: 6px; }
.dl-info-list div { display: flex; flex-direction: column; gap: 3px; }
.dl-info-list span { font-size: 11px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.4px; }
.dl-info-list strong { font-size: 14px; }
.dl-video-embed { margin-top: 18px; }
.dl-video-embed iframe { width: 100%; aspect-ratio: 16/9; border-radius: 10px; border: 0; }

/* System requirements table */
.dl-sysreq-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.dl-sysreq-table th, .dl-sysreq-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--card-border); font-size: 13.5px; }
.dl-sysreq-table th { width: 160px; color: var(--text-muted); font-weight: 600; }
.dl-sysreq-table td { color: var(--text); }

/* Coming Soon page */
.dl-coming-soon-wrap { display: flex; align-items: center; justify-content: center; min-height: 60vh; padding: 40px 16px; }
.dl-coming-soon-box { text-align: center; max-width: 420px; }
.dl-coming-soon-icon { color: var(--primary); margin-bottom: 18px; display: flex; justify-content: center; }
.dl-coming-soon-box h1 { font-size: 24px; margin-bottom: 10px; }
.dl-coming-soon-box p { color: var(--text-muted); font-size: 14.5px; margin-bottom: 24px; }
.dl-coming-soon-box .btn { margin: 0 6px; }

@media (max-width: 600px) {
    .dl-info-list { grid-template-columns: 1fr; }
    .dl-open-popup { width: 100%; justify-content: center; }
}

/* ===================== Single Game Page — Hero Banner ===================== */
.game-hero-banner {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    margin: 20px 0 30px;
    background-size: cover;
    background-position: center;
    padding: 36px 28px;
}
.game-hero-banner::before {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(8,8,12,0.75) 0%, rgba(8,8,12,0.92) 75%, rgba(8,8,12,0.97) 100%);
    backdrop-filter: blur(1px);
}
.game-hero-inner {
    position: relative; z-index: 2;
    display: grid;
    grid-template-columns: 200px 1fr 300px;
    gap: 28px;
    align-items: start;
}

.game-hero-poster {
    width: 100%; aspect-ratio: 3/4; border-radius: 10px; overflow: hidden;
    box-shadow: 0 16px 32px rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.12);
}
.game-hero-poster img { width: 100%; height: 100%; object-fit: cover; }

.game-hero-main { min-width: 0; }

/* Force always-light text/icons inside the hero banner main + poster columns,
   regardless of site light/dark mode — but scoped to specific elements only,
   so the info box (which sits on the normal surface color) is unaffected. */
.game-hero-title,
.game-hero-metabar,
.game-hero-desc,
.game-hero-genres .genres-label,
.game-hero-social .social-btn {
    color: #f5f5f8 !important;
}

.game-hero-title { font-size: 30px; font-weight: 800; margin-bottom: 10px; line-height: 1.2; }

.game-hero-metabar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0;
    font-size: 13px; color: #cfcfd6 !important; margin-bottom: 16px;
}
.game-hero-metabar span { display: inline-flex; align-items: center; }
.game-hero-metabar span:not(:last-child)::after {
    content: "•"; margin: 0 9px; color: #6a6a75;
}

.game-hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.hb-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 700;
    border: 1px solid transparent; background: rgba(255,255,255,0.08); color: #fff;
}
.hb-pill.pill-version { background: rgba(46,204,113,0.18); color: #4ade80 !important; }
.hb-pill.pill-latest { background: rgba(46,204,113,0.18); color: #4ade80 !important; }
.hb-pill.pill-category { background: rgba(255,77,109,0.15); color: var(--text-accent) !important; border-color: rgba(255,77,109,0.3); }

.hb-icon-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 700;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); color: #fff !important;
    cursor: pointer; transition: background .15s ease, color .15s ease;
}
.hb-icon-btn:hover { background: rgba(255,255,255,0.16); }
.hb-icon-btn.is-active { background: rgba(255,77,109,0.2); color: var(--text-accent) !important; border-color: rgba(255,77,109,0.4); }
.hb-icon-btn.is-active .icon { color: var(--text-accent); }
#flushee-fav-btn.is-active .icon { color: #ff4d6d; }
.hb-icon-btn:disabled { opacity: 0.55; cursor: default; }

.game-hero-social { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.social-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 16px; border-radius: 8px; font-size: 13px; font-weight: 700;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15);
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.social-btn.social-discord:hover { background: #5865F2; border-color: #5865F2; color: #fff !important; }
.social-btn.social-youtube:hover { background: #FF0000; border-color: #FF0000; color: #fff !important; }
.social-btn.social-steam:hover { background: #0a1929; border-color: #66c0f4; color: #66c0f4 !important; }

.game-hero-desc { font-size: 14.5px; color: #d5d5db !important; margin-bottom: 18px; max-width: 640px; }

.game-hero-genres { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.genres-label { font-size: 11.5px; font-weight: 800; letter-spacing: 0.6px; margin-right: 2px; }
.genre-pill { padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; color: #fff; }
.genre-color-0 { background: #8b5cf6; } /* purple */
.genre-color-1 { background: #22c55e; } /* green */
.genre-color-2 { background: #f97316; } /* orange */
.genre-color-3 { background: #ef4444; } /* red */
.genre-color-4 { background: #14b8a6; } /* teal */
.genre-color-5 { background: #ec4899; } /* pink */

/* Info box (right column, desktop) */
.game-hero-infobox {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; align-self: start;
}
.hb-info-list div { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.hb-info-list div:last-child { border-bottom: none; }
.hb-info-list span { color: var(--text-muted); }
.hb-info-list strong { color: var(--text-primary); font-weight: 700; }
.hb-info-list strong.text-accent { color: var(--text-accent); display: inline-flex; align-items: center; gap: 5px; }
.hb-info-list strong.text-green { color: #2ecc71; }

.hb-download-btn,
.game-hero-infobox .dl-open-popup {
    width: 100%; justify-content: center; margin-top: 16px; padding: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark)); font-size: 15px;
}
.hb-download-sub { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 8px; }

/* ===================== Single Game Page — Body Layout ===================== */
.game-body-layout { display: grid; grid-template-columns: 1fr 320px; gap: 26px; align-items: start; margin-top: 10px; }
.game-content-col { min-width: 0; }
.content-box {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px; margin-bottom: 22px;
}
.content-box h2 { font-size: 18px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.content-box h2 .icon { color: var(--text-accent); }
.content-box p { color: var(--text-secondary); font-size: 14.5px; }

.dl-sysreq-table th { color: var(--text-muted); }
.dl-sysreq-table td { color: var(--text-primary); }

@media (max-width: 1100px) {
    .game-hero-inner { grid-template-columns: 140px 1fr; }
    .game-hero-infobox { grid-column: 1 / -1; }
    .game-body-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .game-hero-inner { grid-template-columns: 1fr; text-align: center; }
    .game-hero-poster { width: 130px; margin: 0 auto; }
    .game-hero-metabar { justify-content: center; }
    .game-hero-badges, .game-hero-social, .game-hero-genres { justify-content: center; }
    .game-hero-title { font-size: 22px; }
}

/* ===================== Download Popup v2 ===================== */
.dl-popup-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.dl-popup-header-title { display: flex; align-items: center; gap: 10px; }
.dl-popup-header-title .icon { color: var(--text-accent); flex-shrink: 0; margin-top: 2px; }
.dl-popup-header-title h3 { font-size: 17px; margin: 0; }
.dl-popup-post-title { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.dl-verified-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(46,204,113,0.12); color: #2ecc71; border: 1px solid rgba(46,204,113,0.25);
    font-size: 12px; font-weight: 700; padding: 7px 12px; border-radius: 8px; margin-bottom: 18px;
}

.dl-server-section { margin-bottom: 18px; }
.dl-server-section h4 {
    display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 10px;
}
.dl-torrent-section h4 { color: #f97316; }

.dl-server-row {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px;
    padding: 12px 14px; margin-bottom: 8px;
}
.dl-torrent-row { border-color: rgba(249,115,22,0.4); background: rgba(249,115,22,0.06); }
.dl-server-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.dl-server-btn {
    background: var(--accent); color: #fff; border: none; padding: 8px 16px; border-radius: 6px;
    font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .15s ease;
}
.dl-server-btn:hover { background: var(--accent-dark); }
.dl-server-btn.dl-waiting { background: var(--star); color: #1a1a1a; }
.dl-torrent-btn { background: #f97316; }
.dl-torrent-btn:hover { background: #ea6a0c; }
.dl-torrent-btn.dl-waiting { background: var(--star); color: #1a1a1a; }

.dl-empty-msg { color: var(--text-muted); font-size: 14px; text-align: center; padding: 20px 0; }

/* ===================== Reviews + Reply System ===================== */
.rv-summary { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.rv-score { font-size: 40px; font-weight: 800; color: var(--star); line-height: 1; }
.rv-stars-static { display: inline-flex; gap: 2px; color: var(--star); }
.rv-star-filled { color: var(--star); }
.rv-star-empty { color: var(--border); }
.rv-count { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

.rv-empty { color: var(--text-muted); font-size: 14px; padding: 10px 0; }

.rv-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.rv-item:last-child { border-bottom: none; }
.rv-item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.rv-author { font-weight: 700; font-size: 13.5px; margin-left: 4px; }
.rv-date { font-size: 12px; color: var(--text-muted); margin-left: 8px; }
.rv-content { font-size: 14px; color: var(--text-secondary); margin: 6px 0 8px; line-height: 1.55; }

.rv-reply-toggle {
    background: none; border: none; color: var(--text-accent); font-size: 12.5px; font-weight: 700;
    cursor: pointer; padding: 0; margin-bottom: 8px;
}
.rv-reply-toggle:hover { text-decoration: underline; }

.rv-delete-btn {
    background: rgba(224,38,60,0.12); color: var(--accent); border: 1px solid rgba(224,38,60,0.3);
    font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 6px; cursor: pointer; text-transform: uppercase;
}
.rv-delete-btn:hover { background: var(--accent); color: #fff; }

.rv-replies { margin-top: 10px; padding-left: 18px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.rv-reply-item .rv-content { font-size: 13px; }
.rv-reply-item .rv-author { font-size: 12.5px; }

.rv-reply-form-wrap { margin: 10px 0; max-width: 480px; }

.rv-form { display: flex; flex-direction: column; gap: 10px; }
.rv-input, .rv-textarea, .rv-select {
    width: 100%; background: var(--bg-alt); border: 1px solid var(--border); color: var(--text-primary);
    padding: 10px 12px; border-radius: 8px; font-size: 13.5px; font-family: inherit;
}
.rv-select {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%239a9aa5'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; padding-right: 34px;
}
.rv-input:focus, .rv-textarea:focus, .rv-select:focus { outline: none; border-color: var(--accent); }

.rv-star-input { display: flex; align-items: center; gap: 4px; }
.rv-star-pick { background: none; border: none; cursor: pointer; color: var(--border); padding: 2px; transition: color .1s ease; }
.rv-star-pick.is-filled { color: var(--star); }
.rv-star-pick:hover { color: var(--star); }

.rv-submit-btn { align-self: flex-start; }

.rv-msg { font-size: 12.5px; font-weight: 600; min-height: 16px; }
.rv-msg-success { color: #2ecc71; }
.rv-msg-error { color: var(--accent); }

.rv-leave-box { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.rv-leave-box h4 { font-size: 15px; margin-bottom: 12px; }

/* Report popup reuses .dl-popup base styles */
.rp-popup .rv-form { margin-top: 4px; }

/* ===================== Live Search Overlay ===================== */
.ls-overlay {
    position: fixed; inset: 0; z-index: 3000; display: none;
    align-items: flex-start; justify-content: center;
    background: rgba(5,5,8,0.75); backdrop-filter: blur(6px);
    padding: 10vh 16px 16px;
}
.ls-overlay.active { display: flex; }

.ls-box {
    width: 100%; max-width: 600px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    display: flex; flex-direction: column;
}

.ls-input-row {
    display: flex; align-items: center; gap: 10px; padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}
.ls-search-icon { color: var(--text-muted); flex-shrink: 0; }
.ls-input {
    flex: 1; background: transparent; border: none; color: var(--text-primary);
    font-size: 15px; font-family: inherit;
}
.ls-input:focus { outline: none; }
.ls-input::placeholder { color: var(--text-muted); }

.ls-clear-btn {
    display: none; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%; background: var(--bg-alt);
    border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; flex-shrink: 0;
}
.ls-clear-btn:hover { color: var(--text-primary); }

.ls-esc-btn {
    font-size: 10.5px; font-weight: 700; color: var(--text-muted);
    border: 1px solid var(--border); border-radius: 5px; padding: 3px 7px;
    cursor: pointer; flex-shrink: 0; letter-spacing: 0.5px;
}
.ls-esc-btn:hover { border-color: var(--accent); color: var(--accent); }

.ls-body { max-height: 60vh; overflow-y: auto; padding: 16px 18px 20px; }

.ls-popular-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 11.5px; font-weight: 800; letter-spacing: 0.6px;
    color: var(--text-accent); margin-bottom: 12px;
}
.ls-fire-icon { color: var(--text-accent); }

.ls-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ls-pill {
    padding: 7px 14px; border-radius: 20px; font-size: 13px; font-weight: 600;
    background: var(--bg-alt); border: 1px solid var(--border); color: var(--text-primary);
    transition: border-color .15s ease, color .15s ease;
}
.ls-pill:hover { border-color: var(--accent); color: var(--accent); }

.ls-no-results { color: var(--text-muted); font-size: 14px; text-align: center; padding: 24px 0; }

.ls-result-row {
    display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px;
    transition: background .12s ease;
}
.ls-result-row:hover { background: var(--bg-alt); }
.ls-result-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.ls-result-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ls-result-title { font-size: 14px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-result-cat { font-size: 11.5px; color: var(--text-muted); }

@media (max-width: 600px) {
    .ls-overlay { padding: 8vh 10px 10px; }
    .ls-box { max-width: 100%; }
}

/* ===================== Trending Page ===================== */
.tr-page { padding-top: 24px; padding-bottom: 50px; }

.tr-page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.tr-page-title { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.tr-live-indicator { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.tr-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 0 0 rgba(46,204,113,0.6); animation: tr-pulse 1.8s infinite; }
@keyframes tr-pulse {
    0% { box-shadow: 0 0 0 0 rgba(46,204,113,0.6); }
    70% { box-shadow: 0 0 0 6px rgba(46,204,113,0); }
    100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); }
}
.tr-page-actions { display: flex; gap: 8px; }

.tr-tabs {
    display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 18px;
    border-bottom: 1px solid var(--border); scrollbar-width: none;
}
.tr-tabs::-webkit-scrollbar { display: none; }
.tr-tab {
    flex-shrink: 0; padding: 8px 16px; border-radius: 20px; font-size: 13.5px; font-weight: 700;
    background: var(--surface); border: 1px solid var(--border); color: var(--text-secondary); white-space: nowrap;
}
.tr-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.tr-hero-card {
    position: relative; display: block; border-radius: var(--radius); overflow: hidden;
    min-height: 220px; margin-bottom: 24px; box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}
.tr-hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,8,12,0.15) 0%, rgba(8,8,12,0.92) 100%); }
.tr-hero-badge {
    position: absolute; top: 16px; left: 16px; z-index: 2;
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--accent); color: #fff; font-size: 12px; font-weight: 800;
    padding: 6px 12px; border-radius: 20px; text-transform: uppercase;
}
.tr-hero-content { position: relative; z-index: 2; padding: 20px; }
.tr-hero-content h2 { color: #fff !important; font-size: 22px; font-weight: 800; margin: 8px 0 6px; }
.tr-hero-content p { color: #d5d5db !important; font-size: 13.5px; max-width: 520px; }

.tr-cat-tag {
    display: inline-block; background: rgba(255,77,109,0.15); color: var(--text-accent);
    border: 1px solid rgba(255,77,109,0.3); font-size: 11px; font-weight: 700;
    padding: 3px 10px; border-radius: 20px; text-transform: uppercase;
}
.tr-cat-tag-hero { background: rgba(255,255,255,0.15); color: #fff !important; border-color: rgba(255,255,255,0.3); }

.tr-feed { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.tr-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,0.15); transition: transform .15s ease;
}
.tr-card:hover { transform: translateY(-3px); }
.tr-card-thumb { position: relative; aspect-ratio: 4/3; overflow: hidden; }
.tr-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tr-rank {
    position: absolute; top: 8px; left: 8px; background: rgba(8,8,12,0.75); color: #fff;
    font-size: 13px; font-weight: 800; padding: 4px 9px; border-radius: 20px;
    display: inline-flex; align-items: center; gap: 3px;
}
.tr-rank-up { color: #2ecc71; display: inline-flex; }
.tr-card-body { padding: 12px 14px 14px; }
.tr-card-title { font-size: 14px; font-weight: 700; margin: 8px 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-stats { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); }
.tr-stats span { display: inline-flex; align-items: center; gap: 4px; }

.tr-empty-state { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--text-muted); }
.tr-empty-state .icon { color: var(--text-muted); margin-bottom: 14px; }
.tr-empty-state h3 { font-size: 17px; color: var(--text-primary); margin-bottom: 6px; }

.tr-skeleton-wrap { display: none; flex-direction: column; gap: 14px; margin-top: 16px; }
.tr-skel-card { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.tr-skel-thumb { width: 70px; height: 70px; border-radius: 10px; flex-shrink: 0; }
.tr-skel-thumb, .tr-skel-lines span {
    background: linear-gradient(90deg, var(--bg-alt) 25%, var(--border) 50%, var(--bg-alt) 75%);
    background-size: 200% 100%; animation: tr-shimmer 1.4s infinite;
    border-radius: 6px; display: block;
}
.tr-skel-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.tr-skel-lines span:nth-child(1) { width: 60%; height: 14px; }
.tr-skel-lines span:nth-child(2) { width: 40%; height: 10px; }
.tr-skel-lines span:nth-child(3) { width: 80%; height: 10px; }
@keyframes tr-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.tr-end-msg { text-align: center; color: var(--text-muted); font-size: 13px; padding: 24px 0; }

/* Filter bottom sheet */
.tr-sheet-overlay {
    position: fixed; inset: 0; z-index: 3000; display: none; align-items: flex-end; justify-content: center;
    background: rgba(5,5,8,0.6); opacity: 0; transition: opacity .2s ease;
}
.tr-sheet-overlay.active { opacity: 1; }
.tr-sheet {
    width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 20px 20px 0 0; padding: 12px 20px 24px;
    transform: translateY(100%); transition: transform .25s ease;
}
.tr-sheet-overlay.active .tr-sheet { transform: translateY(0); }
.tr-sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--border); margin: 0 auto 16px; }
.tr-sheet h3 { font-size: 15px; margin-bottom: 14px; }
.tr-sheet-option {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
    padding: 12px 14px; border-radius: 10px; background: transparent; border: 1px solid transparent;
    color: var(--text-primary); font-size: 14px; font-weight: 600; margin-bottom: 6px;
}
.tr-sheet-option.active { background: rgba(224,38,60,0.1); border-color: var(--accent); color: var(--accent); }
.tr-sheet-option .icon { color: var(--text-accent); }
.tr-sheet-close { width: 100%; justify-content: center; margin-top: 10px; }

@media (max-width: 600px) {
    .tr-feed { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .tr-hero-content h2 { font-size: 18px; }
    .tr-page-title { font-size: 21px; }
}

/* ===================== Categories Page ===================== */
.cat-page { padding-top: 24px; padding-bottom: 50px; }
.cat-page-header { margin-bottom: 18px; }

.cat-search-row { display: flex; gap: 12px; margin-bottom: 26px; flex-wrap: wrap; }
.cat-search-box {
    flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px;
}
.cat-search-icon { color: var(--text-muted); flex-shrink: 0; }
.cat-search-box input { flex: 1; background: transparent; border: none; color: var(--text-primary); font-size: 14px; font-family: inherit; }
.cat-search-box input:focus { outline: none; }

.cat-sort-toggle { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.cat-sort-btn { padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--text-muted); background: transparent; border: none; }
.cat-sort-btn.active { background: var(--accent); color: #fff; }

.cat-section-label { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 12px; }
.cat-featured-row { margin-bottom: 28px; }
.cat-featured-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.cat-featured-scroll::-webkit-scrollbar { display: none; }
.cat-featured-chip {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-radius: 20px; font-size: 13.5px; font-weight: 700; white-space: nowrap;
}

.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.cc-card {
    position: relative; border-radius: 16px; padding: 20px 16px; border: 1px solid var(--border);
    display: flex; flex-direction: column; transition: transform .15s ease;
}
.cc-card:hover { transform: translateY(-3px); }
.cc-icon-box {
    width: 52px; height: 52px; border-radius: 14px; background: rgba(255,255,255,0.06);
    display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.cc-name { font-size: 15px; font-weight: 800; color: var(--text-primary); margin-bottom: 3px; }
.cc-count { font-size: 12px; color: var(--text-muted); }

.cc-new-badge {
    position: absolute; top: 14px; right: 44px; background: #2ecc71; color: #06210f;
    font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 10px; text-transform: uppercase;
}
.cc-more-btn {
    position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%;
    background: rgba(0,0,0,0.15); border: none; color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
}
.cc-more-btn:hover { background: rgba(0,0,0,0.3); }

.cc-menu {
    display: none; position: absolute; top: 42px; right: 10px; z-index: 5;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.3); min-width: 150px; overflow: hidden;
}
.cc-menu.is-open { display: block; }
.cc-menu-item {
    width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 14px;
    background: transparent; border: none; color: var(--text-primary); font-size: 13px; font-weight: 600; text-align: left;
}
.cc-menu-item:hover { background: var(--bg-alt); }

.cat-empty-state, .cat-no-results {
    grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--text-muted);
    display: flex; flex-direction: column; align-items: center;
}
.cat-empty-state .icon, .cat-no-results .icon { color: var(--text-muted); margin-bottom: 14px; }
.cat-empty-state h3, .cat-no-results h3 { font-size: 17px; color: var(--text-primary); margin-bottom: 6px; }

@media (min-width: 1000px) {
    .cat-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 420px) {
    .cat-grid { grid-template-columns: 1fr; }
    .cc-card { flex-direction: row; align-items: center; gap: 14px; padding: 14px; }
    .cc-icon-box { margin-bottom: 0; flex-shrink: 0; }
}

/* ===================== "New Games" style grid card (Latest / Search / Category) ===================== */
.ng-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }

.ng-card {
    position: relative; border-radius: var(--radius); overflow: hidden;
    aspect-ratio: 3/4; display: block; box-shadow: 0 4px 14px rgba(0,0,0,0.2);
    transition: transform .15s ease;
}
.ng-card:hover { transform: translateY(-3px); }
.ng-card-thumb { position: relative; width: 100%; height: 100%; }
.ng-card-thumb img { width: 100%; height: 100%; object-fit: cover; }

.ng-card-badge {
    position: absolute; top: 8px; left: 8px; z-index: 2;
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(8,8,12,0.8); color: #fff; font-size: 10.5px; font-weight: 700;
    padding: 4px 8px; border-radius: 20px;
}

.ng-card-title-bar {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    background: linear-gradient(0deg, rgba(8,8,12,0.95) 30%, rgba(8,8,12,0.4) 80%, transparent 100%);
    padding: 22px 10px 10px;
}
.ng-card-title {
    font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ng-card-arrow { color: var(--text-accent); flex-shrink: 0; }

.ng-page-header { margin-bottom: 22px; }
.ng-page-header h1 { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.ng-page-header h1 .icon { color: var(--star); }
.ng-page-header p { color: var(--text-muted); font-size: 13.5px; }

@media (max-width: 1200px) { .ng-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 1000px) { .ng-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 700px)  { .ng-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; } }
@media (max-width: 460px)  { .ng-grid { grid-template-columns: repeat(2, 1fr); } }

/* ===================== Category Archive Page ===================== */
.cg-page { padding-top: 20px; padding-bottom: 50px; }

.cg-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); margin-bottom: 18px; }
.cg-breadcrumb a { color: var(--text-accent); }
.cg-breadcrumb span:last-child { color: var(--text-primary); font-weight: 600; }

.cg-header { text-align: center; margin-bottom: 20px; }
.cg-header h1 { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.cg-header p { color: var(--text-muted); font-size: 14px; max-width: 560px; margin: 0 auto; }

.cg-about {
    max-width: 700px; margin: 0 auto 18px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 4px 16px;
}
.cg-about summary {
    display: flex; align-items: center; gap: 8px; padding: 12px 0; cursor: pointer;
    font-size: 13.5px; font-weight: 700; list-style: none;
}
.cg-about summary::-webkit-details-marker { display: none; }
.cg-about summary .icon:first-child { color: var(--text-accent); }
.cg-about-chevron { margin-left: auto; transition: transform .15s ease; }
.cg-about[open] .cg-about-chevron { transform: rotate(90deg); }
.cg-about-body { padding: 0 0 14px; color: var(--text-secondary); font-size: 13.5px; }

.cg-search-box {
    max-width: 560px; margin: 0 auto 18px; display: flex; align-items: center; gap: 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px;
}
.cg-search-icon { color: var(--text-muted); }
.cg-search-box input { flex: 1; background: transparent; border: none; color: var(--text-primary); font-size: 14px; font-family: inherit; }
.cg-search-box input:focus { outline: none; }

.cg-sort-tabs { display: flex; justify-content: center; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.cg-sort-tab {
    padding: 9px 18px; border-radius: 20px; font-size: 13px; font-weight: 700;
    background: var(--surface); border: 1px solid var(--border); color: var(--text-secondary);
}
.cg-sort-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.cg-alpha-row { text-align: center; margin-bottom: 24px; }
.cg-alpha-label { font-size: 11px; font-weight: 800; letter-spacing: 0.6px; color: var(--text-muted); margin-bottom: 10px; }
.cg-alpha-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.cg-alpha-btn {
    min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px;
    background: var(--surface); border: 1px solid var(--border); color: var(--text-secondary); font-size: 12.5px; font-weight: 700;
}
.cg-alpha-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cg-alpha-btn:hover { border-color: var(--accent); }

.cg-random-row { text-align: center; margin-bottom: 26px; }
.cg-random-btn { display: inline-flex; }

.cg-results-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cg-results-count { font-size: 13px; color: var(--text-muted); }
.cg-sort-select {
    background: var(--surface); border: 1px solid var(--border); color: var(--text-primary);
    padding: 8px 12px; border-radius: 8px; font-size: 13px; font-family: inherit;
}

@media (max-width: 600px) {
    .cg-header h1 { font-size: 22px; }
}

/* ===================== Category Archive Page ===================== */
.catp-page { padding-top: 20px; padding-bottom: 50px; }

.catp-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); margin-bottom: 24px; }
.catp-breadcrumb a { display: inline-flex; align-items: center; gap: 5px; color: var(--text-muted); }
.catp-breadcrumb a:hover { color: var(--accent); }

.catp-header { text-align: center; max-width: 640px; margin: 0 auto 24px; }
.catp-header h1 { font-size: 30px; font-weight: 800; margin-bottom: 8px; }
.catp-header p { color: var(--text-muted); font-size: 14px; }

.catp-about { max-width: 640px; margin: 0 auto 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.catp-about-toggle {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; background: transparent; border: none; color: var(--text-primary); font-size: 13.5px; font-weight: 700;
}
.catp-about-toggle span { display: flex; align-items: center; gap: 8px; }
.catp-about-chevron { transition: transform .2s ease; }
.catp-about-toggle.is-open .catp-about-chevron { transform: rotate(180deg); }
.catp-about-body { max-height: 0; overflow: hidden; transition: max-height .25s ease; padding: 0 16px; }
.catp-about-body.is-open { max-height: 300px; padding: 0 16px 16px; }
.catp-about-body p { color: var(--text-secondary); font-size: 13.5px; }

.catp-search-row {
    max-width: 640px; margin: 0 auto 20px; display: flex; align-items: center; gap: 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px;
}
.catp-search-icon { color: var(--text-muted); }
.catp-search-row input { flex: 1; background: transparent; border: none; color: var(--text-primary); font-size: 14px; font-family: inherit; }
.catp-search-row input:focus { outline: none; }

.catp-sort-pills { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }
.catp-pill {
    padding: 9px 18px; border-radius: 20px; font-size: 13px; font-weight: 700;
    background: var(--surface); border: 1px solid var(--border); color: var(--text-secondary);
}
.catp-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.catp-letters { text-align: center; margin-bottom: 20px; }
.catp-letters-label { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.6px; color: var(--text-muted); margin-bottom: 10px; }
.catp-letters-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.catp-letter-btn {
    min-width: 30px; height: 30px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 7px; background: var(--surface); border: 1px solid var(--border); color: var(--text-secondary); font-size: 12px; font-weight: 700;
}
.catp-letter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.catp-letter-btn:hover { border-color: var(--accent); }

.catp-random-row { text-align: center; margin-bottom: 30px; }
.catp-random-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; font-weight: 700; font-size: 14px;
}

.catp-results-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.catp-results-count { font-size: 13px; color: var(--text-muted); }
.catp-results-count strong { color: var(--text-primary); }
.catp-sort-select {
    background: var(--surface); border: 1px solid var(--border); color: var(--text-primary);
    padding: 8px 30px 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 600;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%239a9aa5'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center; background-size: 12px;
}

@media (max-width: 600px) {
    .catp-header h1 { font-size: 22px; }
    .catp-sort-pills { gap: 6px; }
    .catp-pill { padding: 7px 13px; font-size: 12px; }
}

/* ===================== Latest / Search Games Page ===================== */
.lat-page { padding-top: 24px; padding-bottom: 50px; }
.lat-header { margin-bottom: 22px; }
.lat-header h1 { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.lat-star-icon { color: var(--star); }
.lat-header p { color: var(--text-secondary); font-size: 13.5px; }
.lat-header p strong { color: var(--text-primary); }
.lat-query { color: var(--text-accent); }

.lat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }

.lc-card { display: block; }
.lc-thumb { position: relative; aspect-ratio: 3/4; border-radius: 10px; overflow: hidden; background: #000; }
.lc-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.lc-card:hover .lc-thumb img { transform: scale(1.04); }
.lc-badge {
    position: absolute; top: 7px; left: 7px; display: inline-flex; align-items: center; gap: 4px;
    background: rgba(8,8,12,0.8); color: #fff; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 20px;
}
.lc-title-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 9px 2px 0; }
.lc-title {
    font-size: 12.5px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; flex: 1;
}
.lc-arrow { color: var(--text-muted); flex-shrink: 0; }
.lc-card:hover .lc-title { color: var(--text-accent); }

@media (max-width: 1100px) { .lat-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px) { .lat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } .lat-header h1 { font-size: 18px; } }

/* ===================== Trending Leaderboard ===================== */
.tr-page-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.tr-trophy-icon { color: var(--star); }

.tr-hero-live {
    position: absolute; top: 16px; right: 16px; z-index: 2;
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(8,8,12,0.6); border: 1px solid rgba(255,255,255,0.15); color: #fff !important;
    font-size: 11.5px; font-weight: 700; padding: 5px 11px; border-radius: 20px;
}
.tr-hero-download-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; }

.tr-lb-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.tr-section-title { font-size: 17px; font-weight: 800; }
.tr-view-toggle { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.tr-view-btn { display: flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--text-muted); background: transparent; border: none; }
.tr-view-btn.active { background: var(--accent); color: #fff; }

.tr-lb-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tr-lb-columns {
    display: grid; grid-template-columns: 56px 1fr 160px 120px 70px; gap: 10px; align-items: center;
    padding: 12px 16px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.5px; color: var(--text-muted);
    border-bottom: 1px solid var(--border); text-transform: uppercase;
}
.tr-lb-row {
    display: grid; grid-template-columns: 56px 1fr 160px 120px 70px; gap: 10px; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.tr-lb-row:last-child { border-bottom: none; }
.tr-lb-row:hover { background: var(--bg-alt); }
.tr-lb-rank { display: flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 800; color: var(--text-primary); }
.tr-lb-game { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tr-lb-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.tr-lb-game-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tr-lb-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-lb-size { font-size: 11px; color: var(--text-muted); }
.tr-lb-bar-col { display: flex; align-items: center; gap: 8px; }
.tr-lb-bar-track { flex: 1; height: 6px; border-radius: 4px; background: var(--bg-alt); overflow: hidden; }
.tr-lb-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--star)); border-radius: 4px; }
.tr-lb-percent { font-size: 11px; font-weight: 700; color: var(--text-muted); width: 32px; text-align: right; }
.tr-lb-downloads { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.tr-lb-get-btn {
    display: inline-flex; align-items: center; gap: 4px; justify-self: end;
    background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; padding: 6px 12px; border-radius: 7px;
}
.tr-lb-get-btn:hover { background: var(--accent-dark); }

.tr-grid-view { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

@media (max-width: 700px) {
    .tr-lb-columns { display: none; }
    .tr-lb-row { grid-template-columns: 30px 1fr 55px 44px; gap: 6px; }
    .tr-lb-bar-col { display: none; }
    .tr-lb-downloads { font-size: 11px; text-align: right; }
    .tr-lb-title { font-size: 12.5px; }
    .tr-lb-get-btn span, .tr-lb-get-btn { font-size: 0; padding: 8px; }
    .tr-lb-get-btn .icon { font-size: initial; }
}

/* ===================== Mobile Optimization ===================== */
@media (max-width: 1100px) {
    .main-layout { grid-template-columns: 1fr; }
    .games-grid { grid-template-columns: repeat(4, 1fr); }
    .category-strip { grid-template-columns: repeat(4, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .main-navigation {
        position: fixed; top: 64px; left: 0; right: 0; bottom: 0; z-index: 998;
        background: var(--bg); padding: 16px 20px; display: none; overflow-y: auto;
    }
    .main-navigation.active { display: block; }
    .main-navigation ul { flex-direction: column; gap: 0; }
    .main-navigation ul li { border-bottom: 1px solid var(--card-border); padding: 14px 0; }
    .menu-toggle { display: block; }
    .search-toggle-form { display: none; }

    .hero-slide { min-height: 260px; }
    .hero-slide-content { padding: 22px; }
    .hero-slide-content h1 { font-size: 24px; }
    .hero-desc { font-size: 13px; }
    .hero-actions .btn { padding: 9px 14px; font-size: 13px; }

    .category-strip { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .category-box { padding: 12px 6px; }
    .category-box .cat-icon { font-size: 20px; }
    .category-box .cat-name { font-size: 11.5px; }

    .games-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .game-card .game-title { font-size: 12.5px; }
    .game-card .body { padding: 8px 8px 10px; }

    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
    .category-strip { grid-template-columns: repeat(2, 1fr); }
}
