/* avoid-ai-design-ignore-file: T1, C6, SD2, SD4
   Kept on purpose: Brand Kit v1.1 mandates Inter and Inter Display Black, the metallic gold gradient on deep black, and tracked uppercase labels (Guidelines p.5-6). */
/* TraderBorn. Brand Kit v1.1: deep black, Market Blue surfaces, gold only for actions, XP and rank. Inter served from /font (CSP 'self'). */
@font-face { font-family: 'Inter'; src: url('/font/Inter-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/font/Inter-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/font/Inter-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter Display'; src: url('/font/InterDisplay-Black.woff2') format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }

/* TRADERBORN brand tokens (Brand Kit v1.1, 04_Brand_System/brand-tokens.css) */
:root {
  --tb-gold: #D4AF37;
  --tb-gold-light: #F4D578;
  --tb-gold-dark: #A87522;
  --tb-black: #080F14;
  --tb-market-blue: #132440;
  --tb-slate: #2A2F3A;
  --tb-white: #F4F4F4;
  --tb-muted: #93A3B5;
  --tb-gold-grad: linear-gradient(115deg, #FFF2B0 0%, #EFC763 18%, #D4A13A 46%, #F2CC68 73%, #9C661E 100%);

  --bg: var(--tb-black);
  --bg-2: var(--tb-market-blue);
  --line: var(--tb-slate);
  --ink: var(--tb-white);
  --muted: var(--tb-muted);
  --amber: var(--tb-gold);
  --amber-ink: var(--tb-black);
  --green: #5fd38d;
  --red: #ef6b6b;
  --radius: 16px;
  --font: 'Inter', Arial, sans-serif;
  --font-display: 'Inter Display', 'Inter', Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
}
a { color: var(--amber); }
button { font: inherit; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.08; font-family: var(--font-display); font-weight: 900; letter-spacing: -0.025em; }
h1 { font-size: clamp(1.7rem, 6vw, 2.5rem); }
h2 { font-size: 1.25rem; }
p { margin: 0 0 .9rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.eyebrow { color: var(--amber); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .5rem; }
.lead { font-size: 1.1rem; }
.of { color: var(--muted); font-size: .5em; font-weight: 600; margin-left: .1em; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 30px; width: auto; display: block; }
.brand__word { font-family: var(--font-display); font-weight: 900; font-size: 1.2rem; letter-spacing: -0.01em; color: #F9FAFC; line-height: 1; }
.brand__word b { font-weight: 900; background: var(--tb-gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.navbtn { background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.navbtn:hover { border-color: var(--amber); }

.wrap { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 20px 16px 32px; }
.foot { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; padding: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.foot nav { display: flex; gap: 14px; }
.foot a { color: var(--muted); }

.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px; margin-bottom: 16px; }
.hero { padding: 28px 0 12px; }
.hero h1 { font-size: clamp(2.2rem, 9vw, 3.6rem); }
.hero h1 b { font-weight: 900; background: var(--tb-gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.actions { display: flex; flex-direction: column; gap: 12px; margin: 22px 0 12px; }
.actions--row { flex-direction: row; flex-wrap: wrap; }
.btn {
  display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 2px; padding: 12px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--ink); cursor: pointer; text-decoration: none; text-align: left;
  transition: transform .05s ease, border-color .15s ease;
}
.btn:hover { border-color: var(--amber); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--tb-gold-grad); color: var(--amber-ink); border-color: var(--tb-gold-dark); font-weight: 800; }
.btn--primary:hover { filter: brightness(1.05); }
.btn--big { padding: 16px 20px; width: 100%; }
.btn__title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 900; letter-spacing: -0.01em; }
.btn__sub { font-size: .85rem; opacity: .8; font-weight: 500; }
.btn[disabled] { opacity: .55; cursor: wait; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 0; }

.strip { margin-top: 24px; }
.mini { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.mini li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; font-size: .95rem; }
.mini b { font-family: var(--mono); color: var(--amber); }

.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
.form input { font: inherit; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.form input:focus { outline: 2px solid var(--amber); outline-offset: 1px; border-color: transparent; }
.form--row { flex-direction: row; flex-wrap: wrap; }
.form--row input { flex: 1 1 220px; }
.form.inline, .inline { display: inline; }
.styles { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.styles legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: .95rem; width: 100%; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; }
.pill span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; }
.pill input:checked + span { border-color: var(--amber); color: var(--amber); }
.pill input:focus-visible + span { outline: 2px solid var(--amber); }
.error { color: var(--red); font-size: .95rem; }
.flash { padding: 10px 14px; border-radius: 10px; background: #1d2b22; color: var(--green); }
.flash--err { background: #2b1d1d; color: var(--red); }

/* Season */
.season__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.season__count { font-family: var(--mono); font-size: 1.6rem; font-weight: 700; margin: 0; }
.market { margin: 0; color: var(--muted); }
.market b { color: var(--ink); }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-bottom: 16px; }
.metric { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); }
.metric b { font-family: var(--mono); color: var(--ink); text-align: right; }
.bar { height: 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--tb-gold-grad); transition: width .4s ease; }
.metric.up b { color: var(--green); }
.metric.down b { color: var(--red); }
.event { background: linear-gradient(180deg, var(--tb-market-blue), #0d1a2e); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px; }
.event__text { font-size: 1.2rem; font-weight: 600; line-height: 1.35; margin-bottom: 16px; }
.options { display: grid; gap: 10px; }
.opt { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; text-align: left; }
.opt:hover { border-color: var(--amber); }
.opt .risk { font-size: .72rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.opt .risk.hot { color: var(--red); }
.outcome { margin-top: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.outcome__text { font-size: 1.05rem; font-weight: 600; }
.outcome__delta { font-family: var(--mono); color: var(--muted); font-size: .95rem; }
.outcome__change { font-weight: 700; color: var(--amber); }
.outcome.bad .outcome__text { color: var(--red); }
.outcome.fired .outcome__change { color: var(--red); }

/* Summary + share */
.summary h1 { font-size: 4.6rem; margin: 4px 0 8px; }
.score { font-family: var(--font-display); font-weight: 900; letter-spacing: -0.04em; background: var(--tb-gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ending { color: var(--muted); }
.rank { font-weight: 700; color: var(--amber); }
.log ol { padding-left: 20px; color: var(--muted); font-size: .9rem; }
.log summary { cursor: pointer; color: var(--muted); }
.signup h2 { margin-bottom: 4px; }

/* Board */
.tabs { display: flex; gap: 8px; margin: 10px 0 14px; }
.tab { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.tab.is-active { border-color: var(--amber); color: var(--amber); }
.rows { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; }
.rows li { display: grid; grid-template-columns: 32px 1fr auto auto; gap: 10px; align-items: center; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.rows .n { font-family: var(--mono); color: var(--muted); }
.rows .s { font-family: var(--mono); font-weight: 700; color: var(--amber); }
.rows .st { color: var(--muted); font-size: .85rem; }
.rows li.me { border-color: var(--amber); }

/* Server pages */
.page .share h1 { font-size: 4.6rem; }
.prose ul, .prose ol { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.admin table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: .95rem; }
.admin th, .admin td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }

@media (min-width: 560px) {
  .actions { flex-direction: row; }
  .btn--big { width: auto; flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .bar i { transition: none; }
}

/* ---------- Site: nav, landing, how-it-works ---------- */
.wrap--wide { max-width: 1040px; }
.topnav { display: flex; align-items: center; gap: 6px; }
.navlink { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.navlink:hover { color: var(--ink); }
.btn--sm { padding: 8px 16px; flex-direction: row; font-size: .95rem; }
.top .navbtn { display: none; }
@media (max-width: 560px) {
  .navlink--hide-sm { display: none; }
  .brand__word { display: none; }
  .navlink { padding: 6px 6px; font-size: .9rem; }
}
@media (max-width: 380px) { .brand__word { display: none; } }

.hero--landing { padding: 40px 0 24px; }
.hero--landing h1 { font-size: clamp(2.4rem, 8vw, 4.4rem); max-width: 14ch; }
.hero--landing .lead { color: var(--muted); max-width: 46ch; }
.hero--landing .actions { max-width: 640px; }
a.btn { color: var(--ink); }
a.btn--primary { color: var(--amber-ink); }

.block { margin: 56px 0; }
.block h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
.block--split { display: grid; gap: 20px; align-items: start; }
@media (min-width: 820px) { .block--split { grid-template-columns: 1fr 1.4fr; } }

/* The ladder echoes the rising candles in the TB mark. */
.ladder { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(8, minmax(64px, 1fr)); gap: 10px; align-items: end; height: 260px; overflow-x: auto; }
.ladder li { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 8px; }
.ladder .candle { display: block; width: 26px; border-radius: 3px; background: var(--tb-gold-grad); position: relative; box-shadow: 0 0 0 1px rgba(255, 241, 173, .25) inset; }
.ladder .candle::before { content: ''; position: absolute; left: 50%; top: -14px; bottom: -10px; width: 2px; margin-left: -1px; background: rgba(244, 213, 120, .55); z-index: -1; }
.ladder__name { font-size: .78rem; color: var(--muted); text-align: center; line-height: 1.2; min-height: 2.4em; }
.ladder .h1 .candle { height: 14%; } .ladder .h2 .candle { height: 24%; } .ladder .h3 .candle { height: 34%; } .ladder .h4 .candle { height: 44%; }
.ladder .h5 .candle { height: 54%; } .ladder .h6 .candle { height: 64%; } .ladder .h7 .candle { height: 74%; } .ladder .h8 .candle { height: 84%; }
.ladder .h8 .ladder__name { color: var(--amber); font-weight: 700; }

.opt.is-picked { border-color: var(--amber); }
.event .outcome { margin-top: 14px; }

.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { color: var(--muted); margin: 10px 0 0; }

.prose table { width: 100%; border-collapse: collapse; margin: 8px 0 20px; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 1.05rem; margin-top: 16px; }

/* ---------- Nav: links are always separated, never run together ---------- */
.topnav { gap: 4px 18px; flex-wrap: wrap; justify-content: flex-end; }
.topnav .navlink { text-decoration: none; white-space: nowrap; padding: 8px 4px; border-bottom: 2px solid transparent; }
.topnav .navlink:hover, .topnav .navlink[aria-current="page"] { color: var(--ink); border-bottom-color: var(--tb-gold); }
.topnav .btn { margin-left: 6px; white-space: nowrap; }
@media (max-width: 560px) { .topnav { gap: 4px 12px; } }

/* ---------- Tables: left-aligned for LTR, ruled, header row set apart ---------- */
html[dir="ltr"] th, html[dir="ltr"] td { text-align: left; }
html[dir="rtl"] th, html[dir="rtl"] td { text-align: right; }
.prose table, .admin table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--tb-slate); border-radius: 12px; overflow: hidden; margin: 12px 0 24px; font-size: .95rem; }
.prose th, .admin th { background: rgba(212, 175, 55, .10); color: var(--tb-gold-light); font-weight: 700; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; }
.prose th, .prose td, .admin th, .admin td { padding: 12px 14px; border-bottom: 1px solid var(--tb-slate); vertical-align: top; }
.prose th + th, .prose td + td, .admin th + th, .admin td + td { border-left: 1px solid var(--tb-slate); }
.prose tbody tr:last-child td, .admin tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .025); }
.prose td:first-child { width: 2.5em; color: var(--muted); font-family: var(--mono); }
@media (max-width: 560px) { .prose table { font-size: .85rem; } .prose th, .prose td { padding: 9px 8px; } }

/* ---------- Season: year track, market chip, deltas, promotion moment ---------- */
.track { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(20, 1fr); gap: 4px; align-items: end; height: 26px; }
.track li { height: 40%; border-radius: 2px; background: var(--tb-slate); }
.track li.ok { height: 70%; background: var(--tb-gold-grad); }
.track li.bad { height: 55%; background: var(--red); opacity: .75; }
.track li.promoted { height: 100%; box-shadow: 0 0 0 1px var(--tb-gold-light); }
.track li.fired { height: 100%; }
.track li.now { height: 100%; background: transparent; box-shadow: inset 0 0 0 2px var(--tb-gold); }

.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-right: 6px; vertical-align: 1px; border: 1px solid currentColor; }
.chip--bull { color: var(--green); }
.chip--bear { color: var(--tb-muted); }
.chip--crash { color: var(--red); }
.chip--bubble { color: var(--tb-gold-light); }

.outcome__delta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: var(--mono); font-size: .95rem; }
.outcome__delta .up { color: var(--tb-gold-light); }
.outcome__delta .down { color: var(--red); }

.moment { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(8, 15, 20, .92); }
.moment[hidden] { display: none; }
.moment__card { width: min(420px, 100%); text-align: center; background: linear-gradient(180deg, var(--tb-market-blue), #0d1a2e); border: 1px solid var(--tb-gold-dark); border-radius: 20px; padding: 28px 22px; animation: rise .45s cubic-bezier(.2, .8, .2, 1); }
.moment__card .eyebrow { font-size: .9rem; letter-spacing: .24em; }
.moment__card h2 { font-size: clamp(1.8rem, 7vw, 2.4rem); margin: 4px 0 18px; background: var(--tb-gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.moment__line { color: var(--muted); margin: 16px 0 20px; }
.moment--fired .moment__card { border-color: var(--red); }
.moment--fired .eyebrow { color: var(--red); }
.moment--fired h2 { background: none; color: var(--ink); }
@keyframes rise { from { transform: translateY(16px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

/* Mini ladder: the eight stages, lit up to where you are. */
.ladder--mini { height: 90px; margin: 0 auto 4px; max-width: 280px; grid-template-columns: repeat(8, 1fr); gap: 8px; overflow: visible; }
.ladder--mini .candle { width: 14px; background: var(--tb-slate); box-shadow: none; }
.ladder--mini .candle::before { display: none; }
.ladder--mini .lit .candle { background: var(--tb-gold-grad); }
/* avoid-ai-design-ignore: C5 — the glow marks the stage you reached, it carries meaning */
.ladder--mini .at .candle { box-shadow: 0 0 14px rgba(244, 213, 120, .55); }
.summary .ladder--mini { margin: 6px 0 14px; max-width: 240px; }
@media (prefers-reduced-motion: reduce) { .moment__card { animation: none; } }

/* ---------- Status bar: age, role at employer, net worth ---------- */
.status { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; margin: 0 0 12px; padding: 12px 14px; background: linear-gradient(180deg, var(--tb-market-blue), #0d1a2e); border: 1px solid var(--tb-slate); border-radius: 14px; }
.status__item { margin: 0; min-width: 0; }
.status dt { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.status dd { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: 1.15rem; line-height: 1.15; }
@media (max-width: 420px) { .status__item--role dd span { font-size: 1rem; } }
.status__item--role dd span { display: block; }
.status__item--role small { display: block; font-family: var(--font); font-weight: 400; font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status__item--worth { text-align: right; }
.status__item--worth dd { background: var(--tb-gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 1.3rem; }
.season__head { display: block; }
.season__head .eyebrow { margin: 4px 0 4px; }

.pnl { font-family: var(--font-display); font-weight: 900; font-size: 1.6rem; margin: 0 0 6px; color: var(--muted); }
.pnl--up { background: var(--tb-gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pnl--down { color: var(--red); }

.moment__where { color: var(--ink); margin: -10px 0 16px; font-weight: 600; }
.worth-final { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 4px 0 12px; padding: 12px 0; border-top: 1px solid var(--tb-slate); border-bottom: 1px solid var(--tb-slate); color: var(--muted); }
.worth-final b { font-family: var(--font-display); font-weight: 900; font-size: 1.8rem; background: var(--tb-gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Keyboard focus: visible on every interactive element ---------- */
:focus-visible { outline: 2px solid var(--tb-gold-light); outline-offset: 3px; border-radius: 6px; }
.btn:focus-visible, .opt:focus-visible, .tab:focus-visible, .navlink:focus-visible { outline: 2px solid var(--tb-gold-light); outline-offset: 3px; }
.form input:focus-visible { outline: 2px solid var(--tb-gold-light); outline-offset: 1px; }

/* ---------- Odds on every option, and the draw ---------- */
.opt { flex-wrap: wrap; row-gap: 8px; }
.opt__label { flex: 1 1 60%; }
.odds { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.odd { display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 8px; border-radius: 8px; font-size: .8rem; font-family: var(--mono); border: 1px solid transparent; white-space: nowrap; }
.odd b { font-family: var(--font); font-weight: 700; }
.odd--win { color: var(--tb-gold-light); background: rgba(212, 175, 55, .10); }
.odd--lose { color: #f19a9a; background: rgba(239, 107, 107, .10); }
.opt.is-dim { opacity: .35; }
.opt.is-picked { border-color: var(--tb-gold); opacity: 1; }
.opt.is-picked .odd { transition: transform .08s ease, box-shadow .08s ease; }
.odd.is-on { transform: scale(1.08); border-color: currentColor; box-shadow: 0 0 0 2px rgba(255, 255, 255, .06); }

/* ---------- Game layout: the desk, and the career beside it on wide screens ---------- */
.wrap--game { max-width: 640px; }
.history { margin-top: 18px; background: var(--bg-2); border: 1px solid var(--tb-slate); border-radius: var(--radius); padding: 14px; }
.history__title { font-size: 1.05rem; margin: 0 0 10px; }
.history__table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.history__table th { text-align: left; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 0 6px 8px; border-bottom: 1px solid var(--tb-slate); }
.history__table td { padding: 8px 6px; border-bottom: 1px solid var(--tb-slate); vertical-align: middle; }
.history__table .num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.history__table .age { font-family: var(--mono); color: var(--muted); width: 2.5em; }
.history__table .up { color: var(--tb-gold-light); }
.history__table .down { color: var(--red); }
.history__table tr.is-promoted td { background: rgba(212, 175, 55, .07); }
.history__table tr.is-fired td { background: rgba(239, 107, 107, .07); }
.who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.who__name { display: flex; flex-direction: column; min-width: 0; font-weight: 600; line-height: 1.2; }
.who__name small { color: var(--muted); font-weight: 400; font-size: .78rem; }
.badge { --badge-h: 210; flex: 0 0 auto; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-size: .7rem; font-weight: 800; letter-spacing: .02em; color: #fff; background: hsl(var(--badge-h) 55% 32%); box-shadow: inset 0 0 0 1px hsl(var(--badge-h) 60% 55% / .5); }

@media (min-width: 980px) {
  .wrap--game { max-width: 1160px; }
  .season { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 22px; align-items: start; }
  .season__main { grid-column: 2; }
  .history { grid-column: 1; grid-row: 1; margin-top: 0; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
  .wrap--game > .card, .wrap--game > .stack, .wrap--game > section:not(.season):not(.offers) { max-width: 640px; margin-inline: auto; }
  .wrap--game > .offers { max-width: 980px; margin-inline: auto; }
  .offers__grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Country picker ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-weight: 600; font-size: .95rem; }
.country { position: relative; }
.country__current { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; cursor: pointer; text-align: left; }
.country__current img, .flag { border-radius: 3px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); object-fit: cover; vertical-align: -2px; }
.country__caret { margin-left: auto; color: var(--muted); }
.country__panel { position: absolute; z-index: 20; inset: calc(100% + 6px) 0 auto 0; background: var(--tb-market-blue); border: 1px solid var(--tb-slate); border-radius: 12px; padding: 8px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.country__panel input { width: 100%; font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); margin-bottom: 6px; }
.country__list { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow: auto; }
.country__list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.country__list li:hover, .country__list li:focus-visible { background: rgba(212, 175, 55, .10); outline: none; }
.country__list li img { border-radius: 3px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); }
.form select { font: inherit; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.lb-name { display: inline-flex; align-items: center; gap: 8px; }
.status dd .flag { margin-right: 4px; }

/* ---------- Offers ---------- */
.offers h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); margin-bottom: 4px; }
.offers .lead { margin-bottom: 18px; }
.offers__grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.offer { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 16px 18px; border-radius: var(--radius); border: 1px solid var(--tb-slate); background: linear-gradient(180deg, var(--tb-market-blue), #0d1a2e); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .15s ease, transform .08s ease; }
.offer:hover { border-color: var(--tb-gold); }
.offer:active { transform: translateY(1px); }
.offer .badge { width: 52px; height: 52px; border-radius: 14px; font-size: 1.05rem; margin-bottom: 4px; }
.offer__name { font-family: var(--font-display); font-weight: 900; font-size: 1.3rem; line-height: 1.15; }
.offer__where { font-size: .9rem; }
.offer__pay { font-family: var(--font-display); font-weight: 900; font-size: 1.5rem; margin-top: 6px; background: var(--tb-gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tag { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.tag--steady { color: var(--green); background: rgba(95, 211, 141, .12); }
.tag--bonus { color: var(--tb-gold-light); background: rgba(212, 175, 55, .14); }
.tag--churn { color: #f19a9a; background: rgba(239, 107, 107, .12); }
.tag--abroad { color: #9cc3ff; background: rgba(120, 170, 255, .12); }
.badge { background: var(--badge-bg, hsl(var(--badge-h) 55% 32%)); }
.status__earn { display: block; font-size: .75rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.earn-final { display: flex; justify-content: space-between; margin: -4px 0 12px; }
.earn-final b { color: var(--ink); }

/* ---------- Background: a trading floor at night, towers through the glass ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 15, 20, .72) 0%, rgba(8, 15, 20, .86) 45%, rgba(8, 15, 20, .97) 100%),
    url('/bg/trading-floor.webp') center top / cover no-repeat;
}
@media (max-width: 700px) {
  body::before { background: linear-gradient(180deg, rgba(8, 15, 20, .7) 0%, rgba(8, 15, 20, .9) 40%, rgba(8, 15, 20, .98) 100%), url('/bg/trading-floor-sm.webp') center top / cover no-repeat; }
}
body { background: transparent; }
html { background: var(--bg); }
.top { background: rgba(8, 15, 20, .55); backdrop-filter: none; }
.card, .event, .status, .history, .offer, .outcome { box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }

/* ---------- Choices as tiles: a form you fill in, not a list you scroll ---------- */
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 8px; min-height: 150px; padding: 14px; border-radius: 14px; border: 1px solid var(--tb-slate); background: rgba(8, 15, 20, .72); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s ease, transform .08s ease, opacity .2s ease; }
.tile:hover { border-color: var(--tb-gold); }
.tile:active { transform: translateY(1px); }
.tile.is-dim { opacity: .35; }
.tile.is-picked { border-color: var(--tb-gold); opacity: 1; }
.tile__title { font-weight: 700; font-size: 1.02rem; line-height: 1.25; }
.tile--offer { align-items: center; text-align: center; justify-content: flex-start; min-height: 210px; }
.tile--offer .badge { width: 44px; height: 44px; border-radius: 12px; font-size: .9rem; }
.tile--offer .tile__title { font-family: var(--font-display); font-weight: 900; font-size: 1.12rem; }
.tile__sub { font-size: .82rem; color: var(--muted); line-height: 1.3; }
.tile__where { font-size: .8rem; color: var(--muted); }
.tile__pay { margin-top: auto; font-family: var(--font-display); font-weight: 900; font-size: 1.2rem; background: var(--tb-gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tile--up { border-color: rgba(212, 175, 55, .45); }
.tile--founder { border-color: var(--tb-gold); background: linear-gradient(180deg, rgba(212, 175, 55, .10), rgba(8, 15, 20, .8)); }
.tile .odds { justify-content: flex-start; }
@media (min-width: 560px) { .tile { min-height: 160px; } }
.event .eyebrow { margin-bottom: 6px; }

/* ---------- Origin ---------- */
.origin h1 { font-size: clamp(2rem, 7vw, 2.8rem); }
.origin__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 22px; }
.origin__facts div { background: rgba(8, 15, 20, .6); border: 1px solid var(--tb-slate); border-radius: 12px; padding: 12px; }
.origin__facts dt { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.origin__facts dd { margin: 4px 0 0; font-weight: 700; }
.origin__money { font-family: var(--font-display); font-weight: 900; font-size: 1.4rem; background: var(--tb-gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.origin--wealthy, .origin--dynasty { border-color: var(--tb-gold); }
@media (max-width: 480px) { .origin__facts { grid-template-columns: 1fr 1fr; } .origin__facts div:last-child { grid-column: 1 / -1; } }

/* ---------- The dealer and the collection ---------- */
.icon { width: 28px; height: 28px; fill: none; stroke: var(--tb-gold-light); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tile--item { align-items: center; text-align: center; justify-content: flex-start; min-height: 220px; }
.tile--item .icon { width: 40px; height: 40px; margin-bottom: 2px; }
.tile--skip { align-items: center; justify-content: center; text-align: center; border-style: dashed; }
.tile--moment { grid-column: 1 / -1; min-height: 90px; align-items: center; justify-content: center; text-align: center; border-color: var(--tb-gold); background: linear-gradient(180deg, rgba(212, 175, 55, .16), rgba(8, 15, 20, .8)); }
.tile--moment .tile__title { font-family: var(--font-display); font-weight: 900; font-size: 1.3rem; }
.collection { display: flex; justify-content: flex-end; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.owned { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: rgba(212, 175, 55, .12); }
.owned .icon { width: 16px; height: 16px; }
.summary-collection { margin: 6px 0 14px; }
.summary-collection h2 { font-size: 1rem; margin-bottom: 8px; }
.summary-collection ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.summary-collection li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--tb-slate); border-radius: 10px; }
.summary-collection li b { font-family: var(--mono); color: var(--tb-gold-light); }
