/* HIGHER or LOWER: BTV — bold big-number stat cards */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #12312b;          /* deep evergreen */
  --bg2: #0c221e;
  --card: #f7f2e7;        /* cream stock */
  --ink: #17211f;
  --accent: #e8842c;      /* maple orange */
  --hi: #2e9e5b;
  --lo: #d64545;
  --gold: #f2b13d;
}

html, body {
  min-height: 100%;
  background: radial-gradient(ellipse at 50% -10%, #1c473e, var(--bg) 55%, var(--bg2));
  color: var(--card);
  font-family: "Avenir Next", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body { display: flex; flex-direction: column; align-items: center; padding: 12px 14px calc(20px + env(safe-area-inset-bottom)); }

button { font: inherit; cursor: pointer; border: none; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
#topbar {
  width: min(560px, 100%);
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 2px 10px;
}
.brand { font-weight: 900; font-size: 17px; letter-spacing: 0.5px; }
.brand .tb-or { color: var(--accent); font-style: italic; margin: 0 3px; font-weight: 700; }
.brand .btv { color: var(--gold); }
.scores { display: flex; gap: 8px; }
.badge {
  background: rgba(0,0,0,0.35); border-radius: 12px; padding: 4px 12px; text-align: center;
  border: 1px solid rgba(247,242,231,0.12);
}
.badge small { display: block; font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; opacity: 0.65; }
.badge b { font-size: 18px; font-weight: 900; color: var(--gold); }

/* ---------- screens ---------- */
.screen { width: min(560px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; }

.big-title { margin-top: 8vh; font-size: clamp(46px, 13vw, 84px); font-weight: 900; line-height: 0.95; letter-spacing: -2px; }
.big-title .accent { color: var(--accent); }
.sub { margin-top: 12px; font-size: 13px; font-weight: 800; letter-spacing: 3px; color: var(--gold); }
.deck { margin-top: 20px; font-size: 16px; line-height: 1.55; color: #e9e2d2; }
.deck.small { font-size: 13px; opacity: 0.75; margin-top: 10px; }
.deck .hi { color: #7dd8a0; } .deck .lo { color: #f09090; }
.fineprint { margin-top: 14px; font-size: 12px; opacity: 0.55; }

.btn-lead {
  margin-top: 26px; padding: 16px 44px; border-radius: 999px;
  font-size: 19px; font-weight: 900; letter-spacing: 1px; color: #fff;
  background: linear-gradient(#f09338, #d97719);
  box-shadow: 0 5px 0 #9c5310, 0 12px 26px rgba(0,0,0,0.45);
  transition: transform 0.08s ease;
}
.btn-lead:active { transform: translateY(3px); box-shadow: 0 2px 0 #9c5310; }
.btn-ghost {
  margin-top: 26px; padding: 15px 30px; border-radius: 999px;
  font-size: 17px; font-weight: 800; color: var(--card);
  background: rgba(255,255,255,0.08); border: 2px solid rgba(247,242,231,0.35);
}

/* ---------- category banner ---------- */
#catBanner {
  margin: 4px 0 12px; padding: 8px 18px; border-radius: 999px;
  background: rgba(0,0,0,0.35); border: 1px solid rgba(242,177,61,0.4);
  font-weight: 800; font-size: 14px; color: var(--gold);
  animation: pop 0.35s ease;
}
#catBanner small { display: block; font-weight: 600; font-size: 11px; color: #e9e2d2; opacity: 0.75; }
@keyframes pop { 0% { transform: scale(0.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ---------- cards ---------- */
#cards { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 0; }
.card {
  width: 100%; background: var(--card); color: var(--ink);
  border-radius: 22px; padding: 20px 18px 18px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.4);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  position: relative;
}
.card-label { font-size: 17px; font-weight: 800; letter-spacing: 0.2px; }
.card-value {
  margin-top: 6px; font-size: clamp(46px, 13vw, 74px);
  font-weight: 900; letter-spacing: -2px; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.card .unit-suffix { display: block; font-size: 14px; font-weight: 700; letter-spacing: 0; opacity: 0.6; margin-top: 10px; }
.card-meta { margin-top: 8px; font-size: 12px; font-weight: 600; color: #5c6660; }
.card-meta a { color: #2c6e54; font-weight: 700; }
.mystery .card-value { color: #9aa39e; }
.card.reveal-good { box-shadow: 0 0 0 4px var(--hi), 0 10px 28px rgba(0,0,0,0.4); }
.card.reveal-good .card-value, .card.reveal-bad .card-value { color: var(--ink); }
.card.reveal-bad { box-shadow: 0 0 0 4px var(--lo), 0 10px 28px rgba(0,0,0,0.4); }

#vs {
  margin: -12px 0; z-index: 2;
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-weight: 900; font-size: 16px;
  border: 4px solid var(--bg); box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

#guessRow { display: flex; gap: 10px; margin-top: 16px; }
.btn-guess {
  flex: 1; padding: 16px 8px; border-radius: 14px;
  font-size: 18px; font-weight: 900; letter-spacing: 1px; color: #fff;
  transition: transform 0.08s ease;
}
.btn-guess:active { transform: scale(0.96); }
.btn-guess.hi { background: linear-gradient(#38b56c, var(--hi)); box-shadow: 0 4px 0 #1e6e3e; }
.btn-guess.lo { background: linear-gradient(#e25c5c, var(--lo)); box-shadow: 0 4px 0 #96302f; }

#verdict { margin-top: 14px; font-size: 20px; font-weight: 900; letter-spacing: 1px; }
#verdict.good { color: var(--hi); }
#verdict.bad { color: var(--lo); }

#hopNote {
  margin-top: 16px; padding: 8px 18px; border-radius: 999px;
  background: rgba(242,177,61,0.15); border: 1px dashed rgba(242,177,61,0.6);
  color: var(--gold); font-weight: 800; font-size: 13px;
  animation: pop 0.35s ease;
}

/* ---------- game over ---------- */
#gameover h2 { margin-top: 5vh; font-size: clamp(30px, 8vw, 44px); font-weight: 900; letter-spacing: -1px; }
.score-big { font-size: clamp(64px, 20vw, 110px); font-weight: 900; color: var(--gold); line-height: 1; }
.best-line { margin-top: 4px; font-size: 15px; font-weight: 800; color: #e9e2d2; }
.best-line.new-best { color: #7dd8a0; }
.sources {
  margin-top: 16px; font-size: 12.5px; line-height: 1.7; color: #cfc8b6;
  background: rgba(0,0,0,0.3); border-radius: 14px; padding: 10px 16px; max-width: 100%;
}
.sources a { color: var(--gold); }
.row { display: flex; gap: 12px; align-items: center; }
.cta-brief {
  margin-top: 22px; display: inline-block; padding: 10px 20px; border-radius: 999px;
  color: var(--gold); font-weight: 800; font-size: 14px; text-decoration: none;
  background: rgba(242,177,61,0.12); border: 1px solid rgba(242,177,61,0.5);
}

/* ---------- leaderboard ---------- */
.lb {
  margin-top: 20px; width: min(360px, 100%);
  background: rgba(0,0,0,0.32); border-radius: 16px; padding: 12px 16px;
  border: 1px solid rgba(247,242,231,0.12);
}
.chip {
  border: 2px solid rgba(247,242,231,0.3); background: rgba(0,0,0,0.3);
  color: var(--card); font-size: 13px; font-weight: 700;
  padding: 6px 14px; border-radius: 999px;
}
.chip.sel { background: var(--accent); border-color: var(--gold); color: #fff; }
.lb-tabs { display: flex; gap: 6px; justify-content: center; }
.lb-tabs .chip { font-size: 12px; padding: 5px 12px; }
.lb ol { list-style: none; margin: 10px 0 4px; max-height: 30vh; overflow-y: auto; }
.lb li {
  display: flex; gap: 8px; align-items: baseline;
  font-size: 14px; font-weight: 600; color: #e9e2d2;
  padding: 3px 6px; border-radius: 8px;
}
.lb li .rank { width: 22px; text-align: right; opacity: 0.7; font-size: 12px; }
.lb li .nm { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb li .sc { font-weight: 900; color: var(--gold); }
.lb li.me { background: rgba(232,132,44,0.35); color: #fff; }
.lb .lb-status { font-size: 12px; color: var(--gold); opacity: 0.85; margin: 8px 0 2px; }
.lb-form { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.lb-form input {
  font: inherit; font-size: 14px; font-weight: 600; width: 160px;
  padding: 8px 12px; border-radius: 999px; border: 2px solid rgba(247,242,231,0.3);
  background: rgba(0,0,0,0.35); color: #fff; outline: none;
}
.lb-form input::placeholder { color: rgba(233,226,210,0.5); }
.lb-rename { font-size: 11px; padding: 4px 10px; margin-top: 8px; opacity: 0.85; }
.lb-form.hidden, .lb-rename.hidden { display: none; }

/* ---------- footer ---------- */
#footer { margin-top: auto; padding-top: 26px; font-size: 12px; opacity: 0.65; text-align: center; }
#footer a { color: var(--gold); }

/* wider screens: cards side by side */
@media (min-width: 640px) {
  #cards { flex-direction: row; align-items: stretch; gap: 0; }
  .card { width: calc(50% - 26px); display: flex; flex-direction: column; justify-content: center; }
  #vs { margin: auto -12px; align-self: center; }
  #guessRow { margin-top: 20px; }
}
