/*
 * Selected visual direction: a luminous, curved television studio.
 * This layer intentionally overrides the earlier square HUD styling while
 * preserving the existing game logic and accessibility structure.
 */

:root {
  --studio-black: #05070b;
  --studio-panel: rgba(13, 16, 22, 0.9);
  --studio-panel-soft: rgba(18, 21, 28, 0.82);
  --studio-gold: #d9b765;
  --studio-gold-light: #f5dda0;
  --studio-border: rgba(232, 204, 139, 0.42);
  --studio-border-soft: rgba(220, 226, 237, 0.16);
  --studio-copy: #f3f0e8;
  --studio-muted: #9ba2ad;
  --studio-claude: #f07d43;
  --studio-codex: #77b5ff;
  --studio-mint: #82e2d2;
}

body {
  min-width: 320px;
  background: var(--studio-black);
  font-family: "Manrope", Arial, sans-serif;
}

#studio {
  filter: brightness(1.28) saturate(0.88) contrast(0.96);
}

.game {
  min-height: 100dvh;
  padding: 0 30px 18px;
}

.topbar {
  z-index: 10;
  min-height: 92px;
  border-bottom-color: rgba(232, 204, 139, 0.2);
}

.brand {
  gap: 15px;
}

.brand__mark {
  width: 50px;
  height: 50px;
  border-color: var(--studio-gold);
  color: var(--studio-gold-light);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  box-shadow: 0 0 28px rgba(217, 183, 101, 0.12);
}

.brand strong {
  color: var(--studio-gold-light);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.2em;
}

.brand small {
  margin-top: 5px;
  color: #a2a6ac;
  font-size: 9px;
  letter-spacing: 0.09em;
}

.round-readout {
  display: grid;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.round-readout__number {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
}

.round-readout__number > span,
.round-readout__prize > span {
  color: #b8bbc1;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.round-readout__number strong {
  color: var(--studio-copy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 33px;
  font-weight: 400;
  letter-spacing: 0.03em;
}

.round-readout__number i {
  margin-left: 3px;
  color: var(--studio-gold);
  font-family: "DM Mono", monospace;
  font-size: 11px;
}

.round-readout__prize {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.round-readout__prize strong {
  color: var(--studio-gold-light);
  font-family: "DM Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.topbar__actions {
  gap: 9px;
}

.utility-button {
  min-height: 42px;
  border-color: rgba(232, 204, 139, 0.28);
  border-radius: 999px;
  padding: 0 18px;
  background: rgba(8, 10, 14, 0.72);
  color: #b8bbc1;
  backdrop-filter: blur(14px);
}

.utility-button--narrator[aria-pressed="true"] {
  border-color: rgba(232, 204, 139, 0.56);
  color: var(--studio-gold-light);
  box-shadow: inset 0 0 24px rgba(217, 183, 101, 0.06);
}

.progress {
  position: relative;
  z-index: 10;
  margin-top: 0;
  gap: 7px;
}

.progress li {
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.progress li.is-current {
  height: 2px;
  border-radius: 999px;
}

.scoreboard {
  top: 126px;
  left: 32px;
  z-index: 8;
  width: min(680px, 56vw);
}

.contestant {
  min-width: 285px;
  align-items: flex-start;
  gap: 14px;
}

.contestant--codex {
  justify-content: flex-start;
  text-align: left;
}

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

.contestant__identity {
  align-items: flex-start;
}

.contestant__signal {
  margin-top: 11px;
}

.contestant small {
  color: var(--studio-claude);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.contestant--codex small {
  color: var(--studio-mint);
}

.contestant h2 {
  margin-top: 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 400;
  letter-spacing: 0;
}

.contestant p {
  margin-top: 7px;
  color: #aeb3bd;
  font-size: 10px;
}

.contestant .contestant__winnings {
  width: fit-content;
  margin-top: 7px;
  color: var(--studio-gold-light);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.score {
  margin-top: 25px;
  color: var(--studio-claude);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 48px;
}

.contestant--codex .score {
  order: 2;
  color: var(--studio-mint);
}

.stage-figures {
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

.presenter-figure {
  position: absolute;
  top: 130px;
  right: clamp(-35px, -1.5vw, -10px);
  width: clamp(405px, 38vw, 570px);
  height: min(600px, 64vh);
  margin: 0;
  filter: drop-shadow(0 22px 42px rgba(0, 0, 0, 0.48));
}

.presenter-figure::before {
  position: absolute;
  inset: 7% 7% 13% 14%;
  z-index: -1;
  border-radius: 50%;
  background: rgba(236, 196, 104, 0.09);
  box-shadow: 0 0 85px rgba(236, 196, 104, 0.2);
  content: "";
}

.presenter-figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.prize-rack {
  position: absolute;
  bottom: clamp(342px, 37vh, 395px);
  width: 270px;
  min-height: 135px;
}

.prize-rack--claude {
  left: 118px;
}

.prize-rack--codex {
  left: clamp(555px, 43vw, 640px);
}

.prize-rack__bags {
  display: flex;
  height: 150px;
  align-items: flex-end;
  gap: 0;
}

.cash-bag {
  position: relative;
  flex: 0 0 auto;
  width: var(--bag-size, 72px);
  height: calc(var(--bag-size, 72px) * 0.8);
  margin-right: calc(var(--bag-size, 72px) * -0.34);
  transform-origin: center bottom;
  filter: drop-shadow(0 13px 14px rgba(0, 0, 0, 0.46));
}

.cash-bag img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cash-bag span {
  position: absolute;
  right: 8%;
  bottom: 3%;
  display: grid;
  min-width: 42%;
  min-height: 21%;
  place-items: center;
  border: 1px solid rgba(245, 220, 159, 0.5);
  border-radius: 999px;
  padding: 1px 5px;
  color: #fff1c8;
  background: rgba(7, 12, 18, 0.82);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.34);
  font-family: "DM Mono", monospace;
  font-size: clamp(6px, calc(var(--bag-size, 72px) * 0.09), 10px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  text-shadow: 0 1px 3px #000;
}

.prize-rack--claude .cash-bag {
  filter:
    drop-shadow(0 15px 16px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 8px rgba(240, 125, 67, 0.26));
}

.prize-rack--codex .cash-bag {
  filter:
    drop-shadow(0 15px 16px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 8px rgba(119, 181, 255, 0.28));
}

.cash-bag.is-new {
  animation: bag-arrival 720ms cubic-bezier(0.18, 0.85, 0.28, 1.15) both;
}

.presenter-subtitles {
  top: clamp(292px, 37vh, 350px);
  right: clamp(38px, 6vw, 96px);
  bottom: auto;
  z-index: 12;
  width: min(340px, 30vw);
  border: 1px solid rgba(232, 204, 139, 0.56);
  border-left-width: 1px;
  border-radius: 16px;
  padding: 10px 14px 12px;
  background: rgba(10, 12, 16, 0.74);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
}

.presenter-subtitles > span {
  color: var(--studio-gold);
}

.presenter-subtitles p {
  color: var(--studio-copy);
  font-size: 11px;
  font-weight: 500;
}

.round-stage {
  position: fixed;
  right: 0;
  bottom: 17px;
  left: 0;
  z-index: 10;
  width: min(1160px, calc(100vw - 44px));
  margin: 0 auto;
}

.host-line {
  position: fixed;
  top: clamp(292px, 37vh, 350px);
  right: clamp(38px, 6vw, 96px);
  z-index: 11;
  width: min(340px, 30vw);
  max-width: none;
  min-height: 56px;
  margin: 0;
  border-color: rgba(232, 204, 139, 0.28);
  border-radius: 16px;
  padding: 11px 15px;
  background: rgba(10, 12, 16, 0.72);
  font-size: 9px;
  line-height: 1.5;
  backdrop-filter: blur(12px);
  transition: opacity 140ms ease, visibility 140ms ease;
}

.host-line.is-captioned {
  visibility: hidden;
  opacity: 0;
}

.question-card {
  overflow: hidden;
  border-color: rgba(232, 204, 139, 0.54);
  border-radius: 38px;
  background: rgba(12, 15, 20, 0.92);
  box-shadow: 0 22px 62px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(18px);
}

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

.question-card__meta {
  border: 0;
  padding: 12px 25px 0;
  color: var(--studio-gold);
}

.question-card__text {
  min-height: 62px;
  padding: 9px 126px 14px;
  color: var(--studio-copy);
  font-size: 13px;
  line-height: 1.48;
}

.question-card__expand {
  right: 20px;
  bottom: 16px;
  border-color: rgba(232, 204, 139, 0.25);
  border-radius: 999px;
  background: rgba(19, 22, 28, 0.9);
}

.choice-grid {
  margin-top: 8px;
  gap: 7px 10px;
}

.choice {
  min-height: 43px;
  border-color: rgba(232, 204, 139, 0.44);
  border-radius: 999px;
  padding: 8px 18px 8px 64px;
  background: rgba(11, 14, 19, 0.93);
  color: #d8d9dd;
  font-size: 10px;
  backdrop-filter: blur(14px);
}

.choice::before,
.choice::after {
  display: none;
}

.choice__label {
  left: 12px;
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid rgba(232, 204, 139, 0.48);
  border-radius: 50%;
  color: var(--studio-gold-light);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
}

.choice__label::after {
  display: none;
}

.choice:hover,
.choice:focus,
.choice:focus-visible {
  border-color: var(--studio-gold-light);
  background: rgba(30, 27, 20, 0.96);
}

.choice__tooltip {
  right: 18px;
  bottom: calc(100% + 8px);
  left: 18px;
  border-color: rgba(232, 204, 139, 0.66);
  border-radius: 16px;
  background: rgba(9, 11, 16, 0.98);
}

.choice.is-picked-claude {
  border-color: #ff9d72;
  background: var(--studio-claude);
  box-shadow: 0 0 28px rgba(240, 125, 67, 0.38);
}

.choice.is-picked-codex {
  border-color: #a9c9ff;
  background: var(--studio-codex);
  box-shadow: 0 0 28px rgba(119, 181, 255, 0.38);
}

.choice.is-picked-both {
  border-color: var(--studio-gold-light);
  background: linear-gradient(
    90deg,
    var(--studio-claude) 0 50%,
    var(--studio-codex) 50% 100%
  );
}

.choice.is-picked-claude .choice__label,
.choice.is-picked-codex .choice__label,
.choice.is-picked-both .choice__label {
  border-color: rgba(8, 10, 14, 0.46);
}

.answer-grid {
  margin-top: 8px;
  gap: 10px;
}

.answer-card {
  overflow: hidden;
  border-color: rgba(220, 226, 237, 0.16);
  border-radius: 20px;
  background: rgba(9, 12, 17, 0.88);
  backdrop-filter: blur(14px);
}

.answer-card header,
.answer-card footer {
  padding: 6px 13px;
}

.answer-card > p {
  min-height: 27px;
  padding: 7px 13px;
}

.round-controls {
  margin-top: 8px;
}

.ground-truth {
  border-color: rgba(220, 226, 237, 0.16);
  border-radius: 999px 0 0 999px;
  background: rgba(9, 12, 17, 0.88);
}

.lock-button {
  min-width: 320px;
  border-radius: 0 999px 999px 0;
  background: var(--studio-gold-light);
  color: #16130c;
  font-weight: 700;
}

.lock-button__icon {
  display: none;
}

.setup-modal,
.question-modal,
.final-modal {
  background: rgba(2, 4, 8, 0.84);
  backdrop-filter: blur(24px);
}

.setup-card,
.question-modal__card,
.final-card {
  border-color: rgba(232, 204, 139, 0.46);
  border-radius: 38px;
  background: rgba(13, 16, 22, 0.96);
  box-shadow: 0 36px 110px rgba(0, 0, 0, 0.62);
}

.model-picker,
.start-button {
  border-radius: 22px;
}

.checkpoint-note {
  border: 1px solid rgba(130, 226, 210, 0.28);
  border-radius: 15px;
  padding: 9px 12px;
  background: rgba(130, 226, 210, 0.06);
  color: var(--studio-mint);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  line-height: 1.5;
  text-align: center;
}

@keyframes bag-arrival {
  0% {
    opacity: 0;
    transform: translateY(-70px) scale(0.72) rotate(-8deg);
  }
  68% {
    opacity: 1;
    transform: translateY(6px) scale(1.04) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
  }
}

@media (max-height: 850px) and (min-width: 900px) {
  .topbar {
    min-height: 76px;
  }

  .scoreboard {
    top: 100px;
  }

  .presenter-figure {
    top: 98px;
    height: 465px;
  }

  .prize-rack {
    bottom: 327px;
  }

  .presenter-subtitles {
    top: 265px;
  }

  .host-line {
    top: 265px;
  }

  .round-stage {
    bottom: 10px;
  }

  .answer-card > p {
    min-height: 22px;
    padding-top: 5px;
    padding-bottom: 5px;
  }
}

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

  #studio {
    position: fixed;
  }

  .game {
    min-height: 980px;
    padding-right: 18px;
    padding-left: 18px;
  }

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

  .round-readout {
    display: none;
  }

  .scoreboard {
    top: 108px;
    left: 18px;
    width: calc(100vw - 36px);
  }

  .contestant {
    min-width: 0;
    width: 46%;
  }

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

  .presenter-figure {
    top: 270px;
    right: -45px;
    width: 360px;
    height: 390px;
    opacity: 0.88;
  }

  .prize-rack {
    bottom: auto;
    top: 440px;
    transform: scale(0.78);
    transform-origin: left bottom;
  }

  .prize-rack--claude {
    left: 0;
  }

  .prize-rack--codex {
    left: 38%;
  }

  .presenter-subtitles {
    right: 18px;
    bottom: auto;
    top: 395px;
    width: min(300px, calc(100vw - 36px));
  }

  .host-line {
    top: 395px;
    right: 18px;
    width: min(300px, calc(100vw - 36px));
  }

  .round-stage {
    position: absolute;
    top: 625px;
    bottom: auto;
    width: calc(100vw - 36px);
  }

  .question-card__text {
    padding-right: 25px;
    padding-left: 25px;
  }

  .question-card__expand {
    position: static;
    float: right;
    margin: 0 18px 12px;
  }
}

@media (max-width: 620px) {
  body {
    overflow-y: auto;
    overscroll-behavior-y: contain;
    background:
      radial-gradient(circle at 50% 8%, rgba(217, 183, 101, 0.1), transparent 38%),
      var(--studio-black);
  }

  .studio-fallback,
  .stage-figures {
    display: none !important;
  }

  #studio {
    display: block;
    opacity: 0.98;
  }

  .game {
    display: block;
    min-height: 100dvh;
    padding:
      env(safe-area-inset-top)
      12px
      calc(18px + env(safe-area-inset-bottom));
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 64px;
    background: linear-gradient(180deg, #05070b 72%, transparent);
  }

  .progress {
    margin-top: 7px;
  }

  .brand__mark {
    width: 40px;
    height: 40px;
  }

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

  .brand small {
    display: none;
  }

  .utility-button--narrator {
    display: none;
  }

  .utility-button {
    min-height: 42px;
    padding: 0 13px;
    letter-spacing: 0.08em;
  }

  .scoreboard {
    position: relative;
    top: auto;
    left: auto;
    display: grid;
    width: 100%;
    margin-top: 14px;
    border: 1px solid var(--studio-border-soft);
    border-radius: 20px;
    padding: 11px;
    gap: 10px;
    background: rgba(10, 13, 18, 0.78);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    backdrop-filter: blur(14px);
  }

  .contestant {
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .contestant--codex {
    justify-content: space-between;
    text-align: left;
  }

  .contestant--codex .contestant__identity {
    flex-direction: row;
    text-align: left;
  }

  .contestant--codex .score {
    order: 2;
  }

  .contestant__identity {
    min-width: 0;
    gap: 7px;
  }

  .contestant__identity > div {
    min-width: 0;
  }

  .contestant h2 {
    margin-top: 2px;
    font-size: 17px;
  }

  .contestant p:not(.contestant__winnings) {
    display: none;
  }

  .contestant .contestant__winnings {
    overflow: visible;
    max-width: none;
    margin-top: 3px;
    font-size: 8px;
    white-space: nowrap;
  }

  .score {
    margin-top: 0;
    font-size: 34px;
  }

  .presenter-subtitles {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    margin-top: 10px;
  }

  .round-stage {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    margin-top: clamp(250px, 34vh, 310px);
    padding-top: 0;
    scroll-margin-top: 74px;
  }

  .host-line {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    min-height: 0;
    margin-bottom: 8px;
    padding: 9px 12px;
    font-size: 9px;
  }

  .question-card {
    border-radius: 24px;
  }

  .question-card__meta {
    padding: 11px 15px 0;
    gap: 10px;
    font-size: 7px;
  }

  .question-card__text {
    min-height: 0;
    padding: 10px 16px 12px;
    font-size: 12px;
    line-height: 1.5;
    -webkit-line-clamp: 4;
  }

  .question-card__expand {
    float: none;
    width: calc(100% - 24px);
    min-height: 40px;
    margin: 0 12px 12px;
  }

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

  .choice {
    min-height: 50px;
    border-radius: 18px;
    padding: 9px 13px 9px 57px;
    font-size: 10px;
  }

  .choice__label {
    left: 10px;
    width: 34px;
    height: 34px;
  }

  .choice__text {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .answer-card {
    border-radius: 18px;
  }

  .answer-card header,
  .answer-card footer {
    min-height: 38px;
    padding: 8px 12px;
  }

  .answer-card > p {
    min-height: 44px;
    max-height: none;
    overflow: visible;
    padding: 10px 12px;
  }

  .round-controls {
    display: grid;
    margin-top: 10px;
    gap: 8px;
  }

  .ground-truth,
  .lock-button {
    min-width: 0;
    width: 100%;
    border-radius: 18px;
  }

  .ground-truth {
    min-height: 48px;
    padding: 11px 13px;
  }

  .lock-button {
    min-height: 54px;
    padding: 0 18px;
    font-size: 11px;
  }

  .setup-modal,
  .question-modal,
  .final-modal {
    display: flex;
    overflow-y: auto;
    align-items: flex-start;
    padding:
      max(10px, env(safe-area-inset-top))
      10px
      max(10px, env(safe-area-inset-bottom));
  }

  .setup-card,
  .question-modal__card,
  .final-card {
    margin: auto 0;
    border-radius: 24px;
  }

  .setup-card,
  .final-card {
    padding: 24px 18px;
  }

  .setup-card h1,
  .final-card h2 {
    font-size: clamp(32px, 10vw, 42px);
  }

  .setup-card__intro {
    margin: 15px 0 18px;
    font-size: 12px;
    line-height: 1.55;
  }

  .model-picker {
    padding: 12px;
  }

  .model-picker select,
  .start-button {
    min-height: 48px;
  }

  .question-modal__card {
    max-height: calc(100dvh - 20px);
  }

  .question-modal__card header {
    padding: 14px 16px;
  }

  .question-modal__card h2 {
    font-size: 24px;
  }

  .question-modal__card pre {
    padding: 16px;
    font-size: 10px;
    line-height: 1.6;
  }
}

@media (max-width: 420px) {
  .brand > span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cash-bag.is-new {
    animation: none;
  }
}
