@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --paper: #6627e8;
  --ink: #281347;
  --accent: #6627e8;
  --line: #cdc0e4;
  --white: #fffcff;
  --pink: #ff7ac8;
  --lime: #d6ff46;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100svh; background: radial-gradient(ellipse at 0% 0%, #903cff 0, transparent 55%), var(--paper); }
button, input, select { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
:focus-visible { outline: 3px solid #f16ab7; outline-offset: 4px; }
.masthead {
  width: min(100% - 3rem, 69rem);
  margin: auto;
  border-bottom: 1px solid #ffffff40;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.35rem 0;
}
.wordmark { font-weight: 800; letter-spacing: -.04em; }
.wordmark span, h1 span { color: var(--lime); }
.series, .eyebrow { font-size: .73rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
main { width: min(100% - 3rem, 64rem); margin: auto; padding: clamp(2rem, 7vw, 5rem) 0; }
.setup { display: grid; grid-template-columns: 1.05fr 1fr; align-items: start; gap: clamp(2rem, 6vw, 5.5rem); }
h1, h2 { font-family: "Bricolage Grotesque", system-ui, sans-serif; letter-spacing: -.065em; }
h1 { color: var(--lime); font-size: clamp(3.7rem, 8.4vw, 7rem); line-height: .95; margin: .6rem 0 1.1rem; font-weight: 800; text-shadow: 3px 4px 0 #391080; }
.intro p { color: white; max-width: 29ch; font-size: 1.15rem; line-height: 1.5; margin: 0; }
.panel { background: var(--white); border: 2px solid var(--ink); border-radius: 1.5rem; padding: clamp(1.2rem, 4vw, 2rem); box-shadow: 7px 8px 0 var(--pink); }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1; margin: 0 0 1.2rem; overflow-wrap: anywhere; }
h3 { font-size: 1.08rem; margin: 1.5rem 0 .65rem; }
fieldset { border: 0; min-width: 0; padding: 0; margin: 0 0 1.25rem; }
legend { font-weight: 800; margin-bottom: .5rem; padding: 0; }
.teams { display: grid; gap: .8rem; }
.team-row { display: grid; gap: .45rem; padding: .7rem; border: 1px solid var(--line); border-radius: .9rem; background: #f6f0ff; }
.team-name { display: flex; gap: .4rem; }
.team-row input { min-width: 0; flex: 1; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: .65rem; padding: .65rem .75rem; }
.team-sound { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .5rem; }
.team-sound label { display: grid; min-width: 0; gap: .3rem; font-size: .75rem; font-weight: 700; }
.team-sound select { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: .6rem; padding: .5rem; background: var(--white); color: var(--ink); font-size: .9rem; }
.sound-preview { min-height: 44px; padding: .5rem .65rem; color: var(--ink); background: var(--lime); border: 1px solid var(--ink); border-radius: .6rem; font-size: .8rem; font-weight: 800; }
.sound-preview:hover { background: #e4ff8b; }
.text-button { color: var(--accent); background: transparent; border: 0; font-weight: 800; min-height: 44px; padding: 0 .15rem; }
.remove { padding: 0 .65rem; }
.options { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.options label { position: relative; cursor: pointer; }
.options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.options span { display: grid; place-items: center; min-height: 46px; padding: .55rem .2rem; border: 2px solid var(--line); border-radius: .65rem; font-weight: 700; }
.options small { font-size: .68rem; font-weight: 500; margin-top: .12rem; }
.options input:checked + span { background: var(--lime); border-color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
.options input:focus-visible + span { outline: 3px solid #bd1681; outline-offset: 2px; }
.hint { color: #625174; font-size: .88rem; margin: .65rem 0 0; line-height: 1.4; }
.button { min-height: 53px; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .75rem 1rem; border: 2px solid var(--ink); border-radius: .75rem; font-weight: 800; font-size: 1rem; box-shadow: 0 3px 0 var(--ink); transition: transform .15s, box-shadow .15s, background .15s; }
.button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.button span { font-size: 1.3em; line-height: 1; }
.primary { background: var(--accent); color: white; }
.primary:hover { background: #5319c6; }
.secondary { background: var(--pink); color: var(--ink); }
.secondary:hover { background: #ff99d4; }
#correct { background: var(--lime); color: var(--ink); }
#correct:hover { background: #e4ff8b; }
.stage { width: min(100%, 34rem); margin-inline: auto; }
.stage > p:not(.hint) { line-height: 1.5; }
.stage .eyebrow { color: #6428ba; }
#ready .button { margin-top: 1.5rem; }
.spotlight { background: var(--lime); position: relative; overflow: hidden; padding-top: 3rem; }
.spotlight-star { position: absolute; top: -.4rem; right: .6rem; font-size: 6rem; line-height: 1; color: #28134715; transform: rotate(15deg); pointer-events: none; }
.spotlight h2 { font-size: clamp(2.6rem, 7vw, 4rem); margin-bottom: 1.5rem; }
.spotlight .handoff { font-size: 1.15rem; font-weight: 700; }
.spotlight .eyebrow { margin-top: 0; }
.turn-header { color: white; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.turn-header .eyebrow { color: var(--lime); margin-bottom: .3rem; }
#play-team { font-size: 1.2rem; overflow-wrap: anywhere; }
#timer { color: var(--ink); background: var(--lime); border: 2px solid var(--ink); border-radius: 50%; flex: none; width: 3.6rem; height: 3.6rem; display: grid; place-items: center; font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
#timer.urgent { background: var(--pink); }
progress { display: block; width: 100%; height: .5rem; border: none; border-radius: 1rem; overflow: hidden; appearance: none; background: #44159e; }
progress::-webkit-progress-bar { background: #44159e; }
progress::-webkit-progress-value { background: var(--lime); }
progress::-moz-progress-bar { background: var(--lime); }
.clue-card { min-height: 15rem; background: #fff17a; border: 2px solid var(--ink); border-radius: 1.2rem; margin: 1.2rem 0 1.5rem; padding: 1.25rem; display: grid; align-content: center; justify-items: center; gap: .65rem; text-align: center; box-shadow: 5px 6px 0 var(--pink); }
.clue-card .eyebrow { color: var(--ink); }
.clue-card h2 { max-width: 100%; font-size: clamp(2.25rem, 7vw, 4rem); margin: 0; }
.actions { display: grid; gap: .75rem; }
.actions .button { min-height: 84px; padding: 1rem 1.35rem; font-size: 1.55rem; border-radius: 1rem; }
#tally { color: white; text-align: center; margin-top: 1.2rem; font-weight: 700; }
.scoreboard { margin: .7rem 0 1.5rem; padding: 0; list-style: none; }
.scoreboard li { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .85rem .6rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.scoreboard strong { flex: none; }
.scoreboard .leader { background: #efffc6; border-radius: .65rem; }
.recap > .eyebrow, .finale > .eyebrow { margin-top: 0; }
.recap h2 { color: var(--accent); font-size: clamp(2.4rem, 6vw, 3.3rem); }
.turn-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 1.5rem 0; }
.turn-stats div { display: flex; flex-direction: column-reverse; align-items: center; background: var(--lime); border: 2px solid var(--ink); border-radius: 1rem; padding: .9rem .5rem; box-shadow: 0 3px 0 var(--ink); }
.turn-stats div:last-child { background: var(--pink); transform: rotate(2deg); }
.turn-stats dt { font-weight: 800; font-size: .9rem; }
.turn-stats dd { font-family: "Bricolage Grotesque", system-ui, sans-serif; margin: 0; font-size: 3.5rem; font-weight: 800; line-height: 1; }
.passed-section { background: #f6f0ff; padding: 1rem; border-radius: 1rem; }
.passed-section h3 { margin-top: 0; }
.passed-section p { color: #625174; font-size: .9rem; line-height: 1.4; margin-bottom: 0; }
.clue-list { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.clue-list:empty { display: none; }
.clue-list li { max-width: 100%; overflow-wrap: anywhere; border: 1px solid #dab3cd; border-radius: .65rem; padding: .55rem .7rem; background: #ffe1f1; font-weight: 700; }
.finale { text-align: center; }
.winner-banner { background: var(--lime); border: 2px solid var(--ink); border-radius: 1.2rem; box-shadow: 4px 5px 0 var(--pink); padding: 1.5rem 1rem; margin-bottom: 2rem; }
.winner-star { display: block; width: fit-content; margin: 0 auto .5rem; font-size: 3rem; color: var(--accent); text-shadow: 3px 3px 0 var(--pink); transform: rotate(-12deg); }
.winner-banner h2 { font-size: clamp(2.5rem, 7vw, 3.8rem); margin-bottom: .8rem; }
.winner-banner p:last-child { margin-bottom: 0; font-weight: 700; }
.finale .scoreboard { text-align: left; }
body:has(#play:not([hidden])) main { padding-block: 1rem; }
body:has(#play:not([hidden])) .masthead { padding-block: .8rem; }
#play .clue-card { min-height: clamp(7rem, 25svh, 13rem); margin-block: .8rem 1rem; }
@media (max-height: 650px) {
  #play .actions .button { min-height: 68px; padding-block: .65rem; }
  #play .clue-card { min-height: 7rem; padding: 1rem; }
  #play .clue-card h2 { font-size: clamp(1.8rem, 6vw, 2.8rem); }
}
@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
}
@media (max-width: 720px) {
  .setup { grid-template-columns: 1fr; gap: 1.35rem; }
  h1 { margin-top: 0; }
}
@media (max-width: 420px) {
  .series { font-size: .6rem; letter-spacing: .08em; }
}
@media (max-width: 380px) {
  main, .masthead { width: calc(100% - 1.5rem); }
}
