@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700&display=swap");

:root {
  color-scheme: dark;
  --ink: #040912;
  --panel: rgba(6, 13, 27, 0.88);
  --panel-solid: #07101f;
  --navy: #0b1932;
  --line: rgba(201, 218, 255, 0.2);
  --line-bright: rgba(215, 183, 103, 0.75);
  --gold: #d7b767;
  --gold-pale: #f4dea3;
  --white: #f4f7ff;
  --muted: #94a1b8;
  --claude: #d88455;
  --codex: #66e6c0;
  --claude-pick: #f27a45;
  --codex-pick: #6f9eff;
  --correct: #79e8a8;
  --wrong: #ff7f86;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--white);
  font-family: "Manrope", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold-pale);
  outline-offset: 4px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

[hidden] {
  display: none !important;
}

#studio {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.studio-fallback {
  position: fixed;
  top: 80px;
  left: 50%;
  z-index: 8;
  padding: 8px 12px;
  border: 1px solid var(--wrong);
  background: var(--ink);
  color: var(--white);
  font-size: 12px;
  transform: translateX(-50%);
}

.game {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto auto 1fr;
  padding: 0 clamp(20px, 3vw, 48px) clamp(16px, 2vw, 28px);
  pointer-events: none;
}

.game button,
.game select,
.question-card__scroll {
  pointer-events: auto;
}

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

.brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-pale);
  font-family: Georgia, serif;
  font-size: 17px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.05em;
}

.round-readout {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  text-transform: uppercase;
}

.round-readout > span {
  font-size: 9px;
  letter-spacing: 0.18em;
}

.round-readout strong {
  color: var(--white);
  font-size: 22px;
  font-weight: 500;
}

.round-readout i {
  color: var(--gold);
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
}

.utility-button {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  justify-content: center;
  border: 1px solid var(--line);
  padding: 8px 13px;
  background: rgba(4, 9, 18, 0.64);
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.topbar__actions {
  display: flex;
  justify-self: end;
  gap: 8px;
  pointer-events: auto;
}

.utility-button--narrator[aria-pressed="true"] {
  border-color: rgba(215, 183, 103, 0.58);
  color: var(--gold-pale);
}

.utility-button:hover {
  border-color: var(--gold);
  color: var(--white);
}

.progress {
  display: grid;
  margin: 12px 0 0;
  padding: 0;
  gap: 6px;
  grid-template-columns: repeat(10, 1fr);
  list-style: none;
}

.progress li {
  height: 2px;
  background: rgba(255, 255, 255, 0.16);
}

.progress li.is-current {
  background: var(--gold-pale);
  box-shadow: 0 0 14px rgba(215, 183, 103, 0.7);
}

.progress li.is-complete {
  background: var(--gold);
}

.scoreboard {
  position: absolute;
  top: 104px;
  right: auto;
  left: clamp(20px, 3vw, 48px);
  display: flex;
  width: min(620px, 58vw);
  align-items: start;
  justify-content: space-between;
  pointer-events: none;
}

.contestant {
  position: relative;
  display: flex;
  min-width: min(260px, 30vw);
  align-items: center;
  gap: 18px;
}

.contestant--codex {
  justify-content: flex-end;
  text-align: right;
}

.contestant__identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contestant--codex .contestant__identity {
  flex-direction: row-reverse;
}

.contestant__signal {
  width: 8px;
  height: 8px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--claude);
  box-shadow: 0 0 16px currentColor;
}

.contestant--codex .contestant__signal {
  color: var(--codex);
}

.contestant.is-thinking .contestant__signal {
  background: currentColor;
  animation: signal 800ms ease-in-out infinite alternate;
}

.contestant.is-winner .contestant__signal {
  background: var(--gold-pale);
  color: var(--gold-pale);
}

.contestant small,
.contestant h2,
.contestant p {
  margin: 0;
}

.contestant small,
.contestant p {
  font-family: "DM Mono", monospace;
}

.contestant small {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.contestant h2 {
  margin-top: 2px;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.contestant p {
  max-width: 180px;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score {
  color: var(--gold-pale);
  font-family: "DM Mono", monospace;
  font-size: clamp(30px, 3vw, 46px);
  font-weight: 400;
  line-height: 1;
}

/* Hide trace markup left in tabs opened before reasoning panels were removed. */
.trace-bubble {
  display: none !important;
}

.presenter-subtitles {
  position: fixed;
  top: clamp(395px, 48.5vh, 450px);
  right: clamp(44px, 7vw, 112px);
  z-index: 5;
  width: min(390px, 35vw);
  border: 1px solid rgba(244, 222, 163, 0.62);
  border-left: 3px solid var(--gold);
  padding: 9px 12px 10px;
  background: rgba(2, 6, 14, 0.9);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.presenter-subtitles.is-speaking {
  animation: subtitle-in 180ms ease-out both;
}

.presenter-subtitles > span {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-family: "DM Mono", monospace;
  font-size: 7px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.presenter-subtitles p {
  min-height: 30px;
  margin: 0;
  color: var(--white);
  font-size: clamp(10px, 0.9vw, 12px);
  font-weight: 600;
  line-height: 1.42;
  text-wrap: balance;
}

.round-stage {
  align-self: end;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.host-line {
  width: fit-content;
  max-width: min(620px, 90%);
  margin: 0 auto 8px;
  padding: 7px 15px;
  border: 1px solid var(--line);
  background: rgba(4, 9, 18, 0.78);
  color: var(--gold-pale);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.02em;
  text-align: center;
}

.question-card {
  position: relative;
  border: 1px solid var(--line-bright);
  background: var(--panel);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.5);
}

.question-card::before,
.question-card::after {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 1px;
  background: var(--gold);
  content: "";
}

.question-card::before {
  right: 100%;
}

.question-card::after {
  left: 100%;
}

.question-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--gold);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.question-card__scroll {
  overflow: hidden;
}

.question-card__text {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  padding: 12px clamp(80px, 9vw, 112px) 13px;
  font-size: clamp(12px, 1vw, 14px);
  line-height: 1.42;
  text-align: center;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.question-card__expand {
  position: absolute;
  right: 8px;
  bottom: 7px;
  border: 1px solid var(--line);
  padding: 5px 8px;
  background: var(--panel-solid);
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.question-card__expand:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--white);
}

.choice-grid {
  position: relative;
  z-index: 3;
  display: grid;
  margin: 8px 0 0;
  padding: 0;
  gap: 7px 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
}

.choice {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 37px;
  align-items: center;
  border: 1px solid var(--line-bright);
  padding: 7px 14px 7px 48px;
  background:
    linear-gradient(90deg, rgba(215, 183, 103, 0.09), transparent 42%),
    rgba(4, 9, 18, 0.92);
  color: #dbe3ef;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  line-height: 1.35;
  outline: none;
  cursor: help;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.choice::before,
.choice::after {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  border-color: var(--line-bright);
  background: var(--panel-solid);
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.choice::before {
  left: -5px;
  border-bottom: 1px solid;
  border-left: 1px solid;
}

.choice::after {
  right: -5px;
  border-right: 1px solid;
  border-top: 1px solid;
}

.choice__label {
  position: absolute;
  left: 17px;
  color: var(--gold);
  font-weight: 700;
}

.choice__label::after {
  content: "·";
  margin-left: 4px;
}

.choice__text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice__tooltip {
  position: absolute;
  right: 10px;
  bottom: calc(100% + 7px);
  left: 10px;
  z-index: 12;
  display: none;
  border: 1px solid var(--gold);
  padding: 10px 12px;
  background: #050b16;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.64);
  color: var(--white);
  font-size: 9px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.choice:hover,
.choice:focus,
.choice:focus-visible {
  border-color: var(--gold);
  background:
    linear-gradient(90deg, rgba(215, 183, 103, 0.18), transparent 58%),
    rgba(4, 9, 18, 0.97);
  color: var(--white);
}

.choice:hover .choice__tooltip,
.choice:focus .choice__tooltip,
.choice:focus-visible .choice__tooltip {
  display: block;
}

.choice.is-picked-claude,
.choice.is-picked-codex,
.choice.is-picked-both {
  color: #050912;
  font-weight: 700;
  animation: answer-lock 420ms ease-out both;
}

.choice.is-picked-claude {
  border-color: #ff9b70;
  background: var(--claude-pick);
  box-shadow: 0 0 26px rgba(242, 122, 69, 0.52);
}

.choice.is-picked-codex {
  border-color: #9bbaff;
  background: var(--codex-pick);
  box-shadow: 0 0 26px rgba(111, 158, 255, 0.52);
}

.choice.is-picked-both {
  border-color: var(--gold-pale);
  background: linear-gradient(
    90deg,
    var(--claude-pick) 0 50%,
    var(--codex-pick) 50% 100%
  );
  box-shadow:
    -10px 0 28px rgba(242, 122, 69, 0.42),
    10px 0 28px rgba(111, 158, 255, 0.42);
}

.choice.is-picked-claude::before,
.choice.is-picked-claude::after {
  border-color: #ff9b70;
  background: var(--claude-pick);
}

.choice.is-picked-codex::before,
.choice.is-picked-codex::after {
  border-color: #9bbaff;
  background: var(--codex-pick);
}

.choice.is-picked-both::before {
  border-color: #ff9b70;
  background: var(--claude-pick);
}

.choice.is-picked-both::after {
  border-color: #9bbaff;
  background: var(--codex-pick);
}

.choice.is-picked-claude .choice__label,
.choice.is-picked-codex .choice__label,
.choice.is-picked-both .choice__label {
  color: #050912;
}

.answer-grid {
  display: grid;
  margin-top: 8px;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.answer-card {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  opacity: 0.72;
  transition: border-color 220ms ease, opacity 220ms ease, transform 220ms ease;
}

.answer-card header,
.answer-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.answer-card header {
  border-bottom: 1px solid var(--line);
}

.answer-card footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.answer-card footer strong {
  min-width: 54px;
  color: var(--gold-pale);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.answer-card footer strong.is-live {
  color: var(--white);
  text-shadow: 0 0 12px rgba(215, 183, 103, 0.72);
}

.answer-card header span {
  color: var(--muted);
}

.answer-card > p {
  min-height: 42px;
  max-height: 68px;
  overflow: auto;
  margin: 0;
  padding: 10px 12px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.answer-card.is-thinking {
  border-color: rgba(215, 183, 103, 0.42);
  opacity: 1;
}

.answer-card.is-thinking header span::after {
  content: "";
  animation: ellipsis 1.2s steps(4, end) infinite;
}

.answer-card.is-correct {
  border-color: var(--correct);
  opacity: 1;
}

.answer-card.is-wrong,
.answer-card.is-error {
  border-color: var(--wrong);
  opacity: 1;
}

.answer-card.is-winner {
  border-color: var(--gold-pale);
  box-shadow: 0 0 25px rgba(215, 183, 103, 0.2);
  transform: translateY(-3px);
}

.round-controls {
  display: grid;
  align-items: stretch;
  margin-top: 8px;
  gap: 8px;
  grid-template-columns: 1fr minmax(240px, 0.4fr);
}

.ground-truth {
  display: flex;
  min-width: 0;
  align-items: center;
  margin: 0;
  border: 1px solid var(--line);
  padding: 9px 13px;
  background: rgba(4, 9, 18, 0.82);
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  line-height: 1.4;
}

.ground-truth.is-revealed {
  color: var(--gold-pale);
}

.lock-button,
.start-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--gold);
  padding: 0 16px;
  background: var(--gold);
  color: #101016;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lock-button {
  min-height: 44px;
  font-size: 10px;
}

.lock-button:hover:not(:disabled),
.start-button:hover:not(:disabled) {
  background: var(--gold-pale);
}

.lock-button__icon {
  font-size: 17px;
}

.setup-modal,
.question-modal,
.final-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 5, 12, 0.75);
  backdrop-filter: blur(15px);
}

.setup-card,
.final-card {
  width: min(680px, 100%);
  border: 1px solid var(--line-bright);
  padding: clamp(26px, 5vw, 54px);
  background: rgba(5, 12, 25, 0.96);
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.72);
}

.eyebrow {
  margin: 0 0 13px;
  color: var(--gold);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.setup-card h1,
.final-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.setup-card__intro {
  max-width: 590px;
  margin: 20px 0 26px;
  color: #b2bed1;
  font-size: 13px;
  line-height: 1.65;
}

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

.model-picker {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  padding: 14px;
  background: var(--navy);
}

.model-picker > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.model-picker strong {
  font-size: 12px;
}

.connection {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  font-style: normal;
  text-align: right;
}

.connection.is-connected {
  color: var(--correct);
}

.model-picker select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0 30px 0 10px;
  background: var(--ink);
  font-family: "DM Mono", monospace;
  font-size: 10px;
}

.model-picker select:disabled {
  cursor: default;
  opacity: 1;
  color: var(--white);
  border-color: rgba(215, 183, 103, 0.42);
}

.setup-error {
  min-height: 17px;
  margin: 10px 0 0;
  color: var(--wrong);
  font-size: 10px;
}

.start-button {
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  font-size: 10px;
}

.start-button span:last-child {
  font-family: "DM Mono", monospace;
  font-size: 8px;
  font-weight: 500;
}

.subscription-note {
  margin: 13px 0 0;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-align: center;
}

.question-modal__card {
  display: grid;
  width: min(920px, 100%);
  max-height: min(760px, 90vh);
  overflow: hidden;
  border: 1px solid var(--line-bright);
  background: var(--panel-solid);
  grid-template-rows: auto 1fr;
}

.question-modal__card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.question-modal__card h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 400;
}

.question-modal__card .eyebrow {
  margin-bottom: 4px;
}

.question-modal__card button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--white);
  font-size: 24px;
  line-height: 1;
}

.question-modal__card pre {
  overflow: auto;
  margin: 0;
  padding: 24px;
  color: #d7dfec;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.final-card {
  max-width: 580px;
  text-align: center;
}

.final-card p:not(.eyebrow) {
  margin: 20px 0 26px;
  color: var(--gold-pale);
  font-family: "DM Mono", monospace;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@keyframes signal {
  to {
    opacity: 0.35;
    transform: scale(1.45);
  }
}

@keyframes ellipsis {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75%,
  100% {
    content: "...";
  }
}

@keyframes answer-lock {
  0% {
    filter: brightness(1.8);
    transform: scale(0.985);
  }
  100% {
    filter: brightness(1);
    transform: scale(1);
  }
}

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

@media (max-width: 760px) {
  html {
    overflow-x: hidden;
  }

  body {
    overflow: auto;
    overflow-x: hidden;
  }

  .game {
    min-height: 100svh;
    padding: 0 14px 14px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .round-readout {
    display: none;
  }

  .brand small {
    display: none;
  }

  .scoreboard {
    top: 88px;
    right: 14px;
    left: 14px;
    width: auto;
  }

  .contestant {
    min-width: 0;
    gap: 8px;
  }

  .contestant small {
    display: none;
  }

  .contestant p {
    display: block;
    max-width: 105px;
    font-size: 7px;
  }

  .contestant h2 {
    font-size: 11px;
  }

  .score {
    font-size: 28px;
  }

  .round-stage {
    padding-top: 330px;
  }

  .presenter-subtitles {
    top: 300px;
    right: 14px;
    left: 14px;
    width: auto;
  }

  .question-card::before,
  .question-card::after {
    display: none;
  }

  .question-card__scroll {
    overflow: hidden;
  }

  .question-card__text {
    padding-right: 72px;
    padding-left: 18px;
    text-align: left;
    -webkit-line-clamp: 3;
  }

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

  .answer-grid,
  .round-controls,
  .model-pickers {
    grid-template-columns: 1fr;
  }

  .answer-card > p {
    min-height: 34px;
    max-height: 64px;
  }

  .setup-modal,
  .question-modal,
  .final-modal {
    padding: 12px;
  }

  .setup-card,
  .final-card {
    padding: 26px 20px;
  }
}

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