:root {
  color-scheme: light;
  --ink: #111412;
  --ink-soft: #282d29;
  --paper: #f2f0e8;
  --paper-bright: #fbfaf6;
  --lime: #c9ff58;
  --lime-deep: #91d813;
  --coral: #ff6b52;
  --line: rgba(17, 20, 18, 0.16);
  --muted: #676d68;
  --white-line: rgba(255, 255, 255, 0.3);
  --shadow: 0 24px 70px rgba(13, 18, 15, 0.18);
  --display: "Cantarell Extra Bold", "Arial Black", "Arial Narrow", sans-serif;
  --body: Lato, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  background: var(--ink);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.app,
main,
.screen {
  min-height: 100dvh;
}

.app {
  position: relative;
  overflow: hidden;
}

.screen {
  display: none;
}

.screen.is-active {
  display: grid;
}

.topbar {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  min-height: 74px;
  align-items: center;
  padding: 0 clamp(18px, 3vw, 48px);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  transition: color 300ms ease, border-color 300ms ease, background 300ms ease;
}

.app[data-screen="intro"] .topbar {
  grid-template-columns: 1fr auto;
}

.app[data-screen="game"] .topbar {
  border-color: rgba(255, 255, 255, 0.18);
  background: linear-gradient(to bottom, rgba(8, 11, 9, 0.36), transparent);
  color: #fff;
}

.brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 4px 0;
  color: inherit;
  cursor: pointer;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  overflow: visible;
  fill: currentColor;
}

.brand-mark circle,
.brand-mark path:nth-last-child(-n + 2) {
  fill: var(--paper);
}

.app[data-screen="intro"] .brand-mark circle,
.app[data-screen="intro"] .brand-mark path:nth-last-child(-n + 2) {
  fill: var(--paper);
}

.app[data-screen="game"] .brand-mark circle,
.app[data-screen="game"] .brand-mark path:last-child {
  fill: var(--ink);
}

.scoreboard {
  display: flex;
  min-width: 180px;
  align-items: center;
  justify-content: center;
  gap: 22px;
  color: #fff;
}

.score-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.score-item span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.score-item strong {
  font-family: var(--display);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

.score-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.25);
}

.round-button {
  display: grid;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-self: end;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  opacity: 0.76;
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease;
}

.round-button:hover {
  background: rgba(255, 255, 255, 0.1);
  opacity: 1;
  transform: rotate(4deg);
}

.round-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.intro-screen {
  position: relative;
  grid-template-columns: minmax(0, 1.06fr) minmax(370px, 0.94fr);
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 23% 16%, rgba(201, 255, 88, 0.18), transparent 22%),
    var(--paper);
  padding: 118px clamp(24px, 6vw, 96px) 66px;
}

.intro-screen::after {
  position: absolute;
  top: 74px;
  bottom: 0;
  left: 53%;
  width: 1px;
  background: var(--line);
  content: "";
}

.intro-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
  padding-right: clamp(20px, 5vw, 88px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow > span {
  width: 26px;
  height: 2px;
  background: var(--lime-deep);
}

.intro-content h1 {
  max-width: 800px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.5rem, 6.4vw, 7.2rem);
  font-weight: 600;
  letter-spacing: -0.072em;
  line-height: 0.91;
}

.intro-content h1 em {
  position: relative;
  color: transparent;
  font-style: normal;
  -webkit-text-stroke: 1.5px var(--ink);
}

.intro-content h1 em::after {
  position: absolute;
  z-index: -1;
  right: -0.08em;
  bottom: 0.06em;
  left: -0.05em;
  height: 0.24em;
  border-radius: 999px;
  background: var(--lime);
  content: "";
  transform: rotate(-1deg);
}

.intro-copy {
  max-width: 600px;
  margin: 32px 0 0;
  color: #4d534e;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.72;
}

.intro-actions {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 38px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 24px;
  border-radius: 3px;
  padding: 0 24px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  box-shadow: 6px 6px 0 var(--lime-deep);
}

.primary-button:not(:disabled):hover {
  box-shadow: 3px 3px 0 var(--lime-deep);
  transform: translate(3px, 3px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.primary-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.secondary-button {
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.secondary-button:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
}

.secondary-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.text-button {
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  padding: 6px 0 3px;
  color: inherit;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
}

.text-button:hover {
  opacity: 0.6;
}

.load-error {
  max-width: 520px;
  margin: 24px 0 0;
  border-left: 3px solid var(--coral);
  padding-left: 14px;
  color: #8e3021;
}

.data-note {
  display: flex;
  max-width: 520px;
  align-items: center;
  gap: 12px;
  margin-top: 46px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.data-note svg {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.data-note p,
.data-note strong,
.data-note span {
  display: block;
}

.data-note p {
  margin: 0;
}

.data-note strong {
  font-size: 0.78rem;
}

.data-note span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
}

.intro-preview {
  position: relative;
  z-index: 2;
  width: min(39vw, 560px);
  height: min(68vh, 650px);
  justify-self: center;
}

.preview-card {
  position: absolute;
  display: flex;
  width: min(26vw, 390px);
  min-width: 280px;
  height: min(40vh, 360px);
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-radius: 3px;
  box-shadow: var(--shadow);
  padding: 26px;
  color: #fff;
}

.preview-card::before,
.preview-card::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.preview-card::before {
  inset: 0;
  background:
    linear-gradient(145deg, transparent 15%, rgba(255, 255, 255, 0.15) 15.2%, transparent 15.8%),
    linear-gradient(25deg, transparent 62%, rgba(255, 255, 255, 0.1) 62.2%, transparent 62.8%);
  background-size: 120px 120px, 170px 170px;
}

.preview-card::after {
  right: -70px;
  bottom: -85px;
  width: 260px;
  height: 260px;
  border: 34px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.preview-card-left {
  top: 2%;
  left: 2%;
  background: linear-gradient(145deg, #263e39, #0c1714);
  transform: rotate(-7deg);
}

.preview-card-right {
  right: 0;
  bottom: 2%;
  background: linear-gradient(145deg, #d9563f, #7d211c);
  transform: rotate(6deg);
}

.preview-index {
  color: rgba(255, 255, 255, 0.48);
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
}

.preview-card p {
  margin: 0 0 7px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-card strong {
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.4vw, 2.5rem);
  letter-spacing: -0.05em;
}

.preview-vs {
  position: absolute;
  z-index: 4;
  top: 47%;
  left: 48%;
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 6px solid var(--paper);
  border-radius: 50%;
  background: var(--lime);
  font-family: var(--display);
  font-size: 0.86rem;
  font-weight: 700;
  transform: rotate(-4deg);
}

.intro-disclaimer {
  position: absolute;
  z-index: 4;
  right: 28px;
  bottom: 18px;
  margin: 0;
  color: #7c817d;
  font-size: 0.68rem;
}

.intro-texture {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(17, 20, 18, 0.08);
  border-radius: 50%;
}

.orbit-one {
  top: -300px;
  right: -260px;
  width: 760px;
  height: 760px;
}

.orbit-two {
  right: 35%;
  bottom: -460px;
  width: 660px;
  height: 660px;
}

.monument {
  position: absolute;
  background: rgba(17, 20, 18, 0.025);
  clip-path: polygon(42% 0, 58% 0, 60% 12%, 76% 12%, 76% 75%, 96% 75%, 96% 100%, 4% 100%, 4% 75%, 24% 75%, 24% 12%, 40% 12%);
}

.monument-one {
  right: 3%;
  bottom: -1px;
  width: 260px;
  height: 470px;
}

.monument-two {
  top: 18%;
  left: 45%;
  width: 120px;
  height: 230px;
  opacity: 0.7;
}

.game-screen {
  position: relative;
  background: var(--ink);
}

.battle-stage {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
}

.event-panel {
  --tone-a: #243a36;
  --tone-b: #0c1714;
  --tone-c: #77a69c;
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  padding: 104px clamp(24px, 5vw, 80px) 50px;
  background: var(--tone-b);
  color: #fff;
}

.event-panel-challenger {
  --tone-a: #a84334;
  --tone-b: #481b19;
  --tone-c: #fa987f;
}

.panel-art,
.panel-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.panel-art {
  z-index: -3;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 24%, color-mix(in srgb, var(--tone-c) 74%, transparent) 0, transparent 30%),
    radial-gradient(circle at 12% 88%, var(--tone-a) 0, transparent 42%),
    linear-gradient(145deg, var(--tone-a), var(--tone-b) 70%);
  transform: scale(1.02);
  transition: transform 800ms cubic-bezier(0.16, 1, 0.3, 1), filter 500ms ease;
}

.panel-art::before {
  position: absolute;
  inset: -30%;
  background:
    repeating-radial-gradient(ellipse at 40% 35%, transparent 0 22px, rgba(255, 255, 255, 0.075) 23px 24px, transparent 25px 38px);
  content: "";
  opacity: 0.62;
  transform: rotate(-18deg);
}

.panel-art::after {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  content: "";
  mix-blend-mode: soft-light;
  opacity: 0.36;
}

.panel-shade {
  z-index: -2;
  background:
    linear-gradient(to bottom, rgba(4, 7, 5, 0.32), transparent 25%, transparent 72%, rgba(4, 7, 5, 0.46)),
    radial-gradient(circle at center, transparent 10%, rgba(4, 7, 5, 0.22) 100%);
}

.panel-number {
  position: absolute;
  top: 50%;
  left: 50%;
  color: rgba(255, 255, 255, 0.055);
  font-family: var(--display);
  font-size: clamp(17rem, 36vw, 36rem);
  font-weight: 700;
  letter-spacing: -0.12em;
  line-height: 0.6;
  transform: translate(-54%, -52%);
}

.topography {
  position: absolute;
  right: -7vw;
  bottom: -9vw;
  width: min(34vw, 520px);
  height: min(34vw, 520px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 45% 55% 58% 42%;
  box-shadow:
    0 0 0 34px rgba(255, 255, 255, 0.035),
    0 0 0 68px rgba(255, 255, 255, 0.025),
    0 0 0 102px rgba(255, 255, 255, 0.02);
  transform: rotate(18deg);
}

.event-content {
  position: relative;
  z-index: 2;
  width: min(100%, 590px);
  text-align: center;
  transition: opacity 260ms ease, transform 460ms cubic-bezier(0.16, 1, 0.3, 1);
}

.event-meta {
  min-height: 1.2em;
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.event-content h2 {
  max-width: 660px;
  margin: 0 auto;
  font-family: var(--display);
  font-size: clamp(2.3rem, 4.25vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 0.98;
  text-wrap: balance;
}

.comparison-copy {
  margin: 26px 0 11px;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(0.84rem, 1.15vw, 1rem);
}

.death-count {
  margin: 0;
  color: var(--lime);
  font-family: var(--display);
  font-size: clamp(2.75rem, 5.2vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
  text-shadow: 0 6px 30px rgba(3, 8, 5, 0.2);
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.34);
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease;
}

.source-link:hover {
  border-color: #fff;
  color: #fff;
}

.source-link svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.choice-controls {
  display: grid;
  width: min(100%, 340px);
  margin: 26px auto 0;
  gap: 8px;
}

.choice-button {
  display: grid;
  min-height: 74px;
  grid-template-columns: 46px 1fr 30px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(13, 17, 14, 0.15);
  padding: 8px 18px 8px 11px;
  color: #fff;
  cursor: pointer;
  text-align: left;
  backdrop-filter: blur(8px);
  transition: background 170ms ease, border-color 170ms ease, color 170ms ease, transform 170ms ease;
}

.choice-button::after {
  justify-self: end;
  color: rgba(255, 255, 255, 0.5);
  content: "↗";
  font-size: 1rem;
}

.choice-button:hover {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--ink);
  transform: scale(1.025);
}

.choice-button:hover::after {
  color: var(--ink);
}

.choice-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
}

.choice-button:hover .choice-icon {
  background: rgba(17, 20, 18, 0.12);
}

.choice-button strong,
.choice-button small {
  display: block;
}

.choice-button strong {
  font-family: var(--display);
  font-size: 1.04rem;
  letter-spacing: -0.02em;
}

.choice-button small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.68rem;
}

.choice-button:hover small {
  color: rgba(17, 20, 18, 0.65);
}

.choice-or {
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.versus-badge {
  position: absolute;
  z-index: 12;
  top: 50%;
  left: 50%;
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 7px solid rgba(17, 20, 18, 0.82);
  border-radius: 50%;
  background: var(--paper-bright);
  color: var(--ink);
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 700;
  transform: translate(-50%, -50%);
  transition: background 200ms ease, color 200ms ease, transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.challenger-reveal {
  margin-top: 23px;
}

.challenger-reveal:not([hidden]) {
  animation: reveal-count 500ms cubic-bezier(0.16, 1.2, 0.3, 1) both;
}

.reveal-caption {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
  font-weight: 600;
}

.result-flash {
  position: absolute;
  z-index: 20;
  top: 50%;
  left: 50%;
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border: 8px solid rgba(17, 20, 18, 0.78);
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.5);
}

.result-icon {
  display: none;
  width: 52px;
  height: 52px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5;
}

.result-icon-correct {
  stroke: #39a852;
}

.result-icon-wrong {
  stroke: #d74735;
}

.battle-stage.is-correct .result-flash,
.battle-stage.is-wrong .result-flash {
  animation: result-pop 820ms cubic-bezier(0.16, 1.3, 0.3, 1) both;
}

.battle-stage.is-correct .result-icon-correct,
.battle-stage.is-wrong .result-icon-wrong {
  display: block;
}

.battle-stage.is-correct .versus-badge {
  background: var(--lime);
  transform: translate(-50%, -50%) scale(0.86);
}

.battle-stage.is-wrong .versus-badge {
  background: var(--coral);
  color: #fff;
  transform: translate(-50%, -50%) scale(0.86);
}

.battle-stage.is-revealing .event-panel-challenger .panel-art {
  filter: saturate(1.2) brightness(1.08);
  transform: scale(1.07);
}

.battle-stage.is-advancing .event-panel-known {
  animation: known-exit 440ms ease both;
}

.battle-stage.is-advancing .event-panel-challenger {
  animation: challenger-handoff 440ms ease both;
}

.game-over {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #fff;
}

.game-over:not([hidden]) .game-over-backdrop {
  animation: fade-in 260ms ease both;
}

.game-over:not([hidden]) .game-over-card {
  animation: modal-up 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.game-over-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 10, 8, 0.76);
  backdrop-filter: blur(12px);
}

.game-over-card {
  position: relative;
  z-index: 1;
  width: min(100%, 510px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background:
    radial-gradient(circle at 100% 0%, rgba(201, 255, 88, 0.12), transparent 32%),
    #171c18;
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.42);
  padding: clamp(30px, 5vw, 50px);
  text-align: center;
}

.game-over-card .eyebrow {
  justify-content: center;
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.55);
}

.game-over-card h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.3rem, 6vw, 3.8rem);
  letter-spacing: -0.065em;
  line-height: 1;
}

.game-over-copy {
  max-width: 400px;
  margin: 18px auto 0;
  color: rgba(255, 255, 255, 0.66);
  line-height: 1.55;
}

.final-score {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 32px 0;
  border: solid rgba(255, 255, 255, 0.15);
  border-width: 1px 0;
}

.final-score > div {
  padding: 20px;
}

.final-score > div + div {
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.final-score span,
.final-score strong {
  display: block;
}

.final-score span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.final-score strong {
  margin-top: 4px;
  color: var(--lime);
  font-family: var(--display);
  font-size: 2.25rem;
}

.game-over-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.game-over-card .primary-button {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--ink);
  box-shadow: none;
}

.game-over-card .primary-button:hover {
  box-shadow: none;
  transform: translateY(-2px);
}

.game-over-card > .text-button {
  margin-top: 26px;
  color: rgba(255, 255, 255, 0.58);
}

.how-dialog {
  width: min(calc(100% - 32px), 600px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border: 0;
  background: var(--paper-bright);
  box-shadow: 0 30px 100px rgba(5, 8, 6, 0.35);
  color: var(--ink);
  padding: 0;
}

.how-dialog::backdrop {
  background: rgba(11, 14, 12, 0.74);
  backdrop-filter: blur(6px);
}

.how-dialog[open] {
  animation: modal-up 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.how-dialog form {
  position: relative;
  padding: clamp(28px, 6vw, 48px);
}

.dialog-close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.dialog-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.6;
}

.how-dialog .eyebrow {
  margin-bottom: 16px;
}

.how-dialog h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.5rem, 8vw, 4rem);
  letter-spacing: -0.07em;
}

.how-steps {
  display: grid;
  margin: 34px 0 0;
  padding: 0;
  gap: 24px;
  list-style: none;
}

.how-steps li {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 16px;
}

.how-steps li > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-family: var(--display);
  font-size: 0.8rem;
}

.how-steps strong {
  font-family: var(--display);
}

.how-steps p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.keyboard-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.72rem;
}

.keyboard-tip > span {
  margin-right: auto;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.keyboard-tip strong {
  margin-right: 8px;
  color: var(--ink);
  font-size: 0.7rem;
}

kbd {
  display: grid;
  min-width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid #b8bcb7;
  border-bottom-width: 2px;
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font-family: var(--body);
}

.method-note {
  margin: 20px 0 0;
  color: #777c77;
  font-size: 0.72rem;
  line-height: 1.55;
}

.dialog-ready {
  width: 100%;
  margin-top: 24px;
  box-shadow: 5px 5px 0 var(--lime-deep);
}

.toast {
  position: fixed;
  z-index: 110;
  bottom: 24px;
  left: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: #111713;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  padding: 12px 18px;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  margin: -1px !important;
  border: 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
}

@keyframes reveal-count {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes result-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.45) rotate(-8deg);
  }
  24%,
  68% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
  }
}

@keyframes known-exit {
  to {
    opacity: 0;
    transform: translateX(-8%);
  }
}

@keyframes challenger-handoff {
  to {
    filter: brightness(0.82);
    transform: translateX(-4%);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-up {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 960px) {
  .intro-screen {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    padding-right: 38px;
    padding-left: 38px;
  }

  .intro-screen::after {
    left: 57%;
  }

  .intro-content h1 {
    font-size: clamp(3.4rem, 7.3vw, 5.4rem);
  }

  .intro-preview {
    width: 36vw;
  }

  .preview-card {
    width: 30vw;
    min-width: 240px;
  }

  .event-panel {
    padding-right: 30px;
    padding-left: 30px;
  }
}

@media (max-width: 700px) {
  body {
    overflow-y: auto;
  }

  .topbar {
    min-height: 62px;
    padding: 0 16px;
  }

  .brand {
    gap: 8px;
    font-size: 1.05rem;
  }

  .brand-mark {
    width: 24px;
    height: 24px;
  }

  .round-button {
    width: 36px;
    height: 36px;
  }

  .scoreboard {
    min-width: 138px;
    gap: 12px;
  }

  .score-item {
    display: block;
    text-align: center;
  }

  .score-item span {
    display: block;
    font-size: 0.54rem;
    line-height: 1;
  }

  .score-item strong {
    display: block;
    margin-top: 2px;
    font-size: 1.1rem;
  }

  .score-divider {
    height: 20px;
  }

  .intro-screen.is-active {
    display: block;
    min-height: 100dvh;
    overflow-y: auto;
    padding: 104px 22px 60px;
  }

  .intro-screen::after {
    display: none;
  }

  .intro-content {
    max-width: 580px;
    margin: 0 auto;
    padding: 0;
    text-align: center;
  }

  .intro-content .eyebrow {
    justify-content: center;
    margin-bottom: 20px;
  }

  .intro-content h1 {
    font-size: clamp(3rem, 15.5vw, 5.2rem);
    line-height: 0.92;
  }

  .intro-copy {
    margin-top: 26px;
    font-size: 0.95rem;
    line-height: 1.62;
  }

  .intro-actions {
    flex-direction: column;
    gap: 17px;
    margin-top: 30px;
  }

  .intro-actions .primary-button {
    width: min(100%, 340px);
  }

  .data-note {
    justify-content: center;
    margin: 34px auto 0;
    text-align: left;
  }

  .intro-preview {
    width: min(100%, 400px);
    height: 315px;
    margin: 42px auto 0;
  }

  .preview-card {
    width: 250px;
    min-width: 0;
    height: 230px;
    padding: 20px;
  }

  .preview-card-left {
    left: 2%;
  }

  .preview-card-right {
    right: 2%;
  }

  .preview-vs {
    width: 54px;
    height: 54px;
    border-width: 5px;
  }

  .intro-disclaimer {
    position: relative;
    right: auto;
    bottom: auto;
    margin: 24px auto 0;
    padding: 0 24px;
    text-align: center;
  }

  .battle-stage {
    min-height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }

  .event-panel {
    min-height: 50dvh;
    padding: 72px 22px 23px;
  }

  .event-panel-challenger {
    padding-top: 24px;
    padding-bottom: 25px;
  }

  .event-content h2 {
    font-size: clamp(1.75rem, 8.4vw, 2.7rem);
    line-height: 1;
  }

  .event-meta {
    margin-bottom: 12px;
    font-size: 0.57rem;
  }

  .comparison-copy {
    margin: 12px 0 5px;
    font-size: 0.72rem;
  }

  .death-count {
    font-size: clamp(2.25rem, 11vw, 3.8rem);
  }

  .source-link {
    margin-top: 10px;
    font-size: 0.6rem;
  }

  .choice-controls {
    display: grid;
    grid-template-columns: 1fr 22px 1fr;
    width: min(100%, 390px);
    align-items: center;
    margin-top: 13px;
    gap: 4px;
  }

  .choice-button {
    display: flex;
    min-width: 0;
    min-height: 54px;
    gap: 7px;
    border-radius: 5px;
    padding: 6px 9px;
  }

  .choice-button::after {
    display: none;
  }

  .choice-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    font-size: 1.1rem;
  }

  .choice-button strong {
    font-size: 0.82rem;
  }

  .choice-button small {
    overflow: hidden;
    max-width: 82px;
    font-size: 0.56rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .choice-or {
    font-size: 0.54rem;
  }

  .versus-badge {
    top: 50%;
    width: 54px;
    height: 54px;
    border-width: 5px;
    font-size: 0.68rem;
  }

  .result-flash {
    width: 76px;
    height: 76px;
    border-width: 6px;
  }

  .result-icon {
    width: 42px;
    height: 42px;
  }

  .challenger-reveal {
    margin-top: 8px;
  }

  .reveal-caption {
    margin-top: 5px;
    font-size: 0.66rem;
  }

  .topography {
    width: 54vw;
    height: 54vw;
  }

  .panel-number {
    font-size: 68vw;
  }

  .game-over {
    padding: 12px;
  }

  .game-over-card {
    max-height: calc(100dvh - 24px);
    overflow: auto;
    padding: 30px 22px;
  }

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

  .game-over-actions .primary-button,
  .game-over-actions .secondary-button {
    min-height: 50px;
  }

  .final-score {
    margin: 24px 0;
  }

  .toast {
    bottom: 14px;
    max-width: calc(100% - 28px);
    text-align: center;
  }
}

@media (max-height: 720px) and (min-width: 701px) {
  .event-panel {
    padding-top: 86px;
    padding-bottom: 24px;
  }

  .event-meta {
    margin-bottom: 15px;
  }

  .comparison-copy {
    margin-top: 16px;
  }

  .choice-controls {
    margin-top: 16px;
  }

  .choice-button {
    min-height: 62px;
  }

  .source-link {
    margin-top: 14px;
  }
}

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