/* =========================================================
   闭卷 · 双人知识擂台
   视觉方向：Swiss / 国际主义考试印刷品
   纯白纸面、墨黑结构、单一瑞士红、可见网格、无圆角、无阴影
   ========================================================= */

:root {
  --paper: #ffffff;
  --ink: #0a0a0a;
  --muted: #6b6b6b;
  --faint: #9a9a9a;
  --line: #d9d9d9;
  --line-soft: #ececec;
  --wash: #f5f5f5;
  --red: #e4002b;
  --red-dark: #b80022;
  --font: "Noto Sans SC", "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --frame: 13px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.overlay-open {
  overflow: hidden;
}

body::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  background-image: linear-gradient(to right, rgba(10, 10, 10, 0.045) 1px, transparent 1px);
  background-size: calc(100% / 12) 100%;
  content: "";
  pointer-events: none;
}

::selection {
  color: #fff;
  background: var(--red);
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

h1,
h2,
h3,
p,
dl,
dd,
dt,
fieldset,
legend {
  margin: 0;
}

fieldset {
  min-width: 0;
  padding: 0;
  border: 0;
}

kbd {
  display: inline-block;
  min-width: 17px;
  padding: 1px 4px;
  border: 1px solid var(--line);
  font-family: var(--font);
  font-size: 9px;
  line-height: 1.35;
  text-align: center;
}

.page-frame {
  position: fixed;
  z-index: 90;
  inset: var(--frame);
  border: 1px solid var(--ink);
  pointer-events: none;
}

.skip-link {
  position: fixed;
  z-index: 500;
  top: -100px;
  left: 24px;
  padding: 10px 16px;
  color: #fff;
  background: var(--ink);
  font-size: 12px;
}

.skip-link:focus {
  top: 20px;
}

#app {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

/* ---------- masthead ---------- */

.masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 21px 48px 18px;
  border-bottom: 1px solid var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  color: #fff;
  background: var(--ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.brand-type strong {
  display: block;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.1;
}

.brand-type small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.22em;
  line-height: 1;
}

.brand:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 5px;
}

.masthead-note {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.17em;
  text-align: center;
  text-transform: uppercase;
}

.masthead-note span {
  padding: 0 8px;
  color: var(--red);
}

.masthead-tools {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 18px;
}

.bank-note {
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.quit-button {
  padding: 0 0 3px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  letter-spacing: 0.08em;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.quit-button:hover {
  color: var(--red);
  border-color: var(--red);
}

.quit-button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 10px;
  letter-spacing: 0.08em;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.sound-toggle:hover {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.sound-toggle:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.sound-led {
  width: 6px;
  height: 6px;
  background: var(--red);
}

.sound-toggle[aria-pressed="false"] .sound-led {
  background: var(--line);
}

/* ---------- shared ---------- */

main {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 52px;
}

.screen {
  width: 100%;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow-en {
  color: var(--faint);
}

.rule-short {
  width: 34px;
  height: 2px;
  flex: 0 0 auto;
  background: var(--red);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.section-head h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.section-head > span {
  color: var(--faint);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.arrow {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 1px;
  flex: 0 0 auto;
  background: currentColor;
  font-style: normal;
}

.arrow::after {
  position: absolute;
  top: -3px;
  right: 0;
  width: 6px;
  height: 6px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

/* ---------- home ---------- */

.screen-home {
  padding-top: clamp(48px, 7vh, 76px);
  padding-bottom: 70px;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, 0.72fr);
  align-items: start;
  gap: clamp(42px, 6vw, 100px);
}

.hero {
  padding-top: 8px;
}

.hero > * {
  animation: rise 680ms var(--ease) both;
}

.hero > :nth-child(2) {
  animation-delay: 60ms;
}

.hero > :nth-child(3) {
  animation-delay: 120ms;
}

.hero > :nth-child(4) {
  animation-delay: 180ms;
}

.rule-short {
  transform-origin: left center;
  animation: rule-grow 680ms 220ms var(--ease) both;
}

.hero h1 {
  margin: 24px 0 26px;
  font-size: clamp(60px, 7.3vw, 108px);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.hero-line {
  display: block;
  white-space: nowrap;
}

.accent {
  color: var(--red);
}

.lede {
  max-width: 510px;
  color: #303030;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.015em;
  line-height: 1.9;
}

.hero-meta {
  display: flex;
  align-items: flex-end;
  gap: 34px;
  max-width: 680px;
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--ink);
}

.meta-item strong {
  display: block;
  font-size: 50px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.meta-item span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.meta-scope {
  margin-left: auto;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.03em;
  line-height: 1.8;
  text-align: right;
}

/* setup card */

.setup-card {
  border: 1px solid var(--ink);
  background: var(--paper);
  animation: rise 780ms 120ms var(--ease) both;
}

.setup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  color: #fff;
  background: var(--ink);
}

.setup-head h2 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.setup-head span {
  color: #b9b9b9;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.field {
  padding: 17px 18px 19px;
  border-bottom: 1px solid var(--line);
}

.field legend {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.11em;
}

.field legend span {
  float: right;
  color: var(--faint);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.field legend b {
  color: var(--red);
  font-weight: 700;
}

.mode-list {
  display: grid;
  gap: 7px;
}

.mode-option {
  position: relative;
  display: block;
}

.mode-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.mode-body {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  transition: color 170ms var(--ease), border-color 170ms var(--ease), background 170ms var(--ease);
}

.mode-option:hover .mode-body {
  border-color: var(--ink);
}

.mode-option input:focus-visible + .mode-body {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.mode-option input:checked + .mode-body {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.mode-index {
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.mode-copy strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.mode-copy small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.mode-option input:checked + .mode-body .mode-copy small {
  color: #bdbdbd;
}

.mode-arrow {
  position: relative;
  width: 18px;
  height: 1px;
  justify-self: end;
  background: currentColor;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 170ms var(--ease), transform 170ms var(--ease);
}

.mode-arrow::after {
  position: absolute;
  top: -3px;
  right: 0;
  width: 6px;
  height: 6px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

.mode-option input:checked + .mode-body .mode-arrow {
  opacity: 1;
  transform: translateX(0);
}

.player-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.player-field {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  transition: border-color 160ms var(--ease);
}

.player-field:focus-within {
  border-color: var(--ink);
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.player-tag {
  display: grid;
  width: 27px;
  height: 38px;
  place-items: center;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.player-a .player-tag {
  background: var(--red);
}

.player-b .player-tag {
  background: var(--ink);
}

.player-field input {
  width: 100%;
  min-width: 0;
  padding: 10px 8px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.player-side {
  padding-right: 8px;
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.cat {
  position: relative;
  display: block;
}

.cat input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.cat span {
  display: grid;
  min-height: 30px;
  place-items: center;
  padding: 4px 2px;
  border: 1px solid var(--line);
  color: #3c3c3c;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: center;
  transition: color 140ms var(--ease), border-color 140ms var(--ease), background 140ms var(--ease);
}

.cat:hover span {
  border-color: var(--ink);
}

.cat input:checked + span {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.cat input:focus-visible + span {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

.cat-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.cat-links {
  display: flex;
  gap: 12px;
}

.cat-links button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
  line-height: 1.5;
}

.cat-links button:hover {
  color: var(--red);
  border-color: var(--red);
}

.cat-links button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.cat-tools p {
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.03em;
  text-align: right;
}

.cat-tools p.is-error {
  color: var(--red);
}

.start-button {
  display: flex;
  width: calc(100% - 36px);
  align-items: center;
  justify-content: space-between;
  margin: 18px;
  padding: 15px 17px;
  border: 1px solid var(--ink);
  color: #fff;
  background: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  transition: background 170ms var(--ease), border-color 170ms var(--ease);
}

.start-button:hover {
  border-color: var(--red);
  background: var(--red);
}

.start-button:active {
  transform: translateY(1px);
}

.start-button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.start-button .arrow {
  width: 28px;
}

.start-button.is-shake {
  animation: shake 320ms var(--ease);
}

.setup-foot {
  padding: 0 18px 16px;
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.02em;
  line-height: 1.7;
}

/* howto */

.howto {
  margin-top: clamp(64px, 9vh, 100px);
  padding-top: 20px;
  border-top: 1px solid var(--ink);
}

.howto-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 4px;
}

.howto-grid article {
  min-height: 150px;
  padding: 22px 30px 10px 0;
  border-right: 1px solid var(--line);
}

.howto-grid article + article {
  padding-left: 30px;
}

.howto-grid article:last-child {
  border-right: 0;
}

.howto-num {
  color: var(--red);
  font-size: 9px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.howto-grid h3 {
  margin-top: 10px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.howto-grid p {
  max-width: 340px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.85;
}

/* ---------- game ---------- */

.screen-game {
  padding-top: 22px;
  padding-bottom: 48px;
}

.game-head {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: stretch;
  gap: 26px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--ink);
}

.game-match {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.game-match > span {
  color: var(--red);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.13em;
}

.game-match > strong {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
}

.score-card {
  min-width: 0;
  padding: 8px 18px 7px;
  border-top: 3px solid transparent;
  transition: background 220ms var(--ease), border-color 220ms var(--ease);
}

.score-a.is-active {
  border-top-color: var(--red);
  background: var(--wash);
}

.score-b.is-active {
  border-top-color: var(--ink);
  background: var(--wash);
}

.score-player {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.score-player span:last-child {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-b .score-player {
  flex-direction: row-reverse;
}

.score-side {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: #fff;
  background: var(--ink);
  font-size: 8px;
  font-weight: 700;
}

.score-a .score-side {
  background: var(--red);
}

.score-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 3px;
}

.score-b .score-line {
  justify-content: flex-end;
}

.score-line strong {
  font-size: clamp(34px, 3.6vw, 50px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.score-line strong.is-bump {
  animation: score-bump 280ms var(--ease);
}

.score-line span {
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.match-center {
  display: flex;
  min-width: 112px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 18px;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  text-align: center;
}

.match-center span:first-child {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.match-center span:last-child {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.timer-track {
  height: 5px;
  margin-top: 7px;
  overflow: hidden;
  background: var(--line-soft);
}

.timer-fill {
  width: 100%;
  height: 100%;
  background: var(--red);
  transform-origin: left center;
  transition: width 100ms linear, background 180ms var(--ease);
}

.timer-track.is-urgent .timer-fill {
  background: var(--red);
}

.game-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  margin-top: 24px;
  border: 1px solid var(--ink);
  animation: rise 440ms var(--ease) both;
}

.question-card {
  display: flex;
  min-height: 512px;
  flex-direction: column;
  padding: 28px 36px 30px;
}

.q-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  color: #fff;
  background: var(--ink);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.q-index {
  color: var(--faint);
  font-size: 9px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.14em;
}

.question-card h2 {
  max-width: 930px;
  margin: 24px 0 30px;
  font-size: clamp(26px, 3.1vw, 43px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.3;
  text-wrap: balance;
}

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.option {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-height: 76px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  background: var(--paper);
  text-align: left;
  transition: color 150ms var(--ease), border-color 150ms var(--ease), background 150ms var(--ease), opacity 180ms var(--ease);
}

.option:hover:not(:disabled) {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.option:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.option-letter {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid currentColor;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  transition: color 150ms var(--ease), border-color 150ms var(--ease), background 150ms var(--ease);
}

.option:hover:not(:disabled) .option-letter {
  color: var(--ink);
  border-color: #fff;
  background: #fff;
}

.option-text {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1.55;
}

.option.is-correct {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: inset 4px 0 0 var(--red);
}

.option.is-correct .option-letter {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

.option.is-wrong {
  color: var(--red);
  border-color: var(--red);
  background: var(--paper);
}

.option.is-wrong .option-letter {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

.option.is-wrong .option-text {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.option.is-dim {
  opacity: 0.38;
}

.option:disabled {
  cursor: default;
}

.skip-button {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 154px;
  margin-top: 14px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  transition: color 150ms var(--ease), border-color 150ms var(--ease);
}

.skip-button span:last-child {
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

.skip-button:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.skip-button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.question-card h2:focus {
  outline: 0;
}

.verdict {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--ink);
  animation: verdict-in 260ms var(--ease) both;
}

.verdict-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.verdict-head strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.verdict-head span {
  color: var(--red);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.verdict p {
  max-width: 800px;
  margin-top: 7px;
  color: #3f3f3f;
  font-size: 11px;
  line-height: 1.85;
}

.verdict.is-miss .verdict-head strong {
  color: var(--red);
}

.next-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  min-width: 142px;
  margin-top: 15px;
  padding: 10px 13px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: var(--paper);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  transition: color 150ms var(--ease), background 150ms var(--ease);
}

.next-button:hover {
  color: #fff;
  background: var(--ink);
}

.next-button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.next-button .arrow {
  width: 18px;
}

.play-rail {
  display: flex;
  flex-direction: column;
  padding: 26px 22px 22px;
  border-left: 1px solid var(--ink);
  background: #fafafa;
}

.turn-box {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.rail-label {
  display: block;
  color: var(--faint);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.turn-box strong {
  display: block;
  overflow: hidden;
  margin-top: 7px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turn-box > span:last-child {
  display: inline-block;
  margin-top: 5px;
  color: var(--red);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.turn-box.is-p2 > span:last-child {
  color: var(--ink);
}

.clock-box {
  padding: 19px 0 16px;
  border-bottom: 1px solid var(--line);
}

.clock {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 3px;
  color: var(--ink);
  transition: color 160ms var(--ease);
}

.clock > span {
  font-size: 68px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.07em;
  line-height: 0.95;
}

.clock > small {
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.clock-box.is-urgent .clock {
  color: var(--red);
}

.clock-box.is-urgent .clock > span {
  animation: clock-pulse 900ms var(--ease) infinite;
}

.clock-scale {
  width: 100%;
  height: 5px;
  margin-top: 12px;
  background-image: repeating-linear-gradient(to right, var(--ink) 0 1px, transparent 1px 10%);
  opacity: 0.22;
}

.mini-stats {
  padding-top: 8px;
}

.mini-stats > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.mini-stats dt {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.mini-stats dd {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rail-tip {
  margin-top: auto;
  padding-top: 18px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.8;
}

/* ---------- result ---------- */

.screen-result {
  padding-top: 46px;
  padding-bottom: 66px;
  animation: rise 500ms var(--ease) both;
}

.screen-result:focus {
  outline: 0;
}

.result-head {
  padding-bottom: 25px;
  border-bottom: 2px solid var(--ink);
}

.result-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-top: 18px;
}

.winner-badge {
  display: inline-flex;
  padding: 5px 8px;
  color: #fff;
  background: var(--red);
  font-size: 8px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.18em;
  line-height: 1.2;
}

.winner-badge.is-draw {
  background: var(--ink);
}

.result-head h1 {
  margin-top: 12px;
  font-size: clamp(44px, 6.2vw, 84px);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
  overflow-wrap: anywhere;
}

.result-sub {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.result-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  padding-bottom: 4px;
}

.button-solid,
.button-line {
  min-width: 116px;
  padding: 12px 16px;
  border: 1px solid var(--ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  transition: color 160ms var(--ease), background 160ms var(--ease), border-color 160ms var(--ease);
}

.button-solid {
  color: #fff;
  background: var(--ink);
}

.button-solid:hover {
  border-color: var(--red);
  background: var(--red);
}

.button-line {
  color: var(--ink);
  background: var(--paper);
}

.button-line:hover {
  color: #fff;
  background: var(--ink);
}

.button-solid:focus-visible,
.button-line:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.result-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 24px;
  border: 1px solid var(--ink);
}

.result-card {
  min-width: 0;
  padding: 24px 26px 22px;
}

.result-card + .result-card {
  border-left: 1px solid var(--ink);
}

.result-card.is-winner {
  box-shadow: inset 0 5px 0 var(--red);
}

.result-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-side {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: #fff;
  background: var(--ink);
  font-size: 9px;
  font-weight: 700;
}

.result-a .result-side {
  background: var(--red);
}

.result-card-head h2 {
  overflow: hidden;
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-verdict {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
}

.result-card.is-winner .result-verdict {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

.result-card.is-draw .result-verdict {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.result-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
}

.result-score strong {
  font-size: clamp(64px, 8vw, 102px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.075em;
  line-height: 0.9;
}

.result-score span {
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.result-stats > div {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.result-stats dt {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.result-stats dd {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.result-bar {
  height: 6px;
  margin-top: 18px;
  overflow: hidden;
  background: var(--line-soft);
}

.result-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--red);
  transition: width 900ms 160ms var(--ease);
}

.result-b .result-bar i {
  background: var(--ink);
}

/* review */

.review {
  margin-top: 54px;
  padding-top: 20px;
  border-top: 1px solid var(--ink);
}

.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
  margin-top: 16px;
}

.review-player {
  min-width: 0;
}

.review-player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
}

.review-player-head strong {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.review-player-head span {
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.review-item {
  padding: 12px 0 13px;
  border-bottom: 1px solid var(--line);
}

.review-cat {
  display: inline-block;
  color: var(--red);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.review-item h3 {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1.55;
}

.review-answer {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.review-answer b {
  color: var(--ink);
  font-weight: 600;
}

.review-answer .miss {
  color: var(--red);
}

.review-note {
  margin-top: 4px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.7;
}

.review-player-empty {
  padding: 14px 0;
  color: var(--faint);
  font-size: 10px;
}

.review-empty {
  margin-top: 16px;
  color: var(--muted);
  font-size: 11px;
}

/* ---------- overlay / toast ---------- */

.overlay {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--paper);
}

.overlay-panel {
  width: min(590px, 100%);
  padding: 42px 44px 34px;
  border: 1px solid var(--ink);
  border-top: 7px solid var(--red);
  background: var(--paper);
  animation: overlay-in 320ms var(--ease) both;
}

.overlay-kicker {
  color: var(--red);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.overlay-panel h2 {
  margin-top: 13px;
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.08;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.overlay-text {
  max-width: 430px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.85;
}

.overlay-button {
  min-width: 180px;
  margin-top: 25px;
  padding: 13px 18px;
  border: 1px solid var(--ink);
  color: #fff;
  background: var(--ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  transition: background 160ms var(--ease), border-color 160ms var(--ease);
}

.overlay-button:hover {
  border-color: var(--red);
  background: var(--red);
}

.overlay-button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.overlay-note {
  margin-top: 13px;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.02em;
  line-height: 1.7;
}

.countdown {
  margin: 18px 0 4px;
  color: var(--red);
  font-size: 150px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.08em;
  line-height: 0.85;
  animation: count-pop 520ms var(--ease) both;
}

.overlay-panel.is-counting {
  text-align: center;
}

.overlay-panel.is-counting .overlay-kicker {
  display: block;
}

.overlay-panel.is-counting h2,
.overlay-panel.is-counting .overlay-text,
.overlay-panel.is-counting .overlay-button,
.overlay-panel.is-counting .overlay-note {
  display: none;
}

.toast {
  position: fixed;
  z-index: 300;
  bottom: 30px;
  left: 50%;
  max-width: calc(100% - 40px);
  padding: 10px 15px;
  color: #fff;
  background: var(--ink);
  font-size: 10px;
  letter-spacing: 0.03em;
  line-height: 1.6;
  transform: translateX(-50%);
  animation: toast-in 220ms var(--ease) both;
}

/* ---------- footer ---------- */

.site-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: auto;
  padding: 16px 48px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.09em;
}

.site-foot p:last-child {
  text-align: right;
}

/* ---------- animations ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rule-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes verdict-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes overlay-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes count-pop {
  from {
    opacity: 0;
    transform: scale(1.14);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes clock-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.52;
  }
}

@keyframes score-bump {
  0% {
    transform: translateY(0);
  }
  35% {
    transform: translateY(-4px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .home-grid {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
    gap: 46px;
  }

  .hero h1 {
    font-size: clamp(56px, 6.8vw, 86px);
  }

  .game-body {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

  .question-card {
    padding: 26px 28px 28px;
  }
}

@media (max-width: 940px) {
  .home-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero {
    max-width: 760px;
  }

  .hero h1 {
    font-size: clamp(58px, 10vw, 96px);
  }

  .setup-card {
    max-width: 660px;
  }

  .game-head {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .game-match {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }

  .score-card {
    padding-right: 14px;
    padding-left: 14px;
  }

  .game-body {
    grid-template-columns: 1fr;
  }

  .play-rail {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0 26px;
    padding: 20px 24px;
    border-top: 1px solid var(--ink);
    border-left: 0;
  }

  .turn-box {
    padding: 0;
    border: 0;
  }

  .clock-box {
    padding: 0;
    border: 0;
    text-align: right;
  }

  .clock {
    justify-content: flex-end;
  }

  .clock > span {
    font-size: 48px;
  }

  .clock-scale {
    display: none;
  }

  .mini-stats {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 15px;
    padding-top: 0;
    border-top: 1px solid var(--line);
  }

  .mini-stats > div {
    padding: 9px 14px 0 0;
    border: 0;
  }

  .mini-stats > div + div {
    padding-left: 14px;
    border-left: 1px solid var(--line);
  }

  .rail-tip {
    grid-column: 1 / -1;
    margin-top: 12px;
    padding-top: 0;
  }

  .result-title-row {
    align-items: flex-start;
  }

  .review-grid {
    gap: 0 24px;
  }
}

@media (max-width: 720px) {
  :root {
    --frame: 7px;
  }

  body::before {
    background-size: 25% 100%;
  }

  .masthead {
    grid-template-columns: 1fr auto;
    padding: 15px 20px 13px;
  }

  .masthead-note,
  .bank-note {
    display: none;
  }

  .brand-mark {
    width: 37px;
    height: 37px;
    font-size: 21px;
  }

  .brand-type strong {
    font-size: 17px;
  }

  .brand-type small {
    font-size: 7px;
  }

  .sound-toggle {
    padding: 7px 9px;
  }

  main {
    padding: 0 20px;
  }

  .screen-home {
    padding-top: 42px;
    padding-bottom: 52px;
  }

  .eyebrow {
    font-size: 9px;
    letter-spacing: 0.14em;
  }

  .rule-short {
    width: 24px;
  }

  .hero h1 {
    margin: 20px 0 22px;
    font-size: clamp(47px, 13.6vw, 78px);
    letter-spacing: -0.07em;
    line-height: 1;
  }

  .lede {
    font-size: 14px;
    line-height: 1.85;
  }

  .hero-meta {
    flex-wrap: wrap;
    gap: 22px;
    margin-top: 34px;
  }

  .meta-item strong {
    font-size: 38px;
  }

  .meta-scope {
    width: 100%;
    margin-left: 0;
    padding-top: 12px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
    text-align: left;
  }

  .field {
    padding: 15px 14px 17px;
  }

  .start-button {
    width: calc(100% - 28px);
    margin: 14px;
  }

  .setup-foot {
    padding: 0 14px 14px;
  }

  .player-fields {
    grid-template-columns: 1fr;
  }

  .howto {
    margin-top: 52px;
  }

  .howto-grid {
    grid-template-columns: 1fr;
  }

  .howto-grid article {
    min-height: 0;
    padding: 18px 0 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .howto-grid article + article {
    padding-left: 0;
  }

  .howto-grid article:last-child {
    border-bottom: 0;
  }

  .howto-grid p {
    max-width: 100%;
  }

  .screen-game {
    padding-top: 17px;
    padding-bottom: 36px;
  }

  .score-card {
    padding: 7px 9px 6px;
  }

  .score-player {
    gap: 6px;
    font-size: 9px;
  }

  .score-side {
    width: 16px;
    height: 16px;
    font-size: 7px;
  }

  .score-line strong {
    font-size: 34px;
  }

  .score-line span {
    display: none;
  }

  .match-center {
    min-width: 76px;
    padding: 0 8px;
  }

  .match-center span:first-child {
    font-size: 8px;
  }

  .match-center span:last-child {
    font-size: 7px;
  }

  .game-body {
    margin-top: 16px;
  }

  .question-card {
    min-height: 0;
    padding: 20px 18px 22px;
  }

  .question-card h2 {
    margin: 18px 0 22px;
    font-size: clamp(24px, 7vw, 32px);
    line-height: 1.38;
  }

  .options {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .option {
    min-height: 60px;
    padding: 11px 12px;
  }

  .option-text {
    font-size: 13px;
  }

  .verdict {
    padding-top: 17px;
  }

  .verdict p {
    font-size: 10px;
  }

  .play-rail {
    padding: 17px 18px;
  }

  .turn-box strong {
    font-size: 21px;
  }

  .clock > span {
    font-size: 41px;
  }

  .screen-result {
    padding-top: 34px;
    padding-bottom: 48px;
  }

  .result-title-row {
    flex-direction: column;
    gap: 20px;
    margin-top: 14px;
  }

  .result-head h1 {
    font-size: clamp(40px, 12vw, 62px);
  }

  .result-actions {
    width: 100%;
  }

  .button-solid,
  .button-line {
    flex: 1;
    min-width: 0;
  }

  .result-board {
    grid-template-columns: 1fr;
    margin-top: 18px;
  }

  .result-card {
    padding: 20px;
  }

  .result-card + .result-card {
    border-top: 1px solid var(--ink);
    border-left: 0;
  }

  .result-score strong {
    font-size: clamp(58px, 17vw, 84px);
  }

  .review {
    margin-top: 38px;
  }

  .review-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .overlay {
    padding: 14px;
  }

  .overlay-panel {
    padding: 28px 24px 24px;
    border-top-width: 6px;
  }

  .overlay-panel h2 {
    font-size: clamp(34px, 10vw, 46px);
  }

  .countdown {
    font-size: 120px;
  }

  .site-foot {
    padding: 14px 20px;
    font-size: 7px;
  }
}

@media (max-width: 390px) {
  main {
    padding: 0 16px;
  }

  .hero h1 {
    font-size: 45px;
  }

  .cat span {
    font-size: 9px;
  }

  .player-field input {
    font-size: 11px;
  }

  .match-center {
    min-width: 62px;
    padding: 0 5px;
  }

  .score-line strong {
    font-size: 30px;
  }

  .result-actions {
    flex-direction: column;
  }
}

@media (hover: none) {
  .option:hover:not(:disabled):not(.is-correct):not(.is-wrong) {
    color: var(--ink);
    border-color: var(--line);
    background: var(--paper);
  }

  .option:hover:not(:disabled):not(.is-correct):not(.is-wrong) .option-letter {
    color: var(--ink);
    border-color: currentColor;
    background: transparent;
  }

  .sound-toggle:hover {
    color: var(--ink);
    border-color: var(--line);
    background: var(--paper);
  }
}

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