/* Giggleland – game-screen styles from the gameplay overhaul (Nov 2026).
 * Loaded after platform.css. Sections: River Crossing screen · Kart driving pad · 3D pause/leave · Escape adventure · experiences. */

/* =====================================================================
 * River Crossing: the river at its own shape fills the screen, status + moves float on the sky,
 * a slim toolbar beside it (wide screens) or under it (tall screens), levels in a pop-up. Nothing to scroll.
 * ===================================================================== */
.screen .world-card.rv-card { display: block !important; padding: 6px !important; }
.world-card.rv-card > .world-head, .rv-card > .cat-panel > .flex:first-child, .rv-card > .flex:first-child { display: none !important; }
.rv-card > .cat-panel:not(.hidden) { display: block !important; }
.rv-game { --rv-tools: clamp(92px, 12vw, 150px); display: flex; gap: 8px; align-items: center; justify-content: center; width: 100%; }
.rv-board { position: relative; flex: 0 0 auto; aspect-ratio: 1200 / 620; border-radius: 18px; overflow: hidden;
  width: min(calc(100% - var(--rv-tools) - 8px), calc((var(--vh100, 100vh) - 28px) * 1.935)); }
.rv-board canvas { display: block; width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; border-radius: 0 !important; }
.rv-hud { position: absolute; inset: 0 0 auto 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; padding: 1.2% 1.4%; pointer-events: none; }
.rv-name { background: rgba(255, 255, 255, .85); border-radius: 999px; padding: 2px 10px; font: 800 clamp(12px, 1.5vw, 17px) var(--kid-font, sans-serif); color: #5f3dc4; white-space: nowrap; }
.rv-hud #pzStatus { flex: 0 1 62%; margin: 0 !important; text-align: center; background: rgba(255, 255, 255, .88) !important; color: #4c2a9e; border-radius: 14px; padding: 3px 10px !important;
  font-size: clamp(11.5px, 1.45vw, 17px) !important; line-height: 1.2; box-shadow: 0 3px 10px rgba(0, 0, 0, .12); }
.rv-chips { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.rv-chips .chip { min-height: 0 !important; padding: 1px 9px !important; font-size: clamp(11px, 1.3vw, 15px) !important; background: rgba(255, 255, 255, .85); }
.rv-tools { flex: 0 0 var(--rv-tools); width: var(--rv-tools); display: flex; flex-direction: column; gap: 6px; }
.rv-tools .btn-kid { width: 100%; min-height: 46px; padding: .25rem .4rem; font-size: clamp(13px, 1.4vw, 17px); margin: 0; justify-content: center; }
.rv-tools #pzCross { min-height: 64px; font-size: clamp(15px, 1.8vw, 21px); }
.rv-levels { display: flex !important; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }
/* screens that aren't wide enough for a toolbar beside the river (4:3, 16:10, upright): toolbar underneath, river full width */
@media (max-aspect-ratio: 19/10) {
  .rv-game { flex-direction: column; gap: 6px; }
  .rv-board { width: min(100%, calc((var(--vh100, 100vh) - 84px) * 1.935)); }
  .rv-tools { flex: none; width: min(100%, calc((var(--vh100, 100vh) - 84px) * 1.935)); flex-direction: row; flex-wrap: nowrap; }
  .rv-tools .btn-kid { flex: 1 1 0; width: auto; min-height: 50px; }
  .rv-tools #pzCross { flex: 1.7 1 0; min-height: 50px; }
}
@media (orientation: portrait) {
  .rv-tools { flex-wrap: wrap; }
  .rv-tools .btn-kid { flex: 1 1 30%; }
  .rv-tools #pzCross { flex-basis: 100%; }
}
/* the game sits in the middle of the screen, not at the top with a gap below */
.rv-card > .cat-panel:not(.hidden) { min-height: calc(var(--vh100, 100vh) - 24px); display: flex !important; align-items: center; justify-content: center; }
.screen .world-card.rv-card > .cat-panel > .rv-game { align-self: center !important; }
.rv-card .cat-panel > .justify-center:empty { display: none !important; }

/* =====================================================================
 * Giggle Kart driving pad (touch): steering wheel on the left thumb, gas / brake / drift on the right thumb.
 * ===================================================================== */
.gk-pad { position: absolute; inset: auto 0 0 0; height: 0; pointer-events: none; }
.gk-pad.hidden { display: none; }
.gl-hud.kart .gl-stick, .gl-hud.kart .gl-jump { display: none !important; }
.gk-wheel { pointer-events: auto; position: absolute; left: calc(14px + env(safe-area-inset-left)); bottom: calc(14px + env(safe-area-inset-bottom)); width: 200px; height: 150px;
  border-radius: 80px; background: rgba(20, 14, 60, .32); border: 3px solid rgba(255, 255, 255, .45); backdrop-filter: blur(4px); touch-action: none; display: grid; place-items: center; }
.gk-wheel-art { width: 112px; height: 112px; color: rgba(255, 255, 255, .92); filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .35)); transition: transform .05s linear; }
.gk-wheel-art svg { width: 100%; height: 100%; }
.gk-wheel > span { position: absolute; top: 50%; transform: translateY(-50%); font-size: 22px; color: rgba(255, 255, 255, .75); }
.gk-wheel .gk-l { left: 10px; } .gk-wheel .gk-r { right: 10px; }
.gk-wheel.left .gk-l, .gk-wheel.right .gk-r { color: #ffd60a; transform: translateY(-50%) scale(1.3); }
.gk-right { pointer-events: auto; position: absolute; right: calc(14px + env(safe-area-inset-right)); bottom: calc(14px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; gap: 10px; align-items: end; }
.gk-btn { touch-action: none; user-select: none; -webkit-user-select: none; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 0; border-radius: 50%; color: #fff; font-size: 30px; line-height: 1; cursor: pointer;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .28), 0 10px 22px rgba(0, 0, 0, .25); transition: transform .06s; }
.gk-btn small { font: 900 10px var(--tp-font); letter-spacing: .5px; margin-top: 2px; opacity: .9; }
.gk-btn.on { transform: translateY(4px) scale(.96); box-shadow: 0 2px 0 rgba(0, 0, 0, .28); filter: brightness(1.15); }
.gk-gas { grid-column: 2; grid-row: 1 / span 2; width: 104px; height: 104px; background: radial-gradient(circle at 35% 30%, #69f0ae, #12b886); }
.gk-brake { grid-column: 1; grid-row: 2; width: 78px; height: 78px; background: radial-gradient(circle at 35% 30%, #ff8787, #e03131); }
.gk-drift { grid-column: 1; grid-row: 1; width: 66px; height: 66px; background: radial-gradient(circle at 35% 30%, #b197fc, #7048e8); justify-self: center; }
/* the item button sits above the gas pedal on touch screens */
@media (pointer: coarse) {
  .gl-hud.kart .gl-item { display: block !important; position: absolute; top: auto; right: calc(26px + env(safe-area-inset-right)); bottom: calc(136px + env(safe-area-inset-bottom)); width: 74px; height: 74px; font-size: 36px; }
}
.gl-speed { display: inline-flex; align-items: baseline; gap: 3px; color: #fff; }
.gl-speed b { font: 800 24px/1 var(--tp-display); color: #fff !important; text-shadow: none !important; min-width: 40px !important; text-align: right; }
.gl-speed small { font-size: 11px; opacity: .8; }
.gl-speed.fast b { color: #ffd60a !important; }
.gl-fade.flash { opacity: .55; transition: opacity .15s; }
/* sideways phones: a bit smaller so the track stays visible between the thumbs */
@media (orientation: landscape) and (max-height: 520px) {
  .gk-wheel { width: 168px; height: 124px; } .gk-wheel-art { width: 92px; height: 92px; }
  .gk-gas { width: 88px; height: 88px; } .gk-brake { width: 66px; height: 66px; } .gk-drift { width: 56px; height: 56px; font-size: 24px; }
  .gl-hud.kart .gl-item { width: 62px !important; height: 62px !important; bottom: calc(112px + env(safe-area-inset-bottom)) !important; font-size: 30px !important; }
  .gl-kartbar { gap: 8px; padding: 4px 6px 4px 10px; } .gl-kartbar b { font-size: 24px; } .gl-speed b { font-size: 20px; }
  .gl-hud.kart .gl-map { bottom: auto; top: 60px; width: 92px; height: 92px; }
}
/* extra contextual buttons (experiences) beside the jump button */
.gx-actions { position: absolute; right: calc(128px + env(safe-area-inset-right)); bottom: calc(26px + env(safe-area-inset-bottom)); display: flex; gap: 10px; align-items: flex-end; }
.gx-actions.hidden { display: none; }
.gx-act { touch-action: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 70px; height: 70px; border-radius: 50%; border: 0; color: #fff; font-size: 30px;
  background: radial-gradient(circle at 35% 30%, #74c0fc, #1c7ed6); box-shadow: 0 5px 0 rgba(0, 0, 0, .25), 0 8px 18px rgba(0, 0, 0, .2); }
.gx-act small { font: 900 10px var(--tp-font); margin-top: 1px; }
.gx-act.on { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.gx-act.hidden { display: none; }
@media (pointer: fine) { .gx-actions { display: none; } }

/* Inside a 3D game (kart, obby, party, experiences) the Plaza menus step aside: only the game's own bar + controls */
body.gl-gamemode .gl-hud .gl-btns, body.gl-gamemode .gl-hud .gl-chips { display: none !important; }
body.gl-gamemode .gl-hud .gl-me { display: none !important; }
@media (orientation: landscape) and (max-height: 520px) {
  body.tp-on.gl-gamemode { --tp-sw-cur: 0px; }
  body.gl-gamemode .tp-side { display: none !important; }
  body.tp-on.gl-gamemode #app { padding-left: env(safe-area-inset-left) !important; }
}

/* =====================================================================
 * Escape Adventures HUD: room + goal pill and Hint / Pause on top, bag at the bottom middle, big action button by the thumb.
 * ===================================================================== */
.gl-hud.exp .gl-place, .gl-hud.exp .gl-obbybar { display: none !important; }
.gx-esc { position: absolute; inset: 0; pointer-events: none; font-family: var(--tp-font); }
.gx-esc > * { pointer-events: auto; }
.gx-esc-top { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; max-width: calc(100% - 24px);
  padding: 5px 6px 5px 14px; border-radius: 999px; background: rgba(20, 14, 60, .72); backdrop-filter: blur(8px); color: #fff; white-space: nowrap; }
.gx-room { font-size: 13px; opacity: .85; }
.gx-goal { font-weight: 900; font-size: 15px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.gx-bag { position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 22px;
  background: rgba(20, 14, 60, .72); backdrop-filter: blur(8px); max-width: calc(100% - 360px); overflow-x: auto; scrollbar-width: none; }
.gx-bag-l { font-size: 24px; } .gx-bag-empty { color: rgba(255, 255, 255, .6); font-size: 13px; font-weight: 800; padding-right: 6px; }
.gx-slot { width: 50px; height: 50px; flex: none; border-radius: 14px; border: 3px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .14); font-size: 28px; cursor: pointer; }
.gx-slot.sel { border-color: #ffd60a; background: rgba(255, 214, 10, .3); transform: translateY(-4px); box-shadow: 0 0 16px rgba(255, 214, 10, .6); }
.gx-use { position: absolute; right: calc(132px + env(safe-area-inset-right)); bottom: calc(24px + env(safe-area-inset-bottom)); width: 96px; height: 96px; border-radius: 50%; border: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-size: 38px; line-height: 1; color: #fff; background: radial-gradient(circle at 35% 30%, #69f0ae, #12b886); box-shadow: 0 6px 0 #0c8a63, 0 10px 24px rgba(0, 0, 0, .3);
  animation: gxPulse 1.4s ease-in-out infinite; touch-action: none; }
.gx-use small { font: 900 11px var(--tp-font); margin-top: 3px; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-use.on { transform: translateY(4px) scale(.96); box-shadow: 0 2px 0 #0c8a63; }
.gx-use.hidden, .gx-keyhint.hidden { display: none; }
@keyframes gxPulse { 50% { box-shadow: 0 6px 0 #0c8a63, 0 0 0 10px rgba(105, 240, 174, .25); } }
.gx-keyhint { position: absolute; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: #2b1d40; font-weight: 900; font-size: 15px; }
@media (pointer: coarse) { .gx-keyhint { display: none; } }
@media (pointer: fine) { .gx-use { right: 24px; } .gx-bag { max-width: calc(100% - 200px); } }
.gx-pop { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-size: 80px; animation: gxPop .9s ease-out forwards; pointer-events: none; }
@keyframes gxPop { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; } 30% { transform: translate(-50%, -60%) scale(1.25); opacity: 1; } 100% { transform: translate(-50%, 120%) scale(.5); opacity: 0; } }
.gx-clue { font-size: 22px; font-weight: 900; line-height: 1.4; }
.gx-keypad { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(300px, 86vw); padding: 14px; border-radius: 22px; background: #263238; color: #fff; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.gx-kdisp { margin: 8px 0 10px; padding: 8px; border-radius: 12px; background: #0b1030; color: #7cff6b; font: 900 30px/1 monospace; letter-spacing: 4px; }
.gx-kdisp.bad { color: #ff6b6b; animation: shake .35s; }
.gx-kgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gx-key { height: 50px; border-radius: 14px; border: 0; background: #455a64; color: #fff; font: 900 22px var(--tp-font); box-shadow: 0 4px 0 #1c262b; }
.gx-key:active { transform: translateY(3px); box-shadow: 0 1px 0 #1c262b; }
.gx-key.ok { background: #12b886; box-shadow: 0 4px 0 #0c8a63; }
.gx-kclose { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .15); color: #fff; font-size: 16px; }
@media (orientation: landscape) and (max-height: 520px) {
  .gx-esc-top { top: 6px; padding: 3px 4px 3px 10px; } .gx-room { display: none; } .gx-goal { font-size: 13px; }
  .gx-slot { width: 42px; height: 42px; font-size: 24px; } .gx-bag { bottom: 8px; padding: 4px 8px; max-width: calc(100% - 330px); }
  .gx-use { width: 80px; height: 80px; font-size: 32px; right: calc(112px + env(safe-area-inset-right)); bottom: 16px; }
  .gx-kgrid { gap: 5px; } .gx-key { height: 40px; } .gx-kdisp { font-size: 24px; margin: 4px 0 6px; }
}
@media (orientation: portrait) and (max-width: 820px) {
  .gx-esc-top { top: 112px; } .gx-bag { top: 160px; bottom: auto; max-width: calc(100% - 24px); } .gx-use { right: 24px; bottom: 140px; }
}

/* =====================================================================
 * 🚪 Leave is always in the same place in every 2D game: the top of the side column (sideways screens) or the top
 * right (upright screens) – never below the fold.
 * ===================================================================== */
@media (orientation: landscape) and (max-height: 720px) {
  body.tp-ingame .screen .world-card > .world-head { order: -1 !important; margin: 0 0 6px !important; justify-content: flex-end; }
  body.tp-ingame .screen .world-card.wide > .world-head { order: -1 !important; }
  body.tp-ingame .world-card > .world-head .world-exit { min-height: 40px; padding: .15rem .7rem; font-size: .95rem; }
}
body.tp-ingame .world-card > .world-head .world-exit { margin-left: auto; }

/* =====================================================================
 * Flood Escape HUD: goal + stars + ⏸ on top, a water gauge on the left edge (water vs you), an air bar when you swim.
 * ===================================================================== */
.gx-flood { position: absolute; inset: 0; pointer-events: none; font-family: var(--tp-font); }
.gx-flood > * { pointer-events: auto; }
.gx-fstars { font-size: 15px; color: #ffd60a; }
.gx-water { --h: 0%; --me: 0%; position: absolute; left: calc(14px + env(safe-area-inset-left)); top: 70px; bottom: 170px; width: 18px; border-radius: 10px; background: rgba(20, 14, 60, .45); overflow: visible; pointer-events: none; }
.gx-water > i { position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); border-radius: 10px; background: linear-gradient(#74c0fc, #1c7ed6); transition: height .2s; }
.gx-water::after { content: '🧒'; position: absolute; left: 50%; bottom: var(--me); transform: translate(-50%, 50%); font-size: 20px; transition: bottom .2s; }
.gx-water > span { position: absolute; left: 26px; top: 0; white-space: nowrap; padding: 3px 10px; border-radius: 999px; background: rgba(20, 14, 60, .72); color: #fff; font-weight: 900; font-size: 13px; }
.gx-water.danger > span { background: #e03131; animation: gxBlink .6s ease-in-out infinite alternate; }
@keyframes gxBlink { to { transform: scale(1.06); } }
.gx-air { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: rgba(20, 14, 60, .78); color: #fff; font-weight: 900; }
.gx-air.hidden { display: none; }
.gx-air b { position: relative; width: 140px; height: 12px; border-radius: 6px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.gx-air b i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ff6b6b, #74c0fc); border-radius: 6px; transition: width .15s; }
@media (orientation: landscape) and (max-height: 520px) { .gx-water { top: 48px; bottom: 150px; } .gx-air { top: 44px; } }
@media (orientation: portrait) and (max-width: 820px) { .gx-water { top: 160px; bottom: 200px; } .gx-air { top: 160px; } }

/* =====================================================================
 * New Strategy boards: Checkers, Mancala, Colour Flip
 * ===================================================================== */
.sk2-board { margin: 0 auto; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.sk2-checkers, .sk2-flip { display: grid; aspect-ratio: 1; width: min(100%, 520px, calc(var(--vh100, 100vh) - 190px)); min-width: 260px; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 0 rgba(0, 0, 0, .15); }
.sk2-checkers { grid-template-columns: repeat(8, 1fr); border: 6px solid #6d4c41; }
.ck-cell { border: 0; padding: 0; background: #f8e7c9; display: grid; place-items: center; position: relative; cursor: pointer; }
.ck-cell.dark { background: #a1662f; }
.ck-piece { width: 78%; height: 78%; border-radius: 50%; display: grid; place-items: center; font-size: clamp(12px, 2.4vw, 22px); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25), 0 3px 4px rgba(0, 0, 0, .3); transition: transform .15s; }
.ck-piece.p0 { background: radial-gradient(circle at 35% 30%, #ff8787, #e03131); }
.ck-piece.p1 { background: radial-gradient(circle at 35% 30%, #ffffff, #ced4da); }
.ck-cell.can .ck-piece { animation: ckBob 1.2s ease-in-out infinite; }
.ck-cell.sel .ck-piece { transform: scale(1.12); box-shadow: 0 0 0 4px #ffd43b, 0 6px 10px rgba(0, 0, 0, .35); }
.ck-cell.target::after { content: ''; width: 38%; height: 38%; border-radius: 50%; background: rgba(255, 212, 59, .85); box-shadow: 0 0 12px #ffd43b; animation: ckPulse .9s ease-in-out infinite alternate; }
@keyframes ckBob { 50% { transform: translateY(-3px); } }
@keyframes ckPulse { to { transform: scale(1.25); } }
.sk2-flip { grid-template-columns: repeat(6, 1fr); gap: 3px; background: #1b5e20; padding: 6px; border: 6px solid #0b3d12; }
.rv-cell { border: 0; border-radius: 8px; background: #2e7d32; display: grid; place-items: center; cursor: pointer; padding: 0; }
.rv-cell.last { box-shadow: inset 0 0 0 3px #ffd43b; }
.rv-disc { width: 80%; height: 80%; border-radius: 50%; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25), 0 3px 4px rgba(0, 0, 0, .3); }
.rv-disc.p0 { background: radial-gradient(circle at 35% 30%, #ff8787, #e03131); }
.rv-disc.p1 { background: radial-gradient(circle at 35% 30%, #fff3bf, #fab005); }
.rv-disc.flip { animation: rvFlip .45s ease-out; }
@keyframes rvFlip { 0% { transform: rotateY(90deg) scale(.8); } 100% { transform: rotateY(0) scale(1); } }
.rv-dot { width: 24%; height: 24%; border-radius: 50%; background: rgba(255, 255, 255, .55); animation: ckPulse .9s ease-in-out infinite alternate; }
.sk2-mancala { display: grid; grid-template-columns: 1fr 6fr 1fr; gap: 8px; align-items: stretch; width: min(100%, 720px); padding: 12px; border-radius: 40px; background: linear-gradient(#a0522d, #8b4513); box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .25), 0 8px 0 rgba(0, 0, 0, .15); }
.mc-mid { display: grid; gap: 10px; }
.mc-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.mc-pit, .mc-store { position: relative; border: 0; border-radius: 50%; aspect-ratio: 1; background: radial-gradient(circle at 50% 40%, #5d2e0f, #3e1f0a); color: #fff; display: grid; place-items: center; padding: 0; cursor: pointer; box-shadow: inset 0 6px 10px rgba(0, 0, 0, .5); }
.mc-store { border-radius: 40px; aspect-ratio: auto; min-height: 100%; cursor: default; }
.mc-pit b, .mc-store b { position: absolute; bottom: 4%; font: 900 clamp(12px, 2vw, 18px) var(--kid-font, sans-serif); text-shadow: 0 2px 2px #000; }
.mc-store b { font-size: clamp(16px, 3vw, 28px); bottom: 8%; }
.mc-seeds { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; width: 70%; }
.mc-seeds i { width: clamp(5px, 1vw, 9px); height: clamp(5px, 1vw, 9px); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #c3fae8, #20c997); }
.mc-store.s1 .mc-seeds i, .mc-row:first-child .mc-seeds i { background: radial-gradient(circle at 35% 30%, #e5dbff, #845ef7); }
.mc-pit.can { box-shadow: inset 0 6px 10px rgba(0, 0, 0, .5), 0 0 0 4px #ffd43b; animation: ckBob 1.2s ease-in-out infinite; }
.mc-pit.last, .mc-store.last { box-shadow: inset 0 6px 10px rgba(0, 0, 0, .5), 0 0 0 4px #74c0fc; }
/* the boards go in the big left column of the game screen (like the other board games) */
@media (orientation: landscape) and (max-height: 720px) {
  .card > .cat-panel > .sk2-board { grid-column: 1; grid-row: 1 / span 30; position: sticky; top: 4px; margin-inline: auto; }
  .card > .cat-panel > .sk2-checkers, .card > .cat-panel > .sk2-flip { width: min(100%, calc(var(--vh100, 100vh) - 16px)); }
}
@media (orientation: portrait) and (max-width: 640px) {
  .sk2-mancala { grid-template-columns: .62fr 6fr .62fr; gap: 5px; padding: 8px; border-radius: 28px; }
  .mc-row { gap: 4px; } .mc-mid { gap: 6px; }
  .sk2-board { margin-top: 6px; }
}

/* Tower Defense build / upgrade menu – pops up next to the pad you tapped */
.td-wrap { position: relative; }
.td-menu { position: absolute; transform: translate(-50%, calc(-100% - 34px)); display: flex; gap: 6px; padding: 6px; border-radius: 18px; background: rgba(20, 14, 60, .88); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); z-index: 3; }
.td-menu.below { transform: translate(-50%, 34px); }
.td-menu.hidden { display: none; }
.td-opt { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 6px 8px; border: 0; border-radius: 14px; background: #fff; font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 3px 0 #ced4da; }
.td-opt small { font: 900 12px var(--kid-font, sans-serif); color: #5f3dc4; margin-top: 3px; }
.td-opt.off { opacity: .45; }
.td-opt:active { transform: translateY(2px); box-shadow: none; }
.td-x { border: 0; background: transparent; color: #fff; font-size: 16px; padding: 0 4px; cursor: pointer; }

/* Slide Puzzle + Pipe Flow boards */
.sl-box { position: relative; margin: 0 auto; width: min(100%, 460px, calc(var(--vh100, 100vh) - 190px)); min-width: 250px; aspect-ratio: 1; }
.sl-board { position: absolute; inset: 0; border-radius: 16px; background: #343a40; box-shadow: 0 8px 0 rgba(0, 0, 0, .15); overflow: hidden; }
.sl-tile { position: absolute; width: calc(100% / var(--n)); height: calc(100% / var(--n)); border: 2px solid rgba(255, 255, 255, .8); border-radius: 10px; padding: 0; cursor: pointer; transition: left .14s ease-out, top .14s ease-out; touch-action: manipulation; }
.sl-tile small { position: absolute; left: 4px; top: 2px; font: 900 12px var(--kid-font, sans-serif); color: #fff; text-shadow: 0 1px 2px #000; }
.sl-tile.home { border-color: #ffe066; }
.sl-tile.shake { animation: shake .3s; }
.sl-board.won .sl-tile { border-color: transparent; border-radius: 0; }
.sl-peek { position: absolute; inset: 0; border-radius: 16px; background-size: cover; z-index: 2; box-shadow: 0 0 0 4px #ffd43b; }
.sl-peek.hidden { display: none; }
.pf-box { position: relative; margin: 0 auto; width: min(100%, 470px, calc(var(--vh100, 100vh) - 190px)); min-width: 250px; aspect-ratio: 1; padding: 0 30px; box-sizing: content-box; max-width: calc(100% - 60px); }
.pf-board { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; width: 100%; height: 100%; padding: 6px; border-radius: 16px; background: #8d6e63; box-shadow: 0 8px 0 rgba(0, 0, 0, .15); box-sizing: border-box; }
.pf-cell { border: 0; border-radius: 8px; background: #d7ccc8; padding: 6%; cursor: pointer; touch-action: manipulation; }
.pf-cell svg { width: 100%; height: 100%; display: block; }
.pf-cell.wet { background: #e7f5ff; }
.pf-cell.spin svg { animation: pfSpin .18s ease-out; }
@keyframes pfSpin { from { transform: rotate(-90deg); } to { transform: rotate(0); } }
.pf-end { position: absolute; transform: translateY(-50%); font-size: clamp(22px, 4vw, 34px); }
.pf-src { left: 0; } .pf-dst { right: 0; }
.pf-dst.bloom { animation: pfBloom .8s ease-out 2; }
@keyframes pfBloom { 50% { transform: translateY(-50%) scale(1.6); } }
@media (orientation: landscape) and (max-height: 720px) {
  .card > .cat-panel > .sl-box, .card > .cat-panel > .pf-box { grid-column: 1; grid-row: 1 / span 30; position: sticky; top: 4px; margin-inline: auto; width: min(100%, calc(var(--vh100, 100vh) - 16px)); }
  .card > .cat-panel > .pf-box { width: min(calc(100% - 60px), calc(var(--vh100, 100vh) - 16px)); }
}

/* Word Hunt */
.wh-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; margin: 0 auto; width: min(100%, 470px, calc(var(--vh100, 100vh) - 210px)); min-width: 250px; aspect-ratio: 1; padding: 6px; border-radius: 16px; background: #e6fcf5; box-shadow: 0 6px 0 #96f2d7; touch-action: none; user-select: none; -webkit-user-select: none; }
.wh-cell { display: grid; place-items: center; border-radius: 8px; background: #fff; font: 900 clamp(14px, 3.2vw, 24px) var(--kid-font, sans-serif); color: #343a40; cursor: pointer; }
.wh-cell.got { background: hsl(var(--h, 160), 80%, 78%); color: #1b1b2f; }
.wh-cell.sel { background: #ffd43b !important; transform: scale(1.08); }
.wh-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.wh-word { padding: 4px 10px; border-radius: 999px; background: #fff; border: 2px solid #c3fae8; font: 900 15px var(--kid-font, sans-serif); letter-spacing: 1px; color: #0b7285; }
.wh-word.found { background: #b2f2bb; border-color: #69db7c; text-decoration: line-through; color: #2b8a3e; }
/* Times-Table Tower */
.tt-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; align-items: stretch; width: min(100%, 680px); margin: 0 auto; }
.tt-stage { position: relative; min-height: min(360px, calc(var(--vh100, 100vh) - 200px)); border-radius: 20px; background: linear-gradient(#a5d8ff, #e7f5ff 70%, #b2f2bb 70%); overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 8%; }
.tt-cloud { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); font-size: 48px; }
.tt-cloud.reached { animation: pfBloom .7s ease-out 2; }
.tt-goal { position: absolute; top: 8px; right: 8px; font: 900 13px var(--kid-font, sans-serif); background: rgba(255, 255, 255, .85); padding: 2px 8px; border-radius: 999px; }
.tt-tower { display: flex; flex-direction: column-reverse; align-items: center; gap: 2px; width: 70%; }
.tt-tower.wobble { animation: shake .5s; }
.tt-block { width: 100%; height: calc(min(300px, calc(var(--vh100, 100vh) - 260px)) / var(--goal)); min-height: 14px; border-radius: 6px; background: hsl(var(--h), 75%, 62%); color: #fff; font: 900 clamp(9px, 1.6vw, 13px) var(--kid-font, sans-serif); display: grid; place-items: center; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2); animation: popIn .25s ease-out; overflow: hidden; }
.tt-block.fall { animation: ttFall .4s ease-in forwards; }
@keyframes ttFall { to { transform: translate(60px, 120px) rotate(40deg); opacity: 0; } }
.tt-q { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.tt-sum { text-align: center; font: 900 clamp(32px, 7vw, 54px) var(--kid-font, sans-serif); color: #e8590c; }
.tt-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tt-opt { min-height: 70px; border: 0; border-radius: 20px; background: linear-gradient(#ffd43b, #fab005); color: #5c3c00; font: 900 clamp(24px, 5vw, 38px) var(--kid-font, sans-serif); box-shadow: 0 6px 0 #e67700; cursor: pointer; }
.tt-opt:active { transform: translateY(4px); box-shadow: 0 2px 0 #e67700; }
.tt-opt.wrong { background: #ffa8a8; box-shadow: 0 6px 0 #e03131; }
@media (orientation: portrait) and (max-width: 640px) { .tt-wrap { grid-template-columns: 1fr; } .tt-stage { min-height: 300px; } }
@media (orientation: landscape) and (max-height: 720px) {
  .card > .cat-panel > .wh-grid, .card > .cat-panel > .tt-wrap { grid-column: 1; grid-row: 1 / span 30; position: sticky; top: 4px; margin-inline: auto; }
  .card > .cat-panel > .wh-grid { width: min(100%, calc(var(--vh100, 100vh) - 16px)); }
  .card > .cat-panel > .tt-wrap .tt-stage { min-height: calc(var(--vh100, 100vh) - 30px); }
}

/* Sticker World tray + tools */
.st-tools { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.st-tool { width: 50px; height: 50px; border-radius: 14px; border: 3px solid #ffdeeb; background: #fff; font-size: 24px; cursor: pointer; }
.st-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; justify-content: center; }
.st-tab { padding: 6px 12px; border-radius: 999px; border: 2px solid #ffdeeb; background: #fff; font: 800 14px var(--kid-font, sans-serif); color: #c2255c; cursor: pointer; }
.st-tab.on { background: #ff4f8b; color: #fff; border-color: #ff4f8b; }
.st-tray { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; max-height: 128px; overflow-y: auto; }
.st-sticker { width: 54px; height: 54px; border-radius: 14px; border: 0; background: #fff0f6; font-size: 32px; cursor: pointer; box-shadow: 0 3px 0 #fcc2d7; }
.st-sticker:active { transform: scale(.9); }

/* Tag Arena HUD */
.gx-tag { position: absolute; inset: 0; pointer-events: none; font-family: var(--tp-font); }
.gx-tag > * { pointer-events: auto; }
.gx-itbanner { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); padding: 6px 16px; border-radius: 999px; background: #ff4d6d; color: #fff; font-weight: 900; font-size: 18px; animation: gxBlink .5s ease-in-out infinite alternate; pointer-events: none; }
.gx-itbanner.hidden { display: none; }
.gx-stamina { position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(20, 14, 60, .7); pointer-events: none; }
.gx-stamina i { display: block; width: 120px; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #ffd43b, #69db7c); }
@media (orientation: landscape) and (max-height: 520px) { .gx-itbanner { top: 44px; font-size: 15px; } }
