@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,600;1,700&display=swap');

:root {
  --paper: #f1f0ea;
  --paper-deep: #e8e7df;
  --ink: #151816;
  --muted-ink: #747a72;
  --line: #d7d7ce;
  --accent: #c8ee68;
  --accent-dark: #69872c;
  --coral: #ff8165;
  --mono: 'DM Mono', 'SFMono-Regular', Consolas, monospace;
  --body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Playfair Display', 'Iowan Old Style', Baskerville, Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.page-shell { width: min(1440px, 100%); margin: 0 auto; padding: 0 64px; }
.wordmark { display: inline-flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 800; letter-spacing: -.045em; }
.wordmark-mark { width: 23px; height: 23px; display: inline-flex; align-items: end; gap: 3px; }
.wordmark-mark i { display: block; width: 5px; background: var(--ink); border-radius: 1px 1px 0 0; transform: skewY(-14deg); }
.wordmark-mark i:nth-child(1) { height: 10px; background: var(--coral); }
.wordmark-mark i:nth-child(2) { height: 17px; background: var(--ink); }
.wordmark-mark i:nth-child(3) { height: 23px; background: var(--accent-dark); }
.intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 84px; padding: 76px 0 56px; }
.eyebrow { display: flex; align-items: center; gap: 11px; margin: 0 0 20px; color: var(--accent-dark); font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .1em; line-height: 1.2; text-transform: uppercase; }
.eyebrow-line { display: inline-block; width: 36px; height: 2px; background: currentColor; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 820px; margin-bottom: 0; font-family: var(--display); font-size: clamp(60px, 7vw, 100px); font-weight: 600; letter-spacing: -.073em; line-height: .91; }
h1 em { color: #747c6f; font-weight: 600; }
.intro-aside { align-self: end; max-width: 390px; padding: 6px 0 4px 36px; border-left: 2px solid var(--coral); }
.aside-label { margin-bottom: 15px; color: var(--ink); font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.aside-copy { max-width: 365px; margin-bottom: 30px; color: #777c74; font-size: 17px; line-height: 1.6; }
.metric-row { display: flex; gap: 36px; }
.metric { display: flex; align-items: baseline; gap: 9px; }
.metric strong { color: var(--ink); font-family: var(--display); font-size: 34px; font-weight: 600; letter-spacing: -.06em; }
.metric span { color: #7e847b; font-family: var(--mono); font-size: 13px; line-height: 1.25; text-transform: uppercase; }

.tournament-section { padding: 16px 0 118px; scroll-margin-top: 30px; }
.tournament-setup { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.setup-copy { grid-column: 2 / span 2; text-align: center; }
.world-choice { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.world-card { grid-column: span 2; }
.setup-copy p { max-width: 500px; margin: 0 auto; color: #777c74; font-size: 17px; line-height: 1.6; }
.setup-copy p strong { color: var(--ink); font-size: 20px; font-weight: 700; }
.world-card { position: relative; min-height: 246px; display: flex; flex-direction: column; align-items: start; padding: 29px 30px 27px; overflow: hidden; border: 1px solid transparent; text-align: left; cursor: pointer; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.world-card::before { position: absolute; right: -42px; bottom: -68px; width: 220px; height: 220px; border: 1px solid currentColor; border-radius: 50%; opacity: .17; content: ''; }
.world-card::after { position: absolute; right: 21px; bottom: 20px; width: 104px; height: 104px; border: 1px solid currentColor; border-radius: 50%; opacity: .14; content: ''; }
.world-card:hover { transform: translateY(-5px); box-shadow: 8px 8px 0 var(--accent); }
.world-card:active { transform: translateY(-1px); }
.world-dark { background: #232824; color: #d7ddd2; border-color: #232824; }
.world-light { background: #dfded6; color: #262b27; border-color: #d1d1c8; }
.choice-index { position: relative; z-index: 1; margin-bottom: 38px; color: var(--coral); font-family: var(--mono); font-size: 14px; }
.world-light .choice-index { color: var(--accent-dark); }
.world-card-title { position: relative; z-index: 1; font-family: var(--display); font-size: 34px; letter-spacing: -.065em; }
.world-card-description { position: relative; z-index: 1; max-width: 245px; margin-top: 9px; color: #aab4a5; font-size: 16px; line-height: 1.5; }
.world-light .world-card-description { color: #6f756d; }
.world-card-bottom { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; width: 100%; margin-top: auto; padding-top: 25px; color: #a7b29e; font-family: var(--mono); font-size: 14px; text-transform: uppercase; }
.world-light .world-card-bottom { color: #6d756b; }
.choice-arrow { margin-left: auto; color: var(--accent); font-size: 24px; }
.world-light .choice-arrow { color: var(--coral); }

.tournament-arena { margin-top: 64px; border-top: 1px solid var(--line); }
.arena-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 65px; margin-top: 30px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.arena-status { display: flex; align-items: center; gap: 10px; color: #777e74; font-family: var(--mono); font-size: 13px; text-transform: uppercase; }
.live-ring { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 5px rgba(255, 129, 101, .14); }
.toolbar-divider { color: #aeb2a8; }
.arena-actions { display: flex; align-items: center; gap: 27px; }
.reveal-toggle { display: flex; align-items: center; gap: 10px; color: #777e74; font-family: var(--mono); font-size: 13px; text-transform: uppercase; cursor: pointer; }
.reveal-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { position: relative; width: 34px; height: 19px; border: 1px solid #aeb3a8; border-radius: 20px; transition: background .2s, border-color .2s; }
.toggle-track::after { position: absolute; top: 4px; left: 4px; width: 9px; height: 9px; border-radius: 50%; background: #8f978c; content: ''; transition: transform .2s, background .2s; }
.reveal-toggle input:checked + .toggle-track { border-color: var(--accent-dark); background: var(--accent-dark); }
.reveal-toggle input:checked + .toggle-track::after { background: var(--paper); transform: translateX(15px); }
.reveal-toggle input:focus-visible + .toggle-track { outline: 3px solid var(--coral); outline-offset: 3px; }
.arena-intro { display: flex; align-items: end; justify-content: space-between; padding: 25px 0 18px; }
.round-label { display: block; margin-bottom: 7px; color: var(--accent-dark); font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.arena-intro h3 { margin: 0; font-family: var(--display); font-size: 42px; font-weight: 600; letter-spacing: -.07em; line-height: 1; }
.keyboard-hint { display: flex; align-items: center; gap: 8px; color: #858c82; font-family: var(--mono); font-size: 13px; text-transform: uppercase; }
.keyboard-hint kbd { display: inline-grid; min-width: 29px; height: 29px; place-items: center; border: 1px solid #c1c5bb; border-radius: 3px; background: #e8e7df; color: var(--ink); font-family: var(--mono); font-size: 15px; }
.contender-grid { display: grid; grid-template-columns: minmax(0, 1fr) 80px minmax(0, 1fr); align-items: center; gap: 22px; transition: opacity .2s ease, filter .2s ease, transform .2s ease; }
.contender-grid.is-transitioning { opacity: 0; filter: blur(4px); transform: translateY(6px) scale(.99); }
.contender-grid.is-loading { opacity: 1; filter: none; transform: none; transition: none; }
.contender-placeholder { height: var(--contender-height, 370px); border: 1px solid #d0d2c8; background: #e9e8e1; }
.neither-placeholder { width: 80px; height: 124px; justify-self: center; border: 1px dashed #d0d2c8; background: #e9e8e1; }
.neither-button { width: 80px; min-height: 124px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; justify-self: center; padding: 13px 7px; border: 1px dashed #b7bcb1; background: transparent; color: #858c82; font-family: var(--mono); text-transform: uppercase; cursor: pointer; transition: transform .25s ease, border-color .25s, background .25s, color .25s, box-shadow .25s; }
.neither-button:hover { border-color: var(--coral); background: #e8e7df; color: var(--ink); transform: translateY(-3px); box-shadow: 0 8px 16px rgba(53, 60, 45, .08); }
.neither-button.picked { border-color: var(--coral); background: #e8e7df; color: var(--ink); box-shadow: 4px 4px 0 var(--coral); transform: translateY(-2px); }
.neither-mark { color: var(--coral); font-family: var(--body); font-size: 27px; line-height: 1; }
.neither-label { font-size: 12px; font-weight: 500; letter-spacing: .08em; }
.neither-action { color: #9a9f96; font-size: 9px; letter-spacing: .04em; line-height: 1.2; text-align: center; }
.neither-button kbd { display: inline-grid; width: 22px; height: 22px; margin-top: 5px; place-items: center; border: 1px solid #c1c5bb; color: var(--ink); font-size: 12px; }
.contender-card { --scheme-bg: #1e1e2e; --scheme-fg: #cdd6f4; --scheme-muted: #7f849c; --scheme-red: #f38ba8; --scheme-yellow: #f9e2af; --scheme-green: #a6e3a1; --scheme-cyan: #94e2d5; --scheme-blue: #89b4fa; --scheme-magenta: #cba6f7; position: relative; min-width: 0; padding: 0; border: 1px solid #d0d2c8; background: #e9e8e1; text-align: left; cursor: pointer; transition: transform .25s ease, border-color .25s, box-shadow .25s, opacity .25s; }
.contender-card:hover { border-color: #91998a; transform: translateY(-5px); box-shadow: 0 12px 24px rgba(53, 60, 45, .1); }
.contender-card:focus-visible { outline-offset: 5px; }
.contender-card.picked { border-color: var(--accent-dark); box-shadow: 8px 8px 0 var(--accent); transform: translateY(-3px); }
.contender-card.eliminated { opacity: .42; transform: scale(.985); }
.contender-card.eliminated .contender-terminal { filter: saturate(.45); }
.contender-top { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 15px; color: #858c82; font-family: var(--mono); font-size: 13px; letter-spacing: .05em; text-transform: uppercase; }
.contender-number { color: var(--coral); }
.contender-choice { color: #858c82; }
.contender-choice kbd { display: inline-grid; width: 27px; height: 25px; margin-left: 7px; place-items: center; border: 1px solid #bfc3b8; color: var(--ink); font-size: 14px; }
.contender-terminal { min-height: 236px; margin: 0 12px; padding: 20px 21px; overflow: hidden; background: var(--scheme-bg); color: var(--scheme-fg); font-family: var(--mono); font-size: clamp(13px, 1.05vw, 16px); line-height: 1.65; }
.contender-terminal-bar { display: flex; gap: 6px; margin-bottom: 20px; opacity: .9; }
.contender-terminal-bar i { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--scheme-red); }
.contender-terminal-bar i:nth-child(2) { background: var(--scheme-yellow); }
.contender-terminal-bar i:nth-child(3) { background: var(--scheme-green); }
.contender-line { overflow-wrap: anywhere; }
.contender-user { color: var(--scheme-green); }
.contender-path { color: var(--scheme-blue); }
.contender-muted { color: var(--scheme-muted); }
.contender-green { color: var(--scheme-green); }
.contender-cyan { color: var(--scheme-cyan); }
.contender-yellow { color: var(--scheme-yellow); }
.contender-magenta { color: var(--scheme-magenta); }
.contender-red { color: var(--scheme-red); }
.contender-terminal-rule { width: 100%; height: 1px; margin: 14px 0; background: color-mix(in srgb, var(--scheme-fg) 15%, transparent); }
.contender-prompt { color: var(--scheme-yellow); }
.contender-cursor { display: inline-block; width: 9px; height: 16px; margin-left: 6px; background: var(--scheme-green); vertical-align: -2px; }
.contender-bottom { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 19px 20px 20px; }
.contender-name { margin: 0; color: var(--ink); font-size: 18px; font-weight: 800; letter-spacing: -.045em; }
.contender-type { margin: 6px 0 0; color: #777e74; font-family: var(--mono); font-size: 13px; text-transform: uppercase; }
.contender-swatches { display: flex; gap: 4px; }
.contender-swatches i { display: block; width: 13px; height: 13px; border-radius: 1px; }
.contender-swatches i:nth-child(1) { background: var(--scheme-red); }
.contender-swatches i:nth-child(2) { background: var(--scheme-yellow); }
.contender-swatches i:nth-child(3) { background: var(--scheme-green); }
.contender-swatches i:nth-child(4) { background: var(--scheme-blue); }
.contender-swatches i:nth-child(5) { background: var(--scheme-magenta); }
.contender-swatches i:nth-child(6) { background: var(--scheme-cyan); }
.champion-screen { padding: 62px 0 20px; text-align: center; }
.champion-mark { display: grid; width: 54px; height: 54px; margin: 0 auto 24px; place-items: center; border: 1px solid var(--coral); color: var(--coral); font-size: 25px; transform: rotate(45deg); }
.champion-mark::first-letter { transform: rotate(-45deg); }
.champion-screen .round-label { margin-bottom: 14px; }
.champion-screen h3 { margin: 0; font-family: var(--display); font-size: 60px; font-weight: 600; letter-spacing: -.08em; line-height: 1; }
.champion-card { max-width: 560px; margin: 0 auto; text-align: left; }
.champion-card .contender-terminal { min-height: 190px; }
.no-champion { display: grid; min-height: 190px; place-items: center; align-content: center; gap: 15px; padding: 35px 24px; border: 1px dashed #bfc3b8; background: #e9e8e1; color: #777e74; text-align: center; }
.no-champion-mark { color: var(--coral); font-family: var(--body); font-size: 42px; line-height: 1; }
.no-champion p { margin: 0; font-family: var(--mono); font-size: 13px; text-transform: uppercase; }
.champion-actions { display: flex; align-items: center; justify-content: center; gap: 28px; margin-top: 29px; }
.primary-button { padding: 14px 18px 14px 21px; border: 1px solid var(--ink); background: var(--ink); color: var(--accent); font-family: var(--mono); font-size: 14px; text-transform: uppercase; cursor: pointer; }
.primary-button span { display: inline-block; margin-left: 11px; color: var(--coral); font-size: 20px; vertical-align: -2px; }
.primary-button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.site-footer { display: flex; align-items: center; justify-content: center; min-height: 112px; margin: 0 -64px; padding: 0 64px; border-top: 1px solid var(--line); }
.site-footer p { margin: 0; color: #858c82; font-family: var(--display); font-size: 17px; font-style: italic; }
.site-footer p a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--coral); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.site-footer p a:hover { color: var(--accent-dark); }
@media (max-width: 1050px) {
  .page-shell { padding: 0 36px; }
  .intro { gap: 46px; }
  .tournament-setup { gap: 34px; }
  .site-footer { margin-left: -36px; margin-right: -36px; padding-left: 36px; padding-right: 36px; }
}

@media (max-width: 760px) {
  .page-shell { padding: 0 20px; }
  .intro { display: block; padding: 58px 0 42px; }
  h1 { font-size: clamp(50px, 13vw, 74px); }
  .intro-aside { max-width: 520px; margin-top: 49px; padding: 24px 0 0; border-top: 2px solid var(--coral); border-left: 0; }
  .aside-copy { font-size: 16px; }
  .tournament-section { padding: 22px 0 82px; }
  .tournament-setup { display: block; }
  .setup-copy { text-align: left; }
  .setup-copy p { max-width: 560px; margin-left: 0; font-size: 16px; }
  .world-choice { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 29px; }
  .world-card { grid-column: span 1; }
  .world-card { min-height: 220px; padding: 25px; }
  .choice-index { margin-bottom: 31px; }
  .tournament-arena { margin-top: 48px; }
  .arena-toolbar { align-items: start; flex-direction: column; gap: 17px; padding: 18px 0; }
  .arena-actions { width: 100%; justify-content: space-between; gap: 18px; }
  .arena-intro { align-items: start; flex-direction: column; gap: 15px; padding-top: 20px; padding-bottom: 15px; }
  .arena-intro h3 { font-size: 38px; }
  .keyboard-hint { align-self: end; }
  .contender-grid { grid-template-columns: 1fr; gap: 16px; }
  .neither-button { width: 100%; min-height: 64px; flex-direction: row; gap: 10px; }
  .neither-action { margin-left: 3px; }
  .neither-button kbd { margin-top: 0; margin-left: auto; }
  .neither-placeholder { width: 100%; height: 64px; }
  .contender-terminal { min-height: 220px; }
  .champion-screen h3 { font-size: 50px; }
  .champion-actions { align-items: stretch; flex-direction: column; gap: 20px; }
  .primary-button { width: fit-content; margin: 0 auto; }
  .site-footer { margin-left: -20px; margin-right: -20px; padding: 27px 20px; }
}

@media (max-width: 600px) {
  .world-choice { grid-template-columns: 1fr; }
  .world-card { min-height: 205px; }
}

@media (max-width: 400px) {
  h1 { font-size: 48px; }
  .metric-row { gap: 23px; }
  .metric strong { font-size: 30px; }
  .arena-intro h3 { font-size: 34px; }
  .arena-actions { align-items: start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .contender-card, .world-card, .neither-button, .contender-grid { transition: none; }
  .contender-grid.is-transitioning { opacity: 1; filter: none; transform: none; }
}
