:root {
  --bg: #46178f;
  --bg2: #2a0d5e;
  --card: #ffffff;
  --ink: #1d1033;
  --muted: #6b6280;
  --accent: #ff3d7f;
  --good: #26890c;
  --warn: #d89e00;
  --blue: #1368ce;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { background: var(--bg2); }
body {
  font-family: "Rubik", "Nunito", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  background: radial-gradient(circle at 20% 0%, #6a2fc0 0%, var(--bg) 40%, var(--bg2) 100%) fixed;
  color: var(--ink);
  min-height: 100vh;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.wide { max-width: 1400px; }
.center { text-align: center; }
.logo { color: #fff; font-weight: 900; font-size: 34px; letter-spacing: -1px; text-align: center; margin: 18px 0; }
.logo span { color: #ffd23f; }
.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: 0 8px 0 rgba(0,0,0,.18); margin-bottom: 16px; }
h1, h2, h3 { margin: 0 0 12px; }
.white { color: #fff; }
.muted { color: var(--muted); }
label { display: block; font-weight: 800; margin: 14px 0 6px; }
input[type=text], input[type=password], textarea, input[type=number] {
  width: 100%; font: inherit; font-size: 18px; padding: 12px 14px; border: 2px solid #ccc4dd; border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus { outline: 3px solid #ffd23f; border-color: var(--bg); }
textarea { resize: vertical; min-height: 90px; }
.big-input { font-size: 30px !important; text-align: center; font-weight: 900; letter-spacing: 6px; }
button, .btn {
  font: inherit; font-weight: 900; font-size: 18px; border: 0; border-radius: 10px; padding: 14px 22px; cursor: pointer;
  background: #333; color: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.3); transition: transform .05s;
}
button:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.3); }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-main { background: var(--accent); }
.btn-green { background: var(--good); }
.btn-blue { background: var(--blue); }
.btn-ghost { background: #eee; color: var(--ink); }
.btn-full { width: 100%; margin-top: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.err { color: #c0002a; font-weight: 800; margin-top: 10px; min-height: 1em; }

.avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.avatars button { font-size: 26px; padding: 4px 0; background: #f2eefa; box-shadow: none; border: 3px solid transparent; }
.avatars button.sel { border-color: var(--accent); background: #ffe3ee; }

.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.pcard { background: #fff; border-radius: 12px; padding: 12px; text-align: center; position: relative; animation: pop .3s ease; }
.pcard .av { font-size: 44px; line-height: 1.1; }
.pcard .nm { font-weight: 900; font-size: 18px; word-break: break-word; }
.pcard .bio { font-size: 13px; color: var(--muted); margin-top: 4px; word-break: break-word; }
.pcard.off { opacity: .5; }
.pcard .x { position: absolute; top: 4px; inset-inline-end: 4px; padding: 2px 8px; font-size: 14px; background: #eee; color: #900; box-shadow: none; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { background: rgba(255,255,255,.15); color: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 800; }

.target { width: 100%; border-radius: var(--radius); display: block; background: #000; aspect-ratio: 1; object-fit: cover; }
.attempt { display: flex; gap: 12px; align-items: flex-start; border-top: 1px solid #eee; padding: 12px 0; }
.attempt img, .attempt .ph { width: 110px; height: 110px; border-radius: 10px; object-fit: cover; flex: none; background: #f2eefa; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.attempt .info { flex: 1; min-width: 0; }
.attempt .pr { font-weight: 700; word-break: break-word; }
.bar { height: 14px; background: #eee; border-radius: 99px; overflow: hidden; margin: 6px 0; }
.bar > div { height: 100%; background: linear-gradient(90deg, #ff3d7f, #ffd23f, #26890c); background-size: 300px 100%; }
.score { font-weight: 900; font-size: 22px; }
.best { outline: 3px solid #ffd23f; border-radius: 10px; }
.spin { display: inline-block; width: 28px; height: 28px; border: 4px solid #ddd; border-top-color: var(--accent); border-radius: 50%; animation: s 1s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }
.tip { background: #fff7d6; border-radius: 8px; padding: 6px 10px; margin-top: 6px; font-size: 15px; }

/* host screen */
.code-box { background: #fff; border-radius: var(--radius); padding: 16px 24px; display: inline-block; text-align: center; }
.code-box .code { font-size: 64px; font-weight: 900; letter-spacing: 8px; color: var(--bg); line-height: 1; }
.lobby-top { display: flex; gap: 20px; align-items: center; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.qr { width: 170px; height: 170px; border-radius: 10px; background: #fff; padding: 6px; }
.url { font-size: 26px; font-weight: 900; color: var(--ink); }
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.host-target { max-height: 78vh; width: auto; max-width: 100%; margin: 0 auto; }
.prog { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eee; }
.prog .av { font-size: 28px; }
.prog .nm { font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dots span { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #ddd; margin-inline-start: 3px; }
.dots span.on { background: var(--accent); }
.grid-res { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.res { background: #fff; border-radius: 12px; padding: 10px; text-align: center; }
.res img, .res .ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #f2eefa; display: flex; align-items: center; justify-content: center; }
.res .rk { font-weight: 900; font-size: 20px; }
.res .pp { font-size: 13px; color: var(--muted); margin-top: 4px; word-break: break-word; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 16px; margin: 30px 0; }
.podium .step { background: #fff; border-radius: 12px 12px 0 0; width: 200px; text-align: center; padding: 14px; }
.podium .step .av { font-size: 60px; }
.podium .step .nm { font-weight: 900; font-size: 22px; }
.p1 { min-height: 280px; background: #ffd23f !important; }
.p2 { min-height: 220px; }
.p3 { min-height: 180px; }
.opt { display: flex; gap: 8px; flex-wrap: wrap; }
.opt button { background: #f2eefa; color: var(--ink); box-shadow: none; border: 3px solid transparent; }
.opt button.sel { border-color: var(--accent); background: #ffe3ee; }
.presets { max-height: 300px; overflow: auto; border: 1px solid #eee; border-radius: 10px; padding: 6px; }
.presets label { font-weight: 600; margin: 0; padding: 6px; display: flex; gap: 8px; align-items: center; }
.uploads { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 8px; }
.uploads img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.banner { background: #fff7d6; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-weight: 700; }
.hidden { display: none !important; }
#timer { font-weight: 900; font-size: 22px; background: #e53935; color: #fff; border-radius: 999px; padding: 2px 12px; }
#timer:empty { display: none; }
#timer.low { background: #ff3d7f; color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.1); } }
.fs-btn { position: fixed; top: 10px; left: 10px; padding: 8px 12px; font-size: 16px; background: rgba(255,255,255,.2); box-shadow: none; z-index: 5; }
.confetti { position: fixed; top: -50px; pointer-events: none; z-index: 10; animation: fall 3.5s linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
.about { color: rgba(255,255,255,.75); text-align: center; margin-top: 24px; font-size: 14px; }
.about h1 { font-size: 16px; margin: 0 0 4px; }
.about p { margin: 0; }
#lightbox { position: fixed; inset: 0; background: rgba(10,0,30,.88); z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; }
#lightbox .lb-inner { max-width: min(92vw, 900px); text-align: center; }
#lightbox img { max-width: 100%; max-height: 72vh; border-radius: 14px; display: block; margin: 0 auto; background: #fff; }
#lightbox .lb-cap { color: #fff; font-size: 20px; margin: 12px 0; word-break: break-word; }
.zoom { cursor: zoom-in; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.gallery .g { position: relative; cursor: zoom-in; }
.gallery .g img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.gallery .g .lab { font-size: 15px; margin-top: 2px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery .g .sc { position: absolute; top: 6px; inset-inline-start: 6px; background: rgba(0,0,0,.7); color: #fff; border-radius: 8px; padding: 1px 8px; font-size: 16px; font-weight: 900; }
.host-split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(360px, 1.2fr); gap: 20px; align-items: start; }
.host-split .sticky { position: sticky; top: 10px; }
@media (max-width: 900px) { .host-split { grid-template-columns: 1fr; } .host-split .sticky { position: static; } }
.mine { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; display: block; background: #f2eefa; cursor: zoom-in; }
.mine-ph { width: 100%; aspect-ratio: 1; border-radius: 14px; background: #f2eefa; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.attempt img { cursor: zoom-in; }

/* ---------- student game screen: always fits the phone screen ---------- */
body.in-game { min-height: 0; }
body.in-game .wrap { height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 8px 12px; }
body.in-game .logo { font-size: 20px; margin: 2px 0 6px; }
body.in-game .about { display: none; }
body.in-game #app { flex: 1; min-height: 0; overflow: auto; }
.play { height: 100%; display: flex; flex-direction: column; gap: 8px; }
.play .topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #fff; border-radius: 12px; padding: 8px 12px; font-size: 16px; flex: none; }
.play .topbar #timer { font-size: 18px; padding: 0 8px; background: #f2eefa; }
.play .pic { flex: 1; min-height: 120px; background: #fff; border-radius: 14px; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 6px; }
.play .pic img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; cursor: zoom-in; display: block; }
.pic-msg { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 18px; padding: 10px; }
.play .line { flex: none; background: #fff; border-radius: 12px; padding: 8px 12px; display: flex; gap: 10px; align-items: center; font-size: 15px; }
.play .line.err { color: #c0002a; font-weight: 800; }
.play .line .big { font-size: 24px; font-weight: 900; flex: none; }
.spin.sm { width: 18px; height: 18px; border-width: 3px; flex: none; }
.strip { flex: none; display: flex; gap: 6px; overflow-x: auto; }
.strip .th { position: relative; flex: none; cursor: zoom-in; border-radius: 8px; border: 3px solid transparent; }
.strip .th.best { border-color: #ffd23f; }
.strip .th img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; display: block; }
.strip .th span { position: absolute; bottom: 2px; inset-inline-start: 2px; background: rgba(0,0,0,.7); color: #fff; font-size: 11px; font-weight: 800; border-radius: 4px; padding: 0 3px; }
.compose { flex: none; display: flex; gap: 8px; align-items: stretch; }
.compose textarea { min-height: 0; height: 64px; font-size: 17px; padding: 8px 10px; resize: none; }
.compose button { flex: none; width: 92px; padding: 8px; font-size: 20px; }
body.compact .about { display: none; }
body.compact .logo { font-size: 24px; margin: 4px 0 8px; }
body.compact label { margin: 10px 0 4px; }
body.compact .card { padding: 14px 16px; }
body.compact .avatars { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 5px; }
body.compact .avatars button { font-size: 24px; padding: 3px 0; }
body.compact .btn-full { margin-top: 12px; }

#lightbox .lb-inner { max-width: min(96vw, 1300px); }
#lightbox img, #lightbox video { max-width: 100%; max-height: 84vh; border-radius: 14px; display: block; margin: 0 auto; background: #fff; }
.timebtns { gap: 6px; margin: 4px 0 0; }
.timebtns button { padding: 6px 10px; font-size: 15px; background: #f2eefa; color: var(--ink); box-shadow: none; }
video.target { background: #000; }
.prog.rank .pl { width: 36px; text-align: center; font-size: 20px; }
.prog.rank .up { color: #26890c; font-weight: 900; }
.prog.rank .down { color: #c0002a; font-weight: 900; }
.prog.rank .rp { color: var(--muted); font-weight: 800; }
.prog.rank .tot { font-size: 20px; min-width: 48px; text-align: end; }

.compose .mic { flex: none; width: 52px; padding: 0; font-size: 24px; background: #f2eefa; color: var(--ink); box-shadow: none; }
.compose .mic.on { background: #ff3d7f; color: #fff; animation: pulse 1s infinite; }
.play .line.understood { font-size: 14px; color: var(--muted); padding: 4px 12px; }

/* word bank for young children */
.wb { flex: none; background: #fff; border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.wb-tabs, .wb-words { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.wb-tabs::-webkit-scrollbar, .wb-words::-webkit-scrollbar { display: none; }
.wb button { flex: none; box-shadow: none; white-space: nowrap; }
.wb-tabs button { padding: 4px 10px; font-size: 14px; background: #f2eefa; color: var(--ink); }
.wb-tabs button.sel { background: var(--bg); color: #fff; }
.wb-words button { padding: 6px 12px; font-size: 17px; background: #fff7d6; color: var(--ink); border: 2px solid #ffd23f; }
.say { background: none; box-shadow: none; padding: 0 4px; font-size: 20px; color: inherit; }

.play .line.found { font-size: 14px; flex-wrap: wrap; gap: 4px 8px; padding: 4px 12px; }
.play .line.found span { background: #e3f8dc; color: #1d6b0a; border-radius: 999px; padding: 0 8px; font-weight: 800; }
.play .line.found b { margin-inline-start: auto; color: var(--muted); }
.up { color: #26890c; font-weight: 900; }
.prog .pl { width: 30px; text-align: center; flex: none; }
.prog.rank { animation: slidein .5s ease both; }
@keyframes slidein { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
.els { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin-bottom: 12px; }
.els .el { background: #f2eefa; border-radius: 999px; padding: 4px 12px; font-weight: 700; }
.els .el b { color: var(--bg); }

/* class vote */
.play .pic.voting { display: block; overflow-y: auto; padding: 6px; }
.vote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.vote { position: relative; padding: 0; border-radius: 10px; background: #f2eefa; box-shadow: none; border: 4px solid transparent; overflow: hidden; }
.vote img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.vote.on { border-color: #ff3d7f; }
.vote span { position: absolute; top: 4px; inset-inline-end: 4px; font-size: 26px; }
.play .line.vote-title { justify-content: space-between; }
.popular { display: flex; gap: 14px; align-items: center; background: #ffe3ee; border-radius: 14px; padding: 10px; margin-bottom: 12px; }
.popular img { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; cursor: zoom-in; }
.res .hearts { color: #ff3d7f; font-weight: 900; }

/* final screen: result + exit button always visible */
.final-top { flex: none; margin: 0; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.final-medal { font-size: 56px; line-height: 1; }
.leave-btn { flex: none; margin: 0; font-size: 20px; padding: 16px; }
.top-list { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 12px; }

/* hint */
.hint-btn { padding: 4px 10px; font-size: 15px; background: #ffd23f; color: var(--ink); box-shadow: none; }
.play .line.hint-line { flex-wrap: wrap; gap: 6px; background: #fff7d6; }
.hint-line button { padding: 4px 12px; font-size: 16px; background: #fff; color: var(--ink); border: 2px solid #ffd23f; box-shadow: none; }
/* clearer vote */
.vote-title { flex: none; display: flex; align-items: center; gap: 10px; background: #ff3d7f; color: #fff; border-radius: 12px; padding: 10px 12px; }
.vote-title.done { background: #26890c; }
.vote-title .vt-main { flex: 1; font-weight: 900; font-size: 18px; }
.vote-title .vt-hearts { font-size: 26px; letter-spacing: 2px; }
.vote-title .say { color: #fff; }
.vote span { font-size: 30px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.vote-grid.wants .vote:not(.on) { animation: wiggle 2.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 90%, 100% { transform: none; } 93% { transform: rotate(-2deg) scale(1.02); } 96% { transform: rotate(2deg) scale(1.02); } }
.vote.on { border-color: #ff3d7f; transform: scale(.96); }

/* no replay of animations when the screen refreshes */
.still .prog.rank, .still .step, .still .drumroll, .still .award, .still .fulllist { animation: none !important; opacity: 1 !important; }
.still .drumroll { display: none; }
/* sort buttons */
.sortbtns { gap: 6px; margin: 6px 0 0; }
.sortbtns button { padding: 4px 10px; font-size: 14px; background: #f2eefa; color: var(--ink); box-shadow: none; border: 2px solid transparent; }
.sortbtns button.sel { border-color: var(--accent); background: #ffe3ee; }
/* finale */
.finale .drumroll { font-size: 30px; font-weight: 900; animation: drum 2.6s ease both; }
@keyframes drum { 0% { opacity: 0; transform: scale(.6); } 15% { opacity: 1; transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: scale(1.1); } }
.finale .step { opacity: 0; animation: rise .8s cubic-bezier(.2, 1.4, .4, 1) both; }
.finale .p3 { animation-delay: 1s; }
.finale .p2 { animation-delay: 2.2s; }
.finale .p1 { animation-delay: 3.5s; box-shadow: 0 0 0 6px #fff3, 0 0 60px 10px #ffd23f; }
@keyframes rise { from { opacity: 0; transform: translateY(120px) scale(.8); } to { opacity: 1; transform: none; } }
.finale .p1 .av { animation: bounce 1s ease-in-out 4.3s 3; }
@keyframes bounce { 50% { transform: translateY(-14px) scale(1.15); } }
.finale .award { opacity: 0; animation: rise .7s ease 5s both; }
.finale .fulllist { opacity: 0; animation: fadein .8s ease 5.6s both; }
@keyframes fadein { to { opacity: 1; } }

/* AI video versions */
.vpanel { margin: 10px auto 0; max-width: 640px; padding: 10px 12px; text-align: start; }
.vchip { padding: 4px 10px; font-size: 14px; background: #f2eefa; color: var(--ink); box-shadow: none; border: 2px solid transparent; border-radius: 999px; display: inline-flex; gap: 4px; align-items: center; }
.vchip.sel { border-color: var(--accent); background: #ffe3ee; }
.vchip.wait { background: #fff7d6; }
.vchip.bad { background: #fde2e2; color: #900; }

/* students' videos */
.gallery .g video, .res video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; background: #000; }
.play .pic video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; display: block; cursor: zoom-in; }
.vbadge { position: absolute; top: 6px; inset-inline-end: 6px; background: rgba(0,0,0,.65); color: #fff; border-radius: 6px; padding: 0 5px; font-size: 14px; }
.vote { position: relative; }

/* no projector: class picture + own try on the student's screen */
.play .pic:has(.dual) { padding: 4px; }
.dual { display: flex; flex-direction: column; gap: 6px; width: 100%; height: 100%; }
@media (orientation: landscape) { .dual { flex-direction: row; } }
.dual figure { flex: 1; min-height: 0; min-width: 0; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #f6f3fc; border-radius: 10px; padding: 4px; }
.dual figure img, .dual figure video { flex: 1; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; cursor: zoom-in; }
.dual figure .pic-msg { flex: 1; font-size: 15px; }
.dual figcaption { flex: none; font-size: 13px; font-weight: 800; color: var(--muted); padding-top: 2px; }

/* timer: always red so it's easy to see */
.play .topbar #timer { background: #e53935; color: #fff; font-size: 20px; padding: 2px 12px; box-shadow: 0 2px 6px rgba(229, 57, 53, .35); }
.play .topbar #timer.low { background: #b00020; }

/* No projector: on a PC the page gets wider so both pictures can be big */
@media (min-width: 900px) {
  body.in-game .wrap:has(.dual) { max-width: min(1500px, 100%); }
}
.dual { gap: 10px; }
.dual figure { background: linear-gradient(#f8f5fe, #efe9fb); padding: 8px; border-radius: 14px; }
.dual figure img, .dual figure video { border-radius: 12px; }
.dual figure { box-shadow: inset 0 0 0 2px #e6defa; }
.dual figcaption { font-size: 15px; padding-top: 6px; }

/* ---------- final picture choice ---------- */
.strip.pickable { background: #fff; border-radius: 12px; padding: 6px 8px; align-items: center; }
.strip .strip-lab { flex: none; font-size: 13px; font-weight: 800; line-height: 1.2; padding-inline-end: 4px; }
.strip .strip-lab .muted { font-weight: 600; font-size: 12px; }
.strip button.th { padding: 0; background: none; box-shadow: none; cursor: pointer; }
.strip .th.final { border-color: #ffb300; box-shadow: 0 0 0 2px #fff3c4; }
.strip .th.final span { background: #ffb300; color: #3a2400; }
@media (min-width: 900px) { .strip .th img { width: 68px; height: 68px; } }

/* ---------- no projector: picture layout by screen ---------- */
.dual { position: relative; }
.dual figure.t figcaption { color: #4a2bb0; }
/* phones / tall screens: class picture big, the child's own small in the corner (tap to swap) */
@media (orientation: portrait) {
  .dual.two { display: block; }
  .dual.two figure { position: absolute; inset: 0; }
  .dual.two:not(.swap) figure.m, .dual.two.swap figure.t {
    inset: auto; bottom: 10px; left: 10px; width: 40%; height: 42%; z-index: 2; padding: 4px;
    background: #fff; border: 3px solid #fff; box-shadow: 0 6px 18px rgba(30, 0, 80, .35); cursor: pointer;
  }
  .dual.two:not(.swap) figure.m figcaption, .dual.two.swap figure.t figcaption { font-size: 11px; padding-top: 2px; }
  .dual.two:not(.swap) figure.m figcaption::after, .dual.two.swap figure.t figcaption::after { content: ' · 🔄'; }
  .dual.two:not(.swap) figure.m img, .dual.two.swap figure.t img { cursor: pointer; }
  .dual.two .pic-msg { font-size: 13px; padding: 4px; }
}
/* wide screens: side by side, the class picture a little bigger */
@media (orientation: landscape) {
  .dual.two figure.t { flex: 1.15; }
}
/* short screens (laptops): give the pictures every pixel */
@media (max-height: 760px) {
  body.in-game .logo { display: none; }
  body.in-game .wrap { padding-top: 6px; }
}

/* reveal without a projector: the secret picture and the class's top 3 */
.play .line.secret img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; cursor: zoom-in; flex: none; }
.play .line.classtop { gap: 6px; overflow-x: auto; padding: 6px 8px; }
.play .line.classtop .ct { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px; background: #f6f3fc; box-shadow: none; border-radius: 10px; color: inherit; font-size: 12px; font-weight: 800; cursor: zoom-in; }
.play .line.classtop .ct img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; display: block; }

/* ---------- teacher message ---------- */
#tmsg { position: fixed; inset: 0; z-index: 60; background: rgba(20, 0, 50, .55); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn .2s; }
#tmsg .tmsg-in { background: #fff; border-radius: 20px; padding: 20px 22px; max-width: 560px; width: 100%; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.35); border: 4px solid #ffd23f; animation: popIn .35s cubic-bezier(.2, 1.4, .4, 1); }
#tmsg .tmsg-h { font-weight: 900; color: #6a3de8; font-size: 18px; }
#tmsg .tmsg-t { font-size: clamp(24px, 6vw, 40px); font-weight: 900; margin: 10px 0 16px; line-height: 1.25; overflow-wrap: anywhere; }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.msgbox { margin: 10px 0; }
.msgbox .quick button { font-size: 13px; padding: 4px 10px; background: #f2eefa; color: var(--ink); box-shadow: none; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 800; z-index: 70; }
.scbanner { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: #fff5f5; border-color: #ffc9c9; }
.scbanner button { padding: 6px 16px; font-size: 16px; }

/* difficulty 1-10 */
.opt.levels button { min-width: 44px; font-weight: 900; border-bottom: 4px solid var(--lc, #ccc); }
.opt.levels button.sel { background: var(--lc, #6a3de8); color: #fff; }
.lvl-hint { margin: 4px 0 8px; font-weight: 700; }

/* ---------- drawing & animation slides ---------- */
@media (min-width: 900px) { body.in-game .wrap:has(.play.art), body.in-game .wrap:has(.play.game) { max-width: min(1700px, 100%); } }
.play.art { gap: 6px; }
.play .line.goal { font-size: 17px; flex-wrap: wrap; gap: 8px; }
.play .line.goal .g-emoji { font-size: 28px; }
.play .line.result { flex-wrap: wrap; gap: 6px 10px; }
.art-title { font-weight: 900; color: #6a3de8; }
.studio-host { flex: 1; min-height: 0; display: flex; }
.studio { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.st-stage { flex: 1; min-height: 140px; display: flex; align-items: center; justify-content: center; position: relative; }
.st-wrap { position: relative; border-radius: 14px; overflow: hidden; box-shadow: 0 4px 18px rgba(30, 0, 80, .25); }
.st-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.st-onion { opacity: .28; pointer-events: none; }
.st-main { touch-action: none; cursor: crosshair; }
.st-play { z-index: 3; }
.st-bar { flex: none; display: flex; gap: 6px; align-items: center; overflow-x: auto; background: #fff; border-radius: 12px; padding: 5px 6px; scrollbar-width: thin; }
.st-bar .grp { display: flex; gap: 4px; align-items: center; padding-inline-end: 6px; border-inline-end: 1px solid #eee; flex: none; }
.st-bar .grp:last-child { border: 0; }
.st-bar button { padding: 4px 8px; font-size: 18px; background: #f4f1fb; color: var(--ink); box-shadow: none; border-radius: 10px; line-height: 1.1; display: flex; flex-direction: column; align-items: center; min-width: 38px; }
.st-bar button small { font-size: 10px; font-weight: 800; }
.st-bar button.sel { background: #6a3de8; color: #fff; }
.st-bar button:disabled { opacity: .35; }
.st-bar .sw { width: 26px; min-width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid #ddd; }
.st-bar .sw.sel { outline: 3px solid #6a3de8; outline-offset: 1px; }
.st-bar .sz i { display: block; border-radius: 50%; background: #333; }
.st-bar .sz.sel i { background: #fff; }
.st-bar .auto-btn { flex-direction: row; gap: 4px; font-size: 15px; font-weight: 900; background: linear-gradient(90deg, #ffd23f, #ff9de2); }
.st-frames .fr { position: relative; padding: 2px; background: #fff; border: 2px solid #ddd; }
.st-frames .fr canvas { width: 64px; height: 48px; border-radius: 6px; display: block; }
.st-frames .fr b { position: absolute; top: 1px; inset-inline-start: 3px; font-size: 11px; color: #555; }
.st-frames .fr.sel { border-color: #6a3de8; background: #efe9ff; }
.st-frames .play-btn { flex-direction: row; gap: 4px; font-size: 15px; font-weight: 900; background: #43a047; color: #fff; }
.st-suggest { flex: none; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; background: #fff7d6; border-radius: 12px; padding: 6px 8px; font-size: 14px; }
.st-suggest button { display: flex; align-items: center; gap: 4px; padding: 4px 10px; background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.st-suggest .em { font-size: 26px; }
.send-art { flex: none; font-size: 20px; }
.kit-silk .st-bar { background: #1b1033; }
.kit-silk .st-bar button { background: #2c1d52; color: #fff; }
.kit-silk .st-bar button.sel { background: #b388ff; color: #1b1033; }
@media (max-height: 700px) { .st-bar button small { display: none; } }

/* ---------- pairs (student) ---------- */
.pchip { background: #e8f7ff; border-radius: 999px; padding: 0 8px; font-size: 18px; }
.pairpick .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pairpick .chip { font-size: 18px; padding: 8px 14px; background: #f4f1fb; color: var(--ink); cursor: pointer; }
.line.pairline { font-size: 16px; justify-content: center; }

/* ---------- mini-games ---------- */
.play.game { gap: 6px; }
.giveup { flex: none; font-size: 14px; padding: 6px; }
/* coding maze */
.maze-game { flex: 1; min-height: 0; display: flex; gap: 10px; width: 100%; }
@media (orientation: portrait) { .maze-game { flex-direction: column; } }
.mz-board { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-template-rows: repeat(var(--n), minmax(0, 1fr)); gap: 3px; background: #2d1b5e; padding: 6px; border-radius: 14px; aspect-ratio: 1; max-height: 100%; max-width: 100%; align-self: center; flex: none; height: min(100%, 62vh); }
@media (orientation: portrait) { .mz-board { height: auto; width: min(100%, 44vh); } }
.mz-board.mini { width: 220px; height: 220px; margin: 10px auto 0; gap: 2px; padding: 4px; }
.mz-board.mini .mc { font-size: 16px; }
.mc { border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: clamp(14px, 3.4vmin, 30px); position: relative; }
.mc.wall { background: #4a3584; }
.mc.open { background: #f6f1ff; }
.mc.trail { background: #d9f7d0; }
.bot { display: inline-block; transition: transform .2s; position: relative; line-height: 1; }
.bot i { position: absolute; top: -.55em; left: 50%; transform: translateX(-50%); font-size: .45em; color: #e53935; font-style: normal; }
.bot.crash { animation: shake .4s; }
.mz-side { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.mz-palette, .mz-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mz-actions button { padding: 8px 14px; }
.blk { font-weight: 900; border-radius: 10px; padding: 8px 12px; color: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.2); font-size: 16px; }
.blk.b-f { background: #1e88e5; } .blk.b-l { background: #8e24aa; } .blk.b-r { background: #00897b; } .blk.b-rep { background: #fb8c00; }
.mz-prog { flex: 1; min-height: 80px; overflow: auto; background: #fff; border-radius: 12px; padding: 8px; }
.mz-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 6px; }
.mz-head button { padding: 2px 8px; font-size: 13px; }
.mz-list { display: flex; flex-wrap: wrap; gap: 5px; align-items: flex-start; }
.mz-list .blk { padding: 5px 9px; font-size: 14px; }
.mz-list .b-rep { display: flex; flex-direction: column; gap: 4px; padding: 5px; width: 100%; }
.mz-list .b-rep.tgt { outline: 3px dashed #ffd23f; }
.rep-h { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.rep-h button { padding: 0 8px; font-size: 14px; background: rgba(255,255,255,.3); color: #fff; box-shadow: none; }
.rep-h .x { margin-inline-start: auto; }
.rep-b { display: flex; flex-wrap: wrap; gap: 4px; background: rgba(255,255,255,.85); border-radius: 8px; padding: 5px; min-height: 34px; color: var(--ink); }
.mz-msg { font-weight: 800; font-size: 15px; min-height: 1.3em; }
/* escape room */
.escape-game { flex: 1; min-height: 0; overflow: auto; width: 100%; background: linear-gradient(160deg, #2b1a55, #4b2b8f); border-radius: 16px; color: #fff; padding: 12px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.estory { font-size: 17px; font-weight: 700; text-align: center; }
.edots { display: flex; gap: 8px; }
.ed { background: rgba(255,255,255,.12); border-radius: 12px; padding: 4px 10px; font-size: 20px; display: flex; flex-direction: column; align-items: center; }
.ed b { font-size: 16px; } .ed.now { outline: 2px solid #ffd23f; } .ed.ok { background: rgba(120,255,120,.25); }
.epuz { background: #fff; color: var(--ink); border-radius: 16px; padding: 14px; width: min(560px, 100%); text-align: center; display: flex; flex-direction: column; gap: 10px; }
.epuz.shake { animation: shake .4s; }
.et { font-weight: 900; font-size: 18px; color: #6a3de8; }
.eq { font-size: clamp(20px, 4vw, 30px); font-weight: 900; }
.egrid { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; font-size: 30px; }
.eopts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.eopts button { font-size: 24px; padding: 10px 18px; background: #f4f1fb; color: var(--ink); }
.einput { font-size: 34px; font-weight: 900; letter-spacing: 6px; min-height: 1.3em; direction: ltr; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 280px; margin: 0 auto; width: 100%; }
.keypad button { font-size: 22px; padding: 10px 0; background: #f4f1fb; color: var(--ink); }
.emsg { font-weight: 900; min-height: 1.3em; } .emsg.good { color: #b9ffb0; } .emsg.bad { color: #ffb3b3; }
.escape-game.opened .door { animation: popIn .5s; background: #d9f7d0; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
/* teacher: goal card */
.goal-card { background: #fff; border-radius: 18px; padding: 20px; text-align: center; max-width: 560px; margin: 0 auto; }
.goal-card .ge { font-size: 80px; line-height: 1.1; }
.goal-card .gt { font-size: 30px; font-weight: 900; }
.goal-card .gs { color: var(--muted); font-weight: 700; margin-top: 6px; }
/* teacher: pairs panel & special setup */
.pairs-panel { background: #f6f3fc; border-radius: 12px; padding: 8px 10px; margin: 8px 0; }
.pairs-panel summary { cursor: pointer; font-weight: 800; }
.pairs-panel .pbtns { gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.pairs-panel button { padding: 4px 10px; font-size: 14px; background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.pairs-panel button.sel { background: #6a3de8; color: #fff; }
.pairs-panel .teams { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pairs-panel .team { background: #e8f7ff; border-radius: 999px; padding: 2px 4px 2px 10px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.pairs-panel .team button { padding: 0 6px; font-size: 12px; }
.pairs-panel .free { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.prog .pt { font-size: 14px; }
.special .kcount { display: flex; flex-wrap: wrap; gap: 8px; }
.special .kc { display: flex; align-items: center; gap: 6px; background: #f6f3fc; border-radius: 12px; padding: 6px 10px; font-weight: 800; }
.special .kc button { padding: 2px 10px; font-size: 18px; }
.special .kc b { min-width: 18px; text-align: center; font-size: 18px; }
.special .slides { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.special .slide-row { display: flex; align-items: center; gap: 8px; background: #fff; border: 2px solid #eee; border-radius: 12px; padding: 6px 8px; flex-wrap: wrap; }
.special .slide-row .n { width: 22px; text-align: center; }
.special .slide-row .kind { font-weight: 800; min-width: 112px; }
.special .slide-row input { flex: 1; min-width: 160px; margin: 0; padding: 8px 10px; font-size: 16px; }
.special .slide-row select { padding: 8px; border-radius: 10px; font: inherit; }
.special .slide-row .grow { flex: 1; }
.special .slide-row .mv { display: flex; gap: 3px; }
.special .slide-row .mv button { padding: 4px 8px; font-size: 13px; }
.special .k-anim { border-color: #ffd0e6; } .special .k-draw { border-color: #d6e8ff; } .special .k-code { border-color: #ffe2b8; } .special .k-escape { border-color: #d7f3d0; }

/* special setup: number boxes */
.special .kc input { width: 52px; margin: 0; padding: 4px; text-align: center; font-size: 18px; font-weight: 900; }
.special .slide-row .mini { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; color: var(--muted); margin: 0; }
.special .slide-row .mini input { width: 58px; min-width: 0; flex: none; padding: 6px; text-align: center; font-size: 15px; }
/* the best works with all the details */
.art-top { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.art-top .at { background: #fff; border-radius: 18px; padding: 10px; width: 300px; text-align: center; position: relative; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.art-top .at:first-child { order: 0; transform: scale(1.06); }
.art-top .at img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; cursor: zoom-in; background: #111; }
.art-top .medal { position: absolute; top: -14px; inset-inline-start: -10px; font-size: 40px; }
.art-top .who { font-weight: 900; font-size: 18px; margin-top: 6px; }
.art-top .sc b { font-size: 26px; } .art-top .sc .t { font-weight: 800; color: #6a3de8; }
.art-top .tip { color: var(--muted); font-size: 14px; margin-top: 4px; }
.play .line.arttop .ct .d { font-weight: 700; color: #6a3de8; font-size: 11px; }
.play .line.arttop .ct { max-width: 120px; }
.play .line.arttop .ct span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 112px; }
/* bigger pictures to vote on when there are only a few */
.vote-grid:has(> .vote:nth-child(-n+4):last-child) { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.vote-grid:has(> .vote:nth-child(5)) { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.vote img { aspect-ratio: 4/3; }
/* escape room: everything fits on the screen */
.escape-game { gap: 8px; padding: 10px; }
.estory { font-size: 15px; }
.epuz { width: min(900px, 100%); gap: 8px; padding: 12px; }
.ebody { display: flex; gap: 16px; align-items: center; justify-content: center; flex-wrap: wrap; }
.eleft { flex: 1 1 260px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.eright { flex: 0 1 300px; display: flex; flex-direction: column; gap: 6px; }
.egrid { font-size: 26px; gap: 4px; max-width: 380px; }
.egrid.many { font-size: 21px; }
.keypad button { padding: 7px 0; font-size: 20px; }
.einput { font-size: 28px; }
/* choosing a partner: big buttons that clearly look tappable */
.pairpick { border: 3px solid #ffd23f; }
.pairpick .chip { font-size: 20px; padding: 10px 16px; background: #fff; border: 2px solid #6a3de8; color: var(--ink); box-shadow: 0 3px 0 #6a3de8; border-radius: 14px; font-weight: 800; }
.pairpick .chip:active { transform: translateY(2px); box-shadow: 0 1px 0 #6a3de8; }
.line.pairline { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; background: #e8f7ff; border-radius: 14px; padding: 10px 14px; font-size: 18px; margin-bottom: 10px; }
/* escape room in pairs: each one's track of locks, helping, and the door with everyone's digits */
.edots.team { flex-direction: column; gap: 4px; align-items: stretch; }
.etrack { display: flex; gap: 6px; align-items: center; justify-content: center; }
.etrack .en { font-weight: 800; font-size: 14px; min-width: 90px; text-align: end; }
.etrack.self .en { color: #ffd23f; }
.ed.sm { font-size: 15px; padding: 2px 7px; opacity: .85; }
.ehelp { background: #e3f8dc; color: #1d6b0a; font-weight: 900; border-radius: 10px; padding: 6px 10px; }
.epuz.helping { outline: 3px dashed #43a047; }
.eslots { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.eslot { display: flex; align-items: center; gap: 3px; background: #f4f1fb; border-radius: 10px; padding: 4px 8px; font-size: 26px; }
.eslot small { font-size: 12px; color: var(--muted); margin-inline-end: 4px; }
.eslot.self { background: #fff3c4; }
.etalk { font-weight: 900; color: #6a3de8; }
/* escape room: compact top part so the puzzle and the door fit on a laptop screen */
.edots.team .ed { padding: 2px 8px; font-size: 17px; flex-direction: row; gap: 4px; }
.edots.team .ed.sm { font-size: 14px; }
.escape-game .estory { margin-bottom: -2px; }

/* ---------- partners talk: quick messages ---------- */
button.pchip { border: 0; cursor: pointer; color: inherit; font: inherit; font-size: 17px; padding: 2px 10px; box-shadow: 0 2px 0 #9fd3ee; }
#chatpop { position: fixed; inset: 0; z-index: 80; background: rgba(20, 0, 50, .35); display: flex; align-items: flex-start; justify-content: center; padding: 60px 12px 12px; }
#chatpop .cp-in { background: #fff; border-radius: 18px; padding: 12px; width: min(560px, 100%); box-shadow: 0 16px 40px rgba(0,0,0,.35); animation: popIn .25s; }
#chatpop .cp-h { display: flex; justify-content: space-between; align-items: center; font-weight: 900; margin-bottom: 8px; }
#chatpop .cp-h button { padding: 2px 8px; background: #f2eefa; box-shadow: none; }
#chatpop .cp-list { display: flex; flex-wrap: wrap; gap: 8px; }
#chatpop .cp-list button { font-size: 17px; padding: 8px 12px; background: #f4f1fb; color: var(--ink); box-shadow: 0 2px 0 #d8cff0; }
#chatpop .cp-list button.hot { background: #ffd23f; font-weight: 900; }
#bubbles { position: fixed; top: 56px; left: 50%; transform: translateX(-50%); z-index: 75; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(560px, 92vw); }
.bubble { background: #fff; border: 3px solid #00bcd4; border-radius: 18px; padding: 8px 14px; font-size: 18px; box-shadow: 0 8px 22px rgba(0,0,0,.25); animation: popIn .3s; }
/* where my partner is, on the frame strip */
.st-frames .fr .pw { position: absolute; bottom: 0; inset-inline-end: 1px; font-style: normal; font-size: 16px; background: #fff; border-radius: 50%; line-height: 1; padding: 1px; box-shadow: 0 0 0 2px #00bcd4; }
/* my partner's brush on my board */
.st-cursors { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.pcur { position: absolute; transform: translate(-50%, -50%); transition: left .09s linear, top .09s linear, opacity .3s; display: flex; flex-direction: column; align-items: center; }
.pcur i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #00bcd4; background: rgba(0, 188, 212, .2); box-shadow: 0 0 0 2px #fff; }
.pcur.down i { width: 24px; height: 24px; background: rgba(0, 188, 212, .45); }
.pcur span { font-size: 18px; margin-top: 1px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.pcur.away { opacity: .3; }
.pcur.gone { opacity: 0; }

/* ---------- teacher's slide screen: big picture, students' pictures in a strip, controls in a pop-up ---------- */
.wrap:has(.stage) { max-width: 1600px; }
.stage { display: flex; flex-direction: column; gap: 10px; min-height: calc(100vh - 110px); }
.stage-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stage-top h2 { margin: 0; }
.stage-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stage-actions .pill { background: rgba(255,255,255,.18); color: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 800; }
.stage-actions button { padding: 8px 14px; font-size: 16px; }
.stage-main { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.stage-main .stage-target { max-height: calc(100vh - 330px); min-height: 260px; width: auto; max-width: 100%; border-radius: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.35); cursor: zoom-in; }
.stage-main .goal-card { transform: scale(1.15); margin: 20px auto; }
.stage-strip { display: flex; gap: 10px; overflow-x: auto; padding: 6px 4px 10px; min-height: 60px; align-items: flex-start; scrollbar-width: thin; }
.stage-strip .g { flex: none; width: 170px; }
.stage-strip.chips { flex-wrap: wrap; overflow: visible; justify-content: center; }
.pchipT { background: #fff; border-radius: 999px; padding: 4px 12px; font-weight: 700; }
.pchipT b { color: #6a3de8; margin-inline-start: 4px; }
.pchipT.off { opacity: .5; }
.stage-foot { text-align: center; color: rgba(255,255,255,.8); font-size: 15px; }
.pop-bg { position: fixed; inset: 0; background: rgba(10, 0, 30, .45); z-index: 12; }
.drawer { position: fixed; top: 72px; bottom: 0; border-radius: 18px 0 0 0; inset-inline-end: 0; width: min(480px, 94vw); background: #fff; z-index: 13; overflow-y: auto; padding: 14px 16px; box-shadow: 0 0 40px rgba(0,0,0,.35); animation: slideIn .2s ease-out; }
.drawer-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.drawer-h h3 { margin: 0; }
.drawer-h button { padding: 4px 10px; background: #f2eefa; box-shadow: none; }
.picsmodal { position: fixed; inset: 3vh 3vw; background: #fff; z-index: 13; border-radius: 18px; padding: 14px; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.4); animation: popIn .2s; }
.gallery.big { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
@keyframes slideIn { from { transform: translateX(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
.stage-strip .g { position: relative; cursor: zoom-in; background: #fff; border-radius: 12px; padding: 5px; }
.stage-strip .g img, .stage-strip .g video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; display: block; }
.stage-strip .g .lab { font-size: 14px; margin-top: 3px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.stage-strip .g .sc, .gallery.big .g .sc { position: absolute; top: 9px; inset-inline-end: 9px; background: rgba(0,0,0,.72); color: #fff; font-weight: 900; border-radius: 8px; padding: 1px 7px; }

#tools.sel { background: #ffd23f; color: #3a2400; }
/* wide screens (the board): picture on one side, the students' pictures in a column next to it */
body:has(.stage) .logo { display: none; }
@media (min-width: 1000px) {
  .stage { display: grid; grid-template-columns: minmax(0, 1fr) 310px; grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px 16px; height: calc(100vh - 40px); min-height: 0; }
  .stage-top { grid-column: 1 / -1; }
  .stage-main { grid-column: 1; grid-row: 2; }
  .stage-main .stage-target { max-height: calc(100vh - 150px); }
  .stage-strip { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; align-content: start; overflow-y: auto; overflow-x: hidden; background: rgba(255,255,255,.08); border-radius: 16px; padding: 8px; }
  .stage-strip .g { width: auto; }
  .stage-strip.chips { display: flex; flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; overflow-y: auto; }
  .stage-foot { grid-column: 1 / -1; }
  .drawer { top: 64px; }
}
/* the picture fills the space (enlarged, never stretched) */
.stage-main .stage-target { width: 100%; height: calc(100vh - 330px); max-height: none; object-fit: contain; box-shadow: none; border-radius: 0; filter: drop-shadow(0 10px 28px rgba(0,0,0,.4)); }
@media (min-width: 1000px) { .stage-main .stage-target { height: calc(100vh - 150px); } }
.stage-main .stage-target { background: transparent; }
.stage-top { padding-inline-end: 120px; } /* room for the "full screen" button */
/* goal cards and the maze preview, big on the board */
.stage-main .goal-card { transform: none; max-width: min(900px, 100%); padding: 28px 36px; }
.stage-main .goal-card .ge { font-size: clamp(90px, 16vh, 170px); }
.stage-main .goal-card .gt { font-size: clamp(34px, 5.5vh, 60px); }
.stage-main .goal-card .gs { font-size: clamp(17px, 2.6vh, 26px); }
.stage-main .mz-board.mini { width: min(46vh, 440px); height: min(46vh, 440px); }
.stage-main .mz-board.mini .mc { font-size: clamp(16px, 3.4vh, 34px); }
.stage-strip.chips .pchipT { font-size: 17px; }
/* live ranking next to the picture */
.stage-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.liverank { background: #fff; border-radius: 16px; padding: 8px 10px; overflow-y: auto; max-height: 45vh; flex: none; }
.liverank .lr-h { font-weight: 900; font-size: 18px; margin-bottom: 4px; }
.liverank .lr { display: flex; align-items: center; gap: 6px; padding: 3px 0; border-bottom: 1px solid #f0ecf8; font-size: 16px; }
.liverank .lr .pl { width: 28px; text-align: center; }
.liverank .lr .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.liverank .lr .rp { color: #2e7d32; font-weight: 800; font-size: 14px; }
.liverank .lr .tot { min-width: 34px; text-align: end; font-size: 18px; }
.liverank .lr.zero { opacity: .65; }
@media (min-width: 1000px) {
  .stage-side { grid-column: 2; grid-row: 2; }
  .stage-side .stage-strip { flex: 1; min-height: 0; }
}
/* maze: new blocks */
.blk.b-until { background: #e65100; } .blk.b-if { background: #c2185b; }
.mz-list .b-until, .mz-list .b-if { display: flex; flex-direction: column; gap: 4px; padding: 5px; width: 100%; }
.mz-list .rep-b.tgt { outline: 3px dashed #ffd23f; outline-offset: 1px; }
.rep-h .cond { background: #fff; color: #c2185b; font-weight: 900; }
.else-l { font-size: 13px; font-weight: 900; padding: 0 4px; }
.rep-b { cursor: pointer; }
/* animation with an AI helper */
.st-guide { opacity: .32; pointer-events: none; }
.st-tip { flex: none; background: #fff7d6; border: 2px solid #ffd23f; border-radius: 12px; padding: 6px 10px; font-size: 16px; }
.st-tip .muted { font-size: 13px; }
.special .k-animai { border-color: #ffe08a; }
/* escape room: new tasks and the win screen */
.eclock { width: min(190px, 40vw); height: auto; }
.erows { display: flex; flex-direction: column; gap: 6px; }
.erows div { display: flex; gap: 6px; align-items: center; font-size: 30px; justify-content: center; }
.erows small { font-size: 12px; color: var(--muted); width: 40px; }
.egrid.memo { font-size: 44px; gap: 10px; }
.memobar { height: 8px; background: #eee; border-radius: 99px; overflow: hidden; }
.memobar i { display: block; height: 100%; background: #6a3de8; animation: memo linear forwards; }
@keyframes memo { from { width: 100%; } to { width: 0; } }
.escape-game.won { justify-content: center; background: radial-gradient(circle, #43a047, #1b5e20); }
.won-door { font-size: 110px; animation: popIn .6s cubic-bezier(.2, 1.6, .4, 1); }
.won-t { font-size: clamp(30px, 6vw, 54px); font-weight: 900; text-shadow: 0 4px 16px rgba(0,0,0,.4); }
.won-s { font-size: 20px; }

.maze-game { position: relative; }
.mz-won { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(27, 94, 32, .82); color: #fff; border-radius: 14px; z-index: 5; animation: fadeIn .3s; }
.mz-won div { font-size: 90px; animation: popIn .6s cubic-bezier(.2, 1.6, .4, 1); }
.mz-won b { font-size: clamp(28px, 5vw, 48px); }
/* writing a prompt: a comfortable box that grows; the picture makes room while typing */
.compose textarea[data-grow] { font-size: 18px; line-height: 1.35; min-height: 52px; max-height: 30vh; resize: none; overflow-y: auto; }
body.typing.in-game .play .pic { flex: 0 1 auto; max-height: 30vh; }
body.typing.in-game .play .wb, body.typing.in-game .play .strip { display: none; }
/* who is my partner */
.pchip { white-space: nowrap; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
#pairpop { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; background: rgba(20, 0, 50, .45); padding: 16px; animation: fadeIn .2s; }
#pairpop .pp-in { background: #fff; border-radius: 22px; padding: 18px 26px; text-align: center; border: 4px solid #00bcd4; animation: popIn .35s cubic-bezier(.2, 1.4, .4, 1); }
#pairpop .pp-h { font-weight: 900; font-size: 22px; color: #00838f; }
#pairpop .pp-n { display: flex; gap: 18px; justify-content: center; margin: 10px 0; font-size: 26px; font-weight: 900; }
#pairpop .pp-n span { display: flex; flex-direction: column; align-items: center; }
#pairpop .pp-n i { font-style: normal; font-size: 56px; }

/* teacher: side column size, now/sent, status of each student / pair */
@media (min-width: 1000px) { .stage { grid-template-columns: minmax(0, 1fr) var(--side, 420px); } }
.side-bar { display: flex; justify-content: space-between; gap: 6px; flex: none; }
.side-bar button { padding: 4px 10px; font-size: 14px; background: rgba(255,255,255,.85); color: var(--ink); box-shadow: none; }
.side-bar button.sel { background: #ffd23f; color: #3a2400; }
.livebtns, .sizebtns { display: flex; gap: 4px; }
.stage-strip .g { position: relative; }
.stage-strip .g.fin { outline: 4px solid #43a047; }
.stbadge { position: absolute; top: 8px; inset-inline-start: 8px; z-index: 2; background: #fff; border-radius: 999px; padding: 0 6px; font-size: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.stbadge.st-help { animation: pulse 1s infinite; }
.placebadge { position: absolute; top: 4px; inset-inline-end: 6px; z-index: 2; font-size: 30px; }
.stage-strip .g canvas { width: 100%; aspect-ratio: 4/3; display: block; border-radius: 9px; background: #f4f1fb; cursor: zoom-in; }
.stage-strip .g .ph { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 40px; background: #f4f1fb; border-radius: 9px; }
.stage-strip.plays { grid-template-columns: 1fr; }
.playcard .pc-info { font-size: 22px; padding: 14px 6px 4px; text-align: center; min-height: 54px; }
.pill.alldone { background: #43a047; }
#end.pulse { animation: glow 1s ease-in-out infinite alternate; }
@keyframes glow { from { box-shadow: 0 0 0 2px rgba(255,210,63,.5); } to { box-shadow: 0 0 0 9px rgba(255,210,63,.95), 0 0 24px rgba(255,210,63,.9); } }
.adddlg .opt.kinds { flex-wrap: wrap; }
.adddlg .opt.kinds button { font-size: 15px; }
/* the "you're in a pair with…" note: a big banner at the top that does not block the board */
#pairpop { inset: auto; top: 64px; left: 50%; transform: translateX(-50%); background: none; padding: 0; pointer-events: none; width: min(560px, 94vw); }
#pairpop .pp-in { box-shadow: 0 12px 34px rgba(0,0,0,.35); padding: 12px 20px; }
#pairpop .pp-n i { font-size: 44px; }
/* student page: no speaker / mic buttons (teacher messages are still read aloud automatically) */
body.stu button.say, body.stu #mic, body.stu .mic { display: none !important; }
/* ~10 student cards visible at once: columns grow with the count, pictures a bit shorter */
@media (min-width: 1000px) {
  .stage-side .stage-strip:not(.plays) { grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 8px; }
  .stage-side .stage-strip:not(.plays) .g img, .stage-side .stage-strip:not(.plays) .g video, .stage-side .stage-strip:not(.plays) .g .ph { aspect-ratio: 4/3; }
  .stage-side .stage-strip:not(.plays) .g .lab { font-size: 13px; }
  .stage-main .stage-target { height: calc(100vh - 170px); }
}
/* teacher's time-out for one student */
#freeze { position: fixed; inset: 0; z-index: 9999; background: rgba(30, 20, 60, .88); display: flex; align-items: center; justify-content: center; }
#freeze .fz-in { background: #fff; border-radius: 24px; padding: 28px 40px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 22px; }
#freeze .fz-t { font-size: 40px; font-weight: 900; color: #6c3fd1; }
.pmenu { display: inline-flex; gap: 3px; margin-inline-start: 4px; }
.pmenu button { padding: 2px 6px; font-size: 13px; border-radius: 8px; }
.reopen { flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
/* voting: one page at a time, no scrolling */
.vote-grid.paged { grid-template-columns: repeat(var(--vc, 2), minmax(0, 1fr)) !important; }
.vote-grid.paged .vote img { aspect-ratio: 4/3; max-height: calc((100vh - 300px) / 2); width: 100%; object-fit: contain; background: #fff; }
.vote-pages { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 8px; font-size: 20px; }
.vote-pages button { font-size: 26px; padding: 6px 22px; border-radius: 14px; }
.vote-pages button:disabled { opacity: .3; }
.special .slide-row .drag { cursor: grab; font-size: 22px; color: #999; touch-action: none; user-select: none; padding: 0 2px; }
.special .slide-row.dragging { opacity: .5; }
.special .slide-row.drop-here { box-shadow: 0 -4px 0 #6c3fd1; }
.special .slide-row.drop-after { box-shadow: 0 4px 0 #6c3fd1; }
.adddlg .dmodes button { font-size: 17px; padding: 10px 14px; }
.adddlg .dm-help { background: #f2eefa; border-radius: 12px; padding: 10px 12px; margin: 8px 0; font-size: 15px; }
.adddlg .dm-help.warn { background: #fff1e6; color: #a84300; font-weight: 700; }
/* setup: preview of a mini-game slide */
.pvcard { max-width: 640px; width: 100%; max-height: 90vh; overflow: auto; }
.pvcard .mz-board.mini { width: min(52vh, 380px); height: min(52vh, 380px); margin: 8px auto; }
.pvcard .pv-info { margin: 8px 0; font-size: 15px; }
.pvcard .pv-blocks button { font-size: 14px; }
.pvcard .pv-q { background: #f2eefa; border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
.pvcard .pv-btns { justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.special .slide-row .prevbtn { padding: 6px 10px; font-size: 14px; }
.special .slide-row select { max-width: 210px; }
/* "how to play" page for the board */
.explain { background: #fff; border-radius: 24px; padding: 22px 28px; width: min(1100px, 96vw); max-height: 94vh; overflow: auto; text-align: start; }
.explain h1 { font-size: clamp(28px, 5vh, 52px); margin: 10px 0 14px; }
.explain .ex-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.explain .ex-tabs button { font-size: 14px; padding: 6px 10px; }
.explain .ex-body { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.explain .ex-steps { flex: 1; min-width: 280px; font-size: clamp(20px, 3.4vh, 34px); line-height: 1.5; padding-inline-start: 1.2em; margin: 0; }
.explain .ex-steps li { margin: 8px 0; }
.explain .ex-side { flex: none; }
.explain .ex-side .mz-board.mini { width: min(40vh, 340px); height: min(40vh, 340px); }
.explain .ex-demo { background: #f2eefa; border-radius: 14px; padding: 14px; font-size: 22px; max-width: 360px; }
.explain .ex-foot { margin-top: 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 18px; }
/* dialogs never taller than the screen (laptops 768px high): scroll inside, buttons stay reachable */
.adddlg { max-height: calc(100vh - 32px); overflow-y: auto; }
.adddlg label { margin-top: 8px; }
.adddlg .dmodes { position: sticky; top: -1px; background: #fff; z-index: 1; padding-top: 2px; }
/* explain page: "show them yourself" – the real student screen next to the steps */
.explain .ex-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.explain .ex-modes button { font-size: 18px; padding: 10px 16px; }
.explain.live { width: 98vw; height: 96vh; max-height: 96vh; display: flex; flex-direction: column; padding: 14px 16px; }
.explain .ex-live { flex: 1; min-height: 0; display: flex; gap: 14px; margin-top: 10px; }
.explain .ex-mini { width: 290px; flex: none; overflow-y: auto; font-size: 17px; }
.explain .ex-mini h2 { margin: 0 0 6px; }
.explain .ex-mini ol { padding-inline-start: 1.2em; margin: 0 0 10px; line-height: 1.45; }
.explain .ex-mini li { margin: 5px 0; }
.explain .ex-mini select, .explain .ex-mini .btn-ghost { width: 100%; margin: 6px 0; }
.explain .ex-lv { display: flex; align-items: center; gap: 8px; font-weight: 800; margin: 6px 0; }
.explain .ex-lv button { padding: 4px 14px; font-size: 20px; }
.explain .ex-frame { flex: 1; min-width: 0; border-radius: 16px; overflow: hidden; background: linear-gradient(135deg, #6c3fd1, #3a1c8f); display: flex; align-items: center; justify-content: center; }
.explain .ex-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.explain .ex-frame .pic-msg { color: #fff; }
@media (max-width: 800px) { .explain .ex-live { flex-direction: column; } .explain .ex-mini { width: auto; max-height: 30vh; } }
body.demo #fs, body.demo .fsbtn { display: none !important; }
/* bigger, clearer buttons on the drawing / animation board (small children, touch screens) */
.st-bar { gap: 8px; padding: 6px 8px; }
.st-bar button { min-width: 48px; min-height: 48px; font-size: 22px; padding: 5px 9px; justify-content: center; }
.st-bar button small { font-size: 12px; }
.st-bar .sw { width: 34px; min-width: 34px; height: 34px; min-height: 34px; }
.st-frames { padding: 8px; gap: 10px; }
.st-frames .fr { min-width: 0; min-height: 0; padding: 3px; }
.st-frames .fr canvas { width: 92px; height: 69px; }
.st-frames .fr b { font-size: 14px; background: rgba(255,255,255,.85); border-radius: 6px; padding: 0 4px; }
.st-frames .fr-acts button { min-width: 72px; min-height: 64px; font-size: 26px; }
.st-frames .fr-acts .fa-add { background: #e3f7e6; border: 2px solid #43a047; }
.st-frames .play-btn { min-height: 64px; font-size: 22px; padding: 6px 18px; }
@media (max-width: 600px) {
  .st-frames .fr canvas { width: 70px; height: 52px; }
  .st-frames .fr-acts button { min-width: 58px; min-height: 56px; font-size: 22px; }
  .st-frames .play-btn { min-height: 56px; font-size: 18px; padding: 6px 12px; }
}
.st-frames .fr-acts button small { display: block !important; }
@media (max-width: 600px) {
  .st-frames { flex-wrap: wrap; overflow-x: visible; justify-content: center; }
  .st-frames .fr-list { flex-basis: 100%; overflow-x: auto; justify-content: flex-start; border: 0; }
  .st-frames .grp:not(.fr-list) { border: 0; }
}
/* The tools and frames: under the board on phones; beside it on wide screens, so the board gets the whole height */
.st-side { display: contents; }
@media (min-width: 760px) and (min-aspect-ratio: 5/4) {
  .play.art .studio { flex-direction: row; align-items: stretch; }
  .play.art .st-side { display: flex; flex-direction: column; gap: 6px; flex: none; width: clamp(240px, 24vw, 360px); min-height: 0; overflow-y: auto; scrollbar-width: thin; }
  .play.art .st-side .st-bar { flex-wrap: wrap; overflow: visible; justify-content: center; }
  .play.art .st-side .st-bar .grp { flex-wrap: wrap; justify-content: center; width: 100%; padding: 0 0 6px; border-inline-end: 0; border-bottom: 1px solid #eee; }
  .play.art .st-side .st-bar .grp:last-child { border-bottom: 0; padding-bottom: 0; }
  .play.art .st-side .st-frames .fr-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .play.art .st-side .st-frames .fr canvas { width: 100%; height: auto; aspect-ratio: 4 / 3; }
  .play.art .st-side .st-frames .fr-acts button { min-width: 0; flex: 1; }
  .play.art .st-side .st-frames .play-btn { flex-basis: 100%; }
  .play.art .st-side .st-magic { flex-wrap: wrap; justify-content: center; overflow: visible; }
  .play.art .st-side .st-tip { order: -1; }
}
/* 🔢 connect the dots */
.dots-game { flex: 1; min-height: 0; width: 100%; background: #fffdf5; border-radius: 16px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink); }
.dots-game.won { justify-content: center; background: radial-gradient(circle, #43a047, #1b5e20); color: #fff; }
.dots-game.won .won-door { font-size: 64px; letter-spacing: 6px; }
.dots-top { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 8px; font-size: 18px; }
.dots-top b { font-size: 24px; margin-inline-end: 4px; opacity: .45; }
.dots-top b.ok, .dots-top b.now { opacity: 1; }
.dots-top .nextnum { font-size: 26px; color: #6a3de8; opacity: 1; }
.dots-svg { flex: 1; min-height: 0; width: 100%; max-height: 100%; touch-action: manipulation; user-select: none; }
.dots-svg .dl { fill: none; stroke: #6a3de8; stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.dots-svg .dfill { stroke: #333; stroke-width: 1; opacity: .9; animation: fadeIn .5s; }
.dots-svg .demoji { font-size: 34px; animation: popIn .6s cubic-bezier(.2, 1.6, .4, 1); transform-origin: 50px 50px; }
.dots-svg .dd { cursor: pointer; }
.dots-svg .dd .hit { fill: transparent; }
.dots-svg .dd .pt { fill: #222; }
.dots-svg .dd text { font-size: 4.6px; font-weight: 800; fill: #333; pointer-events: none; }
.dots-svg .dd text.sm { font-size: 3.6px; }
.dots-svg .dd.on .pt { fill: #6a3de8; }
.dots-svg .dd.on text { fill: #aaa; }
.dots-svg .dd.next .pt { fill: #ff4081; animation: dotPulse 1s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes dotPulse { 50% { transform: scale(1.8); } }
.dots-svg.shake { animation: shake .35s; }
.dots-game .emsg.bad { color: #d32f2f; } .dots-game .emsg.good { color: #2e7d32; }
.dots-svg.mini { width: min(46vh, 380px); height: min(46vh, 380px); background: #fffdf5; border-radius: 14px; display: block; margin: 8px auto; }
/* ⚡ quick drawing */
.quick .qword b { font-size: 24px; }
.quick .qbar { flex: 1; min-width: 60px; height: 12px; background: #eee; border-radius: 99px; overflow: hidden; }
.quick .qbar i { display: block; height: 100%; width: 100%; background: #43a047; transition: width .25s linear; }
.quick .qbar i.low { background: #e53935; }
.quick .qguess { font-size: 18px; font-weight: 800; justify-content: center; }
.quick .qsolved { font-size: 26px; letter-spacing: 4px; justify-content: center; }
.quick .qcount { font-weight: 900; }
/* 🪄 magic drawing: the AI's guesses */
.st-magic { flex: none; display: flex; gap: 6px; align-items: center; overflow-x: auto; background: linear-gradient(90deg, #fff7d6, #ffe3f6); border-radius: 12px; padding: 5px 8px; min-height: 58px; }
.st-magic .mg-l { font-weight: 800; font-size: 15px; white-space: nowrap; }
.st-magic button { display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: 3px 8px; background: #fff; color: var(--ink); border-radius: 12px; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.st-magic .mg-e { font-size: 30px; line-height: 1.1; }
.st-magic button small { font-size: 12px; font-weight: 800; }
.st-magic .mg-no { background: #f3f3f3; }
.st-magic .mg-del { background: #ffe5e5; }
.st-magic button[data-sa] { min-width: 54px; font-size: 22px; }
/* 👆 the picked picture or shape: a dashed box, a handle in the corner to resize */
.st-selbox { position: absolute; z-index: 2; border: 2px dashed #6a3de8; border-radius: 6px; pointer-events: none; }
.st-selbox.hidden { display: none; }
.st-selh { position: absolute; right: -14px; bottom: -14px; width: 28px; height: 28px; border-radius: 50%; background: #6a3de8; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); pointer-events: auto; cursor: nwse-resize; touch-action: none; }
.st-shapes .st-gl { font-size: 13px; white-space: nowrap; color: #6a3de8; }
.st-shapes button { font-size: 22px; }
.pvcard .pv-words { display: flex; flex-wrap: wrap; gap: 6px; }
.pvcard .pv-words span { background: #f2eefa; border-radius: 10px; padding: 4px 10px; font-size: 18px; }
/* 🧪 emoji lab */
.mixlab .pic { min-height: 0; }
.mix-eq { flex-direction: row !important; gap: 10px; font-size: 54px; align-items: center; }
.mix-eq b { font-size: 40px; color: #6a3de8; }
.mix-slots { display: flex; gap: 8px; align-items: center; justify-content: center; }
.mix-slots [data-mixslot] { display: flex; flex-direction: column; align-items: center; font-size: 36px; min-width: 76px; padding: 4px 10px; background: #fff; color: var(--ink); border: 3px dashed #c9b8ff; border-radius: 16px; }
.mix-slots [data-mixslot].full { border-style: solid; border-color: #6a3de8; }
.mix-slots [data-mixslot] small { font-size: 12px; font-weight: 800; }
.mix-slots > b { font-size: 30px; color: #fff; }
.mix-slots #mixgo { font-size: 20px; padding: 14px 18px; }
.mix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 4px; background: #fff; border-radius: 14px; padding: 6px; max-height: 26vh; overflow-y: auto; }
.mix-grid button { font-size: 28px; padding: 4px 0; background: #f6f3ff; border-radius: 10px; box-shadow: none; border: 3px solid transparent; }
.mix-grid button.sel { border-color: #6a3de8; background: #e9e1ff; }
/* 🕺 dancing character */
.puppet .pupwrap { flex: 1; min-height: 0; display: flex; }
.puppet .pupwrap.off { display: none; }
.puppet .pupwrap > * { flex: 1; min-height: 0; }
.pupstage { position: relative; display: flex; align-items: center; justify-content: center; }
.pupstage canvas, .pupstage svg { position: absolute; max-width: 100%; max-height: 100%; aspect-ratio: 4/3; width: 100%; height: auto; background: transparent; }
.pupstage canvas { background: #fff; border-radius: 14px; }
.pupstage svg { touch-action: none; }
.pupjoints .pb { stroke: rgba(80, 40, 160, .55); stroke-width: 5; stroke-linecap: round; }
.pupjoints .pj { stroke: #fff; stroke-width: 4; cursor: grab; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.pup-emotes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pup-emotes button { font-size: 17px; padding: 10px 4px; background: #fff; color: var(--ink); border: 3px solid transparent; }
.pup-emotes button.sel { border-color: #6a3de8; background: #efe9ff; }
.pup-row { justify-content: center; gap: 8px; flex-wrap: wrap; }
.pup-row .btn-main { font-size: 18px; }
.pup-help { justify-content: center; }
@media (max-width: 600px) { .pup-emotes { grid-template-columns: repeat(4, 1fr); } .pup-emotes button { font-size: 14px; padding: 8px 2px; } }
.pupstage { container-type: size; min-height: 200px; }
.pupstage canvas, .pupstage svg { width: min(100cqw, calc(100cqh * 4 / 3)); height: auto; max-width: none; max-height: none; }
.puppet .pupwrap { flex-direction: column; width: 100%; min-width: 0; }
.puppet .pupwrap > * { width: 100%; min-width: 0; }
/* emoji lab on computers: every emoji visible, the picture takes the space that is left */
@media (min-width: 700px) {
  .mixlab .pic { flex: 1 1 0; min-height: 110px; }
  .mixlab .pic img { max-height: 100%; object-fit: contain; }
  .mix-grid { flex: none; max-height: none; overflow: visible; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
  .mix-grid button { font-size: 24px; padding: 2px 0; }
  .mix-slots [data-mixslot] { font-size: 30px; min-width: 70px; padding: 2px 10px; }
}
/* ⚗️ alchemy */
.alchemy .al-count { font-weight: 800; }
.al-main { flex: 1; min-height: 0; display: flex; gap: 12px; }
.al-bench { flex: 1.1; background: #fff; border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.al-mix { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 34px; color: #6a3de8; }
.al-slot { display: flex; flex-direction: column; align-items: center; min-width: 110px; min-height: 110px; justify-content: center; background: #f6f3ff; color: var(--ink); border: 3px dashed #c9b8ff; border-radius: 18px; box-shadow: none; }
.al-slot.full { border-style: solid; border-color: #6a3de8; }
.al-slot span { font-size: 54px; line-height: 1.1; } .al-slot small { font-size: 15px; font-weight: 800; }
.al-out { min-width: 150px; min-height: 110px; display: flex; align-items: center; justify-content: center; text-align: center; }
.al-res { display: flex; flex-direction: column; align-items: center; color: var(--ink); } .al-res span { font-size: 60px; line-height: 1.1; } .al-res small { font-size: 16px; font-weight: 800; }
.al-res.new span { animation: popIn .6s cubic-bezier(.2, 1.6, .4, 1); }
.al-none { font-size: 20px; color: #888; font-weight: 800; } .al-hint { font-size: 18px; color: var(--ink); font-weight: 800; }
.al-bar { height: 12px; background: #eee; border-radius: 99px; overflow: hidden; } .al-bar div { height: 100%; background: linear-gradient(90deg, #43a047, #fdd835); }
.al-help { text-align: center; margin: 0; }
.al-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); align-content: start; gap: 6px; background: rgba(255,255,255,.12); border-radius: 16px; padding: 8px; }
.al-grid button { display: flex; flex-direction: column; align-items: center; background: #fff; color: var(--ink); border-radius: 12px; padding: 6px 2px; border: 3px solid transparent; box-shadow: 0 2px 5px rgba(0,0,0,.15); }
.al-grid button.sel { border-color: #6a3de8; background: #efe9ff; }
.al-grid button span { font-size: 32px; line-height: 1.15; } .al-grid button small { font-size: 13px; font-weight: 800; }
@media (max-width: 800px) { .al-main { flex-direction: column; } .al-slot, .al-out { min-width: 80px; min-height: 80px; } .al-slot span, .al-res span { font-size: 38px; } }
/* wide games use the whole laptop screen */
@media (min-width: 900px) { body.in-game .wrap:has(.play.alchemy), body.in-game .wrap:has(.play.aireal), body.in-game .wrap:has(.play.groupgame) { max-width: min(1300px, 100%); } }
.al-grid { flex: 1.3; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.al-bench { flex: 1; }
/* 🤖 AI or real */
.aireal .ar-count { font-weight: 800; }
.ar-pic { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: #fff; border-radius: 16px; padding: 10px; border: 6px solid transparent; }
.ar-pic img { max-width: 100%; max-height: 100%; min-height: 0; flex: 1; object-fit: contain; border-radius: 10px; }
.ar-pic.ok { border-color: #43a047; } .ar-pic.bad { border-color: #e53935; }
.ar-verdict { font-size: 26px; font-weight: 900; } .ar-verdict small { font-size: 15px; color: #777; }
.ar-btns { display: flex; gap: 14px; justify-content: center; }
.ar-btns button { font-size: 30px; padding: 14px 40px; border-radius: 18px; min-width: 220px; }
.ar-ai { background: linear-gradient(135deg, #7c4dff, #b388ff); color: #fff; } .ar-real { background: linear-gradient(135deg, #00897b, #4db6ac); color: #fff; }
.ar-done { flex: 1; min-height: 0; overflow: auto; background: #fff; border-radius: 16px; padding: 12px; text-align: center; }
.ar-grid, .ar-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ar-grid > div, .ar-stats > div { background: #f6f3ff; border-radius: 12px; padding: 5px; display: flex; flex-direction: column; align-items: center; border: 4px solid transparent; }
.ar-grid img, .ar-stats img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.ar-grid .ok { border-color: #43a047; } .ar-grid .bad { border-color: #e53935; }
.ar-stats > div { background: #fff; } .ar-stats .ai { border-color: #7c4dff; } .ar-stats .real { border-color: #00897b; }
.ar-stats span { font-size: 13px; color: #555; font-weight: 800; }
/* group games: 🕵️ impostor / 📞 drawn telephone */
.groupgame .gmembers { font-size: 14px; font-weight: 700; color: #555; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 50%; }
.gbar { position: relative; height: 22px; background: rgba(255,255,255,.25); border-radius: 99px; overflow: hidden; flex: none; }
.gbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #43a047, #fdd835); transition: width .25s linear; }
.gbar b { position: relative; display: block; text-align: center; color: #fff; font-size: 14px; line-height: 22px; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.grole { background: #fff; border-radius: 14px; padding: 10px 14px; font-size: 20px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: none; }
.grole.imp { background: linear-gradient(90deg, #ffe0e0, #fff3d6); }
.grole b { font-size: 24px; }
.gdraws { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; align-content: start; }
.gdraws.small { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.gdraw { display: flex; flex-direction: column; align-items: center; gap: 4px; background: #fff; color: var(--ink); border-radius: 14px; padding: 6px; border: 5px solid transparent; }
.gdraw img, .gdraw .ph { width: 100%; aspect-ratio: 4/3; object-fit: contain; background: #fafafa; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.gdraw span { font-weight: 800; font-size: 16px; }
.gdraw.sel { border-color: #e53935; } .gdraw.self { opacity: .6; } .gdraw.imp { border-color: #e53935; }
.gopts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gopts button { font-size: 24px; padding: 18px; }
.gresult { flex: 1; min-height: 0; overflow: auto; background: #fff; border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; text-align: center; font-size: 18px; }
.gresult .gr-big { font-size: 40px; font-weight: 900; }
.gresult.caught .gr-big { color: #2e7d32; } .gresult.free .gr-big { color: #c62828; }
.gprev { background: #fff; border-radius: 14px; padding: 12px; font-size: 26px; font-weight: 800; text-align: center; flex: none; }
.gprev.img { flex: 1; min-height: 0; display: flex; justify-content: center; } .gprev.img img { max-height: 100%; max-width: 100%; object-fit: contain; }
.galbum { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.gitem { background: #fff; border-radius: 14px; padding: 8px 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 520px; width: 100%; }
.gitem .gt { font-size: 24px; font-weight: 800; } .gitem img { max-width: 100%; max-height: 260px; border-radius: 10px; cursor: zoom-in; } .gitem span { font-size: 14px; color: #666; font-weight: 700; }
.garrow { font-size: 22px; }
.groupgame .studio-host { flex: 1; min-height: 0; }
.ph-albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.ph-albums .chain { background: rgba(255,255,255,.95); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.ph-albums .chain .ci { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.ph-albums .chain img { width: 110px; aspect-ratio: 4/3; object-fit: contain; background: #fff; border-radius: 6px; cursor: zoom-in; }
.ph-albums .chain small { color: #777; }
/* the chain flows across the laptop screen (right to left) */
.galbum { flex-direction: row; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 6px; }
.galbum .gitem { width: 270px; max-width: 270px; }
.galbum .gitem img { max-height: 190px; }
.galbum .gitem .gt { font-size: 20px; }
.galbum .garrow { align-self: center; font-size: 26px; }

/* ===================== looks (the teacher chooses) ===================== */
/* ⬜ clean – light, full screen, no empty margins */
body[data-theme="clean"] { background: #eef1f7; }
html:has(body[data-theme="clean"]) { background: #eef1f7; }
body[data-theme="clean"] .logo { color: #3b2a6b; }
body[data-theme="clean"] .white, body[data-theme="clean"] .mix-slots > b { color: var(--ink); }
body[data-theme="clean"] .card, body[data-theme="clean"] .topbar, body[data-theme="clean"] .line { box-shadow: 0 1px 3px rgba(0,0,0,.12); }
body[data-theme="clean"].in-game .logo { display: none; }
body[data-theme="clean"].in-game .wrap { max-width: 100% !important; padding: 6px 10px; }
body[data-theme="clean"] .al-grid, body[data-theme="clean"] .stage-strip { background: #fff; }
body[data-theme="clean"] .gbar { background: #dfe3ec; }
body[data-theme="clean"] .pic-msg { color: var(--ink); }
body[data-theme="clean"] .stage-top h2, body[data-theme="clean"] .stage-foot { color: var(--ink); }
/* 🟥🟦 quiz – flat purple with big coloured tiles */
body[data-theme="quiz"] { background: #46178f; }
body[data-theme="quiz"] .card, body[data-theme="quiz"] .topbar, body[data-theme="quiz"] .line { border-radius: 6px; box-shadow: 0 4px 0 rgba(0,0,0,.25); }
body[data-theme="quiz"] .btn-main { background: #e21b3c; box-shadow: 0 5px 0 #a3132a; border-radius: 6px; }
body[data-theme="quiz"] .btn-green { background: #26890c; box-shadow: 0 5px 0 #1a5e08; border-radius: 6px; }
body[data-theme="quiz"] .logo span { color: #fff; }
body[data-theme="quiz"] :is(.gopts, .eopts, .pup-emotes, .ar-btns, .opt.dmodes) > button:nth-child(4n+1) { background: #e21b3c; color: #fff; }
body[data-theme="quiz"] :is(.gopts, .eopts, .pup-emotes, .ar-btns, .opt.dmodes) > button:nth-child(4n+2) { background: #1368ce; color: #fff; }
body[data-theme="quiz"] :is(.gopts, .eopts, .pup-emotes, .ar-btns, .opt.dmodes) > button:nth-child(4n+3) { background: #d89e00; color: #fff; }
body[data-theme="quiz"] :is(.gopts, .eopts, .pup-emotes, .ar-btns, .opt.dmodes) > button:nth-child(4n+4) { background: #26890c; color: #fff; }
body[data-theme="quiz"] .pup-emotes button.sel { outline: 5px solid #fff; outline-offset: -5px; }
body[data-theme="quiz"].in-game .wrap { max-width: min(1400px, 100%) !important; }
/* ⚗️ alchemy, full screen: workspace + list */
body.in-game .wrap:has(.play.alchemy) { max-width: 100% !important; padding: 6px 10px; }
body.in-game:has(.play.alchemy) .logo { display: none; }
.alchemy .topbar { flex-wrap: nowrap; }
.alchemy .al-bar { flex: 1; max-width: 220px; height: 10px; background: #eee; border-radius: 99px; overflow: hidden; } .alchemy .al-bar i { display: block; height: 100%; background: linear-gradient(90deg, #43a047, #fdd835); }
.alchemy .al-tb { padding: 4px 10px; font-size: 14px; }
.alchemy .al-main { flex: 1; min-height: 0; display: flex; gap: 8px; }
.al-ws { flex: 1; position: relative; background: #fbfaf6; background-image: radial-gradient(#e7e2d6 1px, transparent 1px); background-size: 22px 22px; border-radius: 14px; overflow: hidden; touch-action: none; user-select: none; }
.al-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #9a917c; font-size: 22px; font-weight: 800; text-align: center; padding: 20px; pointer-events: none; }
.al-list .al-it { cursor: grab; } .al-empty small { display: block; font-size: 16px; margin-top: 8px; opacity: .85; }
.al-side { width: 280px; flex: none; display: flex; flex-direction: column; gap: 6px; background: #fff; border-radius: 14px; padding: 8px; }
.al-side input { margin: 0; padding: 8px 10px; font-size: 16px; }
.al-list { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(3, 1fr); align-content: start; gap: 4px; }
.al-it { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 4px 2px; border-radius: 12px; cursor: grab; user-select: none; touch-action: none; }
.al-list .al-it:hover { background: #f3efff; }
.al-it span { font-size: 34px; line-height: 1.1; pointer-events: none; } .al-it small { font-size: 13px; font-weight: 800; color: var(--ink); text-align: center; pointer-events: none; }
.al-w { position: absolute; width: 78px; background: rgba(255,255,255,.85); box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.al-w span { font-size: 42px; }
.al-w.mixing { animation: shake .3s infinite; } .al-w.nope { animation: shake .35s; } .al-w.born { animation: popIn .6s cubic-bezier(.2, 1.6, .4, 1); }
.al-tag { position: absolute; top: -10px; inset-inline-end: -10px; background: #ff4081; color: #fff; font-size: 12px; border-radius: 99px; padding: 1px 7px; }
.al-ghost { position: fixed; z-index: 99; width: 78px; pointer-events: none; background: rgba(255,255,255,.9); box-shadow: 0 6px 16px rgba(0,0,0,.25); } .al-ghost span { font-size: 42px; }
body[data-theme="clean"] .pill { background: #dfe3ec; color: var(--ink); }
body[data-theme="clean"] .fs-btn { color: var(--ink); background: #dfe3ec; }
/* 👾 pixel art */
.pixel-game { flex: 1; min-height: 0; width: 100%; display: flex; gap: 14px; align-items: stretch; }
.px-side { width: 230px; flex: none; background: #fff; border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.px-title { font-size: 18px; } .px-title b { font-size: 22px; }
.px-target { display: grid; grid-template-columns: repeat(var(--n), 1fr); width: 180px; aspect-ratio: 1; border: 2px solid #ddd; background: #fff; }
.px-target i { border: 1px solid #f1f1f1; }
.px-target.px-hidden { display: flex; align-items: center; justify-content: center; font-size: 64px; background: repeating-linear-gradient(45deg, #f3f0fb 0 12px, #e9e3f8 12px 24px); }
.px-peek { font-size: 18px; font-weight: 800; padding: 8px 14px; border-radius: 12px; } .px-peek.on { background: #fff3cd; } .px-peek.on b { color: #c62828; font-size: 22px; }
.px-peek.none { color: #6a3de8; }
.px-acc { font-size: 18px; } .px-acc b { font-size: 28px; color: #6a3de8; }
.px-pal { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.px-pal button { width: 46px; height: 46px; border-radius: 12px; border: 3px solid #fff; box-shadow: 0 0 0 2px #ccc; padding: 0; font-size: 22px; }
.px-pal button.sel { box-shadow: 0 0 0 4px #6a3de8; } .px-pal .erase { background: #f4f4f4; }
.px-ok { font-size: 24px; font-weight: 900; color: #2e7d32; }
.px-grid { flex: 1; min-width: 0; align-self: center; display: grid; grid-template-columns: repeat(var(--n), 1fr); width: min(100%, calc(100vh - 190px)); max-width: calc(100vh - 190px); aspect-ratio: 1; background: #fff; border-radius: 10px; overflow: hidden; touch-action: none; user-select: none; box-shadow: 0 4px 14px rgba(0,0,0,.2); margin: 0 auto; }
.px-grid div { border: 1px solid #e8e8e8; cursor: crosshair; }
.px-grid.ok { box-shadow: 0 0 0 6px #43a047; }
.px-prev { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; } .px-prev > div { display: flex; flex-direction: column; align-items: center; } .px-prev .px-target { width: 120px; }
.opt.grades button { min-width: 72px; }
.grade-note { background: #e8f5e9; border-radius: 10px; padding: 8px 12px; margin: 6px 0; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 🌍 where in the world */
body.in-game .wrap:has(.play.georound) { max-width: 100% !important; }
.geo-main { flex: 1; min-height: 0; display: flex; gap: 10px; }
.geo-side { width: 38%; min-width: 280px; display: flex; flex-direction: column; gap: 8px; background: #fff; border-radius: 16px; padding: 10px; }
.geo-pic { flex: 1; min-height: 0; display: flex; justify-content: center; } .geo-pic img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; cursor: zoom-in; }
.geo-help { text-align: center; }
.geo-res { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; align-items: center; } .geo-res img { flex: 1; min-height: 0; max-width: 100%; object-fit: contain; border-radius: 10px; }
.geo-ans { font-size: 26px; font-weight: 900; text-align: center; } .geo-km { font-size: 20px; } .geo-km b { color: #2e7d32; font-size: 26px; }
.geo-sum { flex: 1; overflow: auto; } .geo-row { display: flex; gap: 8px; align-items: center; margin: 6px 0; } .geo-row img { width: 90px; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.geo-mapwrap { flex: 1; min-width: 0; position: relative; background: #a7d3f2; border-radius: 16px; overflow: hidden; display: flex; align-items: center; }
#geomap { width: 100%; } .geosvg { width: 100%; display: block; cursor: crosshair; touch-action: none; user-select: none; }
.geo-zoom { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px; } .geo-zoom button { padding: 4px 10px; font-size: 18px; }
.gpin circle { stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; } .gpin.me circle { fill: #e53935; } .gpin.true circle { fill: #2e7d32; }
.gpin text { font-size: 14px; } .gline { stroke: #333; stroke-width: 2; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.geo-count { font-weight: 800; }
.geo-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .geo-stats .geo-list { display: flex; flex-direction: column; gap: 6px; }
.geo-stats .geo-list > div { background: #fff; border-radius: 10px; padding: 6px; display: flex; gap: 8px; align-items: center; } .geo-stats img { width: 80px; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.geo-stats .geo-board { background: #a7d3f2; border-radius: 14px; overflow: hidden; align-self: start; }
/* 🛠️ app builder */
body.in-game .wrap:has(.play.appmaker) { max-width: 100% !important; }
.app-main { flex: 1; min-height: 0; display: flex; gap: 10px; }
.app-side { width: 32%; min-width: 280px; display: flex; flex-direction: column; gap: 8px; background: #fff; border-radius: 16px; padding: 12px; overflow-y: auto; }
.app-lab { font-weight: 800; font-size: 18px; margin: 0; }
.app-side textarea { font-size: 17px; resize: vertical; }
.app-vers { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; } .app-vers button { padding: 4px 10px; } .app-vers button.sel { background: #6a3de8; color: #fff; }
.app-stage { flex: 1; min-width: 0; background: #fff; border-radius: 16px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.app-stage iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.app-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.app-card { display: flex; flex-direction: column; gap: 4px; text-align: start; background: #fff; color: var(--ink); border-radius: 14px; padding: 12px; }
.app-card b { font-size: 20px; } .app-card small { color: #777; }
.app-big { width: min(1000px, 92vw); height: 74vh; border: 0; background: #fff; border-radius: 12px; }
/* 🗺️ RPG world */
body.in-game .wrap:has(.rpg-game) { max-width: 100% !important; }
.rpg-game { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.rpg-tools { display: flex; gap: 4px; flex-wrap: wrap; background: #2b2140; border-radius: 12px; padding: 6px; justify-content: center; }
.rpg-tools button { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #3d3159; color: #fff; padding: 4px 6px; border-radius: 10px; border: 3px solid transparent; box-shadow: none; min-width: 58px; }
.rpg-tools button.sel { border-color: #ffd23f; background: #574780; }
.rpg-tools canvas { width: 32px; height: 32px; image-rendering: pixelated; } .rpg-tools span { font-size: 24px; line-height: 32px; } .rpg-tools small { font-size: 11px; font-weight: 800; }
.rpg-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; container-type: size; }
.rpg-cv { width: min(100cqw, calc(100cqh * 1.6)); height: auto; image-rendering: pixelated; border-radius: 10px; box-shadow: 0 0 0 4px #2b2140, 0 8px 24px rgba(0,0,0,.35); cursor: crosshair; touch-action: none; }
.rpg-game.playing .rpg-cv { cursor: default; }
.rpg-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #fff; border-radius: 12px; padding: 6px 10px; }
.rpg-foot input { flex: 1; min-width: 220px; margin: 0; padding: 8px; font-size: 16px; }
.rpg-info { font-size: 14px; font-weight: 700; flex-basis: 100%; }
.rpg-bar { display: flex; gap: 14px; align-items: center; background: #2b2140; color: #fff; border-radius: 12px; padding: 6px 12px; font-size: 20px; font-weight: 800; }
.rpg-bar .muted { color: #c9bde6; font-size: 14px; } .rpg-won { color: #ffd23f; } .rpg-dead { color: #ff8a80; }
.rpg-pad { display: flex; flex-direction: column; align-items: center; gap: 4px; } .rpg-pad div { display: flex; gap: 4px; } .rpg-pad button { font-size: 22px; padding: 4px 16px; }
/* RPG: monster / chest options, monster power panel, fights, shop, messages */
.rpg-stage { position: relative; }
.rpg-sub { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; background: #fff; border-radius: 10px; padding: 5px 8px; font-weight: 800; font-size: 14px; }
.rpg-sub button { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; font-size: 14px; background: #f2eefa; color: var(--ink); border: 2px solid transparent; box-shadow: none; }
.rpg-sub button.sel { border-color: #6a3de8; background: #e7defd; } .rpg-sub canvas { width: 24px; height: 24px; image-rendering: pixelated; } .rpg-sub small { color: #777; }
.rpg-panel { position: absolute; inset: 8% 15%; background: #fff; border-radius: 16px; padding: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.4); display: flex; flex-direction: column; gap: 8px; overflow: auto; z-index: 3; }
.rpg-mrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .rpg-mrow canvas { width: 32px; height: 32px; image-rendering: pixelated; }
.rpg-mrow label { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 15px; } .rpg-mrow input { width: 70px; margin: 0; padding: 4px 6px; }
.rpg-ov { position: absolute; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, 92%); background: #fffdf5; border: 5px solid #2b2140; border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; align-items: center; box-shadow: 0 12px 40px rgba(0,0,0,.45); animation: popIn .25s; }
.rf-row { display: flex; align-items: center; justify-content: space-around; width: 100%; }
.rf-who { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 40%; } .rf-who canvas { width: 72px; height: 72px; image-rendering: pixelated; }
.rf-vs { font-size: 40px; }
.hpbar { width: 100%; height: 12px; background: #eee; border-radius: 99px; overflow: hidden; } .hpbar i { display: block; height: 100%; background: #43a047; transition: width .3s; } .hpbar.foe i { background: #e53935; }
.rf-log { width: 100%; background: #fff; border-radius: 10px; padding: 6px 10px; font-size: 15px; min-height: 60px; } .rf-log div:first-child { font-weight: 800; font-size: 17px; }
.rf-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; } .rf-btns button { font-size: 17px; padding: 12px 4px; }
.rpg-ov.shop h3 { margin: 0; } .rs-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; width: 100%; }
.rs-items button { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #fff; color: var(--ink); border: 2px solid #e6dcc4; } .rs-items span { font-size: 32px; } .rs-items small { font-weight: 900; color: #b8860b; }
.rpg-ov.msg .rm-big { font-size: 26px; font-weight: 900; text-align: center; } .rpg-ov.msg .rm-big small { font-size: 18px; font-weight: 700; }
.rpg-bar span { white-space: nowrap; }
.rpg-ov { animation: none; }
.rpg-ov .rf-who canvas { animation: none; }
/* playing: the map as big as the screen allows, the buttons beside it (under it on narrow screens) */
.rpg-main { flex: 1; min-height: 0; display: flex; gap: 10px; align-items: stretch; }
.rpg-main .rpg-stage { flex: 1; min-width: 0; }
.rpg-game.playing { gap: 6px; }
.rpg-game.playing .rpg-bar { gap: 12px; flex-wrap: wrap; justify-content: center; font-size: 19px; padding: 5px 10px; }
.rpg-bar .rh { position: relative; width: 150px; height: 26px; background: #4a3d68; border-radius: 99px; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; }
.rpg-bar .rh i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #e53935, #ff7a6b); transition: width .25s; }
.rpg-bar .rh b { position: relative; font-size: 16px; }
.rpg-pad { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.rp-dirs { direction: ltr; display: grid; grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(2, 58px); gap: 5px; grid-template-areas: ". u ." "l d r"; }
.rp-dirs button { font-size: 24px; padding: 0; } .rp-dirs .u { grid-area: u; } .rp-dirs .l { grid-area: l; } .rp-dirs .d { grid-area: d; } .rp-dirs .r { grid-area: r; }
.rp-atk { width: 184px; font-size: 30px; padding: 8px; background: #e53935; color: #fff; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.rp-atk small, .rp-pot small { font-size: 11px; font-weight: 800; opacity: .85; }
.rp-pot { width: 184px; font-size: 22px; padding: 6px; background: #7e57c2; color: #fff; display: flex; gap: 8px; align-items: center; justify-content: center; }
@media (max-width: 900px), (max-aspect-ratio: 5/4) {
  .rpg-main { flex-direction: column; }
  .rpg-pad { flex-direction: row; flex-wrap: wrap; }
  .rp-atk, .rp-pot { width: auto; min-width: 110px; }
}
.rpg-toast { position: absolute; top: 12px; left: 50%; transform: translate(-50%, -20px); z-index: 5; background: rgba(43, 33, 64, .92); color: #fff; font-size: 22px; font-weight: 900; padding: 8px 18px; border-radius: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; white-space: nowrap; }
.rpg-toast.show { opacity: 1; transform: translate(-50%, 0); }
/* the shop: big cards, the price on each, clear when you can't buy yet */
.rpg-ov.shop { width: min(720px, 94%); position: absolute; padding-top: 18px; }
.rpg-ov.shop h3 { font-size: 26px; }
.rs-x { position: absolute; top: 8px; left: 8px; width: 44px; height: 44px; padding: 0; font-size: 22px; border-radius: 50%; background: #eee; color: #333; }
.rs-items { grid-template-columns: repeat(5, 1fr); }
.rs-items button { position: relative; padding: 12px 4px 10px; border-width: 3px; border-radius: 16px; }
.rs-items button span { font-size: 44px; line-height: 1.1; }
.rs-items button b { font-size: 19px; } .rs-items button em { font-style: normal; font-size: 14px; font-weight: 700; color: #555; }
.rs-items button small { font-size: 18px; }
.rs-items button.can { border-color: #43a047; background: #f1fbf1; } .rs-items button.can:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.15); }
.rs-items button.cant { opacity: .45; }
.rs-items kbd { position: absolute; top: 4px; right: 6px; font-size: 12px; color: #999; font-family: inherit; }
@media (max-width: 700px) { .rs-items { grid-template-columns: repeat(3, 1fr); } }
.geo-hint { background: #fff8e1; border-radius: 10px; padding: 8px; font-size: 20px; font-weight: 800; text-align: center; }
.geo-pts { font-size: 40px; font-weight: 900; color: #888; animation: popIn .5s cubic-bezier(.2, 1.6, .4, 1); } .geo-pts.ok { color: #f9a825; } .geo-pts.great { color: #2e7d32; }
.gline { stroke-dasharray: 6 4; animation: gdraw 1s ease-out; } @keyframes gdraw { from { stroke-dashoffset: 400; opacity: .2; } to { stroke-dashoffset: 0; opacity: 1; } }
.georound.il .geo-mapwrap { justify-content: center; } .georound.il #geomap { width: auto; height: 100%; } .georound.il .geosvg { height: 100%; width: auto; max-width: 100%; }
.geo-stats.il { grid-template-columns: 1fr 2fr; } .geo-stats.il .geo-board { max-height: 70vh; } .geo-stats.il .geo-board .geosvg { max-height: 70vh; width: auto; margin: 0 auto; }
/* maps always fit their box (world 2:1, Israel tall) */
.geo-mapwrap { container-type: size; justify-content: center; }
#geomap { width: min(100cqw, calc(100cqh * 2)); height: auto; }
.georound.il #geomap { width: min(100cqw, calc(100cqh * 0.47)); height: auto; }
.georound.il .geosvg { width: 100%; height: auto; max-width: none; }
.app-chips { display: flex; flex-wrap: wrap; gap: 5px; } .app-chips button { font-size: 13px; padding: 5px 9px; background: #f2eefa; color: var(--ink); box-shadow: none; border-radius: 99px; } .app-chips .rnd { background: #ffe9a8; }
.app-stage { position: relative; flex-direction: column; }
.app-fs { position: absolute; top: 8px; left: 8px; z-index: 2; padding: 4px 10px; font-size: 18px; background: rgba(0,0,0,.55); color: #fff; box-shadow: none; }
.app-bug { width: 100%; background: #fff3e0; border-bottom: 2px solid #ffb74d; padding: 6px 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 700; } .app-bug code { background: #fff; padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.app-stage iframe { flex: 1; }
.vote.appvote { display: flex; flex-direction: column; background: #fff; padding: 0; }
.appvote .app-try { flex: 1; display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; background: linear-gradient(135deg, #ede7ff, #fff); color: var(--ink); box-shadow: none; padding: 12px; min-height: 120px; } .appvote .app-try b { font-size: 18px; }
.appvote .app-heart { font-size: 26px; background: #fff; box-shadow: none; padding: 4px; }
/* 🎨 slides without ranking: no numbers, no places – just the work */
.nosbtn { padding: 4px 8px; font-size: 13px; background: #fff3c4; color: var(--ink); box-shadow: none; } .nosbtn.off { background: #e3f2fd; }
.nos-tag { font-size: 15px; background: #e3f2fd; color: #0d47a1; border-radius: 99px; padding: 2px 10px; vertical-align: middle; }
.nos-note { background: #e3f2fd; border-radius: 10px; padding: 8px 12px; margin: 6px 0; font-weight: 700; }
.stage.noscore .sc, .stage.noscore .placebadge, .grid-res.noscore .score, .grid-res.noscore .rkn, .art-top.noscore .medal, .art-top.noscore .sc b { display: none !important; }
body.noscore .line.result .big, body.noscore .line .big, body.noscore .topbar .rankinfo, body.noscore .th span, body.noscore .ar-count, body.noscore .al-count b { display: none !important; }
.app-file { display: flex; gap: 6px; flex-wrap: wrap; } .app-file .btn-ghost { font-size: 14px; padding: 6px 10px; }

/* ✨ AI animation: the speed buttons under the two animations */
.speedbar { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; background: #fff; border-radius: 14px; padding: 6px 8px; }
.speedbar .lab { font-weight: 800; font-size: 15px; }
.speedbar .sp { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 3px 10px; border-radius: 12px; background: #f6f3fc; border: 2px solid #e6defa; font-size: 22px; min-width: 62px; cursor: pointer; font-family: inherit; color: var(--ink); }
.speedbar .sp small { font-size: 12px; font-weight: 700; color: var(--muted); }
.speedbar .sp.on { border-color: #6c3ce0; background: #efe9fb; box-shadow: inset 0 0 0 2px #6c3ce0; }
.speedbar .sp:hover { background: #efe9fb; }
.goal-card .target-anim { display: block; max-width: 100%; max-height: 52vh; margin: 8px auto; border-radius: 14px; background: #fff; }

/* ❤️ live hearts (emoji lab, dancing character): the classmates' creations while the slide runs */
.mix-main { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.mix-main .pic { flex: 1 1 0; }
.live-strip { display: flex; gap: 6px; align-items: center; background: #fff; border-radius: 14px; padding: 6px; overflow-x: auto; flex: none; }
.live-strip .strip-lab { font-weight: 800; font-size: 14px; white-space: nowrap; text-align: center; }
.live-strip .lv { position: relative; flex: none; width: 74px; height: 74px; border-radius: 12px; background: #f6f3fc; border: 3px solid transparent; }
.live-strip .lv.on { border-color: #ff3d7f; }
.live-strip .lv img { width: 100%; height: 100%; object-fit: contain; border-radius: 9px; cursor: zoom-in; }
.live-strip .lv button { position: absolute; bottom: -4px; inset-inline-start: -4px; font-size: 16px; padding: 1px 5px; border-radius: 10px; background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.25); display: flex; align-items: center; gap: 2px; }
.live-strip .lv button small { font-size: 12px; font-weight: 800; }
.hearts-got { color: #ff3d7f; font-size: 18px; white-space: nowrap; }
.mix-slots [data-mixslot].opt3:not(.full) { opacity: .75; }
@media (min-width: 900px) {
  .mix-main { flex-direction: row; }
  .mix-main .live-strip { flex-direction: column; width: 190px; overflow-x: hidden; overflow-y: auto; align-items: stretch; display: grid; grid-template-columns: 1fr 1fr; align-content: start; }
  .mix-main .live-strip .strip-lab { grid-column: 1 / -1; }
  .mix-main .live-strip .lv { width: auto; height: 80px; }
}
/* 🕺 dance floor colours */
.pup-floors { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; }
.pup-floors .lab { color: #fff; font-weight: 800; font-size: 14px; }
.pup-floors button { width: 40px; height: 34px; padding: 0; font-size: 18px; border-radius: 10px; border: 3px solid rgba(255,255,255,.6); box-shadow: none; }
.pup-floors button.sel { border-color: #ffd23f; box-shadow: 0 0 0 2px #6a3de8; }
.puppet .live-strip { flex: none; }
.puppet .pup-emotes { grid-template-columns: repeat(8, 1fr); }
.puppet .pup-emotes button { padding: 6px 2px; font-size: 15px; }
@media (max-width: 700px) { .puppet .pup-emotes { grid-template-columns: repeat(4, 1fr); } }
body[data-theme="clean"] .pup-floors .lab { color: var(--ink); }
/* ⚡ quick drawing: the board, and the short celebration after a word is guessed */
.quick .qboard { flex: 1; min-height: 0; display: flex; position: relative; }
.quick .qboard > .studio-host { flex: 1; }
.quick .qhit { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(38, 137, 12, .18); border-radius: 14px; z-index: 5; animation: qhitIn .25s ease-out; }
.quick .qhit-box { background: #fff; border-radius: 22px; padding: 18px 34px; text-align: center; box-shadow: 0 10px 0 rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 4px; align-items: center; }
.quick .qhit-box .qe { font-size: 72px; line-height: 1; }
.quick .qhit-box b { font-size: 30px; color: var(--good); }
.quick .qhit-box span { color: var(--muted); font-weight: 700; }
.quick .qbar i.paused { background: #ffd23f; }
@keyframes qhitIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
.slide-row label.chk { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.slide-row label.chk input { width: auto; margin: 0; }
/* 🔢 connect the dots: dragging a line */
.dots-svg.dragmode { touch-action: none; }
.dots-svg .dband { stroke: #6a3de8; stroke-width: 1.1; stroke-dasharray: 2 1.5; stroke-linecap: round; opacity: .7; pointer-events: none; }
.dots-top .dmode { font-size: 13px; font-weight: 800; color: #6a3de8; white-space: nowrap; }
.dots-game { user-select: none; -webkit-user-select: none; }
/* 🔐 escape room: AI-or-real picture, spot the difference */
.eimg img { max-width: min(340px, 100%); max-height: 32vh; border-radius: 12px; display: block; cursor: zoom-in; box-shadow: 0 4px 0 rgba(0,0,0,.15); }
.espot { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.espic { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.espic small { font-weight: 800; color: var(--muted); }
.espic.b small { color: #6a3de8; }
.esg { display: grid; grid-template-columns: repeat(var(--w), 1fr); gap: 3px; background: #e9f7e4; padding: 6px; border-radius: 12px; }
.espic.b .esg { background: #eef3ff; }
.esg > * { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 28px; border-radius: 8px; }
.esg button { padding: 0; background: transparent; box-shadow: none; border: 3px solid transparent; color: inherit; cursor: pointer; }
.esg button:hover { background: rgba(106, 61, 232, .1); }
.esg button.found { border-color: #e53935; border-radius: 50%; background: rgba(229, 57, 53, .1); }
.espot-left { font-size: 20px; font-weight: 800; text-align: center; padding: 10px; background: #fff7d6; border-radius: 12px; }
@media (max-width: 700px) { .esg > * { width: 34px; height: 34px; font-size: 22px; } }
/* 👥 choosing partners: invitations, and the 3-2-1 when a pair starts */
.pairpick .invites { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 8px; }
.pairpick .invite { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #fff7d6; border: 3px solid #ffd23f; border-radius: 14px; padding: 8px 10px; animation: popIn .35s cubic-bezier(.2, 1.4, .4, 1); }
.pairpick .invite span { flex: 1; font-size: 17px; }
.pairpick .invite .btn-main { padding: 8px 16px; font-size: 17px; }
.pairpick .invite .btn-ghost { padding: 6px 10px; font-size: 14px; }
.pairpick .waiting { background: #eef3ff; border-radius: 12px; padding: 8px 10px; margin: 0 0 8px; }
.pairpick .waiting .btn-ghost { padding: 2px 10px; font-size: 13px; }
.pairpick .chip.sel { outline: 3px solid #6a3de8; background: #efe9ff; }
.pairpick .chip.wants { background: #fff7d6; }
#pairpop .pp-321 { font-size: 54px; font-weight: 900; color: #6a3de8; line-height: 1.1; animation: popIn .45s cubic-bezier(.2, 1.6, .4, 1); }
/* 🛠️ app builder: the app box, full screen with a big way out, and "send to the teacher" */
.app-box { position: relative; flex: 1; width: 100%; min-height: 0; display: flex; flex-direction: column; }
.app-box iframe { flex: 1; width: 100%; height: 100%; border: 0; background: #fff; }
.app-box.full { position: fixed; inset: 0; z-index: 90; background: #fff; }
.app-box:fullscreen { background: #fff; }
.app-fsx { position: absolute; top: 10px; left: 10px; z-index: 3; padding: 10px 18px; font-size: 18px; font-weight: 900; background: #e53935; color: #fff; border-radius: 14px; box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.app-send { margin-top: 2px; }
.app-send.sent { background: var(--good); }
.sent-apps { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin-top: 10px; }
.sent-apps b { width: 100%; text-align: center; }
.sent-apps button small { color: var(--muted); font-weight: 700; }
/* 🔎 the Hebrew page about the games (/games) */
.about a { color: #ffd23f; font-weight: 700; }
.seo-page .wrap { max-width: 820px; }
.seo { line-height: 1.6; font-size: 17px; }
.seo h1 { font-size: 30px; }
.seo h2 { margin-top: 22px; color: #4a2bb0; }
.seo .lead { font-size: 19px; }
.seo-games { padding-inline-start: 18px; display: flex; flex-direction: column; gap: 6px; }
.seo-btn { display: inline-block; text-decoration: none; margin: 4px 0 4px 6px; padding: 10px 18px; border-radius: 14px; }
.seo a:not(.seo-btn) { color: #4a2bb0; font-weight: 700; }
.seo-btn.btn-main { color: #fff; } .seo-btn.btn-ghost { color: var(--ink); }
/* 🖼️ the teacher's gallery of the students' work */
.picsmodal { display: flex; flex-direction: column; gap: 10px; background: linear-gradient(#fbf9ff, #f1ecfc); }
.gal-h { flex-wrap: wrap; gap: 8px; align-items: center; position: sticky; top: -14px; z-index: 2; background: #fbf9ff; padding: 6px 0; }
.gal-h h3 { margin: 0; }
.gal-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1; justify-content: center; }
.gal-tools .opt { display: inline-flex; gap: 4px; }
.gal-tools button { padding: 6px 12px; font-size: 14px; }
.gallery.fancy { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.gcard { margin: 0; background: #fff; border-radius: 18px; padding: 8px; box-shadow: 0 6px 18px rgba(74, 43, 176, .12); cursor: zoom-in; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; gap: 6px; }
.gcard:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: 0 12px 26px rgba(74, 43, 176, .22); }
.gcard.fin { outline: 3px solid #ffd23f; }
.gcard .gimg { position: relative; }
.gcard .gimg img, .gcard .gimg video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; background: #f3f0fa; }
.gcard .gsc { position: absolute; top: 8px; inset-inline-start: 8px; background: rgba(255,255,255,.92); color: #4a2bb0; font-weight: 900; border-radius: 10px; padding: 1px 9px; font-size: 17px; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.gcard .gstar { position: absolute; top: 6px; inset-inline-end: 8px; font-size: 24px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.gcard .ghearts { position: absolute; bottom: 8px; inset-inline-start: 8px; background: #fff; color: #e53935; border-radius: 10px; padding: 0 8px; font-weight: 900; font-size: 15px; }
.gcard .gtag { position: absolute; bottom: 8px; inset-inline-end: 44px; font-size: 18px; }
.gcard .gplay { position: absolute; bottom: 6px; inset-inline-end: 6px; padding: 2px 8px; font-size: 18px; background: rgba(0,0,0,.55); color: #fff; box-shadow: none; border-radius: 10px; opacity: 0; transition: opacity .15s; }
.gcard:hover .gplay { opacity: 1; }
.gcard figcaption { display: flex; flex-direction: column; gap: 1px; padding: 0 4px 2px; font-size: 15px; }
.gcard figcaption .muted { font-size: 13px; }
.gcard .gpr { font-size: 13px; color: var(--ink); background: #f6f3fc; border-radius: 8px; padding: 3px 7px; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gal-rows { display: flex; flex-direction: column; gap: 16px; }
.gal-who { font-weight: 900; font-size: 18px; margin-bottom: 6px; }
.gal-show { flex: 1; min-height: 0; display: flex; align-items: center; gap: 12px; }
.gal-big { flex: 1; min-height: 0; height: 100%; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: zoom-in; }
.gal-big .big { max-width: 100%; max-height: calc(100% - 70px); min-height: 0; object-fit: contain; border-radius: 18px; box-shadow: 0 12px 34px rgba(0,0,0,.25); background: #fff; }
.gal-big figcaption { font-size: 24px; text-align: center; }
.gal-big .gpr { font-size: 18px; margin-top: 4px; }
.gal-big .gsc-in { color: #4a2bb0; }
.gal-arrow { font-size: 34px; padding: 18px 16px; border-radius: 18px; }
.gal-count { text-align: center; font-weight: 800; display: flex; gap: 10px; align-items: center; justify-content: center; }
.gal-tools .btn-main { background: var(--accent); color: #fff; }
/* 📺 the teacher's lobby and results fill the screen (laptop / projector) without scrolling the page;
   a long list scrolls inside its own box */
@media (min-width: 900px) and (min-height: 560px) {
  body[data-tphase="lobby"] .wrap, body[data-tphase="reveal"] .wrap { height: 100vh; display: flex; flex-direction: column; padding-top: 6px; padding-bottom: 10px; }
  body[data-tphase="lobby"] .wrap > .logo, body[data-tphase="reveal"] .wrap > .logo { margin: 4px 0 8px; font-size: 28px; }
  body[data-tphase="lobby"] #app, body[data-tphase="reveal"] #app { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  body[data-tphase="lobby"] .lobby-top { margin-bottom: 10px; }
  body[data-tphase="lobby"] .banner { margin-bottom: 8px; padding: 8px 14px; }
  body[data-tphase="lobby"] .players { flex: 1 1 0; min-height: 90px; overflow-y: auto; align-content: start; padding: 2px; }
  body[data-tphase="lobby"] .players.many { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
  body[data-tphase="lobby"] .players.many .pcard { padding: 6px; }
  body[data-tphase="lobby"] .players.many .av { font-size: 30px; }
  body[data-tphase="lobby"] .players.many .nm { font-size: 15px; }
  body[data-tphase="lobby"] .players.many .bio { display: none; }
  body[data-tphase="lobby"] #app > .card { flex: none; max-height: 34vh; overflow-y: auto; margin-bottom: 0; }
  .reveal-fit { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 16px; }
  .reveal-fit .rv-main { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-inline-end: 4px; }
  .reveal-fit .rv-main > h2 { margin: 6px 0 0; }
  .reveal-fit .rv-target { margin: 0; }
  .reveal-fit .rv-target .target, .reveal-fit .rv-target img { max-height: 34vh; }
  .reveal-fit .rv-side { min-height: 0; overflow-y: auto; margin: 0; display: flex; flex-direction: column; gap: 10px; }
  .reveal-fit .rv-side .rv-next { position: sticky; top: 0; z-index: 2; }
  .reveal-fit .grid-res { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}
@media (max-width: 899px) { .reveal-fit { display: flex; flex-direction: column; gap: 16px; } }
#freeze.lockall { background: rgba(20, 10, 50, .94); }
.vote.cardvote { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: #fff; color: var(--ink); padding: 14px 8px; min-height: 130px; }
.cardvote .cv-em { font-size: 28px; line-height: 1.3; word-break: break-all; text-align: center; }
.out-btn { left: auto; right: 10px; top: auto; bottom: 10px; font-size: 14px; opacity: .8; }
.lockbtn.on { background: #e53935 !important; color: #fff !important; animation: pulseGlow 1.5s infinite; }
@keyframes pulseGlow { 50% { box-shadow: 0 0 0 6px rgba(229,57,53,.3); } }
.danger { color: #c62828 !important; }
.reveal-tools { gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.pairs-panel .free button.paired { background: #e8f5e9; }
/* 🎯 the task card at the start of a slide, and clearer goals for students */
#taskpop { position: fixed; inset: 0; z-index: 95; display: flex; align-items: center; justify-content: center; background: rgba(20, 10, 50, .55); animation: fadeIn .2s; }
#taskpop .tp-in { background: #fff; border-radius: 26px; padding: 26px 34px; max-width: min(620px, 92vw); text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; box-shadow: 0 14px 0 rgba(0,0,0,.2); animation: popIn .35s cubic-bezier(.2, 1.4, .4, 1); }
#taskpop .tp-ic { font-size: 84px; line-height: 1; } #taskpop .tp-name { font-size: 34px; font-weight: 900; }
#taskpop .tp-goal { font-size: 28px; font-weight: 900; background: #fff7d6; border: 3px solid #ffd23f; border-radius: 16px; padding: 8px 16px; }
#taskpop .tp-how { font-size: 21px; line-height: 1.45; } #taskpop .btn-main { font-size: 22px; padding: 12px 34px; }
body.stu .play .line.goal { background: #fff7d6; border: 3px solid #ffd23f; font-size: 19px; }
body.stu .play .line.goal b { font-size: 22px; }
body.stu .topbar { font-size: 17px; }
body.stu button { font-size: max(1em, 16px); }
.guide h3 { margin: 0 0 8px; } .guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.guide-grid > div { display: flex; align-items: center; gap: 8px; background: #f6f3fc; border-radius: 12px; padding: 8px 10px; } .guide-grid b { font-size: 26px; } .guide-grid span { font-size: 16px; font-weight: 700; }
.openall.on { background: #43a047 !important; color: #fff !important; }

/* ── Landing (home page, only while the code box is showing) ───────────── */
body.compact .landing { display: none; }
.landing { max-width: 1080px; margin: 8px auto 0; padding: 0 16px 48px; color: #fff; }
.ld-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 40px 0 24px; }
.ld-kicker { font-size: 14px; font-weight: 700; color: #ffd23f; margin: 0 0 10px; }
.ld-hero h1 { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.08; font-weight: 900; margin: 0 0 16px; }
.ld-lead { font-size: 19px; line-height: 1.6; color: rgba(255,255,255,.86); margin: 0 0 24px; max-width: 34em; }
.ld-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.ld-btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 22px; border-radius: 999px; font-weight: 700; font-size: 17px;
  color: #fff; text-decoration: none; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); transition: transform .15s ease, background-color .15s ease; }
.ld-btn:hover { background: rgba(255,255,255,.2); transform: translateY(-1px); }
.ld-btn:active { transform: scale(.98); }
.ld-primary { background: var(--accent); border-color: transparent; box-shadow: 0 6px 0 rgba(0,0,0,.2); }
.ld-primary:hover { background: #ff5a93; }
.ld-facts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.ld-facts li { font-size: 14px; padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.18); color: rgba(255,255,255,.85); }
.ld-phones { display: flex; justify-content: center; gap: 18px; }
.ld-phones img { width: 46%; max-width: 240px; height: auto; border-radius: 26px; border: 6px solid #1d1033;
  box-shadow: 0 24px 60px rgba(0,0,0,.45); background: #2a0d5e; }
.ld-phones img:first-child { transform: rotate(-4deg) translateY(12px); }
.ld-phones img:last-child { transform: rotate(3deg) translateY(-10px); }
.ld-section { padding: 48px 0 8px; }
.ld-section h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 900; margin: 0 0 20px; }
.ld-games { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.ld-game { background: #fff; color: var(--ink); border-radius: 18px; padding: 18px; box-shadow: 0 6px 0 rgba(0,0,0,.18); }
.ld-emoji { font-size: 30px; display: block; margin-bottom: 8px; }
.ld-game h3 { font-size: 18px; margin: 0 0 6px; }
.ld-game p { font-size: 15px; line-height: 1.5; color: var(--muted); margin: 0; }
.ld-more { margin: 16px 0 0; }
.ld-more a, .ld-faq a, .ld-foot a { color: #ffd23f; font-weight: 700; }
.ld-steps ol { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ld-steps li { counter-increment: step; background: rgba(0,0,0,.18); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.ld-steps li::before { content: counter(step); width: 34px; height: 34px; border-radius: 50%; background: #ffd23f; color: #1d1033; font-weight: 900;
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.ld-steps b { font-size: 19px; }
.ld-steps span { color: rgba(255,255,255,.8); line-height: 1.5; }
.ld-faq details { background: rgba(0,0,0,.18); border-radius: 14px; padding: 14px 18px; margin-bottom: 10px; }
.ld-faq summary { font-weight: 700; font-size: 17px; cursor: pointer; }
.ld-faq p { margin: 10px 0 0; color: rgba(255,255,255,.85); line-height: 1.6; }
.ld-foot { margin-top: 48px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.15); display: flex; flex-wrap: wrap;
  justify-content: space-between; gap: 12px; color: rgba(255,255,255,.7); font-size: 15px; }
@media (max-width: 860px) {
  .ld-hero { grid-template-columns: 1fr; gap: 28px; padding-top: 24px; }
  .ld-games { grid-template-columns: repeat(2, 1fr); }
  .ld-steps ol { grid-template-columns: 1fr; }
}
@media (max-width: 480px) { .ld-games { grid-template-columns: 1fr; } .ld-lead { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) { .ld-btn { transition: none; } }
