/* Case the Wolf game shell: one bright look for every game in /games/.
   Each game sets <html data-world="..."> to pick its colours and scenery. */
@font-face { font-family: "Lilita One"; src: url("/assets/fonts/lilita-one-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* The games ask for Fredoka One and Nunito from Google; serve our own fonts under those names instead. */
@font-face { font-family: "Fredoka One"; src: url("/assets/fonts/lilita-one-latin-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }

:root {
  --ink: #182158;
  --gs-display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --gs-body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --w: #1585ee; --w-dark: #0b5fb0; --w-soft: #e3f1ff; --w-accent: #ffc928;
  --good: #2dbe6c; --good-soft: #dcf9e8; --bad: #ff5a5f; --bad-soft: #ffe3e4;
  --pop: cubic-bezier(.34, 1.56, .64, 1);
}
[data-world="charter"]    { --w: #e53935; --w-dark: #a3151b; --w-soft: #ffe8e6; --w-accent: #ffc928; }
[data-world="mountain"]   { --w: #7e57c2; --w-dark: #4527a0; --w-soft: #efe7ff; --w-accent: #ffd54f; }
[data-world="forest"]     { --w: #2dbe6c; --w-dark: #187a42; --w-soft: #e1f8e9; --w-accent: #ffc928; }
[data-world="puzzle"]     { --w: #a24bf0; --w-dark: #6a1fb0; --w-soft: #f4e8ff; --w-accent: #ff6fb5; }
[data-world="court"]      { --w: #3949ab; --w-dark: #1a237e; --w-soft: #e8eaff; --w-accent: #ffc928; }
[data-world="lake"]       { --w: #1585ee; --w-dark: #0b5fb0; --w-soft: #e1f2ff; --w-accent: #ffc928; }
[data-world="town"]       { --w: #ff7a1a; --w-dark: #c4520a; --w-soft: #fff0e3; --w-accent: #ff5fa2; }
[data-world="parliament"] { --w: #d7263d; --w-dark: #8f1424; --w-soft: #ffe9ec; --w-accent: #ffc928; }

/* ---------- World scenery ---------- */
html body.gs-ready { background: var(--w-soft) !important; font-family: var(--gs-body) !important; color: var(--ink); padding-bottom: 150px !important; }
.gs-scene { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.gs-scene svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.gs-clouds { animation: gsDrift 60s linear infinite alternate; }
.gs-sun { transform-origin: 1320px 150px; animation: gsPulse 4s ease-in-out infinite; }
.gs-wave { animation: gsWave 7s ease-in-out infinite alternate; }
.gs-wave--slow { animation-duration: 11s; }
.gs-flag { animation: gsFlag 2.4s ease-in-out infinite; }
.gs-float { position: absolute; top: -40px; animation: gsFall linear infinite; opacity: .85; filter: drop-shadow(0 2px 2px rgba(0,0,0,.15)); }
[data-world="lake"] .gs-float, [data-world="puzzle"] .gs-float { top: auto; bottom: -40px; animation-name: gsRise; }
@keyframes gsDrift { to { transform: translateX(140px); } }
@keyframes gsPulse { 50% { transform: scale(1.06); } }
@keyframes gsWave { to { transform: translateX(-200px); } }
@keyframes gsFlag { 50% { transform: skewY(-6deg) scaleX(.94); } }
@keyframes gsFall { 0% { transform: translateY(0) rotate(0); } 100% { transform: translateY(110vh) translateX(40px) rotate(320deg); } }
@keyframes gsRise { 0% { transform: translateY(0) scale(.8); } 100% { transform: translateY(-110vh) translateX(-30px) scale(1.1); } }

/* Old decorations the games drew themselves are replaced by the scenery. */
body.gs-ready > .snow, body.gs-ready > .leaf, body.gs-ready > .maple, body.gs-ready > .bubble, body.gs-ready > .star { display: none !important; }
body.gs-ready::before { content: none !important; }

/* ---------- Type ---------- */
.gs-ready h1, .gs-ready h2, .gs-ready h3, .gs-ready .start-title, .gs-ready .results-title, .gs-ready .rtitle, .gs-ready .topbar-title,
.gs-ready .q-text, .gs-ready .qtext, .gs-ready .climb-q, .gs-ready .stage-title, .gs-ready .stage-title-text, .gs-ready .mt {
  font-family: var(--gs-display) !important; font-weight: 400 !important; letter-spacing: .01em;
}
.gs-ready button, .gs-ready input, .gs-ready a { font-family: inherit; }
.gs-ready .hdr h1, .gs-ready .start-title { font-size: clamp(2rem, 6vw, 2.9rem) !important; color: var(--w-dark) !important; text-shadow: 0 3px 0 rgba(255,255,255,.9); line-height: 1.05; }
.gs-ready .start-title .red, .gs-ready .start-title .blue, .gs-ready .start-title .purple, .gs-ready .results-title .red, .gs-ready .results-title .blue, .gs-ready .results-title .purple { color: var(--w) !important; }
.gs-ready .q-text, .gs-ready .qtext, .gs-ready .climb-q { color: var(--ink) !important; font-size: clamp(1.25rem, 3.6vw, 1.6rem) !important; line-height: 1.3 !important; }

/* ---------- Top bar (games with a bar across the top) ---------- */
.gs-ready .topbar { background: var(--w) !important; border-bottom: 4px solid var(--ink) !important; box-shadow: 0 4px 0 rgba(24,33,88,.25); }
.gs-ready .box .topbar, .gs-ready .screen .topbar { background: transparent !important; border: 0 !important; box-shadow: none; }
.gs-ready .topbar-title { color: #fff !important; font-size: 1.5rem !important; text-shadow: 0 2px 0 var(--ink); }
.gs-ready .topbar-back { background: #fff !important; color: var(--ink) !important; border: 3px solid var(--ink) !important; box-shadow: 0 3px 0 var(--ink); font-weight: 700; }
.gs-ready .coins-pill, .gs-ready .coins-badge { background: var(--w-accent) !important; color: var(--ink) !important; border: 3px solid var(--ink); font-weight: 700; }

/* ---------- Cards ---------- */
.gs-ready .box, .gs-ready .start-card, .gs-ready .q-card, .gs-ready .results-card, .gs-ready .stage-hd, .gs-ready .stage-header {
  background: #fff !important; border: 4px solid var(--ink) !important; border-radius: 30px !important;
  box-shadow: 0 10px 0 var(--ink), 0 24px 50px rgba(24,33,88,.25) !important;
}
.gs-ready .box { max-width: 720px !important; padding: 26px 22px 30px !important; margin-top: 8px; }
.gs-ready .game-wrap { padding-top: 24px !important; }
.gs-ready .hdr-icon, .gs-ready .scroll-icon, .gs-ready .results-icon, .gs-ready .remoji { filter: drop-shadow(0 6px 0 rgba(24,33,88,.15)); }
.gs-ready .qbox, .gs-ready .mountain, .gs-ready .sort-scene, .gs-ready .comp-scene, .gs-ready .vote-scene, .gs-ready .rule-story, .gs-ready .match-area {
  background: var(--w-soft) !important; border: 3px solid var(--ink) !important; border-radius: 24px !important;
}
.gs-ready .qimg-slot, .gs-ready .q-char, .gs-ready .mascot-img { background: #fff !important; border: 3px solid var(--ink) !important; box-shadow: 0 4px 0 var(--w); }
.gs-ready .qimg-slot { width: 130px !important; height: 130px !important; border-radius: 50% !important; animation: gsBob 3s ease-in-out infinite; }
.gs-ready .qimg-emoji { font-size: 4.6rem !important; }

/* ---------- Big chunky buttons ---------- */
.gs-ready .mbtn, .gs-ready .big-btn, .gs-ready .action-btn, .gs-ready .nxtbtn, .gs-ready .playbtn, .gs-ready .fn-next, .gs-ready .fb-next,
.gs-ready .check-btn, .gs-ready .chkbtn, .gs-ready .check-sort-btn, .gs-ready .send-btn, .gs-ready .ctrl-btn, .gs-ready .back {
  font-family: var(--gs-display) !important; font-weight: 400 !important; letter-spacing: .02em;
  border: 3px solid var(--ink) !important; border-radius: 22px !important;
  box-shadow: 0 6px 0 var(--ink) !important; transition: transform .12s var(--pop), box-shadow .12s, filter .2s !important;
}
.gs-ready .mbtn:hover, .gs-ready .big-btn:hover, .gs-ready .action-btn:hover, .gs-ready .nxtbtn:hover, .gs-ready .playbtn:hover, .gs-ready .back:hover { transform: translateY(-3px) !important; filter: brightness(1.06); }
.gs-ready .mbtn:active, .gs-ready .big-btn:active, .gs-ready .action-btn:active, .gs-ready .nxtbtn:active, .gs-ready .playbtn:active, .gs-ready .back:active,
.gs-ready .check-btn:active, .gs-ready .chkbtn:active, .gs-ready .send-btn:active { transform: translateY(5px) !important; box-shadow: 0 1px 0 var(--ink) !important; }
.gs-ready .big-btn, .gs-ready .nxtbtn, .gs-ready .playbtn, .gs-ready .fn-next, .gs-ready .fb-next, .gs-ready .check-btn, .gs-ready .chkbtn, .gs-ready .check-sort-btn, .gs-ready .send-btn {
  background: var(--w-accent) !important; color: var(--ink) !important; font-size: 1.3rem !important; padding: 14px 34px !important;
}
.gs-ready .big-btn { font-size: 1.6rem !important; padding: 16px 44px !important; animation: gsBreathe 2.2s ease-in-out infinite; }
.gs-ready .back { background: #fff !important; color: var(--ink) !important; box-shadow: 0 4px 0 var(--ink) !important; }

/* Game mode menu: each mode its own colour */
.gs-ready .menu { gap: 16px !important; }
.gs-ready .mbtn { color: #fff !important; padding: 18px 20px !important; min-height: 84px; text-shadow: 0 2px 0 rgba(24,33,88,.35); }
.gs-ready .mbtn:nth-child(3n+1) { background: linear-gradient(135deg, var(--w), var(--w-dark)) !important; }
.gs-ready .mbtn:nth-child(3n+2) { background: linear-gradient(135deg, #1fb8ff, #1585ee) !important; }
.gs-ready .mbtn:nth-child(3n+3) { background: linear-gradient(135deg, #ff9b3d, #ff6a3d) !important; }
.gs-ready .mbtn .mi { font-size: 2.4rem !important; width: 62px; height: 62px; flex: none; display: grid; place-items: center; background: rgba(255,255,255,.95); border: 3px solid var(--ink); border-radius: 50%; text-shadow: none; }
.gs-ready .mbtn .mt { font-size: 1.35rem !important; }
.gs-ready .mbtn .md { font-family: var(--gs-body); font-size: .95rem !important; opacity: 1 !important; }
.gs-ready .mbtn::after { content: "▶"; margin-left: auto; width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--w-accent); color: var(--ink); border: 3px solid var(--ink); font-size: .95rem; text-shadow: none; }

/* ---------- Answer tiles ---------- */
.gs-ready .abtn, .gs-ready .option-btn, .gs-ready .climb-btn, .gs-ready .rule-btn, .gs-ready .vote-btn, .gs-ready .sort-choice, .gs-ready .item-choice,
.gs-ready .pat-choice, .gs-ready .slice-opt, .gs-ready .j-btn, .gs-ready .match-item, .gs-ready .comp-chip, .gs-ready .right-card, .gs-ready .fact-card, .gs-ready .sort-card {
  background: #fff !important; color: var(--ink) !important; font-weight: 700 !important;
  border: 3px solid var(--ink) !important; border-radius: 20px !important;
  box-shadow: 0 5px 0 var(--ink) !important; transition: transform .12s var(--pop), box-shadow .12s, background .2s !important;
}
.gs-ready .abtn, .gs-ready .option-btn, .gs-ready .climb-btn, .gs-ready .rule-btn, .gs-ready .vote-btn { font-size: 1.1rem !important; min-height: 64px; padding: 14px !important; }
.gs-ready .abtn:hover, .gs-ready .option-btn:hover:not(:disabled), .gs-ready .climb-btn:hover, .gs-ready .rule-btn:hover, .gs-ready .vote-btn:hover,
.gs-ready .sort-choice:hover, .gs-ready .item-choice:hover, .gs-ready .pat-choice:hover, .gs-ready .slice-opt:hover, .gs-ready .j-btn:hover,
.gs-ready .match-item:hover, .gs-ready .comp-chip:hover, .gs-ready .right-card:hover, .gs-ready .fact-card:hover { transform: translateY(-3px) !important; background: var(--w-soft) !important; }
.gs-ready .abtn:active, .gs-ready .option-btn:active, .gs-ready .climb-btn:active, .gs-ready .rule-btn:active, .gs-ready .vote-btn:active { transform: translateY(4px) !important; box-shadow: 0 1px 0 var(--ink) !important; }
/* a different colour stripe for each answer, like a game show */
.gs-ready .agrid > .abtn, .gs-ready .options-list > .option-btn, .gs-ready .climb-choices > .climb-btn, .gs-ready .rule-choices > *, .gs-ready .vote-choices > * { border-bottom-width: 3px !important; }
.gs-ready .agrid > :nth-child(4n+1), .gs-ready .climb-choices > :nth-child(4n+1), .gs-ready .rule-choices > :nth-child(4n+1), .gs-ready .vote-choices > :nth-child(4n+1) { box-shadow: 0 5px 0 var(--ink), inset 0 -8px 0 #ff5a5f !important; }
.gs-ready .agrid > :nth-child(4n+2), .gs-ready .climb-choices > :nth-child(4n+2), .gs-ready .rule-choices > :nth-child(4n+2), .gs-ready .vote-choices > :nth-child(4n+2) { box-shadow: 0 5px 0 var(--ink), inset 0 -8px 0 #1fb8ff !important; }
.gs-ready .agrid > :nth-child(4n+3), .gs-ready .climb-choices > :nth-child(4n+3), .gs-ready .rule-choices > :nth-child(4n+3), .gs-ready .vote-choices > :nth-child(4n+3) { box-shadow: 0 5px 0 var(--ink), inset 0 -8px 0 #ffc928 !important; }
.gs-ready .agrid > :nth-child(4n+4), .gs-ready .climb-choices > :nth-child(4n+4), .gs-ready .rule-choices > :nth-child(4n+4), .gs-ready .vote-choices > :nth-child(4n+4) { box-shadow: 0 5px 0 var(--ink), inset 0 -8px 0 #2dbe6c !important; }
.gs-ready .abtn .ae, .gs-ready .climb-btn .cbi { font-size: 2.2rem !important; }
.gs-ready .option-btn .opt-letter { background: var(--w) !important; color: #fff !important; border: 2px solid var(--ink); font-family: var(--gs-display); }
.gs-ready .options-list > .option-btn:nth-child(4n+2) .opt-letter { background: #1fb8ff !important; }
.gs-ready .options-list > .option-btn:nth-child(4n+3) .opt-letter { background: #ffc928 !important; color: var(--ink) !important; }
.gs-ready .options-list > .option-btn:nth-child(4n+4) .opt-letter { background: #2dbe6c !important; }

/* right and wrong */
.gs-ready .correct, .gs-ready .matched, .gs-ready .sel.correct {
  background: var(--good-soft) !important; border-color: #138a49 !important; color: #0d5c31 !important;
  box-shadow: 0 5px 0 #138a49, 0 0 0 6px rgba(45,190,108,.35) !important; animation: gsYes .5s var(--pop) !important;
}
.gs-ready .wrong, .gs-ready .wrong-flash, .gs-ready .sel.wrong {
  background: var(--bad-soft) !important; border-color: #c62828 !important; color: #8e1b1b !important;
  box-shadow: 0 5px 0 #c62828 !important; animation: gsNo .45s ease !important;
}
.gs-ready .option-btn.correct .opt-letter { background: var(--good) !important; }
.gs-ready .option-btn.wrong .opt-letter { background: var(--bad) !important; }
@keyframes gsYes { 0% { transform: scale(1); } 40% { transform: scale(1.08) rotate(-1deg); } 100% { transform: scale(1); } }
@keyframes gsNo { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-10px) rotate(-1deg); } 40% { transform: translateX(9px) rotate(1deg); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }

/* feedback boxes */
.gs-ready .fb, .gs-ready .feedback-box, .gs-ready .fun-fact { border: 3px solid var(--ink) !important; border-radius: 20px !important; font-size: 1.1rem !important; animation: gsPopIn .4s var(--pop); }
.gs-ready .fb.ok, .gs-ready .feedback-box.good { background: var(--good-soft) !important; color: #0d5c31 !important; }
.gs-ready .fb.no, .gs-ready .feedback-box.bad { background: #fff6d6 !important; color: #6b4b00 !important; }

/* progress */
.gs-ready .xpbar-wrap, .gs-ready .timer-track, .gs-ready .prog-track { height: 20px !important; background: #fff !important; border: 3px solid var(--ink) !important; border-radius: 99px !important; }
.gs-ready .xpbar, .gs-ready .prog-fill { background: repeating-linear-gradient(45deg, var(--w-accent) 0 12px, #ffe27a 12px 24px) !important; animation: gsStripes 1s linear infinite; }
.gs-ready .dots { gap: 6px !important; }
.gs-ready .dot, .gs-ready .prog-dot { width: 18px !important; height: 18px !important; border: 3px solid var(--ink); background: #fff !important; }
.gs-ready .dot.done, .gs-ready .prog-dot.done { background: var(--good) !important; }
.gs-ready .dot.cur, .gs-ready .prog-dot.current, .gs-ready .prog-dot.active { background: var(--w-accent) !important; transform: scale(1.3); }
.gs-ready .sbadge, .gs-ready .stage-badge, .gs-ready .info-chip, .gs-ready .q-category, .gs-ready .stage-num {
  background: var(--w-accent) !important; color: var(--ink) !important; border: 3px solid var(--ink) !important; font-weight: 700 !important;
}
.gs-ready .xplabel { color: var(--ink) !important; }
@keyframes gsStripes { to { background-position: 34px 0; } }

/* ---------- Results ---------- */
.gs-ready .rxp, .gs-ready .xp-badge, .gs-ready #xp-badge { background: var(--w-accent) !important; color: var(--ink) !important; border: 3px solid var(--ink) !important; font-family: var(--gs-display); font-size: 1.4rem !important; padding: 10px 24px !important; border-radius: 99px !important; box-shadow: 0 5px 0 var(--ink); animation: gsBreathe 1.6s ease-in-out infinite; }
.gs-stars { display: flex; justify-content: center; gap: 10px; margin: 4px 0 6px; }
.gs-star { font-size: clamp(3.4rem, 12vw, 4.6rem); line-height: 1; color: #d9dcea; -webkit-text-stroke: 3px var(--ink); transform: scale(0); animation: gsStar .55s var(--pop) forwards; }
.gs-star:nth-child(2) { font-size: clamp(4.2rem, 15vw, 5.6rem); margin-top: -12px; }
.gs-star.on { color: #ffc928; text-shadow: 0 0 22px rgba(255, 201, 40, .8); }
.gs-best { text-align: center; font-weight: 700; color: #c4520a; margin: 0 0 8px; }
@keyframes gsStar { 0% { transform: scale(0) rotate(-40deg); } 100% { transform: scale(1) rotate(0); } }

/* ---------- Case the host ---------- */
.gs-host { position: fixed; left: 10px; bottom: 0; z-index: 60; pointer-events: none; display: flex; align-items: flex-end; }
.gs-host__pic { width: 120px; height: 150px; overflow: hidden; transform-origin: bottom center; transition: transform .3s var(--pop); filter: drop-shadow(0 4px 0 rgba(24,33,88,.25)); }
.gs-host__pic img { width: 120px; height: auto; display: block; }
.gs-host.jump .gs-host__pic { animation: gsJump .6s var(--pop); }
.gs-host.is-sad .gs-host__pic { transform: rotate(-6deg) translateY(6px); }
.gs-bubble {
  position: relative; margin: 0 0 96px 6px; max-width: 220px; padding: 10px 14px;
  background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 4px 0 var(--ink);
  font-family: var(--gs-display); font-size: 1.05rem; line-height: 1.2;
  opacity: 0; transform: scale(.6) translateY(10px); transform-origin: bottom left; transition: opacity .2s, transform .25s var(--pop);
}
.gs-bubble::before { content: ""; position: absolute; left: -12px; bottom: 14px; border: 9px solid transparent; border-right-color: var(--ink); }
.gs-host.is-talking .gs-bubble { opacity: 1; transform: none; }
.gs-host.is-happy .gs-bubble { background: #fffbe0; }
.gs-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@keyframes gsJump { 0% { transform: translateY(0); } 40% { transform: translateY(-26px) rotate(-4deg); } 100% { transform: translateY(0); } }

/* ---------- HUD ---------- */
.gs-hud { position: fixed; right: 74px; bottom: 14px; z-index: 70; display: flex; gap: 8px; align-items: center; }
.gs-mute { width: 48px; height: 48px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); font-size: 1.3rem; cursor: pointer; }
.gs-mute:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.gs-streak { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; border-radius: 99px; background: #ff7a1a; color: #fff; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); font-family: var(--gs-display); font-size: 1.3rem; }
.gs-streak[hidden] { display: none; }
.gs-streak.bump { animation: gsYes .45s var(--pop); }
.gs-streak__fire { animation: gsBob 1s ease-in-out infinite; display: inline-block; }

/* ---------- Effects ---------- */
.gs-pop { position: fixed; z-index: 80; pointer-events: none; transform: translate(-50%, -50%); font-family: var(--gs-display); font-size: 1.6rem; color: #fff; -webkit-text-stroke: 1.5px var(--ink); text-shadow: 0 3px 0 var(--ink); animation: gsUp 1.2s ease-out forwards; white-space: nowrap; }
.gs-pop.good { color: #ffc928; }
.gs-spark { position: fixed; z-index: 79; pointer-events: none; font-size: 1.4rem; transform: translate(-50%, -50%); animation: gsSpark .85s ease-out forwards; }
.gs-banner { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; pointer-events: none; }
.gs-banner span { font-family: var(--gs-display); font-size: clamp(2.2rem, 9vw, 4.2rem); color: #fff; padding: 12px 30px; background: #ff7a1a; border: 4px solid var(--ink); border-radius: 26px; box-shadow: 0 8px 0 var(--ink); transform: rotate(-4deg); animation: gsBanner 1.6s var(--pop) forwards; }
.gs-confetti { position: fixed; top: -20px; z-index: 84; width: 11px; height: 16px; border-radius: 3px; pointer-events: none; animation: gsConf linear forwards; }
@keyframes gsUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -190%) scale(1); } }
@keyframes gsSpark { to { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.4) rotate(160deg); } }
@keyframes gsBanner { 0% { transform: scale(0) rotate(-20deg); } 25% { transform: scale(1.1) rotate(-4deg); } 80% { transform: scale(1) rotate(-4deg); opacity: 1; } 100% { transform: scale(.8) rotate(-4deg); opacity: 0; } }
@keyframes gsConf { to { transform: translateY(110vh) rotate(var(--r)); } }
@keyframes gsBob { 50% { transform: translateY(-6px); } }
@keyframes gsBreathe { 50% { transform: scale(1.05); } }
@keyframes gsPopIn { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.gs-enter { animation: gsPopIn .35s var(--pop); }

/* ---------- Phones ---------- */
@media (max-width: 600px) {
  html body.gs-ready { padding-bottom: 120px !important; }
  .gs-ready .box { padding: 20px 14px 24px !important; border-radius: 24px !important; }
  .gs-host__pic { width: 64px; height: 80px; }
  .gs-host__pic img { width: 64px; }
  .gs-bubble { margin-bottom: 48px; max-width: 160px; font-size: .92rem; padding: 8px 12px; }
  /* sound and streak stack on the right, clear of the centred Next buttons */
  .gs-hud { right: 12px; bottom: 76px; flex-direction: column-reverse; align-items: flex-end; }
  .gs-ready .mbtn { min-height: 76px; }
  .gs-ready .mbtn .mi { width: 52px; height: 52px; font-size: 2rem !important; }
  .gs-ready .mbtn::after { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .gs-scene *, .gs-ready * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Once a game is running, tuck the big title away so the question sits higher on the screen. */
.gs-ready .box:has(.screen.active:not(#menuScreen)) .hdr { display: none; }
.gs-ready .box:has(.screen.active:not(#menuScreen)) .xplabel { margin-bottom: 2px; }

/* Charter Challenge shows one dot per question in its bank: keep them small and wrapping. */
.gs-ready .prog-dots { flex-wrap: wrap; gap: 4px !important; }
.gs-ready .prog-dot { width: 12px !important; height: 12px !important; border-width: 2px; }

/* ---------- Guest page (sign in to play) ----------
   The picture has the sign drawn into it; invisible links sit exactly over its buttons.
   Wide screens show the whole picture; phones zoom in on the sign.
   Plain sizes only (no aspect-ratio maths) so every phone browser draws it the same. */
html:has(body.gw-on) { margin: 0 !important; padding: 0 !important; height: 100%; overflow: hidden; background: #101845; }
body.gw-on { margin: 0 !important; padding: 0 !important; width: 100% !important; height: 100% !important; min-height: 0 !important; display: block !important; overflow: hidden; background: #101845 !important; font-family: var(--gs-body); }
.gw { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gw__bg { position: absolute; inset: -40px; background: url("/games/shell/guest-wall.webp") center / cover no-repeat; filter: blur(22px) brightness(.55) saturate(1.2); }
/* Whole picture (1660 x 947): fit inside the screen */
.gw__frame { position: relative; flex: none; overflow: hidden;
  width: min(100vw, 175.29vh); height: min(57.05vw, 100vh);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5); animation: gsPopIn .5s var(--pop); }
@supports (height: 100dvh) { .gw__frame { width: min(100vw, 175.29dvh); height: min(57.05vw, 100dvh); } }
.gw__art { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.gw__art img { position: absolute; left: 0; top: 0; display: block; width: 100%; height: 100%; max-width: none; }
.gw__hit { position: absolute; display: block; border-radius: 999px; outline: none; -webkit-tap-highlight-color: transparent; transition: box-shadow .15s, background .15s; }
.gw__hit--login { left: 36.6%; top: 54.9%; width: 26.9%; height: 8.3%; }
.gw__hit--join  { left: 36.6%; top: 64%;   width: 26.9%; height: 8.3%; }
.gw__hit--home  { left: 44%;   top: 73.3%; width: 12%;   height: 4.6%; border-radius: 12px; }
.gw__hit:hover { background: rgba(255, 255, 255, .16); box-shadow: 0 0 0 4px rgba(255, 255, 255, .7), 0 0 30px rgba(255, 220, 120, .7); }
.gw__hit:active { background: rgba(0, 0, 0, .12); }
.gw__hit:focus-visible { box-shadow: 0 0 0 4px #fff, 0 0 0 8px #182158; }
.gw__hit--login::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; animation: gwPing 2.2s ease-out infinite; pointer-events: none; }
@keyframes gwPing { 0% { box-shadow: 0 0 0 0 rgba(255, 230, 120, .75); } 70%, 100% { box-shadow: 0 0 0 18px rgba(255, 230, 120, 0); } }
.gw__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Phones and tablets held upright: a tall picture of its own (941 x 1672) that fills the
   whole screen like a cover photo, centred, with the buttons placed over it. */
@media (max-width: 1024px) and (orientation: portrait) {
  .gw__bg { background-image: url("/games/shell/guest-wall-mobile.webp"); }
  .gw__frame { width: 100vw; height: 100vh; box-shadow: none; }
  @supports (height: 100dvh) { .gw__frame { height: 100dvh; } }
  .gw__art { left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: max(100vw, 56.28vh); height: max(177.68vw, 100vh); }
  @supports (height: 100dvh) { .gw__art { width: max(100vw, 56.28dvh); height: max(177.68vw, 100dvh); } }
  .gw__hit--login { left: 21.5%; top: 63.9%; width: 56%; height: 5.9%; }
  .gw__hit--join  { left: 21.5%; top: 69.8%; width: 56%; height: 5.8%; }
  .gw__hit--home  { left: 37%;   top: 75.7%; width: 26%; height: 3.4%; }
}
/* Phones turned sideways: slice x 400 to 1260, y 110 to 800 (860 x 690) */
@media (max-height: 500px) and (orientation: landscape) {
  .gw__frame { width: min(100vw, 124.64vh); height: min(80.23vw, 100vh); }
  @supports (height: 100dvh) { .gw__frame { width: min(100vw, 124.64dvh); height: min(80.23vw, 100dvh); } }
  .gw__art { width: 193.02%; height: 137.25%; left: -46.51%; top: -15.94%; }
}
@media (prefers-reduced-motion: reduce) { .gw__hit--login::after { animation: none; } }
/* Nothing else (music button, effects) sits on top of the guest page. */
body.gw-on > *:not(.gw) { display: none !important; }

/* Uploaded background picture (CaseDash > Games backgrounds): fades in over the drawn scene. */
.gs-photo { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity .6s ease; }
.gs-photo::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,var(--gs-dim, 0)); }
.gs-photo.is-in { opacity: 1; }
.gs-scene--photo svg { visibility: hidden; transition: visibility 0s .6s; }
.gs-scene--photo .gs-float { z-index: 1; }
.gs-scene--quiet .gs-float { display: none; }
