/* ══════════════════════════════════════════════════════════════════════════
   NoHit — "Nocturne" design system.
   Dark navy + blurple accent, Inter type, hairline-ring elevation, fading
   rules. Plain CSS on plain HTML: no build step, no framework. Tokens and
   component classes are documented in knowledge/design-system.md.
   ══════════════════════════════════════════════════════════════════════════ */

/* — Inter, self-hosted (SIL OFL 1.1; see fonts/OFL.txt). latin subset only. — */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/inter-400.woff2") format("woff2");
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/inter-500.woff2") format("woff2");
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/inter-600.woff2") format("woff2");
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/inter-700.woff2") format("woff2");
}

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

:root {
    /* — Nocturne core tokens — */
    --color-bg: #161826;
    --color-ground: #0e0f18;      /* darker ground behind cards / page tail */
    --color-surface: #232532;
    --color-text: #e9e9ed;
    --color-accent: #9184d9;      /* the "blurple" accent — replaces IMDb yellow */
    --color-accent-2: #a7a1db;
    --color-divider: color-mix(in srgb, #e9e9ed 16%, transparent);

    /* Neutral ramp 100→900 */
    --color-neutral-100: #f3f5fe;
    --color-neutral-200: #e4e7f5;
    --color-neutral-300: #cfd3e5;
    --color-neutral-400: #b2b6ca;
    --color-neutral-500: #9397ab;
    --color-neutral-600: #75798c;
    --color-neutral-700: #595d6c;
    --color-neutral-800: #3f424d;
    --color-neutral-900: #292b31;

    /* Accent ramp 100→900 */
    --color-accent-100: #f5f4ff;
    --color-accent-200: #e7e5fe;
    --color-accent-300: #d2cefd;
    --color-accent-400: #b5abfc;
    --color-accent-500: #968ae0;
    --color-accent-600: #796cbf;
    --color-accent-700: #5d5294;
    --color-accent-800: #423a6a;
    --color-accent-900: #2b2741;

    /* Deep-indigo section band (Ledger / featured challenge strips) */
    --color-section: #262a60;
    --color-section-glow: #353b80;
    --color-section-ghost: #4c5397;

    --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading-weight: 500;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: ui-monospace, Menlo, Monaco, "Cascadia Code", monospace;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 14px;

    /* Elevation is a hairline ring first, ambient shadow second. */
    --shadow-sm: 0 0 0 1px #3f424d;
    --shadow-md: 0 0 0 1px #595d6c, 0 6px 18px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 0 0 1px #9397ab, 0 16px 40px rgba(0, 0, 0, 0.65);

    /* Muted text alphas (AA-checked; body-size muted uses .72, not .55). */
    --text-muted: rgba(233, 233, 237, 0.72);
    --text-faint: rgba(233, 233, 237, 0.6);

    /* ── Compatibility shim ──────────────────────────────────────────────
       Legacy rules referenced --yellow / --black* tokens. Aliasing them onto
       the Nocturne palette keeps any un-migrated rule rendering in-theme.
       New code should use the --color-* tokens directly. */
    --black: var(--color-bg);
    --black-light: var(--color-ground);
    --black-card: var(--color-surface);
    --black-hover: color-mix(in srgb, var(--color-text) 6%, transparent);
    --yellow: var(--color-accent);
    --yellow-dim: var(--color-accent-600);
    --yellow-glow: color-mix(in srgb, var(--color-accent) 15%, transparent);
    --gray: var(--color-neutral-500);
    --gray-light: var(--color-neutral-400);
    --gray-dark: var(--color-neutral-800);
    --white: var(--color-text);
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    font-weight: 400;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-heading-weight);
    line-height: 1.12;
    letter-spacing: -0.015em;
}
h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }

a { color: var(--color-accent); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

.text-muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); }

/* Fading horizontal rule — a Nocturne signature (transparent at both ends). */
.hr {
    height: 1px;
    border: 0;
    background: linear-gradient(to right,
        transparent, var(--color-divider) 48px,
        var(--color-divider) calc(100% - 48px), transparent);
}

/* Section eyebrow / kicker: a short accent bar + tiny uppercase label. */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-accent);
}
.eyebrow::before {
    content: "";
    width: 22px;
    height: 2px;
    background: currentColor;
    display: block;
}

/* ── Buttons ─────────────────────────────────────────────────────────────
   Primary is an OUTLINE-accent button (not a solid fill) — the deliberate
   Nocturne contrast with the old solid-yellow buttons. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: var(--font-heading-weight);
    font-size: 14px;
    line-height: 1.2;
    color: var(--color-text);
    background: transparent;
    border: 1px solid transparent;
    padding: 8px 15px;
    border-radius: var(--radius-md);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn svg { display: block; flex-shrink: 0; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { color: var(--color-accent); border-color: var(--color-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.btn-primary:active { background: color-mix(in srgb, var(--color-accent) 22%, transparent); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.btn-danger { color: #ff8a8a; border-color: #7a2b2b; }
.btn-danger:hover { background: rgba(220, 60, 60, 0.12); border-color: #a33; color: #ff8a8a; }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ── Tags ───────────────────────────────────────────────────────────────── */
.tag {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    letter-spacing: 0.02em;
    padding: 3px 10px;
    border-radius: calc(var(--radius-md) * 0.75);
    white-space: nowrap;
}
.tag-accent { background: var(--color-accent-800); color: var(--color-accent-100); }
.tag-accent-2 { background: var(--color-accent-2-800, var(--color-accent-800)); color: var(--color-accent-100); }
.tag-neutral { background: var(--color-neutral-800); color: var(--color-neutral-100); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent-200); }
/* Legacy alias — the macro used .game-tag for game labels. */
.game-tag { background: var(--color-neutral-800); color: var(--color-neutral-100); }
/* A tag rendered as a link (e.g. runner "Works in" chips) never underlines. */
a.tag { text-decoration: none; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.field > label, .field-label, .filter-heading {
    display: block;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-faint);
}
.field .req { color: var(--color-accent); }

.input, .filter-input,
.field input, .field select {
    width: 100%;
    min-height: 38px;
    padding: 8px 11px;
    font-family: inherit;
    font-size: 14px;
    color: var(--color-text);
    caret-color: var(--color-accent);
    background: var(--color-surface);
    border: 1px solid var(--color-divider);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder, .filter-input::placeholder, .field input::placeholder {
    color: var(--text-faint);
}
.input:hover, .filter-input:hover {
    border-color: color-mix(in srgb, var(--color-text) 45%, transparent);
}
.input:focus, .input:focus-visible,
.filter-input:focus, .field input:focus, .field select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 14%, transparent);
}
textarea.input { min-height: 90px; resize: vertical; }

/* Segmented control (kept in the system for future data-backed sorts). */
.seg {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid var(--color-divider);
    border-radius: var(--radius-md);
}
.seg-opt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 13px;
    cursor: pointer;
}
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.seg-opt:has(input:checked) { color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.seg-opt:not(:has(input:checked)):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: -2px; }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}
.card-kicker { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-accent); }
.card-title { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 17px; line-height: 1.2; }
.card-body { margin: 0; font-size: 13px; color: var(--text-muted); }
.card-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-faint); }
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* ══════════════════════════════════════════════════════════════════════
   Site chrome — navbar + footer (shared via base.html)
   ══════════════════════════════════════════════════════════════════════ */
.navbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 15px 34px;
    background: var(--color-bg);
    position: sticky;
    top: 0;
    z-index: 100;
    /* The fading rule beneath the nav is a ::after, not a border. */
}
.navbar::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: linear-gradient(to right,
        transparent, var(--color-divider) 48px,
        var(--color-divider) calc(100% - 48px), transparent);
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: var(--color-text);
}
.nav-brand-bar {
    width: 3px;
    height: 17px;
    background: var(--color-accent);
    border-radius: 2px;
    display: block;
    flex-shrink: 0;
}
.nav-brand-word {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.14em;
}

.nav-links {
    display: flex;
    gap: 20px;
    font-size: 13.5px;
}
.nav-links a {
    color: var(--text-faint);
    text-decoration: none;
    transition: color 0.15s;
}
.nav-links a:hover { color: var(--color-text); }
.nav-links a.active, .nav-links a[aria-current="page"] { color: var(--color-text); }

/* Search pill — the GET form to /search, restyled. */
.navbar-search {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    margin-left: auto;
}
.nav-search-pill {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    max-width: 320px;
    padding: 0 12px;
    height: 36px;
    background: var(--color-surface);
    border: 1px solid var(--color-divider);
    border-radius: var(--radius-md);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.nav-search-pill:focus-within {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 12%, transparent);
}
.nav-search-pill svg { flex-shrink: 0; color: var(--text-faint); }
.nav-search-pill input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--color-text);
    font-family: inherit;
    font-size: 13px;
}
.nav-search-pill input::placeholder { color: var(--text-faint); }
/* The pill submits on Enter; the button is a visually-hidden a11y affordance. */
.nav-search-pill button {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 28px 34px 34px;
    color: var(--text-faint);
    font-size: 11.5px;
}
.footer::before {
    content: "";
    position: absolute;
    left: 0; right: 0;
    margin-top: -28px;
    height: 1px;
    background: linear-gradient(to right,
        transparent, var(--color-divider) 48px,
        var(--color-divider) calc(100% - 48px), transparent);
}

/* ══════════════════════════════════════════════════════════════════════
   Home — hero + editorial sections
   ══════════════════════════════════════════════════════════════════════ */
.page {
    max-width: 1280px;
    margin: 0 auto;
}

.hero {
    position: relative;
    padding: 44px 34px 40px;
    overflow: hidden;
}
.hero-glow {
    position: absolute;
    top: -160px;
    right: -80px;
    width: 640px;
    height: 520px;
    background: radial-gradient(closest-side, rgba(145, 132, 217, 0.20), transparent);
    pointer-events: none;
}
.hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 44px;
    align-items: center;
}
.hero-title { font-size: 38px; line-height: 1.08; margin: 14px 0; letter-spacing: -0.02em; }
.hero-blurb { margin: 0 0 20px; font-size: 14.5px; line-height: 1.65; color: var(--text-muted); max-width: 46ch; }
.hero-chiprow { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.hero-chip { display: inline-flex; align-items: center; gap: 10px; }
.hero-chip-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    overflow: hidden; background: var(--color-neutral-800);
    display: grid; place-items: center; flex: none;
    font-size: 13px; font-weight: 600; color: var(--color-accent-200);
}
.hero-chip-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hero-chip-name { font-size: 13.5px; color: var(--color-text); text-decoration: none; position: relative; z-index: 2; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 26px; }
.hero-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hero-media { position: relative; }
.hero-media-frame {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, #232532, #161826);
    aspect-ratio: 16 / 9;
}
.hero-media-frame img { width: 100%; height: 100%; object-fit: cover; }
.hero-media-scrim {
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 38%;
    background: linear-gradient(transparent, rgba(14, 15, 24, 0.75));
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    pointer-events: none;
}

/* Section scaffolding used by home and the new nav pages. */
.section {
    padding: 8px 34px 40px;
}
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
/* Index-page top section sits a little lower and its title is page-scale. */
.section-top { padding-top: 34px; }
.section-title-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-title { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.section-title.page-title { font-size: 32px; }
.section-sub { font-size: 12px; color: var(--text-faint); }
.section-link { font-size: 12.5px; color: var(--color-accent); text-decoration: none; white-space: nowrap; }

/* Horizontal scroll rail. */
.video-row {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-neutral-800) transparent;
}
.video-row::-webkit-scrollbar { height: 6px; }
.video-row::-webkit-scrollbar-track { background: transparent; }
.video-row::-webkit-scrollbar-thumb { background: var(--color-neutral-800); border-radius: 3px; }
.video-row .frame-card { flex: 0 0 270px; }

/* Grid of frame cards (runner runs, game runs). */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

/* ── Frame card (default: rails + grids) ──────────────────────────────── */
.frame-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
/* Stretched overlay link: the whole card opens the video, without nesting
   anchors, so inner links (runner names) stay independently clickable. */
.card-link { position: absolute; inset: 0; z-index: 1; }
.frame-thumb {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #232532, #1a1c28);
}
.frame-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.92; transition: opacity 0.2s; }
.frame-card:hover .frame-thumb img { opacity: 1; }
.frame-title {
    font-size: 14px;
    line-height: 1.35;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.frame-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--text-faint);
    flex-wrap: wrap;
}
.runner-name {
    position: relative;
    z-index: 2;
    color: var(--color-accent-300);
    text-decoration: none;
    transition: color 0.15s;
}
a.runner-name:hover { color: var(--color-accent-200); }
/* Card title -> internal run page. Layered above the stretched .card-link
   overlay (z-index:1) exactly like .runner-name, so the title deep-links while
   the rest of the card still opens YouTube. Inherits the title's color; accents
   on hover, matching the runner-name treatment. See knowledge/seo.md. */
.run-link {
    position: relative;
    z-index: 2;
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}
a.run-link:hover { color: var(--color-accent-200); }
.frame-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.frame-desc {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Plate card (featured / signature) ────────────────────────────────── */
.plate-card {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: block;
}
.plate-card .card-link { z-index: 1; }
.plate-card > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
}
.plate-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(200deg, rgba(22, 24, 38, 0.05) 30%, rgba(14, 15, 24, 0.92));
}
.plate-tags { position: absolute; top: 10px; left: 10px; display: flex; gap: 5px; z-index: 2; }
.plate-body { position: absolute; left: 12px; right: 12px; bottom: 11px; z-index: 2; }
.plate-title { font-size: 15px; line-height: 1.3; margin-bottom: 6px; }
.plate-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: rgba(233, 233, 237, 0.62); flex-wrap: wrap; }

/* ── Ledger row (search results) ──────────────────────────────────────── */
.ledger-list { display: flex; flex-direction: column; }
.ledger-row {
    position: relative;
    display: grid;
    grid-template-columns: 30px 148px 1fr;
    gap: 18px;
    align-items: center;
    padding: 14px 10px;
    border-top: 1px solid var(--color-divider);
}
.ledger-row:first-child { border-top: 0; }
.ledger-row:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }
.ledger-rank { font-size: 11.5px; font-family: var(--font-mono); color: var(--text-faint); text-align: right; }
.ledger-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; }
.ledger-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.ledger-body { min-width: 0; }
.ledger-title { font-size: 14.5px; line-height: 1.35; margin-bottom: 6px; }
.ledger-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ledger-desc {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Runners-to-follow grid ───────────────────────────────────────────── */
.runner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.runner-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
    padding: 18px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.runner-tile:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }
.runner-tile-avatar {
    position: relative;
    width: 44px; height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--color-neutral-800);
    display: grid; place-items: center;
    font-size: 16px; font-weight: 600; color: var(--color-accent-200);
}
.runner-tile-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.runner-tile-name { font-size: 14.5px; color: var(--color-text); }
.runner-tile-meta { font-size: 11.5px; color: var(--text-faint); line-height: 1.5; }

/* ── Game poster grid ─────────────────────────────────────────────────── */
.poster-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}
.poster {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-decoration: none;
    color: inherit;
}
.poster-art {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: linear-gradient(160deg, #2b2d3c, #1a1c28);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-end;
    padding: 12px;
    transition: box-shadow 0.15s;
}
.poster:hover .poster-art { box-shadow: 0 0 0 1px var(--color-accent); }
.poster-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.poster-art-scrim { position: absolute; inset: 0; background: linear-gradient(transparent 35%, rgba(14, 15, 24, 0.92)); }
.poster-name { position: relative; font-size: 13px; line-height: 1.3; color: rgba(233, 233, 237, 0.92); }
.poster-count { font-size: 11px; font-family: var(--font-mono); color: var(--text-faint); }

/* Deep-indigo section band (submit CTA lookalikes / future ledger). */
.section-band { background: var(--color-section); }

/* ══════════════════════════════════════════════════════════════════════
   Runner profile
   ══════════════════════════════════════════════════════════════════════ */
.runner-hero {
    position: relative;
    padding: 38px 34px 30px;
    overflow: hidden;
}
.runner-hero-glow {
    position: absolute;
    top: -200px; left: -40px;
    width: 560px; height: 460px;
    background: radial-gradient(closest-side, rgba(145, 132, 217, 0.14), transparent);
    pointer-events: none;
}
.runner-hero-inner {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 26px;
    flex-wrap: wrap;
}
.runner-avatar {
    width: 96px; height: 96px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--color-neutral-800);
    flex: none;
    box-shadow: var(--shadow-sm);
    display: grid; place-items: center;
}
.runner-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 600; color: var(--color-accent-200);
    background: var(--color-neutral-800);
}
.runner-hero-main { flex: 1; min-width: 260px; }
.runner-nameline { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.runner-display-name { margin: 0; font-size: 34px; letter-spacing: -0.02em; }
.runner-alias { font-size: 13px; color: var(--text-faint); }
.runner-socials { display: flex; gap: 8px; flex-wrap: wrap; }
.social-link { gap: 7px; }
.social-link svg { flex-shrink: 0; }
.runner-stats {
    display: flex;
    gap: 0;
    align-items: flex-start;
}
.stat { padding: 0 22px; border-left: 1px solid var(--color-divider); }
.runner-stats .stat:first-child { padding-left: 0; border-left: 0; }
.stat-value { display: block; font-size: 26px; line-height: 1.1; font-weight: 500; color: var(--color-text); font-family: var(--font-heading); }
.stat-label { display: block; font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-faint); margin-top: 5px; }

.runner-work {
    padding: 0 34px 34px;
}
.runner-work-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 26px;
    align-items: stretch;
}
.signature-wrap { display: flex; }
.signature-wrap .plate-card { aspect-ratio: auto; min-height: 280px; width: 100%; }
.signature-wrap .plate-title { font-size: 24px; line-height: 1.2; letter-spacing: -0.015em; }
.works-card { display: flex; flex-direction: column; gap: 18px; padding: 20px 22px; border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-sm); }
.works-block-label { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px; }
.works-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.kept-list { display: flex; flex-direction: column; gap: 9px; }
.kept-row { display: flex; align-items: center; gap: 10px; }
.kept-name { font-size: 12.5px; color: rgba(233, 233, 237, 0.8); width: 96px; flex: none; }
.kept-bar { flex: 1; height: 4px; border-radius: 2px; background: rgba(233, 233, 237, 0.09); overflow: hidden; }
.kept-bar > span { display: block; height: 100%; background: var(--color-accent); }
.kept-count { font-size: 11px; font-family: var(--font-mono); color: var(--text-faint); width: 22px; text-align: right; flex: none; }

/* ══════════════════════════════════════════════════════════════════════
   Game detail hero (minimal)
   ══════════════════════════════════════════════════════════════════════ */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-faint); margin-bottom: 20px; }
.breadcrumb a { color: inherit; text-decoration: none; }
.breadcrumb span.current { color: rgba(233, 233, 237, 0.8); }
.game-hero { position: relative; padding: 26px 34px 32px; overflow: hidden; }
.game-hero-body { position: relative; }
.game-hero-grid { position: relative; display: grid; grid-template-columns: 200px 1fr; gap: 30px; align-items: start; }
.game-poster {
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-md);
    background: linear-gradient(160deg, #2b2d3c, #1a1c28);
    box-shadow: var(--shadow-sm);
    display: flex; align-items: flex-end;
    padding: 16px;
    position: relative;
    overflow: hidden;
}
.game-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.game-poster-scrim { position: absolute; inset: 0; background: linear-gradient(transparent 35%, rgba(14, 15, 24, 0.92)); }
.game-poster-name { position: relative; font-size: 15px; line-height: 1.25; color: rgba(233, 233, 237, 0.9); }
.game-hero-title { margin: 0 0 6px; font-size: 36px; letter-spacing: -0.02em; }

/* ══════════════════════════════════════════════════════════════════════
   Search page
   ══════════════════════════════════════════════════════════════════════ */
.search-page {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    align-items: start;
    max-width: 1280px;
    margin: 0 auto;
}
.search-sidebar { padding: 26px 24px 40px 34px; }
.filter-form { display: flex; flex-direction: column; gap: 24px; }
.filter-section { display: flex; flex-direction: column; gap: 10px; }
.filter-heading { margin: 0; }

.filter-tag-search { margin-bottom: 2px; }
.filter-tag-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; }
.filter-group-label {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent-300);
    margin-top: 4px;
}
.filter-group-label:first-child { margin-top: 0; }
.filter-tag-empty { font-size: 13px; color: var(--text-faint); margin: 0; }

/* Custom checkbox: style the real input via appearance:none so it stays
   focusable and in the tab order (no display:none). */
.filter-check {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: rgba(233, 233, 237, 0.85);
    cursor: pointer;
}
.filter-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 15px; height: 15px;
    flex: none;
    margin: 0;
    border: 1px solid var(--color-neutral-700);
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.12s, border-color 0.12s;
}
.filter-check input[type="checkbox"]::after {
    content: "";
    width: 8px; height: 8px;
    background: var(--color-bg);
    /* a check glyph via clip-path */
    clip-path: polygon(41% 66%, 12% 40%, 0 52%, 41% 88%, 100% 20%, 88% 8%);
    transform: scale(0);
    transition: transform 0.12s;
}
.filter-check input[type="checkbox"]:checked {
    background: var(--color-accent);
    border-color: var(--color-accent);
}
.filter-check input[type="checkbox"]:checked::after { transform: scale(1); }
.filter-check input[type="checkbox"]:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.filter-check span { flex: 1; }

.filter-actions { display: flex; flex-direction: column; gap: 8px; }

.search-results {
    padding: 26px 34px 40px 26px;
    border-left: 1px solid var(--color-divider);
    min-width: 0;
    min-height: 640px;
}
.search-results-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.search-results-title { margin: 0; font-size: 26px; letter-spacing: -0.015em; }
.search-results-title .highlight { color: var(--color-accent); }
.search-results-count { color: var(--text-faint); font-size: 12px; font-family: var(--font-mono); white-space: nowrap; }
.search-empty {
    text-align: center;
    padding: 64px 24px;
    border: 1px dashed var(--color-neutral-800);
    border-radius: var(--radius-lg);
    color: var(--text-faint);
}
.search-empty p { margin-bottom: 16px; }

/* ══════════════════════════════════════════════════════════════════════
   Cookie consent banner (unchanged behaviour; recolored)
   ══════════════════════════════════════════════════════════════════════ */
.cookie-banner {
    position: fixed;
    bottom: 20px; left: 20px; right: 20px;
    max-width: 560px;
    margin: 0 auto;
    background: var(--color-surface);
    border: 1px solid var(--color-divider);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 200;
}
.cookie-banner[hidden] { display: none; }
.cookie-text { flex: 1; color: var(--text-muted); font-size: 13px; line-height: 1.4; margin: 0; }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-btn {
    border: 1px solid var(--color-divider);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    background: transparent;
    color: var(--color-text);
    transition: background 0.15s, border-color 0.15s;
}
.cookie-decline:hover { border-color: var(--color-neutral-500); }
.cookie-accept { color: var(--color-accent); border-color: var(--color-accent); }
.cookie-accept:hover { background: color-mix(in srgb, var(--color-accent) 12%, transparent); }

/* ══════════════════════════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; gap: 26px; }
    .hero-media { order: -1; }
    .runner-work-grid { grid-template-columns: 1fr; }
    .game-hero-grid { grid-template-columns: 140px 1fr; gap: 20px; }
    .poster-grid { grid-template-columns: repeat(4, 1fr); }
    .search-page { grid-template-columns: 1fr; }
    .search-sidebar { padding: 24px 20px 8px; }
    .search-results { border-left: 0; padding: 8px 20px 40px; min-height: 0; }
    .ledger-row { grid-template-columns: 24px 96px 1fr; gap: 12px; }
}

@media (max-width: 768px) {
    .navbar { padding: 12px 20px; flex-wrap: wrap; gap: 12px; }
    .nav-links { order: 3; width: 100%; gap: 16px; }
    .navbar-search { flex: 1; }
    .hero, .runner-hero, .game-hero { padding-left: 20px; padding-right: 20px; }
    .section { padding-left: 20px; padding-right: 20px; }
    .footer { padding-left: 20px; padding-right: 20px; }
    .poster-grid { grid-template-columns: repeat(3, 1fr); }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .runner-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-title { font-size: 30px; }
    .runner-display-name { font-size: 27px; }
    .game-hero-grid { grid-template-columns: 110px 1fr; }
    .runner-stats { margin-top: 8px; }
}

@media (max-width: 480px) {
    .poster-grid { grid-template-columns: repeat(2, 1fr); }
    .video-row .frame-card { flex: 0 0 220px; }
    .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; }
    .cookie-actions { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* ══════════════════════════════════════════════════════════════════════
   Admin UI — shares the Nocturne tokens (navy + accent), functional reskin.
   ══════════════════════════════════════════════════════════════════════ */
.admin-navbar .nav-brand-word em,
.admin-brand-tag {
    font-style: normal;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    color: var(--text-faint);
    margin-left: 6px;
    text-transform: uppercase;
}
.admin-nav-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.admin-nav-link { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.admin-nav-link:hover { color: var(--color-text); }
.admin-user { color: var(--text-faint); font-size: 0.85rem; padding-left: 16px; border-left: 1px solid var(--color-divider); }

.admin-main { max-width: 1080px; margin: 0 auto; padding: 32px 24px 64px; }

.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.flash { padding: 12px 16px; border-radius: var(--radius-md); font-size: 0.9rem; border: 1px solid transparent; }
.flash-success {
    background: color-mix(in srgb, var(--color-accent) 10%, transparent);
    border-color: var(--color-accent-600);
    color: var(--color-accent-200);
}
.flash-error { background: rgba(220, 60, 60, 0.1); border-color: #7a2b2b; color: #ff8a8a; }

.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.admin-title { font-size: 1.8rem; }
.admin-subtitle { color: var(--text-faint); font-size: 0.9rem; margin-top: 2px; }

.inline-form { display: inline; margin: 0; }

.admin-table-wrap { border: 1px solid var(--color-divider); border-radius: var(--radius-lg); overflow: hidden; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table thead th {
    text-align: left;
    padding: 14px 16px;
    background: var(--color-surface);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--color-divider);
}
.admin-table tbody td { padding: 14px 16px; border-bottom: 1px solid var(--color-divider); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }
.row-inactive { opacity: 0.55; }
.col-actions { text-align: right; white-space: nowrap; }
.action-group { display: inline-flex; gap: 6px; justify-content: flex-end; }

.cell-creator { display: flex; align-items: center; gap: 12px; }
.cell-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 40px; }
.cell-avatar-placeholder {
    display: flex; align-items: center; justify-content: center;
    background: var(--color-neutral-800);
    color: var(--color-accent-200);
    font-weight: 600;
}
.cell-name { font-weight: 600; }
.cell-alias { color: var(--text-faint); font-size: 0.8rem; }
.cell-empty { color: var(--color-neutral-700); }

.mini-tag {
    display: inline-block;
    background: var(--color-neutral-800);
    color: var(--color-neutral-200);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    font-size: 0.72rem;
    margin-right: 4px;
    letter-spacing: 0.02em;
}
.mini-tag-warn { background: color-mix(in srgb, var(--color-accent) 18%, transparent); color: var(--color-accent-200); }

.badge { display: inline-block; border-radius: 20px; padding: 3px 12px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; }
.badge-active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); color: var(--color-accent-200); }
.badge-inactive { background: var(--color-neutral-800); color: var(--color-neutral-300); }
.badge-success { background: color-mix(in srgb, var(--color-accent) 18%, transparent); color: var(--color-accent-200); }
.badge-running { background: var(--color-neutral-800); color: var(--color-neutral-300); }
.badge-failed { background: rgba(220, 60, 60, 0.15); color: #ff8a8a; }

.admin-card { background: var(--color-surface); border: 1px solid var(--color-divider); border-radius: var(--radius-lg); padding: 28px; }
.admin-card-wide { max-width: 720px; }
.admin-card-title { font-size: 1.4rem; margin-bottom: 20px; text-align: center; }
.admin-login { max-width: 380px; margin: 48px auto 0; }
.admin-form { display: flex; flex-direction: column; gap: 16px; }
.field-row { display: flex; gap: 16px; }
.field-row .field { flex: 1; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }

.admin-empty { text-align: center; padding: 64px 24px; border: 1px dashed var(--color-neutral-800); border-radius: var(--radius-lg); color: var(--text-faint); }
.admin-empty p { margin-bottom: 16px; }

.admin-back { display: inline-block; color: var(--text-faint); text-decoration: none; font-size: 0.85rem; font-weight: 500; margin-bottom: 16px; }
.admin-back:hover { color: var(--color-accent); }
.admin-section-title { font-size: 1.1rem; margin: 32px 0 16px; }

.detail-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: 0 0 64px; font-size: 1.6rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-tile { background: var(--color-surface); border: 1px solid var(--color-divider); border-radius: var(--radius-md); padding: 16px; }
.stat-tile-warn { border-color: var(--color-accent-600); }
.stat-tile-value { display: block; font-size: 1.6rem; font-weight: 600; color: var(--color-accent-200); line-height: 1.2; font-family: var(--font-heading); }
.stat-tile-small { font-size: 0.95rem; color: var(--color-text); }
.stat-tile-label { display: block; margin-top: 4px; color: var(--text-faint); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }

.detail-meta { padding: 20px 24px; }
.meta-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 24px; }
.meta-list dt { color: var(--text-faint); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 3px; }
.meta-list dd { font-size: 0.9rem; word-break: break-word; }
.meta-truncate { color: var(--text-muted); font-size: 0.82rem; }

.cell-video { display: flex; align-items: center; gap: 12px; }
.cell-thumb { width: 80px; height: 45px; border-radius: var(--radius-sm); object-fit: cover; flex: 0 0 80px; background: var(--color-neutral-800); }
.cell-link { color: var(--color-text); text-decoration: none; }
.cell-link:hover { color: var(--color-accent); }
.cell-timestamp { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }

/* Video edit form: textarea + checkbox-group controls (the creator form has neither). */
.field textarea {
    width: 100%;
    min-height: 90px;
    padding: 8px 11px;
    font-family: inherit;
    font-size: 14px;
    color: var(--color-text);
    caret-color: var(--color-accent);
    background: var(--color-surface);
    border: 1px solid var(--color-divider);
    border-radius: var(--radius-md);
    outline: none;
    resize: vertical;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea::placeholder { color: var(--text-faint); }
.field textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 14%, transparent);
}

/* fieldset reset so it matches the flex .field layout of the label variant. */
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.field-hint { color: var(--text-faint); font-size: 0.78rem; }

.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.checkbox-option { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; color: var(--text-muted); cursor: pointer; }
.checkbox-option input { accent-color: var(--color-accent); }
.checkbox-meta { color: var(--text-faint); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* Video edit form: repeatable dropdown rows (Games / Creators). Tags stay checkbox-group. */
.select-group { display: flex; flex-direction: column; gap: 8px; }
.select-row { display: flex; gap: 8px; align-items: center; }
.select-row .select-picker { flex: 1 1 auto; min-width: 0; width: auto; }
.select-row .select-remove { flex: 0 0 auto; }
.select-add { align-self: flex-start; margin-top: 8px; }

/* Video edit page: read-only info block (thumbnail + meta list). */
.video-info { display: flex; gap: 20px; align-items: flex-start; }
.video-info-thumb { width: 200px; max-width: 40%; border-radius: var(--radius-sm); object-fit: cover; flex: 0 0 auto; background: var(--color-neutral-800); }
.video-info .meta-list { flex: 1; }

@media (max-width: 640px) {
    .video-info { flex-direction: column; }
    .video-info-thumb { max-width: 100%; width: 100%; }
}

@media (max-width: 640px) {
    .field-row { flex-direction: column; }
    .admin-navbar { padding: 12px 20px; }
    .admin-header { flex-direction: column; align-items: flex-start; }
}
