:root {
  --paper: #f4efe6;
  --paper-2: #ebe4d6;
  --ink: #141311;
  --muted: #6d675c;
  --line: #d9d0bf;
  --red: #d62f2f;
  --red-dark: #a81f1f;
  --notes: #e2a800;
  --note-bg: #fbfaf7;
  --hud: #111110;
  --hud-2: #1d1c1a;
  --green: #3ad07a;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Helvetica Neue", Inter, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.45;
  min-height: 100vh;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
kbd {
  font-family: var(--mono); font-size: .78em; font-weight: 700;
  border: 1px solid currentColor; border-bottom-width: 2px; border-radius: 5px;
  padding: 0 .35em; opacity: .75;
}

/* Top bar + ticker */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; max-width: 1180px; margin: 0 auto;
}
.logo {
  background: none; border: 0; padding: 0;
  font-family: var(--mono); font-size: 14px; letter-spacing: .02em; text-transform: uppercase;
}
.logo b { color: var(--red); }
.pb-chip {
  font-family: var(--mono); font-size: 12px; background: var(--hud); color: #fff;
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.ticker {
  background: var(--red); color: #fff; overflow: hidden; white-space: nowrap;
  font-family: var(--mono); font-size: 13px; font-weight: 700; text-transform: uppercase;
  border-block: 2px solid var(--ink);
}
.ticker-track { display: inline-block; padding: 7px 0; animation: ticker 90s linear infinite; }
.ticker-track span { margin-right: 48px; }
.ticker-track span::before { content: "●"; margin-right: 12px; color: #ffd2d2; }
@keyframes ticker { to { transform: translateX(-50%); } }

main { max-width: 1180px; margin: 0 auto; padding: 0 20px 48px; }
.screen { display: none; }
.screen.active { display: block; animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* Start */
#screen-start { max-width: 760px; margin: 0 auto; padding-top: 48px; }
.kicker { font-family: var(--mono); font-size: 13px; text-transform: uppercase; color: var(--red); margin: 0 0 12px; font-weight: 700; }
h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 8vw, 84px); line-height: .98; margin: 0 0 20px; letter-spacing: -.01em; }
h1 em { color: var(--red); }
.lede { font-size: 19px; color: var(--muted); max-width: 580px; margin: 0 0 32px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mode {
  text-align: left; display: flex; flex-direction: column; gap: 4px;
  background: var(--note-bg); border: 2px solid var(--ink); border-radius: 16px; padding: 20px;
  box-shadow: 4px 4px 0 var(--ink); transition: transform .08s, box-shadow .08s;
}
.mode:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.mode:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.mode-daily { background: var(--ink); color: #fff; }
.mode-daily .mode-tag { background: var(--red); color: #fff; }
.mode-tag {
  align-self: flex-start; font-family: var(--mono); font-size: 12px; font-weight: 700; text-transform: uppercase;
  background: var(--paper-2); padding: 3px 8px; border-radius: 6px;
}
.mode-title { font-family: var(--serif); font-size: 32px; line-height: 1.1; margin-top: 8px; }
.mode-sub { font-size: 15px; opacity: .7; }
.mode-best { font-family: var(--mono); font-size: 13px; color: var(--green); min-height: 1em; }
.rules { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 10px; color: var(--muted); font-size: 15px; }
.rules li::before { content: "→ "; color: var(--red); font-weight: 700; }
.redact-demo, .redacted { background: var(--ink); color: var(--ink); border-radius: 2px; user-select: none; }

/* Play */
.breaking {
  display: flex; gap: 14px; align-items: flex-start; margin: 22px 0 18px;
  background: var(--hud); color: #fff; border-radius: 14px; padding: 14px 18px;
}
.breaking-label {
  flex: none; background: var(--red); font-family: var(--mono); font-weight: 800; font-size: 12px; text-transform: uppercase;
  padding: 4px 8px; border-radius: 5px; margin-top: 3px; animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: .55; } }
.breaking p { margin: 0; font-size: 19px; font-weight: 600; line-height: 1.35; }

.play-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.hud {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--hud); color: #fff; border-radius: 14px; padding: 12px 20px;
}
.timer { font-family: var(--mono); font-weight: 800; font-size: clamp(44px, 7vw, 64px); font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1; }
.timer.flash { color: #ff6b6b; }
.hud-meta { text-align: right; font-family: var(--mono); font-size: 13px; }
.qt { color: #bdb7ab; }
.qt span { color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.penalty { color: #ff6b6b; min-height: 1.3em; }

.stage { position: relative; margin-top: 16px; min-height: 340px; }
.step-label { font-family: var(--mono); font-size: 13px; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; font-weight: 700; }
.step-label b { color: var(--red); }
.options { display: grid; gap: 10px; }
.opt {
  display: flex; gap: 14px; align-items: center; text-align: left;
  background: var(--note-bg); border: 2px solid var(--ink); border-radius: 12px; padding: 14px 16px;
  font-size: 17px; line-height: 1.3; box-shadow: 3px 3px 0 var(--ink);
  transition: transform .06s, box-shadow .06s, background .1s;
  touch-action: manipulation;
}
.opt:hover { background: #fff; }
.opt:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.opt kbd { flex: none; opacity: .5; }
.options.enter .opt { animation: pop .18s ease-out backwards; }
.options.enter .opt:nth-child(2) { animation-delay: .03s; }
.options.enter .opt:nth-child(3) { animation-delay: .06s; }
.options.enter .opt:nth-child(4) { animation-delay: .09s; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }

.countdown {
  position: absolute; inset: 0; display: none; place-items: center;
  font-family: var(--serif); font-size: 160px; line-height: 1; color: var(--red);
}
.countdown.show { display: grid; }
.countdown span { animation: zoom .5s ease-out; }
@keyframes zoom { from { transform: scale(1.6); opacity: 0; } }

.splits { list-style: none; margin: 18px 0 0; padding: 0; font-family: var(--mono); font-size: 13px; border-top: 1px solid var(--line); }
.splits li { display: grid; grid-template-columns: 1fr auto 70px; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--line); color: var(--muted); }
.splits li.current { color: var(--ink); font-weight: 700; }
.splits li.done { color: var(--ink); }
.splits .delta { text-align: right; }
.splits .ahead { color: #1a9a52; }
.splits .behind { color: var(--red); }
.splits .trap-mark { color: var(--red); }

/* Notes-app draft */
.note {
  background: var(--note-bg); border-radius: 22px; padding: 16px 22px 28px;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -20px rgba(40, 30, 10, .35);
  border: 1px solid var(--line); min-height: 420px; position: sticky; top: 16px;
}
.note-bar { display: flex; justify-content: space-between; color: var(--notes); font-size: 17px; font-weight: 500; }
.note-dots { font-weight: 700; }
.note-date { text-align: center; color: #9b968c; font-size: 12px; margin: 10px 0 16px; }
.note-body { font-size: 17px; line-height: 1.5; }
.note-body p { margin: 0 0 .8em; }
.note-body p.title { font-weight: 700; font-size: 20px; }
.note-body .seg { animation: type .25s ease-out; }
@keyframes type { from { opacity: 0; } }
.caret { display: inline-block; width: 2px; height: 1.1em; background: var(--notes); vertical-align: -.2em; animation: blink 1s steps(2) infinite; }
.note-empty { color: #b5afa3; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%);
  background: var(--red); color: #fff; padding: 12px 18px; border-radius: 12px; border: 2px solid var(--ink);
  font-family: var(--mono); font-size: 14px; font-weight: 700; max-width: calc(100vw - 32px);
  box-shadow: 4px 4px 0 var(--ink); transition: transform .18s ease-out; z-index: 10; text-align: center;
}
.toast.show { transform: translate(-50%, 0); }
.toast small { display: block; font-weight: 500; opacity: .9; }

/* Result */
.result-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; padding-top: 24px; align-items: start; }
.shot-wrap { display: flex; justify-content: center; }
#shot { width: 100%; max-width: 560px; height: auto; border-radius: 16px; box-shadow: 0 24px 60px -24px rgba(0,0,0,.45); border: 1px solid var(--line); background: var(--note-bg); }
.pb-banner {
  background: var(--green); color: var(--ink); font-family: var(--mono); font-weight: 800; text-transform: uppercase;
  padding: 10px 14px; border-radius: 10px; border: 2px solid var(--ink); margin-bottom: 14px; text-align: center;
  animation: zoom .4s ease-out;
}
.share-buttons, .again { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.again { margin-top: 18px; }
.btn {
  background: var(--note-bg); border: 2px solid var(--ink); border-radius: 12px; padding: 12px 14px; font-weight: 700;
  box-shadow: 3px 3px 0 var(--ink); transition: transform .06s, box-shadow .06s;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn-primary { background: var(--red); color: #fff; grid-column: 1 / -1; font-size: 18px; padding: 14px; }
.btn-dark { background: var(--ink); color: #fff; }
.hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; min-height: 1.4em; }
.result-side h3 { font-family: var(--mono); font-size: 13px; text-transform: uppercase; color: var(--muted); margin: 28px 0 0; }

@media (max-width: 860px) {
  .play-grid, .result-grid { grid-template-columns: 1fr; }
  .note { position: static; min-height: 0; }
  .stage { min-height: 300px; }
}
@media (max-width: 560px) {
  main { padding: 0 16px 40px; }
  .topbar { padding: 12px 16px; }
  #screen-start { padding-top: 28px; }
  .modes { grid-template-columns: 1fr; }
  .lede { font-size: 17px; }
  .breaking p { font-size: 16px; }
  .opt { font-size: 16px; padding: 12px 14px; }
  .opt kbd { display: none; }
  .hud { padding: 10px 14px; }
  #splits { display: none; }
  .countdown { font-size: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- v2: twists, replies, sound ---- */
.topbar-right { display: flex; align-items: center; gap: 8px; }
.mute { background: none; border: 2px solid var(--ink); border-radius: 999px; width: 34px; height: 34px; font-size: 15px; line-height: 1; padding: 0; }

.breaking p .update { display: block; margin-top: 8px; background: #ffe14d; color: var(--ink); padding: 4px 8px; border-radius: 6px; font-size: .9em; animation: pop .3s ease-out; }

.twist {
  display: none; position: relative; z-index: 3;
  background: var(--hud); color: #fff; border-radius: 16px; padding: 22px;
  flex-direction: column; justify-content: center; gap: 10px;
  border: 3px solid var(--red); animation: shake .4s ease-out;
}
.twist.show { display: flex; }
.twist h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 4.6vw, 42px); line-height: 1.05; margin: 0; }
.twist p { margin: 0; font-size: 17px; color: #d8d2c6; }
.twist q { color: #fff; font-style: italic; }
.twist-tag {
  align-self: flex-start; background: var(--red); font-family: var(--mono); font-weight: 800; font-size: 12px;
  text-transform: uppercase; padding: 4px 8px; border-radius: 5px; animation: blink .6s steps(2) infinite;
}
.twist-escalate { border-color: #ffe14d; }
.twist-escalate .twist-tag { background: #ffe14d; color: var(--ink); }
.ceo-actions { display: grid; gap: 10px; margin-top: 8px; }
.ceo-actions .opt { color: var(--ink); position: relative; overflow: hidden; }
.ceo-actions .opt span { position: relative; z-index: 1; }
.ceo-actions small { display: block; font-size: 13px; opacity: .7; }
.ceo-mash { background: #fff3c4; }
.mash-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #ffd23f; transition: width .08s; }
@keyframes shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-8px) rotate(-.6deg); }
  40% { transform: translateX(7px) rotate(.5deg); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
.legal-warn { color: var(--red); margin-left: 6px; }
.opt-legal { border-color: var(--red); }

.feed { display: grid; gap: 8px; margin-top: 18px; min-height: 0; }
.reply {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: start;
  background: var(--note-bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  animation: slidein .25s ease-out;
}
.reply-trap { border-color: var(--red); background: #fff1ef; }
.reply-ceo, .reply-update { border-color: #e2a800; background: #fff9e3; }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; }
.reply-head { font-size: 13px; color: var(--muted); display: flex; gap: 5px; min-width: 0; }
.reply-head b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-body p { margin: 1px 0 0; font-size: 15px; line-height: 1.35; }
.likes { font-family: var(--mono); font-size: 12px; color: var(--red); white-space: nowrap; }
.feed .reply:nth-child(n+3) { opacity: .6; }
@keyframes slidein { from { opacity: 0; transform: translateX(-10px); } }

.splits li.twist-row { color: var(--red); }
.note-body p.ceo-ps { font-style: italic; color: var(--muted); }
.twist-note { font-family: var(--mono); font-size: 13px; color: var(--red); margin: 8px 0 0; }

@media (max-width: 560px) {
  .feed .reply:nth-child(n+3) { display: none; }
  .twist { padding: 16px; }
  .twist p { font-size: 15px; }
}
