:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #060713;
  color: #f8fbff;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 12%, rgba(31, 142, 255, 0.28), transparent 34%),
    radial-gradient(circle at 80% 18%, rgba(154, 92, 255, 0.25), transparent 36%),
    linear-gradient(135deg, #070817 0%, #121632 54%, #080915 100%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.home-screen,
.example-screen,
.results-screen,
.battle-screen {
  min-height: 100vh;
}

.hero {
  display: grid;
  min-height: 100vh;
  align-content: center;
  gap: 24px;
  padding: 44px clamp(20px, 5vw, 72px);
}

.eyebrow,
.tagline,
.question-type,
.question-subtitle {
  margin: 0;
  color: #b9c8ff;
  font-weight: 800;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 1200px;
  font-size: clamp(54px, 8vw, 116px);
  line-height: 0.9;
  text-shadow: 0 0 34px rgba(55, 181, 255, 0.45);
}

.hero h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 56px);
  color: #ffcf6f;
}

.tagline {
  font-size: clamp(18px, 2vw, 30px);
}

.team-setup {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.setup-card,
.score-card,
.team-pick {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.setup-card {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.setup-card span {
  font-weight: 900;
  font-size: 22px;
}

.setup-card input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 0 12px;
  color: #fff;
  background: rgba(0, 0, 0, 0.24);
  outline: 0;
}

.blue { --team: #26a6ff; }
.purple { --team: #a777ff; }
.orange { --team: #ff9f1c; }
.green { --team: #3ddc97; }

.setup-card,
.score-card,
.team-pick {
  border-color: color-mix(in srgb, var(--team), transparent 55%);
}

.start-button {
  justify-self: start;
  min-height: 76px;
  padding: 0 38px;
  border-radius: 8px;
  color: #06101f;
  background: linear-gradient(135deg, #8ff7ff, #ffcf6f);
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 1000;
  box-shadow: 0 0 38px rgba(143, 247, 255, 0.35);
}

.battle-screen {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 12px;
  padding: 14px clamp(14px, 2vw, 24px) 18px;
}

.topbar,
.score-strip,
.teacher-control {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(4, 8, 26, 0.72);
  backdrop-filter: blur(14px);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
}

.round-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: baseline;
}

.round-meta strong {
  font-size: clamp(20px, 2vw, 34px);
}

.round-meta span {
  color: #b9c8ff;
  font-weight: 800;
}

.timer {
  min-width: 150px;
  padding: 10px 16px;
  border-radius: 8px;
  background: #111b3d;
  color: #8ff7ff;
  text-align: center;
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 1000;
  box-shadow: inset 0 0 22px rgba(143, 247, 255, 0.12);
}

.timer.danger {
  color: #ff5b7f;
  animation: pulse 0.5s infinite alternate;
}

.sound-toggle button,
.control-grid button,
.manual-grid button,
.bet-panel button,
.steal-targets button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  color: #f8fbff;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 900;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 10px;
}

.score-card {
  position: relative;
  overflow: hidden;
  padding: 12px 16px;
}

.score-card::before,
.team-pick::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--team), transparent 60%), transparent);
  pointer-events: none;
}

.score-card span,
.score-card strong,
.score-card em,
.team-pick span,
.team-pick strong {
  position: relative;
}

.score-card.mini {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 76px;
}

.score-card span {
  font-size: clamp(16px, 1.6vw, 28px);
  font-weight: 900;
}

.score-card strong {
  font-size: clamp(28px, 3vw, 54px);
  color: var(--team);
}

.score-card em {
  grid-column: 1 / -1;
  color: #ffcf6f;
  font-style: normal;
  font-weight: 1000;
}

.round-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.round-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #26a6ff, #ffcf6f);
  transition: width 0.3s ease;
}

.arena {
  display: grid;
  grid-template-columns: minmax(210px, 280px) 1fr;
  gap: 14px;
  min-height: 0;
}

.team-picker,
.question-zone {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
}

.team-picker {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
}

.team-picker p,
.bet-panel p {
  margin: 0;
  color: #b9c8ff;
  font-weight: 900;
  text-transform: uppercase;
}

.team-pick {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 72px;
  padding: 0 14px;
  color: #fff;
  text-align: left;
}

.team-pick.selected {
  outline: 4px solid var(--team);
  transform: translateY(-2px);
}

.team-pick span {
  font-size: 20px;
  font-weight: 1000;
}

.team-pick strong {
  font-size: 30px;
}

.bet-panel {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.bet-panel button.active {
  background: #ffcf6f;
  color: #11131f;
}

.question-zone {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(18px, 3vw, 42px);
}

.question-zone h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(58px, 8vw, 128px);
  line-height: 0.95;
  text-align: center;
  overflow-wrap: anywhere;
  text-shadow: 0 0 40px rgba(143, 247, 255, 0.22);
}

.question-zone h1.sentence-prompt {
  font-size: clamp(32px, 4vw, 62px);
  line-height: 1.08;
  text-transform: none;
}

.question-type,
.question-subtitle {
  text-align: center;
  font-size: clamp(16px, 1.7vw, 26px);
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 86px;
  border-radius: 8px;
  padding: 16px 18px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: clamp(22px, 2.4vw, 36px);
  font-weight: 900;
  text-align: left;
}

.choice span {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(143, 247, 255, 0.16);
  color: #8ff7ff;
}

.choice.correct-choice {
  background: rgba(61, 220, 151, 0.24);
  border-color: #3ddc97;
  box-shadow: 0 0 34px rgba(61, 220, 151, 0.24);
}

.answer-panel,
.feedback {
  justify-self: center;
  width: min(760px, 100%);
  border-radius: 8px;
  padding: 16px 22px;
  text-align: center;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.answer-panel {
  display: grid;
  gap: 6px;
}

.answer-panel strong {
  font-size: clamp(26px, 3vw, 48px);
}

.answer-panel span,
.answer-panel em {
  font-size: clamp(20px, 2vw, 30px);
  font-style: normal;
}

.answer-panel p {
  margin: 0;
  color: #ffcf6f;
  font-weight: 900;
}

.feedback {
  animation: pop 0.35s ease both;
}

.feedback b {
  display: block;
  font-size: clamp(30px, 4vw, 60px);
}

.feedback span {
  font-size: clamp(22px, 2.4vw, 36px);
  font-weight: 1000;
}

.feedback.good b { color: #3ddc97; }
.feedback.bad b { color: #ff5b7f; }

.feedback small {
  display: block;
  margin-top: 6px;
  color: #ffcf6f;
  font-weight: 900;
}

.steal-targets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.steal-targets p {
  grid-column: 1 / -1;
  margin: 0;
}

.steal-targets button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.teacher-control {
  padding: 10px 12px;
}

.teacher-control summary {
  cursor: pointer;
  color: #b9c8ff;
  font-weight: 1000;
}

.control-grid,
.manual-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.control-grid {
  grid-template-columns: repeat(5, 1fr);
}

.manual-grid {
  grid-template-columns: repeat(2, 1fr);
}

.manual-team {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.manual-team span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.mystery-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(2, 5, 18, 0.62);
}

.mystery-card {
  width: min(720px, 88vw);
  border-radius: 8px;
  padding: 38px;
  text-align: center;
  background: linear-gradient(135deg, rgba(38, 166, 255, 0.96), rgba(167, 119, 255, 0.96));
  box-shadow: 0 0 80px rgba(143, 247, 255, 0.38);
  animation: cardIn 0.45s ease both;
}

.mystery-card p {
  margin: 0;
  font-size: 28px;
  font-weight: 1000;
}

.mystery-card h2 {
  margin: 10px 0;
  font-size: clamp(44px, 7vw, 92px);
  line-height: 0.95;
}

.mystery-card span {
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 900;
}

.results-screen {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  align-items: center;
  padding: clamp(20px, 4vw, 54px);
  overflow: hidden;
}

.champion,
.review {
  position: relative;
  z-index: 1;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  padding: clamp(18px, 3vw, 36px);
}

.trophy {
  display: inline-grid;
  place-items: center;
  min-height: 86px;
  padding: 0 28px;
  border-radius: 8px;
  color: #11131f;
  background: linear-gradient(135deg, #ffe27a, #ff9f1c);
  font-weight: 1000;
  font-size: 30px;
  animation: trophy 1.2s infinite alternate;
}

.champion h1 {
  margin: 20px 0 6px;
  font-size: clamp(46px, 6vw, 90px);
  line-height: 0.95;
}

.champion h2,
.review h2 {
  margin: 0 0 18px;
  color: #ffcf6f;
  font-size: clamp(26px, 3vw, 44px);
}

.ranking {
  display: grid;
  gap: 10px;
}

.ranking article,
.review article {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.09);
}

.ranking article.winner {
  background: rgba(255, 207, 111, 0.18);
  border: 1px solid rgba(255, 207, 111, 0.5);
}

.ranking span,
.ranking strong,
.ranking em {
  font-size: clamp(22px, 2.4vw, 36px);
  font-style: normal;
  font-weight: 1000;
}

.ranking em {
  color: #8ff7ff;
}

.review {
  display: grid;
  gap: 10px;
}

.review article {
  grid-template-columns: 1fr;
}

.review b {
  font-size: 24px;
}

.review span,
.review em,
.review small {
  font-size: 18px;
  font-style: normal;
  color: #cdd7ff;
}

.review .start-button {
  margin-top: 12px;
}

.no-mistakes {
  color: #cdd7ff;
  font-size: 22px;
}

.confetti i {
  position: absolute;
  top: -30px;
  left: calc((var(--i) * 3%) - 3%);
  width: 12px;
  height: 22px;
  background: hsl(calc(var(--i) * 34), 90%, 62%);
  animation: fall calc(2.6s + var(--i) * 0.04s) linear infinite;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

@keyframes pop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes cardIn {
  from { transform: scale(0.78) rotate(-2deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes trophy {
  from { transform: translateY(0) rotate(-1deg); }
  to { transform: translateY(-8px) rotate(1deg); }
}

@keyframes fall {
  to {
    transform: translateY(110vh) rotate(720deg);
  }
}



.rules-panel {
  width: min(1180px, 100%);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(4, 8, 26, 0.72);
  backdrop-filter: blur(14px);
}

.rules-panel h3 {
  margin: 0 0 16px;
  color: #ffcf6f;
  font-size: clamp(22px, 2vw, 32px);
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 12px;
}

.rules-grid article {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.rules-grid strong {
  color: #8ff7ff;
  font-size: 16px;
}

.rules-grid span,
.rules-note,
.example-note {
  color: #d7ddf7;
  font-size: 15px;
  line-height: 1.5;
}

.rules-note {
  margin: 14px 0 0;
  color: #ffcf6f;
  font-weight: 800;
}

.example-screen {
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 20% 20%, rgba(38, 166, 255, 0.18), transparent 32%),
    radial-gradient(circle at 80% 20%, rgba(255, 159, 28, 0.16), transparent 32%),
    #080915;
}

.example-card {
  width: min(1050px, 100%);
  display: grid;
  gap: 22px;
  padding: clamp(24px, 4vw, 46px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(10, 14, 38, 0.86);
}

.example-card h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(64px, 10vw, 140px);
  line-height: 0.95;
  color: #fff;
  text-transform: lowercase;
}

.example-card .start-button {
  justify-self: center;
}

.choice:disabled {
  cursor: default;
  opacity: 0.92;
}

@media (max-width: 900px) {
  .team-setup,
  .rules-grid,
  .score-strip,
  .choices,
  .manual-grid,
  .control-grid,
  .results-screen {
    grid-template-columns: 1fr;
  }

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

  .timer {
    min-width: 0;
  }

  .team-picker {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-picker p,
  .bet-panel {
    grid-column: 1 / -1;
  }
}
