/* =====================================================
   Gam3bug — Neon Arcade Design System
   Dual themes: Dark (default) + Light
   (c) 2026 gam3bug.com
   ===================================================== */

/* --- Theme Variables --- */
:root[data-theme="dark"] {
    --bg-primary: #0a0a12;
    --bg-secondary: #12121e;
    --bg-surface: #12121e;
    --bg-card: #1a1a2e;
    --bg-card-hover: #22223a;
    --text-primary: #e8e8f0;
    --text-secondary: #8888a0;
    --text-muted: #555570;
    --accent-cyan: #00f0ff;
    --accent-magenta: #ff00aa;
    --accent-glow-cyan: 0 0 10px rgba(0, 240, 255, 0.5), 0 0 20px rgba(0, 240, 255, 0.3);
    --accent-glow-magenta: 0 0 10px rgba(255, 0, 170, 0.5), 0 0 20px rgba(255, 0, 170, 0.3);
    --border-color: rgba(0, 240, 255, 0.2);
    --border-glow: 0 0 5px rgba(0, 240, 255, 0.3);
    --grid-color: rgba(0, 240, 255, 0.05);
    --scanline-opacity: 0.03;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.5);
    --gradient-hero: radial-gradient(ellipse at center, rgba(0, 240, 255, 0.1) 0%, transparent 70%);
}

:root[data-theme="light"] {
    --bg-primary: #f5f5fa;
    --bg-secondary: #ffffff;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0f8;
    --text-primary: #1a1a2e;
    --text-secondary: #555570;
    --text-muted: #9999b0;
    --accent-cyan: #0066ff;
    --accent-magenta: #ff0099;
    --accent-glow-cyan: 0 0 5px rgba(0, 102, 255, 0.2);
    --accent-glow-magenta: 0 0 5px rgba(255, 0, 153, 0.2);
    --border-color: rgba(0, 102, 255, 0.15);
    --border-glow: 0 0 3px rgba(0, 102, 255, 0.1);
    --grid-color: rgba(0, 102, 255, 0.03);
    --scanline-opacity: 0;
    --shadow-card: 0 4px 15px rgba(0, 0, 0, 0.08);
    --gradient-hero: radial-gradient(ellipse at center, rgba(0, 102, 255, 0.08) 0%, transparent 70%);
}

/* --- Card title font (Ace Futurism — same face the games use) --- */
@font-face {
    font-family: 'ArcadeTitle';
    src: url('/assets/fonts/futr.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Grid floor background */
body::before {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50vh;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    perspective: 500px;
    transform: perspective(500px) rotateX(60deg);
    transform-origin: bottom;
    pointer-events: none;
    z-index: 0;
}

/* Scanlines overlay (dark theme only) */
.scanlines {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, var(--scanline-opacity)),
        rgba(0, 0, 0, var(--scanline-opacity)) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 9998;
}

/* --- Parallax Arcade Cabinet Background --- */
.bg-arcade-cabinet {
    position: fixed;
    top: 5vh;
    right: -5vw;
    width: 45vw;
    max-width: 600px;
    min-width: 280px;
    height: 75vh;
    max-height: 800px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.10;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 500' preserveAspectRatio='xMidYMid meet'><defs><linearGradient id='cab' x1='0' y1='0' x2='0' y2='1'><stop offset='0' stop-color='%2300f0ff'/><stop offset='0.5' stop-color='%231a1a2e'/><stop offset='1' stop-color='%23ff00aa'/></linearGradient><linearGradient id='screen' x1='0' y1='0' x2='1' y2='1'><stop offset='0' stop-color='%2300f0ff' stop-opacity='0.3'/><stop offset='1' stop-color='%23ff00aa' stop-opacity='0.3'/></linearGradient></defs><rect x='40' y='10' width='220' height='40' rx='4' fill='%231a1a2e' stroke='%2300f0ff' stroke-width='2'/><text x='150' y='38' font-family='monospace' font-size='18' font-weight='bold' fill='%2300f0ff' text-anchor='middle'>GAM3BUG</text><rect x='20' y='55' width='260' height='280' rx='8' fill='url(%23cab)' stroke='%2300f0ff' stroke-width='2'/><rect x='45' y='75' width='210' height='160' rx='4' fill='%23000' stroke='%2300f0ff' stroke-width='1.5'/><rect x='50' y='80' width='200' height='150' rx='2' fill='url(%23screen)'/><text x='150' y='160' font-family='monospace' font-size='24' font-weight='bold' fill='%2300f0ff' text-anchor='middle' opacity='0.6'>INSERT COIN</text><rect x='80' y='250' width='140' height='70' rx='4' fill='%2312121e' stroke='%2300f0ff' stroke-width='1.5'/><circle cx='110' cy='285' r='10' fill='%23ff00aa' stroke='%23fff' stroke-width='1'/><circle cx='140' cy='285' r='10' fill='%2300f0ff' stroke='%23fff' stroke-width='1'/><circle cx='170' cy='285' r='10' fill='%23ff00aa' stroke='%23fff' stroke-width='1'/><circle cx='195' cy='270' r='6' fill='%23ff0' stroke='%23fff' stroke-width='1'/><circle cx='195' cy='300' r='6' fill='%23ff0' stroke='%23fff' stroke-width='1'/><rect x='125' y='265' width='50' height='8' rx='4' fill='%23333' stroke='%2300f0ff' stroke-width='1'/><rect x='30' y='340' width='240' height='140' rx='8' fill='%231a1a2e' stroke='%2300f0ff' stroke-width='2'/><rect x='50' y='360' width='200' height='100' rx='4' fill='%2312121e' stroke='%2300f0ff' stroke-width='1'/><circle cx='150' cy='410' r='25' fill='none' stroke='%2300f0ff' stroke-width='2'/><circle cx='150' cy='410' r='15' fill='%23333' stroke='%23ff00aa' stroke-width='1.5'/><rect x='135' y='485' width='30' height='10' rx='2' fill='%23333' stroke='%2300f0ff' stroke-width='1'/></svg>");
    background-repeat: no-repeat;
    background-position: center top;
    background-size: contain;
    will-change: transform;
}

:root[data-theme="light"] .bg-arcade-cabinet {
    opacity: 0.05;
}

/* --- Parallax Pinball Machine Background (tall pages only) --- */
.bg-pinball-machine {
    position: fixed;
    bottom: 5vh;
    left: -5vw;
    width: 35vw;
    max-width: 450px;
    min-width: 220px;
    height: 60vh;
    max-height: 650px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.07;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 250 450' preserveAspectRatio='xMidYMid meet'><defs><linearGradient id='pb' x1='0' y1='0' x2='0' y2='1'><stop offset='0' stop-color='%23ff00aa'/><stop offset='0.5' stop-color='%231a1a2e'/><stop offset='1' stop-color='%2300f0ff'/></linearGradient><radialGradient id='pbplay' cx='0.5' cy='0.4' r='0.6'><stop offset='0' stop-color='%2300f0ff' stop-opacity='0.2'/><stop offset='1' stop-color='%23ff00aa' stop-opacity='0.1'/></radialGradient></defs><rect x='30' y='5' width='190' height='30' rx='4' fill='%231a1a2e' stroke='%23ff00aa' stroke-width='2'/><text x='125' y='25' font-family='monospace' font-size='14' font-weight='bold' fill='%23ff00aa' text-anchor='middle'>PINBALL</text><rect x='15' y='40' width='220' height='380' rx='12' fill='url(%23pb)' stroke='%23ff00aa' stroke-width='2'/><rect x='30' y='55' width='190' height='340' rx='8' fill='%23000' stroke='%2300f0ff' stroke-width='1'/><rect x='35' y='60' width='180' height='330' rx='4' fill='url(%23pbplay)'/><circle cx='125' cy='100' r='18' fill='none' stroke='%2300f0ff' stroke-width='2'/><circle cx='125' cy='100' r='10' fill='%23ff00aa' stroke='%23fff' stroke-width='1'/><circle cx='80' cy='160' r='14' fill='none' stroke='%23ff00aa' stroke-width='2'/><circle cx='170' cy='160' r='14' fill='none' stroke='%23ff00aa' stroke-width='2'/><circle cx='125' cy='220' r='16' fill='none' stroke='%2300f0ff' stroke-width='2'/><rect x='40' y='280' width='170' height='80' rx='4' fill='%2312121e' stroke='%2300f0ff' stroke-width='1'/><rect x='60' y='300' width='50' height='6' rx='3' fill='%23ff00aa'/><rect x='60' y='315' width='70' height='6' rx='3' fill='%2300f0ff'/><rect x='60' y='330' width='40' height='6' rx='3' fill='%23ff0'/><rect x='140' y='295' width='50' height='50' rx='4' fill='%23333' stroke='%23ff00aa' stroke-width='1'/><circle cx='165' cy='320' r='12' fill='none' stroke='%2300f0ff' stroke-width='1.5'/><rect x='100' y='425' width='50' height='15' rx='3' fill='%23333' stroke='%23ff00aa' stroke-width='1'/></svg>");
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: contain;
    will-change: transform;
    transition: opacity 0.4s ease;
}

:root[data-theme="light"] .bg-pinball-machine {
    opacity: 0.04;
}

@media (max-width: 768px) {
    .bg-arcade-cabinet {
        width: 70vw;
        right: -15vw;
        opacity: 0.07;
    }
    .bg-pinball-machine {
        width: 55vw;
        left: -15vw;
        opacity: 0.05;
    }
}

/* --- Navbar --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(10, 10, 18, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

:root[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.85);
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-decoration: none;
    color: var(--accent-cyan);
    text-shadow: var(--accent-glow-cyan);
    font-family: 'Courier New', monospace;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-cyan);
    text-shadow: var(--accent-glow-cyan);
}

.nav-link.active {
    background: rgba(0, 240, 255, 0.1);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    border-color: var(--accent-cyan);
    box-shadow: var(--border-glow);
}

/* Toggle shows the theme a click switches TO — sun in dark mode, moon in light. */
:root[data-theme="dark"] .theme-icon-dark { display: none; }
:root[data-theme="light"] .theme-icon-light { display: none; }
.theme-icon-light { color: #ffb040; }
.theme-icon-dark { color: var(--accent-cyan); }
.theme-toggle svg { display: block; }

/* --- Main Content --- */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* --- Hero --- */
.hero {
    text-align: center;
    padding: 5rem 2rem 4rem;
    background: var(--gradient-hero);
}

.hero-content { max-width: 600px; margin: 0 auto; }

.hero h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 900;
    letter-spacing: 4px;
    margin-bottom: 1rem;
}

.tagline {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-badges {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.badge {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.05);
}

/* --- Glitch Effect --- */
.glitch {
    position: relative;
    color: var(--accent-cyan);
    text-shadow: var(--accent-glow-cyan);
    animation: glitchPulse 3s infinite;
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    overflow: hidden;
}

.glitch::before {
    color: var(--accent-magenta);
    clip-path: inset(0 0 50% 0);
    animation: glitchTop 3s infinite linear alternate-reverse;
}

.glitch::after {
    color: var(--accent-cyan);
    clip-path: inset(50% 0 0 0);
    animation: glitchBottom 3s infinite linear alternate-reverse;
}

@keyframes glitchPulse {
    0%, 100% { text-shadow: var(--accent-glow-cyan); }
    50% { text-shadow: var(--accent-glow-cyan), var(--accent-glow-magenta); }
}

@keyframes glitchTop {
    0% { transform: translate(0, 0); }
    20% { transform: translate(-2px, -1px); }
    40% { transform: translate(2px, 1px); }
    60% { transform: translate(-1px, 0); }
    80% { transform: translate(1px, -1px); }
    100% { transform: translate(0, 0); }
}

@keyframes glitchBottom {
    0% { transform: translate(0, 0); }
    20% { transform: translate(2px, 1px); }
    40% { transform: translate(-2px, -1px); }
    60% { transform: translate(1px, 0); }
    80% { transform: translate(-1px, 1px); }
    100% { transform: translate(0, 0); }
}

/* --- Section Title --- */
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
    position: relative;
    padding-left: 1.2rem;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: linear-gradient(var(--accent-cyan), var(--accent-magenta));
    border-radius: 2px;
}

/* --- Game Grid --- */
.games-section { padding: 2rem 0; }

/* --- Featured Game --- */
.featured-game {
    padding: 2rem 0;
}

.featured-game-content {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.08), rgba(255, 0, 240, 0.05));
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.featured-game-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-cyan, #00f0ff), var(--accent-magenta, #ff00f0));
}

.featured-game-badge {
    display: inline-block;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.featured-game-title {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 900;
    margin: 0 0 0.5rem;
    color: var(--accent-cyan, #00f0ff);
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.featured-game-genre {
    display: inline-block;
    font-size: 0.9rem;
    color: var(--text-secondary, #8888a0);
    margin-bottom: 1rem;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 240, 255, 0.1);
    border-radius: 12px;
}

.featured-game-desc {
    color: var(--text-secondary, #8888a0);
    max-width: 600px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.featured-game-desc p { margin: 0 0 0.8rem; text-align: justify; }
.featured-game-desc p:last-child { margin-bottom: 0; }

.featured-howto {
    max-width: 640px;
    margin: 0 auto 1.5rem;
    text-align: left;
    background: rgba(0, 240, 255, 0.04);
    border: 1px solid rgba(0, 240, 255, 0.14);
    border-radius: 10px;
    padding: 1rem 1.25rem;
}

.featured-howto h3 {
    color: var(--accent-cyan, #00f0ff);
    font-size: 1rem;
    margin-bottom: 0.5rem;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.featured-howto ul {
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--text-secondary, #8888a0);
    line-height: 1.7;
    font-size: 0.9rem;
}

.featured-howto li::before {
    content: '▸ ';
    color: var(--accent-magenta, #ff00aa);
}

.featured-howto kbd {
    font-family: inherit;
    font-weight: 700;
    color: var(--accent-cyan, #00f0ff);
}

.featured-howto p {
    color: var(--text-secondary, #8888a0);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* Compact API-link row for the featured game on the landing page —
   deliberately unboxed: a line of links, not a card. */
.featured-api-links {
    margin: 0 auto 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary, #8888a0);
}

.featured-api-links .featured-api-label {
    opacity: 0.7;
    margin-right: 0.4rem;
}

.featured-api-links a {
    color: var(--accent-cyan, #00f0ff);
    text-decoration: none;
    margin: 0 0.5rem;
}

.featured-api-links a:hover {
    text-decoration: underline;
}

.featured-game-btn {
    display: inline-block;
    padding: 0.8rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #000;
    background: var(--accent-cyan, #00f0ff);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.featured-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.5);
}

.game-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.game-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 280px;
    min-width: min(280px, 100%);
    max-width: 360px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    position: relative;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-cyan);
    box-shadow: var(--shadow-card), var(--border-glow);
}

.game-card-thumb {
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-secondary);
}

.game-card-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
}

/* Generated card art (inline SVG from the cardmaker) */
.game-card-art { overflow: hidden; }
.game-card-art svg { display: block; width: 100%; height: 100%; transition: filter 0.3s ease; }
.game-card:hover .game-card-art svg { filter: brightness(1.15); }

.game-card-body { padding: 1rem; flex: 1; }

.game-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--accent-cyan, #00f0ff);
    text-shadow: 0 0 12px rgba(0, 240, 255, 0.45);
}

.game-card-genre {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--accent-magenta);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.game-card-plays {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

.game-card-play {
    padding: 0.6rem;
    text-align: center;
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-cyan);
    font-size: 0.9rem;
    font-weight: 600;
    border-top: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.game-card:hover .game-card-play {
    background: var(--accent-cyan);
    color: var(--bg-primary);
}

/* --- Features --- */
.features-section { padding: 3rem 0; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: var(--accent-magenta);
    box-shadow: var(--border-glow);
}

.feature-icon { font-size: 2.5rem; margin-bottom: 1rem; }

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--accent-cyan);
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* --- Game Page --- */
.game-page { padding: 1rem 0; }

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.game-header-info { flex: 1; min-width: 200px; }

.game-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.8rem;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 6px;
    color: var(--accent-cyan, #00f0ff);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-share:hover {
    background: rgba(0, 240, 255, 0.18);
    border-color: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

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

@media (max-width: 480px) {
    .btn-share span { display: none; }
    .btn-share { padding: 0.4rem 0.55rem; }
}

.back-link {
    display: inline-block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
}

.back-link:hover { color: var(--accent-cyan); }

.game-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.game-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.genre-tag {
    color: var(--accent-magenta);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
}

.play-count {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.game-iframe {
    width: 100%;
    height: 600px;
    border: none;
    display: block;
}

.game-info {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.game-page-ad {
    max-width: 728px;
    margin: 1.5rem auto;
    text-align: center;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 240, 255, 0.03);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem;
}

/* How-to-play card — same left-aligned panel everywhere: featured home
   block, play pages, embeds. The ▸ list + <kbd> chips do the styling. */
.game-controls {
    text-align: left;
    background: rgba(0, 240, 255, 0.04);
    border: 1px solid rgba(0, 240, 255, 0.14);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.game-description h3, .game-controls h3 {
    color: var(--accent-cyan);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-description p, .game-controls p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 0.9rem;
    text-align: justify;
}

.game-controls ul {
    list-style: none;
    padding: 0;
    margin: 0 0 0.9rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
}

.game-controls li::before {
    content: '▸ ';
    color: var(--accent-magenta, #ff00aa);
}

.game-controls kbd, .game-description kbd {
    font-family: inherit;
    font-weight: 700;
    color: var(--accent-cyan);
}

.game-description strong, .game-controls strong,
.game-description b, .game-controls b {
    color: var(--text-primary);
}

/* --- Screenshot --- */
.game-screenshot {
    margin: 1.5rem 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
    background: var(--card-bg);
}
.game-screenshot img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 800px;
    margin: 0 auto;
}

/* --- About Page --- */
.about-page, .api-page { padding: 2rem 0; }

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: var(--accent-cyan);
    text-shadow: var(--accent-glow-cyan);
}

/* --- Page Hero (for API, Sitemap, etc.) --- */
.page-hero {
    text-align: center;
    padding: 3rem 2rem 2rem;
    background: var(--gradient-hero, linear-gradient(135deg, #0a0a18 0%, #12121e 100%));
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 12px;
    margin-bottom: 2.5rem;
}

.page-hero .page-title {
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary, #8888a0);
    max-width: 600px;
    margin: 0 auto;
}

.about-section, .api-section {
    margin-bottom: 2.5rem;
}

.about-section h2, .api-section h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.about-section p, .api-section p {
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    text-align: justify;
}

.about-section a, .api-section a {
    color: var(--accent-cyan);
    text-decoration: none;
}

.about-section a:hover, .api-section a:hover {
    text-decoration: underline;
}

.about-quote {
    margin: 1.2rem 0 0.4rem;
    padding: 1rem 1.4rem;
    border-left: 3px solid var(--accent-gold, #ffb040);
    background: rgba(255, 176, 64, 0.07);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.about-quote p {
    color: var(--text-primary) !important;
    font-size: 1.05rem;
    margin-bottom: 0.4rem !important;
}

.about-quote cite {
    font-style: normal;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Architecture diagram */
.arch-diagram {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 500px;
    margin: 1.5rem 0;
}

.arch-box {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
}

.arch-box h3 { color: var(--accent-cyan); margin-bottom: 0.3rem; font-size: 1rem; }
.arch-box p { font-size: 0.85rem; margin: 0; }

.arch-arrow {
    text-align: center;
    color: var(--accent-magenta);
    font-size: 0.85rem;
    padding: 0.3rem;
}

/* --- API Page --- */
.code-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.code-block code {
    color: var(--accent-cyan);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre;
}

.endpoint { margin-bottom: 1.5rem; }

.endpoint h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.method {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.method.get { background: rgba(0, 240, 255, 0.15); color: var(--accent-cyan); }

/* --- 404 --- */
.not-found {
    text-align: center;
    padding: 4rem 2rem;
}

.not-found h1 {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.not-found p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Legal pages (Privacy, Terms) */
.legal-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    line-height: 1.7;
}
.legal-page .page-title {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}
.legal-page .page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}
.legal-page h3 {
    color: var(--accent-cyan, #00f0ff);
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    font-size: 1.15rem;
}
.legal-page h4 {
    color: var(--text-primary);
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}
.legal-page p {
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
}
.legal-page ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}
.legal-page li {
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    line-height: 1.6;
}
.legal-page a {
    color: var(--accent-cyan, #00f0ff);
    text-decoration: underline;
}

.btn-neon {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: transparent;
    border: 1px solid var(--accent-cyan);
    border-radius: 6px;
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-neon:hover {
    background: var(--accent-cyan);
    color: var(--bg-primary);
    box-shadow: var(--accent-glow-cyan);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* --- Footer --- */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    margin-top: 4rem;
    background: var(--bg-secondary);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer p { color: var(--text-secondary); font-size: 0.85rem;
    text-align: justify; }

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.footer-copyright { margin: 0; }

.footer-seo {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    width: 100%;
}
.footer-seo p {
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--text-secondary);
    opacity: 0.6;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.footer-links { display: flex; gap: 1.5rem; }

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
    .navbar { padding: 0.75rem 1rem; }
    .nav-links { gap: 0.75rem; }
    .nav-link { font-size: 0.85rem; padding: 0.3rem 0.5rem; }
    .main-content { padding: 1rem; }
    .hero { padding: 3rem 1rem 2rem; }
    .game-info { grid-template-columns: 1fr; }
    .game-iframe { height: 400px; }
    .footer-content { flex-direction: column; text-align: center; }
    .game-modal-wrapper { width: 100%; max-width: none; }
}

/* --- Rotate Overlay (phones in portrait for landscape games) --- */
.rotate-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0a0a12;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
    padding: 2rem;
}

.rotate-overlay.show {
    display: flex;
}

.rotate-overlay-icon {
    font-size: 4rem;
    animation: rotateHint 2s ease-in-out infinite;
}

.rotate-overlay-text {
    color: var(--accent-cyan, #00f0ff);
    font-size: 1.2rem;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rotate-overlay-subtext {
    color: var(--text-secondary, #8888a0);
    font-size: 0.9rem;
}

@keyframes rotateHint {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-90deg); }
}

/* Show rotate overlay only on touch devices in portrait */
@media (max-width: 768px) and (orientation: portrait) and (pointer: coarse) {
    .rotate-overlay.show {
        display: flex;
    }
}

/* Hide rotate overlay on desktop and landscape */
@media (min-width: 769px), (orientation: landscape) {
    .rotate-overlay {
        display: none !important;
    }
}

/* --- Game Modal (generic container: title bar + game area) --- */
.game-modal-wrapper {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 2rem;
    background: var(--bg-surface, #12121e);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.game-modal-wrapper.game-modal-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: 100vw;
    z-index: 9999;
    border-radius: 0;
    border: none;
}

.game-modal-bar {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 240, 255, 0.05);
    border-bottom: 1px solid rgba(0, 240, 255, 0.15);
    gap: 0.5rem;
}

.game-modal-title {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #e8e8f0);
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-modal-credit {
    flex: none;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #ffffff;
    text-decoration: none;
    opacity: 1;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.game-modal-credit:hover {
    opacity: 0.85;
    color: var(--accent-cyan, #00f0ff);
}

/* Contact page thank-you overlay — shown after a successful submit,
   mirrors the chemdexai contact confirmation modal. */
.g3b-thank-you {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.g3b-thank-you-card {
    background: var(--bg-surface, #141428);
    border: 1px solid var(--border-color, rgba(0,240,255,0.25));
    border-radius: 16px;
    padding: 32px;
    max-width: 460px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.15), 0 12px 32px rgba(0, 0, 0, 0.4);
}

.g3b-thank-you-card h2 {
    margin: 0 0 12px;
    color: var(--text-primary, #e8e8f0);
    font-size: 1.3rem;
}

.g3b-thank-you-card p {
    margin: 0 0 14px;
    color: var(--text-secondary, #8888a0);
    font-size: 14px;
    line-height: 1.5;
}

.game-modal-fs, .game-modal-close {
    background: none;
    border: none;
    /* Match the title (text-primary) — near-white on dark, dark on
       light — and keep base opacity high enough that the controls read
       on touch devices that never fire :hover. */
    color: var(--text-primary, #e8e8f0);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 1;
}

.game-modal-wrapper:hover .game-modal-fs,
.game-modal-wrapper:hover .game-modal-close {
    opacity: 1;
}

.game-modal-fs:hover, .game-modal-close:hover {
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-cyan, #00f0ff);
}

/* Light theme — the modal/bar defaults are dark-theme cyan rgba. */
:root[data-theme="light"] .game-modal-wrapper {
    border-color: rgba(0, 102, 255, 0.25);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}
:root[data-theme="light"] .game-modal-bar {
    background: rgba(0, 102, 255, 0.06);
    border-bottom-color: rgba(0, 102, 255, 0.18);
}
:root[data-theme="light"] .game-modal-fs:hover,
:root[data-theme="light"] .game-modal-close:hover {
    background: rgba(0, 102, 255, 0.1);
}
/* Light theme — pure white vanishes on the light bar; the credit takes
   the same dark ink as the title. */
:root[data-theme="light"] .game-modal-credit { color: var(--text-primary); }
:root[data-theme="light"] .game-card {
    border-color: rgba(0, 102, 255, 0.22);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
:root[data-theme="light"] .game-card:hover {
    box-shadow: 0 8px 24px rgba(0, 102, 255, 0.18);
}

/* Game area inside the modal — the iframe fills it completely.
   position:relative confines the adkit overlay (#g3b-ad) to the game box. */
.game-modal-wrapper .game-container {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 3;
    max-height: 85vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.game-modal-fullscreen .game-container {
    width: 100%;
    height: 100%;
    flex: 1;
    max-width: none;
    aspect-ratio: auto;
    max-height: none;
}

/* --- Loader --- */
.gam3bug-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #0a0a18 0%, #000 100%);
}

.gam3bug-loader-logo {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 900;
    letter-spacing: 4px;
    color: var(--accent-cyan, #00f0ff);
    text-shadow: 0 0 10px var(--accent-cyan, #00f0ff), 0 0 20px var(--accent-cyan, #00f0ff);
    animation: gam3bugLoaderPulse 1.5s ease-in-out infinite;
}

@keyframes gam3bugLoaderPulse {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px var(--accent-cyan, #00f0ff), 0 0 20px var(--accent-cyan, #00f0ff); }
    50% { opacity: 0.7; text-shadow: 0 0 5px var(--accent-cyan, #00f0ff), 0 0 10px var(--accent-cyan, #00f0ff); }
}

.gam3bug-loader-bar {
    width: 80%;
    max-width: 300px;
    height: 6px;
    background: rgba(0, 240, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(0, 240, 255, 0.2);
}

.gam3bug-loader-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-cyan, #00f0ff), var(--accent-magenta, #ff00ff));
    border-radius: 3px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--accent-cyan, #00f0ff);
    animation: gam3bugLoaderShimmer 2s linear infinite;
}

@keyframes gam3bugLoaderShimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.gam3bug-loading-text {
    font-size: 0.85rem;
    color: var(--text-secondary, #8888a0);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
    animation: gam3bugLoaderTextBlink 1.2s ease-in-out infinite;
}

@keyframes gam3bugLoaderTextBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.gam3bug-error {
    color: #ff453a;
    font-size: 0.9rem;
    padding: 1rem;
}

/* --- Embed Section --- */
.embed-section {
    margin-top: 2rem;
}

/* --- Screenshot --- */
.game-screenshot {
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(0, 240, 255, 0.15));
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.game-screenshot img {
    width: 100%;
    display: block;
}

/* --- Edit Details Modal --- */
.edit-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.edit-modal-overlay.show { display: flex; }

.edit-modal {
    background: var(--bg-surface, #12121e);
    border: 1px solid var(--accent-cyan, #00f0ff);
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}

.edit-modal h2 {
    color: var(--accent-cyan, #00f0ff);
    margin-bottom: 1.5rem;
}

.edit-modal .form-group {
    margin-bottom: 1rem;
}

.edit-modal label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-secondary, #8888a0);
}

.edit-modal input, .edit-modal textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--bg-secondary, #0a0a18);
    border: 1px solid var(--border-color, rgba(0, 240, 255, 0.15));
    border-radius: 6px;
    color: var(--text-primary, #e0e0f0);
    font-size: 0.9rem;
    font-family: inherit;
}

.edit-modal input:focus, .edit-modal textarea:focus {
    outline: none;
    border-color: var(--accent-cyan, #00f0ff);
}

.edit-modal textarea {
    resize: vertical;
    min-height: 80px;
}
    padding: 1.5rem;
    background: var(--bg-surface, #12121e);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 8px;
}

.embed-section h3 {
    color: var(--accent-cyan, #00f0ff);
    margin-bottom: 0.5rem;
}

.embed-section p {
    color: var(--text-secondary, #8888a0);
    margin-bottom: 1rem;
}

.embed-code-block {
    position: relative;
    margin-bottom: 1rem;
}

.embed-code-block h4 {
    font-size: 0.85rem;
    color: var(--text-primary, #e8e8f0);
    margin-bottom: 0.5rem;
}

.embed-code-block .code-block {
    position: relative;
    margin-bottom: 0.5rem;
}

.btn-copy {
    padding: 0.35rem 0.75rem;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.2);
    color: var(--accent-cyan, #00f0ff);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: rgba(0, 240, 255, 0.2);
}

.btn-copy-icon {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
    line-height: 1.3;
    opacity: 0.7;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-copy-icon .copy-text {
    font-size: 0.8rem;
}

.btn-copy-icon:hover {
    opacity: 1;
    transform: scale(1.05);
}

.btn-copy-icon.copied {
    color: var(--accent-green, #00ff88);
    opacity: 1;
}

/* --- Contact Page --- */
.contact-page {
    max-width: 600px;
    margin: 0 auto;
}

/* --- Sitemap Page --- */
.sitemap-page { padding: 2rem 0; }

.sitemap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.sitemap-card {
    background: var(--bg-surface, #12121e);
    border: 1px solid var(--border-color, rgba(0, 240, 255, 0.15));
    border-radius: 12px;
    padding: 1.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sitemap-card:hover {
    border-color: var(--accent-cyan, #00f0ff);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
}

.sitemap-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--accent-cyan, #00f0ff);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color, rgba(0, 240, 255, 0.1));
}

.sitemap-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sitemap-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.sitemap-card li:last-child {
    border-bottom: none;
}

.sitemap-card a {
    color: var(--text-primary, #e0e0f0);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.sitemap-card a:hover {
    color: var(--accent-cyan, #00f0ff);
    padding-left: 0.3rem;
}

.sitemap-card a::after {
    content: '→';
    opacity: 0;
    transition: opacity 0.2s ease;
    margin-left: auto;
}

.sitemap-card a:hover::after {
    opacity: 1;
}

.sitemap-xml-link a {
    color: var(--accent-magenta, #ff00ff) !important;
    font-weight: 600;
}

/* Fold up and hide the top bar in fullscreen (desktop + mobile) */
.game-modal-fullscreen .game-modal-bar {
    transform: translateY(-100%);
    height: 0;
    min-height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

/* Mobile fullscreen hint — brief "Press back to exit" message */
.game-modal-fs-hint {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    text-align: center;
    z-index: 10000;
    opacity: 0;
    transform: translateY(-100%);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.game-modal-fs-hint.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===== API Games List ===== */
.api-games-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}
.api-game-item {
    background: var(--bg-surface, #12121e);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 8px;
    padding: 1rem;
    transition: border-color 0.2s, transform 0.2s;
}
.api-game-item:hover {
    border-color: var(--accent-cyan, #00f0ff);
    transform: translateY(-2px);
}
.api-game-item h4 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}
.api-game-item h4 a {
    color: var(--accent-cyan, #00f0ff);
    text-decoration: none;
}
.api-game-item h4 a:hover { text-decoration: underline; }
.api-game-genre {
    color: var(--accent-magenta, #ff00aa);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 0.5rem;
}
.api-game-desc {
    color: var(--text-secondary, #b8b8c8);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0 0 0.5rem;
}
.api-game-slug {
    font-size: 0.75rem;
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-cyan, #00f0ff);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

/* ===== Link Button ===== */
.btn-link {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border: 1px solid var(--accent-cyan, #00f0ff);
    border-radius: 6px;
    color: var(--accent-cyan, #00f0ff);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    background: rgba(0, 240, 255, 0.05);
}

.btn-link:hover {
    background: rgba(0, 240, 255, 0.15);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
    text-decoration: none;
}

.api-note {
    font-size: 0.85rem;
    color: var(--text-secondary, #8888a0);
    font-style: italic;
    margin-top: 0.5rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
    .game-modal-wrapper .game-container {
        max-height: 85vh;
    }
}

/* ===== Mobile contrast — dark-theme game cards read dim on small
   screens: lift the card ground, brighten the art, and push secondary
   text up a full step so titles/meta stay legible on a phone. ===== */
@media (max-width: 768px) {
    :root[data-theme="dark"] {
        --bg-card: #232338;
        --text-secondary: #b4b4cc;
        --text-muted: #8a8aa6;
    }
    :root[data-theme="dark"] .game-card {
        border-color: rgba(0, 240, 255, 0.34);
        box-shadow: 0 2px 14px rgba(0, 0, 0, 0.45),
            inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    }
    :root[data-theme="dark"] .game-card-art svg,
    :root[data-theme="dark"] .game-card-thumb {
        filter: brightness(1.22) saturate(1.08);
    }
    :root[data-theme="dark"] .game-card-title {
        font-size: 1.15rem;
        text-shadow: 0 0 14px rgba(0, 240, 255, 0.6);
    }
    :root[data-theme="dark"] .game-card-desc {
        font-size: 0.95rem;
        line-height: 1.45;
    }
}
