:root {
  --shell: #242936;
  --shell-deep: #151923;
  --shell-edge: #454d5b;
  --screen: #f7edcf;
  --screen-2: #fff7df;
  --ink: #242332;
  --muted: #6b6261;
  --coral: #df4f32;
  --coral-deep: #a82f2a;
  --orange: #f19a37;
  --cyan: #5cdee0;
  --cyan-deep: #177c8d;
  --lime: #b7d65e;
  --line: #d6c99d;
  --shadow: rgba(13, 16, 24, .34);
  --display: "Cooper Black", "Rockwell Extra Bold", Georgia, serif;
  --body: "Trebuchet MS", "Segoe UI", sans-serif;
  --mono: "Courier New", monospace;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--shell-deep); }
body {
  margin: 0;
  min-width: 300px;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 18%, #3c4353 0, var(--shell-deep) 62%),
    var(--shell-deep);
  font-family: var(--body);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.35) 0 1px, transparent 1px 4px);
  mix-blend-mode: overlay;
}
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 4px solid var(--cyan);
  outline-offset: 3px;
}

.app-shell {
  width: min(1240px, calc(100% - 28px));
  min-height: 100dvh;
  margin: 0 auto;
  padding: 18px 0 34px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--screen);
  padding: 12px 4px 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  letter-spacing: .02em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--shell-deep);
  background: var(--orange);
  border: 3px solid var(--screen);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 18px;
  box-shadow: 3px 3px 0 var(--coral-deep);
}
.brand-copy strong {
  display: block;
  font-family: var(--display);
  font-size: 23px;
  line-height: 1;
}
.brand-copy small {
  display: block;
  margin-top: 4px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.role-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.role-nav a {
  padding: 8px 11px;
  color: #c5c8cf;
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
  text-decoration: none;
  text-transform: uppercase;
}
.role-nav a:hover, .role-nav a[aria-current="page"] {
  color: var(--screen);
  border-color: var(--shell-edge);
  background: rgba(255,255,255,.06);
}

.tv-frame {
  position: relative;
  overflow: hidden;
  padding: clamp(14px, 2.3vw, 26px);
  background: var(--shell);
  border: 3px solid var(--shell-edge);
  border-radius: 18px 18px 12px 12px;
  box-shadow: 0 22px 40px var(--shadow), inset 0 0 0 4px var(--shell-deep);
}
.tv-frame::before, .tv-frame::after {
  position: absolute;
  width: 40px;
  height: 40px;
  content: "";
  opacity: .85;
  background: repeating-linear-gradient(135deg, var(--coral) 0 8px, transparent 8px 15px);
}
.tv-frame::before { top: 0; left: 0; }
.tv-frame::after { right: 0; bottom: 0; transform: rotate(180deg); }
.screen {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 580px;
  padding: clamp(20px, 4vw, 52px);
  background: var(--screen);
  border: 7px solid #10141d;
  border-radius: 9px;
  box-shadow: inset 0 0 0 3px #8d806a, inset 0 0 30px rgba(91, 65, 31, .12);
}
.screen::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  opacity: .19;
  background: repeating-linear-gradient(90deg, transparent 0 32px, rgba(223, 79, 50, .08) 32px 35px);
  pointer-events: none;
}
.screen-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
}
.kicker {
  margin: 0 0 7px;
  color: var(--coral-deep);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; }
h1 { max-width: 760px; margin-bottom: 12px; font-size: clamp(39px, 6vw, 76px); line-height: .96; letter-spacing: -.035em; }
h2 { margin-bottom: 10px; font-size: clamp(28px, 4vw, 48px); line-height: 1; }
h3 { margin-bottom: 7px; font-size: 23px; }
.lede { max-width: 570px; margin-bottom: 0; color: var(--muted); font-size: 17px; line-height: 1.55; }
.signal {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.signal::before {
  width: 10px;
  height: 10px;
  content: "";
  background: var(--cyan);
  border: 2px solid var(--cyan-deep);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(92,222,224,.18);
}
.signal.signal-warm::before { background: var(--orange); border-color: var(--coral-deep); }

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 30px 0;
}
.role-card, .panel {
  border: 2px solid var(--line);
  background: rgba(255,250,230,.8);
  box-shadow: 4px 5px 0 rgba(74, 56, 37, .1);
}
.role-card {
  display: flex;
  min-height: 180px;
  flex-direction: column;
  justify-content: space-between;
  padding: 23px;
  color: var(--ink);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
}
.role-card:hover { transform: translateY(-4px); border-color: var(--coral); background: var(--screen-2); }
.role-card strong { font-family: var(--display); font-size: 29px; font-weight: 400; }
.role-card p { max-width: 290px; margin: 8px 0 0; color: var(--muted); line-height: 1.4; }
.role-tag { color: var(--coral-deep); font-family: var(--mono); font-size: 11px; letter-spacing: .11em; text-transform: uppercase; }
.arrow { align-self: flex-end; color: var(--coral); font-family: var(--mono); font-weight: 700; }

.form-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(250px, .8fr); gap: 30px; align-items: start; }
.panel { padding: clamp(20px, 3vw, 32px); }
.panel-dark {
  color: var(--screen);
  border-color: var(--shell-edge);
  background: var(--shell-deep);
  box-shadow: 4px 5px 0 rgba(74, 56, 37, .18);
}
.panel-dark h3 { color: var(--orange); }
.field { margin-bottom: 19px; }
.field label { display: block; margin-bottom: 7px; color: var(--muted); font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.field input {
  width: 100%;
  min-height: 54px;
  padding: 10px 14px;
  color: var(--ink);
  background: #fffaf0;
  border: 2px solid #a69a7d;
  border-radius: 3px;
  font-size: 18px;
}
.field input.pin { font-family: var(--mono); font-size: 25px; letter-spacing: .32em; }
.field input::placeholder { color: #a69a7d; }
.field-error { min-height: 18px; margin: -8px 0 13px; color: var(--coral-deep); font-family: var(--mono); font-size: 12px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 12px 19px;
  color: #fff7df;
  border: 2px solid #872725;
  border-radius: 3px;
  background: var(--coral);
  box-shadow: 0 4px 0 #872725;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.button:hover { background: #ea633d; }
.button:active { transform: translateY(3px); box-shadow: 0 1px 0 #872725; }
.button:disabled { cursor: not-allowed; opacity: .5; }
.button.secondary { color: var(--ink); border-color: #968868; background: var(--screen-2); box-shadow: 0 4px 0 #968868; }
.button.cyan { color: #10272d; border-color: #126270; background: var(--cyan); box-shadow: 0 4px 0 #126270; }
.button.small { min-height: 38px; padding: 8px 12px; font-size: 11px; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hint { color: var(--muted); font-family: var(--mono); font-size: 12px; line-height: 1.5; }
.hint strong { color: var(--coral-deep); }

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  padding: 10px 14px;
  color: var(--screen);
  background: var(--shell-deep);
  border-bottom: 3px solid var(--orange);
  font-family: var(--mono);
  font-size: 12px;
}
.status-strip strong { color: var(--cyan); }
.phase-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  color: #12242a;
  border-radius: 2px;
  background: var(--cyan);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.phase-badge.warm { color: #fff4d5; background: var(--coral); }
.phase-badge.neutral { color: var(--ink); background: var(--line); }

.waiting {
  display: grid;
  min-height: 290px;
  place-items: center;
  text-align: center;
}
.waiting-mark {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  margin: 0 auto 18px;
  color: var(--shell-deep);
  border: 5px solid var(--coral);
  border-radius: 50%;
  background: var(--orange);
  font-family: var(--mono);
  font-size: 25px;
  font-weight: 700;
}
.answer-list { display: grid; gap: 12px; margin: 24px 0; }
.answer-button {
  display: grid;
  grid-template-columns: 45px 1fr;
  align-items: center;
  width: 100%;
  min-height: 64px;
  padding: 0 16px 0 0;
  color: var(--ink);
  text-align: left;
  border: 2px solid #b9aa84;
  border-radius: 3px;
  background: rgba(255,250,230,.84);
  transition: transform .14s ease, border-color .14s ease, background-color .14s ease;
}
.answer-button:hover { transform: translateX(4px); border-color: var(--coral); }
.answer-button.selected { color: #fff7df; border-color: var(--coral-deep); background: var(--coral); }
.answer-button.locked { cursor: default; }
.answer-key {
  display: grid;
  align-self: stretch;
  place-items: center;
  color: var(--screen);
  background: var(--shell-deep);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
}
.question-card { max-width: 810px; margin: 0 auto; }
.question-card .question-number { color: var(--coral-deep); font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.question-card h2 { margin: 12px 0 23px; font-size: clamp(30px, 4.4vw, 50px); line-height: 1.08; }
.question-meta { display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-family: var(--mono); font-size: 11px; text-transform: uppercase; }

.moderator-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, .7fr); gap: 20px; }
.control-stack { display: grid; gap: 10px; }
.control-step {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 11px;
  align-items: center;
  min-height: 63px;
  padding: 9px 11px;
  border: 1px solid #685f59;
  background: #292f3b;
}
.control-step .number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--shell-deep);
  border-radius: 50%;
  background: var(--line);
  font-family: var(--mono);
  font-weight: 700;
}
.control-step.done .number { background: var(--lime); }
.control-step.active .number { background: var(--orange); }
.control-step strong { display: block; color: var(--screen); font-size: 14px; }
.control-step small { display: block; margin-top: 3px; color: #a7adb4; font-family: var(--mono); font-size: 10px; }
.control-step .button { min-height: 36px; padding: 7px 10px; font-size: 10px; }
.team-list { display: grid; gap: 8px; margin: 14px 0 0; }
.team-row, .rank-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 13px;
  border-bottom: 1px solid #5f6873;
  color: var(--screen);
}
.team-row small, .rank-row small { color: #9ea5ad; font-family: var(--mono); font-size: 10px; }
.team-state { color: var(--cyan); font-family: var(--mono); font-size: 10px; text-transform: uppercase; }
.rank-list { display: grid; gap: 3px; max-width: 760px; margin: 20px auto; }
.rank-row { color: var(--ink); border-color: var(--line); background: rgba(255,250,230,.7); }
.rank-row:first-child { border-left: 6px solid var(--orange); }
.rank-position { color: var(--coral-deep); font-family: var(--mono); font-weight: 700; }
.rank-name { display: flex; align-items: baseline; gap: 10px; }
.score { color: var(--coral-deep); font-family: var(--mono); font-weight: 700; }
.resolution {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
  text-align: center;
  border: 3px solid var(--cyan-deep);
  background: rgba(190,238,222,.28);
}
.resolution.correct { border-color: #679844; background: rgba(183,214,94,.25); }
.resolution.incorrect { border-color: var(--coral); background: rgba(223,79,50,.12); }
.resolution-answer { margin: 12px 0 0; font-family: var(--display); font-size: 30px; }
.toast {
  position: fixed;
  z-index: 10;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100% - 36px));
  padding: 14px 17px;
  color: var(--screen);
  border-left: 5px solid var(--cyan);
  background: var(--shell-deep);
  box-shadow: 0 8px 22px var(--shadow);
  font-family: var(--mono);
  font-size: 12px;
  animation: slide-in .2s ease both;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.footer-note { margin-top: 17px; color: #98a0aa; font-family: var(--mono); font-size: 10px; letter-spacing: .04em; text-align: center; }
.empty { padding: 22px; color: var(--muted); border: 1px dashed #b9aa84; font-family: var(--mono); font-size: 12px; }
@keyframes slide-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 760px) {
  .app-shell { width: min(100% - 18px, 1240px); padding-top: 8px; }
  .topbar { align-items: flex-start; flex-direction: column; padding-bottom: 11px; }
  .role-nav { justify-content: flex-start; }
  .screen { min-height: calc(100dvh - 115px); padding: 23px 16px; }
  .screen-header { flex-direction: column; margin-bottom: 27px; }
  .choice-grid, .form-layout, .moderator-grid { grid-template-columns: 1fr; }
  .choice-grid { margin-top: 22px; }
  .role-card { min-height: 145px; }
  .control-step { grid-template-columns: 31px 1fr; }
  .control-step .button { grid-column: 2; justify-self: start; }
  h1 { font-size: clamp(41px, 15vw, 65px); }
  .question-meta { flex-direction: column; }
}
@media (max-width: 430px) {
  .brand-copy strong { font-size: 20px; }
  .role-nav a { padding: 7px 8px; font-size: 10px; }
  .panel { padding: 18px; }
  .button-row .button { flex: 1; }
}