/* ============================================================
   Motorsports Trivia — graphite / brushed-silver theme
   (variable names kept from the dirt template; values are grey)
   ============================================================ */
:root {
  --clay-900: #0d0e10;
  --clay-800: #15171c;
  --clay-700: #1d2026;
  --clay-600: #2b2f38;
  --dirt: #565d6a;      /* muted steel */
  --dust: #99a3b3;      /* light steel */
  --amber: #d7dde8;     /* PRIMARY ACCENT = bright silver */
  --amber-hot: #aab3c2; /* accent gradient bottom / secondary steel */
  --green: #3ad17a;
  --red: #ff5563;
  --paper: #eef1f6;
  --ink: #e6eaf0;
  --muted: #99a3b3;
  --line: rgba(215, 221, 232, 0.16);
  --card: #191c22;
  --card-hi: #232730;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --cond: 'Arial Narrow', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { min-height: 100%; background: #0f1114; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, #2c313b 0%, transparent 60%),
    radial-gradient(900px 500px at 80% 110%, #1b2027 0%, transparent 55%),
    linear-gradient(180deg, #0f1114 0%, #191c22 55%, #0e1013 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* subtle carbon grain */
body::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  opacity: 0.05;
  background-image: radial-gradient(rgba(255,255,255,0.6) 0.5px, transparent 0.6px);
  background-size: 3px 3px;
}

#app { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; padding: 20px 18px 40px; }

.screen { display: none; animation: fade 0.35s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.btn {
  border: none; cursor: pointer; font-family: var(--font);
  font-weight: 800; letter-spacing: 0.5px; border-radius: 12px;
  transition: transform 0.08s, box-shadow 0.15s, filter 0.15s;
}
.btn:active { transform: translateY(2px) scale(0.99); }

.btn-go {
  background: linear-gradient(180deg, var(--amber) 0%, var(--amber-hot) 100%);
  color: #11131a; font-size: 18px; padding: 16px 26px; width: 100%;
  box-shadow: 0 6px 0 #585f6c, 0 12px 24px rgba(170,179,194,0.25);
  text-shadow: 0 1px 0 rgba(255,255,255,0.25);
}
.btn-go:active { box-shadow: 0 2px 0 #585f6c; }
.btn-go:disabled { filter: grayscale(0.7) brightness(0.6); cursor: not-allowed; box-shadow: none; }

.btn-ghost {
  background: transparent; border: 1.5px solid var(--line); color: var(--muted);
  border-radius: 10px; padding: 10px 16px; font-weight: 700; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--amber); }
.btn-wide { width: 100%; margin-top: 10px; }

.muted { color: var(--muted); font-weight: 400; }

/* ===================== HOME ===================== */
.brand { text-align: center; padding: 14px 0 22px; }
.brand-logo { display: block; width: min(420px, 88%); margin: 0 auto; filter: drop-shadow(0 8px 18px rgba(0,0,0,.55)); }
.brand-fallback { display: none; }
.brand-mark { font-size: 46px; line-height: 1; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
.brand-title {
  font-family: var(--cond);
  font-weight: 900; font-size: clamp(34px, 9vw, 58px); line-height: 0.92;
  letter-spacing: 1px; margin-top: 6px;
  color: var(--paper);
  text-shadow: 0 2px 0 #000, 0 0 26px rgba(215,221,232,.25);
}
.brand-title span {
  display: block; color: var(--amber);
  -webkit-text-stroke: 0; text-shadow: 0 2px 0 #4a515e, 0 0 20px rgba(170,179,194,.4);
}
.brand-tag { color: var(--muted); margin-top: 12px; font-size: 14px; max-width: 460px; margin-inline: auto; }

.setup { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.setup-block { margin-bottom: 20px; }
.setup-label { font-family: var(--cond); font-weight: 800; letter-spacing: 1px; text-transform: uppercase; font-size: 15px; color: var(--amber); margin-bottom: 10px; }

.disc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.disc-card {
  background: var(--card-hi); border: 1.5px solid transparent; border-radius: 14px;
  padding: 14px 8px; cursor: pointer; text-align: center; position: relative;
  transition: border-color .15s, transform .1s, background .15s;
}
.disc-card:hover { transform: translateY(-2px); background: #3d2a20; }
.disc-card.sel { border-color: var(--amber); background: #3d2a20; box-shadow: 0 0 0 3px rgba(215,221,232,.15); }
.disc-emoji { font-size: 26px; display: block; }
.disc-emoji img { width: 42px; height: 42px; object-fit: contain; display: block; margin: 0 auto; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.disc-name { display: block; color: var(--paper); font-weight: 800; font-size: 13px; margin-top: 6px; }
.disc-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.filters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

/* series multi-select chips */
.series-bar { margin-bottom: 6px; }
.mode-series { margin: 4px 0 14px; }
.series-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.series-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.series-chip { background: var(--card); border: 1.5px solid var(--line); color: var(--muted); border-radius: 20px; padding: 8px 14px; font-family: var(--font); font-weight: 700; font-size: 13px; cursor: pointer; transition: border-color .12s, color .12s, background .12s; }
.series-chip:hover { border-color: var(--amber); color: var(--ink); }
.series-chip.active { background: rgba(215,221,232,.14); border-color: var(--amber); color: var(--paper); }
.series-chip.all.active { background: linear-gradient(180deg, var(--amber), var(--amber-hot)); color: #11131a; border-color: var(--amber); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.field select {
  appearance: none; -webkit-appearance: none;
  background: var(--clay-800) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23d7dde8' d='M6 8 0 0h12z'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--ink); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 11px 30px 11px 12px; font-size: 14px; font-weight: 600; font-family: var(--font);
  text-transform: none; letter-spacing: 0; cursor: pointer;
}
.field select:focus { outline: none; border-color: var(--amber); }

.setup-foot { display: flex; flex-direction: column; gap: 12px; }
.pool-info { text-align: center; font-size: 13px; color: var(--muted); font-weight: 600; }
.pool-info b { color: var(--amber); }

.best-line { text-align: center; margin-top: 18px; color: var(--muted); font-size: 13px; min-height: 18px; }
.best-line b { color: var(--paper); }
.home-foot { display: flex; flex-direction: column; align-items: center; gap: 9px; margin-top: 24px; }
.report-link { color: var(--muted); font-size: 12px; text-decoration: none; border-bottom: 1px dashed var(--line); padding-bottom: 1px; transition: color .15s, border-color .15s; }
.report-link:hover { color: var(--amber); border-color: var(--amber); }
.powered { display: flex; align-items: center; gap: 6px; font-size: 10px; letter-spacing: 1.5px; color: #5b6472; font-weight: 700; }
.syntrax-icon { width: 15px; height: 15px; opacity: .65; }

/* ===================== QUIZ ===================== */
.quiz-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.quiz-top .btn-ghost { padding: 8px 12px; font-size: 16px; line-height: 1; }
.hud { display: flex; gap: 10px; margin-left: auto; }
.hud-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 12px; text-align: center; min-width: 62px;
}
.hud-val { display: block; font-family: var(--cond); font-weight: 900; font-size: 22px; color: var(--amber); line-height: 1; }
.hud-key { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.progress { height: 8px; background: var(--clay-800); border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.progress-fill {
  height: 100%; width: 0%; border-radius: 6px;
  background: repeating-linear-gradient(45deg, var(--amber) 0 8px, var(--amber-hot) 8px 16px);
  transition: width .4s ease;
}

.timer-wrap { height: 5px; margin-top: 10px; background: var(--clay-800); border-radius: 4px; overflow: hidden; }
.timer-bar { height: 100%; width: 100%; background: linear-gradient(90deg, var(--green), var(--amber)); transform-origin: left; }
.timer-bar.run { transition: transform linear; }
.timer-bar.warn { background: linear-gradient(90deg, var(--amber-hot), var(--red)); }

.q-meta { display: flex; gap: 8px; margin: 18px 0 10px; flex-wrap: wrap; }
.chip {
  font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px; background: var(--card-hi); color: var(--dust); border: 1px solid var(--line);
}
.chip-diff.easy { color: var(--green); border-color: rgba(55,209,90,.4); }
.chip-diff.medium { color: var(--amber); border-color: rgba(215,221,232,.4); }
.chip-diff.hard { color: var(--red); border-color: rgba(255,77,77,.4); }

.q-text { font-size: clamp(19px, 4.6vw, 25px); line-height: 1.3; font-weight: 800; margin-bottom: 20px; }

.choices { display: flex; flex-direction: column; gap: 11px; }
.choice {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 13px;
  padding: 15px 16px; cursor: pointer; color: var(--ink);
  font-size: 16px; font-weight: 600; font-family: var(--font);
  transition: border-color .12s, background .12s, transform .08s;
}
.choice:hover:not(:disabled) { border-color: var(--amber); background: var(--card-hi); }
.choice:active:not(:disabled) { transform: scale(.99); }
.choice:disabled { cursor: default; }
.choice .key {
  flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--clay-800); border: 1px solid var(--line); font-family: var(--cond);
  font-weight: 900; font-size: 16px; color: var(--dust);
}
.choice.correct { border-color: var(--green); background: rgba(55,209,90,.14); }
.choice.correct .key { background: var(--green); color: #06340f; border-color: var(--green); }
.choice.wrong { border-color: var(--red); background: rgba(255,77,77,.12); }
.choice.wrong .key { background: var(--red); color: #3a0000; border-color: var(--red); }
.choice.dim { opacity: .45; }

.explain {
  display: none; margin-top: 18px; background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--amber); border-radius: 12px; padding: 16px;
  animation: fade .3s ease;
}
.explain.show { display: block; }
.explain-head { font-weight: 900; font-size: 17px; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.explain-head.good { color: var(--green); }
.explain-head.bad { color: var(--red); }
.explain-fact { color: var(--paper); font-size: 14.5px; line-height: 1.5; }
.btn-next { margin-top: 14px; background: linear-gradient(180deg, var(--amber), var(--amber-hot)); color: #11131a; padding: 12px 22px; font-size: 15px; box-shadow: 0 4px 0 #585f6c; }
.btn-next:active { box-shadow: 0 1px 0 #585f6c; }

/* ===================== RESULTS ===================== */
.results-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px 22px; text-align: center; box-shadow: var(--shadow); }
.rank-badge { font-size: 64px; line-height: 1; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); animation: pop .5s ease; }
.rank-badge img { width: 116px; height: 116px; object-fit: contain; display: block; margin: 0 auto; }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.res-rank { font-family: var(--cond); font-weight: 900; font-size: 30px; letter-spacing: 1px; color: var(--amber); margin-top: 6px; text-transform: uppercase; }
.res-score-big { font-family: var(--cond); font-weight: 900; font-size: 68px; line-height: 1; color: var(--paper); margin: 12px 0; }
.res-score-big small { font-size: 20px; color: var(--muted); margin-left: 6px; }
.res-stats { display: flex; justify-content: center; gap: 10px; margin: 16px 0; }
.res-stat { background: var(--card-hi); border: 1px solid var(--line); border-radius: 12px; padding: 12px 6px; flex: 1; }
.res-stat span { display: block; font-family: var(--cond); font-weight: 900; font-size: 26px; color: var(--amber); }
.res-stat label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.res-newbest { display: none; color: var(--green); font-weight: 800; margin-bottom: 10px; }
.res-newbest.show { display: block; animation: fade .4s ease; }

.res-review { text-align: left; margin: 14px 0 20px; max-height: 240px; overflow-y: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.rev-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 13px; }
.rev-item .rev-ic { flex: none; }
.rev-q { color: var(--paper); font-weight: 600; }
.rev-a { color: var(--muted); font-size: 12px; margin-top: 2px; }
.rev-a b { color: var(--green); }

.results-actions { margin-top: 4px; }

/* ===================== HUB / MODE PICKER ===================== */
.mode-grid { display: flex; flex-direction: column; gap: 12px; }
.mode-card {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 14px;
  text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px;
  padding: 16px 18px; cursor: pointer; color: var(--ink); font-family: var(--font); text-decoration: none;
  transition: transform .1s, border-color .15s, background .15s; box-shadow: var(--shadow);
}
.ext-badge { font-size: 14px; color: var(--muted); vertical-align: middle; }
.mode-link:hover .ext-badge { color: var(--amber); }
.mode-card:hover { transform: translateY(-2px); border-color: var(--amber); background: var(--card-hi); }
.mode-card:active { transform: scale(.99); }
.mode-ic { grid-row: 1 / 3; font-size: 34px; align-self: center; display: flex; }
.mode-ic img { width: 52px; height: 52px; object-fit: contain; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.mode-name { font-family: var(--cond); font-weight: 900; font-size: 22px; letter-spacing: .5px; color: var(--amber); }
.mode-desc { font-size: 13px; color: var(--muted); line-height: 1.35; }

/* ===================== SHARED MODE CHROME ===================== */
.mode-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.mode-top .back { padding: 8px 14px; font-size: 18px; line-height: 1; }
.mode-title { font-family: var(--cond); font-weight: 900; font-size: 24px; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.title-ic { width: 32px; height: 32px; object-fit: contain; flex: none; }
.mode-tries { margin-left: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-family: var(--cond); font-weight: 900; font-size: 16px; color: var(--amber); white-space: nowrap; }
.mode-sub { color: var(--muted); font-size: 13px; line-height: 1.4; margin: 4px 0 10px; }
.mode-sub b { color: var(--paper); }
.mode-hi { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.mode-hi b { color: var(--amber); font-weight: 800; }
.hi-max { color: var(--dirt); }
.mode-result { margin-top: 16px; }

/* picker / autocomplete */
.picker { position: relative; }
.picker-hidden { display: none; }
.picker-input {
  width: 100%; background: var(--clay-800); border: 1.5px solid var(--line); border-radius: 12px;
  color: var(--ink); font-size: 16px; font-family: var(--font); padding: 14px 16px;
}
.picker-input:focus { outline: none; border-color: var(--amber); }
.picker-list {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px);
  background: #2c1e17; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden;
  max-height: 260px; overflow-y: auto; box-shadow: var(--shadow); display: none;
}
.picker-list.show { display: block; }
.picker-opt { padding: 12px 16px; cursor: pointer; font-size: 15px; border-bottom: 1px solid rgba(255,255,255,.05); }
.picker-opt:hover, .picker-opt.active { background: var(--card-hi); color: var(--amber); }
.picker-opt small { color: var(--muted); font-size: 12px; margin-left: 6px; }

/* ===================== GUESSR BOARD ===================== */
.guess-board { margin-top: 16px; overflow-x: auto; }
.guess-head, .guess-row {
  display: grid; grid-template-columns: 1.5fr .8fr 1fr .7fr .9fr .8fr; gap: 6px; min-width: 340px; margin-bottom: 6px;
}
.guess-head span { font-size: 10px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); text-align: center; font-weight: 700; padding: 2px; }
.guess-head span:first-child { text-align: left; }
.gcell {
  border-radius: 8px; padding: 8px 4px; text-align: center; font-size: 12px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--card-hi); border: 1px solid var(--line); min-height: 46px; animation: flip .4s ease;
}
@keyframes flip { from { transform: rotateX(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.gcell.name { text-align: left; align-items: flex-start; font-size: 13px; }
.gcell.hit { background: rgba(55,209,90,.18); border-color: var(--green); color: #cffcd8; }
.gcell.near { background: rgba(215,221,232,.16); border-color: var(--amber); color: #ffe6b0; }
.gcell.miss { background: rgba(255,77,77,.10); border-color: rgba(255,77,77,.35); color: #ffd0d0; }
.gcell .arrow { font-size: 15px; line-height: 1; }
.gcell .sub { font-size: 9.5px; color: var(--muted); font-weight: 600; }

/* ===================== CAREER CLUES ===================== */
.career-clues { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.clue {
  display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--amber); border-radius: 12px; padding: 14px 16px; animation: slidein .35s ease;
}
@keyframes slidein { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.clue.locked { border-left-color: #4a3225; opacity: .5; }
.clue-num { font-family: var(--cond); font-weight: 900; font-size: 20px; color: var(--amber); flex: none; width: 22px; }
.clue.locked .clue-num { color: var(--dirt); }
.clue-text { font-size: 15px; line-height: 1.4; }
.clue-hidden { color: var(--dirt); font-style: italic; }

/* ===================== RANK 'EM ===================== */
.rank-prompt { font-size: 17px; font-weight: 700; line-height: 1.4; margin: 6px 0 16px; }
.rank-prompt b { color: var(--amber); }
.rank-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.rank-row {
  display: flex; align-items: center; gap: 12px; background: var(--card); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 12px 14px; transition: background .2s, border-color .2s;
}
.rank-pos { font-family: var(--cond); font-weight: 900; font-size: 22px; color: var(--amber); width: 26px; text-align: center; flex: none; }
.rank-label { flex: 1; font-weight: 700; font-size: 15px; }
.rank-label small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.rank-btns { display: flex; flex-direction: column; gap: 4px; }
.rank-btns button { background: var(--clay-800); border: 1px solid var(--line); color: var(--amber); border-radius: 6px; width: 34px; height: 24px; cursor: pointer; font-size: 12px; line-height: 1; }
.rank-btns button:disabled { opacity: .3; cursor: default; }
.rank-btns button:active:not(:disabled) { background: var(--card-hi); }
.rank-row.correct { border-color: var(--green); background: rgba(55,209,90,.14); }
.rank-lock { font-family: var(--cond); font-weight: 900; color: var(--green); font-size: 20px; width: 34px; text-align: center; }
.rank-status { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 12px; padding: 13px 16px; font-size: 14px; color: var(--paper); line-height: 1.45; animation: fade .3s ease; }
.rank-status b { color: var(--amber); }

/* ===================== GRIDLOCK ===================== */
.grid-table { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1fr; gap: 6px; }
.gh {
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 11px; font-weight: 800; line-height: 1.2; padding: 6px 4px; color: var(--amber);
  background: var(--card-hi); border: 1px solid var(--line); border-radius: 8px; min-height: 54px;
}
.gh.corner { background: transparent; border: none; }
.gsq {
  position: relative; aspect-ratio: 1 / 1; border-radius: 10px; background: var(--card);
  border: 1.5px solid var(--line); cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--dust); font-size: 26px; padding: 4px; text-align: center; transition: border-color .15s, background .15s;
}
.gsq:hover:not(.filled) { border-color: var(--amber); }
.gsq.sel { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(215,221,232,.2); }
.gsq.filled { cursor: default; background: rgba(55,209,90,.13); border-color: var(--green); }
.gsq.filled .gsq-name { font-size: 12px; font-weight: 800; color: #cffcd8; line-height: 1.15; }
.gsq.bad { animation: shake .4s ease; }
@keyframes shake { 0%,100%{transform:translateX(0);} 25%{transform:translateX(-5px);} 75%{transform:translateX(5px);} }
.grid-cell-label { font-size: 13px; color: var(--amber); font-weight: 700; margin-bottom: 8px; text-align: center; }

/* result banners */
.res-banner {
  border-radius: 14px; padding: 18px; text-align: center; border: 1px solid var(--line); background: var(--card); animation: fade .35s ease;
}
.res-banner.win { border-color: var(--green); background: rgba(55,209,90,.10); }
.res-banner.lose { border-color: var(--red); background: rgba(255,77,77,.08); }
.res-banner h3 { font-family: var(--cond); font-size: 26px; font-weight: 900; letter-spacing: .5px; }
.res-banner.win h3 { color: var(--green); }
.res-banner.lose h3 { color: var(--red); }
.res-banner p { color: var(--paper); font-size: 14px; margin: 8px 0 0; line-height: 1.5; }
.res-banner .reveal-name { color: var(--amber); font-weight: 800; }
.res-banner .btn { margin-top: 14px; }

/* ===================== USERNAME MODAL ===================== */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 7, 5, 0.82); backdrop-filter: blur(3px);
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.show { display: flex; animation: fade .25s ease; }
.modal {
  width: 100%; max-width: 380px; background: var(--card); border: 1.5px solid var(--line);
  border-radius: 18px; padding: 26px 22px; text-align: center; box-shadow: var(--shadow);
}
.modal-flag { font-size: 40px; }
.modal-title { font-family: var(--cond); font-weight: 900; font-size: 26px; letter-spacing: .5px; margin-top: 6px; color: var(--paper); }
.modal-sub { color: var(--muted); font-size: 13.5px; margin: 8px 0 16px; line-height: 1.4; }
.modal .picker-input { text-align: center; font-size: 17px; margin-bottom: 12px; }
.modal-error { color: var(--red); font-size: 12.5px; min-height: 16px; margin-bottom: 6px; }

/* ===================== PLAYER BAR ===================== */
.player-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  margin-bottom: 16px; font-size: 13px;
}
.player-bar:empty { display: none; }
.pb-label { color: var(--muted); }
.pb-name { font-weight: 800; color: var(--amber); font-size: 15px; }
.pb-total { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 3px 12px; font-weight: 800; color: var(--paper); font-family: var(--cond); }
.pb-change { background: none; border: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 12px; }
.pb-change:hover { color: var(--amber); }

/* ===================== LEADERBOARDS ===================== */
.lb { margin-top: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.lb-head { font-family: var(--cond); font-weight: 900; letter-spacing: 1px; text-transform: uppercase; font-size: 16px; color: var(--amber); margin-bottom: 12px; }
.lb-ic { width: 22px; height: 22px; object-fit: contain; vertical-align: -6px; margin-right: 2px; }
.btn-ic { width: 22px; height: 22px; object-fit: contain; vertical-align: -5px; margin-left: 2px; }
.ic-cel { width: 16px; height: 16px; object-fit: contain; vertical-align: -3px; }
.lb-tabs { display: flex; gap: 6px; background: var(--clay-800); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.lb-tab { flex: 1; background: none; border: none; color: var(--muted); font-family: var(--font); font-weight: 700; font-size: 13.5px; padding: 9px 6px; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s; }
.lb-tab.active { background: linear-gradient(180deg, var(--amber), var(--amber-hot)); color: #11131a; }
.lb-list { display: flex; flex-direction: column; gap: 4px; }
.lb-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--card-hi); border: 1px solid transparent; }
.lb-row.me { border-color: var(--amber); background: rgba(215,221,232,.12); }
.lb-rank { font-family: var(--cond); font-weight: 900; font-size: 16px; color: var(--dust); text-align: center; }
.lb-name { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-you { font-size: 10px; background: var(--amber); color: #11131a; padding: 1px 6px; border-radius: 10px; font-weight: 800; vertical-align: middle; }
.lb-pts { font-family: var(--cond); font-weight: 900; font-size: 17px; color: var(--paper); }
.lb-sep { text-align: center; color: var(--dirt); letter-spacing: 3px; font-size: 12px; padding: 2px 0; }
.lb-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 18px 8px; }

/* ===================== DRAFT 'EM ===================== */
.draft-roster { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 16px; }
.ds-chip { background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 6px; text-align: center; min-height: 58px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.ds-chip.active { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(215,221,232,.15); }
.ds-chip.filled { background: rgba(55,209,90,.10); border-color: rgba(55,209,90,.5); }
.ds-div { font-size: 9.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; }
.ds-name { font-size: 12px; font-weight: 800; color: #cffcd8; line-height: 1.1; }
.ds-cost { font-family: var(--cond); font-weight: 900; font-size: 13px; color: var(--amber); }
.ds-empty { color: var(--dirt); font-size: 18px; font-weight: 900; }

.draft-modes { display: flex; flex-direction: column; gap: 10px; }
.draft-mode-btn { text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 13px; padding: 15px 16px; cursor: pointer; color: var(--ink); font-family: var(--font); transition: border-color .12s, background .12s, transform .08s; }
.draft-mode-btn:hover { border-color: var(--amber); background: var(--card-hi); }
.draft-mode-btn:active { transform: scale(.99); }
.draft-mode-btn b { display: block; font-family: var(--cond); font-weight: 900; font-size: 19px; color: var(--amber); letter-spacing: .3px; }
.draft-mode-btn span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.draft-head { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.draft-head b { color: var(--amber); }
.draft-era { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--dust); background: var(--card-hi); border: 1px solid var(--line); border-radius: 20px; padding: 3px 10px; }
.draft-options { display: flex; flex-direction: column; gap: 10px; }
.draft-opt { text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 13px; padding: 13px 15px; cursor: pointer; color: var(--ink); font-family: var(--font); transition: border-color .12s, background .12s, transform .08s; }
.draft-opt:hover:not(.broke) { border-color: var(--amber); background: var(--card-hi); }
.draft-opt:active:not(.broke) { transform: scale(.99); }
.draft-opt.broke { opacity: .4; cursor: not-allowed; }
.do-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.do-name { font-weight: 800; font-size: 16px; }
.do-cost { font-family: var(--cond); font-weight: 900; font-size: 18px; color: var(--amber); flex: none; }
.do-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.do-res { font-size: 12.5px; color: var(--dust); margin-top: 5px; }

.draft-team { text-align: left; margin: 14px 0 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.team-row { display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; }
.tr-div { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; }
.tr-name { color: var(--paper); font-weight: 700; }

/* ===================== AD PLACEHOLDERS ===================== */
.ad-rail { display: none; position: fixed; top: 50%; transform: translateY(-50%); z-index: 5; }
.ad-left { left: 18px; }
.ad-right { right: 18px; }
.ad-bottom { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; justify-content: center;
  padding: 6px; background: linear-gradient(0deg, rgba(10,7,5,.96), rgba(10,7,5,.55)); }
.ad-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  border: 2px dashed var(--line); border-radius: 10px; background: rgba(255,255,255,0.015); }
.ad-slot span { font-size: 10px; letter-spacing: 2px; font-weight: 800; color: var(--muted); }
.ad-slot small { font-size: 10px; color: var(--dirt); }
.ad-sky { width: 160px; height: 600px; }
.ad-banner { width: 320px; max-width: 96vw; height: 52px; flex-direction: row; gap: 10px; background: var(--clay-800); }

/* Side rails only when the viewport is wide enough to flank the 720px column */
@media (min-width: 1140px) { .ad-rail { display: block; } }
/* Otherwise (tablet/phone) show the bottom banner and pad the page so it isn't covered */
@media (max-width: 1139px) {
  .ad-bottom { display: flex; }
  #app { padding-bottom: 80px; }
}

/* On phones, drop the round/tries chip below the mode title so the title never wraps beside it */
@media (max-width: 560px) {
  .mode-top { flex-wrap: wrap; }
  .mode-title { flex: 1 1 auto; }
  .mode-tries { order: 3; width: 100%; margin-left: 44px; margin-top: 2px; text-align: left; }
}

@media (max-width: 420px) {
  .disc-grid { grid-template-columns: repeat(2, 1fr); }
  .hud-item { min-width: 52px; padding: 6px 8px; }
  .gh { font-size: 10px; min-height: 50px; }
  .mode-name { font-size: 20px; }
}
