/* ---------- Colours and fonts ---------- */
:root {
    --bg: #12161D;
    --surface: #1B212A;
    --panel: #1B212A;
    --raised: #252D38;
    --edge: #0B0E13;
    --border: #2C3541;
    --border-soft: #262E39;
    --text: #F2F4F7;
    --text-soft: #CBD2DB;
    --muted: #8F99A6;
    --gold: #F5C451;
    --gold-edge: #A9822B;
    --up: #4CC38A;
    --up-bg: #183327;
    --up-chip: #183327;
    --up-edge: #2A7A55;
    --down: #F26D6D;
    --down-bg: #3A1D20;
    --down-chip: #3A1D20;
    --down-edge: #9A3B3B;
    --font: "Space Grotesk", system-ui, sans-serif;
    --num: "JetBrains Mono", ui-monospace, monospace;   /* numbers: money, prices, %, countdown */
    --pixel: "Silkscreen", "Space Grotesk", monospace;  /* the home title only */
    --serif: var(--font);
    --sans: var(--font);
    --mono: var(--font);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    color: var(--text);
    font-family: var(--font);
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
}

/* The night sky behind the city (the skyline and sky chart are drawn by game.js) */
body {
    min-height: 100vh;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 120% 45% at 50% 100%, rgba(245, 196, 81, 0.16), transparent 70%),
        linear-gradient(to bottom, #0b0f1c 0%, #111830 55%, #1d1c33 82%, #2b2236 100%);
    background-attachment: fixed;
}

/* Faint CRT scanlines over the scene (under the panels, so text stays sharp) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1;   /* above the city canvas, below the game (also z-index 1, but later in the page) */
    pointer-events: none;
    background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px);
}

[hidden] { display: none !important; }

/* The background price line (drawn by game.js) */
.bg-chart {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.6s ease;
}

body.in-game .bg-chart { opacity: 0.7; }

/* ---------- Home ---------- */
.home {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tape {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    overflow: hidden;
    border-bottom: 1px solid var(--border-soft);
    background: rgba(13, 17, 23, 0.85);
    display: flex;
    align-items: center;
}

.tape-track {
    display: flex;
    gap: 36px;
    white-space: nowrap;
    padding-left: 36px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
    animation: tape 45s linear infinite;
}

.t-up { color: var(--up); }
.t-down { color: var(--down); }

@keyframes tape { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.home-inner {
    width: 100%;
    max-width: 640px;
    padding: 96px 24px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
}

.home-kicker {
    margin: 0;
    font-family: var(--pixel);
    font-size: 14px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold);
    animation: fade-up 0.6s ease-out both;
}

/* Pixel title with a green/red offset, like a glitchy trading screen */
.home-title {
    margin: 0;
    font-family: var(--pixel);
    font-size: clamp(36px, 12.5vw, 88px);   /* sized so "PRICED IN" stays on one line */
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    text-shadow: -4px 0 var(--up), 4px 0 var(--down);
    animation: fade-up 0.7s ease-out 0.1s both;
}

.home-sub {
    margin: 0;
    font-size: clamp(16px, 2.4vw, 20px);
    line-height: 1.5;
    color: var(--text-soft);
    animation: fade-up 0.7s ease-out 0.25s both;
}

.home-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    animation: fade-up 0.7s ease-out 0.4s both;
}

.home-chips span {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-soft);
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--raised);
}

.home-chips span:empty { display: none; }

.btn-start {
    margin-top: 14px;
    width: 100%;
    max-width: 420px;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border: none;
    border-radius: 16px;
    background: var(--gold);
    color: #241A05;
    box-shadow: 0 5px 0 var(--gold-edge);
    font-family: var(--font);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    animation: fade-up 0.7s ease-out 0.55s both;
    transition: background-color 0.15s ease, transform 0.08s ease, box-shadow 0.08s ease;
}

.btn-start:hover { background: #F8D06E; }
.btn-start:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--gold-edge); }

.howto {
    width: 100%;
    max-width: 520px;
    text-align: left;
    font-size: 14px;
    color: var(--text-soft);
    animation: fade-up 0.7s ease-out 0.7s both;
}

.howto summary {
    cursor: pointer;
    text-align: center;
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    list-style: none;
}

.howto summary::-webkit-details-marker { display: none; }
.howto summary::before { content: "▸ "; }
.howto[open] summary::before { content: "▾ "; }

.howto ol {
    margin: 14px 0 0;
    padding: 16px 20px 16px 36px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    line-height: 1.55;
}

.howto li + li { margin-top: 8px; }

.home-stats {
    margin: 0;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

/* ---------- Game layout ---------- */
.app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* HUD across the top, like Krillion's depth / progress / score */
.hud {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 14px 16px 0 64px;
}

.hud-home {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-30%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: none;
    background: var(--raised);
    box-shadow: 0 3px 0 var(--edge);
    color: var(--gold);
    cursor: pointer;
}

.hud-home:hover { background: #2D3644; }

.hud-box {
    justify-self: start;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 14px;
    border-radius: 14px;
    background: var(--panel);
    box-shadow: 0 3px 0 var(--edge);
}

.hud-right { justify-self: end; text-align: right; }

.hud-label {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
}

.hud-value {
    font-family: var(--mono);
    font-size: 20px;
    font-weight: 700;
}

.hud-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.squares { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 340px; }   /* wraps when a practice round has many cards */

.squares i {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: var(--raised);
    border: 1px solid var(--raised);
}

.squares i.now { background: var(--gold); border-color: var(--gold); }
.squares i.hit { background: var(--up); border-color: var(--up); }
.squares i.miss { background: var(--down); border-color: var(--down); }

/* ---------- The tower: elevator display in the top bar ---------- */
/* Each level (data-level 0–6) looks a little more luxurious than the one below */
.floor {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 8px;
    background: var(--raised);
    box-shadow: 0 2px 0 var(--edge);
    font-family: var(--pixel);
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--muted);
    white-space: nowrap;
    transition: background 0.6s ease, color 0.6s ease, box-shadow 0.6s ease;
}
.floor-num { min-width: 2ch; text-align: center; font-weight: 700; color: var(--text); }
.floor-name { text-transform: uppercase; }

.floor[data-level="1"] { color: var(--text-soft); }                          /* Lobby */
.floor[data-level="2"] { color: var(--up); }                                 /* Trading floor */
.floor[data-level="3"] {                                                     /* Corner office */
    color: var(--gold);
    box-shadow: inset 0 0 0 1px var(--gold-edge), 0 2px 0 var(--edge);
}
.floor[data-level="4"] {                                                     /* Boardroom */
    color: var(--gold);
    background: linear-gradient(to bottom, #2c2410, #1a1508);
    box-shadow: inset 0 0 0 1px var(--gold), 0 2px 0 var(--edge), 0 0 12px rgba(245, 196, 81, 0.25);
}
.floor[data-level="4"] .floor-num { color: var(--gold); }
.floor[data-level="5"],                                                      /* Penthouse */
.floor[data-level="6"] {                                                     /* Rooftop */
    color: #2a1d04;
    background: linear-gradient(to bottom, #f8d77a, #c99a35);
    box-shadow: 0 2px 0 var(--gold-edge), 0 0 16px rgba(245, 196, 81, 0.4);
}
.floor[data-level="5"] .floor-num,
.floor[data-level="6"] .floor-num { color: #2a1d04; }
.floor[data-level="6"] {
    background: linear-gradient(110deg, #c99a35 20%, #fff1c2 40%, #f5c451 60%, #c99a35 80%);
    background-size: 250% 100%;
    animation: shimmer 3s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }

/* The elevator moving: a bounce up with a green glow, or a drop with a red one */
.floor.floor-up { animation: floor-up 0.8s cubic-bezier(0.3, 1.6, 0.5, 1); }
.floor.floor-down { animation: floor-down 0.6s ease-out; }
@keyframes floor-up {
    0% { transform: translateY(8px) scale(0.9); }
    50% { transform: translateY(-4px) scale(1.15); box-shadow: 0 0 0 3px var(--up), 0 0 18px var(--up); }
    100% { transform: none; }
}
@keyframes floor-down {
    0% { transform: translateY(-8px); }
    40% { transform: translateY(3px); box-shadow: 0 0 0 3px var(--down), 0 0 14px var(--down); }
    100% { transform: none; }
}

/* Phones and tablets: "Next: Corner office at $12,500 · $1,297 to go" under the top bar */
.next-level {
    grid-column: 1 / -1;
    margin: 0;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}

/* Laptops: the tower down the left side. Rows run from the Rooftop (top) to the Street,
   each with a coloured bar on the right; the gold marker sits at your balance. */
.tower {
    display: none;
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    width: 150px;
    padding: 14px 12px;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: rgba(13, 17, 23, 0.72);
}

.tower-title {
    margin: 0 0 10px;
    font-family: var(--pixel);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
}

.tower-levels { position: relative; }

.tower-row {
    position: relative;
    height: 46px;
    padding: 6px 18px 0 8px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tower-row::after {                 /* this level's slice of the coloured bar */
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    background: var(--bar);
    opacity: 0.25;
}
.tower-row:nth-child(1) { --bar: #ffcf6b; }   /* Rooftop */
.tower-row:nth-child(2) { --bar: #f0a060; }   /* Penthouse */
.tower-row:nth-child(3) { --bar: #d0707a; }   /* Boardroom */
.tower-row:nth-child(4) { --bar: #a066b0; }   /* Corner office */
.tower-row:nth-child(5) { --bar: #4cc38a; }   /* Trading floor */
.tower-row:nth-child(6) { --bar: #5b8def; }   /* Lobby */
.tower-row:nth-child(7) { --bar: #4a5263; }   /* Street */

.tower-name { font-size: 13px; font-weight: 600; color: var(--muted); }
.tower-min { font-size: 11px; color: var(--muted); opacity: 0.8; }

.tower-row.passed::after, .tower-row.now::after { opacity: 1; }
.tower-row.passed .tower-name { color: var(--text-soft); }
.tower-row.now { background: rgba(245, 196, 81, 0.1); }
.tower-row.now .tower-name { color: var(--gold); }
.tower-row.now .tower-min { color: var(--text-soft); }

/* Your balance: a gold tick across the bar and a tag pointing at it */
.tower-marker {
    position: absolute;
    left: 100%;
    margin-left: 10px;
    transform: translateY(50%);
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--gold);
    color: #241A05;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    transition: bottom 1.2s cubic-bezier(0.3, 1.2, 0.4, 1);
}
.tower-marker::before {             /* arrow pointing back at the bar */
    content: "";
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: var(--gold);
}
.tower-marker::after {              /* tick across the bar */
    content: "";
    position: absolute;
    right: calc(100% + 5px);
    top: 50%;
    width: 14px;
    height: 2px;
    margin-top: -1px;
    background: var(--gold);
}

@media (min-width: 1180px) {
    .tower { display: block; }
    .next-level { display: none; }
}

/* Practice: the tower is for weekly gains, so it's hidden during a practice round */
body.in-practice .floor,
body.in-practice .next-level,
body.in-practice .tower,
body.in-practice .floor-toast { display: none !important; }

/* Banner when you reach a new level */
.floor-toast {
    position: fixed;
    left: 50%;
    top: 96px;
    z-index: 6;
    transform: translateX(-50%);
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid var(--gold-edge);
    background: rgba(13, 17, 23, 0.94);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 24px rgba(245, 196, 81, 0.2);
    font-family: var(--pixel);
    font-size: 18px;
    color: var(--gold);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
}
.floor-toast.is-down { color: var(--down); border-color: var(--down-edge); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5); }
.floor-toast.show { animation: toast 2.6s ease-out forwards; }
@keyframes toast {
    0% { opacity: 0; transform: translate(-50%, 12px) scale(0.9); }
    12% { opacity: 1; transform: translate(-50%, 0) scale(1.06); }
    20% { transform: translate(-50%, 0) scale(1); }
    80% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -8px); }
}

.stage {
    flex-grow: 1;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 28px 16px 24px;
}

/* The one central panel */
.panel-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 28px 28px 22px;
    border-radius: 20px;
    background: var(--panel);
    box-shadow: 0 6px 0 var(--edge);
}

/* ---------- Text ---------- */
.kicker, .label {
    margin: 0;
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--gold);
}

.label { font-size: 12px; font-weight: 500; color: var(--muted); }
.gold { color: var(--gold); }

.headline {
    margin: -6px 0 0;
    font-family: var(--serif);
    font-size: clamp(28px, 6vw, 38px);
    font-weight: 700;
    line-height: 1.08;
}

.headline.big { font-size: clamp(54px, 12vw, 80px); }

.body-text {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-soft);
}

.muted { color: var(--muted); font-size: 13px; }
.note { margin: -6px 0 0; font-size: 13px; color: var(--muted); }

.panel-foot {
    margin: 4px 0 0;
    text-align: center;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
}

code {
    font-family: var(--mono);
    font-size: 13px;
    background: var(--surface);
    padding: 2px 6px;
    border-radius: 6px;
}

/* ---------- Results table ---------- */
.rows { width: 100%; border-collapse: collapse; }

.rows th {
    text-align: left;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    padding: 0 6px 8px 0;
}

.rows td {
    padding: 10px 6px 10px 0;
    border-top: 1px solid var(--border-soft);
    font-size: 15px;
    vertical-align: middle;
}

.rows .num { font-family: var(--mono); color: var(--muted); }
.rows .num.actual { color: var(--text); font-weight: 600; }

.chip {
    display: inline-block;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.chip .pct { font-weight: 400; opacity: 0.85; margin-left: 4px; }
.chip-beat { color: var(--up); background: var(--up-chip); }
.chip-miss { color: var(--down); background: var(--down-chip); }
.chip-inline { color: var(--text-soft); background: var(--raised); }

.clue {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--raised);
    border-left: 4px solid var(--gold);
}

.clue .label { color: var(--gold); }

.clue p {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-soft);
}

/* ---------- Reveal ---------- */
.move-line { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }

.move-number {
    font-family: var(--mono);
    font-size: clamp(52px, 11vw, 72px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.is-up { color: var(--up); }
.is-down { color: var(--down); }

.chart { position: relative; margin-top: -6px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; cursor: crosshair; }

/* 2W / 1M / 3M zoom buttons above a chart */
.chart-range { display: flex; justify-content: flex-end; gap: 4px; margin-bottom: -8px; }

.chart-range button {
    padding: 4px 10px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--muted);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.chart-range button:hover { color: var(--text); }
.chart-range button.active { background: var(--raised); color: var(--gold); }
.chart-range button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* The label that follows your finger or mouse along the chart */
.chart-tip {
    position: absolute;
    top: -8px;
    transform: translate(-50%, -100%);
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 10px;
    background: var(--raised);
    box-shadow: 0 3px 0 var(--edge);
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    pointer-events: none;
}

.chart-tip strong { font-size: 15px; color: var(--text); }

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--raised);
}

.stat-value { font-family: var(--mono); font-size: 17px; font-weight: 700; }

.why {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
}

.why-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tag {
    font-size: 13px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(245, 196, 81, 0.14);
    color: var(--gold);
}

.source { font-size: 13px; color: var(--muted); text-decoration: none; }
.source:hover { color: var(--gold); }

/* ---------- Results ---------- */
.results { text-align: center; align-items: center; }

.grid { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 360px; }

.grid-row { display: flex; align-items: center; gap: 6px; }
.grid-row .sq { width: 26px; height: 26px; border-radius: 6px; background: var(--raised); }
.grid-row .sq.hit { background: var(--up); }
.grid-row .sq.miss { background: var(--down); }
.grid-row .grid-name { margin-left: 8px; font-size: 15px; color: var(--text-soft); }
.grid-pnl { margin-left: auto; font-family: var(--mono); font-size: 15px; font-weight: 700; }

/* ---------- Today, Week and Practice ---------- */
.hub-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }

.week-total { display: flex; flex-direction: column; gap: 4px; margin-top: -6px; }

/* Monday to Friday tiles, green or red by the day's result */
.week-days {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.day-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 78px;
    padding: 10px;
    border-radius: 14px;
    background: var(--raised);
    box-shadow: 0 3px 0 var(--edge);
}

.day-tile.up { background: var(--up-bg); }
.day-tile.down { background: var(--down-bg); }
.day-tile.today { outline: 2px solid var(--gold); outline-offset: 2px; }
.day-tile.future { opacity: 0.45; }

.day-name { font-size: 12px; font-weight: 500; color: var(--muted); }
.day-pnl { font-size: 15px; font-weight: 700; color: var(--muted); }
.day-tile.up .day-pnl { color: var(--up); }
.day-tile.down .day-pnl { color: var(--down); }
.day-sub { font-size: 11px; color: var(--muted); }

.week-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.past-weeks { display: flex; flex-direction: column; gap: 8px; }
.past-row { display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.past-ret { margin-left: auto; font-weight: 700; }

/* Today: countdown, card teasers and the week strip */
.countdown { display: flex; flex-direction: column; gap: 8px; }

.countdown-tiles { display: flex; gap: 8px; }

.count-tile {
    flex: 1 1 0;
    max-width: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 0 8px;
    border-radius: 14px;
    background: var(--raised);
    box-shadow: 0 4px 0 var(--edge);
}

.count-tile strong { font-size: 30px; font-weight: 800; color: var(--gold); line-height: 1; }
.count-tile span { font-size: 11px; font-weight: 600; color: var(--muted); }

.teasers { display: flex; flex-direction: column; gap: 8px; }
.teasers:empty { display: none; }

.teaser {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--raised);
    border-left: 4px solid var(--gold);
}

.teaser.played { border-left-color: var(--border); }
.teaser-text { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.teaser-text strong { font-size: 16px; font-weight: 700; }
.teaser .grid-row .sq { width: 18px; height: 18px; border-radius: 5px; }
.teaser .grid-row .sq:not(.hit):not(.miss) { background: var(--bg); }   /* grey squares show against the teaser */
.teaser .grid-pnl { margin-left: 0; }

.week-strip .day-tile { min-height: 64px; }
.day-tile.locked { opacity: 0.6; }

/* The tab bar at the bottom of the menu */
.tab-row { display: flex; gap: 8px; }

.tab {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
    border: none;
    border-radius: 14px;
    background: none;
    color: var(--muted);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.tab:hover { color: var(--text); }
.tab.active { background: var(--raised); color: var(--gold); box-shadow: 0 3px 0 var(--edge); }
.tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Numbers in the terminal font ---------- */
/* Small data numbers only: big display numbers and word-and-number stats stay in Space Grotesk */
.hud-value, #pnl, .rows .num, .chip, .grid-pnl, .day-pnl,
.count-tile strong, .tower-min, .tower-marker, .past-ret,
.btn span, .floor-num {
    font-family: var(--num);
    letter-spacing: -0.02em;
}

/* ---------- Card and reveal: terminal-style headline and labels ----------
   The headline gets a "> " prompt above it and a blinking gold cursor after it.
   The mood and news text stay in Space Grotesk so they're easy to read. */
#card .headline, #reveal .headline {
    font-family: var(--num);
    font-weight: 800;
    letter-spacing: -0.04em;
}

#card .kicker, #reveal .kicker, #card .label, #reveal .label, #card .rows th {
    font-family: var(--num);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#card .kicker::before, #reveal .kicker::before { content: "> "; }

#card .headline::after, #reveal .headline::after {
    content: "_";
    color: var(--gold);
    animation: cursor-blink 1.1s steps(1) infinite;
}

@keyframes cursor-blink { 50% { opacity: 0; } }

/* ---------- Bottom bar ---------- */
/* No solid bar: the buttons sit on the city itself. A soft fade (clear at the top, a little
   darker towards the bottom) keeps the hint text readable over the lit windows. */
.actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    isolation: isolate;
    padding: 30px 16px 24px;
    background: linear-gradient(to bottom, rgba(8, 11, 20, 0) 0%, rgba(8, 11, 20, 0.45) 40%, rgba(8, 11, 20, 0.7) 100%);
}

/* A blur that fades in towards the bottom: the city still shows through, but a long card
   scrolling underneath turns soft instead of clashing with the hint text */
.actions::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 28%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 28%);
}

.actions .hint, .actions .tab { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9), 0 0 2px rgba(0, 0, 0, 0.8); }

.step {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hint {
    margin: 0;
    text-align: center;
    font-family: var(--mono);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-soft);
}

.hint.small { font-size: 12px; color: var(--muted); }

.hint strong.is-up { color: var(--up); }
.hint strong.is-down { color: var(--down); }

.btn-row { display: flex; gap: 10px; }

.btn {
    flex: 1 1 0;
    min-height: 60px;
    border-radius: 14px;
    border: none;
    background: var(--raised);
    box-shadow: 0 4px 0 var(--edge);
    color: var(--text);
    font-family: var(--font);
    font-size: 18px;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease;
}

.btn span { font-size: 12px; font-weight: 500; color: var(--muted); }
.btn:hover { background-color: #2D3644; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.btn:focus-visible, .hud-home:focus-visible, .btn-start:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.btn-up, .btn-down { flex-direction: row; gap: 8px; font-size: 19px; }
.btn-up { background: var(--up); color: #0B2418; box-shadow: 0 4px 0 var(--up-edge); }
.btn-up:hover { background: #5DCF98; }
.btn-up:active { box-shadow: 0 1px 0 var(--up-edge); }
.btn-down { background: var(--down); color: #2E0B0B; box-shadow: 0 4px 0 var(--down-edge); }
.btn-down:hover { background: #F58080; }
.btn-down:active { box-shadow: 0 1px 0 var(--down-edge); }

.btn-gold { background: var(--gold); color: #241A05; box-shadow: 0 4px 0 var(--gold-edge); }
.btn-gold:hover { background: #F8D06E; }
.btn-gold:active { box-shadow: 0 1px 0 var(--gold-edge); }

.btn-narrow { flex: 0 0 auto; padding: 0 18px; }

/* ---------- Animations ---------- */
.fade-up {
    opacity: 0;
    transform: translateY(10px);
    animation: fade-up 0.5s ease-out forwards;
}
.d1 { animation-delay: 0.3s; }
.d2 { animation-delay: 1.4s; }
.d3 { animation-delay: 1.8s; }

@keyframes fade-up { to { opacity: 1; transform: none; } }

.enter { animation: enter 0.4s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(14px) scale(0.99); } to { opacity: 1; transform: none; } }

.line-draw {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.area-fade { opacity: 0; animation: fade 0.6s ease-out 1.1s forwards; }
@keyframes fade { to { opacity: 1; } }

.dot-pop { opacity: 0; transform-box: fill-box; transform-origin: center; animation: pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) 1.25s forwards; }
@keyframes pop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }

.flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; z-index: 5; }
.flash.go { animation: flash 1s ease-out 0.9s; }
.flash.flash-up { background: var(--up); }
.flash.flash-down { background: var(--down); }
@keyframes flash { 0% { opacity: 0; } 20% { opacity: 0.22; } 100% { opacity: 0; } }

.shake { animation: shake 0.4s ease-in-out 1.4s; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ---------- Phones ---------- */
@media (max-width: 520px) {
    .hud { padding: 10px 10px 0 56px; gap: 8px; }
    .hud-home { left: 10px; width: 36px; height: 36px; }
    .hud-box { min-width: 0; padding: 6px 10px; }
    .hud-value { font-size: 15px; }
    .squares i { width: 12px; height: 12px; }
    /* A long practice round wraps onto a second row (8 squares a row) instead of
       running under the Portfolio and Return boxes */
    .squares { flex-wrap: wrap; justify-content: center; max-width: 124px; }
    .hud-progress { gap: 4px; }
    .floor { font-size: 9px; padding: 2px 6px; gap: 4px; }
    .floor-toast { top: 84px; font-size: 15px; }
    .stage { padding: 18px 10px 16px; }
    .panel-main { padding: 22px 18px 18px; }
    .stats { gap: 6px; }
    .stat { padding: 10px; }
    .stat-value { font-size: 14px; }
    .stat .label { font-size: 11px; }
    .week-days { gap: 5px; }
    .day-tile { padding: 8px 6px; min-height: 70px; }
    .day-pnl { font-size: 12px; }
    .day-sub { font-size: 10px; }
}

/* Respect people who turn animations off */
@media (prefers-reduced-motion: reduce) {
    #card .headline::after, #reveal .headline::after { animation: none; }
    .fade-up, .area-fade, .dot-pop { animation: none; opacity: 1; transform: none; }
    .line-draw { animation: none; stroke-dashoffset: 0; }
    .enter, .shake { animation: none; }
    .flash { display: none; }
    .tape-track { animation: none; }
    .home-kicker, .home-title, .home-sub, .home-chips, .btn-start, .howto { animation: none; }
    .floor.floor-up, .floor.floor-down, .floor[data-level="6"] { animation: none; }
    .tower-marker { transition: none; }
    /* The level banner still appears, but fades in place instead of moving */
    .floor-toast.show { animation: toast-fade 2.6s linear forwards; }
}
@keyframes toast-fade { 0%, 100% { opacity: 0; } 10%, 85% { opacity: 1; } }
