:root {
  color-scheme: dark;
  --ink: #f7f2e8;
  --paper: #141313;
  --panel: #1d1b1a;
  --line: #3a3632;
  --muted: #aaa197;
  --coral: #ff5c45;
  --mint: #adf0c3;
  --yellow: #f1d77a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% 12%, rgba(255,92,69,.08), transparent 22rem),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 100% 4px, auto;
  color: var(--ink);
  font-family: "Arial Narrow", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button, input { font: inherit; }
button { color: inherit; }

.shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 30px 0 24px; }
.masthead { display: grid; grid-template-columns: 1fr 1.25fr auto; gap: 34px; align-items: end; border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.issue, .kicker { color: var(--coral); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 4px 0 -10px; font: 900 clamp(72px, 10vw, 132px)/.85 Georgia, serif; letter-spacing: -.08em; }
.red-dot { color: var(--coral); }
.lede { margin-bottom: 2px; color: #d7d0c8; font: 500 clamp(17px, 2vw, 24px)/1.55 Georgia, "Songti SC", serif; }
.best { min-width: 142px; border-left: 5px solid var(--yellow); padding: 3px 0 3px 16px; }
.best span, .score-card span, .streak-card > span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.best strong { font: 900 48px/1 Arial, sans-serif; }

.game-board { margin-top: 28px; border: 1px solid var(--line); background: rgba(29,27,26,.92); }
.round-head { display: flex; justify-content: space-between; gap: 20px; padding: 24px 28px; border-bottom: 1px solid var(--line); }
.round-head h2, .score-intro h2, .final-card h2 { margin: 5px 0 0; font: 800 clamp(28px, 4vw, 44px)/1.05 Georgia, "Songti SC", serif; }
.round-meter { width: min(230px, 35%); align-self: center; text-align: right; color: var(--muted); font-size: 12px; }
.meter-track { margin-top: 8px; height: 5px; background: #34302e; overflow: hidden; }
.meter-track i { display: block; width: 0; height: 100%; background: var(--coral); transition: width .35s ease; }

.tape-wrap { padding: 24px 28px 20px; overflow: hidden; }
.tape-label { margin-bottom: 12px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .16em; }
.coin-tape { display: flex; gap: 9px; min-height: 57px; overflow-x: auto; padding: 0 0 8px; scrollbar-color: var(--line) transparent; }
.coin { flex: 0 0 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; border: 2px solid currentColor; font: 900 17px Georgia, serif; position: relative; animation: land .35s ease-out both; }
.coin::after { content: attr(data-index); position: absolute; bottom: -7px; right: -4px; min-width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font: 700 9px Arial, sans-serif; }
.coin.heads { color: var(--coral); background: rgba(255,92,69,.08); }
.coin.tails { color: var(--mint); background: rgba(173,240,195,.07); }
.coin.new { box-shadow: 0 0 0 4px rgba(241,215,122,.13); }
@keyframes land { from { opacity: 0; transform: translateY(-10px) rotate(-12deg); } }

.bet-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bet-card { min-width: 0; margin: 0; padding: 24px 28px 28px; border: 0; }
.bet-card + .bet-card { border-left: 1px solid var(--line); }
.bet-card legend { padding: 0; font: 700 17px/1.3 Georgia, "Songti SC", serif; }
.bet-card legend span { color: var(--coral); margin-right: 8px; font: 800 11px Arial, sans-serif; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 17px; }
.choice { cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > span { min-height: 60px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); background: #171616; font-weight: 750; transition: .18s ease; }
.choice:hover > span { border-color: #736b64; transform: translateY(-1px); }
.choice input:focus-visible + span { outline: 2px solid var(--yellow); outline-offset: 3px; }
.choice input:checked + span { border-color: var(--yellow); background: #29251d; color: var(--yellow); box-shadow: inset 4px 0 var(--yellow); }
.mini-coin { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font: 800 12px Georgia, serif; }
.mini-coin.heads { color: var(--coral); }
.mini-coin.tails { color: var(--mint); }
.arrow { width: 30px; text-align: center; font-size: 25px; font-weight: 400; }
.bet-grid.locked { opacity: .45; pointer-events: none; }

.action-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 28px; }
.action-row p { margin: 0; color: var(--muted); font-size: 13px; }
#submitBet, #restartGame { border: 0; background: var(--coral); color: #171313; padding: 15px 22px; font-weight: 900; cursor: pointer; box-shadow: 5px 5px 0 #70291f; transition: .16s ease; }
#submitBet span { margin-left: 22px; font-weight: 600; opacity: .75; }
#submitBet:hover, #restartGame:hover { transform: translate(-2px,-2px); box-shadow: 7px 7px 0 #70291f; }
#submitBet:disabled { cursor: default; filter: grayscale(.6); opacity: .5; transform: none; box-shadow: none; }

.reveal-panel { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.reveal-copy, .lesson { padding: 24px 28px; }
.reveal-copy { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: start; }
.stamp { grid-row: 1 / 3; padding: 5px 8px; border: 1px solid var(--coral); color: var(--coral); font-size: 10px; font-weight: 900; letter-spacing: .12em; transform: rotate(-4deg); }
.reveal-copy h3 { margin: 0; font: 800 22px Georgia, serif; }
.reveal-copy p, .lesson p { margin: 7px 0 0; color: #c8c0b7; line-height: 1.6; }
.lesson { border-left: 1px solid var(--line); background: #181716; }
.lesson > span { color: var(--yellow); font-size: 10px; font-weight: 900; letter-spacing: .15em; }

.score-board { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 1px; margin-top: 18px; background: var(--line); border: 1px solid var(--line); }
.score-board > div { min-height: 150px; padding: 22px; background: var(--paper); }
.score-intro p { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.score-card, .streak-card { display: flex; flex-direction: column; justify-content: space-between; }
.score-card strong, .streak-card strong { font: 900 clamp(38px, 5vw, 60px)/1 Arial, sans-serif; }
.score-card small { font-weight: 800; letter-spacing: .1em; }
.score-card.coral strong { color: var(--coral); }
.score-card.mint strong { color: var(--mint); }
#streakMarks { display: flex; gap: 4px; min-height: 8px; }
#streakMarks i { width: 9px; height: 6px; background: var(--yellow); }

.final-card { margin-top: 18px; padding: clamp(26px, 5vw, 52px); border: 1px solid var(--yellow); background: #211e18; text-align: center; }
.final-card > p { color: #d4cdc3; line-height: 1.7; }
.truth-box { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 24px auto 28px; }
.truth-box > * { padding: 10px 13px; border: 1px solid #4f4837; }
.truth-box strong { color: var(--yellow); }

footer { display: flex; justify-content: space-between; gap: 18px; padding: 20px 2px 0; color: #766f68; font-size: 11px; }
footer p { margin: 0; }
#resetBest { padding: 0; border: 0; border-bottom: 1px solid #625b54; background: transparent; color: #8d857d; cursor: pointer; }

@media (max-width: 760px) {
  .shell { width: min(100% - 22px, 600px); padding-top: 18px; }
  .masthead { grid-template-columns: 1fr auto; gap: 18px; }
  .lede { grid-column: 1 / -1; grid-row: 2; }
  h1 { font-size: 78px; }
  .best { align-self: center; }
  .bet-grid, .reveal-panel { grid-template-columns: 1fr; }
  .bet-card + .bet-card, .lesson { border-left: 0; border-top: 1px solid var(--line); }
  .score-board { grid-template-columns: 1fr 1fr; }
  .score-intro { grid-column: 1 / -1; }
  .action-row { align-items: stretch; flex-direction: column; }
  #submitBet { width: 100%; }
}

@media (max-width: 430px) {
  .shell { width: calc(100% - 16px); }
  .masthead { gap: 10px; }
  .issue { letter-spacing: .1em; }
  .best { min-width: 108px; padding-left: 10px; }
  .best strong { font-size: 38px; }
  .round-head, .tape-wrap, .bet-card, .action-row, .reveal-copy, .lesson { padding-left: 18px; padding-right: 18px; }
  .round-meter { width: 100px; }
  .choice-row { grid-template-columns: 1fr; }
  .choice > span { min-height: 50px; }
  .score-board > div { min-height: 128px; padding: 16px; }
  .score-card strong, .streak-card strong { font-size: 38px; }
  footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
