:root {
  color-scheme: light;
  --paper: #f2f0ea;
  --ink: #151719;
  --muted: #666a6c;
  --line: #c9c8c2;
  --white: #ffffff;
  --acid: #b9ef45;
  --coral: #ff6d56;
  --cyan: #55c5d4;
  --shadow: 0 12px 30px rgba(21, 23, 25, 0.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: 0; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }

.topbar { height: 64px; padding: 0 clamp(18px, 4vw, 64px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; background: rgba(242, 240, 234, 0.96); backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 760; }
.brand-mark { width: 25px; height: 25px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; transform: skewY(-18deg); }
.brand-mark i:nth-child(1) { background: var(--ink); }
.brand-mark i:nth-child(2) { background: var(--coral); }
.brand-mark i:nth-child(3) { background: var(--cyan); }
nav { display: flex; align-items: stretch; height: 100%; gap: 4px; }
nav a { min-width: 90px; display: grid; place-items: center; padding: 0 12px; text-decoration: none; font-size: 14px; color: var(--muted); border-bottom: 3px solid transparent; }
nav a.active { color: var(--ink); border-bottom-color: var(--ink); }
.season-chip { justify-self: end; border: 1px solid var(--ink); padding: 5px 9px; font: 700 11px/1 ui-monospace, monospace; text-transform: uppercase; }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 12px; }
.language-switch { display: flex; border: 1px solid var(--ink); }
.language-switch button { min-width: 44px; height: 28px; padding: 0 8px; border: 0; border-right: 1px solid var(--ink); background: transparent; color: var(--ink); font-size: 11px; font-weight: 750; }
.language-switch button:last-child { border-right: 0; }
.language-switch button[aria-pressed="true"] { background: var(--ink); color: var(--white); }

main { min-height: calc(100vh - 120px); }
.view { max-width: 1480px; margin: 0 auto; padding: clamp(32px, 5vw, 76px) clamp(18px, 4vw, 64px) 80px; }
.intro-band { min-height: min(560px, 65vh); display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 7vw; align-items: center; border-bottom: 1px solid var(--ink); }
.eyebrow { margin: 0 0 18px; font: 700 12px/1.2 ui-monospace, monospace; text-transform: uppercase; color: var(--muted); }
h1 { margin: 0; font-size: clamp(52px, 7vw, 108px); line-height: 0.92; font-weight: 820; letter-spacing: 0; }
.intro-copy { align-self: end; margin-bottom: 76px; font-size: clamp(18px, 2vw, 25px); line-height: 1.45; }
.command-link { display: inline-flex; gap: 20px; align-items: center; margin-top: 28px; padding-bottom: 7px; border-bottom: 2px solid var(--ink); text-decoration: none; font-size: 15px; font-weight: 750; }
.section-head { display: flex; justify-content: space-between; align-items: end; margin: 48px 0 20px; }
.section-head h2 { margin: 0; font-size: 30px; }
.section-head p { margin: 0; color: var(--muted); }
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.game-card { min-height: 290px; padding: 22px; display: flex; flex-direction: column; border: 1px solid var(--ink); background: var(--white); box-shadow: var(--shadow); }
.game-card:nth-child(3n+1) { border-top: 8px solid var(--acid); }
.game-card:nth-child(3n+2) { border-top: 8px solid var(--coral); }
.game-card:nth-child(3n) { border-top: 8px solid var(--cyan); }
.game-card .meta { display: flex; justify-content: space-between; font: 700 11px/1 ui-monospace, monospace; text-transform: uppercase; color: var(--muted); }
.game-card:only-child { grid-column: 1 / -1; }
.game-card h3 { margin: 36px 0 12px; font-size: 34px; }
.game-card p { margin: 0 0 24px; line-height: 1.5; color: var(--muted); }
.game-card .card-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; font-size: 13px; }
.build-list { display: grid; gap: 0; margin: 0 0 18px; border-top: 1px solid var(--line); }
.build-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); }
.build-row strong, .build-row small { display: block; }
.build-row strong { font-size: 13px; }
.build-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.build-row a { border: 1px solid var(--ink); padding: 7px 11px; font: 700 11px/1 ui-monospace, monospace; text-transform: uppercase; }
.catalog-brief { margin: 0 0 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.catalog-brief summary { padding: 13px 0; cursor: pointer; font-size: 13px; font-weight: 760; }
.catalog-brief .task-brief, .catalog-brief > div { border-top: 1px solid var(--line); }
.task-brief { padding: 24px 0; }
.brief-heading { display: grid; grid-template-columns: minmax(220px, 0.75fr) 1.25fr; gap: 36px; align-items: end; }
.brief-heading h3 { margin: 7px 0 0; font-size: 28px; }
.brief-heading p, .brief-goal p, .brief-columns p { margin: 0; color: var(--muted); line-height: 1.55; }
.brief-kicker { font: 700 11px/1.2 ui-monospace, monospace; text-transform: uppercase; color: var(--coral); }
.brief-goal { display: grid; grid-template-columns: minmax(160px, 0.3fr) 1fr; gap: 36px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.brief-goal strong, .brief-columns strong { font: 760 12px/1.2 ui-monospace, monospace; text-transform: uppercase; }
.brief-columns { display: grid; grid-template-columns: 1.4fr 0.6fr; gap: 44px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.brief-columns ul { margin: 14px 0 0; padding-left: 20px; color: var(--muted); line-height: 1.55; }
.brief-columns li + li { margin-top: 7px; }
.brief-columns p { margin-top: 14px; }

.arena-head { display: grid; grid-template-columns: 1fr 420px; gap: 40px; align-items: end; margin-bottom: 36px; }
.arena-head h1, .page-title h1 { font-size: clamp(45px, 6vw, 84px); }
.arena-head > p, .page-title > p:last-child { color: var(--muted); font-size: 18px; line-height: 1.5; }
.match-meta { height: 42px; display: flex; justify-content: space-between; align-items: center; font: 700 12px/1 ui-monospace, monospace; text-transform: uppercase; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--ink); background: transparent; font-size: 20px; }
.arena-brief { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.sequence-launch { min-height: 220px; display: grid; grid-template-columns: auto 1fr auto; gap: 32px; align-items: center; padding: 34px 0; }
.sequence-launch[hidden], .vote-review[hidden] { display: none; }
.sequence-steps { display: flex; align-items: center; gap: 9px; }
.sequence-steps span { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--muted); font: 800 13px/1 ui-monospace, monospace; }
.sequence-steps span.active { border-color: var(--ink); background: var(--acid); color: var(--ink); }
.sequence-steps span.complete { border-color: var(--ink); background: var(--ink); color: var(--white); }
.sequence-steps i { width: 32px; height: 1px; background: var(--line); }
.sequence-launch p { max-width: 560px; margin: 0; color: var(--muted); line-height: 1.55; }
.primary-command { min-height: 48px; padding: 0 24px; border: 1px solid var(--ink); background: var(--ink); color: var(--white); font-weight: 760; }
.vote-review { padding-top: 30px; border-top: 1px solid var(--ink); }
.ready-note { margin: 0 0 18px; font-size: 20px; font-weight: 720; }
.replay-controls { display: flex; gap: 8px; margin-bottom: 12px; }
.replay-controls button { min-height: 38px; padding: 0 14px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.vote-bar { display: grid; grid-template-columns: 1fr auto 1fr auto auto; gap: 8px; margin-top: 14px; }
.vote-bar button { min-height: 46px; border: 1px solid var(--ink); background: var(--ink); color: var(--white); padding: 10px 15px; font-weight: 750; }
.vote-bar .secondary { background: var(--white); color: var(--ink); }
.vote-bar .text-button { background: transparent; color: var(--muted); border-color: var(--line); font-size: 12px; }
.comment-field { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin-top: 12px; color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 700; }
.comment-field input { min-width: 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 12px 2px; text-transform: none; color: var(--ink); }
.empty-state { padding: 60px 24px; border: 1px dashed var(--muted); font-size: 22px; line-height: 1.5; }
.game-stage { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; background: #070a0d; }
.game-stage[hidden] { display: none; }
.stage-toolbar { flex: 0 0 58px; min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 8px clamp(12px, 2vw, 28px); background: var(--ink); color: var(--white); }
.stage-toolbar > div:first-child { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.stage-toolbar strong { font-size: 15px; }
.stage-toolbar span { color: #b9bcbc; font: 700 11px/1 ui-monospace, monospace; text-transform: uppercase; }
.stage-actions { display: flex; gap: 8px; }
.stage-actions button { min-height: 38px; border: 1px solid #5f6264; padding: 0 14px; color: var(--white); font-weight: 720; }
.stage-exit { background: transparent; }
.stage-next { background: var(--acid); border-color: var(--acid) !important; color: var(--ink) !important; }
.game-stage iframe { flex: 1 1 auto; width: 100%; min-height: 0; display: block; border: 0; background: #05070a; }
body.stage-open { overflow: hidden; }

.page-title { padding: 6vh 0 60px; border-bottom: 1px solid var(--ink); }
.leaderboard-list { margin-top: 30px; }
.board { margin-bottom: 46px; }
.board-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 12px; }
.board-head h2 { margin: 0; font-size: 30px; }
.board-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--ink); }
.board-table th, .board-table td { padding: 15px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.board-table th { font: 700 11px/1 ui-monospace, monospace; text-transform: uppercase; color: var(--muted); }
.board-table td:first-child { width: 55px; font-weight: 800; }
.board-table td:nth-child(3) { font: 800 18px/1 ui-monospace, monospace; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; }
.about-grid section { min-height: 310px; padding: 32px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-grid section:nth-child(even) { border-right: 0; }
.about-grid span { font: 800 12px/1 ui-monospace, monospace; color: var(--coral); }
.about-grid h2 { margin-top: 80px; font-size: 29px; }
.about-grid p { max-width: 520px; color: var(--muted); line-height: 1.65; }
footer { min-height: 56px; padding: 0 clamp(18px, 4vw, 64px); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 22px; color: var(--muted); font-size: 12px; }
footer a { margin-left: auto; }

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; backdrop-filter: none; }
  nav { position: fixed; bottom: 0; left: 0; right: 0; height: 58px; background: var(--paper); border-top: 1px solid var(--line); z-index: 30; justify-content: stretch; }
  nav a { flex: 1; min-width: 0; padding: 0 5px; font-size: 12px; border-bottom: 0; border-top: 3px solid transparent; }
  nav a.active { border-top-color: var(--ink); }
  .season-chip { display: none; }
  .intro-band { min-height: auto; grid-template-columns: 1fr; padding: 40px 0; gap: 54px; }
  .intro-copy { align-self: auto; margin: 0; }
  .game-grid { grid-template-columns: 1fr; }
  .arena-head { grid-template-columns: 1fr; }
  .brief-heading, .brief-goal, .brief-columns { grid-template-columns: 1fr; gap: 12px; }
  .sequence-launch { grid-template-columns: 1fr; gap: 18px; }
  .vote-bar { grid-template-columns: 1fr 1fr; }
  .vote-bar button:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .vote-bar .text-button { min-height: 36px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-grid section { border-right: 0; }
  footer { margin-bottom: 58px; }
}

@media (max-width: 520px) {
  .view { padding-top: 30px; }
  h1 { font-size: 49px; }
  .intro-copy { font-size: 18px; }
  .section-head { align-items: start; gap: 12px; }
  .game-card { min-height: 250px; }
  .language-switch button { min-width: 40px; padding: 0 6px; }
  .stage-toolbar { min-height: 104px; align-items: stretch; flex-direction: column; }
  .stage-toolbar > div:first-child { justify-content: space-between; }
  .stage-actions { display: grid; grid-template-columns: auto 1fr; }
  .stage-actions button { min-height: 42px; padding: 0 10px; font-size: 12px; }
  .comment-field { grid-template-columns: 1fr; }
  .board-table th:nth-child(4), .board-table td:nth-child(4), .board-table th:nth-child(5), .board-table td:nth-child(5) { display: none; }
}
