@charset "UTF-8";

:root {
  color-scheme: light;
  --paper: #faf6ed;
  --white: #fffdf7;
  --ink: #251746;
  --muted: #625770;
  --violet: #4825a0;
  --violet-dark: #2d155f;
  --lavender: #e9dfff;
  --orange: #ff975d;
  --yellow: #ffdc81;
  --rule: #dbd0e4;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body { margin: 0; min-width: 280px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
button, summary, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #7951dc; outline-offset: 4px; }
h1, h2, p { margin: 0; }
h2 { font-size: 1.3rem; line-height: 1.15; letter-spacing: -.03em; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  min-height: 4rem;
  padding: .65rem max(1.15rem, calc((100% - 75rem) / 2));
  border-bottom: 1px solid var(--rule);
}
.top-actions { display: flex; align-items: center; gap: .25rem; }
.education-link {
  padding: .48rem .55rem;
  border-radius: .45rem;
  color: var(--violet-dark);
  font-size: .9rem;
  font-weight: 720;
  text-decoration: none;
  white-space: nowrap;
}
.education-link:hover { background: var(--lavender); }
body:has(#play:not([hidden])) .education-link { display: none; }
#music[aria-pressed="true"] { background: var(--lavender); color: var(--violet-dark); }
.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--ink);
  font-weight: 750;
  letter-spacing: -.035em;
  white-space: nowrap;
}
.monogram {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--violet-dark);
  color: var(--white);
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .03em;
}

.shell { width: min(75rem, calc(100% - 3rem)); margin-inline: auto; }
.setup, .results { padding-block: clamp(1.2rem, 3.5vw, 3.15rem) 3rem; }
.hero {
  display: grid;
  grid-template-columns: 1.04fr 1fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
}
.eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem;
  font-size: .71rem;
  font-weight: 850;
  letter-spacing: .13em;
  line-height: 1.4;
}
.eyebrow span:first-child {
  width: .56rem;
  height: .56rem;
  border-radius: 50%;
  background: #e16c37;
}
.eyebrow .pipe { height: .75rem; width: 1px; background: #8f82a4; }
.hero h1 {
  margin: .25em 0 .2em -.067em;
  font-family: "Arial Black", "Segoe UI Black", "Segoe UI", sans-serif;
  font-weight: 900;
  font-size: clamp(4.4rem, 9.7vw, 9.15rem);
  line-height: .77;
  letter-spacing: -.09em;
}
.hero h1 em { font-style: normal; color: var(--violet); }
.hero h1 em span { color: #e16c37; }
.lead {
  max-width: 31ch;
  color: var(--muted);
  font-size: clamp(1.03rem, 1.68vw, 1.35rem);
  line-height: 1.48;
  font-weight: 560;
}
.hero-actions, .option-actions, .result-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .8rem;
}
.hero-actions { margin-top: 1.55rem; gap: 1.15rem; }
.grade-picker {
  display: inline-flex;
  gap: .2rem;
  margin-top: 1rem;
  padding: .2rem;
  border: 1px solid var(--rule);
  border-radius: .75rem;
  background: var(--white);
}
.grade-picker button { min-height: 2.1rem; padding-block: .36rem; background: transparent; }
.grade-picker button[aria-pressed="true"] { color: var(--violet-dark); background: var(--lavender); }
.hero-count { color: var(--muted); font-size: .78rem; line-height: 1.32; }
.hero-count strong { color: var(--ink); }

button {
  min-height: 2.65rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  padding: .52rem .95rem;
  font-weight: 720;
  color: var(--ink);
  transition: background-color .18s, color .18s, border-color .18s;
}
button span[aria-hidden="true"] { margin-inline: .15rem; }
.primary { background: var(--violet); color: var(--white); }
.primary:hover:not(:disabled) { background: var(--violet-dark); }
.hero-actions :is(.primary, .secondary) { padding: .76rem 1.05rem; }
.secondary { background: var(--white); border-color: #cfc0e0; }
.secondary:hover:not(:disabled) { background: var(--lavender); border-color: #9e81cc; }
.quiet { background: transparent; }
.quiet:hover:not(:disabled) { background: #eee5f4; }

.hero-art {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1.09;
  display: grid;
  place-items: center;
  border-radius: 1.5rem;
  background: var(--violet);
  color: var(--yellow);
  border: 1px solid #42208d;
  box-shadow: .5rem .52rem 0 #dfd1f5;
}
.hero-art::before {
  content: "";
  position: absolute;
  inset: .7rem;
  border-radius: 1.06rem;
  border: 1px solid #d8c3ff78;
  z-index: 1;
  pointer-events: none;
}
.art-ring {
  position: absolute;
  width: 71%;
  aspect-ratio: 1;
  top: 5%;
  left: 15%;
  border-radius: 50%;
  border: clamp(1.15rem, 2.65vw, 2.3rem) solid #7855cf;
  transform: rotate(-12deg);
}
.art-type {
  position: absolute;
  top: 14%;
  left: 12%;
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: clamp(2.7rem, 8vw, 8rem);
  line-height: 1;
  letter-spacing: -.08em;
  transform: rotate(-13deg);
  color: #e1ceff;
}
.art-spark { position: absolute; z-index: 1; line-height: 1; }
.art-spark.one { right: 13%; top: 16%; font-size: clamp(1.5rem, 4vw, 3.55rem); }
.art-spark.two { left: 13%; bottom: 19%; color: #ffc5a5; font-size: clamp(1.1rem, 2.45vw, 2.25rem); }
.boost {
  position: absolute;
  inset: 5% 4% 9%;
  width: 92%;
  height: 86%;
  object-fit: contain;
  object-position: center bottom;
  z-index: 2;
  filter: drop-shadow(0 .6rem .7rem #25174655);
}
.art-caption {
  position: absolute;
  z-index: 3;
  right: 8%;
  bottom: 7%;
  color: var(--white);
  font-size: clamp(.52rem, 1.2vw, .73rem);
  font-weight: 830;
  letter-spacing: .16em;
}

.setup-options, .review {
  margin-top: clamp(1.4rem, 4.5vw, 3.25rem);
  border: 1px solid var(--rule);
  border-radius: .85rem;
  background: #fffdf8;
}
.setup-options > summary {
  cursor: pointer;
  padding: 1rem 1.15rem;
  color: var(--ink);
  font-weight: 760;
}
.setup-options > summary::marker { color: var(--violet); }
.summary-note { float: right; margin-left: 1rem; color: var(--muted); font-size: .8rem; font-weight: 600; }
.options-body {
  padding: 1.2rem;
  border-top: 1px solid var(--rule);
}
.options-body > div { max-width: 44rem; }
.team-dialog {
  width: min(31rem, calc(100% - 1.5rem));
  max-height: calc(100% - 1.5rem);
  margin: auto;
  padding: clamp(1rem, 4vw, 1.5rem);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--rule);
  border-radius: 1rem;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 1.25rem 3rem #2517464d;
}
.team-dialog::backdrop { background: #2517468c; }
.team-dialog-header { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.muted { display: block; margin-top: .5rem; color: var(--muted); font-size: .93rem; line-height: 1.55; }
.team-form { display: flex; gap: .55rem; margin-top: .85rem; }
input, textarea {
  width: 100%;
  min-width: 0;
  padding: .58rem .68rem;
  border: 1px solid #c7b6d9;
  border-radius: .55rem;
  color: var(--ink);
  background: var(--white);
  line-height: 1.4;
}
textarea { display: block; margin: .8rem 0 .55rem; resize: vertical; }
.feedback { margin-top: .45rem; color: var(--violet-dark); font-size: .8rem; }
.feedback:empty { margin-top: 0; }
.team-list { display: flex; flex-wrap: wrap; gap: .48rem; padding: 0; margin: .7rem 0 0; list-style: none; }
.team-list li {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: .14rem .24rem .14rem .55rem;
  background: #eee6fb;
  border-radius: .5rem;
  font-size: .88rem;
  font-weight: 680;
}
.team-list button { padding: .2rem .44rem; min-height: 1.85rem; background: transparent; }
.team-list button:hover { background: #e1d2f7; }
.visible-teams {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .75rem 0 0;
  padding: 0;
  list-style: none;
}
.visible-teams li {
  max-width: 100%;
  padding: .25em .66em;
  overflow-wrap: anywhere;
  border-radius: .5rem;
  color: var(--ink);
  background: var(--team, var(--lavender));
  font-size: .88rem;
  font-weight: 760;
  line-height: 1.25;
}

.play {
  width: min(94rem, calc(100% - 2rem));
  padding-block: .9rem;
}
.stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: .8rem;
  min-height: 16rem;
  height: calc(100dvh - 9.35rem);
  padding: clamp(1rem, 3vw, 2.6rem);
  color: var(--white);
  border-radius: clamp(.8rem, 2.2vw, 1.75rem);
  background: #442192;
  box-shadow: inset 0 0 0 1px #cbb0ff55;
}
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 46%, #5a31b0, #391a80 75%);
}
.stage.answer { background: #135b4b; }
.stage.answer::before { background: radial-gradient(ellipse at 50% 46%, #1a6b55, #10463a 80%); }
.stage.answer #word {
  font-size: calc(clamp(1.85rem, min(7.6vw, 14dvh), 6rem) * var(--word-scale, 1));
  line-height: 1.08;
  letter-spacing: -.045em;
}
.stage.answer .stage-mark, .stage.answer .stage-note { color: #d5f9ec; }
.stage-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.stage-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: clamp(.35rem, 1.5vw, .85rem);
}
.question-timer {
  flex: none;
  min-width: 5ch;
  padding: .28rem clamp(.38rem, 1vw, .7rem);
  border-radius: .55rem;
  color: #341c6b;
  background: #f2eaff;
  font-size: clamp(.78rem, 2vw, 1.1rem);
  font-weight: 820;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}
.question-timer[data-low] { color: #491c12; background: #ffc28c; }
.stage.answer .question-timer { display: none; }
.stage-mark {
  color: #e7d9ff;
  font-weight: 820;
  font-size: clamp(.68rem, 1.6vw, 1rem);
  letter-spacing: .16em;
}
.stage-number {
  flex: none;
  color: var(--yellow);
  font-size: clamp(.95rem, 2.7vw, 1.7rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.prompt {
  display: grid;
  place-items: center;
  min-width: 0;
  text-align: center;
}
.prompt.animate { animation: appear .32s ease-out both; }
@keyframes appear { from { opacity: 0; transform: translateY(.34rem); } to { opacity: 1; transform: translateY(0); } }
#word {
  max-width: 100%;
  font-weight: 870;
  font-size: calc(clamp(2.5rem, min(12.7vw, 25dvh), 12.5rem) * var(--word-scale, 1));
  line-height: .99;
  letter-spacing: -.055em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
#word:focus, #finish-title:focus { outline: none; }
.stage-footer { min-width: 0; }
.stage-note {
  text-align: center;
  color: #efdbff;
  font-size: clamp(.79rem, 1.68vw, 1.2rem);
  font-weight: 650;
}
.stage-score-hint {
  margin: .3rem 0 0;
  color: #d5f9ec;
  font-size: clamp(.76rem, 1.4vw, 1rem);
  font-weight: 650;
  text-align: center;
}
.slide-teams {
  justify-content: center;
  max-height: min(6rem, 15dvh);
  margin-top: .45rem;
  overflow: auto;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
.slide-teams li { font-size: clamp(.76rem, 1.6vw, 1.2rem); text-align: center; }
.slide-teams .score-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.team-chip-name { min-width: 0; }
.team-chip-total {
  flex: none;
  padding: .15em .38em;
  border-radius: .35rem;
  background: #ffffffa3;
  font-size: .87em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.score-award {
  flex: none;
  min-width: 4.55rem;
  min-height: 2.25rem;
  padding: .22rem .5rem;
  border-radius: .4rem;
  color: var(--white);
  background: var(--violet-dark);
  font-size: clamp(.76rem, 1.25vw, .94rem);
  white-space: nowrap;
}
.score-award:hover { background: var(--violet); }
.score-award[data-awarded] { background: #145244; }
.score-award[data-awarded]:hover { background: #1c6b57; }
.score-award:focus-visible { outline-offset: 2px; }
progress {
  appearance: none;
  width: 100%;
  height: .28rem;
  overflow: hidden;
  border: 0;
  border-radius: 2rem;
  background: #b896ff54;
  color: var(--yellow);
}
progress::-webkit-progress-bar { background: transparent; }
progress::-webkit-progress-value { background: var(--yellow); border-radius: inherit; transition: width .24s; }
progress::-moz-progress-bar { background: var(--yellow); border-radius: inherit; }
.slide-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .8rem;
  margin-top: .75rem;
}
#back { justify-self: start; }
#next { justify-self: end; }
.key-guide { color: var(--muted); font-size: .8rem; }
kbd {
  display: inline-block;
  min-width: 1.4rem;
  padding: .04rem .2rem;
  border: 1px solid var(--rule);
  border-radius: .24rem;
  background: var(--white);
  text-align: center;
}

.finish-banner {
  padding: clamp(1.3rem, 4.3vw, 3.65rem);
  border-radius: 1.5rem;
  background: var(--violet);
  color: var(--white);
}
.finish-banner .eyebrow span:first-child { background: var(--yellow); }
.finish-banner h1 {
  margin-block: .1em .17em;
  font-size: clamp(2.8rem, 8vw, 6.7rem);
  font-weight: 860;
  line-height: .98;
  letter-spacing: -.07em;
}
.finish-banner p:last-child { color: #eee3ff; font-size: clamp(.96rem, 2vw, 1.2rem); }
.review { padding: 1.2rem; }
.scores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  align-items: start;
  gap: .75rem;
  margin-top: .8rem;
}
.scores > * {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  padding: .6rem .65rem;
  background: var(--paper);
  border-radius: .5rem;
  overflow-wrap: anywhere;
}
.scores input { width: 5rem; flex: none; }
.standing { margin-top: .65rem; font-weight: 730; color: var(--violet-dark); }
.standing:empty { margin-top: 0; }
.answers, .review { margin-top: .95rem; }
#answer-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem 2rem;
  padding: .35rem 1.4rem .6rem 2.75rem;
}
#answer-list li { padding-left: .15rem; overflow-wrap: anywhere; }
#answer-list li::marker { color: var(--violet); font-weight: 750; }
#answer-list li span { display: block; color: var(--muted); margin-top: .1rem; }
.result-actions { margin-top: .85rem; justify-content: end; }

@media (max-width: 46rem) {
  .shell { width: calc(100% - 2rem); }
  .hero { grid-template-columns: 1fr; gap: 1.35rem; }
  .hero h1 { font-size: clamp(4.35rem, 16vw, 7.5rem); }
  .hero-art { aspect-ratio: 1.48; max-height: 27rem; }
  .art-ring { width: min(60%, 21rem); left: 50%; top: 2%; transform: translateX(-50%); }
  .art-type { font-size: clamp(3.8rem, 13.5vw, 6.4rem); }
  #answer-list { grid-template-columns: 1fr; }
  .hero-actions { margin-top: 1rem; }
  .setup-options > summary { padding: .82rem; }
}
@media (max-width: 30rem) {
  .summary-note, .key-guide { display: none; }
  .slide-controls { grid-template-columns: 1fr 1fr; }
  .top { padding-inline: .75rem; }
  .top .quiet { padding-inline: .4rem; }
  .top { flex-wrap: wrap; }
  .play { width: calc(100% - 1rem); }
  #word { font-size: calc(clamp(2.35rem, 15vw, 4.2rem) * var(--word-scale, 1)); }
}
@media (max-height: 36rem) and (orientation: landscape) {
  .top { min-height: 3rem; padding-block: .25rem; }
  .play { padding-block: .45rem; }
  .stage { min-height: 9rem; height: calc(100dvh - 7rem); }
  .slide-teams { max-height: 2.1rem; }
  .stage.answer .slide-teams { max-height: 2.9rem; }
  .slide-controls { margin-top: .38rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}
