/*
 * ONE MORE FLOOR — public website
 *
 * Hand-authored, no build step: the deploy script only runs npm when a
 * package.json exists, and there isn't one. Tokens mirror
 * lib/ui/theme/app_colors.dart so the site and the game agree on what gold is,
 * and the three faces are the three the game loads: Cinzel for display,
 * Playfair Display for the lede, Inter for everything else.
 */

/* --- Fonts -------------------------------------------------------------- */
/* Self-hosted and subset to latin + latin-ext. No CDN, no third-party
   request: a leaderboard name outside those ranges falls back to the system
   stack, exactly as it would with a hosted webfont. */

@font-face {
    font-family: "Cinzel";
    src: url("/fonts/cinzel-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Cinzel";
    src: url("/fonts/cinzel-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Playfair Display";
    src: url("/fonts/playfair-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Inter";
    src: url("/fonts/inter-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Inter";
    src: url("/fonts/inter-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Surfaces — deep lacquered marble, coolest at the back. */
    --surface-void: #05060a;
    --surface-base: #0a0c12;
    --surface-raised: #101420;
    --surface-elevated: #161b2b;
    --lacquer-navy: #0e1626;
    --lacquer-navy-deep: #070b14;

    /* Hairlines — brass inlay in stone. */
    --hairline-gold: rgba(168, 121, 28, 0.4);
    --hairline-gold-strong: rgba(168, 121, 28, 0.8);
    --hairline-cool: #1e2a3f;
    --divider: #1a2030;

    /* Reward — warm gold. */
    --gold-bright: #f7e3ae;
    --gold: #e3b94f;
    --gold-deep: #a8791c;
    --gold-glow: #ffd469;
    --on-reward: #241a05;

    /* Action — electric blue. */
    --blue-bright: #7fb4ff;
    --blue: #2e7bff;
    --blue-deep: #123fa8;

    /* Secure — emerald/cyan. */
    --cyan: #58f0c8;
    --emerald: #14b08a;

    /* Danger — reserved for the robber and death. */
    --red-bright: #ff6b6b;
    --red: #ff2e2e;

    /* Deal and mystery. */
    --purple: #8b5cf6;
    --violet: #b06bff;

    /* Text — warm off-white on cool stone. */
    --text-primary: #f4f1e8;
    --text-secondary: #a9b2c4;
    --text-tertiary: #7a8499;
    --text-disabled: #4a5263;
    --text-gold: #e8c878;

    --focus-ring: #9cc3ff;

    --font-display: "Cinzel", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    --font-serif: "Playfair Display", "Iowan Old Style", Georgia, serif;
    --font-sans: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --measure: 70rem;
    --nav-h: 56px;
    --radius: 16px;
    --radius-sm: 10px;

    /* The panel look: stone under lacquer, lit from the top edge. */
    --panel-face: linear-gradient(165deg, #18223a 0%, #101726 45%, #0a0f1a 100%);
    --panel-edge: 0 1px 0 rgba(247, 227, 174, 0.08) inset,
        0 0 0 1px rgba(168, 121, 28, 0.16),
        0 26px 60px -34px rgba(0, 0, 0, 0.95);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background:
        radial-gradient(80% 45% at 50% 0%, #14203a 0%, transparent 62%),
        radial-gradient(60% 40% at 100% 88%, #1a1428 0%, transparent 60%),
        linear-gradient(180deg, var(--surface-base) 0%, var(--surface-void) 100%);
    background-color: var(--surface-void);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 16px;
    padding-top: var(--nav-h);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--text-gold);
    text-decoration: none;
}

a:hover {
    color: var(--gold-bright);
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
select:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
    border-radius: 4px;
}

/* --- Layout ------------------------------------------------------------- */

.wrap {
    width: 100%;
    max-width: var(--measure);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

main {
    flex: 1 0 auto;
    padding-bottom: 4rem;
}

section {
    margin-top: clamp(3.5rem, 9vw, 6.5rem);
}

/* --- Type --------------------------------------------------------------- */

h1,
h2,
h3 {
    line-height: 1.15;
    margin: 0 0 0.75rem;
}

h1,
h2 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.02em;
}

h1 {
    font-size: clamp(2.125rem, 6.5vw, 3.75rem);
}

h2 {
    font-size: clamp(1.5rem, 3.6vw, 2.25rem);
}

h3 {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-primary);
}

p {
    margin: 0 0 1rem;
    color: var(--text-secondary);
    max-width: 44rem;
}

.lede {
    font-family: var(--font-serif);
    font-size: clamp(1.125rem, 2.3vw, 1.4375rem);
    line-height: 1.5;
    color: #cfd6e4;
}

.eyebrow {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 0.875rem;
}

.eyebrow::after {
    content: "";
    display: block;
    width: 2.5rem;
    height: 1px;
    margin-top: 0.625rem;
    background: linear-gradient(90deg, var(--gold-deep), transparent);
}

.centered .eyebrow::after {
    margin-inline: auto;
    background: linear-gradient(90deg, transparent, var(--gold-deep), transparent);
}

.wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.06em;
    background: linear-gradient(180deg, #fffaf0 0%, var(--gold-bright) 35%, var(--gold) 62%, var(--gold-deep) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tagline {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-gold);
}

.muted {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* --- Header and footer -------------------------------------------------- */

/* A thin rail, not a masthead: it floats over the hero and only turns into a
   solid surface once the page has scrolled. The gradient is the no-JS default,
   so the links stay readable either way. */
.site-header {
    position: fixed;
    inset-inline: 0;
    top: 0;
    height: var(--nav-h);
    z-index: 30;
    border-bottom: 1px solid transparent;
    background: linear-gradient(180deg, rgba(5, 6, 10, 0.72), rgba(5, 6, 10, 0));
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.site-header.is-scrolled {
    background: rgba(7, 11, 20, 0.84);
    border-bottom-color: var(--divider);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 100%;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-variant-caps: small-caps;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--text-primary);
    white-space: nowrap;
}

.brand img {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    box-shadow: 0 0 0 1px var(--hairline-gold);
}

.brand:hover {
    color: var(--gold-bright);
    text-decoration: none;
}

.site-nav {
    display: flex;
    gap: 0.625rem;
    align-items: center;
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    color: var(--text-disabled);
}

.site-nav a {
    color: var(--text-secondary);
    padding-block: 0.25rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    color: var(--gold);
    text-decoration: none;
}

.site-footer {
    border-top: 1px solid var(--divider);
    background: linear-gradient(180deg, transparent, rgba(7, 11, 20, 0.9));
    padding-block: 2.5rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.site-footer .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

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

.footer-brand img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    box-shadow: 0 0 0 1px var(--hairline-gold);
}

.footer-brand b {
    display: block;
    font-family: var(--font-display);
    font-size: 0.9375rem;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    font-weight: 600;
}

.publisher-row {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--divider);
}

.publisher-row .publisher {
    display: inline-block;
}

.publisher-row .publisher img {
    width: 104px;
    height: auto;
    display: block;
    border-radius: 0;
    box-shadow: none;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.publisher-row .publisher:hover img {
    opacity: 0.85;
}

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

/* --- Full-bleed art bands ----------------------------------------------- */

.band {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.band-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    max-width: none;
}

.band-veil {
    position: absolute;
    inset: 0;
    z-index: -1;
}

/* The hero is the poster: the lobby fills the viewport, the rail floats over
   it, and the bottom of the art dissolves into the page's own navy so the
   sections below start without a seam. */
.hero {
    margin-top: calc(-1 * var(--nav-h));
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    min-height: 100svh;
    padding-block: calc(var(--nav-h) + clamp(1.5rem, 5.5vh, 3.5rem)) clamp(2.25rem, 7vh, 4rem);
    text-align: center;
}

.hero .wrap {
    position: relative;
}

/* Biased to the bottom of the plate: the traveller stands at the foot of the
   frame, so a low anchor keeps him and the doorway together in landscape. In
   portrait the plate is taller than the viewport is wide, so cover crops the
   sides instead — the banners go, the traveller and the light seam stay. */
.hero .band-art {
    object-position: center 80%;
}

.hero .band-veil {
    background:
        radial-gradient(76% 56% at 50% 40%, rgba(5, 6, 10, 0) 0%, rgba(5, 6, 10, 0.34) 58%, rgba(5, 6, 10, 0.76) 100%),
        linear-gradient(180deg, rgba(5, 6, 10, 0.66) 0%, rgba(5, 6, 10, 0.1) 18%, rgba(5, 6, 10, 0.28) 46%, rgba(5, 6, 10, 0.72) 74%, rgba(5, 6, 10, 0.97) 92%, var(--surface-void) 100%);
}

/* The prose measure would pin these to the left of a 70rem wrap. */
.hero-foot .tagline,
.hero-foot .store-note {
    max-width: none;
}

.hero .tagline {
    margin-bottom: 0;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.9);
}

.hero-foot .actions {
    margin-top: 1.125rem;
}

/* --- The neon sign ------------------------------------------------------ */

.neon {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    max-width: 19ch;
    margin-inline: auto;
    font-size: clamp(2.0625rem, 7.2vw, 5.5rem);
    line-height: 1.06;
    letter-spacing: 0.005em;
    color: #fff7e6;
    text-shadow:
        0 0 2px rgba(255, 252, 244, 0.95),
        0 0 10px rgba(255, 232, 179, 0.8),
        0 0 26px rgba(255, 212, 105, 0.65),
        0 0 58px rgba(240, 168, 45, 0.5),
        0 0 110px rgba(168, 121, 28, 0.42),
        0 6px 40px rgba(0, 0, 0, 0.75);
    animation: neon-flicker 9s 2.5s infinite;
}

/* Rare and short — a tube settling, not a broken sign. */
@keyframes neon-flicker {
    0%,
    86%,
    100% {
        opacity: 1;
    }

    87% {
        opacity: 0.58;
    }

    88% {
        opacity: 1;
    }

    90% {
        opacity: 0.74;
    }

    91.5% {
        opacity: 1;
    }
}

/* --- Buttons ------------------------------------------------------------ */

.actions {
    display: flex;
    gap: 0.875rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.625rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: 0.03em;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-gold {
    background: linear-gradient(180deg, var(--gold-bright), var(--gold) 55%, #c8973a 100%);
    color: var(--on-reward);
    border-color: var(--gold-deep);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset, 0 12px 28px -14px rgba(255, 212, 105, 0.8);
}

.btn-gold:hover {
    color: var(--on-reward);
    filter: brightness(1.06);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 16px 34px -12px rgba(255, 212, 105, 0.9);
}

.btn-blue {
    background: linear-gradient(180deg, #3f8bff, var(--blue) 55%, var(--blue-deep) 100%);
    color: #fff;
    border-color: rgba(127, 180, 255, 0.5);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 12px 28px -14px rgba(46, 123, 255, 0.85);
}

.btn-blue:hover {
    color: #fff;
    filter: brightness(1.08);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--hairline-cool);
    color: var(--text-primary);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--hairline-gold-strong);
}

/* The pre-launch line under the buttons. */
.store-note {
    margin: 1.25rem auto 0;
    text-align: center;
    max-width: 30rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3125rem 0.875rem;
    border-radius: 999px;
    border: 1px solid var(--hairline-gold);
    background: rgba(168, 121, 28, 0.12);
    color: var(--text-gold);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.chip-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.6875rem;
    letter-spacing: 0.16em;
}

.chip::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold-glow);
    box-shadow: 0 0 10px var(--gold-glow);
}

/* --- Panels, cards and grids -------------------------------------------- */

.grid {
    display: grid;
    gap: 1rem;
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.grid-stats {
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
}

.card,
.panel {
    background: var(--panel-face);
    border-radius: var(--radius);
    box-shadow: var(--panel-edge);
    border: 0;
}

.card {
    padding: 1.5rem;
}

.panel {
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.card p:last-child,
.panel p:last-child {
    margin-bottom: 0;
}

.card-gold {
    box-shadow:
        0 1px 0 rgba(247, 227, 174, 0.12) inset,
        0 0 0 1px rgba(168, 121, 28, 0.5),
        0 26px 60px -30px rgba(255, 212, 105, 0.3),
        0 26px 60px -34px rgba(0, 0, 0, 0.95);
}

.step-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.125rem;
    height: 2.125rem;
    border-radius: 50%;
    border: 1px solid var(--hairline-gold);
    background: radial-gradient(circle at 50% 30%, rgba(255, 212, 105, 0.18), transparent 70%);
    color: var(--text-gold);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Stat tiles. */

.stat {
    background: var(--panel-face);
    border-radius: var(--radius);
    box-shadow: var(--panel-edge);
    padding: 1.125rem 1.25rem;
}

.stat dt {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.stat dd {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-gold);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    text-shadow: 0 0 26px rgba(255, 212, 105, 0.25);
}

/* A running clock is three numbers wide; it gets its own step down. */
.stat dd[data-countdown-to] {
    font-size: 1.4375rem;
    letter-spacing: 0.01em;
}

/* --- Phone screenshots -------------------------------------------------- */

.phones {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1rem, 3vw, 2rem);
    align-items: end;
    margin-top: 2.5rem;
}

.phone {
    display: block;
    margin-inline: auto;
    width: 100%;
    max-width: 15rem;
    padding: 7px;
    border-radius: 30px;
    background: linear-gradient(160deg, #38415a 0%, #141a28 30%, #05070c 100%);
    box-shadow:
        0 0 0 1px rgba(168, 121, 28, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.12) inset,
        0 40px 70px -38px rgba(0, 0, 0, 1);
}

.phone img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 23px;
}

.phone-caption {
    display: block;
    margin-top: 0.875rem;
    text-align: center;
    font-size: 0.6875rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* A phone beside a block of copy. */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 5vw, 3.5rem);
    align-items: center;
}

.split .phone {
    max-width: 13.5rem;
}

/* Four tiles beside a phone read as a 2 × 2 block, never 3 + 1. */
.split .grid-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* --- Concept art strips ------------------------------------------------- */

.art-strip {
    position: relative;
    margin: 0 0 2.5rem;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--panel-edge);
}

.art-strip img {
    display: block;
    width: 100%;
    aspect-ratio: 21 / 9;
    object-fit: cover;
    object-position: center 32%;
}

/* Art whose own lettering sits high in the frame. */
.art-strip img.pan-top {
    object-position: center 12%;
}

.art-strip figcaption {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 3rem 1.375rem 1rem;
    background: linear-gradient(180deg, transparent, rgba(5, 6, 10, 0.9));
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-gold);
}

@media (max-width: 40rem) {
    .art-strip img {
        aspect-ratio: 16 / 9;
    }
}

/* --- Floor type list ---------------------------------------------------- */

.floors {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.floors li {
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
    background: var(--panel-face);
    border-radius: var(--radius-sm);
    padding: 0.9375rem 1.125rem 0.9375rem 1.25rem;
    box-shadow:
        0 1px 0 rgba(247, 227, 174, 0.06) inset,
        0 0 0 1px rgba(168, 121, 28, 0.14),
        0 18px 36px -28px rgba(0, 0, 0, 0.9);
    position: relative;
    overflow: hidden;
}

/* Semantic edge per floor type — never the only signal, the name is always
   written out alongside it. */
.floors li::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 3px;
    background: var(--edge, var(--gold));
    box-shadow: 0 0 18px -2px var(--edge, var(--gold));
}

.floors b {
    display: block;
    font-family: var(--font-display);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 0.125rem;
}

.floors span {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.floor-reward { --edge: var(--gold); }
.floor-challenge { --edge: var(--blue); }
.floor-robber { --edge: var(--red); }
.floor-thief { --edge: var(--red-bright); }
.floor-deal { --edge: var(--purple); }
.floor-bank { --edge: var(--emerald); }
.floor-death { --edge: #6d1111; }
.floor-mystery { --edge: var(--violet); }
.floor-secret { --edge: var(--cyan); }

/* --- Histogram ---------------------------------------------------------- */

.histogram {
    display: grid;
    gap: 0.5rem;
    margin: 0;
}

.histogram-row {
    display: grid;
    grid-template-columns: 4.5rem 1fr 4.5rem;
    gap: 0.75rem;
    align-items: center;
}

.histogram-label {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.histogram-track {
    background: var(--lacquer-navy-deep);
    border: 1px solid var(--divider);
    border-radius: 5px;
    height: 1.5rem;
    overflow: hidden;
}

.histogram-bar {
    height: 100%;
    background: linear-gradient(90deg, #5c4210, var(--gold-deep) 60%, var(--gold));
    box-shadow: 0 0 18px -4px var(--gold-glow);
    border-radius: 4px 0 0 4px;
    min-width: 2px;
}

.histogram-count {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* --- Tables ------------------------------------------------------------- */

.table-scroll {
    overflow-x: auto;
    border-radius: var(--radius);
    background: var(--panel-face);
    box-shadow: var(--panel-edge);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    min-width: 28rem;
}

thead th {
    text-align: left;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--hairline-gold);
    white-space: nowrap;
}

tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(30, 42, 63, 0.55);
    color: var(--text-secondary);
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: rgba(255, 212, 105, 0.04);
}

td.rank {
    font-family: var(--font-display);
    font-variant-numeric: tabular-nums;
    color: var(--text-tertiary);
    width: 3.5rem;
}

td.name {
    color: var(--text-primary);
    font-weight: 600;
}

td.right {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

th.right {
    text-align: right;
}

tr.top-1 td,
tr.top-2 td,
tr.top-3 td {
    background: rgba(168, 121, 28, 0.07);
}

tr.top-1 td.rank,
tr.top-2 td.rank,
tr.top-3 td.rank {
    color: var(--gold);
    font-weight: 700;
}

tr.top-1 td.name {
    color: var(--gold-bright);
}

.flag {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    border: 1px solid var(--divider);
    border-radius: 4px;
    padding: 0.0625rem 0.4375rem;
}

/* --- Filters and pagination -------------------------------------------- */

.filters {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--panel-face);
    border-radius: var(--radius);
    box-shadow: var(--panel-edge);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.field label {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

select {
    appearance: none;
    background: var(--surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--hairline-cool);
    border-radius: var(--radius-sm);
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font: inherit;
    font-size: 0.9375rem;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-tertiary) 50%),
        linear-gradient(135deg, var(--text-tertiary) 50%, transparent 50%);
    background-position: calc(100% - 1rem) 55%, calc(100% - 0.7rem) 55%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.segmented {
    display: inline-flex;
    border: 1px solid var(--hairline-cool);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.segmented a {
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    background: var(--surface-elevated);
}

.segmented a + a {
    border-left: 1px solid var(--hairline-cool);
}

.segmented a:hover {
    text-decoration: none;
    color: var(--text-primary);
}

.segmented a[aria-current="true"] {
    background: linear-gradient(180deg, var(--gold-bright), var(--gold));
    color: var(--on-reward);
    font-weight: 600;
}

.pagination {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* --- Page heads (daily, leaderboard, prose) ----------------------------- */

.page-head {
    margin-top: 0;
    border-bottom: 1px solid var(--hairline-gold);
    padding-block: clamp(2.5rem, 7vw, 4rem) clamp(2rem, 5vw, 3rem);
}

/* A mark, never a hero: 120px tall, stated in the tag as well as here so an
   unstyled page shows a small image rather than a 700px doorway. */
.page-head-mark {
    position: absolute;
    z-index: -1;
    top: 50%;
    right: max(1.25rem, calc(50vw - var(--measure) / 2));
    transform: translateY(-50%);
    width: 88px;
    height: 120px;
    opacity: 0.7;
}

.page-head .band-veil {
    background:
        radial-gradient(60% 130% at 0% 50%, rgba(5, 6, 10, 0.9), rgba(5, 6, 10, 0.35) 72%),
        linear-gradient(180deg, rgba(11, 16, 28, 0.85), var(--surface-void) 100%);
}

.page-head h1 {
    font-size: clamp(1.875rem, 5vw, 3rem);
}

.page-head .lede {
    max-width: 36rem;
}

.page-head p:last-child {
    margin-bottom: 0;
}

/* --- Countdown ---------------------------------------------------------- */

.countdown {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    font-variant-numeric: tabular-nums;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-gold);
}

.countdown small {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* --- Prose (privacy, terms) -------------------------------------------- */

.prose {
    max-width: 44rem;
}

.prose h2 {
    margin-top: 2.5rem;
    font-size: clamp(1.25rem, 2.6vw, 1.5rem);
}

.prose ul {
    color: var(--text-secondary);
    padding-left: 1.25rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose dt {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 1rem;
}

.prose dd {
    margin: 0.25rem 0 0;
    color: var(--text-secondary);
}

.notice {
    border-radius: var(--radius);
    background: linear-gradient(165deg, rgba(168, 121, 28, 0.16), rgba(168, 121, 28, 0.05));
    box-shadow: 0 0 0 1px var(--hairline-gold), 0 1px 0 rgba(247, 227, 174, 0.1) inset;
    padding: 1.125rem 1.375rem;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.notice strong {
    color: var(--text-gold);
}

.empty {
    text-align: center;
    padding: 3rem 1.25rem;
    color: var(--text-tertiary);
    margin: 0;
    max-width: none;
}

/* --- Odds and ends ------------------------------------------------------ */

.centered {
    text-align: center;
}

.centered p,
.centered .lede {
    margin-inline: auto;
}

.section-head {
    max-width: 44rem;
}

.more {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

@media (max-width: 52rem) {
    .split {
        grid-template-columns: minmax(0, 1fr);
    }

    .split .phone {
        max-width: 12rem;
    }
}

@media (max-width: 44rem) {
    /* Keep the hero's call to action on one line: two stacked full-width
       buttons eat 190px of the plate, which is exactly where the traveller is
       standing. */
    .hero-foot .actions {
        gap: 0.625rem;
        margin-top: 0.875rem;
    }

    .hero-foot .btn {
        padding-inline: 1.125rem;
        font-size: 0.875rem;
    }

    .hero-foot .store-note {
        margin-top: 1rem;
    }

    .phones {
        grid-template-columns: minmax(0, 1fr);
        gap: 2.25rem;
        align-items: center;
    }

    .phone {
        max-width: 13rem;
    }
}

@media (max-width: 40rem) {
    .brand {
        font-size: 0.8125rem;
        letter-spacing: 0.1em;
    }

    .site-nav {
        gap: 0.5rem;
        font-size: 0.75rem;
    }

    .histogram-row {
        grid-template-columns: 3.25rem 1fr 2.75rem;
    }

    /* On a phone the band is all text, so the mark moves clear of it. */
    .page-head-mark {
        top: 1rem;
        transform: none;
        width: 44px;
        height: 60px;
        opacity: 0.5;
    }

    /* Fit the board inside a phone rather than making the page scroll
       sideways; .table-scroll stays as the safety net for long names. */
    table {
        min-width: 0;
        font-size: 0.875rem;
    }

    thead th,
    tbody td {
        padding-inline: 0.5rem;
    }

    thead th {
        white-space: normal;
        letter-spacing: 0.1em;
    }

    td.rank {
        width: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        animation: none !important;
        transition: none !important;
    }
}
