:root {
  color-scheme: dark;
  --ink: #090c0b;
  --ink-soft: #111513;
  --paper: #f2f4ee;
  --paper-2: #dfe3da;
  --line: #303631;
  --line-light: #c8cdc4;
  --muted: #a7afa7;
  --acid: #b7ff38;
  --coral: #ff5b45;
  --cyan: #68d7e8;
  --white: #f8faf5;
  --font-sans: Inter, "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-sans);
  letter-spacing: 0;
}

button,
input,
select { font: inherit; letter-spacing: 0; }

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

a { color: inherit; }

[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  transform: translateY(-150%);
  background: var(--acid);
  color: var(--ink);
  font-weight: 800;
}

.skip-link:focus { transform: translateY(0); }

.duel-header {
  position: relative;
  z-index: 20;
  height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--ink);
  padding: 0 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  text-decoration: none;
  font-weight: 900;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--acid);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
}

.brand__name { font-size: 13px; }

.duel-header__status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.duel-header__status > span {
  width: 7px;
  height: 7px;
  background: var(--acid);
  box-shadow: 0 0 16px rgba(183, 255, 56, .65);
}

.duel-header__api {
  justify-self: end;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--acid);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
}

.duel-hero {
  position: relative;
  isolation: isolate;
  min-height: 680px;
  height: calc(100svh - 88px);
  max-height: 860px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: 1fr auto;
  gap: 24px;
  padding: 72px 4.5% 0;
  overflow: hidden;
}

.duel-hero__image,
.duel-hero__shade {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.duel-hero__image {
  background-image: url("/signal-observatory.jpg");
  background-position: center;
  background-size: cover;
}

.duel-hero__shade {
  z-index: -1;
  background: rgba(4, 7, 6, .42);
}

.duel-hero__content {
  grid-column: 1 / span 7;
  align-self: center;
  max-width: 850px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.duel-hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: 66px;
  line-height: .98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.duel-hero__lede {
  max-width: 700px;
  margin: 26px 0 0;
  color: #d4d9d1;
  font-size: 18px;
  line-height: 1.65;
}

.duel-hero__rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 660px;
  margin: 38px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, .28);
}

.duel-hero__rules li {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-right: 1px solid rgba(255, 255, 255, .18);
}

.duel-hero__rules li:last-child { border-right: 0; }

.duel-hero__rules strong {
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--acid);
}

.duel-hero__rules span {
  max-width: 105px;
  color: #c5ccc3;
  font-size: 12px;
  line-height: 1.35;
}

.matchmaker {
  grid-column: 9 / -1;
  align-self: center;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-top: 4px solid var(--acid);
  background: rgba(9, 12, 11, .9);
  backdrop-filter: blur(12px);
}

.matchmaker header {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 24px;
}

.matchmaker header span,
.workspace-code span,
.duel-versus article > span,
.result-integrity span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
}

.matchmaker header strong { font-size: 24px; }

.matchmaker label,
.challenger-identity label,
.case-field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.matchmaker input,
.challenger-identity input,
.case-field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: #161b18;
  color: var(--white);
  padding: 0 13px;
}

.matchmaker input:focus,
.challenger-identity input:focus,
.case-field select:focus { border-color: var(--acid); }

.matchmaker button,
.gauntlet__submit button,
.invite-console button,
.result-actions button {
  min-height: 48px;
  border: 0;
  border-radius: 0;
  background: var(--acid);
  color: var(--ink);
  padding: 0 18px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 900;
}

.matchmaker button { width: 100%; }

button:disabled { cursor: wait; opacity: .58; }

.matchmaker__note,
.form-status {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.form-status { min-height: 17px; color: var(--coral); }

.form-trap {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.network-pulse {
  grid-column: 1 / -1;
  align-self: end;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 -5% 0;
  padding: 0 5%;
  border-top: 1px solid rgba(255, 255, 255, .2);
  background: rgba(9, 12, 11, .88);
}

.network-pulse > div {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-right: 1px solid rgba(255, 255, 255, .15);
  padding: 0 24px;
}

.network-pulse > div:last-child { border-right: 0; }

.network-pulse dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.network-pulse dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
}

.has-active-duel .duel-hero {
  min-height: 430px;
  height: 430px;
  padding-top: 48px;
}

.has-active-duel .duel-hero__content { grid-column: 1 / span 9; }
.has-active-duel .duel-hero h1 { max-width: 1000px; font-size: 52px; }
.has-active-duel .duel-hero__lede { max-width: 850px; margin-top: 18px; }
.has-active-duel .duel-hero__rules { display: none; }

.invite-stage,
.duel-ledger {
  width: min(1240px, calc(100% - 64px));
  margin: 0 auto;
  padding: 90px 0;
}

.duel-workspace {
  width: 100%;
  margin: 0;
  padding: 90px max(32px, calc((100% - 1240px) / 2));
  color: var(--ink);
  background: var(--paper);
}

.workspace-header,
.result-stage > header,
.duel-ledger > header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
  margin-bottom: 40px;
}

.workspace-header h2,
.invite-stage h2,
.result-stage h2,
.duel-ledger h2 {
  max-width: 780px;
  margin: 0;
  font-size: 42px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.workspace-code,
.result-integrity {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.workspace-code strong {
  font-family: var(--font-mono);
  font-size: 20px;
}

.duel-versus {
  display: grid;
  grid-template-columns: 1fr 90px 1fr;
  min-height: 190px;
  background: var(--ink-soft);
  color: var(--white);
  border-top: 5px solid var(--acid);
}

.duel-versus article {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 34px 42px;
}

.duel-versus article:last-child { text-align: right; }

.duel-versus article strong { font-size: 28px; overflow-wrap: anywhere; }

.duel-versus article small { color: var(--muted); }

.duel-versus article b {
  margin-top: 10px;
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 10px;
}

.duel-versus > div {
  display: grid;
  place-items: center;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 900;
}

.challenger-identity {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 32px;
  margin-top: 28px;
  background: var(--ink-soft);
}

.challenger-identity label { margin: 0; }

.gauntlet__cases {
  display: grid;
  gap: 22px;
  margin-top: 28px;
}

.duel-case {
  border: 1px solid var(--line-light);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.duel-case__header {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  align-items: center;
  min-height: 72px;
  border-bottom: 1px solid var(--line-light);
}

.duel-case__header > span {
  align-self: stretch;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 900;
}

.duel-case__header h3 {
  margin: 0;
  padding: 0 22px;
  font-size: 21px;
}

.duel-case__header small {
  padding-right: 22px;
  color: #656d66;
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
}

.duel-case__brief {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  padding: 28px;
  border-bottom: 1px solid var(--line-light);
}

.duel-case__brief p { margin: 0; line-height: 1.6; }

.duel-policy {
  border-left: 4px solid var(--coral);
  padding-left: 18px;
}

.duel-policy span {
  display: block;
  margin-bottom: 7px;
  color: #6e756f;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 900;
}

.duel-evidence {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line-light);
}

.duel-evidence li {
  min-height: 150px;
  padding: 18px;
  border-right: 1px solid var(--line-light);
}

.duel-evidence li:last-child { border-right: 0; }

.duel-evidence strong {
  display: block;
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 11px;
}

.duel-evidence p { margin: 14px 0 0; font-size: 12px; line-height: 1.55; }

.duel-case__answer { padding: 28px; }

.decision-segment {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: 48px;
  margin-bottom: 22px;
  border: 1px solid var(--ink);
}

.decision-segment label { position: relative; cursor: pointer; }

.decision-segment input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.decision-segment span {
  height: 100%;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 900;
}

.decision-segment label:last-child span { border-right: 0; }

.decision-segment input:checked + span { background: var(--ink); color: var(--acid); }

.answer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 18px;
}

.critical-field fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.critical-field legend,
.case-field > span,
.confidence-field > span {
  display: block;
  margin-bottom: 9px;
  color: #646c65;
  font-size: 11px;
  font-weight: 800;
}

.critical-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 48px;
  border: 1px solid var(--line-light);
}

.critical-options label { position: relative; cursor: pointer; }

.critical-options input { position: absolute; opacity: 0; }

.critical-options span {
  height: 100%;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line-light);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
}

.critical-options label:last-child span { border-right: 0; }

.critical-options input:checked + span { background: var(--coral); color: #fff; }

.confidence-field {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.confidence-field output { font-family: var(--font-mono); font-weight: 900; }

.confidence-field input { grid-column: 1 / -1; width: 100%; accent-color: var(--ink); }

.gauntlet__submit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  margin-top: 28px;
  padding: 26px 28px;
  background: var(--ink);
  color: var(--white);
}

.gauntlet__submit div { display: grid; gap: 7px; }

.gauntlet__submit strong { font-size: 14px; }

.gauntlet__submit span { color: var(--muted); font-size: 11px; }

.invite-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  border-top: 1px solid var(--line);
}

.invite-stage > div:first-child > p:last-child { color: var(--muted); line-height: 1.7; }

.invite-console {
  display: grid;
  grid-template-columns: 1fr auto auto;
  border: 1px solid var(--line);
}

.invite-console code {
  min-width: 0;
  align-self: center;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 18px;
  color: var(--acid);
  white-space: nowrap;
}

.invite-console button { border-left: 1px solid var(--ink); }

.invite-console button:last-child { background: var(--coral); color: #fff; }

.invite-prompt {
  grid-column: 2;
  margin: -32px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
}

.result-stage {
  width: 100%;
  padding: 90px max(32px, calc((100% - 1240px) / 2));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ink-soft);
}

.result-integrity code {
  max-width: 280px;
  overflow: hidden;
  color: var(--acid);
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.score-plate {
  min-height: 250px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  gap: 14px 28px;
  padding: 42px;
  border-right: 1px solid var(--line);
}

.score-plate:last-child { border-right: 0; }

.score-plate.is-winner { box-shadow: inset 0 5px 0 var(--acid); }

.score-plate > span { color: var(--muted); font-family: var(--font-mono); font-size: 10px; }

.score-plate h3 { grid-column: 1; margin: 0; font-size: 28px; overflow-wrap: anywhere; }

.score-plate p { grid-column: 1; margin: 0; color: var(--muted); }

.score-plate strong {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 72px;
}

.result-fingerprints {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  margin-top: 32px;
}

.fingerprint {
  display: grid;
  gap: 13px;
}

.fingerprint h3 { margin: 0 0 5px; font-size: 15px; }

.fingerprint-row {
  display: grid;
  grid-template-columns: 110px 1fr 42px;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.fingerprint-row i { height: 6px; background: var(--line); }

.fingerprint-row i span { display: block; height: 100%; background: var(--acid); }

.fingerprint-row b { color: var(--white); font-family: var(--font-mono); text-align: right; }

.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 42px;
}

.result-actions button:last-child { background: transparent; border: 1px solid var(--line); color: var(--white); }

.duel-ledger > header a {
  color: var(--acid);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
}

.duel-ledger ol { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }

.duel-ledger li {
  min-height: 82px;
  display: grid;
  grid-template-columns: 110px 1fr 80px 40px 80px 1fr auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.duel-ledger li strong { color: var(--white); }

.duel-ledger li b { color: var(--acid); font-family: var(--font-mono); font-size: 18px; }

.duel-ledger li a { color: var(--acid); font-family: var(--font-mono); font-size: 10px; }

.duel-ledger .ledger-empty { display: flex; justify-content: center; text-align: center; }

.duel-footer {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 4.5%;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.duel-footer a:first-child { color: var(--white); font-weight: 900; text-decoration: none; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

@media (max-width: 1100px) {
  .duel-hero h1 { font-size: 54px; }
  .duel-hero__content { grid-column: 1 / span 7; }
  .matchmaker { grid-column: 8 / -1; }
  .answer-grid { grid-template-columns: 1fr 1fr; }
  .duel-evidence { grid-template-columns: repeat(3, 1fr); }
  .duel-evidence li { border-bottom: 1px solid var(--line-light); }
  .duel-ledger li { grid-template-columns: 90px 1fr 60px 30px 60px 1fr auto; }
}

@media (max-width: 820px) {
  .duel-header { height: 58px; grid-template-columns: 1fr auto; padding: 0 16px; }
  .duel-header__status { display: none; }
  .duel-header__api { font-size: 9px; }
  .brand__mark { width: 34px; height: 34px; }
  .duel-hero {
    height: auto;
    max-height: none;
    min-height: calc(100svh - 58px);
    display: block;
    padding: 52px 20px 0;
  }
  .duel-hero__image { background-position: 68% center; opacity: .52; }
  .duel-hero__shade { background: rgba(4, 7, 6, .48); }
  .duel-hero h1 { font-size: 44px; line-height: 1; }
  .duel-hero__lede { font-size: 16px; }
  .duel-hero__rules { margin-top: 28px; }
  .duel-hero__rules li { min-height: 64px; align-items: flex-start; padding-top: 14px; }
  .matchmaker { margin: 36px 0 0; padding: 22px; }
  .network-pulse { grid-template-columns: 1fr 1fr; margin: 34px -20px 0; padding: 0; }
  .network-pulse > div { min-height: 68px; padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.14); }
  .network-pulse dd { font-size: 22px; }
  .invite-stage,
  .duel-ledger { width: calc(100% - 32px); padding: 62px 0; }
  .duel-workspace { padding: 62px 16px; }
  .workspace-header,
  .result-stage > header,
  .duel-ledger > header { align-items: flex-start; flex-direction: column; }
  .workspace-header h2,
  .invite-stage h2,
  .result-stage h2,
  .duel-ledger h2 { font-size: 34px; }
  .workspace-code,
  .result-integrity { justify-items: start; }
  .duel-versus { grid-template-columns: 1fr 50px 1fr; min-height: 160px; }
  .duel-versus article { padding: 22px 18px; }
  .duel-versus article strong { font-size: 18px; }
  .challenger-identity { grid-template-columns: 1fr; padding: 22px; }
  .duel-case__header { grid-template-columns: 54px 1fr; }
  .duel-case__header small { display: none; }
  .duel-case__brief { grid-template-columns: 1fr; gap: 18px; padding: 22px; }
  .duel-evidence { grid-template-columns: 1fr; }
  .duel-evidence li { min-height: 0; border-right: 0; }
  .duel-case__answer { padding: 22px; }
  .answer-grid { grid-template-columns: 1fr; }
  .gauntlet__submit { align-items: stretch; flex-direction: column; padding: 22px; }
  .invite-stage { grid-template-columns: 1fr; gap: 26px; }
  .invite-console { grid-template-columns: 1fr 1fr; }
  .invite-console code { grid-column: 1 / -1; min-height: 52px; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
  .invite-prompt { grid-column: 1; margin: 0; }
  .result-stage { padding: 62px 16px; }
  .result-scores,
  .result-fingerprints { grid-template-columns: 1fr; }
  .score-plate { min-height: 210px; padding: 30px 22px; border-right: 0; border-bottom: 1px solid var(--line); }
  .score-plate:last-child { border-bottom: 0; }
  .score-plate strong { font-size: 58px; }
  .result-actions { flex-direction: column; }
  .duel-ledger li { grid-template-columns: 76px 1fr 54px; padding: 16px 0; }
  .duel-ledger li > :nth-child(4),
  .duel-ledger li > :nth-child(5),
  .duel-ledger li > :nth-child(6) { display: none; }
  .duel-footer { align-items: flex-start; flex-direction: column; padding: 28px 20px; }
  .has-active-duel .duel-hero { min-height: 420px; height: auto; padding-top: 40px; }
  .has-active-duel .duel-hero h1 { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
