:root {
  color-scheme: light;
  --cream: #fff8e9;
  --paper: #fffdf6;
  --ink: #172842;
  --muted: #445873;
  --blue: #174f9d;
  --sky: #dbeefa;
  --sun: #ffd35c;
  --line: #cad8e3;
  --green: #1f684c;
  --red: #a03932;
  --radius: 15px;
  --body: "Comic Sans MS", "Chalkboard SE", "Trebuchet MS", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); }
body { margin: 0; color: var(--ink); font-family: var(--body); }
button, select, input { font: inherit; }
button {
  min-height: 44px; border: 1px solid var(--line); border-radius: 11px; background: white;
  color: var(--ink); padding: 8px 15px; font-weight: 700; cursor: pointer;
  transition: transform .14s ease, background-color .14s ease, box-shadow .14s ease;
}
button:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 3px 8px #203e681d; }
button:not(:disabled):active { transform: translateY(1px); }
button:disabled { cursor: default; opacity: .52; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #1260c0; outline-offset: 3px; }
::selection { background: var(--sun); color: var(--ink); }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
p, h1, h2, h3, figure { margin: 0; }
h1, h2, h3 { letter-spacing: -.025em; }
.primary { background: var(--blue); color: white; border-color: var(--blue); }
.primary:hover:not(:disabled) { background: #123f7f; }
.quiet { background: transparent; border-color: transparent; color: var(--blue); }
.quiet:hover:not(:disabled) { background-color: var(--sky); }
.bare { background: transparent; border: 0; box-shadow: none !important; }
.top {
  height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border-bottom: 1px solid #e9dfcc; padding: 0 max(24px, calc((100vw - 1360px) / 2));
  background: var(--paper);
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-align: left; padding: 0; font-size: 1.04rem; line-height: 1.1; white-space: nowrap; }
.wordmark small { display: block; color: var(--blue); font-size: .63rem; letter-spacing: .11em; margin-top: 4px; }
.mic {
  display: inline-grid; place-items: center; width: 39px; height: 39px; background: var(--blue);
  border-radius: 12px; position: relative; color: #fff; flex: none;
}
.mic::before {
  content: ""; position: absolute; width: 8px; height: 15px; border: 2px solid currentColor; border-radius: 7px; top: 7px;
}
.mic::after {
  content: ""; position: absolute; width: 15px; height: 11px; border: 2px solid currentColor;
  border-top: 0; border-radius: 0 0 10px 10px; top: 16px; box-shadow: 0 7px 0 -5px currentColor;
}
.top-actions { display: flex; align-items: center; gap: 3px; }
#main { outline: none; }
.skip { position: fixed; top: 6px; left: 10px; z-index: 10; background: white; padding: 8px; transform: translateY(-150%); }
.skip:focus { transform: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.home {
  width: min(1360px, calc(100% - 72px)); margin: 0 auto; min-height: calc(100svh - 68px);
  display: grid; grid-template-columns: .88fr 1.12fr; gap: clamp(28px, 5vw, 88px);
  align-items: center; padding: 34px 0; animation: enter .45s ease-out both;
}
.hero-copy h1 { font-size: clamp(4.2rem, 8.5vw, 8rem); line-height: .92; margin: 16px 0 22px; font-weight: 900; }
.hero-copy h1 span { color: var(--blue); }
.subtitle { font-weight: 800; color: var(--blue); font-size: clamp(1rem, 1.55vw, 1.4rem); }
.intro { color: var(--muted); font-size: clamp(1.05rem, 1.5vw, 1.35rem); max-width: 34ch; line-height: 1.45; }
.home-levels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.level { text-align: left; position: relative; min-height: 83px; padding: 12px 29px 12px 15px; }
.level strong, .level small { display: block; }
.level strong { font-size: clamp(1.2rem, 2vw, 1.7rem); }
.level small { font-size: .88rem; margin-top: 3px; }
.level > span { font-size: 1.3rem; position: absolute; right: 11px; top: 15px; }
.easy { background: var(--sun); border-color: #e9bc45; }
.hard { background: var(--blue); color: white; border-color: var(--blue); }
.home-links { display: flex; gap: 3px; margin: 8px 0 0 -13px; }
.hero-art {
  border-radius: 25px; background: var(--sky); overflow: hidden; position: relative;
  box-shadow: 0 12px 33px #3d638524; aspect-ratio: 1.18;
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.on-air {
  position: absolute; bottom: 16px; left: 16px; padding: 9px 13px; border-radius: 100px;
  background: var(--paper); color: var(--ink); font-size: .82rem; font-weight: 800; letter-spacing: .09em;
}
.on-air i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #c63d31; margin-right: 4px; }
.game {
  width: min(1360px, calc(100% - 48px)); margin: 0 auto; padding: 14px 0 16px;
  --portrait-size: clamp(90px, 19vh, 185px);
  --picture-size: clamp(58px, 12vh, 110px);
}
.game-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 15px; color: var(--blue); font-weight: 800; }
.topic { color: var(--muted); font-weight: 600; }
.steps { margin: 0 0 0 auto; padding: 0; display: flex; gap: 12px; list-style: none; color: var(--muted); }
.steps li { display: flex; align-items: center; gap: 5px; font-size: .85rem; }
.steps li span {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #ebeff0;
}
.steps li.on span { color: white; background: var(--blue); }
.steps li[aria-current] { color: var(--blue); }
.stage { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 10px 0 12px; min-height: 68px; }
.stage h1 { font-size: clamp(1.8rem, 4.3vw, 3.8rem); line-height: 1; }
.stage p { color: var(--muted); font-size: clamp(.95rem, 1.65vw, 1.3rem); margin-top: 5px; }
.stage-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.stage-actions .primary { font-size: clamp(.92rem, 1.5vw, 1.2rem); min-height: 47px; }
#timer { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--blue); white-space: nowrap; }
.guest-grid { display: grid; gap: 13px; }
.guests-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.guests-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.guest {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--paper); border: 1px solid #e7ded0; border-radius: var(--radius);
  min-width: 0; padding: 9px 9px 10px;
}
.guest.current { border-color: #5590db; box-shadow: 0 0 0 2px #5590db55; }
.guest.muted .portrait { filter: saturate(.52); opacity: .63; }
.guest-person { text-align: center; min-width: 0; width: 100%; display: grid; justify-items: center; gap: 3px; }
.portrait {
  width: min(100%, var(--portrait-size)); height: var(--portrait-size); overflow: hidden;
  border-radius: 13px; background: var(--sky);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.meet { --portrait-size: clamp(130px, 27vh, 254px); }
.guest h3 { font-size: clamp(1.1rem, 2.45vw, 2rem); line-height: 1.05; overflow-wrap: anywhere; max-width: 100%; }
.voice { min-height: 44px; color: var(--blue); padding: 4px 10px; font-size: .95rem; display: inline-flex; align-items: center; gap: 6px; }
.play-glyph { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 8px solid currentColor; }
progress { width: min(170px, 90%); height: 6px; accent-color: var(--blue); }
.talking .portrait img { animation: talking 1s ease-in-out infinite; }
.just-checked .portrait img { animation: bounce .42s ease-out; }
.happy .portrait { outline: 2px solid #508c69; outline-offset: 2px; }
.slots, .clues { display: flex; justify-content: center; gap: 6px; width: 100%; }
.slot, .clue { flex: 1 1 0; max-width: 122px; min-width: 0; }
.slot > button { width: 100%; height: 100%; min-height: calc(var(--picture-size) + 21px); }
.slot:not(.filled) > button { background: #f0f4f6; color: #54708b; border: 2px dashed #9eb5c9; font-size: 1.35rem; }
.picture-card {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; background: white; border: 1px solid var(--line); border-radius: 11px;
  padding: 3px 4px 4px; min-height: calc(var(--picture-size) + 21px); color: var(--ink);
}
.picture-card:disabled { opacity: 1; }
.picture-card img { width: min(var(--picture-size), 100%); height: var(--picture-size); object-fit: contain; }
.picture-card.selected { outline: 3px solid var(--blue); outline-offset: -2px; background: #eaf4ff; }
.card-word { font-size: clamp(.63rem, 1.22vw, 1rem); line-height: 1.08; text-align: center; overflow-wrap: anywhere; }
.number, .result {
  position: absolute; top: 4px; display: grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; font: 800 .86rem/1 var(--body); background: var(--ink); color: white;
}
.number { left: 4px; }
.result { right: 4px; font-size: 1rem; }
.right .result { background: var(--green); }
.wrong .result { background: var(--red); }
.reveal .picture-card.fresh { animation: bounce .42s ease-out; }
.waiting { background: #f0f4f6; border-style: dashed; }
.mix .clue { animation: collect .65s ease-in both; }
.deck { margin-top: 9px; background: var(--sky); padding: 4px 9px 9px; border-radius: var(--radius); }
.deck-heading { display: flex; gap: 8px; justify-content: space-between; align-items: center; }
.deck-heading h3 { padding-left: 3px; font-size: 1.15rem; }
.deck-cards { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: 6px; min-height: calc(var(--picture-size) + 21px); }
.deck-cards .picture-card { flex: 1 1 0; max-width: 132px; min-width: min(74px, 15%); padding-top: 11px; }
.deck-empty { align-self: center; font-size: 1.05rem; color: var(--muted); }
.deck-mix { animation: shuffle .55s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(235ms + var(--order) * 18ms); }
.is-paused *, .is-paused *::before, .is-paused *::after { animation-play-state: paused !important; }
.voice-error { padding: 3px 8px; border-radius: 9px; color: #762c27; background: #ffe5d7; margin-bottom: 6px; }
.speaking {
  margin-top: 12px; padding: 10px 14px; background: var(--sun); border-radius: var(--radius);
  display: flex; justify-content: space-between; align-items: center; gap: 10px; overflow-wrap: anywhere;
}
.speaking strong { font-size: 1.12rem; }
.speaking.celebrate { animation: bounce .55s ease-out; }
.finish { text-align: center; display: grid; justify-items: center; align-content: center; gap: 18px; min-height: 70vh; padding: 20px; }
.finish h1 { font-size: clamp(2.5rem, 7vw, 5.5rem); }
.finish p { font-size: 1.3rem; }
.finish-actions, .dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
dialog {
  border: 1px solid var(--line); border-radius: 20px; background: var(--paper); color: var(--ink);
  width: min(580px, calc(100% - 24px)); max-height: calc(100svh - 26px); padding: 19px;
  box-shadow: 0 20px 60px #192b4b33;
}
dialog::backdrop { background: #152b4b79; }
.dialog-title { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 12px; }
.dialog-title h2 { color: var(--ink); font-size: 1.55rem; }
dialog p { margin: 8px 0 12px; line-height: 1.45; }
.help { padding-left: 24px; line-height: 1.45; }
.help li + li { margin-top: 8px; }
.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.field { display: grid; gap: 5px; margin: 10px 0; font-weight: 700; }
select {
  min-height: 44px; width: 100%; min-width: 0; color: var(--ink); border-radius: 8px; border: 1px solid #a9bfd3; padding: 5px 8px; background: white;
}
.audio-controls { display: grid; gap: 8px; }
.audio-controls label { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.audio-controls input { accent-color: var(--blue); }
.round-list { display: grid; gap: 6px; }
.round-list button { display: flex; justify-content: space-between; gap: 8px; text-align: left; }
.script-text { font-size: 1.35rem; font-weight: 700; }
@keyframes enter { from { opacity: .65; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes talking { 50% { transform: scale(1.035) translateY(1px); } }
@keyframes bounce { 45% { transform: translateY(-5px); } }
@keyframes collect { 24% { transform: rotateY(89deg); } 65%, 100% { transform: translateY(42px) scale(.3); opacity: 0; } }
@keyframes shuffle { 0% { transform: translateY(-25px) rotateY(89deg); opacity: .2; } 55% { transform: translateX(calc((var(--order) - 4) * -3px)) rotateY(-27deg); } 100% { transform: none; opacity: 1; } }
@media (max-height: 820px) and (min-width: 761px) {
  .game { --portrait-size: clamp(105px, 17vh, 138px); --picture-size: clamp(59px, 9.8vh, 79px); padding-top: 8px; }
  .meet { --portrait-size: 174px; }
  .top { height: 57px; }
  .stage { min-height: 52px; margin: 7px 0 8px; }
  .stage h1 { font-size: clamp(1.8rem, 3.7vw, 3rem); }
  .guest { padding-block: 7px; gap: 5px; }
  .game-meta { font-size: .92rem; }
  .home { min-height: calc(100svh - 57px); }
}
@media (max-width: 760px) {
  .home { grid-template-columns: 1fr; gap: 17px; width: calc(100% - 32px); padding: 24px 0; min-height: 0; }
  .hero-copy h1 { font-size: clamp(3.2rem, 13vw, 5.2rem); margin: 10px 0; }
  .hero-copy h1 br { display: none; }
  .hero-copy h1 br::after { content: " "; }
  .hero-art { aspect-ratio: 1.45; max-height: 340px; }
  .home-levels { margin-top: 14px; }
  .top { padding: 0 10px; height: auto; min-height: 60px; }
  .top-actions button { padding: 5px 6px; font-size: .8rem; }
  .game { width: calc(100% - 18px); --portrait-size: 105px; --picture-size: 58px; }
  .steps { margin-left: 0; gap: 7px; }
  .game-meta { font-size: .85rem; gap: 4px 9px; }
  .guest-grid { gap: 5px; }
  .guest { padding: 5px 3px; }
  .stage { align-items: flex-start; flex-wrap: wrap; min-height: 0; }
  .stage-actions { flex: 0 0 auto; }
  .slots, .clues { flex-wrap: wrap; gap: 4px; }
  .slots > *, .clues > * { min-width: min(44px, 100%); }
  .voice { padding: 3px; font-size: .73rem; }
  .number, .result { width: 19px; height: 19px; font-size: .72rem; top: 2px; }
  .deck-cards .picture-card { flex-basis: 55px; max-width: 85px; }
}
@media (max-width: 420px) {
  .game { --portrait-size: 84px; --picture-size: 39px; }
  .meet { --portrait-size: 112px; }
  .top-actions .screen-button { max-width: 64px; }
  .on-air { bottom: 9px; left: 9px; }
  .speaking { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
}
@media (max-width: 360px) {
  .top { flex-wrap: wrap; gap: 0; padding-block: 4px; }
  .top-actions { flex-wrap: wrap; }
  .top:has([data-action="controls"]) .top-actions { width: 100%; justify-content: space-between; }
}

.deck-cards .deck-gap {
  background: #d0e5f3;
  border: 1px dashed #a4bdcf;
  pointer-events: none;
}
.has-selection.match:not(.is-paused) .slot:not(.filled) > button {
  border-color: var(--blue);
  background: #e7f2fc;
  color: var(--blue);
}
.slot.drop-target > button,
.slot.drop-target:not(.filled) > button {
  outline: 3px solid var(--blue);
  outline-offset: -3px;
  background: #d4e9fc;
}
.deck-cards.drop-target {
  outline: 2px dashed var(--blue);
  outline-offset: -2px;
  border-radius: 11px;
}
.primary:disabled {
  background: #e1eaf3;
  border-color: #bdcddd;
  color: #445873;
  opacity: 1;
}
