:root {
  /* SparkHop: #1E88FF blue · #7C3AED purple · #FF4D8D pink · #FFB020 yellow · #34D399 green · #00B8D9 cyan */
  --bg1: #e3efff;
  --bg2: #f1e9ff;
  --ink: #14285a;
  --muted: #4b5a7c;
  --card: #ffffff;
  --line: #d3dcee;
  --primary: #1670e0;      /* brand blue, a little deeper where white text sits on it */
  --primary-soft: #dcebff;
  --accent: #7c3aed;
  --pink: #ff4d8d;
  --yellow: #ffb020;
  --ok: #1fae6e;
  --ok-bg: #d9f8ea;
  --bad: #e5484d;
  --bad-bg: #ffe1e6;
  --chip: #e3eeff;
  --radius: 28px;
  --shadow: 0 10px 30px rgba(20, 40, 90, 0.12);
  --brand-font: "SparkHop Rounded", "Segoe UI", Roboto, "Noto Color Emoji", system-ui, sans-serif;
  /* Board scale: everything grows with the screen so it is readable from the back of the room. */
  --fs: clamp(18px, 2.1vw, 44px);
}

/* M PLUS Rounded 1c (OFL, bundled, Latin + Greek): rounded and chunky like the SparkHop wordmark. */
@font-face { font-family: "SparkHop Rounded"; src: url("/fonts/mplus-rounded-bold.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "SparkHop Rounded"; src: url("/fonts/mplus-rounded-extrabold.ttf") format("truetype"); font-weight: 800 900; font-display: swap; }
h1, .title, .prompt, .tile, .btn, .chip, .pill, .score-big, .code, .video-q .verdict, .video-start, .overlay, .fill-line { font-family: var(--brand-font); }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Segoe UI", Roboto, "Noto Sans", "Noto Color Emoji", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 700px at 10% 0%, var(--bg1), transparent), radial-gradient(1000px 700px at 100% 100%, var(--bg2), transparent), #f7f8fc;
  font-size: var(--fs);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.hidden { display: none !important; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 2.2vh 3vw; }
.center { align-items: center; justify-content: center; text-align: center; gap: 2vh; }
h1 { font-size: 2.1em; margin: 0.2em 0; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.brand { position: absolute; top: 3vh; left: 3vw; font-size: 0.9em; color: var(--muted); display: flex; align-items: center; gap: 0.5em; }
.brand b { color: var(--primary); }
.brand-mascot { height: 2.6em; }
.brand-word { height: 1.9em; }
.mascot-hop { animation: hop 1.6s ease-in-out infinite; }
.logo { display: inline-grid; place-items: center; width: 1.8em; height: 1.8em; border-radius: 0.5em; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; font-weight: 800; }

/* Pairing */
.pair-card { display: flex; align-items: center; gap: 4vw; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4vh 4vw; text-align: left; }
.qr { width: min(48vh, 36vw); height: min(48vh, 36vw); background: #fff; border-radius: 12px; display: grid; place-items: center; }
.qr img, .qr svg { width: 100%; height: 100%; image-rendering: pixelated; }
.pair-text ol { padding-left: 1.2em; line-height: 1.6; color: var(--muted); }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 2.4em; letter-spacing: 0.18em; font-weight: 800; color: var(--primary); margin: 0.3em 0; }

/* Play */
.bar { display: flex; align-items: center; gap: 1.5vw; }
.title { font-weight: 700; font-size: 1.1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
html.in-app #link-open { display: none !important; }
.credit { font-size: 0.6em; color: var(--muted); max-width: 22vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.credit:empty { display: none; }
.progress { flex: 1; height: 1.6vh; border-radius: 99px; background: var(--line); overflow: hidden; }
#progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.5s ease; }
.pill { background: var(--card); box-shadow: var(--shadow); border-radius: 99px; padding: 0.35em 0.9em; font-weight: 800; }
.tally { display: flex; gap: 0.6vw; }
.tally .ok { color: var(--ok); }
.tally .bad { color: var(--bad); }
.tally .pill.bump { animation: pop 0.45s ease; }
.mute { border: none; cursor: pointer; font-size: 1em; }
.timer { height: 1.2vh; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 1.2vh; }
#timer-fill { height: 100%; width: 100%; background: #ffb347; transition: width 0.1s linear; }
#timer-fill.low { background: var(--bad); }

.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.8em; padding: 1vh 6vw 1vh 14vw; overflow: hidden; }
/* Room for the control buttons at the bottom so they never cover answers. */
#screen-play .stage, #screen-link .show-image { margin-bottom: max(8vh, 58px); }
.prompt { font-size: 1.9em; font-weight: 700; text-align: center; line-height: 1.35; max-width: 100%; }
.slot { display: inline-block; min-width: 4em; padding: 0 0.35em; border-radius: 0.3em; background: rgba(14, 124, 102, 0.12); color: var(--primary); border-bottom: 0.12em solid var(--primary); }
.slot.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.slot.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.visual { height: min(22vh, 4.6em); display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
/* Pictures never grow past their box (big photos / pictograms would otherwise cover the question and answers) */
.visual img { height: min(22vh, 4.6em); width: auto; max-width: min(60vw, 9em); object-fit: contain; display: block; }
.visual .emoji { font-size: min(16vh, 3.4em); line-height: 1; }

.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5em 2vw; width: min(100%, 1400px); }
.options.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile {
  min-height: min(13vh, 2.6em); border-radius: var(--radius); border: 0.18em solid var(--line); background: var(--card); box-shadow: var(--shadow);
  font-size: 1.5em; font-weight: 700; color: var(--ink); display: grid; place-items: center; padding: 0.4em; cursor: pointer;
  transition: transform 0.12s ease, background 0.2s, border-color 0.2s;
}
.tile:active { transform: scale(0.97); }
.tile.ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); animation: pop 0.45s ease; }
.tile.bad { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); animation: shake 0.45s ease; }
.tile.dim { opacity: 0.45; }
.tile[disabled] { cursor: default; }
.tf .tile { min-height: min(20vh, 3.2em); font-size: 2em; }

.dropzone { width: min(100%, 1100px); min-height: min(12vh, 2.4em); border-radius: var(--radius); border: 0.18em dashed var(--primary); background: rgba(14, 124, 102, 0.06); display: grid; place-items: center; color: var(--muted); font-size: 1.2em; }
.dropzone.over { background: var(--primary-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 2vh 1.6vw; justify-content: center; }
.chip { padding: 0.5em 1.1em; border-radius: 0.8em; background: var(--chip); font-size: 1.5em; font-weight: 700; box-shadow: var(--shadow); cursor: grab; touch-action: none; }
.chip.dragging { cursor: grabbing; box-shadow: 0 20px 40px rgba(31, 34, 64, 0.25); z-index: 10; position: relative; }
.chip.placed { background: var(--primary-soft); }
.chip.used { visibility: hidden; }
.answer-row { min-height: min(12vh, 2.4em); width: min(100%, 1300px); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1.2vw; padding: 1.5vh; }
.answer-row.ok { background: var(--ok-bg); } .answer-row.bad { background: var(--bad-bg); }

.match { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.4em 3vw; width: min(100%, 1500px); }
.match .col { display: flex; flex-direction: column; gap: 0.35em; }
.match .tile { min-height: min(9vh, 2em); font-size: 1.25em; min-width: 0; overflow-wrap: anywhere; justify-content: start; grid-auto-flow: column; gap: 0.5em; }
.match .tile.sel { border-color: var(--accent); background: #efe7ff; }
.match .tile img { height: 1.6em; }

.input-row { display: flex; gap: 1vw; width: min(100%, 1000px); }
.input-row input { flex: 1; font-size: 1.5em; padding: 0.4em 0.6em; border-radius: 0.5em; border: 0.12em solid var(--line); }
.fill-result { display: flex; flex-direction: column; align-items: center; gap: 0.3em; }
.fill-line { font-size: 1.6em; font-weight: 800; padding: 0.2em 0.9em; border-radius: 0.6em; animation: pop 0.45s ease; }
.fill-line.ok { color: var(--ok); background: var(--ok-bg); }
.fill-line.bad { color: var(--bad); background: var(--bad-bg); }
.btn { font-size: 1.1em; font-weight: 700; padding: 0.6em 1.4em; border-radius: 0.7em; border: none; background: var(--primary); color: #fff; cursor: pointer; box-shadow: var(--shadow); }
.explain { color: var(--muted); font-size: 1.05em; text-align: center; max-width: 70vw; }

.host { position: absolute; left: 1.5vw; bottom: 1vh; height: 26vh; transition: transform 0.3s; }
.host.react { animation: hop 0.6s ease; }
.host.big { position: static; height: 38vh; }
.score-big { font-size: 2em; font-weight: 800; color: var(--primary); }

#screen-link { gap: 1.5vh; }
#screen-link .spacer { flex: 1; }
#screen-link a.btn { text-decoration: none; font-size: 0.8em; }
.show-image { flex: 1; min-height: 0; display: grid; place-items: center; overflow: auto; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); cursor: zoom-in; }
.show-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.show-image.zoom { cursor: zoom-out; place-items: start center; }
.show-image.zoom img { max-width: none; max-height: none; width: 100%; }
#link-frame { flex: 1; width: 100%; border: 0; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }

.controls { position: absolute; right: 2vw; bottom: 1.2vh; display: flex; gap: 0.8vw; z-index: 15; }
.controls button { width: 6.5vh; height: 6.5vh; min-width: 48px; min-height: 48px; border-radius: 50%; border: none; background: var(--card); box-shadow: var(--shadow); font-size: 1em; cursor: pointer; color: var(--ink); opacity: 0.85; }
.controls button:active { transform: scale(0.94); }
.controls button.ok { color: var(--ok); } .controls button.bad { color: var(--bad); }
#screen-link.is-link .img-only, #screen-link.is-image .link-only { display: none; }

.overlay { position: absolute; inset: 0; background: rgba(247, 248, 252, 0.82); display: grid; place-items: center; font-size: 2.4em; font-weight: 800; backdrop-filter: blur(4px); z-index: 20; }
#confetti { position: absolute; inset: 0; pointer-events: none; z-index: 30; }

/* Interactive video */
.video-wrap { position: relative; flex: 1; min-height: 0; margin-top: 1.2vh; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow); }
#video-player, .video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
#video-progress { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.4s ease; }
.video-glass { position: absolute; inset: 0; z-index: 2; } /* no taps into YouTube itself */
.video-wrap.waiting .video-glass { display: none; } /* until it plays, the child may also tap YouTube's own ▶ (phones need a tap on the video) */
.video-sound { position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); z-index: 5; border: none; border-radius: 99px; padding: 0.5em 1.2em; font-weight: 800; background: rgba(20, 40, 90, 0.85); color: #fff; font-size: 1em; cursor: pointer; }
/* While a question is asked the paused picture stays in view: video on the left, question on the right
   (on an upright screen: question below), so the children still see what the question is about. */
#video-player, .video-wrap iframe, .video-glass { transition: width 0.35s ease, height 0.35s ease; }
/* an iframe does not stretch between left/right, so its size is given directly */
.video-wrap.asking #video-player, .video-wrap.asking iframe, .video-wrap.asking .video-glass { width: 56%; right: auto; }
.video-wrap.asking .video-q { left: 56%; animation: slide-in 0.35s ease; padding: 2vh 2vw; gap: 0.55em; }
.video-wrap.asking .video-q .prompt { font-size: 1.3em; }
.video-wrap.asking .video-q .options { grid-template-columns: 1fr; gap: 0.45em; }
.video-wrap.asking .video-q .options.tf { grid-template-columns: 1fr 1fr; }
.video-wrap.asking .video-q .tile { font-size: 1.15em; min-height: min(9vh, 2.2em); }
.video-wrap.asking .video-q .pic { width: min(17vh, 6.5em); height: min(17vh, 6.5em); }
.video-wrap.asking .video-q .pic .e { font-size: min(9vh, 3.4em); }
.video-wrap.asking .video-q .verdict { font-size: 1.35em; }
.video-wrap.asking .video-q .fill-line { font-size: 1.2em; }
@media (max-aspect-ratio: 1/1) {
  .video-wrap.asking #video-player, .video-wrap.asking iframe, .video-wrap.asking .video-glass { width: 100%; height: 48%; bottom: auto; }
  .video-wrap.asking .video-q { left: 0; top: 48%; }
}
@keyframes slide-in { from { transform: translateX(8%); opacity: 0; } to { transform: none; opacity: 1; } }
.video-start { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 1.6em; font-weight: 800; padding: 0.6em 1.4em; border: none; border-radius: 0.8em; background: var(--primary); color: #fff; box-shadow: var(--shadow); cursor: pointer; z-index: 3; }
.video-q { position: absolute; inset: 0; z-index: 4; background: rgba(247, 248, 252, 0.97); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.7em; padding: 3vh 4vw; overflow: auto; text-align: center; animation: pop 0.35s ease; }
.video-q .when { color: var(--primary); font-weight: 800; font-size: 0.9em; }
.video-q .prompt { font-size: 1.6em; }
.video-q .options { width: min(100%, 1200px); }
.video-q .pics { display: flex; flex-wrap: wrap; gap: 1.2vw; justify-content: center; }
.video-q .pic { width: min(22vh, 10em); height: min(22vh, 10em); border-radius: var(--radius); border: 0.18em solid var(--line); background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; font-size: 1em; padding: 0.3em; }
.video-q .pic .e { font-size: min(11vh, 4.5em); line-height: 1; }
.video-q .pic .w { font-size: 0.9em; font-weight: 700; }
.video-q .pic, .video-q .pic:disabled { color: var(--ink); } /* disabled buttons would fade the emoji */
.video-q .pic.ok { background: var(--ok-bg); border-color: var(--ok); animation: pop 0.45s ease; }
.video-q .pic.bad { background: var(--bad-bg); border-color: var(--bad); animation: shake 0.45s ease; }
.video-q .pic.dim { opacity: 0.45; }
.video-q .verdict { font-size: 1.7em; font-weight: 800; }
.video-q .verdict.ok { color: var(--ok); } .video-q .verdict.bad { color: var(--bad); }

/* Games */
.chip.sel { outline: 0.18em solid var(--primary); background: var(--primary-soft); }
.chip.bad { background: var(--bad-bg); }
.chip.letter { color: #fff; min-width: 2.2em; text-align: center; border: none; }
.groups { display: flex; gap: 1.5vw; width: min(100%, 1500px); }
.group { flex: 1; min-height: 22vh; border-radius: var(--radius); border: 0.15em solid var(--g); background: color-mix(in srgb, var(--g) 12%, white); display: flex; flex-direction: column; align-items: center; gap: 0.25em; padding: 0.5em; cursor: pointer; font-size: 1em; color: var(--ink); }
.group-name { font-family: var(--brand-font); font-weight: 800; color: var(--g); font-size: 1.3em; }
.group-word { font-size: 1.05em; font-weight: 700; }
.memory { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 0.5em; width: min(100%, 1300px); }
.mcard { aspect-ratio: 4 / 3; border-radius: 0.6em; border: 0.12em solid var(--line); background: var(--primary); color: #fff; font-size: 1.05em; font-weight: 700; display: grid; place-items: center; cursor: pointer; padding: 0.3em; box-shadow: var(--shadow); }
.mcard.up { background: var(--card); color: var(--ink); }
.mcard.ok { background: var(--ok-bg); border-color: var(--ok); }
.mcard .back { font-size: 1.8em; }
.memoji { font-size: 1.8em; line-height: 1; }
.ws-wrap { display: flex; gap: 2vw; align-items: center; justify-content: center; width: 100%; }
.wsgrid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 0.12em; height: min(56vh, 50vw); aspect-ratio: 1; }
.wscell { border: none; border-radius: 0.25em; background: var(--card); font-family: var(--brand-font); font-weight: 800; font-size: 0.95em; color: var(--ink); cursor: pointer; padding: 0; }
.wscell.ok { background: var(--ok-bg); color: var(--ok); }
.wscell.start { background: var(--yellow); color: #fff; }
.wscell.bad { background: var(--bad-bg); }
.ws-list { flex-direction: column; max-width: 30vw; font-size: 0.75em; }
.flash { width: min(100%, 900px); min-height: 34vh; border-radius: var(--radius); border: none; background: var(--primary-soft); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3em; cursor: pointer; color: var(--ink); font-size: 1em; padding: 1em; }
.flash.back { background: #fff3d6; }
.hearts { font-size: 1.4em; }
.slots { display: flex; gap: 0.35em; }
.hslot { min-width: 1.2em; border-bottom: 0.12em solid var(--ink); font-family: var(--brand-font); font-weight: 800; font-size: 2em; text-align: center; }
.keys { display: flex; flex-wrap: wrap; gap: 0.3em; justify-content: center; width: min(100%, 1100px); }
.key { width: 2.3em; height: 2.3em; border-radius: 0.4em; border: 0.08em solid var(--line); background: var(--card); font-family: var(--brand-font); font-weight: 800; font-size: 1em; color: var(--ink); cursor: pointer; }
.key.ok { color: var(--ok); background: var(--ok-bg); } .key.bad { color: #b0b8cc; background: #edf2fc; }
.wheel-wrap { position: relative; width: min(46vh, 22em); aspect-ratio: 1; }
.wheel { width: 100%; height: 100%; border-radius: 50%; box-shadow: var(--shadow); border: 0.3em solid #fff; }
.wheel-pin { position: absolute; top: -0.4em; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 0.7em solid transparent; border-right: 0.7em solid transparent; border-top: 1.4em solid var(--ink); z-index: 2; }
.boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6em; }
.gift { width: 3.4em; height: 3.4em; border-radius: 0.6em; border: none; font-size: 1.5em; color: #fff; cursor: pointer; box-shadow: var(--shadow); }
.gift.used { background: #edf2fc; color: #b0b8cc; }

/* Games, phase 2 */
.qhead { display: flex; align-items: center; gap: 1vw; }
.speak { border: none; border-radius: 50%; width: 2.2em; height: 2.2em; background: var(--primary-soft); font-size: 1em; cursor: pointer; box-shadow: var(--shadow); }
.cw-wrap { display: flex; gap: 2vw; align-items: flex-start; justify-content: center; width: 100%; }
.cwgrid { display: grid; grid-template-columns: repeat(var(--w), 1fr); width: min(48vw, calc(54vh * var(--w) / var(--h))); aspect-ratio: calc(var(--w) / var(--h)); }
.cwcell { position: relative; }
.cwcell.on { background: #fff; border: 0.06em solid #8592b0; }
.cwcell.open { background: #ffe7b0; }
.cwnum { position: absolute; top: 0.05em; left: 0.15em; font-size: 0.45em; color: var(--ink); }
.cwletter { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--brand-font); font-weight: 800; color: var(--ok); font-size: 1.1em; }
.cw-clues { display: grid; grid-template-columns: 1fr 1fr; gap: 0.3em; max-width: 42vw; font-size: 0.7em; align-content: start; }
.cw-clues .cw-title { grid-column: 1 / -1; }
.cw-title { font-family: var(--brand-font); font-weight: 800; color: var(--primary); margin-top: 0.3em; }
.cw-clue { text-align: left; border: none; background: var(--card); border-radius: 0.5em; padding: 0.35em 0.6em; font-size: 1em; cursor: pointer; color: var(--ink); box-shadow: var(--shadow); }
.cw-clue.sel { background: #ffe7b0; } .cw-clue.ok { background: var(--ok-bg); color: var(--ok); } .cw-clue.bad { background: var(--bad-bg); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6em; width: min(100%, 1300px); }
.ftile { aspect-ratio: 4 / 3; border-radius: 0.7em; border: 0.15em solid var(--line); background: var(--card); color: var(--ink); font-size: 1em; font-weight: 700; display: grid; place-items: center; cursor: pointer; padding: 0.3em; box-shadow: var(--shadow); }
.ftile.seen { border-color: var(--ok); }
.fnum { color: #fff; font-family: var(--brand-font); font-size: 2em; font-weight: 800; }
.holes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2vw; }
.hole { width: min(18vh, 6em); height: min(14vh, 4.5em); border-radius: 50%; border: none; background: rgba(109, 76, 65, 0.22); font-family: var(--brand-font); font-weight: 800; font-size: 0.9em; color: var(--ink); cursor: default; }
.hole.up { background: var(--yellow); cursor: pointer; animation: pop 0.3s ease; }
.sky { position: relative; width: min(100%, 1300px); height: 42vh; border-radius: var(--radius); background: linear-gradient(#dff0ff, #f5f9ff); overflow: hidden; }
.balloon { position: absolute; bottom: -30%; transform: translateX(-50%); width: 7em; height: 8em; border-radius: 50% 50% 48% 48%; border: none; color: #fff; font-family: var(--brand-font); font-weight: 800; font-size: 0.9em; cursor: pointer; animation-name: rise; animation-timing-function: linear; animation-iteration-count: infinite; padding: 0.4em; }
.balloon.still { animation: none; bottom: 25%; }
.balloon.ok { background: var(--ok) !important; } .balloon.bad { background: var(--bad) !important; } .balloon.dim { opacity: 0.35; }
@keyframes rise { from { bottom: -30%; } to { bottom: 110%; } }
.rank { display: flex; flex-direction: column; gap: 0.35em; width: min(100%, 1100px); }
.rank-line { border: none; border-radius: 0.6em; padding: 0.5em 0.8em; color: #fff; font-size: 1.05em; font-weight: 700; text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.rank-line.placed { background: var(--primary-soft); color: var(--ink); }
.rank-line.ok { background: var(--ok-bg); color: var(--ok); } .rank-line.bad { background: var(--bad-bg); color: var(--bad); }
.speakcard { background: #7c3aed; color: #fff; } .speakcard.back { background: #fff; color: var(--ink); }

/* Teams & players on their phones */
.teams { position: absolute; top: 8.5vh; left: 50%; transform: translateX(-50%); display: flex; gap: 1vw; z-index: 12; font-size: 0.75em; }
.team { display: flex; align-items: center; gap: 0.5em; background: #fff; border: 0.15em solid var(--g); border-radius: 99px; padding: 0.25em 0.9em; box-shadow: var(--shadow); font-family: var(--brand-font); font-weight: 800; color: var(--ink); position: relative; }
.team-score { background: var(--g); color: #fff; border-radius: 99px; padding: 0 0.6em; }
.team.turn { transform: scale(1.12); background: color-mix(in srgb, var(--g) 15%, white); }
.team.win { transform: scale(1.15); }
.team-turn { font-size: 0.75em; color: var(--g); }
.players { position: absolute; left: 1.5vw; bottom: 1.5vh; z-index: 14; display: flex; gap: 0.6em; align-items: center; background: #fff; border-radius: 1em; padding: 0.5em 0.8em; box-shadow: var(--shadow); font-size: 0.7em; }
.players-qr { width: 5.5em; height: 5.5em; }
.players-qr svg { width: 100%; height: 100%; }
.players-url { font-weight: 700; }
.players-code { font-family: var(--brand-font); font-weight: 800; font-size: 1.8em; letter-spacing: 0.12em; color: var(--primary); }
.leaders { position: absolute; right: 1.5vw; top: 12vh; z-index: 13; background: #fff; border-radius: 1em; padding: 0.5em 0.8em; box-shadow: var(--shadow); font-size: 0.68em; min-width: 12em; }
.leaders-title { font-family: var(--brand-font); font-weight: 800; margin-bottom: 0.2em; }
.leader { display: flex; justify-content: space-between; gap: 1em; padding: 0.1em 0; }
.podium { display: flex; align-items: flex-end; gap: 1.5vw; margin-top: 1vh; }
.step { display: flex; flex-direction: column; align-items: center; gap: 0.2em; font-family: var(--brand-font); font-weight: 800; }
.step-block { width: 6em; border-radius: 0.6em 0.6em 0 0; display: grid; place-items: center; font-size: 1.4em; color: #fff; }
.s1 .step-block { height: 5.5em; background: var(--yellow); } .s2 .step-block { height: 4em; background: #9aa8c4; } .s3 .step-block { height: 3em; background: #d08a52; }
.step-score { font-size: 0.8em; color: var(--muted); }

/* Homework (solo) */
html.solo #btn-pause, html.solo [data-cmd="reveal"], html.solo [data-cmd="reset"] { display: none; }
.hw-form { display: flex; gap: 0.6em; }
.hw-form input { font-size: 1.1em; padding: 0.5em 0.8em; border-radius: 0.6em; border: 0.12em solid var(--line); min-width: 12em; }
.hw-err { color: var(--bad); font-weight: 700; }

/* Airplane & maze */
.air { position: relative; width: min(100%, 1300px); height: 40vh; border-radius: var(--radius); background: linear-gradient(#dff0ff, #f5f9ff); overflow: hidden; display: flex; flex-direction: column; }
.air-lane { flex: 1; cursor: pointer; border-bottom: 0.06em dashed #c9d8f0; }
.air-lane.on { background: rgba(30, 136, 255, 0.10); }
.plane { position: absolute; left: 1%; transform: translateY(-50%); font-size: 2.6em; transition: top 0.2s ease; }
.air-word { position: absolute; transform: translate(-50%, -50%); color: #fff; font-family: var(--brand-font); font-weight: 800; border-radius: 0.7em; padding: 0.35em 0.8em; white-space: nowrap; }
.air-word.ok { background: var(--ok) !important; } .air-word.bad { background: var(--bad) !important; } .air-word.dim { opacity: 0.35; }
.maze-wrap { display: flex; gap: 2vw; align-items: center; }
.maze { display: grid; grid-template-columns: repeat(9, 1fr); gap: 0.1em; height: min(46vh, 34vw); aspect-ratio: 1; }
.mcell { background: #fff; border-radius: 0.2em; display: grid; place-items: center; font-size: 0.9em; }
.mcell.wall { background: var(--ink); }
.mcell.exit { color: #fff; font-family: var(--brand-font); font-weight: 800; }
.maze-opts { display: flex; flex-direction: column; gap: 0.4em; }
.maze-opt { border-left: 0.35em solid; background: #fff; border-radius: 0.5em; padding: 0.35em 0.8em; font-weight: 700; box-shadow: var(--shadow); }
.maze-opt.ok { background: var(--ok-bg); color: var(--ok); } .maze-opt.bad { background: var(--bad-bg); color: var(--bad); } .maze-opt.dim { opacity: 0.45; }
.maze-pad { display: grid; grid-template-columns: repeat(4, auto); gap: 0.4em; }

/* Student phone (/s) */
html.student #btn-pause, html.student [data-cmd="reveal"], html.student [data-cmd="reset"], html.student #mute { display: none; }
html.student .teams, html.student .players, html.student .leaders, html.student .host { display: none !important; }
html.student .stage { padding-left: 3vw; padding-right: 3vw; }
html.student { --fs: clamp(15px, 4.2vw, 26px); }

/* Small TV viewports (e.g. 960×540 CSS px): less chrome, smaller host. */
@media (max-height: 620px) { .host { height: 20vh; } .stage { padding-left: 11vw; } .bar { font-size: 0.85em; } }

@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
@keyframes hop { 0% { transform: translateY(0); } 35% { transform: translateY(-5vh); } 70% { transform: translateY(0); } 85% { transform: translateY(-1.2vh); } 100% { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Emoji look the same everywhere (Noto Color Emoji web font); word pictures on cards */
.emoji, .memoji { font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif; }
.memoji-img { width: min(9vh, 2.6em); height: min(9vh, 2.6em); max-width: 100%; object-fit: contain; display: block; margin: 0 auto 4px; border-radius: 10px; background: #fff; }
.visual img { object-fit: contain; background: #fff; border-radius: 12px; }

/* ↶ · 🗑 · ✓ Έλεγχος under games that put pieces in order */
.fix-bar { display: flex; gap: 0.5em; justify-content: center; align-items: center; margin-top: 0.6em; flex-wrap: wrap; }
.fix-bar .btn.ghost { background: var(--card); color: var(--ink); border: 0.08em solid var(--line); min-width: 3em; }
.fix-bar .btn:disabled { opacity: 0.45; }
