/* ============================================================================================
 * arcade.css — DweebArcade shared chrome (WebDweeb design DNA, standalone). A DweebThings production.
 *
 * Same token vocabulary as WebDweeb (--bg-main / --text-main / --accent / --surface /
 * --border-soft / --base-shade + radius/shadow/font vars) so a WebDweeb theme engine could
 * one day drive this site unchanged. Dark is the DEFAULT here (arcade identity), not a mode.
 *
 * PALETTE: WebDweeb's admin dark theme — dark forest / sage green (#0f1512 window,
 * #18201b panels, #5f9a7a accent). The arcade wears the family's after-hours colors.
 *
 * Games NEVER link this file — every game in /games/ is fully self-contained by design.
 * ============================================================================================ */

:root {
    --bg-main: #0f1512;
    --text-main: #e7ece8;
    --accent: #5f9a7a;
    --base-shade: 255, 255, 255;
    --surface: #18201b;
    --border-soft: rgba(255, 255, 255, 0.13);
    --border-medium: rgba(255, 255, 255, 0.22);
    --glass-border: var(--border-soft); /* legacy alias kept for WebDweeb parity */
    --font-main: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'Space Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    /* TYPE SCALE — matches WebDweeb (Tailwind scale): 16px body, tracking-tight titles, 700 headings.
       Roles: display=page/hero titles, h2=section, h3=subsection, h4=card/small title, lead=intro,
       body=default, sm=secondary, xs=caption/chip, label=mono uppercase kicker. */
    --fs-display: clamp(30px, 6vw, 48px);
    --fs-h2: clamp(22px, 3vw, 30px);
    --fs-h3: 20px;
    --fs-h4: 16px;
    --fs-lead: 18px;
    --fs-body: 16px;
    --fs-sm: 14px;
    --fs-xs: 12px;
    --fs-label: 11px;
    --fw-heading: 700;
    --header-bg: rgba(15, 21, 18, 0.85);
    --header-text: #e7ece8;
    --header-size: 15px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --shadow-card: 0 8px 32px -4px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { background-color: var(--bg-main); overflow-x: hidden; scroll-behavior: smooth; }
body {
    font-family: var(--font-main);
    font-size: var(--fs-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    margin: 0;
    min-height: 100vh;
    /* WebDweeb's bg-pattern engine, arcade blend: the bg-glow ambience plus a whisper of
       bg-scanlines (their exact technique, alpha tuned for a dark ground). */
    background-image:
        linear-gradient(rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.14) 50%),
        radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--accent), transparent 92%), transparent 45%),
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--accent), transparent 94%), transparent 40%),
        radial-gradient(circle at 50% 100%, color-mix(in srgb, var(--accent), transparent 95%), transparent 35%);
    background-size: 100% 4px, auto, auto, auto;
    background-attachment: fixed;
}
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; }

/* --- STRUCTURAL BLOCKS (WebDweeb parity) --- */
.content-card {
    background-color: var(--bg-main);
    position: relative;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.content-card::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: var(--surface);
}
.content-card > * { position: relative; z-index: 1; }

/* (.gradient-text retired in the WebDweeb-parity pass: headlines are solid ink now.) */

/* --- NAV (same skeleton as WebDweeb's .top-bar) --- */
.top-bar {
    position: sticky; top: 0; width: 100%; height: 70px;
    background: var(--header-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-soft); z-index: 50;
}
.top-bar-inner {
    max-width: 1280px; width: 100%; margin: 0 auto; padding: 0 5vw;
    display: flex; align-items: center; justify-content: space-between; height: 100%;
}
.nav-logo-container { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.nav-logo-icon {
    width: 12px; height: 12px; border-radius: 3px; background: var(--accent); flex-shrink: 0;
    transform: rotate(45deg);
}
.nav-logo-text { font-size: 18px; font-weight: 700; color: var(--text-main); letter-spacing: -0.02em; margin: 0; display: flex; }
/* The DweebArcade wordmark logo (white variant) is the sole nav brand element (the diamond mark
   was removed), so it carries a bit more size. */
.nav-logo-img { height: 28px; width: auto; display: block; }
@media (max-width: 420px) { .nav-logo-img { height: 24px; } }
.nav-logo-text .logo-arcade { color: var(--accent); }
.nav-tagline {
    font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.02em; text-transform: none;
    color: var(--text-main); opacity: 0.45; margin-left: 8px; display: none; white-space: nowrap;
}
/* Show the tagline only on wide screens; below this the 6 nav links need the room. */
@media (min-width: 1000px) { .nav-tagline { display: inline; } }
.nav-links { display: flex; align-items: center; gap: 24px; font-size: var(--header-size); font-weight: 600; }
.nav-link { color: var(--text-main); opacity: 0.65; text-decoration: none; transition: 0.2s; padding: 6px 0; position: relative; }
.nav-link:hover, .nav-link.active { opacity: 1; color: var(--accent); }
.nav-link::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
    background: var(--accent); border-radius: 2px; transform: scaleX(0); transition: transform 0.2s ease;
}
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

.mobile-menu-btn { display: none; background: transparent; border: none; color: var(--text-main); cursor: pointer; padding: 6px; }
.mobile-menu-btn svg { width: 24px; height: 24px; }
#mobile-menu-overlay {
    position: fixed; inset: 0; z-index: 9000; background: var(--bg-main);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem;
    transition: opacity 0.2s, visibility 0.2s;
}
.mobile-nav-link { font-size: 22px; font-weight: 700; color: var(--text-main); text-decoration: none; transition: 0.2s; }
.mobile-nav-link:hover, .mobile-nav-link.active { color: var(--accent); }
.mobile-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.mobile-visible { opacity: 1; visibility: visible; pointer-events: auto; }
@media (max-width: 799px) { .mobile-menu-btn { display: block; } .nav-links { display: none; } }

/* --- PAGE SCAFFOLD --- */
.page-wrap { max-width: 1280px; margin: 0 auto; padding: 0 5vw 44px; }

/* Heroes wear WebDweeb's headline scale now: solid ink, 800 weight, an eyebrow instead of a
   tracking-heavy mono label. The landing-page mega-clamp + gradient text are gone on purpose. */
.hero { padding: 46px 0 34px; }
.hero-kicker {
    font-size: var(--fs-label); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
    color: var(--accent); margin: 0 0 10px;
}
.hero-title { font-size: var(--fs-display); font-weight: var(--fw-heading); letter-spacing: -0.02em; margin: 0 0 12px; }
.hero-sub { font-size: var(--fs-lead); max-width: 620px; opacity: 0.75; margin: 0; line-height: 1.6; }
/* About page header carries the prominence (kelso: bigger headline + sub, lead box stays plain). Scoped by id so news/contact headers are unchanged. */
/* Matches .hero-title so the About headline sits at the same size as News + Contact. */
#about-headline { font-size: var(--fs-display); font-weight: var(--fw-heading); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 12px; }
#about-sub { font-size: var(--fs-lead); max-width: 680px; opacity: 0.85; line-height: 1.6; }

/* Bare page-section header, WebDweeb's .page-header-row DNA: accent icon tile + solid title. */
.page-header-row { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; }
.page-title-icon {
    width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--accent);
    color: var(--bg-main); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.page-title-icon svg { width: 20px; height: 20px; }
.page-header-title { font-size: var(--fs-h3); font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.page-header-sub { font-size: var(--fs-xs); opacity: 0.55; margin: 2px 0 0; }

/* The module wrapper, WebDweeb's .wd-module verbatim shape on the dark ground. */
.wd-module {
    background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
    overflow: hidden; display: flex; flex-direction: column;
}
.wd-module-header {
    background: rgba(255, 255, 255, 0.03); padding: 13px 20px;
    border-bottom: 1px solid var(--border-soft);
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.wd-module-title { font-size: var(--fs-sm); font-weight: 700; margin: 0; text-transform: uppercase; letter-spacing: 0.04em; }
.wd-module-action { font-size: var(--fs-sm); font-weight: 600; opacity: 0.55; text-decoration: none; transition: 0.2s; flex-shrink: 0; }
.wd-module-action:hover { opacity: 1; color: var(--accent); }

/* Promise strip — play / download / offline */
.promise-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 30px 0 46px; }
.promise { display: flex; gap: 13px; align-items: flex-start; padding: 18px 20px; }
.promise-icon {
    /* WebDweeb's .dlhub-stat-icon chip: accent-tint fill, small radius, no outline. */
    width: 36px; height: 36px; flex-shrink: 0; border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent); display: flex; align-items: center; justify-content: center;
}
.promise-icon svg { width: 18px; height: 18px; }
.promise h3 { font-size: var(--fs-h4); font-weight: var(--fw-heading); margin: 1px 0 3px; }
.promise p { font-size: var(--fs-sm); opacity: 0.65; margin: 0; line-height: 1.5; }

/* --- FILTERS + SEARCH (WebDweeb pill language) --- */
.grid-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 26px; }
/* The pills are concatenated with no separator by renderFilters(); #filter-row is the flex
   container that actually gives them breathing room (wraps to new rows on narrow screens). */
#filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
/* WebDweeb's .vid-filter-pill recipe: surface fill, hairline border, solid accent when active. */
.filter-btn {
    font-size: var(--fs-xs); letter-spacing: 0.01em; cursor: pointer; outline: none;
    padding: 6px 16px; border-radius: 9999px; font-family: var(--font-main);
    border: 1px solid var(--border-soft); background: var(--surface);
    font-weight: 600; color: var(--text-main); opacity: 0.65; transition: 0.2s;
}
.filter-btn:hover { opacity: 1; border-color: var(--accent); }
.filter-btn.active {
    opacity: 1; background-color: var(--accent); color: #fff; border-color: var(--accent);
}
.grid-search { position: relative; margin-left: auto; min-width: 200px; }
.grid-search input {
    width: 100%; padding: 9px 14px 9px 34px; border: 1px solid var(--border-soft); border-radius: 9999px;
    background: rgba(var(--base-shade), 0.04); color: var(--text-main); font-size: var(--fs-sm); outline: none;
    transition: 0.2s; font-family: var(--font-main);
}
.grid-search input:focus { border-color: var(--accent); }
.grid-search svg {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px; opacity: 0.4; pointer-events: none;
}

/* --- GAME GRID --- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.game-card { display: flex; flex-direction: column; transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.game-card:hover {
    /* WebDweeb's card hover: a 2px lift + deeper shadow, border warms to the game's own accent. */
    transform: translateY(-2px); border-color: color-mix(in srgb, var(--ga, var(--accent)) 45%, transparent);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.game-card.is-unreleased { opacity: 0.62; }
.game-card.is-unreleased:hover { transform: none; border-color: var(--border-soft); }

.game-thumb {
    aspect-ratio: 16 / 9; position: relative; overflow: hidden;
    border-bottom: 1px solid var(--border-soft);
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
        linear-gradient(145deg, #17231c, #0a100c);
}
.game-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-thumb .thumb-glyph {
    font-size: 52px; line-height: 1; color: var(--accent);
    text-shadow: 0 0 24px color-mix(in srgb, var(--accent), transparent 40%);
    font-family: var(--font-mono);
}
/* CRT scanlines over the tile — the arcade wink */
.game-thumb::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(rgba(0,0,0,0) 50%, rgba(0,0,0,0.18) 50%);
    background-size: 100% 4px; mix-blend-mode: overlay;
}
/* Tinted glass (per-game --ga): the glyph tile's backdrop, and the art tile's too, so the lazy-load gap
   (or a missing banner, which onerror drops) shows the game's own color under the title, not a blank. */
.game-thumb.thumb-wall, .game-thumb.thumb-art {
    background:
        radial-gradient(58% 60% at 50% 42%, color-mix(in srgb, var(--ga, var(--accent)) 22%, transparent), transparent 70%),
        linear-gradient(150deg, color-mix(in srgb, var(--ga, var(--accent)) 13%, #0a0f0c), #06090b);
}
/* PERF (2026-09-09): card art is the same animated banner the rotator uses, so a full catalog is a
   wall of animated SVGs all running at once, which cost more than a whole CPU core in Safari.
   arcade.watchCardArt() gives every tile three states, and both hidden ones cost nothing:
     .art-idle   scrolled well away: the image is hidden, so it stops animating. The tinted glass
                 above shows through, which is what a card looks like before its art loads anyway.
     .art-held   seen already: the art is frozen on the frame it reached, painted into a canvas laid
                 over the image. Indistinguishable from the live art, just still.
     (neither)   the card is on screen and playing, for HOLD_MS after it scrolls in.
   The classes go on the TILE, never the <img>, so whatever the resting state is can never affect
   the box the observers measure. */
.game-thumb.art-idle img { visibility: hidden; }
.game-thumb.art-held img { visibility: hidden; }
.game-thumb .thumb-freeze {
    position: absolute; inset: 0; width: 100%; height: 100%; display: block;
    visibility: hidden; pointer-events: none;
}
.game-thumb.art-held .thumb-freeze { visibility: visible; }
.thumb-wall .tw-badge {
    position: relative; z-index: 1; width: 78px; height: 78px; border-radius: 19px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-size: 42px; line-height: 1; color: #06110b; background: var(--ga, var(--accent));
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--ga, var(--accent)), transparent 82%),
                0 14px 34px -8px color-mix(in srgb, var(--ga, var(--accent)), transparent 30%);
    transition: transform 0.25s ease;
}
.game-card:hover .thumb-wall .tw-badge { transform: translateY(-3px) rotate(-3deg); }

.game-body { padding: 16px 18px 6px; flex: 1; }
.game-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.game-title { font-size: var(--fs-h4); font-weight: 700; letter-spacing: -0.01em; }
.game-blurb { font-size: var(--fs-sm); opacity: 0.7; margin: 0; line-height: 1.55; }
/* Banner-style cover title laid over the card art (art cards only), mirroring the rotator's two-tone
   .rot-name: white first line, accent (--ga) second line, over a top scrim for legibility. */
.game-thumb .thumb-scrim { position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(180deg, rgba(4,8,6,0.74) 0%, rgba(4,8,6,0.30) 28%, transparent 52%); }
.game-thumb .thumb-title { position: absolute; left: 14px; top: 11px; right: 70px; z-index: 3; margin: 0;
    font-family: var(--font-main); font-weight: 900; font-size: clamp(18px, 5.4vw, 23px);
    line-height: 0.9; letter-spacing: -0.4px; color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,0.62); }
.game-thumb .thumb-title span { color: var(--ga, var(--accent));
    text-shadow: 0 0 16px color-mix(in srgb, var(--ga, var(--accent)), transparent 45%); }
.game-thumb .status-badge.thumb-status { position: absolute; top: 10px; right: 10px; z-index: 3; }
.game-meta {
    display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px 0;
    font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.06em;
}
.meta-chip {
    padding: 3px 9px; border-radius: 9999px; border: 1px solid var(--border-soft);
    opacity: 0.7; text-transform: uppercase;
}
/* Personal best chip (per device, stored in the shell; games report their score by postMessage).
   Reads as a real record: a soft accent-tinted pill, a trophy in the game's accent, a Best caption. */
.pb-line {
    display: flex; align-items: center; gap: 7px;
    margin: 8px 18px 2px; padding: 5px 10px 5px 9px; /* 18px sides = the button-row inset, so it lines up */
    border-radius: 8px; font-family: var(--font-mono); font-size: 12.5px;
    background: color-mix(in srgb, var(--ga, var(--accent)) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--ga, var(--accent)) 26%, transparent);
}
.pb-ic { width: 15px; height: 15px; color: var(--ga, var(--accent)); flex-shrink: 0; }
.pb-label { font-size: 9px; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; color: var(--ga, var(--accent)); flex-shrink: 0; }
.pb-val { color: var(--text-main); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-reset {
    margin-left: auto; background: none; border: none; color: var(--text-main); cursor: pointer;
    font-size: 14px; line-height: 1; padding: 0 2px; opacity: 0.3; transition: opacity 0.15s, color 0.15s; flex-shrink: 0;
}
.pb-reset:hover, .pb-reset:focus-visible { opacity: 1; color: var(--ga, var(--accent)); }
.status-badge {
    font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; padding: 3px 9px; border-radius: 9999px; flex-shrink: 0;
}
.status-live { color: #34d399; border: 1px solid rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.status-in-development { color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.status-soon { color: var(--text-main); border: 1px solid var(--border-soft); opacity: 0.55; }

.game-actions { display: flex; gap: 10px; padding: 16px 18px 18px; }

/* --- BUTTONS (WebDweeb .btn-accent-fill + a ghost partner) --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 20px; border-radius: var(--radius-md);
    font-family: var(--font-main); font-weight: 700; font-size: var(--fs-label); letter-spacing: 0.05em;
    text-transform: uppercase; text-decoration: none; cursor: pointer; transition: 0.2s;
    border: 1px solid transparent;
}
.btn svg { width: 14px; height: 14px; }
.btn-accent-fill { background: var(--accent); color: var(--bg-main); border-color: var(--accent); }
.btn-accent-fill:hover { background: color-mix(in srgb, var(--accent) 82%, white); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-main); border-color: var(--border-medium); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { flex: 1; }

.item-hidden { display: none !important; }
.item-visible { animation: fadeIn 0.4s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- PLAYER OVERLAY --- */
#player-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(15, 21, 18, 0.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center; padding: 3vh 3vw;
    transition: opacity 0.2s ease, visibility 0.2s;
}
/* Per-game backdrop: the "neon vocabulary wall" (assets/backdrops/<slug>.svg) — a dark arcade
   room hung with neon signs from that game's own symbol set. One full-bleed composition, shown
   as-is (its light pools and scanlines are baked in). Negative z-index parks it between the
   overlay background and the player shell; games without art keep the classic dark overlay. */
#player-overlay::before {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image: var(--player-backdrop, none);
    background-size: cover; background-position: center;
    opacity: 0; transition: opacity 0.4s ease;
}
#player-overlay.has-backdrop::before { opacity: 1; }
/* Soft vignette over the wall so the eye settles on the game, not the signage. */
#player-overlay.has-backdrop::after {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.30) 100%);
}
#player-overlay.player-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.player-shell {
    /* Stadium framing: the game is a window INSIDE the decorated room, not wall-to-wall.
       The border of backdrop pattern around it is the point. */
    width: min(1020px, 90%); height: 100%; max-height: 86vh;
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
}
@media (max-width: 700px) {
    /* Phones: gameplay space wins over decoration. */
    .player-shell { width: 100%; max-height: 94vh; }
}
.player-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-bottom: 1px solid var(--border-soft); flex-shrink: 0;
}
.player-title { font-size: var(--fs-sm); font-weight: 700; letter-spacing: -0.01em; margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-title::before { content: '▮ '; color: var(--accent); }
.player-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent; border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
    color: var(--text-main); font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.08em;
    text-transform: uppercase; text-decoration: none; padding: 6px 11px; cursor: pointer; transition: 0.2s;
    flex-shrink: 0;
}
.player-btn:hover { border-color: var(--accent); color: var(--accent); }
.player-btn svg { width: 13px; height: 13px; }
/* Phones: four labeled buttons overflow the bar, and .player-shell clips the overflow, pushing
   Close off-screen. Collapse to icon-only with real tap targets so every control stays on the bar. */
@media (max-width: 560px) {
    .player-bar { gap: 6px; padding: 8px 10px; }
    .player-btn { padding: 0; min-width: 40px; height: 38px; justify-content: center; }
    .player-btn .btn-label { display: none; }
    .player-btn svg { width: 17px; height: 17px; }
}
.player-stage { flex: 1; min-height: 0; background: #000; }
.player-stage iframe { width: 100%; height: 100%; border: none; display: block; background: #000; }
/* When the stage container itself is fullscreened, let the shell fill it edge to edge. */
.player-shell:fullscreen { max-height: none; width: 100%; border-radius: 0; }

/* --- ABOUT / PROSE PAGES --- */
.prose-card { padding: 34px 36px; margin-bottom: 22px; }
.prose-card h2 { font-size: var(--fs-h3); font-weight: 700; letter-spacing: -0.01em; margin: 0 0 14px; }
.prose-card h2 .h-index { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--accent); margin-right: 10px; }
.prose-card p { font-size: var(--fs-body); opacity: 0.8; margin: 0 0 12px; }
.prose-card p:last-child { margin-bottom: 0; }
.prose-card code {
    font-family: var(--font-mono); font-size: var(--fs-xs);
    background: rgba(var(--base-shade), 0.07); border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm); padding: 1px 6px;
}
.prose-card ul { margin: 0 0 12px; padding-left: 20px; }
.prose-card li { font-size: var(--fs-body); opacity: 0.8; margin-bottom: 6px; }

/* About page intro stays a plain prose card (kelso: emphasis belongs on the headline, not this box). */

/* --- MARQUEE TICKER (arcade signage under the nav; hidden offline) --- */
.marquee { display: none; border-bottom: 1px solid var(--border-soft); background: rgba(0, 0, 0, 0.25); overflow: hidden; }
.marquee.ticker-visible { display: block; }
.marquee-track {
    display: inline-flex; gap: 0; white-space: nowrap; padding: 7px 0;
    font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.12em; text-transform: uppercase;
    animation: marquee-scroll 30s linear infinite; will-change: transform;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { padding: 0 28px; opacity: 0.7; flex-shrink: 0; }
.marquee-track span b { color: var(--accent); font-weight: 700; }
.marquee-track span::before { content: '◆'; color: var(--accent); margin-right: 28px; opacity: 0.5; }
@keyframes marquee-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ============ HOME HERO: the upright cabinet in a neon-sign room (A + C) ============ */
.hero-cabinet {
    position: relative; overflow: hidden; isolation: isolate;
    /* full-bleed: the arcade room runs browser edge-to-edge, breaking out of the page-wrap max-width.
       left:50% + translateX(-50%) centers the 100vw block symmetrically (html's overflow-x:hidden
       clips the scrollbar remainder evenly, so no sideways shift). */
    width: 100vw; left: 50%; transform: translateX(-50%);
    /* align-items:flex-end + no bottom padding plants the cabinet on the floor (not floating) */
    padding: 46px 0 0; display: flex; justify-content: center; align-items: flex-end;
    gap: clamp(14px, 2.6vw, 34px);
    --neon: color-mix(in srgb, var(--accent) 60%, #eafff4);
    --cab-ink: #070b09;
}
/* the room: a drawn retro arcade (assets/hero-arcade.svg) — a back wall lined with cabinets whose
   screens are subtle green pixel-art, a neon perspective floor, ceiling downlights. The CSS cabinet
   sits in front of this as the machine you walked up to. Faint scanlines keep the CRT-room feel. */
.hero-room {
    position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
    background: #060d0a url('hero-arcade.svg?v=20260730d') center / cover no-repeat;
}
.hero-room::before {
    content: ''; position: absolute; inset: 0;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px);
    opacity: 0.3;
}
/* edge vignette + a bottom fade that dissolves the room into the page background (seamless join) */
.hero-room::after {
    content: ''; position: absolute; inset: 0;
    background:
        linear-gradient(180deg, transparent 55%, var(--bg-main) 100%),
        radial-gradient(92% 94% at 50% 52%, transparent 54%, rgba(3, 7, 5, 0.45) 100%);
}

/* the cabinet body */
.cabinet { position: relative; z-index: 1; width: min(560px, 92%); }
.cab-marquee {
    position: relative; text-align: center; padding: 22px 22px 18px; border-radius: 14px 14px 6px 6px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent), var(--cab-ink) 66%), var(--cab-ink));
    border: 1px solid var(--border-soft);
    box-shadow: 0 0 44px -8px color-mix(in srgb, var(--accent), transparent 40%), inset 0 1px 0 rgba(255,255,255,0.06);
}
.cab-bulbs {
    position: absolute; left: 16px; right: 16px; top: 8px; height: 6px; border-radius: 4px;
    background: repeating-linear-gradient(90deg, var(--neon) 0 5px, transparent 5px 16px);
    box-shadow: 0 0 8px color-mix(in srgb, var(--neon), transparent 40%);
    animation: cab-bulbs 1.5s steps(2) infinite;
}
@keyframes cab-bulbs { 50% { opacity: 0.45; } }
.cab-wordmark { line-height: 0; margin-top: 10px; }
.cab-wordmark .wm-svg {
    width: min(420px, 84%); height: auto; shape-rendering: crispEdges;
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--neon), transparent 55%));
}
/* The real DweebArcade wordmark (green-outline variant) on the cabinet marquee. Neon drop-shadow
   makes the white letters glow on the dark-green glass. */
.cab-wordmark .wm-logo {
    width: min(430px, 86%); height: auto; display: inline-block;
    filter: drop-shadow(0 0 12px color-mix(in srgb, var(--neon), transparent 52%));
}
.cab-wordmark .wm-a { fill: var(--text-main); }
.cab-wordmark .wm-b { fill: var(--neon); }
.cab-tag {
    margin: 12px 0 0; font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.04em;
    text-transform: none; color: var(--text-muted, #93a49a);
}
.cab-hood {
    height: 14px; margin: 0 10px; background: linear-gradient(180deg, #0c110e, var(--cab-ink));
    border-left: 1px solid var(--border-soft); border-right: 1px solid var(--border-soft);
}
.cab-body {
    position: relative; padding: 22px 26px 16px; border-radius: 0 0 12px 12px; overflow: hidden;
    border: 1px solid var(--border-soft); border-top: 0;
    background: linear-gradient(180deg, #0e140f, #0a0f0c);
}
/* the CRT screen: Insert Coin + readout live inside the glass */
.cab-screen {
    position: relative; min-height: 214px; padding: 26px 22px; border-radius: 64px / 40px;
    border: 10px solid rgba(4,7,6,0.7); outline: 1px solid var(--border-soft);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center;
    background: radial-gradient(120% 120% at 50% 36%, color-mix(in srgb, var(--surface), #0a1410 40%) 0%, #060a08 78%);
    box-shadow: inset 0 0 60px 10px rgba(0,0,0,0.7), inset 0 0 8px 2px color-mix(in srgb, var(--accent), transparent 88%), 0 18px 50px -18px #000;
}
.cab-screen::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
    background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.045) 0 1px, transparent 1px 3px);
    mix-blend-mode: overlay;
}
.hero-readout {
    position: relative; z-index: 1; margin: 0; min-height: 1.2em;
    font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.13em; text-transform: uppercase;
    color: var(--neon); opacity: 0.9; text-shadow: 0 0 10px color-mix(in srgb, var(--neon), transparent 55%);
    transition: opacity 0.26s ease;
}
.hero-readout b { color: #fff; font-weight: 700; }
.cab-press {
    position: relative; z-index: 1; margin: 0;
    font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.3em; text-transform: uppercase; color: var(--accent);
    animation: cab-press 1.1s steps(1) infinite;
}
@keyframes cab-press { 50% { opacity: 0.15; } }

/* INSERT COIN: the original bordered, pulsing, mono CTA (kelso's preferred look), adapted to
   the cabinet's neon on the dark screen. id/class kept: renderInsertCoin() toggles .coin-visible. */
.insert-coin {
    position: relative; z-index: 1; display: none; align-items: center; gap: 12px; margin: 0;
    background: transparent; border: 2px solid var(--neon); border-radius: 10px; cursor: pointer;
    font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--neon); padding: 14px 28px; white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
    animation: coin-pulse 2.4s ease-in-out infinite;
}
.insert-coin.coin-visible { display: inline-flex; }
.insert-coin:hover { background: var(--neon); color: var(--cab-ink); animation-play-state: paused; }
.insert-coin .coin-slot { width: 6px; height: 18px; border-radius: 2px; background: currentColor; }
.insert-coin small { font-size: var(--fs-label); letter-spacing: 0.1em; opacity: 0.7; }
@keyframes coin-pulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--neon), transparent 58%); }
    50%      { box-shadow: 0 0 24px 2px color-mix(in srgb, var(--neon), transparent 58%); }
}
@media (prefers-reduced-motion: reduce) { .insert-coin { animation: none; } }

/* control deck: joystick + buttons, tilted like a real panel */
.cab-deck {
    margin: 18px 6px 0; height: 66px; border-radius: 8px; border: 1px solid var(--border-soft);
    background: linear-gradient(180deg, #12180f, #0b0f0b);
    transform: perspective(500px) rotateX(24deg); transform-origin: top;
    display: flex; align-items: center; justify-content: center; gap: 22px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.6);
}
.cab-stick { position: relative; width: 13px; height: 32px; border-radius: 7px; background: linear-gradient(180deg, #2a3a30, #0d1310); }
.cab-stick::before {
    content: ''; position: absolute; left: 50%; top: -8px; transform: translateX(-50%); width: 18px; height: 18px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ff6b6b, #a11d1d); box-shadow: 0 3px 8px rgba(0,0,0,0.6);
}
.cab-buttons { display: flex; gap: 11px; }
.cab-buttons b { width: 24px; height: 24px; border-radius: 50%; box-shadow: 0 4px 8px rgba(0,0,0,0.5), inset 0 2px 3px rgba(255,255,255,0.25); }
.cab-buttons b:nth-child(1) { background: radial-gradient(circle at 35% 30%, var(--neon), #2e6a4b); }
.cab-buttons b:nth-child(2) { background: radial-gradient(circle at 35% 30%, #ffd27a, #a97a1e); }
.cab-buttons b:nth-child(3) { background: radial-gradient(circle at 35% 30%, #8ab6ff, #2c56a3); }
/* coin slot detail */
.cab-coinslot {
    margin: 14px auto 2px; width: 118px; height: 20px; border-radius: 4px;
    background: rgba(4,7,6,0.7); border: 1px solid var(--border-soft);
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.cab-coinslot i { width: 32px; height: 5px; border-radius: 3px; background: #000; box-shadow: inset 0 0 4px color-mix(in srgb, var(--neon), transparent 55%); }
.cab-coinslot span { font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-muted, #93a49a); }

/* flanking mini-cabinets: quick-launchers that fill the side space (left = Featured, right = Surprise Me) */
.mini-cab {
    position: relative; z-index: 1; flex-shrink: 0; align-self: center;
    display: flex; flex-direction: column; width: clamp(118px, 11vw, 148px);
    padding: 0; border: 0; background: transparent; font: inherit; color: var(--text-main); cursor: pointer;
    opacity: 0.78; transition: transform 0.16s ease, opacity 0.16s ease;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.38));
}
.mini-cab:hover { transform: translateY(-4px); opacity: 1; }
.mini-cab:focus-visible { outline: 2px solid var(--neon); outline-offset: 4px; border-radius: 12px; }
.mini-marquee {
    text-align: center; padding: 7px 8px 6px; border-radius: 9px 9px 3px 3px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent), var(--cab-ink) 74%), var(--cab-ink));
    border: 1px solid var(--border-soft); border-bottom: 0;
    font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
    color: color-mix(in srgb, var(--neon), var(--text-muted, #93a49a) 40%); transition: color 0.16s ease;
}
.mini-screen {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
    padding: 16px 12px; min-height: 92px; border: 6px solid rgba(4,7,6,0.7); border-radius: 22px / 16px;
    background: radial-gradient(120% 120% at 50% 36%, color-mix(in srgb, var(--surface), #0a1410 40%), #060a08 80%);
    box-shadow: inset 0 0 30px 6px rgba(0,0,0,0.7);
}
.mini-screen::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.04) 0 1px, transparent 1px 3px); mix-blend-mode: overlay;
}
.mini-glyph { font-size: 28px; line-height: 1; color: var(--neon); text-shadow: 0 0 12px color-mix(in srgb, var(--neon), transparent 58%); }
.mini-title {
    font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text-main); opacity: 0.82; text-align: center; line-height: 1.3;
}
.mini-slot {
    text-align: center; padding: 7px; border-radius: 0 0 8px 8px; border: 1px solid var(--border-soft); border-top: 0;
    background: linear-gradient(180deg, #0e140f, #0a0f0c);
    font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--text-muted, #93a49a);
}
.mini-slot b { color: var(--neon); font-weight: 700; }
.mini-cab:hover .mini-slot { color: var(--neon); }
.mini-cab:hover .mini-marquee { color: var(--neon); box-shadow: 0 0 22px -6px color-mix(in srgb, var(--accent), transparent 42%); }
/* minis need horizontal room; below this they drop away and the main cabinet centers alone */
@media (max-width: 960px) { .mini-cab { display: none; } }

@media (prefers-reduced-motion: reduce) { .cab-bulbs, .cab-press { animation: none; } }
@media (max-width: 560px) {
    .hero-cabinet { padding: 30px 0 30px; }
    .cabinet { width: 94%; }
    .cab-screen { min-height: 180px; padding: 20px 16px; }
    .cab-deck, .cab-bulbs, .hero-glyph { display: none; }
    .cab-wordmark .wm-svg, .cab-wordmark .wm-logo { width: min(300px, 90%); }
    .insert-coin { font-size: var(--fs-sm); letter-spacing: 0.08em; padding: 12px 18px; }
    .insert-coin small { display: none; }
}

/* --- HERO ROTATOR (cinematic cover carousel; replaces the cabinet once a live game
       ships a banner at assets/heroes/<slug>.svg — see arcade.js HERO + renderHeroRotator).
       The cabinet stays as the fallback until then. Each slide retints to the game's own
       accent (--accent set per slide by JS); the surrounding chrome stays sage. --- */
#hero-rotator[hidden], #hero-cabinet[hidden] { display: none !important; }
#hero-rotator {
    position: relative; isolation: isolate;
    width: 100vw; left: 50%; transform: translateX(-50%); margin: 0 0 6px;
}
.rot-stage {
    position: relative; height: clamp(430px, 56vh, 540px); overflow: hidden; background: #040705;
    border-bottom: 1px solid var(--border-soft);
    box-shadow: inset 0 -80px 90px -60px #000, 0 0 60px -20px color-mix(in srgb, var(--accent), transparent 55%);
    --accent: var(--accent); /* overridden per slide */
}
/* PERF (2026-09-09): a banner is an animated SVG loaded through <img>, and in Chromium such an
   image keeps animating at opacity 0 — 13 invisible covers were re-rendering every frame behind
   the one on screen (measured: 1164ms of work per 3s, down to 6ms once parked). `.idle` stops
   that; buildRotator() puts it on the off-slides once the crossfade has finished and takes it off
   the incoming slide before the fade starts. WebKit already suspends zero-opacity content, so this
   is a Chromium/Edge win and a no-op in Safari. The old scale(1.035) → scale(1) push-in went with
   it: scaling a live animated layer re-rasters it at size on every frame of the transition. */
.rot-slide {
    position: absolute; inset: 0; opacity: 0;
    transition: opacity 0.85s ease; pointer-events: none;
}
.rot-slide.on { opacity: 1; pointer-events: auto; }
/* `visibility`, not `display`: both stop the animation dead (measured identical), but a slide that
   was display:none has to be laid out and rasterised from scratch the instant the crossfade starts,
   which put a fresh stutter on every slide change. Hidden slides keep their box and their art. */
.rot-slide.idle { visibility: hidden; }
.rot-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; }
.rot-veil { position: absolute; inset: 0; pointer-events: none; background:
    radial-gradient(90% 55% at 50% 4%, rgba(4,8,6,.35), transparent 60%),
    linear-gradient(180deg, rgba(4,8,6,.5) 0%, transparent 22%, transparent 52%, rgba(3,6,4,.92) 100%); }
.rot-front { position: absolute; left: 0; right: 0; top: 0; z-index: 2; text-align: center; padding: clamp(30px, 7%, 70px) 16px 0; }
.rot-kick { font-family: var(--font-mono); font-size: clamp(9px, 1.2vw, 11px); letter-spacing: 0.32em;
    text-transform: uppercase; color: rgba(255,255,255,.55); margin: 0 0 10px; }
.rot-name { font-family: var(--font-main); font-size: clamp(30px, 6vw, 58px); font-weight: 900; line-height: 0.92;
    letter-spacing: -1.2px; margin: 0; text-shadow: 0 2px 34px rgba(0,0,0,.55); }
.rot-name span { color: var(--accent); text-shadow: 0 0 26px color-mix(in srgb, var(--accent), transparent 40%); }
/* Scrim pill: the tagline is small mono text that can land on the brightest part of a banner
   (the face cards on the Blackjack slide). It shrink-wraps to its own text and carries the same
   tint + blur as .rot-arrow, so it reads as cabinet chrome rather than a patch. :empty guards a
   game registered without a tagline from rendering a bare pill. */
.rot-tagline { font-family: var(--font-mono); font-size: clamp(10px, 1.5vw, 14px); color: #eef4f0;
    display: inline-block; max-width: 100%; margin: clamp(10px, 2.2%, 16px) 0 0;
    padding: 5px 15px; border-radius: 999px;
    background: rgba(6,10,8,.42); border: 1px solid rgba(255,255,255,.1);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    text-shadow: 0 1px 3px rgba(0,0,0,.9); }
.rot-tagline:empty { display: none; }
.rot-arrow { position: absolute; top: calc(50% - 44px); z-index: 6; width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.22); background: rgba(6,10,8,.42); backdrop-filter: blur(3px);
    color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 22px; line-height: 1; opacity: 0; transition: 0.18s; }
#hero-rotator:hover .rot-arrow, .rot-arrow:focus-visible { opacity: 0.92; }
.rot-arrow:hover { background: rgba(6,10,8,.8); border-color: var(--accent); color: var(--accent); }
.rot-arrow.l { left: clamp(10px, 2vw, 22px); } .rot-arrow.r { right: clamp(10px, 2vw, 22px); }
.rot-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; align-items: center;
    gap: 14px; flex-wrap: wrap; padding: 14px clamp(16px, 4vw, 44px) 16px; }
.rot-now { display: flex; align-items: center; gap: 11px; min-width: 0; }
.rot-now .cat { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 3px 10px; white-space: nowrap; opacity: 0.9; }
.rot-now .lbl { font-family: var(--font-mono); font-size: var(--fs-xs); color: #cdd8d0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rot-now .lbl b { color: #fff; font-weight: 700; }
.rot-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.rot-dots { display: flex; gap: 8px; align-items: center; margin-right: 4px; }
.rdot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: transparent; cursor: pointer; padding: 0; transition: 0.18s; }
.rdot:hover { border-color: #fff; }
.rdot.on { background: var(--accent); border-color: var(--accent); width: 22px; border-radius: 5px; box-shadow: 0 0 10px color-mix(in srgb, var(--accent), transparent 40%); }
.rot-prog { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; z-index: 6; background: var(--accent);
    box-shadow: 0 0 10px var(--accent); opacity: 0.9; }
.rot-prog.run { transition: width var(--dur, 7s) linear; width: 100%; }
@media (prefers-reduced-motion: reduce) {
    .rot-slide { transition: opacity 0.3s; }
    .rot-prog.run { transition: none; width: 0; }
}
@media (max-width: 720px) {
    .rot-stage { height: clamp(380px, 66vh, 460px); }
    .rot-actions .btn .rl { display: none; }
    .rot-now .lbl { display: none; }
    /* the dot strip grows with the catalog; let it shrink (then scroll) instead of
       wrapping the Play/Download buttons onto their own lines */
    .rot-bar { flex-wrap: nowrap; gap: 10px; }
    .rot-actions { flex-wrap: nowrap; min-width: 0; }
    .rot-dots { gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 4px 0; }
    .rot-dots::-webkit-scrollbar { display: none; }
    .rdot { width: 7px; height: 7px; flex: none; }
    .rdot.on { width: 18px; }
    /* the pill wraps to two lines at phone widths; a softer radius reads as a plaque there */
    .rot-tagline { padding: 5px 12px; border-radius: 14px; }
}

/* --- ATTRACT MODE (homepage idle screen) --- */
#attract-overlay {
    position: fixed; inset: 0; z-index: 11000; background: #060a08;
    display: none; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 30px; cursor: pointer;
}
#attract-overlay.attract-on { display: flex; animation: attract-in 0.8s ease-out; }
@keyframes attract-in { from { opacity: 0; } to { opacity: 1; } }
#attract-overlay::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(rgba(0,0,0,0) 50%, rgba(0,0,0,0.3) 50%); background-size: 100% 4px;
}
.attract-glyph {
    font-family: var(--font-mono); font-size: clamp(90px, 22vw, 190px); line-height: 1; color: var(--accent);
    text-shadow: 0 0 60px color-mix(in srgb, var(--accent), transparent 25%);
    animation: attract-float 5s ease-in-out infinite;
}
@keyframes attract-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.attract-title { font-size: clamp(26px, 5vw, 44px); font-weight: 900; letter-spacing: -0.02em; margin: 18px 0 10px; }
.attract-blurb { font-size: 15px; opacity: 0.7; max-width: 520px; margin: 0 auto; }
.attract-press {
    font-family: var(--font-mono); font-size: var(--fs-sm); letter-spacing: 0.3em; text-transform: uppercase;
    color: var(--accent); margin-top: 44px; animation: attract-blink 1.2s steps(1) infinite;
}
@keyframes attract-blink { 50% { opacity: 0; } }
.attract-brand {
    position: absolute; bottom: 26px; left: 0; right: 0;
    font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.25em; text-transform: uppercase; opacity: 0.4;
}

/* --- ANNOUNCEMENT TOP SHELF (WebDweeb's slim dismissible bar, verbatim DNA) --- */
.top-shelf { width: 100%; background: var(--accent); display: none; }
.top-shelf.shelf-visible { display: block; }
.top-shelf-inner { max-width: 1280px; margin: 0 auto; padding: 12px 5vw; display: flex; align-items: center; gap: 12px; font-size: var(--fs-sm); }
.top-shelf-badge { background: rgba(0,0,0,0.25); color: #fff; font-size: var(--fs-label); font-weight: 700; letter-spacing: 0.05em; padding: 2px 7px; border-radius: 4px; text-transform: uppercase; flex-shrink: 0; }
.top-shelf-title { font-weight: 700; color: #fff; flex-shrink: 0; }
.top-shelf-desc { color: rgba(255,255,255,0.9); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.top-shelf-cta { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; flex-shrink: 0; white-space: nowrap; }
.top-shelf-cta:hover { opacity: 0.85; }
.top-shelf-close { background: none; border: none; color: rgba(255,255,255,0.9); font-size: var(--fs-h3); line-height: 1; cursor: pointer; padding: 0 2px; flex-shrink: 0; }

/* --- FEATURED SPOTLIGHT (admin-picked cabinet, big hero treatment) --- */
.spotlight { display: none; margin: 0 0 44px; }
.spotlight.spot-visible { display: block; }
.spotlight-inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); min-height: 250px; }
.spotlight-copy { padding: 30px 34px; display: flex; flex-direction: column; align-items: flex-start; }
.spotlight-kicker { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.spotlight-title { font-size: clamp(24px, 3.2vw, 34px); font-weight: 900; letter-spacing: -0.02em; margin: 0 0 10px; }
.spotlight-desc { font-size: var(--fs-sm); opacity: 0.75; margin: 0 0 18px; max-width: 480px; }
.spotlight-actions { display: flex; gap: 10px; margin-top: auto; }
.spotlight-art {
    position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden;
    border-left: 1px solid var(--border-soft);
    background:
        radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 65%),
        linear-gradient(145deg, #17231c, #0a100c);
}
.spotlight-art img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.spotlight-art .thumb-glyph { font-size: 96px; font-family: var(--font-mono); color: var(--accent); text-shadow: 0 0 34px color-mix(in srgb, var(--accent), transparent 30%); }
.spotlight-art::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(rgba(0,0,0,0) 50%, rgba(0,0,0,0.18) 50%); background-size: 100% 4px; mix-blend-mode: overlay;
}
@media (max-width: 760px) {
    .spotlight-inner { grid-template-columns: 1fr; }
    .spotlight-art { min-height: 160px; border-left: none; border-top: 1px solid var(--border-soft); order: 2; }
}

/* --- TROPHIES (trophies.html: device-local medals + achievements dashboard) --- */
.tr-empty { text-align: center; padding: 60px 20px; }
.tr-empty-ring { font-size: 46px; margin-bottom: 8px; }
.tr-empty h2 { margin: 0 0 8px; font-size: 22px; }
.tr-empty p { margin: 0 auto 20px; max-width: 420px; opacity: 0.7; line-height: 1.6; }

.tr-dash { display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card); padding: 26px 28px; }
.tr-ring { position: relative; width: 130px; height: 130px; flex: none; }
.tr-ring svg { width: 130px; height: 130px; display: block; }
.tr-ring .ring-bg { fill: none; stroke: var(--border-soft); stroke-width: 9; }
/* --ring / --ring-glow are set inline per completion tier (see renderTrophies), so the arc and the
   centre number level up through the trophy palette as the ring fills. */
.tr-ring .ring-fg { fill: none; stroke: var(--ring, var(--accent)); stroke-width: 9; stroke-linecap: round;
    filter: drop-shadow(0 0 6px var(--ring-glow, transparent)); transition: stroke-dasharray 0.7s ease, stroke 0.5s ease; }
.tr-ring-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tr-ring-mid b { font-size: 36px; font-weight: 900; line-height: 0.9; letter-spacing: -0.02em; color: var(--ring, var(--text-main)); font-variant-numeric: tabular-nums; }
.tr-ring-mid span { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.5; margin-top: 5px; }
.tr-summary { display: grid; grid-template-columns: repeat(4, minmax(76px, 1fr)); gap: 22px; flex: 1; min-width: 240px; }
.tr-stat { display: flex; flex-direction: column; gap: 7px; }
.tr-stat b { font-size: clamp(30px, 3.2vw, 42px); font-weight: 900; color: var(--text-main); line-height: 0.9; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tr-stat span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase; opacity: 0.5; line-height: 1.35; }
@media (min-width: 720px) { .tr-summary { border-left: 1px solid var(--border-soft); padding-left: 28px; } }
.tr-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tr-note { margin: 12px 2px 0; font-size: 12.5px; opacity: 0.55; line-height: 1.5; }

.tr-h2 { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin: 34px 0 14px; display: flex; align-items: baseline; gap: 10px; }
.tr-count { font-family: var(--font-mono); font-size: 12px; font-weight: 400; opacity: 0.55; letter-spacing: 0; text-transform: none; }

.tr-ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tr-ach { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: var(--radius-lg);
    background: var(--surface); border: 1px solid var(--border-soft); }
.tr-ach.is-locked { opacity: 0.5; }
.tr-ach-badge svg { width: 40px; height: 40px; display: block; flex: none; }
.tr-ach .rosette { fill: none; stroke: var(--text-main); stroke-width: 2; opacity: 0.3; }
.tr-ach .tick { stroke: var(--text-main); stroke-width: 2.4; opacity: 0.3; stroke-linecap: round; stroke-linejoin: round; }
.tr-ach.is-earned .rosette { fill: color-mix(in srgb, var(--accent) 18%, transparent); stroke: var(--accent); opacity: 1; }
.tr-ach.is-earned .tick { stroke: var(--accent); opacity: 1; }
.tr-ach-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tr-ach-name { font-size: 13.5px; font-weight: 700; }
.tr-ach-desc { font-size: 12px; opacity: 0.65; line-height: 1.4; }

.tr-case { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tr-game { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
    padding: 15px 18px 16px; box-shadow: var(--shadow-card); border-top: 2px solid var(--ga, var(--accent)); }
.tr-game-head { display: flex; align-items: center; gap: 11px; }
.tr-glyph { width: 30px; height: 30px; flex: none; display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: var(--ga, var(--accent)); border-radius: 8px;
    background: color-mix(in srgb, var(--ga, var(--accent)) 12%, transparent); }
.tr-game-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.tr-game-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-game-best { font-family: var(--font-mono); font-size: 11.5px; opacity: 0.7; }
.tr-game-best b { color: var(--text-main); opacity: 1; font-weight: 700; }
.tr-unplayed { opacity: 0.55; }
.tr-play { background: none; border: 1px solid var(--border-soft); border-radius: 7px; cursor: pointer;
    font-family: inherit; font-size: 12px; font-weight: 600; color: var(--text-main); padding: 5px 10px; flex: none; transition: 0.15s; }
.tr-play:hover, .tr-play:focus-visible { border-color: var(--ga, var(--accent)); color: var(--ga, var(--accent)); outline: none; }

.tr-medals { display: flex; gap: 10px; margin: 14px 0 12px; }
.tr-medal { width: 42px; }
.tr-medal svg { width: 42px; height: 51px; display: block; }
.tr-medal .cup { stroke: rgba(0, 0, 0, 0.22); stroke-width: 0.75; }
.tr-medal .handle { stroke-width: 3; stroke-linecap: round; }
.tr-medal .init { font: 800 13px/1 Inter, system-ui, sans-serif; fill: rgba(0, 0, 0, 0.5); }
.tr-medal.is-locked .cup { fill: #2a332d; }
.tr-medal.is-locked .handle { stroke: #2a332d; }
.tr-medal.is-locked .init { fill: rgba(255, 255, 255, 0.2); }
.tr-medal.is-earned svg { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45)); }
.tr-medal.is-earned.tr-medal-bronze .cup { fill: #cd7f32; }
.tr-medal.is-earned.tr-medal-bronze .handle { stroke: #cd7f32; }
.tr-medal.is-earned.tr-medal-silver .cup { fill: #cbd5da; }
.tr-medal.is-earned.tr-medal-silver .handle { stroke: #cbd5da; }
.tr-medal.is-earned.tr-medal-gold .cup { fill: #f5c542; }
.tr-medal.is-earned.tr-medal-gold .handle { stroke: #f5c542; }
.tr-medal.is-earned.tr-medal-platinum .cup { fill: #7fe3d0; }
.tr-medal.is-earned.tr-medal-platinum .handle { stroke: #7fe3d0; }

.tr-next-label { font-size: 11.5px; opacity: 0.65; margin-bottom: 6px; }
.tr-bar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.tr-bar > i { display: block; height: 100%; border-radius: 3px; background: var(--ga, var(--accent)); }
.tr-maxed { font-size: 11.5px; opacity: 0.6; font-style: italic; }

@media (max-width: 900px) { .tr-actions { flex-basis: 100%; } } /* actions drop to their own row before they crowd the stats */

/* ===== Trophy toasts ============================================================================
   Shell-side pop when a trophy tier or achievement is earned mid-play. Drawn over the game (or
   inside the fullscreen element, re-parented in JS), so one style covers every cabinet. Top-right
   slide-in on desktop; drops to a full-width strip at the bottom on phones, where the top holds the
   game's own bar. The trophy-cup icon reuses .tr-medal, tinted per tier for free. */
.da-toast-wrap {
    /* Must outrank the player overlay (10000) and attract mode (11000): a trophy is earned WHILE a
       game is open, and at a lower z-index the toast renders correctly but is painted over by the
       game frame (chime plays, nothing visible). Stays under the maintenance curtain (13000). */
    position: fixed; top: 84px; right: 18px; z-index: 12000;
    display: flex; flex-direction: column; gap: 10px;
    max-width: min(340px, 86vw); pointer-events: none;
}
.da-toast {
    pointer-events: auto; cursor: pointer;
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--border-medium);
    border-left: 3px solid var(--accent);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
    transform: translateX(120%); opacity: 0;
    transition: transform 0.42s cubic-bezier(0.16, 0.9, 0.3, 1), opacity 0.42s;
}
.da-toast.is-in { transform: translateX(0); opacity: 1; }
.da-toast.is-out { transform: translateX(120%); opacity: 0; }
.da-toast-icon { flex: 0 0 auto; width: 34px; height: 40px; display: flex; align-items: center; justify-content: center; }
.da-toast-icon .tr-medal { width: 34px; }
.da-toast-icon .tr-medal svg { width: 34px; height: 40px; }
.da-toast-star { font-size: 26px; line-height: 1; color: var(--accent); }
.da-toast-body { min-width: 0; }
.da-toast-kicker {
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--accent); margin-bottom: 2px;
}
.da-toast-title { font-weight: 800; font-size: 14px; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.da-toast-sub { font-size: 11px; opacity: 0.62; margin-top: 1px; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) {
    .da-toast-wrap { top: auto; bottom: 14px; left: 10px; right: 10px; max-width: none; }
    .da-toast { transform: translateY(140%); }
    .da-toast.is-in { transform: translateY(0); }
    .da-toast.is-out { transform: translateY(140%); }
}
@media (prefers-reduced-motion: reduce) {
    .da-toast, .da-toast.is-in, .da-toast.is-out { transform: none; transition: opacity 0.3s; }
}
@media (max-width: 560px) {
    .tr-summary { grid-template-columns: repeat(2, 1fr); }
    .tr-dash { gap: 18px; }
}

/* --- NEWS (home strip + news.html archive) --- */
.news-strip { margin-top: 46px; display: none; }
.news-strip.news-visible { display: block; }

/* News rows: WebDweeb's .wd-row/.sidebar-item density instead of floating cards. */
.news-row { display: block; padding: 15px 20px; border-bottom: 1px solid var(--border-soft); }
.news-row:last-child { border-bottom: none; }
.news-row:hover { background: rgba(var(--base-shade), 0.03); }
.news-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.news-row h3 { font-size: var(--fs-h4); font-weight: 700; margin: 0; letter-spacing: -0.015em; line-height: 1.3; color: var(--text-main); }
.news-row .news-date { font-family: var(--font-mono); font-size: var(--fs-label); opacity: 0.5; margin: 0; flex-shrink: 0; white-space: nowrap; }
.news-byline { display: flex; align-items: center; gap: 9px; margin-top: 10px; }
.byline-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
    border: 1.5px solid color-mix(in srgb, var(--accent), transparent 42%);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 88%), 0 2px 6px rgba(0,0,0,0.3); }
.news-byline span { font-size: var(--fs-xs); font-weight: 700; opacity: 0.82; color: var(--text-main); letter-spacing: 0.01em; }
.news-row .news-body { font-size: var(--fs-sm); opacity: 0.7; line-height: 1.55; margin-top: 6px; }
.news-row .news-body p { margin: 0 0 6px; }
.news-row .news-body p:last-child { margin-bottom: 0; }

/* Archive page rows: the same .news-row shape, sized up for full posts. */
.news-article { padding: 22px 24px; }
.news-article h2 { font-size: var(--fs-h2); font-weight: var(--fw-heading); letter-spacing: -0.02em; line-height: 1.25; margin: 0; color: var(--text-main); }
.news-article .byline-avatar { width: 32px; height: 32px; }
.news-article .news-byline { margin-top: 12px; }
.news-article .news-byline span { font-size: var(--fs-sm); }
.news-article .news-body { font-size: var(--fs-body); opacity: 0.8; line-height: 1.75; margin-top: 8px; }
.news-article .news-body p { margin: 0 0 12px; }
.news-article .news-body p:last-child { margin-bottom: 0; }
.news-article .news-body h3 { font-size: var(--fs-h4); margin: 16px 0 8px; }
.news-body a { color: var(--accent); }

/* --- MAINTENANCE NOTICE --- */
.maintenance-note { padding: 40px; text-align: center; }
.maintenance-note h3 { font-size: var(--fs-h3); margin: 0 0 8px; color: var(--accent); }
.maintenance-note p { opacity: 0.7; margin: 0; }

/* --- CONTACT FORM (public page; module body) --- */
.contact-body { padding: 20px 22px; }
.cform-field { margin-bottom: 14px; }
.cform-field label {
    display: block; font-size: var(--fs-label); font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; opacity: 0.6; margin-bottom: 6px;
}
.cform-field input, .cform-field textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: var(--radius-md);
    background: rgba(var(--base-shade), 0.04); color: var(--text-main);
    font-size: var(--fs-sm); font-family: var(--font-main); outline: none; transition: 0.2s; resize: vertical;
}
.cform-field input:focus, .cform-field textarea:focus { border-color: var(--accent); }
/* Honeypot lives far off-screen; display:none would let smarter bots skip it. */
.hp-field { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }
.contact-note { font-size: var(--fs-sm); opacity: 0.75; line-height: 1.6; margin: 0 0 4px; }
.contact-error { font-size: var(--fs-sm); color: #e07a6a; margin: 0 0 12px; }
.contact-done-title { font-size: var(--fs-h4); font-weight: 700; color: var(--accent); margin: 0 0 8px; }

/* --- MAINTENANCE SPLASH (full-site curtain; admins never see it) --- */
#maintenance-splash {
    position: fixed; inset: 0; z-index: 13000; background: var(--bg-main);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 30px;
    /* same CRT scanline language as the attract screen */
    background-image: linear-gradient(rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.18) 50%);
    background-size: 100% 4px;
}
#maintenance-splash .splash-diamond {
    width: 16px; height: 16px; border-radius: 4px; background: var(--accent);
    transform: rotate(45deg); margin-bottom: 22px;
    box-shadow: 0 0 22px color-mix(in srgb, var(--accent), transparent 30%);
}
#maintenance-splash .splash-wordmark { font-size: clamp(30px, 6vw, 46px); font-weight: 900; letter-spacing: -0.03em; margin: 0 0 18px; }
#maintenance-splash .splash-wordmark span { color: var(--accent); }
#maintenance-splash .splash-line { font-size: var(--fs-h4); font-weight: 700; margin: 0 0 8px; }
#maintenance-splash .splash-msg { font-size: var(--fs-sm); opacity: 0.7; max-width: 460px; margin: 0; line-height: 1.6; }
#maintenance-splash .splash-brand {
    position: absolute; bottom: 26px; left: 0; right: 0;
    font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.25em; text-transform: uppercase; opacity: 0.4;
}

/* --- FOOTER --- */
.site-footer {
    border-top: 1px solid var(--border-soft); margin-top: 28px;
    padding: 26px 5vw; text-align: center;
}
/* muted via color (not opacity) so the link can override to a readable brightness */
.site-footer p { font-size: var(--fs-label); font-weight: 500; color: rgba(231, 236, 232, 0.5); margin: 0; }
.site-footer .footer-mono { font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; font-size: var(--fs-label); margin-top: 4px; }
.site-footer a { color: #8fd0ab; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.site-footer a:hover { color: #fff; }

/* --- SITE POPUP (announcement modal, injected site-wide by arcade.js applyPopup) --- */
.popup-overlay {
    position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(6, 9, 8, 0.72); backdrop-filter: blur(4px);
    animation: popup-fade 0.2s ease;
}
@keyframes popup-fade { from { opacity: 0; } to { opacity: 1; } }
.popup-modal {
    position: relative; width: min(520px, 100%); max-height: 90vh; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border-soft); border-radius: 16px;
    box-shadow: 0 30px 80px -20px rgba(0,0,0,0.8); padding: 0 0 24px;
    animation: popup-pop 0.24s cubic-bezier(0.2,0.9,0.3,1.15);
}
@keyframes popup-pop { from { transform: translateY(10px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.popup-close {
    position: absolute; top: 12px; right: 12px; z-index: 2; width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer; line-height: 1;
    background: rgba(0,0,0,0.45); border: 1px solid var(--border-soft); color: var(--text-main); font-size: var(--fs-sm);
    transition: 0.15s;
}
.popup-close:hover { background: var(--accent); color: var(--bg-main); }
.popup-img { width: 100%; display: block; border-radius: 15px 15px 0 0; max-height: 260px; object-fit: cover; }
.popup-video { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 15px 15px 0 0; overflow: hidden; background: #000; }
.popup-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.popup-title { font-size: var(--fs-h3); font-weight: 700; letter-spacing: -0.01em; margin: 22px 26px 0; }
.popup-body { font-size: var(--fs-body); line-height: 1.6; color: var(--text-main); opacity: 0.86; margin: 10px 26px 0; }
.popup-body p { margin: 0 0 10px; }
.popup-body p:last-child { margin-bottom: 0; }
.popup-body ul { margin: 0 0 10px; padding-left: 18px; }
.popup-body a { color: var(--accent); }
.popup-cta {
    display: inline-block; margin: 18px 26px 0; padding: 11px 22px; border-radius: 10px;
    background: var(--accent); color: var(--bg-main); font-weight: 700; font-size: var(--fs-sm); text-decoration: none;
    transition: 0.15s;
}
.popup-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
@media (max-width: 560px) {
    .popup-title, .popup-body, .popup-cta { margin-left: 18px; margin-right: 18px; }
}

/* --- NEWS LIGHTBOX (per-post "read full article" reader on the news page) --- */
/* Long posts show a clamped preview on the page; the full text opens in this modal. */
.news-clamp { position: relative; max-height: 7.4em; overflow: hidden; }
.news-clamp::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2.6em;
    background: linear-gradient(transparent, var(--surface)); pointer-events: none;
}
.news-read-btn {
    margin: 12px 0 2px; display: inline-flex; align-items: center; gap: 6px;
    background: transparent; border: 1px solid var(--border-medium); color: var(--text-main);
    font-family: var(--font-main); font-size: var(--fs-sm); font-weight: 700; padding: 7px 15px;
    border-radius: 8px; cursor: pointer; transition: 0.15s;
}
.news-read-btn:hover { border-color: var(--accent); color: var(--accent); }
.news-modal { width: min(680px, 100%); padding-bottom: 26px; }
.news-modal-head { padding: 26px 26px 0; border-bottom: 1px solid var(--border-soft); padding-bottom: 16px; }
.news-modal-title { font-size: var(--fs-h2); font-weight: var(--fw-heading); letter-spacing: -0.01em; margin: 0 0 5px; }
.news-modal-date { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.06em; opacity: 0.6; margin: 0; }
.news-modal-body { font-size: var(--fs-body); line-height: 1.75; margin: 18px 26px 0; color: var(--text-main); opacity: 0.9; }
.news-modal-body p { margin: 0 0 12px; }
.news-modal-body p:last-child { margin-bottom: 0; }
.news-modal-body ul { margin: 0 0 12px; padding-left: 20px; }
.news-modal-body a { color: var(--accent); }
.news-modal-body h2, .news-modal-body h3 { font-size: var(--fs-h4); font-weight: 700; margin: 18px 0 8px; }
@media (max-width: 560px) {
    .news-modal-head { padding-left: 18px; padding-right: 18px; }
    .news-modal-body { margin-left: 18px; margin-right: 18px; }
}

/* --- DOCS / GUIDES --- */
/* inline images inside any markdown-lite body (docs, and now news/about too) */
.md-img { max-width: 100%; height: auto; display: block; margin: 14px 0; border-radius: 8px; border: 1px solid var(--border-soft); }

/* per-game "Read the guide" link on a game card */
/* A deliberate card footer: full-width hairline divider, balanced padding, sits snug under the
   Play button (the actions row drops its bottom padding when a guide link follows). */
.game-guide-link { display: block; margin: 0; padding: 13px 18px 15px; border-top: 1px solid var(--border-soft); font-size: var(--fs-xs); font-weight: 700; color: var(--accent); text-decoration: none; }
.game-guide-link:hover { text-decoration: underline; color: var(--accent); }
.game-actions:has(+ .game-guide-link) { padding-bottom: 12px; }

/* docs index */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.doc-card { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: var(--text-main); transition: transform 0.15s ease, border-color 0.15s ease; }
.doc-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.doc-card-cover { aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--border-soft); }
.doc-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-card-cover--blank { display: flex; align-items: center; justify-content: center;
    background: radial-gradient(58% 60% at 50% 42%, color-mix(in srgb, var(--ga, var(--accent)) 22%, transparent), transparent 70%), linear-gradient(150deg, #17231c, #0a100c); }
.doc-card-cover--blank span { font-family: var(--font-mono); font-size: 42px; color: var(--ga, var(--accent)); }
.doc-card-body { padding: 12px 15px 16px; flex: 1; }
.doc-card-top { margin-bottom: 6px; }
.doc-card-game { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.doc-card-game--page { color: var(--text-muted, #93a49a); }
.doc-card-title { font-size: var(--fs-h4); font-weight: var(--fw-heading); margin: 0 0 5px; letter-spacing: -0.01em; }
.doc-card-summary { font-size: var(--fs-xs); opacity: 0.7; margin: 0; line-height: 1.5; }

/* docs reader */
.doc-title { margin-bottom: 10px; }
.doc-cover { margin: 6px 0 20px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-soft); }
.doc-cover img { width: 100%; display: block; }
.doc-body { font-size: var(--fs-body); line-height: 1.75; }
.doc-body h3 { font-size: var(--fs-h3); font-weight: 700; margin: 24px 0 8px; }
.doc-body p { margin: 0 0 14px; }
.doc-body ul { margin: 0 0 14px; padding-left: 20px; }
.doc-body li { margin: 0 0 5px; }
.doc-body a { color: var(--accent); }
.doc-foot { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

/* --- DOCS as a KNOWLEDGE BASE (docs.html two-column shell) --- */
.docs-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); gap: 30px; max-width: 1180px; margin: 0 auto; padding: 46px 5vw 60px; align-items: start; }
.docs-solo { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.docs-solo .docs-sidebar { display: none; }
.docs-sidebar { position: sticky; top: 84px; align-self: start; }
.docs-search-wrap { margin-bottom: 14px; }
#docs-search { width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border-soft); background: var(--surface); color: var(--text-main); font-family: inherit; font-size: var(--fs-sm); }
#docs-search:focus { outline: none; border-color: var(--accent); }
#docs-nav { font-size: var(--fs-sm); max-height: calc(100vh - 150px); overflow-y: auto; }
.docs-nav-group { margin-bottom: 16px; }
.docs-nav-cat { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); opacity: 0.85; margin: 0 0 6px; }
.docs-nav-link { display: block; padding: 5px 10px; border-radius: 6px; color: var(--text-main); text-decoration: none; opacity: 0.8; border-left: 2px solid transparent; }
.docs-nav-link:hover { opacity: 1; background: rgba(var(--base-shade), 0.05); }
.docs-nav-link.active { opacity: 1; color: var(--accent); border-left-color: var(--accent); background: rgba(var(--base-shade), 0.05); font-weight: 700; }
.docs-nav-empty { font-size: var(--fs-sm); opacity: 0.6; }

.docs-cat-section { margin-top: 26px; }
.docs-cat-h { font-size: var(--fs-sm); font-weight: 700; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-soft); }

/* in-article table of contents + backlinks + wiki links */
.doc-body h3 { scroll-margin-top: 84px; }
.doc-toc { border: 1px solid var(--border-soft); border-radius: 10px; padding: 12px 16px; margin: 6px 0 22px; background: var(--surface); }
.doc-toc-h, .doc-back-h { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.doc-toc ul { margin: 0; padding-left: 16px; }
.doc-toc li { margin: 3px 0; font-size: var(--fs-sm); }
.doc-toc a { color: var(--text-main); opacity: 0.82; text-decoration: none; }
.doc-toc a:hover { color: var(--accent); opacity: 1; }
.doc-body a.wikilink { color: var(--accent); font-weight: 600; }
.doc-backlinks { margin-top: 26px; border-top: 1px solid var(--border-soft); padding-top: 16px; }
.doc-backlinks ul { margin: 0; padding-left: 18px; }
.doc-backlinks li { margin: 4px 0; font-size: var(--fs-sm); }
.doc-backlinks a { color: var(--accent); }

@media (max-width: 800px) {
    .docs-shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .docs-sidebar { position: static; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border-soft); }
    #docs-nav { max-height: none; }
}
