/* Online classroom games (/play/*). Loaded only on those pages, on top of style.css.
   Also loaded by /live/, which uses .play-panel, .play-editor, .play-stage, .play-intro, .confetti and .ptoast. */
.play-panel { position: relative; overflow: hidden; min-height: 540px; display: flex; flex-direction: column; }
.play-panel:fullscreen { display: flex; }
.play-bar { margin-top: 0; }
.play-bar label { color: rgba(244,241,232,.85); }
.play-check { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; cursor: pointer; }
.tool-panel .play-check input { width: 18px; height: 18px; padding: 0; accent-color: var(--yellow); }
.play-editor { background: rgba(0,0,0,.2); border: 2px dashed var(--s-line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.play-editor textarea { width: 100%; font: 600 1rem/1.55 var(--font-body); resize: vertical; }
.play-editor select { max-width: 260px; }
.play-editor h3 { color: var(--chalk); font-size: 1.1rem; margin: 14px 0 4px; }
.play-stage { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 10px 0; }
.play-center { justify-content: center; }
.play-note { text-align: center; color: rgba(244,241,232,.75); font-weight: 600; margin: 10px auto; max-width: 640px; }
.play-note.big-note { font: 700 1.6rem var(--font-display); color: #fff; }
.play-keys { text-align: center; color: rgba(244,241,232,.45); font-size: .82rem; font-weight: 600; margin: 10px 0 0; }
.tool-panel kbd, .play-keys kbd { display: inline-block; font: 700 .72em/1 var(--font-body); padding: 3px 6px; border-radius: 5px; border: 1px solid currentColor; opacity: .7; margin: 0 1px; vertical-align: .08em; }
.tool-panel button.big { font-size: 1.25rem; padding: 14px 28px; }
.play-intro { text-align: center; padding: 20px 10px; }
.play-intro h2 { color: var(--chalk); font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 6px 0 10px; }
.play-intro p { color: rgba(244,241,232,.82); font-size: 1.1rem; max-width: 620px; margin: 0 auto 22px; }
.play-intro-emoji { font-size: 4.4rem; line-height: 1; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-4deg); } }
.play-rules { list-style: none; padding: 0; margin: -6px auto 22px; display: flex; flex-wrap: wrap; gap: 8px 12px; justify-content: center; max-width: 820px; }
.play-rules li { background: #fff8d6; color: #4a3200; font-weight: 700; padding: 8px 14px; border-radius: 4px; transform: rotate(-1deg); box-shadow: 0 6px 10px -6px rgba(0,0,0,.5); }
.play-rules li:nth-child(2) { transform: rotate(1.2deg); background: #dff1fb; }
.play-rules li:nth-child(3) { transform: rotate(-.6deg); background: #ffe1ea; }

/* Team colors, names and score chips */
.team-red { --tc: #ff6b5a; } .team-blue { --tc: #5aa2ff; } .team-yellow { --tc: #ffd25e; }
.team-green { --tc: #7dd87a; } .team-violet { --tc: #c4a3ff; } .team-teal { --tc: #4fd6bd; }
.pteams { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.pteams:empty { display: none; }
.pteam { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; border-radius: 999px; background: rgba(0,0,0,.22); border: 3px solid var(--tc); transition: transform .2s ease, box-shadow .2s ease; }
.pteam.is-turn { transform: translateY(-3px) scale(1.06); box-shadow: 0 0 0 4px rgba(255,255,255,.18), 0 0 22px var(--tc); }
.pteam.is-turn::before { content: '▼'; position: absolute; top: -22px; left: 50%; transform: translateX(-50%); color: var(--tc); font-size: .9rem; animation: bob 1.2s ease-in-out infinite; }
.pteam-name { font: 700 1rem var(--font-display); color: var(--tc); }
.pteam-badge { font: 700 .9rem var(--font-display); color: #ffd25e; }
.pteam-score { font: 700 1.6rem/1 var(--font-display); color: #fff; min-width: 1.6em; text-align: center; }
.pteam.is-bump .pteam-score { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.5); color: #ffd25e; } }
.pteam-float { position: absolute; left: 50%; top: -6px; font: 700 1.3rem var(--font-display); color: #ffd25e; text-shadow: 0 2px 4px rgba(0,0,0,.5); pointer-events: none; animation: floatup 1.1s ease-out forwards; }
.pteam-float.neg { color: #ff6b5a; }
@keyframes floatup { from { transform: translate(-50%, 0); opacity: 1; } to { transform: translate(-50%, -46px); opacity: 0; } }
.tool-panel .pteam-btns button { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 50%; font-size: 1.1rem; }
.pk-who, .mm-who, .ttt-who, .qs-turn { color: var(--tc); font-weight: 800; }

/* Countdown bar */
.pbar { position: relative; height: 16px; border-radius: 999px; background: rgba(0,0,0,.3); overflow: hidden; margin: 8px 0 4px; }
.pbar::before { content: ''; position: absolute; inset: 0; width: calc(var(--p, 1) * 100%); background: linear-gradient(90deg, #7dd87a, #ffd25e); border-radius: inherit; transition: background .3s; }
.pbar[data-s="5"]::before, .pbar[data-s="4"]::before, .pbar[data-s="3"]::before, .pbar[data-s="2"]::before, .pbar[data-s="1"]::before, .pbar[data-s="0"]::before { background: #ff6b5a; }
.pbar::after { content: attr(data-s); position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 700 .8rem var(--font-display); color: #fff; }

/* Modal card inside a game */
.play-modal { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(15,30,22,.78); backdrop-filter: blur(3px); padding: 16px; }
.play-modal[hidden] { display: none; }
.play-card { position: relative; width: min(760px, 100%); max-height: 100%; overflow: auto; background: var(--paper); color: var(--ink); border-radius: 14px; padding: 26px 24px 20px; text-align: center; box-shadow: 0 20px 40px rgba(0,0,0,.45); border-top: 10px solid var(--tc, var(--yellow)); animation: pop .25s ease; }
.play-card.is-steal { animation: pop .25s ease, wiggle .5s ease .25s; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
@keyframes wiggle { 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }
.play-card h2 { color: var(--ink); font-size: clamp(1.5rem, 3.4vw, 2.4rem); margin: 4px 0 14px; }
.play-card-label { font: 700 1.4rem var(--font-hand); color: var(--tc, var(--muted)); margin: 0; filter: brightness(.8); }
.play-answer { font: 700 1.7rem var(--font-display); color: var(--green); background: #eaf6e7; border-radius: 10px; padding: 8px 18px; display: inline-block; animation: pop .3s ease; }
.play-card .tool-row { margin: 10px 0 0; }
.tool-panel .play-card button { color: var(--ink); border-color: var(--line); background: #f3eee2; }
.tool-panel .play-card button.primary { background: var(--yellow); border-color: var(--yellow); color: #3b2a00; }
.tool-panel .play-card .play-card-close { position: absolute; top: 8px; right: 8px; width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 50%; border-style: solid; font-size: 1rem; }
.pk-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; text-align: left; }
.tool-panel .play-card .pk-choice { font: 700 1.2rem var(--font-display); padding: 12px 14px; border: 2px solid var(--line); border-style: solid; background: #fff; transition: opacity .3s, background .3s; }
.pk-choice b { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: #fff; flex: none; }
.tool-panel .play-card .pk-choice.is-right { background: #dff3da; border-color: var(--green); }
.tool-panel .play-card .pk-choice.is-right b { background: var(--green); }
.pk-choice.is-dim { opacity: .45; }
.tool-panel .play-card .pk-choice.is-picked { box-shadow: 0 0 0 4px var(--tc, var(--yellow)); opacity: 1; }

/* Confetti, toast, splash */
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 9; }
.confetti i { position: absolute; top: -12px; width: 10px; height: 16px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { top: 110%; transform: translateX(40px) rotate(720deg); } }
.ptoast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; z-index: 100; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 700; box-shadow: 0 10px 24px rgba(0,0,0,.35); transition: all .3s ease; max-width: calc(100% - 32px); }
.ptoast.show { opacity: 1; transform: translate(-50%, 0); }
.pk-splash { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; pointer-events: none; padding: 16px; }
.pk-splash > div { font: 700 clamp(2rem, 6vw, 4.6rem)/1.1 var(--font-display); color: #fff; text-align: center; padding: 18px 34px; border-radius: 18px; background: rgba(20,40,28,.92); border: 5px solid #fff; transform: rotate(-3deg); box-shadow: 0 18px 40px rgba(0,0,0,.5); animation: slam .45s cubic-bezier(.2,1.6,.4,1) both; }
.pk-splash.is-gold > div { background: #ffd25e; color: #4a3200; border-color: #fff8d6; }
.pk-splash.is-steal > div { background: #e2453c; border-color: #ffd2cc; }
.pk-splash.is-twist > div { background: #8e6bbf; border-color: #e8dcff; transform: rotate(2deg); }
.pk-splash.is-team > div { background: var(--tc); color: #1d1d1d; }
.pk-splash.out { opacity: 0; transition: opacity .4s; }
@keyframes slam { from { transform: scale(2.4) rotate(-12deg); opacity: 0; } }

/* End screen and podium */
.pk-end { text-align: center; padding: 10px 6px; position: relative; }
.pk-end-title { font: 700 1.8rem var(--font-hand); color: #ffd25e; margin: 0; }
.pk-end-head { color: #fff; font-size: clamp(1.7rem, 4vw, 2.8rem); margin: 4px 0 16px; }
.pk-end-score { color: rgba(244,241,232,.85); font: 700 1.3rem var(--font-display); margin: -6px 0 18px; }
.pk-podium { display: flex; justify-content: center; align-items: flex-end; gap: 12px; margin: 0 auto 16px; max-width: 640px; }
.pk-step { flex: 1; max-width: 190px; display: flex; flex-direction: column; align-items: center; gap: 2px; animation: rise .7s cubic-bezier(.2,1.3,.4,1) both; }
.pk-step.place-1 { animation-delay: .5s; } .pk-step.place-2 { animation-delay: .25s; }
@keyframes rise { from { transform: translateY(60px); opacity: 0; } }
.pk-step-emoji { font-size: 2.6rem; line-height: 1; }
.pk-step.place-1 .pk-step-emoji { font-size: 3.4rem; animation: bob 1.6s ease-in-out infinite; }
.pk-step-name { font: 700 1.2rem var(--font-display); color: var(--tc); }
.pk-step-score { font: 700 1.8rem/1 var(--font-display); color: #fff; }
.pk-step-block { width: 100%; display: grid; place-items: start center; padding-top: 10px; font-size: 2rem; border-radius: 10px 10px 0 0; background: var(--tc); box-shadow: inset 0 -8px 0 rgba(0,0,0,.18), inset 0 4px 0 rgba(255,255,255,.3); height: 70px; margin-top: 6px; }
.pk-step.place-1 .pk-step-block { height: 140px; }
.pk-step.place-2 .pk-step-block { height: 100px; }
.pk-rest { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; padding: 0; margin: 0 0 16px; }
.pk-rest li { font: 700 1.05rem var(--font-display); color: var(--tc); background: rgba(0,0,0,.25); padding: 4px 12px; border-radius: 999px; }
.pk-rest b { color: #fff; }
.pk-endmodal { z-index: 7; }

/* Shared "which team?" buttons */
.qs-ask { text-align: center; font: 700 1.25rem var(--font-display); color: var(--chalk); margin: 8px 0; }
.qs-judge { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 6px 0 4px; }
.tool-panel .qs-tm { border: 3px solid var(--tc); color: var(--tc); background: rgba(0,0,0,.25); font: 700 1.2rem var(--font-display); padding: 10px 18px; border-radius: 999px; }
.tool-panel .qs-tm:hover { background: rgba(0,0,0,.35); border-style: solid; }
.tool-panel .qs-tm.is-on { background: var(--tc); color: #1d1d1d; box-shadow: 0 0 18px var(--tc); }
.tool-panel .qs-tm.is-on::after { content: ' ✔'; }
.tool-panel .play-card .qs-tm { background: #fff; color: var(--ink); border-color: var(--tc); }

/* ---------- Quiz show ---------- */
.qs-play { display: flex; flex-direction: column; }
.qs-head { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.qs-count { font: 700 1.4rem var(--font-hand); color: rgba(244,241,232,.8); margin: 0; }
.qs-count span { margin-left: 6px; }
.qs-double { font: 700 1rem var(--font-display); background: #ffd25e; color: #4a3200; padding: 4px 12px; border-radius: 999px; animation: glow 1.2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 18px #ffd25e; } }
.qs-clock { --p: 1; margin-left: auto; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#ffd25e calc(var(--p) * 360deg), rgba(0,0,0,.3) 0); position: relative; }
.qs-clock[hidden] { display: grid; visibility: hidden; }
.qs-clock::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: #23402f; }
.qs-clock::after { content: attr(data-s); position: relative; font: 700 1.7rem var(--font-display); color: #fff; }
.qs-clock[data-s="5"], .qs-clock[data-s="4"], .qs-clock[data-s="3"], .qs-clock[data-s="2"], .qs-clock[data-s="1"], .qs-clock[data-s="0"] { background: conic-gradient(#ff6b5a calc(var(--p) * 360deg), rgba(0,0,0,.3) 0); animation: beat 1s ease infinite; }
@keyframes beat { 15% { transform: scale(1.15); } }
.qs-dots { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; margin: 2px 0 0; }
.qs-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(244,241,232,.2); }
.qs-dots i.done { background: rgba(244,241,232,.6); }
.qs-dots i.now { background: #ffd25e; transform: scale(1.3); }
.qs-q { color: #fff; text-align: center; font-size: clamp(1.7rem, 4.2vw, 3.2rem); margin: 14px auto 20px; max-width: 980px; overflow-wrap: anywhere; }
.qs-q.is-mid { font-size: clamp(1.5rem, 3.4vw, 2.6rem); }
.qs-q.is-long { font-size: clamp(1.25rem, 2.6vw, 2rem); }
.qs-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tool-panel .qs-ans { position: relative; display: flex; align-items: center; gap: 14px; text-align: left; padding: 18px; border: 0; border-radius: 12px; color: #fff; font: 700 clamp(1.1rem, 2.4vw, 1.8rem)/1.2 var(--font-display); box-shadow: inset 0 -6px 0 rgba(0,0,0,.2); transition: transform .12s, opacity .4s, filter .4s; min-height: 88px; animation: dealin .4s ease both; animation-delay: var(--d, 0s); overflow-wrap: anywhere; }
@keyframes dealin { from { transform: translateY(24px) scale(.95); opacity: 0; } }
.tool-panel .qs-ans:hover { transform: translateY(-2px); }
.tool-panel .qs-ans.ans-0 { background: #e2453c; } .tool-panel .qs-ans.ans-1 { background: #2f6fd1; }
.tool-panel .qs-ans.ans-2 { background: #c98a00; } .tool-panel .qs-ans.ans-3 { background: #3c8f37; }
.qs-shape { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 10px; background: rgba(255,255,255,.18); font-size: 1.6rem; position: relative; }
.qs-shape small { position: absolute; right: -6px; bottom: -6px; font-size: .75rem; background: #fff; color: #333; border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; }
.qs-ans.is-dim { opacity: .22; filter: grayscale(.7); transform: scale(.96); }
.qs-ans.is-right { outline: 6px solid #fff; animation: winpop .6s cubic-bezier(.2,1.6,.4,1); z-index: 1; box-shadow: 0 0 30px rgba(255,255,255,.6); }
@keyframes winpop { 0% { transform: scale(.9); } 60% { transform: scale(1.06); } }
.qs-ans.is-right::after { content: '✔'; margin-left: auto; font-size: 2rem; }
.qs-ans.is-wrong { opacity: .55; }
.qs-ans.is-wrong::after { content: '✘'; margin-left: auto; font-size: 2rem; }
.qs-ans.is-picked { outline: 4px dashed #fff; }
.qs-actions { flex-direction: column; align-items: center; min-height: 120px; margin-top: 14px; }
.qs-timeup { font: 700 1.6rem var(--font-display); color: #ff6b5a; margin: 0 0 6px; animation: pop .3s ease; }
.qs-play.is-timeup .qs-ans { animation: none; }
.qs-drum { font: 700 2rem var(--font-hand); color: #ffd25e; margin: 6px 0; animation: beat .5s ease infinite; }

/* ---------- Tic tac toe ---------- */
.ttt-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ttt-status { font: 700 1.6rem var(--font-display); color: var(--chalk); text-align: center; min-height: 1.6em; }
.ttt-status button { margin-left: 10px; vertical-align: middle; }
.ttt-who { font-size: 2rem; color: var(--tc); }
.ttt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(460px, 100%); }
.tool-panel .ttt-cell { position: relative; aspect-ratio: 1; justify-content: center; font: 700 clamp(3rem, 9vw, 5.4rem)/1 var(--font-display); border: 3px solid rgba(244,241,232,.35); border-radius: 14px; background: rgba(255,255,255,.06); }
.tool-panel .ttt-cell small { font-size: 1.5rem; color: rgba(244,241,232,.5); }
.tool-panel .ttt-cell:disabled { cursor: default; }
.tool-panel .ttt-cell.is-gold { border-color: #ffd25e; border-style: solid; background: rgba(255,210,94,.12); }
.ttt-star { position: absolute; top: 6px; right: 8px; font-size: 1.4rem; animation: twinkle 1.6s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(1.25) rotate(15deg); } }
.ttt-cell.mark-X { color: #ff6b5a; animation: stamp .35s cubic-bezier(.2,1.6,.4,1); }
.ttt-cell.mark-O { color: #5aa2ff; animation: stamp .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes stamp { from { transform: scale(1.8); opacity: 0; } }
.tool-panel .ttt-cell.is-win { background: rgba(255,210,94,.35); border-color: #ffd25e; border-style: solid; animation: winpulse 1s ease-in-out infinite; }
@keyframes winpulse { 50% { box-shadow: 0 0 26px #ffd25e; } }
.ttt-grid.is-over .ttt-cell:not(.is-win) { opacity: .55; }
.ttt-wins { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; color: rgba(244,241,232,.8); font-weight: 700; }
.ttt-wins .team-red, .ttt-wins .team-blue { color: var(--tc); font-size: 1.15rem; }
.ttt-wins b { color: #fff; font-size: 1.4rem; margin-left: 4px; }
.ttt-champ { font: 700 9rem/1 var(--font-display); color: var(--tc); text-shadow: 0 0 30px var(--tc); animation: stamp .5s cubic-bezier(.2,1.6,.4,1); }
.tool-panel:fullscreen .ttt-grid { width: min(56vh, 100%); }

/* ---------- Memory match ---------- */
.mm-status, .mp-status, .gw-status { text-align: center; font: 700 1.35rem var(--font-display); color: var(--chalk); margin-bottom: 12px; min-height: 1.6em; }
.mm-status button, .mp-status button, .gw-status button { margin-left: 10px; vertical-align: middle; }
.mm-typed { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 8px; background: #ffd25e; color: #4a3200; }
.mm-grid { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 12px; max-width: 900px; width: 100%; margin: 0 auto; }
.tool-panel .mm-card { position: relative; height: 108px; padding: 0; border: 0; background: none; perspective: 800px; animation: dealin .35s ease both; animation-delay: var(--d, 0s); }
.tool-panel .mm-card:hover { background: none; }
.mm-back, .mm-front { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 12px; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .5s cubic-bezier(.3,1.3,.5,1); padding: 8px; text-align: center; }
.mm-back { background: repeating-linear-gradient(45deg, #ffd25e 0 12px, #f2b705 12px 24px); color: #5a3f00; font: 700 2.2rem var(--font-display); box-shadow: inset 0 -5px 0 rgba(0,0,0,.18); }
.mm-card:hover .mm-back { filter: brightness(1.08); }
.mm-front { background: var(--paper); color: var(--ink); font: 700 clamp(1.05rem, 2vw, 1.55rem)/1.15 var(--font-display); transform: rotateY(180deg); overflow-wrap: anywhere; overflow: hidden; }
.mm-front.is-mid { font-size: clamp(.95rem, 1.6vw, 1.25rem); }
.mm-front.is-long { font-size: clamp(.8rem, 1.3vw, 1.05rem); }
.mm-front.is-emoji { font-size: clamp(2.4rem, 5vw, 3.6rem); }
.mm-front img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.mm-front.side-b { background: #e3f0fc; }
.mm-card.is-up .mm-back { transform: rotateY(180deg); }
.mm-card.is-up .mm-front { transform: rotateY(360deg); }
.mm-card.is-miss .mm-front { animation: shake .45s ease; box-shadow: 0 0 0 4px #ff6b5a; }
.mm-card.is-found .mm-front { box-shadow: 0 0 0 5px var(--tc, #7dd87a); animation: winpop .5s ease; }
.mm-card.is-gold .mm-front { background: #fff3c4; box-shadow: 0 0 0 5px #ffd25e, 0 0 24px #ffd25e; }
.mm-card[data-team]::after { content: attr(data-team); position: absolute; top: -8px; right: -6px; font-size: 1.3rem; z-index: 2; }
.mm-card.by-red { --tc: #ff6b5a; } .mm-card.by-blue { --tc: #5aa2ff; } .mm-card.by-yellow { --tc: #ffd25e; }
.mm-card.by-green { --tc: #7dd87a; } .mm-card.by-violet { --tc: #c4a3ff; } .mm-card.by-teal { --tc: #4fd6bd; }
.tool-panel:fullscreen .mm-card { height: calc((100vh - 320px) / var(--rows, 4) - 12px); }
.tool-panel:fullscreen .mm-front { font-size: clamp(1.1rem, 2.4vh, 2rem); }
.tool-panel:fullscreen .mm-front.is-emoji { font-size: 8vh; }
@media (max-width: 600px) { .mm-grid { gap: 8px; } .tool-panel .mm-card { height: 78px; } .mm-back { font-size: 1.4rem; } .mm-front { font-size: .9rem; padding: 4px; } .mm-front.is-emoji { font-size: 2rem; } }

/* ---------- Guess the word ---------- */
.gw-wrap { display: flex; flex-direction: column; align-items: center; }
.gw-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; width: 100%; margin-bottom: 6px; }
.gw-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-panel .gw-tools button { padding: 8px 12px; font-size: .92rem; }
.tool-panel .gw-tools button:disabled { opacity: .4; cursor: default; }
.gw-tools small { opacity: .7; }
.gw-worth { color: #ffd25e; }
.gw-board { display: grid; gap: 7px; margin-bottom: 12px; }
.gw-row { position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 7px; }
.gw-row.by-team::before { content: ''; position: absolute; left: -22px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--tc); box-shadow: 0 0 8px var(--tc); }
.gw-row.is-now .gw-cell { border-color: rgba(244,241,232,.5); }
.gw-row.is-shake { animation: shake .4s ease; }
.gw-row.is-win .gw-cell { animation: flipin .5s ease both, hop .4s ease both; animation-delay: var(--d, 0s), calc(var(--d, 0s) + .6s); }
@keyframes hop { 50% { transform: translateY(-14px); } }
.gw-cell { width: clamp(24px, calc((100vw - 120px) / var(--n) - 7px), 66px); aspect-ratio: 1; display: grid; place-items: center; border: 3px solid rgba(244,241,232,.3); border-radius: 8px; font: 700 clamp(1.1rem, 3.4vw, 2.3rem) var(--font-display); color: #fff; text-transform: uppercase; }
.gw-cell.typed { border-color: rgba(244,241,232,.85); animation: pop .12s ease; }
.gw-pattern { font: 700 1.6rem var(--font-display); color: #ffd25e; margin: 0 0 10px; letter-spacing: .1em; animation: pop .3s ease; }
.gw-pattern b { display: inline-block; min-width: 1.1em; text-align: center; }
.gw-cell.correct, .gw-cell.present, .gw-cell.absent { border-color: transparent; }
.gw-row.is-fresh .gw-cell { animation: flipin .5s ease both; animation-delay: var(--d, 0s); }
.gw-cell.correct { background: #4f9d4a; } .gw-cell.present { background: #c98a00; } .gw-cell.absent { background: rgba(0,0,0,.35); }
@keyframes flipin { 0% { transform: rotateX(90deg); } 100% { transform: none; } }
.gw-hint { font: 700 1.7rem var(--font-hand); color: #ffd25e; margin: 4px 0 10px; text-align: center; }
.gw-keys { display: flex; flex-direction: column; gap: 6px; align-items: center; width: 100%; max-width: 680px; }
.gw-keys div { display: flex; gap: 5px; justify-content: center; width: 100%; }
.tool-panel .gw-key { flex: 1; max-width: 54px; padding: 14px 0; justify-content: center; font: 700 1.15rem var(--font-display); border-style: solid; border-width: 0; background: rgba(255,255,255,.16); }
.tool-panel .gw-key.wide { max-width: 90px; flex: 1.6; font-size: .9rem; }
.tool-panel .gw-key.correct { background: #4f9d4a; } .tool-panel .gw-key.present { background: #c98a00; } .tool-panel .gw-key.absent { background: rgba(0,0,0,.4); color: rgba(255,255,255,.45); }
/* full screen: the board takes whatever height is left (after the clue lines and keyboard) and the cells size to it */
.tool-panel:fullscreen .play-stage:has(.gw-wrap) { min-height: 0; }
.tool-panel:fullscreen .gw-wrap { flex: 1; min-height: 0; }
.tool-panel:fullscreen .gw-board { flex: 1 1 0; min-height: 0; width: 100%; container-type: size; display: flex; flex-direction: column; justify-content: center; align-items: center; margin-bottom: 8px; }
.tool-panel:fullscreen .gw-cell { --cell: min(calc((100cqh - 35px) / 6), calc((100cqw - 60px) / var(--n) - 7px), 110px); width: var(--cell); font-size: calc(var(--cell) * .56); }
.tool-panel:fullscreen .gw-key { padding: 1.1vh 0; }
.tool-panel:fullscreen .gw-status { margin-bottom: 6px; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- Word scramble ---------- */
.ws-wrap { text-align: center; }
.ws-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ws-worth { font: 700 1.1rem var(--font-display); color: #ffd25e; }
.ws-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 26px 0 16px; }
.ws-tile { display: block; will-change: transform; }
.ws-face { width: clamp(44px, 8vw, 84px); aspect-ratio: 1; display: grid; place-items: center; background: #f6e7c8; color: #4a3200; border-radius: 10px; font: 700 clamp(1.6rem, 4.6vw, 3rem) var(--font-display); box-shadow: inset 0 -6px 0 #d9c294, 0 8px 12px -6px rgba(0,0,0,.5); transform: rotate(var(--r)); animation: drop .45s cubic-bezier(.3,1.4,.5,1) both; animation-delay: var(--d); transition: background .3s, transform .3s; }
.ws-tile.is-locked .ws-face { background: #7dd87a; color: #173d14; box-shadow: inset 0 -6px 0 #4f9d4a, 0 8px 12px -6px rgba(0,0,0,.5); transform: none; }
@keyframes drop { from { transform: translateY(-50px) rotate(0); opacity: 0; } }
.ws-answer { font: 700 clamp(1.8rem, 4.6vw, 3.2rem) var(--font-display); color: #7dd87a; letter-spacing: .12em; margin: 6px 0; animation: pop .3s ease; }
.tool-panel:fullscreen .ws-face { width: min(12vh, calc((100vw - 200px) / 10)); font-size: 6vh; }

/* ---------- Mystery picture ---------- */
.mp-wrap { display: flex; flex-direction: column; align-items: center; }
.mp-top { display: flex; justify-content: space-between; align-items: center; width: min(620px, 100%); gap: 10px; margin-bottom: 4px; }
.mp-guessrow { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.mp-guessrow button { margin: 0 !important; }
.mp-frame { position: relative; container-type: size; width: min(620px, 100%); aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: radial-gradient(circle, #fffdf7, #f1e6cc); box-shadow: 0 10px 22px rgba(0,0,0,.4); }
.mp-pic { position: absolute; inset: 0; display: grid; place-items: center; line-height: 1; overflow: hidden; }
.mp-pic span { display: block; font-size: 100cqh; transform: rotate(var(--rot, 0deg)); }
.mp-pic.is-img img { width: 100%; height: 100%; object-fit: cover; }
.mp-tiles { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); }
.tool-panel .mp-tile { border-radius: 0; border: 2px solid rgba(0,0,0,.18); justify-content: center; font: 700 2.2rem var(--font-display); color: #fff; transition: transform .6s cubic-bezier(.5,-0.4,.6,1), opacity .6s ease; text-shadow: 0 2px 0 rgba(0,0,0,.2); }
.tool-panel .mp-tile:nth-child(4n+1) { background: #e2453c; } .tool-panel .mp-tile:nth-child(4n+2) { background: #2f6fd1; }
.tool-panel .mp-tile:nth-child(4n+3) { background: #c98a00; } .tool-panel .mp-tile:nth-child(4n) { background: #3c8f37; }
.tool-panel .mp-tile:nth-child(n+5):nth-child(-n+8) { filter: brightness(1.12); }
.tool-panel .mp-tile:hover { filter: brightness(1.25); }
.tool-panel .mp-tile.is-gone { transform: translateY(40%) rotate(25deg) scale(.3); opacity: 0; pointer-events: none; }
.mp-name { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: var(--ink); color: #fff; font: 700 1.8rem var(--font-display); padding: 6px 22px; border-radius: 999px; animation: pop .4s ease; white-space: nowrap; max-width: 94%; overflow: hidden; text-overflow: ellipsis; }
.mp-name[hidden] { display: none; }
.mp-own textarea { min-height: 90px; }
.mp-teampick { gap: 10px; }
.tool-panel:fullscreen .mp-frame, .tool-panel:fullscreen .mp-top { width: min(calc((100vh - 420px) * 4 / 3), 100%); }

/* ---------- Pass the bomb ---------- */
.pb-wrap { text-align: center; padding: 10px 0; position: relative; }
.pb-label { font: 700 1.5rem var(--font-hand); color: rgba(244,241,232,.75); margin: 0; }
.pb-prompt { color: #fff; font-size: clamp(1.9rem, 5vw, 3.6rem); margin: 4px 0 6px; overflow-wrap: anywhere; }
.pb-scene { display: flex; align-items: center; justify-content: center; gap: 0; margin: 4px auto; max-width: 760px; }
.pb-fuse { width: min(420px, 52%); height: auto; overflow: visible; margin-right: -14px; position: relative; z-index: 1; }
.pb-rope { fill: none; stroke: rgba(0,0,0,.35); stroke-width: 9; stroke-linecap: round; }
.pb-burn { fill: none; stroke: #c9a46b; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 6 5; }
.pb-glow { fill: rgba(255,170,40,.55); animation: flicker .15s steps(2) infinite; }
.pb-sparkt { font-size: 26px; }
@keyframes flicker { 50% { opacity: .4; transform: scale(1.4); } }
.pb-bomb { position: relative; display: inline-block; font-size: clamp(5.5rem, 16vw, 10rem); line-height: 1.1; }
.pb-bomb.lit { animation: wobble var(--speed, .5s) ease-in-out infinite; }
@keyframes wobble { 25% { transform: rotate(-7deg) scale(1.04); } 75% { transform: rotate(7deg) scale(.97); } }
.pb-pass { font: 700 2rem var(--font-hand); color: #ffd25e; }
.pb-flash { position: absolute; inset: 0; z-index: 6; pointer-events: none; background: radial-gradient(circle, #fff 0%, #ffd25e 30%, #e2453c 60%, transparent 80%); animation: flash .8s ease-out forwards; }
@keyframes flash { from { opacity: 1; transform: scale(.3); } to { opacity: 0; transform: scale(2.2); } }
.is-boom .pb-bomb { animation: boom .5s cubic-bezier(.2,1.6,.4,1); font-size: clamp(7rem, 20vw, 13rem); }
@keyframes boom { from { transform: scale(.2) rotate(-30deg); } }
.is-boom .pb-prompt { color: #ff6b5a; font-size: clamp(2.8rem, 9vw, 5.6rem); letter-spacing: .04em; text-shadow: 4px 4px 0 rgba(0,0,0,.3); }
.tool-panel .qs-tm.is-boomed { background: var(--tc); color: #1d1d1d; }
.tool-panel .qs-tm.is-boomed::after { content: ' 💥'; }
.tool-panel .qs-tm:disabled { cursor: default; }
.pb-shake { animation: shake .6s ease; }
.tool-panel:fullscreen .pb-bomb { font-size: 22vh; }
.tool-panel:fullscreen .is-boom .pb-bomb { font-size: 30vh; }

/* ---------- Would you rather ---------- */
.wy-wrap { text-align: center; }
.wy-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.wy-total { font: 700 1rem var(--font-display); color: rgba(244,241,232,.7); }
.wy-cards { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; margin: 14px 0; }
.wy-or { align-self: center; font: 700 2rem var(--font-hand); color: #ffd25e; }
.wy-card { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 16px 16px; border-radius: 16px; color: #fff; box-shadow: inset 0 -6px 0 rgba(0,0,0,.18); transition: transform .3s, box-shadow .3s; }
.wy-card.side-0 { background: #2f6fd1; } .wy-card.side-1 { background: #d9622a; }
.wy-card.is-winner { transform: scale(1.04) rotate(-.6deg); box-shadow: 0 0 0 6px #ffd25e, 0 0 34px rgba(255,210,94,.7); }
.wy-card.is-winner::before { content: '👑'; position: absolute; top: 6px; right: 12px; font-size: 2.2rem; animation: stamp .5s cubic-bezier(.2,1.6,.4,1); }
.wy-letter { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.25); display: grid; place-items: center; font: 700 1.6rem var(--font-display); }
.wy-card h2 { color: #fff; font-size: clamp(1.5rem, 3.4vw, 2.6rem); margin: 0; flex: 1; display: grid; place-items: center; overflow-wrap: anywhere; }
.wy-count { display: flex; align-items: center; gap: 10px; }
.wy-count b { font: 700 2.4rem var(--font-display); min-width: 2ch; }
.wy-count b.is-hidden { opacity: .55; }
.wy-count b.is-bump { animation: bump .35s ease; }
.tool-panel .wy-count button { width: 42px; height: 42px; padding: 0; justify-content: center; border-radius: 50%; font-size: 1.3rem; border-color: rgba(255,255,255,.5); }
.tool-panel .wy-count .wy-five { width: auto; padding: 0 12px; border-radius: 999px; font-size: 1rem; }
.wy-bar { width: 100%; height: 34px; background: rgba(0,0,0,.25); border-radius: 999px; overflow: hidden; }
.wy-bar i { display: flex; align-items: center; justify-content: flex-end; height: 100%; width: 0; background: #ffd25e; color: #3b2a00; font: 700 1.05rem var(--font-display); font-style: normal; padding-right: 8px; border-radius: inherit; white-space: nowrap; }
/* no sliver before the result */
.wy-bar i:empty { padding: 0; }
.wy-talk { background: #fff8d6; color: #4a3200; border-radius: 4px; padding: 12px 18px; margin: 4px auto 10px; max-width: 760px; font-weight: 700; transform: rotate(-.6deg); box-shadow: 0 8px 14px -8px rgba(0,0,0,.6); animation: pop .3s ease; }
.wy-talk b { display: block; font: 700 1.4rem var(--font-display); color: #2b2a33; }
.wy-frame { font: 700 1.5rem var(--font-hand); color: #b34700; }
.wy-recap { list-style: none; padding: 0; margin: 10px auto 20px; max-width: 900px; display: grid; gap: 8px; }
.wy-recap li { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.wy-recap em { color: #ffd25e; font: 700 1.2rem var(--font-hand); }
.wy-r { padding: 8px 12px; border-radius: 10px; color: #fff; font-weight: 700; opacity: .6; }
.wy-r.side-0 { background: #2f6fd1; text-align: right; } .wy-r.side-1 { background: #d9622a; text-align: left; }
.wy-r.is-win { opacity: 1; box-shadow: 0 0 0 3px #ffd25e; }
.wy-r b { font-family: var(--font-display); }

/* ---------- Full screen: bigger for the back row, keep the bottom-right corner free for the watermark ---------- */
.tool-panel:fullscreen .play-stage { padding-bottom: 6px; }
.tool-panel:fullscreen .pteams { margin: 8px 0 6px; }
.tool-panel:fullscreen .play-bar { gap: 6px; }
.tool-panel:fullscreen .play-bar button, .tool-panel:fullscreen .play-bar select { padding: 6px 10px; font-size: .85rem; }
.tool-panel:fullscreen .play-bar label { font-size: .85rem; }
.tool-panel:fullscreen .pteam { padding: 8px 10px 8px 18px; }
.tool-panel:fullscreen .pteam-name { font-size: 1.3rem; }
.tool-panel:fullscreen .pteam-score { font-size: 2.2rem; }
.tool-panel:fullscreen .qs-q { font-size: clamp(2rem, 5.4vh, 4rem); }
.tool-panel:fullscreen .qs-q.is-long { font-size: clamp(1.6rem, 4vh, 2.8rem); }
.tool-panel:fullscreen .qs-ans { font-size: clamp(1.3rem, 3.4vh, 2.4rem); min-height: 13vh; }
.tool-panel:fullscreen .play-card h2 { font-size: clamp(2rem, 5vh, 3.4rem); }
.tool-panel:fullscreen .play-card { width: min(1000px, 100%); }
.tool-panel:fullscreen .play-keys { display: none; }
.tool-panel:fullscreen .mm-status, .tool-panel:fullscreen .mp-status, .tool-panel:fullscreen .gw-status, .tool-panel:fullscreen .ttt-status { font-size: 1.8rem; }
.tool-panel:fullscreen .wy-card h2 { font-size: clamp(2rem, 5vh, 3.6rem); }

@media (max-width: 640px) {
  .wy-cards { grid-template-columns: 1fr; }
  .qs-answers { grid-template-columns: 1fr; gap: 10px; }
  .tool-panel .qs-ans { min-height: 60px; padding: 12px; }
  .qs-shape { width: 40px; height: 40px; }
  .play-panel { min-height: 420px; }
  .play-keys { display: none; }
  .pk-choices { grid-template-columns: 1fr; }
  .pk-step-emoji { font-size: 2rem; } .pk-step.place-1 .pk-step-block { height: 100px; } .pk-step.place-2 .pk-step-block { height: 72px; } .pk-step-block { height: 50px; }
  .wy-recap li { grid-template-columns: 1fr; } .wy-recap em { display: none; } .wy-r.side-0, .wy-r.side-1 { text-align: center; }
  .pb-scene { flex-direction: column; } .pb-fuse { width: 80%; margin: 0 0 -10px; }
  .ttt-champ { font-size: 6rem; }
  .gw-row.by-team::before { left: -14px; width: 8px; height: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .play-panel *, .play-panel *::before, .play-panel *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
