/*! © 2026 My Fun Games · https://myfungames.co.uk · all rights reserved · wm:mfg-7c1e5a90-2026 */
/* css/fonts.css */
/* Fredoka (SIL Open Font License), hosted on this site so visitors' browsers never contact Google for fonts.
   One variable font file per script covers every weight we use (400 to 700). Paths are relative to the bundled css/ folder. */
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 300 700; font-stretch: 100%; font-display: swap;
  src: url("../assets/fonts/fredoka-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 300 700; font-stretch: 100%; font-display: swap;
  src: url("../assets/fonts/fredoka-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* css/tokens.css */
/* ===== Design tokens — change colours/sizes here, not in the other files ===== */
:root {
  /* Surfaces: deep indigo, friendly not scary */
  --bg: #4a3bbd;          /* bright royal purple (white text = 8:1 contrast) */
  --bg-2: #5748cf;
  --surface: #382a9f;     /* cards sit a little darker than the page so they stand out */
  --surface-2: #4a3cc0;
  --line: rgba(255, 255, 255, 0.24);

  /* Text */
  --text: #ffffff;
  --muted: #ebe8ff;      /* soft white: easy to read */
  --ink: #1f1650;        /* dark text used ON bright colours */

  /* Candy colours */
  --coral: #ff6b6b;
  --sky: #46c8ff;
  --violet: #b69cff;
  --sun: #ffd84d;
  --mint: #4ee3a0;
  --pink: #ff8cc0;

  /* Per-game accent (set by JS from the category) */
  --accent: var(--violet);
  --accent-2: #7a52e0;

  /* Shape */
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 12px;
  --pop: 0 5px 0 rgba(0, 0, 0, 0.28);

  /* Type */
  --font: "Fredoka", "Baloo 2", "Trebuchet MS", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Touch */
  --tap: 48px;                       /* minimum comfortable tap size */
  --gutter: 16px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

/* css/base.css */
/* ===== Base: reset, typography, shared buttons ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  --ts: 1;                              /* text scale: 1, 1.15 or 1.3 (Accessibility sheet, js/core/access.js) */
  font-size: calc(100% * var(--ts));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;          /* no double-tap zoom delay */
}

html[data-text="large"] { --ts: 1.15; }
html[data-text="xl"] { --ts: 1.3; }

body {
  font-family: var(--font);
  font-size: 1rem;                      /* 16px+: never tiny on phones */
  line-height: 1.4;
  color: var(--text);
  /* night sky at the top, warm dawn at the bottom of the world */
  background: var(--bg) linear-gradient(180deg, #2a1a8c 0%, #4a34c9 28%, #8a4fe0 62%, #d25aa6 100%) no-repeat;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
body.stage-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; opacity: 0.45; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 2px #1f1650; }   /* white ring + dark edge: visible on light AND dark colours */
/* only for screen readers */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* "Skip to the games": the first thing a keyboard or screen-reader user reaches */
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 1000; padding: 12px 18px; border-radius: 12px; background: #ffd84d; color: #1f1650; font: 700 calc(16px * var(--ts, 1)) Fredoka, sans-serif; text-decoration: none; }
.skip-link:focus { top: 12px; }
main:focus { outline: none; }

/* Twinkling stars behind the page (no text glow: keeps text crisp) */
.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(2px 2px at 12% 14%, #fff 98%, transparent),
    radial-gradient(2px 2px at 34% 8%, #fff 98%, transparent),
    radial-gradient(3px 3px at 58% 18%, #fff 98%, transparent),
    radial-gradient(2px 2px at 80% 10%, #fff 98%, transparent),
    radial-gradient(2px 2px at 92% 28%, #fff 98%, transparent),
    radial-gradient(2px 2px at 6% 36%, #fff 98%, transparent),
    radial-gradient(3px 3px at 46% 34%, #fff 98%, transparent);
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { opacity: 0.9; } 50% { opacity: 0.35; } }

/* ---- Buttons (chunky "sticker" style) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: var(--tap);
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.1;
  user-select: none; -webkit-user-select: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn-primary { background: var(--accent); color: var(--ink); box-shadow: var(--pop); }
.btn-primary:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.28); }
.btn-ghost { background: rgba(255, 255, 255, 0.12); color: #fff; border: 2px solid var(--line); }
.btn-ghost:active { background: rgba(255, 255, 255, 0.22); }
.btn-lg { min-height: 56px; font-size: 1.2rem; padding: 0.7rem 1.8rem; }
.btn-xl { min-height: 64px; font-size: 1.4rem; padding: 0.8rem 2.4rem; }

.icon-btn {
  width: var(--tap); height: var(--tap);
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid var(--line);
  font-size: 1.25rem; line-height: 1;
  user-select: none; -webkit-user-select: none;
}
.icon-btn:active { background: rgba(255, 255, 255, 0.24); }

/* calm movement: the device setting, unless the player chose Normal; or the player chose Calm (html[data-motion]) */
@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="normal"]) *, html:not([data-motion="normal"]) *::before, html:not([data-motion="normal"]) *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

html[data-motion="calm"] *, html[data-motion="calm"] *::before, html[data-motion="calm"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* ---- Cookie notice (bottom sheet; hidden while a game is open) ---- */
.consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
  padding: 12px calc(12px + var(--safe-r)) calc(12px + var(--safe-b)) calc(12px + var(--safe-l));
}
body.stage-open .consent { display: none; }
.consent-box {
  max-width: 560px; margin: 0 auto;
  background: var(--surface); border: 2px solid var(--line);
  border-radius: var(--r-lg); padding: 16px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.45);
}
.consent-box h2 { font-size: 1.25rem; margin-bottom: 4px; }
.consent-box p { color: var(--muted); font-size: 1rem; margin-bottom: 12px; }
.consent-btns { display: flex; gap: 10px; }
.consent-btns .btn { flex: 1; }

.link-btn { color: var(--muted); text-decoration: underline; font-size: 0.95rem; min-height: 40px; padding: 0 8px; }

/* css/home.css */
/* ===== Home page: the world map (mobile-first) ===== */

/* ---- Hero ---- */
.hero {
  position: relative;
  padding: calc(var(--safe-t) + 10px) calc(var(--gutter) + var(--safe-r)) 6px calc(var(--gutter) + var(--safe-l));
  max-width: 1120px; margin: 0 auto;
}
.hero-bar { display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; border-radius: 12px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; }
.hero-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 2px; }
.hero-text { min-width: 0; padding-bottom: 14px; }
.hero-title {
  font-size: clamp(2.7rem, 13vw, 5.4rem);
  font-weight: 700; line-height: 0.95; letter-spacing: -0.01em;
  color: var(--sun);
  -webkit-text-stroke: 0.14em #2b1a8f; paint-order: stroke fill;      /* sticker outline, stays crisp */
  transform: rotate(-3deg); transform-origin: left bottom;
}
.hero-title span { display: block; }
.hero-title span + span { color: #fff; margin-left: 0.5em; }
.hero-sub {
  display: inline-block; margin-top: 14px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(20, 10, 80, 0.5);
  font-size: 1.05rem; font-weight: 500;
}
.mascot { flex: none; width: clamp(110px, 32vw, 190px); animation: bob 3.2s ease-in-out infinite; }
.mascot .mascot-arm-l { transform-origin: 32px 100px; animation: wave 1.6s ease-in-out infinite; }
.mascot .mascot-arm-r { transform-origin: 128px 100px; animation: wave 1.6s ease-in-out infinite reverse; }
.mascot .mascot-eyes { animation: blink 4.5s infinite; transform-origin: 80px 84px; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-14deg); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }

/* ---- Page ---- */
.page { max-width: 1120px; margin: 0 auto; padding: 8px calc(var(--gutter) + var(--safe-r)) 24px calc(var(--gutter) + var(--safe-l)); }
.section-h { font-size: 1.4rem; font-weight: 700; line-height: 1.2; margin: 6px 0 10px; }

/* ===== Rewards: profile strip, daily challenge, trophy sheet, toast ===== */
.profile-wrap { margin: 0 0 16px; display: grid; gap: 10px; }
.pf-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  background: rgba(20, 10, 80, 0.55); border: 2px solid rgba(255, 255, 255, 0.25); color: #fff; font-size: 1.05rem; font-weight: 600;
}
.pf-chip b { font-size: 1.2rem; color: var(--sun); font-variant-numeric: tabular-nums; }
.pf-chip small { color: var(--muted); font-size: 0.85rem; font-weight: 500; }
.pf-btn { background: var(--sun); color: var(--ink); border-color: transparent; box-shadow: var(--pop); }
.pf-btn b { color: var(--ink); } .pf-btn small { color: #5a4d99; }
.pf-btn:active { transform: translateY(3px); box-shadow: none; }
.pf-user { background: var(--mint); color: var(--ink); border-color: transparent; box-shadow: var(--pop); max-width: 100%; }
.pf-user b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 9ch; }
.pf-user:active { transform: translateY(3px); box-shadow: none; }
.pf-tabs { display: flex; gap: 8px; margin: 0 0 12px; }
.pf-tab { flex: 1; min-height: 46px; border-radius: 14px; background: rgba(255, 255, 255, 0.12); color: #fff; font-weight: 700; font-size: 1rem; border: 2px solid transparent; }
.pf-tab.on { background: var(--sun); color: var(--ink); }
.pf-form { display: grid; gap: 10px; }
.pf-form[hidden] { display: none; }
.pf-form label { display: grid; gap: 4px; font-weight: 600; }
.pf-form input[type=text], .pf-form input[type=password] { min-height: 48px; padding: 0 14px; border-radius: 14px; border: 3px solid rgba(255, 255, 255, 0.35); background: #1d1466; color: #fff; font: inherit; font-size: 1.1rem; }
.pf-form input:focus { outline: none; border-color: var(--sun); }
.pf-check { display: flex !important; align-items: center; gap: 10px; font-weight: 500 !important; }
.pf-check input { width: 22px; height: 22px; }
.pf-note { color: var(--muted); font-size: 0.92rem; margin: 0; }
.pf-err { color: #ff9a9a; font-weight: 700; margin: 0; min-height: 1.2em; }
.pf-actions { display: flex; gap: 10px; margin: 10px 0; }
.pf-more { margin-top: 14px; color: var(--muted); } .pf-more summary { cursor: pointer; padding: 8px 0; }
.daily {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px 10px 10px; border-radius: 26px; text-align: left;
  background: linear-gradient(135deg, var(--c1), var(--c2)); color: var(--ink); box-shadow: var(--pop); border: 3px solid rgba(255, 255, 255, 0.85);
}
.daily:active { transform: translateY(3px); box-shadow: none; }
.daily-ball { flex: none; width: 54px; height: 54px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.daily-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.daily-text b { font-size: 1.15rem; }
.daily-text span { font-size: 0.98rem; font-weight: 500; }
.daily-reward { flex: none; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; }
.daily.done { filter: saturate(0.6); }
.daily.done .daily-reward { background: var(--mint); color: var(--ink); }

.sheet { position: fixed; inset: 0; z-index: 400; display: flex; align-items: flex-end; justify-content: center; background: rgba(15, 8, 60, 0.7); padding: 0; }
.sheet-card {
  width: min(100%, 560px); max-height: 88vh; max-height: 88dvh; overflow: auto; -webkit-overflow-scrolling: touch;
  background: #2f2390; border: 4px solid rgba(255, 255, 255, 0.85); border-bottom: 0; border-radius: 30px 30px 0 0;
  padding: 16px 16px calc(20px + var(--safe-b)); animation: sheetUp 0.28s ease-out;
}
@media (min-width: 720px) { .sheet { align-items: center; padding: 20px; } .sheet-card { border-radius: 30px; border-bottom: 4px solid rgba(255, 255, 255, 0.85); } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-head h2 { font-size: 1.5rem; } .sheet-head small { color: var(--sun); font-size: 1.1rem; }
.sheet-sub { color: var(--muted); margin: 4px 0 12px; }
.trophy-list { list-style: none; display: grid; gap: 8px; }
.trophy { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: 20px; background: rgba(255, 255, 255, 0.08); opacity: 0.85; }
.trophy.got { background: rgba(255, 216, 77, 0.2); opacity: 1; border: 2px solid rgba(255, 216, 77, 0.6); }
.tr-ball { flex: none; width: 50px; height: 50px; border-radius: 50%; background: rgba(0, 0, 0, 0.28); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.trophy.got .tr-ball { background: #fff; }
.tr-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.tr-text b { font-size: 1.05rem; } .tr-text span { color: var(--muted); font-size: 0.95rem; } .tr-text small { color: var(--muted); font-size: 0.8rem; }
.tr-bar { display: block; height: 8px; margin: 4px 0 2px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); overflow: hidden; }
.tr-bar i { display: block; height: 100%; background: var(--mint); border-radius: 999px; }

.reward-toast {
  position: fixed; left: 50%; top: calc(14px + var(--safe-t)); z-index: 500; transform: translate(-50%, -140%);
  display: flex; align-items: center; gap: 12px; max-width: min(92vw, 420px); padding: 10px 18px 10px 12px; border-radius: 24px;
  background: var(--sun); color: var(--ink); box-shadow: 0 8px 0 rgba(20, 10, 70, 0.35); pointer-events: none; opacity: 0;
}
.reward-toast.show { animation: toastDrop 3.5s ease both; }
.reward-toast b { display: block; font-size: 1.1rem; line-height: 1.2; } .reward-toast i { display: block; font-style: normal; font-size: 0.92rem; font-weight: 500; }
.rt-emoji { flex: none; width: 46px; height: 46px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
@keyframes toastDrop { 0% { transform: translate(-50%, -140%); opacity: 0; } 10%, 85% { transform: translate(-50%, 0); opacity: 1; } 100% { transform: translate(-50%, -140%); opacity: 0; } }

.back3d { color: #fff; font-weight: 600; margin-left: 6px; white-space: nowrap; }

/* "Add to home screen" card: shown on phones until the game is installed (or hidden for a week) */
.install-card { margin: 0 0 16px; padding: 12px 14px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, #3a8dff, #6a4cff 60%, #b45cff); box-shadow: 0 5px 0 rgba(0, 0, 0, 0.25); }
.install-row { display: flex; align-items: center; gap: 10px; }
.install-ico { font-size: calc(32px * var(--ts, 1)); line-height: 1; }
.install-txt { display: grid; flex: 1; min-width: 0; }
.install-txt b { font-size: calc(18px * var(--ts, 1)); }
.install-txt small { font-size: calc(12.5px * var(--ts, 1)); opacity: 0.92; line-height: 1.25; }
.install-go { appearance: none; border: 0; border-radius: 14px; padding: 12px 18px; min-height: 44px; font: 700 calc(17px * var(--ts, 1)) Fredoka, sans-serif; color: #2a1a8c; background: #ffd84d; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); cursor: pointer; }
.install-go:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); }
.install-x { appearance: none; border: 0; background: rgba(255, 255, 255, 0.18); color: #fff; width: 32px; height: 32px; border-radius: 50%; font-size: calc(14px * var(--ts, 1)); cursor: pointer; align-self: flex-start; }
.install-steps { margin: 10px 0 2px; padding: 10px 12px 10px 32px; border-radius: 12px; background: rgba(0, 0, 0, 0.22); font-size: calc(14px * var(--ts, 1)); line-height: 1.5; }
.install-steps li { margin: 2px 0; }
.install-steps li b { color: #ffd84d; }

/* ---- Finder: search box, type chips, surprise me ---- */
.finder-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px; border-radius: 999px; background: #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.22); }
.finder-search:focus-within { outline: 3px solid #ffd84d; }
.finder-ico { font-size: calc(18px * var(--ts, 1)); }
.finder-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 600 calc(17px * var(--ts, 1)) Fredoka, sans-serif; color: #2a1a8c; appearance: none; -webkit-appearance: none; }
.finder-search input::placeholder { color: #6559a6; opacity: 1; }
.finder-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.finder-surprise { flex: none; height: 48px; padding: 0 14px; border: 0; border-radius: 999px; font: 700 calc(15px * var(--ts, 1)) Fredoka, sans-serif; color: #2a1a8c; background: #ffd84d; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); cursor: pointer; white-space: nowrap; }
.finder-surprise:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); }
@media (max-width: 380px) { .finder-surprise span { display: none; } .finder-surprise { padding: 0 14px; font-size: calc(20px * var(--ts, 1)); } }

/* ---- Friends ---- */
.fr-chip { position: relative; }
.fr-badge { margin-left: 6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #ff6b6b; color: #fff; font: 700 0.8rem/calc(20px * var(--ts, 1)) Fredoka, sans-serif; text-align: center; }
.fr-badge[hidden] { display: none; }
.fr-me { background: rgba(255, 255, 255, 0.1); border-radius: 18px; padding: 10px 12px; margin-bottom: 10px; }
.fr-me small { color: var(--muted); }
.fr-code { font: 700 1.35rem Fredoka, sans-serif; letter-spacing: 0.04em; color: var(--sun); word-break: break-all; margin: 2px 0; user-select: all; }
.fr-on { width: 100%; margin-bottom: 10px; }
.fr-add { display: flex; gap: 8px; margin: 6px 0; }
.fr-add input { flex: 1; min-width: 0; height: 48px; border: 0; border-radius: 999px; padding: 0 16px; font: 600 calc(16px * var(--ts, 1)) Fredoka, sans-serif; color: #2a1a8c; background: #fff; }
.fr-h { font-size: 1.1rem; margin: 14px 0 6px; }
.fr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fr-row { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.1); border-radius: 16px; padding: 8px 10px; }
.fr-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fr-who small { color: var(--muted); }
.fr-inv { min-height: 40px; padding: 0 14px; }
.fr-x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.15); color: #fff; font-size: calc(16px * var(--ts, 1)); cursor: pointer; }
.fr-games { display: flex; flex-wrap: wrap; gap: 8px; }
.fr-game { border: 2px solid rgba(255, 255, 255, 0.3); border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: #fff; padding: 8px 14px; font: 600 calc(15px * var(--ts, 1)) Fredoka, sans-serif; cursor: pointer; }
.fr-game:active { transform: translateY(1px); }
.fr-invite { position: fixed; left: 0; right: 0; top: 0; z-index: 600; display: flex; justify-content: center; padding: 12px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); pointer-events: none; }
.fr-inv-card { pointer-events: auto; width: 100%; max-width: 420px; display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; padding: 14px; border-radius: 22px; background: #fff5d6; color: #2a1a8c; box-shadow: 0 8px 0 rgba(0, 0, 0, 0.25); font-size: 1.05rem; animation: frdrop 0.3s ease-out; }
.fr-inv-emoji { font-size: 2.4rem; }
.fr-inv-btns { grid-column: 1 / -1; display: flex; gap: 8px; }
@keyframes frdrop { from { transform: translateY(-120%); } to { transform: none; } }
.fr-incoming { background: #fff5d6; color: #2a1a8c; border-radius: 18px; padding: 12px; margin-bottom: 10px; font-size: 1.05rem; }
.fr-incoming .btn-ghost { color: #2a1a8c; border-color: rgba(42, 26, 140, 0.4); }
.goals { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 0; font-size: 0.85rem; }
.goals > b { width: 100%; font-size: 0.9rem; }
.goal { background: rgba(255,255,255,0.12); border-radius: 999px; padding: 4px 10px; } .goal.ok { background: rgba(78,227,160,0.28); }

/* "Show all N games" button on a land / search results */
.land-more { display: block; margin: 12px auto 4px; padding: 10px 18px; border: 0; border-radius: 999px; background: rgba(255,255,255,.9); color: #3a2d9c; font: 700 calc(15px * var(--ts, 1)) Fredoka, sans-serif; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.land-more:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }

.pf-list { display: grid; gap: 8px; margin: 0 0 12px; }
.pf-list .btn { justify-content: flex-start; }

/* name picker (js/core/names.js) */
.np { display: grid; gap: 8px; text-align: center; }
.np-name { font: 700 1.7rem "Fredoka", sans-serif; color: var(--sun); background: rgba(0, 0, 0, 0.28); border-radius: 14px; padding: 10px 8px; overflow-wrap: anywhere; }
.np-row { display: flex; align-items: flex-end; justify-content: center; gap: 8px; }
.np-step { display: grid; gap: 3px; } .np-step small { color: var(--muted); font-size: 0.75rem; }
.np-step > div { display: flex; gap: 3px; }
.np-b, .np-dice { min-width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, 0.18); color: #fff; font-size: 1rem; cursor: pointer; }
.np-dice { font-size: 1.5rem; background: var(--sun); }
.np-err { margin: 0; min-height: 1.1em; color: #ff9aa5; font-size: 0.85rem; }
.pf-fix { margin: 0 0 12px; padding: 10px; border-radius: 14px; background: rgba(255, 216, 77, 0.15); border: 2px solid #ffd84d; }

/* ---- Accessibility sheet (js/core/access.js) ---- */
.ac-body { display: flex; flex-direction: column; gap: 16px; margin: 10px 0; }
.ac-row h3 { font-size: 1.15rem; margin-bottom: 2px; }
.ac-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ac-opt { min-height: 48px; padding: 0 18px; border-radius: 999px; background: rgba(255,255,255,.12); border: 2px solid var(--line); color: #fff; font: inherit; font-weight: 600; cursor: pointer; touch-action: manipulation; }
.ac-opt.on { background: var(--sun); color: var(--ink); border-color: #fff; }
.ac-sample { padding: 12px 14px; border-radius: 14px; background: rgba(0,0,0,.22); text-align: center; }

/* css/portal.css */
/* ===================== PORTAL LAYOUT (sidebar + picture grids) =====================
   Phone first: the sidebar is a slide-in menu and a row of pills sits under the search bar.
   900px and up: the sidebar is always visible on the left and the game pictures fill the right. */
.shell { display: block; }
.content { min-width: 0; }
.page { max-width: 1280px; }
.foot { text-align: center; padding: 8px 16px calc(24px + var(--safe-b)); font-size: .95rem; }
.foot p { display: inline-block; padding: 4px 14px; border-radius: 999px; background: rgba(20,10,80,.5); color: #fff; margin: 3px; }
.world-loading { padding: 40px 0; text-align: center; font-weight: 600; }

/* top bar: menu button, logo, search, surprise, sound */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; padding: calc(var(--safe-t) + 8px) calc(var(--gutter) + var(--safe-r)) 8px calc(var(--gutter) + var(--safe-l)); background: linear-gradient(#2a1a8c 70%, rgba(42,26,140,0)); }
.side-btn { flex: none; width: 46px; height: 46px; border: 0; border-radius: 14px; background: rgba(255,255,255,.18); color: #fff; font-size: calc(22px * var(--ts, 1)); cursor: pointer; }
.brand-top { flex: none; }
.brand-top .brand-mark { width: 36px; height: 36px; }
.topbar .icon-btn { flex: none; }
@media (max-width: 520px) { .brand-top { display: none; } .finder-surprise span { display: none; } .finder-surprise { padding: 0 14px; font-size: calc(20px * var(--ts, 1)); } }

/* pills (phones) */
.pills { display: flex; gap: 8px; overflow-x: auto; padding: 2px calc(var(--gutter) + var(--safe-r)) 10px calc(var(--gutter) + var(--safe-l)); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; border: 2px solid rgba(255,255,255,.28); border-radius: 999px; background: rgba(20,10,80,.45); color: #fff; padding: 0 14px; height: 40px; font: 600 calc(15px * var(--ts, 1)) Fredoka, sans-serif; cursor: pointer; white-space: nowrap; }
.pill.on { background: #ffd84d; border-color: #ffd84d; color: #2a1a8c; box-shadow: 0 3px 0 rgba(0,0,0,.25); }

/* slim hero */
.hero { padding-top: 0; padding-bottom: 0; max-width: 1280px; }
.hero-title { font-size: clamp(2rem, 9vw, 3.4rem); }
.hero-text { padding-bottom: 6px; }
.hero-sub { margin-top: 8px; font-size: .98rem; }
.mascot { width: clamp(80px, 22vw, 130px); }
body.filtering .hero { display: none; }

/* sidebar: slide-in menu on phones */
.side { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); padding: calc(var(--safe-t) + 14px) 12px calc(var(--safe-b) + 18px); overflow-y: auto; background: #2a1a8c; box-shadow: 6px 0 24px rgba(0,0,0,.4); transform: translateX(-105%); transition: transform .22s ease; }
.side.open { transform: none; }
.side-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(10,4,50,.55); }
.side-scrim[hidden] { display: none; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: #fff; font: 700 calc(20px * var(--ts, 1)) Fredoka, sans-serif; text-decoration: none; }
.side-brand .brand-mark { width: 36px; height: 36px; }
.side-h { margin: 14px 10px 4px; font: 700 calc(12px * var(--ts, 1)) Fredoka, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #bdb2ff; }
.side-i { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: 12px; background: transparent; color: #fff; font: 600 calc(16px * var(--ts, 1)) Fredoka, sans-serif; text-align: left; cursor: pointer; }
.side-i:hover { background: rgba(255,255,255,.12); }
.side-i.on { background: #ffd84d; color: #2a1a8c; }
.si-e { flex: none; width: 26px; text-align: center; font-size: calc(19px * var(--ts, 1)); }
.si-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.si-n { flex: none; font-size: calc(12px * var(--ts, 1)); font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.16); }
.side-i.on .si-n { background: rgba(42,26,140,.14); }

/* rows and grids */
.row { margin: 0 0 26px; }
.row-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.row-h h1, .row-h h2 { font: 700 1.35rem/1.2 Fredoka, sans-serif; margin: 0; }
.row-h h1 small, .row-h h2 small { display: block; font: 500 .85rem Fredoka, sans-serif; color: var(--muted); margin-top: 2px; }
.see, .see-n { flex: none; border: 0; background: rgba(255,255,255,.16); color: #fff; padding: 6px 12px; border-radius: 999px; font: 600 calc(14px * var(--ts, 1)) Fredoka, sans-serif; cursor: pointer; }
.see-n { cursor: default; background: transparent; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.hscroll { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll .gcard { flex: none; width: min(70vw, 260px); scroll-snap-align: start; }

/* game card: picture, then title */
.gcard { position: relative; content-visibility: auto; contain-intrinsic-size: auto 210px; }
.card-main { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: #fff; text-align: left; cursor: pointer; }
.card-img { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: linear-gradient(135deg, var(--sky1, #7f5df0), var(--sky2, #e0b5ff)); box-shadow: 0 5px 0 rgba(0,0,0,.28); transition: transform .15s ease; }
.card-img img { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; }
.cover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.cover b { font-size: clamp(46px, 9vw, 64px); line-height: 1; filter: drop-shadow(0 4px 0 rgba(0,0,0,.25)); z-index: 1; }
.cover i { position: absolute; font-style: normal; font-size: calc(26px * var(--ts, 1)); opacity: .5; font-weight: 700; color: #fff; }
.cover i:nth-of-type(1) { left: 9%; top: 12%; transform: rotate(-14deg); }
.cover i:nth-of-type(2) { right: 9%; top: 14%; transform: rotate(12deg); }
.cover i:nth-of-type(3) { left: 12%; bottom: 10%; transform: rotate(10deg); }
.cover i:nth-of-type(4) { right: 12%; bottom: 12%; transform: rotate(-10deg); }
.cover i:nth-of-type(5) { left: 44%; top: 4%; transform: rotate(6deg); font-size: calc(20px * var(--ts, 1)); }
.card-go { z-index: 3; position: absolute; left: 50%; bottom: 10px; transform: translate(-50%, 10px); opacity: 0; padding: 6px 16px; border-radius: 999px; background: #ffd84d; color: #2a1a8c; font: 700 calc(15px * var(--ts, 1)) Fredoka, sans-serif; box-shadow: 0 3px 0 rgba(0,0,0,.3); transition: opacity .15s, transform .15s; pointer-events: none; }
.card-title { display: block; margin: 8px 4px 0; font: 700 1rem/1.2 Fredoka, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { display: block; margin: 1px 4px 0; font: 500 .82rem Fredoka, sans-serif; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-main:active .card-img { transform: scale(.97); }
.card-fav { z-index: 4; position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(20,10,80,.55); color: #fff; font-size: calc(19px * var(--ts, 1)); cursor: pointer; }
.card-fav.on { color: #ffd84d; }
/* heart + count on the picture: tap to like without opening the game */
.like-btn.card-like { z-index: 4; position: absolute; top: 6px; left: 6px; min-width: 44px; height: 44px; padding: 0 12px; margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 0; border-radius: 999px; background: rgba(20,10,80,.55); color: #fff; font: 600 calc(14px * var(--ts, 1)) Fredoka, sans-serif; cursor: pointer; box-shadow: none; }
.like-btn.card-like .like-h { font-size: calc(17px * var(--ts, 1)); line-height: 1; }
.like-btn.card-like .like-n:empty { display: none; }
.like-btn.card-like.on { background: rgba(120,20,70,.7); }
.like-btn.card-like:active { transform: scale(.94); }
@media (hover: hover) { .card-main:hover .card-img { transform: translateY(-4px) scale(1.03); } .card-main:hover .card-go { opacity: 1; transform: translate(-50%, 0); } }
.card-big .card-title { font-size: 1.1rem; }

/* mood tiles */
.moods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mood { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 0 14px; border: 0; border-radius: 18px; color: #fff; font: 700 1.05rem Fredoka, sans-serif; text-align: left; cursor: pointer; box-shadow: 0 5px 0 rgba(0,0,0,.28); }
.mood span { font-size: calc(28px * var(--ts, 1)); }
.mood:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.28); }
.mood-brain { background: linear-gradient(135deg, #7f5df0, #b69cff); } .mood-rush { background: linear-gradient(135deg, #ff5d73, #ff9f43); }
.mood-friends { background: linear-gradient(135deg, #0aa5c0, #45f0c8); } .mood-quick { background: linear-gradient(135deg, #f08c00, #ffd84d); }
.mood-relax { background: linear-gradient(135deg, #2f9e44, #8ce99a); } .mood-classics { background: linear-gradient(135deg, #d9480f, #ffa94d); }

/* search results + empty states */
.finder-results { margin: 0 0 20px; }
.finder-results[hidden], .world[hidden] { display: none; }
.finder-none { font-weight: 600; line-height: 1.4; margin: 6px 0; padding: 14px; border-radius: 16px; background: rgba(20,10,80,.45); }
.install-card[data-hide] { display: none; }
.recent[hidden] { display: none; }

/* tablets and up: a row shows as many WHOLE cards as fit (the rest are behind "See all"), instead of a swipe row with a half-hidden card */
@media (min-width: 600px) {
  .hscroll { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-template-rows: auto; grid-auto-rows: 0; column-gap: 14px; row-gap: 0; overflow: hidden; padding: 2px 0 10px; scroll-snap-type: none; }
  .hscroll .gcard { width: auto; }
}

/* desktop: permanent sidebar on the left, pictures on the right */
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: start; }
  .side { position: sticky; top: 0; z-index: 10; height: 100vh; width: auto; transform: none; box-shadow: none; background: rgba(20,10,80,.55); border-right: 1px solid rgba(255,255,255,.12); transition: none; }
  .side-scrim { display: none; }
  .side-btn, .pills { display: none; }
  .brand-top { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
  .moods { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1300px) { .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); } .moods { grid-template-columns: repeat(6, 1fr); } }
@media (prefers-reduced-motion: reduce) { .side, .card-img, .card-go { transition: none; } }

/* css/player.css */
/* ===== Game stage (mobile-first: full-screen on phones, big window on desktop) ===== */
.stage {
  position: fixed; inset: 0; z-index: 100;
  display: flex;
  background: var(--bg-2);
  overscroll-behavior: contain;
}
.stage-panel {
  --cb: clamp(52px, 9vh, 76px);          /* on-screen control button size */
  position: relative;
  display: flex; flex-direction: column;
  width: 100%; height: 100%;
  background: var(--bg-2);
  background: linear-gradient(180deg, var(--stage1, #4a3bbd), var(--stage2, #5748cf));
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
}

/* ---- Top bar: title, score, sound, pause, close ---- */
.stage-bar {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: rgba(15, 8, 60, 0.55);
  border-bottom: 4px solid var(--accent);
}
.stage-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.stage-emoji { font-size: 1.7rem; line-height: 1; }
.stage-name h2 { display: none; font-size: 1.15rem; font-weight: 700; white-space: nowrap; }
.stage-hud { flex: 1; min-width: 0; display: flex; justify-content: center; }
.score-display {
  max-width: 100%;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  font-size: 1.15rem; font-weight: 700; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.icon-close { background: var(--coral); color: var(--ink); border-color: transparent; font-weight: 700; }

/* ---- Play area ---- */
.stage-play { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.stage-scene { position: absolute; left: 0; right: 0; bottom: 0; height: min(42%, 220px); opacity: 0.4; pointer-events: none; }
.stage-scene svg { width: 100%; height: 100%; }
.stage-body {
  position: absolute; inset: 0;
  display: flex;
  padding: 10px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.game-root {
  margin: auto;                          /* centres, but never clips the top when tall */
  width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.stage-hint { display: none; flex: none; text-align: center; color: var(--muted); font-size: 0.95rem; padding: 6px 12px 10px; }

/* Canvas games: size is set by JS (Player.fit) so the picture fills the screen sharply */
.canvas-wrap { position: relative; display: block; line-height: 0; flex: none; max-width: 100%; }
.game-canvas {
  display: block;
  max-width: 100%;
  border-radius: 16px;
  border: 3px solid var(--accent);
  background: #2b2080;
  touch-action: none;
  outline: none;
  -webkit-user-select: none; user-select: none;
}

/* ---- On-screen controls: big, simple, thumb-friendly ---- */
.onscreen-controls {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  width: 100%; flex: none;
}
.ctrl-btn {
  width: var(--cb); height: var(--cb);
  display: flex; align-items: center; justify-content: center;
  border-radius: 20px;
  background: var(--surface-2);
  border: 2px solid var(--line);
  color: #fff;
  font-size: 1.7rem; font-weight: 700; line-height: 1;
  box-shadow: var(--pop);
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
.ctrl-btn:active, .ctrl-btn.pressed {
  background: var(--accent); color: var(--ink);
  transform: translateY(4px); box-shadow: none;
}
.ctrl-btn.wide {
  width: auto; min-width: calc(var(--cb) * 2); padding: 0 1.3rem;
  font-size: 1.2rem; font-family: var(--font);
}
/* D-pad: up on top, then left / down / right (two rows = less height) */
.onscreen-controls.dpad {
  display: grid;
  grid-template-columns: repeat(3, var(--cb));
  grid-template-rows: repeat(2, var(--cb));
  gap: 8px; width: auto;
}
.dpad .ctrl-btn[data-dir="up"]    { grid-column: 2; grid-row: 1; }
.dpad .ctrl-btn[data-dir="left"]  { grid-column: 1; grid-row: 2; }
.dpad .ctrl-btn[data-dir="down"]  { grid-column: 2; grid-row: 2; }
.dpad .ctrl-btn[data-dir="right"] { grid-column: 3; grid-row: 2; }
.dpad .ctrl-btn.center { display: none; }

/* Buttons used inside a few games' own screens */
.restart-btn {
  min-height: var(--tap); padding: 0.5rem 1.4rem; border-radius: 999px;
  background: var(--accent); color: var(--ink); font-weight: 700; font-size: 1.1rem;
  box-shadow: var(--pop);
}

/* Phones in landscape: put the controls beside the picture */
@media (orientation: landscape) and (max-height: 520px) {
  .stage-panel { --cb: clamp(48px, 15vh, 66px); }
  .stage-bar { padding: 4px 10px; }
  .stage-body { padding: 6px; }
  .game-root { flex-direction: row; justify-content: center; gap: 14px; }
  .onscreen-controls { width: auto; flex-direction: column; flex-wrap: nowrap; }
  .onscreen-controls.dpad { flex-direction: unset; }
  .stage-hint { display: none !important; }
}

/* ---- Overlay: Ready / Countdown / Pause / Game over ---- */
.overlay {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  padding: 14px;
  background: linear-gradient(180deg, var(--stage1, #4a3bbd), var(--stage2, #5748cf));
  overflow: auto;
}
.overlay.v-count { background: color-mix(in srgb, var(--stage1, #4a3bbd) 90%, transparent); }
.overlay.v-go { background: transparent; pointer-events: none; animation: fadeOut 0.65s ease forwards; }
.card {
  width: min(100%, 420px);
  margin: auto;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 20px 18px;
  text-align: center;
  background: rgba(18, 10, 70, 0.62);
  border: 4px solid var(--accent);
  border-radius: 32px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.25);
  animation: pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.big-emoji { font-size: 4rem; line-height: 1; }
.card-h { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.card-p { color: var(--muted); font-size: 1.05rem; }
.howto { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.howto li {
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.98rem; font-weight: 500;
}
.best-line { font-weight: 600; color: var(--sun); font-size: 1.1rem; }
.badge-best {
  padding: 6px 16px; border-radius: 999px;
  background: var(--sun); color: var(--ink); font-weight: 700; font-size: 1.1rem;
  animation: wiggle 0.7s ease 0.3s 2;
}
.score-box {
  min-width: 190px; padding: 10px 24px;
  border-radius: 20px; background: rgba(0, 0, 0, 0.3);
}
.score-label { color: var(--muted); font-size: 0.95rem; font-weight: 500; }
.score-val { font-size: 3rem; font-weight: 700; line-height: 1.1; color: var(--sun); font-variant-numeric: tabular-nums; }
.btn-col { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; padding-left: 0.8rem; padding-right: 0.8rem; }
.ready-card .btn-xl { margin-top: 6px; width: 100%; }

.count-num {
  font-size: min(42vmin, 14rem); font-weight: 700; line-height: 1; color: var(--sun);
  animation: countPop 0.8s ease both;
}
.count-num.go { color: var(--mint); font-size: min(30vmin, 10rem); animation: goPop 0.65s ease both; }
.count-sub { margin-top: 6px; font-size: 1.4rem; font-weight: 600; color: var(--muted); }

.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i {
  position: absolute; top: -16px; width: 10px; height: 16px; border-radius: 2px;
  animation: fall 2.4s linear forwards;
}

@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes countPop { 0% { transform: scale(1.6); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { transform: scale(0.85); opacity: 0.9; } }
@keyframes goPop { 0% { transform: scale(0.6); opacity: 0; } 30% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
@keyframes fadeOut { 0%, 55% { opacity: 1; } 100% { opacity: 0; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
@keyframes fall { to { transform: translate(var(--drift, 0), 110vh) rotate(720deg); } }

/* ---- Tablets / desktop: a big framed window ---- */
@media (min-width: 720px) and (min-height: 560px) {
  .stage { align-items: center; justify-content: center; padding: 20px; background: rgba(40, 28, 120, 0.8); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  .stage-panel {
    max-width: 1040px; max-height: 940px;
    border: 4px solid var(--accent);
    border-radius: 30px;
    overflow: hidden;
    padding: 0;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  }
  .stage-name h2 { display: block; }
  .stage-hint { display: block; }
  .stage-body { padding: 16px; }
  .stage-panel { --cb: clamp(56px, 8vh, 72px); }
}
@media (min-width: 560px) and (max-width: 719px) {
  .stage-name h2 { display: block; }
}
@media (min-width: 720px) and (max-height: 760px) {
  .stage { padding: 6px; }
  .stage-panel { border-width: 3px; border-radius: 22px; }
  .stage-hint { display: none; }
  .stage-body { padding: 8px; }
}

/* Speed Clicker's big button */
.big-tap {
  width: min(62vw, 240px); height: min(62vw, 240px);
  border-radius: 50%;
  background: var(--accent); color: var(--ink);
  font-size: 2.2rem; font-weight: 700;
  box-shadow: 0 10px 0 rgba(0, 0, 0, 0.3);
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
  transition: transform 0.05s, box-shadow 0.05s;
}
.big-tap.hit, .big-tap:active { transform: translateY(8px) scale(0.97); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }

/* ---- Wordle ---- */
.wd-board { display: grid; gap: 6px; width: min(100%, 300px); }
.wd-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wd-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 3px solid var(--line); background: var(--surface);
  font-size: 1.7rem; font-weight: 700; color: #fff;
}
.wd-cell.filled { border-color: #fff; }
.wd-cell.green, .wd-key.green { background: var(--mint); color: var(--ink); border-color: transparent; }
.wd-cell.yellow, .wd-key.yellow { background: var(--sun); color: var(--ink); border-color: transparent; }
.wd-cell.gray, .wd-key.gray { background: #251c70; color: #cfc8ff; border-color: transparent; }
.wd-kb { display: grid; gap: 6px; width: min(100%, 360px); }
.wd-krow { display: flex; gap: 5px; justify-content: center; }
.wd-key {
  flex: 1; min-width: 0; height: 48px; padding: 0;
  border-radius: 10px; background: var(--surface-2); border: 2px solid var(--line);
  color: #fff; font-size: 1.1rem; font-weight: 700;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.wd-key.wide { flex: 1.6; font-size: 0.9rem; }
.wd-key:active { transform: translateY(3px); box-shadow: none; }

/* ---- Levels ---- */
.stage-hud { gap: 8px; align-items: center; }
.level-pill {
  flex: none; padding: 6px 12px; border-radius: 999px;
  background: var(--accent); color: var(--ink);
  font-size: 1.05rem; font-weight: 700; line-height: 1.2;
}
.level-toast {
  position: absolute; left: 50%; top: 16%; z-index: 4;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 28px; border-radius: 22px;
  background: var(--accent); color: var(--ink);
  pointer-events: none; text-align: center;
}
.level-toast b { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.level-toast span { font-size: 1rem; font-weight: 600; }
.level-toast.show { animation: toastIn 1.7s ease both; }
@keyframes toastIn {
  0% { transform: translate(-50%, -20px) scale(0.8); opacity: 0; }
  12% { transform: translate(-50%, 0) scale(1.05); opacity: 1; }
  20% { transform: translate(-50%, 0) scale(1); }
  80% { transform: translate(-50%, 0) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -10px) scale(1); opacity: 0; }
}
.level-line { font-weight: 600; color: var(--muted); font-size: 1.1rem; }
.stars { display: flex; gap: 6px; font-size: 3rem; line-height: 1; color: rgba(255, 255, 255, 0.25); }
.stars .on { color: var(--sun); animation: starPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: calc(var(--i) * 0.18s); }
@keyframes starPop { from { transform: scale(0) rotate(-40deg); } to { transform: scale(1) rotate(0); } }

.levels-card { width: min(100%, 440px); }
.lvl-grid { width: 100%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.lvl {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 58px; padding: 5px 0; border-radius: 14px;
  background: var(--surface-2); color: #fff; border: 2px solid var(--line);
  font-family: var(--font); touch-action: manipulation;
}
.lvl-n { font-size: 1.4rem; font-weight: 700; line-height: 1.1; }
.lvl-stars { font-size: 0.85rem; letter-spacing: 1px; color: var(--sun); line-height: 1; min-height: 0.85rem; }
.lvl:not(.locked):active { transform: scale(0.95); }
.lvl:not(.locked):hover, .lvl:focus-visible { border-color: var(--accent); }
.lvl.locked { opacity: 0.45; }

/* ---- Memory cards (flat, modern) ---- */
.mm-grid { display: grid; gap: 8px; width: 100%; max-width: 340px; }
.mm-card {
  aspect-ratio: 1; border-radius: 14px; border: 0;
  background: var(--surface-2); color: rgba(255, 255, 255, 0.55);
  font-size: 1.3rem; font-weight: 700; font-family: var(--font);
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
  transition: transform 0.18s, background 0.18s;
}
.mm-card:active { transform: scale(0.94); }
.mm-card.up { background: #fff; transform: scale(1.03); }
.mm-card.done { background: var(--mint); animation: mmPop 0.35s ease; }
.mm-card .e { font-size: 1.6em; line-height: 1; }
@keyframes mmPop { 50% { transform: scale(1.12); } }

/* ---- Moles (flat) ---- */
.mole-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; max-width: 300px; }
.hole {
  aspect-ratio: 1; border-radius: 50%; border: 0;
  background: #2b2080; font-size: 2.3rem; line-height: 1;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.25);
  touch-action: manipulation; transition: transform 0.1s, background 0.12s;
}
.hole.mole { background: var(--accent); animation: molePop 0.18s ease-out; }
.hole.bomb { background: var(--coral); animation: molePop 0.18s ease-out; }
.hole.hit { background: var(--mint); transform: scale(0.88); }
@keyframes molePop { from { transform: scale(0.6); } to { transform: scale(1); } }

/* Phones: make room in the top bar for the level chip + score */
@media (max-width: 480px) {
  .stage-emoji { display: none; }
  .stage-bar { gap: 6px; padding: 8px; }
  .stage-hud { gap: 6px; justify-content: flex-start; }
  .score-display { padding: 6px 12px; font-size: 1.05rem; flex: 0 1 auto; min-width: 0; }
  .level-pill { padding: 6px 10px; font-size: 1rem; }
}

/* ---- Real Drive controls: steering left, pedals right ---- */
.drive-pad { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; width: 100%; max-width: 420px; flex: none; }
.drive-grp { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.drive-row { display: flex; gap: 8px; }
.drive-cap { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); }
.ctrl-btn.drive-btn { font-family: var(--font); font-size: 1.1rem; font-weight: 700; }
.ctrl-btn.steer { background: #2f6fd6; border-color: #6aa2ff; font-size: 1.8rem; }
.ctrl-btn.brake { width: calc(var(--cb) * 1.25); background: #d94c4c; border-color: #ff8f8f; }
.ctrl-btn.gas { width: calc(var(--cb) * 1.5); height: calc(var(--cb) * 1.2); background: #2fb36d; border-color: #7be3a8; font-size: 1.3rem; }
.ctrl-btn.steer:active, .ctrl-btn.steer.pressed { background: #6aa2ff; }
.ctrl-btn.brake:active, .ctrl-btn.brake.pressed { background: #ff8f8f; color: var(--ink); }
.ctrl-btn.gas:active, .ctrl-btn.gas.pressed { background: #7be3a8; color: var(--ink); }
@media (orientation: landscape) and (max-height: 520px) {
  .drive-pad { flex-direction: column; width: auto; align-items: center; }
}

/* ---- Number Merge ---- */
.nm-board {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  width: min(100%, 320px); padding: 8px; border-radius: 20px;
  background: rgba(0, 0, 0, 0.28); touch-action: none; -webkit-user-select: none; user-select: none;
}
.nm-cell {
  aspect-ratio: 1; border-radius: 12px; background: rgba(255, 255, 255, 0.1);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--ink); line-height: 1;
}
.nm-cell.new { animation: nmNew 0.2s ease-out; }
.nm-cell.merge { animation: nmMerge 0.22s ease-out; }
@keyframes nmNew { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes nmMerge { 50% { transform: scale(1.18); } }

/* ---- Typing Racer ---- */
.tr-word { display: flex; gap: 4px; justify-content: center; font-size: 2rem; font-weight: 700; letter-spacing: 0.04em; min-height: 2.6rem; }
.tr-word span { padding: 0 3px; border-bottom: 4px solid transparent; color: rgba(255, 255, 255, 0.75); }
.tr-word .ok { color: var(--mint); }
.tr-word .now { color: #fff; border-bottom-color: var(--sun); }
.tr-word.shake { animation: shake 0.25s; }
.tr-next { color: var(--muted); font-size: 0.95rem; margin-top: -6px; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---- Code Cracker ---- */
.cc-board { display: grid; gap: 5px; width: min(100%, 340px); }
.cc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; border-radius: 14px; background: rgba(255, 255, 255, 0.08); }
.cc-row.cur { outline: 3px solid var(--sun); background: rgba(255, 255, 255, 0.16); }
.cc-secret { background: rgba(0, 0, 0, 0.3); }
.cc-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.cc-slots { display: flex; gap: 6px; }
.cc-slot {
  width: 32px; height: 32px; border-radius: 50%; background: rgba(0, 0, 0, 0.28);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); font-weight: 700; font-size: 0.95rem;
}
.cc-secret .cc-slot { color: #fff; }
.cc-fb { display: grid; grid-template-columns: repeat(3, 10px); gap: 4px; }
.cc-peg { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); display: block; }
.cc-peg.ex { background: var(--mint); }
.cc-peg.pa { background: #fff; }
.cc-pal { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.cc-col {
  width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff;
  color: var(--ink); font-weight: 700; font-size: 1.15rem;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.28); touch-action: manipulation;
}
.cc-col:active { transform: translateY(3px); box-shadow: none; }
.cc-actions { display: flex; gap: 10px; }

/* ---- Number Rush ---- */
.nr-board { display: grid; gap: 8px; width: min(100%, 340px); }
.nr-cell {
  aspect-ratio: 1; min-height: 48px; border-radius: 14px; background: #4a3cc0; color: var(--mint);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.28); font-size: 1.4rem; font-weight: 700; touch-action: manipulation;
}
.nr-cell.done { background: var(--mint); color: var(--ink); opacity: 0.35; box-shadow: none; }
.nr-cell.bad { animation: shake 0.25s; background: #d94c4c; }

/* ---- Reaction Racer ---- */
.rx-box {
  width: min(100%, 320px); height: 250px; padding: 1rem; border-radius: 28px;
  font-size: 1.6rem; font-weight: 700; color: #fff; text-align: center; line-height: 1.25;
  border: 4px solid rgba(255, 255, 255, 0.5); box-shadow: 0 8px 0 rgba(0, 0, 0, 0.28);
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.rx-box.idle { background: #4a3cc0; }
.rx-box.wait { background: #d94c4c; }
.rx-box.fake { background: #ff9f2e; color: var(--ink); }
.rx-box.go { background: #2fb36d; }
.rx-box.bad { background: #8d3a9c; }
.rx-times { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 34px; }
.rx-times span { padding: 4px 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); font-weight: 700; }
.rx-times span.bad { background: #8d3a9c; }

/* ---- Tic-Tac-Toe ---- */
.ttt-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(100%, 300px); }
.ttt-cell {
  aspect-ratio: 1; border-radius: 20px; background: #4a3cc0; box-shadow: 0 5px 0 rgba(0, 0, 0, 0.28);
  font-size: 3.2rem; font-weight: 700; line-height: 1; touch-action: manipulation;
}
.ttt-cell.x { color: var(--mint); }
.ttt-cell.o { color: var(--coral); }
.ttt-cell.pop { animation: nmNew 0.2s ease-out; }
.ttt-cell.win { background: var(--sun); color: var(--ink); }

/* ---- Number Forge ---- */
.nf-target { display: flex; align-items: baseline; gap: 10px; padding: 6px 22px; border-radius: 20px; background: rgba(0, 0, 0, 0.3); }
.nf-target span { color: var(--muted); font-weight: 600; }
.nf-target b { font-size: 2.6rem; color: var(--sun); line-height: 1.1; font-variant-numeric: tabular-nums; }
.nf-tiles { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; width: min(100%, 340px); min-height: 70px; }
.nf-tile {
  min-width: 64px; height: 64px; padding: 0 12px; border-radius: 18px; background: #4a3cc0; color: #fff;
  font-size: 1.6rem; font-weight: 700; box-shadow: 0 5px 0 rgba(0, 0, 0, 0.28); touch-action: manipulation;
}
.nf-tile.sel { background: var(--sun); color: var(--ink); transform: translateY(-3px); }
.nf-ops { display: flex; gap: 10px; }
.nf-op {
  width: 58px; height: 58px; border-radius: 50%; background: #2f6fd6; color: #fff; border: 3px solid #6aa2ff;
  font-size: 1.8rem; font-weight: 700; touch-action: manipulation;
}
.nf-op.on { background: var(--mint); color: var(--ink); border-color: #fff; }
.nf-op:disabled { opacity: 0.4; }
.nf-actions { display: flex; gap: 10px; }

/* ---- Colour Flood ---- */
.cf-pal { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* ---- Simon (levels) ---- */
.sm-board { display: grid; gap: 12px; width: min(100%, 340px); }
.sm-pad { aspect-ratio: 1; border-radius: 22px; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.28); font-size: 2rem; color: rgba(31, 22, 80, 0.55); transition: background 0.1s, transform 0.1s; touch-action: manipulation; }
.sm-board.shake { animation: shake 0.3s; }
.sm-msg { min-height: 1.6rem; font-size: 1.25rem; font-weight: 700; text-align: center; }

/* ---- Color Chaos (levels) ---- */
.cx-word { font-size: 3.2rem; font-weight: 700; text-align: center; min-height: 1.4em; margin: 6px 0 14px; letter-spacing: 0.04em; }
.cx-word.shake { animation: shake 0.25s; }
.cx-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; max-width: 340px; }
.cx-col { width: 72px; height: 72px; border-radius: 50%; border: 4px solid #fff; color: var(--ink); font-size: 1.6rem; font-weight: 700; box-shadow: 0 5px 0 rgba(0, 0, 0, 0.28); touch-action: manipulation; }
.cx-col:active { transform: translateY(4px); box-shadow: none; }

/* ---- Speed Clicker (levels) ---- */
.ck-area { position: relative; width: min(100%, 340px); height: 270px; display: flex; align-items: center; justify-content: center; }
.ck-area .big-tap.small { position: absolute; width: 110px; height: 110px; font-size: 1.4rem; }
.ck-bar { width: min(100%, 340px); height: 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); overflow: hidden; }
.ck-bar i { display: block; height: 100%; width: 0; background: var(--mint); border-radius: 999px; transition: width 0.08s; }

/* ---- Glow Grid ---- */
.gg-board { display: grid; gap: 10px; }
.gg-bulb {
  aspect-ratio: 1; border-radius: 50%; background: #2a2078; border: 4px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.3); transition: background 0.12s, transform 0.1s; touch-action: manipulation;
}
.gg-bulb.on { background: var(--sun); border-color: #fff; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.16), 0 0 0 4px rgba(255, 216, 77, 0.35); }
.gg-bulb:active { transform: scale(0.92); }

/* ---- Party Pad (group games: imposter, passbomb, mostlikely, mindmeld) ---- */
.pt-screen { width: min(100%, 360px); display: flex; flex-direction: column; align-items: center; }
.pt-card { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 18px 14px; border-radius: 24px; background: rgba(30, 14, 70, 0.72); border: 2px solid var(--line); }
.pt-emoji { font-size: 3.2rem; line-height: 1; }
.pt-h { margin: 0; font-size: 1.45rem; font-weight: 700; line-height: 1.2; }
.pt-q { font-size: 1.5rem; color: var(--sun); }
.pt-p { margin: 0; color: var(--muted); font-size: 1.05rem; line-height: 1.35; }
.pt-small { margin: 0; color: var(--muted); font-size: 0.9rem; }
.pt-ava { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink); font-weight: 700; border: 3px solid #fff; flex: none; font-size: 1.05em; }
.pt-count { display: flex; align-items: center; gap: 18px; }
.pt-count div { display: flex; flex-direction: column; min-width: 70px; }
.pt-count b { font-size: 2.2rem; line-height: 1; }
.pt-count span { color: var(--muted); font-size: 0.9rem; }
.pt-step { width: 52px; height: 52px; border-radius: 50%; font-size: 1.8rem; font-weight: 700; background: var(--pink); color: var(--ink); box-shadow: var(--pop); touch-action: manipulation; }
.pt-step:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.28); }
.pt-names { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pt-name { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, 0.1); border-radius: 14px; padding: 4px 8px 4px 4px; min-width: 0; }
.pt-name input { flex: 1; min-width: 0; width: 100%; background: none; border: 0; color: #fff; font: inherit; font-size: 1rem; padding: 8px 4px; outline: none; }
.pt-name input::placeholder { color: rgba(255, 255, 255, 0.55); }
.pt-name:focus-within { background: rgba(255, 255, 255, 0.2); }
.pt-opt { width: 100%; display: flex; flex-direction: column; gap: 6px; align-items: center; color: var(--muted); font-size: 0.95rem; }
.pt-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pt-chip { min-height: 44px; padding: 0 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); border: 2px solid var(--line); color: #fff; font-weight: 600; touch-action: manipulation; }
.pt-chip.on { background: var(--pink); color: var(--ink); border-color: #fff; }

/* ---- Crash Arena land (js/core/versus.js): set-up dots and the one-big-button-per-player pad ---- */
.vs-sub { font-size: 0.9rem; margin-top: -6px; }
.vs-who { display: flex; gap: 8px; justify-content: center; }
.vs-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #1f1650; font-weight: 700; font-size: 1.1rem; border: 2px solid rgba(255, 255, 255, 0.6); }
.vs-pad { display: grid; gap: 8px; width: min(100%, 360px); margin: 10px auto 0; grid-template-columns: repeat(var(--n, 2), 1fr); }
.vs-n1 { --n: 1; } .vs-n2 { --n: 2; } .vs-n3 { --n: 3; } .vs-n4 { --n: 4; }
.vs-btn { min-height: 64px; border-radius: 20px; border: 3px solid; color: #1f1650; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3); touch-action: none; user-select: none; -webkit-user-select: none; font-family: inherit; padding: 4px; }
.vs-btn b { font-size: 1rem; line-height: 1.1; }
.vs-btn small { font-size: 0.7rem; opacity: 0.7; }
.vs-btn.pressed { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); }
.vs-btn.vs-big { min-height: 96px; }
.vs-n4 .vs-btn b, .vs-n3 .vs-btn b { font-size: 0.85rem; }
@media (hover: none) { .vs-btn small { display: none; } }
.pt-pass .pt-who { font-size: 2rem; }
.pt-cover { width: 100%; min-height: 160px; border-radius: 20px; background: repeating-linear-gradient(45deg, #5a2a8f, #5a2a8f 14px, #6c36a8 14px, #6c36a8 28px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; border: 3px dashed #fff; }
.pt-cover span { font-size: 2.4rem; }
.pt-cover b { font-size: 1.25rem; }
.pt-cover small { color: var(--muted); }
.pt-reveal { width: 100%; border-radius: 20px; padding: 18px 12px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.pt-reveal.good { background: var(--mint); color: var(--ink); }
.pt-reveal.bad { background: var(--coral); color: var(--ink); }
.pt-reveal b { font-size: 1.5rem; }
.pt-word { font-size: 2.2rem !important; }
.pt-timer { font-size: 2.2rem; font-weight: 700; color: var(--sun); }
.pt-pick { width: 100%; display: grid; grid-template-columns: 1fr; gap: 8px; }
.pt-pick.pt-two { grid-template-columns: 1fr 1fr; }
.pt-pill { min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.14); border: 2px solid var(--line); color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); touch-action: manipulation; font-size: 1.05rem; }
.pt-pill:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); background: rgba(255, 255, 255, 0.3); }
.pt-bomb-ico { font-size: 5rem; display: inline-block; }
.pt-pulse { animation: pt-pulse 0.3s; }
@keyframes pt-pulse { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
.pt-bang { font-size: 5rem; animation: pt-pulse 0.5s; }
.pt-topic { margin: 0; font-size: 1.35rem; font-weight: 700; color: var(--sun); }
.pt-holder { display: flex; align-items: center; gap: 10px; }
.pt-passbtn { width: 100%; min-height: 84px; font-size: 2rem; background: var(--mint); }
.pt-dare { width: 100%; background: var(--sun); color: var(--ink); border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.pt-dare b { font-size: 1.15rem; }
.pt-winner { background: var(--sun); color: var(--ink); font-weight: 700; font-size: 1.25rem; border-radius: 999px; padding: 8px 18px; }
.pt-board { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.pt-row-s { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.1); border-radius: 12px; padding: 5px 10px; text-align: left; }
.pt-row-s b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pt-row-s em { font-style: normal; font-weight: 700; color: var(--sun); max-width: 45%; text-align: right; font-size: 0.9rem; }
.pt-pos { width: 24px; text-align: center; color: var(--muted); }
.pt-bar { flex: 1; height: 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); overflow: hidden; }
.pt-bar i { display: block; height: 100%; background: var(--mint); border-radius: 999px; }

/* ---- Game Night: chess + checkers boards ---- */
.ch-wrap { width: min(100%, 600px); margin: 0 auto; display: flex; flex-direction: column; gap: 4px; }
.ch-board { container-type: inline-size; display: grid; grid-template-columns: repeat(8, 1fr); border-radius: 6px; overflow: hidden; border: 3px solid #302e2b; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
.ch-sq { position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 0; touch-action: manipulation; }
.ch-sq.lt { background: #f8f5ee; } .ch-sq.dk { background: #9a6a42; }
.ch-sq.lastf.lt { background: #c9edb4; } .ch-sq.lastf.dk { background: #7d9a45; }
.ch-sq.lastt.lt { background: #a8e08a; } .ch-sq.lastt.dk { background: #6fae3a; }
.ch-sq.sel.lt, .ch-sq.sel.dk { background: #3fcf6e; }
.ch-sq.hint { box-shadow: inset 0 0 0 4px #3da5ff; }
.ch-sq.chk { background: radial-gradient(circle, #ff3b3b 0%, #e02a2a 38%, rgba(224, 42, 42, 0) 78%), #f8f5ee; }
.ch-sq.chk.dk { background: radial-gradient(circle, #ff3b3b 0%, #e02a2a 38%, rgba(224, 42, 42, 0) 78%), #9a6a42; }
.ch-sq.tgt::after { content: ""; position: absolute; width: 34%; height: 34%; border-radius: 50%; background: #1fb85a; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55); pointer-events: none; }
.ch-sq.tgt.cap::after { width: 100%; height: 100%; border-radius: 0; box-shadow: none; background: radial-gradient(circle, transparent 56%, #1fb85a 58%); }
.ch-rk, .ch-fl { position: absolute; font: 700 clamp(0.62rem, 2.6cqw, 0.85rem)/1 "Fredoka", system-ui, sans-serif; pointer-events: none; }
.ch-rk { top: 3px; left: 4px; } .ch-fl { bottom: 2px; right: 4px; }
.ch-sq.lt .ch-rk, .ch-sq.lt .ch-fl { color: #8a5a34; } .ch-sq.dk .ch-rk, .ch-sq.dk .ch-fl { color: #f8f5ee; }
.ch-pc { font-size: clamp(1.9rem, 10.6cqw, 4.6rem); line-height: 1; font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", "Apple Symbols", sans-serif; paint-order: stroke fill; pointer-events: none; filter: drop-shadow(0 2px 1.5px rgba(0, 0, 0, 0.4)); }
/* white side: ivory pieces with a dark outline; black side: near-black pieces with a thin light outline (readable on both square colours) */
.ch-pc.w { color: #fffef6; -webkit-text-stroke: 0.07em #1d1b19; }
.ch-pc.b { color: #1b1a18; -webkit-text-stroke: 0.045em #d9d4c4; }
.ch-strip { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 3px 8px; margin: 0; border-radius: 10px; background: rgba(20, 10, 80, 0.45); color: #fff; font-weight: 700; }
.ch-strip.on { background: rgba(255, 216, 77, 0.22); box-shadow: inset 0 0 0 2px #ffd84d; }
.ch-av { font-size: 1.3rem; } .ch-nm { font-size: 0.95rem; white-space: nowrap; }
.ch-cap { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0; line-height: 1; overflow: hidden; }
.ch-cap em { font-style: normal; font-size: 0.85rem; margin-left: 6px; color: #8ff0b4; }
.ch-cp { font-size: 1.15rem; margin-right: -3px; font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", "Apple Symbols", sans-serif; paint-order: stroke fill; }
.ch-cp.w { color: #fffef6; -webkit-text-stroke: 1.2px #1d1b19; } .ch-cp.b { color: #1b1a18; -webkit-text-stroke: 1px #d9d4c4; }
.ch-pre > :not(.ch-bwrap), .ch-pre .ch-board { display: none; }
.ch-pre .ch-start { position: static; padding: 0; background: none; overflow: visible; }
.ch-pre .ch-scard { gap: 8px; padding: 14px; }
.ch-pre .ch-scard h4 { font-size: 1.3rem; }
.ch-pre .ch-scard .ch-chip { height: 38px; font-size: 0.95rem; }
.ch-start[hidden], .ch-promo[hidden], .ch-offer[hidden], { display: none; }
.ch-lab { display: block; color: #fff; font-weight: 700; font-size: 0.95rem; text-align: left; }
.ch-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-start { position: absolute; inset: 0; z-index: 7; display: flex; align-items: center; justify-content: center; padding: 6px; background: rgba(15, 8, 60, 0.82); border-radius: 6px; overflow: auto; }
.ch-scard { width: 100%; max-height: 100%; display: grid; gap: 4px; padding: 8px 10px; border-radius: 18px; background: #2a1a8c; border: 3px solid #ffd84d; }
.ch-scard h4 { margin: 0; font-size: 1.05rem; color: #ffd84d; text-align: center; }
.ch-scard .ch-chip { height: 32px; padding: 0 10px; font-size: 0.88rem; }
.ch-scard .btn { margin-top: 2px; min-height: 44px; padding: 0 16px; font-size: 1.1rem; }
.ch-bwrap { position: relative; }
.ch-promo { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; background: rgba(15, 8, 60, 0.7); border-radius: 6px; }
.ch-pcard { display: grid; gap: 8px; justify-items: center; padding: 12px; border-radius: 16px; background: #2a1a8c; border: 3px solid #ffd84d; color: #fff; }
.ch-pcard > div { display: flex; gap: 8px; }
.ch-pcard button { width: 56px; height: 56px; border-radius: 12px; border: 0; background: #9a6a42; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ch-pcard .ch-pc { font-size: 2.4rem; filter: none; }
.ch-status { text-align: center; font-weight: 700; font-size: 0.95rem; min-height: 1.3em; color: #fff; }
.ch-moves { display: flex; gap: 6px; align-items: baseline; overflow-x: auto; white-space: nowrap; scrollbar-width: none; min-height: 28px; padding: 3px 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.28); color: #fff; font-size: 0.88rem; }
.ch-moves::-webkit-scrollbar { display: none; }
.ch-moves b { color: #ffd84d; margin-left: 4px; } .ch-moves span { font-weight: 600; } .ch-moves small { color: var(--muted); }
.ch-offer { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: #2a1a8c; border: 2px solid #ffd84d; color: #fff; font-weight: 700; }
.ch-offer span { flex: 1; } .ch-offer button { height: 34px; padding: 0 12px; border: 0; border-radius: 10px; font: 700 0.9rem "Fredoka", sans-serif; cursor: pointer; background: #ffd84d; color: #2a1a8c; }
.ch-btns { display: flex; gap: 6px; }
.ch-btns button { flex: 1; min-width: 0; height: 42px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, 0.18); color: #fff; font: 700 0.72rem/1 "Fredoka", sans-serif; cursor: pointer; }
.ch-btns button i { font-style: normal; font-size: 1.1rem; }
.ch-btns button:disabled { opacity: 0.4; cursor: default; }
.ch-time { flex: none; min-width: 64px; text-align: center; padding: 4px 8px; border-radius: 8px; background: #1b1a18; color: #fff; font: 700 1.15rem/1 "Fredoka", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.ch-time.low { background: #c92a2a; animation: pt-pulse 0.8s infinite; }
.ch-chip { flex: none; padding: 0 11px; height: 30px; border: 2px solid rgba(255, 255, 255, 0.3); border-radius: 999px; background: rgba(20, 10, 80, 0.45); color: #fff; font: 600 0.82rem "Fredoka", sans-serif; cursor: pointer; }
.ch-chip.on { background: #ffd84d; border-color: #ffd84d; color: #2a1a8c; }
.dr-pc { width: 74%; height: 74%; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35), inset 0 0 0 4px rgba(255, 255, 255, 0.25); font-size: 1.3rem; }
.dr-pc.w { background: #fff7e0; color: #b5763d; } .dr-pc.b { background: #d94c4c; color: #ffd84d; }
.ch-sq.can .dr-pc { animation: pt-pulse 1.2s infinite; }

/* ---- Tycoon Trail ---- */
.tt-wrap { width: min(100%, 344px); }
.tt-board { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(7, 1fr); gap: 2px; aspect-ratio: 1; background: #3a1c0c; border: 4px solid #3a1c0c; border-radius: 14px; }
.tt-t { position: relative; background: #fff4dc; color: #3a1c0c; border-radius: 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; line-height: 1; min-width: 0; }
.tt-t.plain { background: #ffe4b0; } .tt-t.corner { background: #ffd47a; }
.tt-band { position: absolute; left: 0; right: 0; top: 0; height: 5px; }
.tt-e { font-size: 1.1rem; font-weight: 400; } .tt-t small { font-size: 0.5rem; font-weight: 700; margin-top: 2px; }
.tt-t u { display: flex; align-items: center; justify-content: center; font-size: 0.5rem; text-decoration: none; color: var(--ink); position: absolute; left: 2px; bottom: 2px; width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid #3a1c0c; }
.tt-tok { position: absolute; inset: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1px; background: rgba(255, 255, 255, 0.35); }
.tt-tok { background: rgba(255, 255, 255, 0.55); outline: 2px solid #1f1650; outline-offset: -2px; z-index: 1; }
.tt-tok em { display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 700; font-size: 0.55rem; color: var(--ink); width: 18px; height: 18px; border-radius: 50%; border: 2px solid #1f1650; }
.tt-tok em.me { width: 30px; height: 18px; border-radius: 9px; border-color: #fff; box-shadow: 0 0 0 2px #1f1650; font-size: 0.5rem; }
.tt-mid { grid-area: 2 / 2 / 7 / 7; background: rgba(30, 14, 70, 0.9); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 4px; color: #fff; text-align: center; min-height: 0; }
.tt-players { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.tt-pl { display: flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, 0.1); border-radius: 8px; padding: 2px 5px; font-size: 0.68rem; white-space: nowrap; }
.tt-pl i { width: 9px; height: 9px; border-radius: 50%; flex: none; } .tt-pl b { margin-left: auto; color: var(--sun); }
.tt-pl.on { background: rgba(255, 216, 77, 0.3); outline: 2px solid var(--sun); } .tt-pl.out { opacity: 0.35; text-decoration: line-through; }
.tt-dice { display: flex; gap: 8px; align-items: center; }
.tt-dice strong { font-size: 1.5rem; color: var(--sun); min-width: 1.6em; }
.tt-die { width: 44px; height: 44px; border-radius: 10px; background: #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 6px; gap: 1px; }
.tt-die i { border-radius: 50%; } .tt-die i.on { background: #1f1650; }
.tt-at { display: flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 700; background: rgba(255, 255, 255, 0.14); border-radius: 999px; padding: 2px 8px; }
.tt-at i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; flex: none; }
.tt-d { font-style: normal; font-weight: 700; border-radius: 6px; padding: 0 4px; color: var(--ink); } .tt-d.up { background: var(--mint); } .tt-d.dn { background: var(--coral); }
.tt-pl.mine { border: 1.5px solid #fff; }
.tt-pl i { display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 0.42rem; font-weight: 700; color: var(--ink); width: 14px !important; height: 14px !important; }
.tt-pl.mine i { width: 22px !important; border-radius: 8px; }
.tt-msg { margin: 0; font-size: 0.74rem; line-height: 1.2; min-height: 2.4em; }
.tt-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; min-height: 36px; }
.tt-btn { min-height: 38px; padding: 0 12px; font-size: 0.85rem; }

/* ---- Cards (Crazy Eights, Twenty-One) ---- */
.cd-table { width: min(100%, 360px); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cd { position: relative; width: 46px; height: 64px; border-radius: 8px; background: #fff; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3); padding: 0; flex: none; touch-action: manipulation; }
.cd b { font-size: 1.15rem; line-height: 1; } .cd i { font-style: normal; font-size: 1.1rem; line-height: 1; }
.cd.r { color: #d93a4a; } .cd.k { color: #1f1650; }
.cd.back { background: repeating-linear-gradient(45deg, #5a3bc4, #5a3bc4 6px, #7a5be0 6px, #7a5be0 12px); color: #fff; border: 3px solid #fff; }
.cd.back b { font-size: 1.6rem; }
.cd.back i { position: absolute; bottom: 2px; right: 4px; font-size: 0.7rem; color: #fff; }
.cd.big { width: 62px; height: 86px; } .cd.big b { font-size: 1.6rem; } .cd.big i { font-size: 1.5rem; }
.cd.sm { width: 40px; height: 56px; } .cd.sm b { font-size: 1rem; } .cd.sm i { font-size: 0.95rem; }
.cd.ok { box-shadow: 0 0 0 3px var(--sun), 0 3px 0 rgba(0, 0, 0, 0.3); transform: translateY(-8px); }
.cd-hand { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding-top: 8px; }
.cd-hand .cd { margin-left: -10px; } .cd-hand .cd:first-child { margin-left: 0; }
.cd-opps { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.cd-opp { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, 0.1); border-radius: 12px; padding: 4px 10px; font-size: 0.9rem; }
.cd-opp.on { outline: 2px solid var(--sun); background: rgba(255, 216, 77, 0.25); } .cd-minis { display: flex; } .cd-minis i { width: 12px; height: 18px; border-radius: 3px; border: 2px solid #fff; background: #7a5be0; margin-left: -5px; } .cd-minis i:first-child { margin-left: 0; } .cd-opp em { font-style: normal; color: var(--sun); font-weight: 700; }
.cd-mid { display: flex; align-items: center; gap: 22px; }
.cd-top { display: flex; align-items: center; gap: 10px; } .cd-suit { font-size: 2.2rem; background: #fff; border-radius: 50%; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; }
.cd-suit.r { color: #d93a4a; } .cd-suit.k { color: #1f1650; }
.cd-msg { margin: 0; min-height: 1.5em; text-align: center; font-weight: 600; color: var(--sun); }
.cd-pick { display: flex; gap: 8px; } .cd-pick .btn { font-size: 1.6rem; min-width: 56px; } .cd-pick .btn.r { color: #ff7a8a; }
.cd-row { width: 100%; text-align: center; } .cd-row h4 { margin: 0 0 6px; font-weight: 600; color: var(--muted); } .cd-row h4 b { color: var(--sun); }
.cd-cards { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 58px; }

/* ===== Online Games (js/core/online.js) ===== */
.on-root { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.on-card { width: min(100%, 360px); display: grid; gap: 10px; justify-items: stretch; text-align: center; padding: 16px; border-radius: 24px; background: rgba(255, 255, 255, 0.12); border: 3px solid rgba(255, 255, 255, 0.35); }
.on-card h3 { font-size: 1.5rem; } .on-card p { margin: 0; color: var(--muted); }
.on-note { font-size: 0.9rem; } .on-info { font-weight: 700; font-size: 1.05rem; min-height: 1.4em; }
.on-lv { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.on-chip { flex: 1; min-height: 42px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 700; border: 2px solid transparent; }
.on-chip.on { background: var(--sun); color: var(--ink); }
.on-code { font-size: 3.2rem; font-weight: 700; letter-spacing: 0.25em; padding: 8px 0 8px 0.25em; border-radius: 18px; background: #1d1466; color: var(--sun); }
.on-join { display: flex; gap: 8px; } .on-join input { flex: 1; min-width: 0; min-height: 52px; padding: 0 12px; text-align: center; font: inherit; font-size: 1.6rem; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; border-radius: 14px; border: 3px solid rgba(255, 255, 255, 0.35); background: #1d1466; color: #fff; }
.on-board { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.on-over { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(15, 8, 60, 0.82); border-radius: 18px; z-index: 5; padding: 12px; }
.c4 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 10px; width: min(100%, 360px); border-radius: 18px; background: #2a5db8; box-shadow: var(--pop); }
.c4-col { display: grid; gap: 6px; padding: 0; border: 0; background: none; touch-action: manipulation; }
.c4-col:disabled { opacity: 1; }
.c4-cell { display: block; aspect-ratio: 1; border-radius: 50%; background: #12286a; }
.c4-cell.r { background: #ff5a5a; } .c4-cell.y { background: #ffd84d; } .c4-cell.win { box-shadow: 0 0 0 4px #fff; }
.tr { color: #ff7a7a; } .ty { color: var(--sun); }
.on-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; text-align: left; } .on-list li { padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.12); font-weight: 600; }
.imp-card { text-align: left; } .imp-card h3 { text-align: center; } .imp-word { font-size: 2.2rem; letter-spacing: 0.02em; text-align: center; color: var(--mint); }
.imp-votes { display: grid; gap: 8px; } .imp-votes .btn.on { background: var(--sun); color: var(--ink); }
/* join-room / clue form: the input must be allowed to shrink so the card fits a phone */
.on-card { box-sizing: border-box; min-width: 0; max-width: 100%; }
.on-card > * { min-width: 0; }
.on-join { width: 100%; min-width: 0; }
.on-join input { flex: 1 1 0; width: 0; min-width: 0; font-size: 1.4rem; letter-spacing: 0.2em; }
.on-join .btn { flex: none; }
.ctrl-btn.ctrl-off { opacity: 0.5; }

/* ---- Quiz games (quiz page): Brain Battle (.bb), Globe Trail (.gt), Kick-Off Quiz (.kq) ---- */
.bb, .gt { display: flex; flex-direction: column; gap: 10px; width: min(100%, 430px); margin: 0 auto; padding: 6px 4px 10px; color: #fff; }
.bb-arena { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 6px; }
.bb-fighter { position: relative; text-align: center; }
.bb-fighter b { display: block; font-size: 0.95rem; }
.bb-emo { display: inline-block; font-size: calc(56px * var(--ts, 1)); line-height: 1.1; }
.bb-foe .bb-emo { transform: scaleX(-1); }
.bb-vs { font-weight: 700; font-size: 1.3rem; color: #ffd84d; padding-bottom: 28px; }
.bb-hp { height: 12px; margin-top: 4px; border-radius: 99px; background: rgba(0, 0, 0, 0.35); overflow: hidden; }
.bb-hp i { display: block; height: 100%; width: 100%; background: #4ee3a0; transition: width 0.4s; }
.bb-hp i.low { background: #ff6b6b; }
.bb-hp-foe i { background: #ff9f2e; }
.bb-timer { height: 8px; border-radius: 99px; background: rgba(0, 0, 0, 0.3); overflow: hidden; }
.bb-timer i { display: block; height: 100%; width: 100%; background: #46c8ff; transition: width 0.1s linear; }
.bb-timer i.hot { background: #ff6b6b; }
.bb-q { background: rgba(255, 255, 255, 0.13); border-radius: 20px; padding: 12px 14px; text-align: center; }
.bb-q small { opacity: 0.8; font-weight: 600; }
.bb-q h3 { margin: 4px 0 0; font-size: 1.3rem; line-height: 1.25; }
.bb-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bb-opt { min-height: 58px; padding: 8px 10px; border: 0; border-radius: 16px; background: #fff; color: #2a1a8c; font: 600 1.05rem Fredoka, sans-serif; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); cursor: pointer; }
.bb-opt:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.bb-opt:disabled { cursor: default; opacity: 0.85; }
.bb-opt.right { background: #4ee3a0; opacity: 1; }
.bb-opt.wrong { background: #ff6b6b; color: #fff; opacity: 1; }
.bb-note { min-height: 1.5em; text-align: center; font-weight: 600; }
.bb-pop { position: absolute; left: 50%; top: 0; transform: translateX(-50%); font-weight: 700; font-size: 1.7rem; color: #ffd84d; -webkit-text-stroke: 2px #2a1a8c; paint-order: stroke fill; pointer-events: none; animation: bbpop 0.9s ease-out forwards; }
.bb-pop.power { color: #ff9f2e; font-size: 2.2rem; }
.bb-pop.bad { color: #ff6b6b; }
@keyframes bbpop { from { opacity: 1; top: 10px; } to { opacity: 0; top: -34px; } }
.shake { animation: bbshake 0.4s; }
.lunge-r { animation: bblr 0.4s; }
.lunge-l { animation: bbll 0.4s; }
@keyframes bbshake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes bblr { 50% { transform: translateX(48px) scale(1.2); } }
@keyframes bbll { 50% { transform: scaleX(-1) translateX(48px) scale(1.2); } }
.gt-steps { display: flex; justify-content: center; gap: 6px; }
.gt-steps i { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, 0.25); }
.gt-steps i.done { background: #4ee3a0; }
.gt-steps i.now { background: #ffd84d; box-shadow: 0 0 0 3px rgba(255, 216, 77, 0.35); }
.gt-clues { display: grid; gap: 6px; }
.gt-clue { margin: 0; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.13); font-size: 1.05rem; line-height: 1.3; }
.gt-clue b { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 6px; border-radius: 50%; background: #ffd84d; color: #2a1a8c; font-size: 0.85rem; }
.gt-clue.new { background: rgba(255, 216, 77, 0.22); animation: bbpop2 0.4s; }
@keyframes bbpop2 { from { transform: scale(0.96); opacity: 0.4; } to { transform: none; opacity: 1; } }
.gt-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gt-opt { min-height: 58px; padding: 6px 8px; border: 0; border-radius: 16px; background: #fff; color: #2a1a8c; font: 600 1rem Fredoka, sans-serif; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); cursor: pointer; display: grid; gap: 1px; align-content: center; }
.gt-opt small { font-weight: 500; opacity: 0.7; font-size: 0.8rem; }
.gt-opt.off { background: rgba(255, 255, 255, 0.25); color: rgba(255, 255, 255, 0.6); text-decoration: line-through; box-shadow: none; }
.gt-more { align-self: center; }
.gt-result { background: #fff5d6; color: #2a1a8c; border-radius: 22px; padding: 12px; display: grid; gap: 8px; text-align: center; }
.gt-result[hidden] { display: none; }
.gt-found { display: flex; align-items: center; gap: 10px; text-align: left; }
.gt-found div { flex: 1; display: grid; }
.gt-found small { opacity: 0.7; }
.gt-e { font-size: 2.2rem; }
.gt-found em { font-style: normal; font-weight: 700; font-size: 1.3rem; }
.gt-fact { margin: 0; font-size: 0.98rem; line-height: 1.35; }
.kq-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kq-top span { margin-left: auto; font-weight: 600; opacity: 0.85; }
.kq-timer { height: 8px; border-radius: 99px; background: rgba(0, 0, 0, 0.3); overflow: hidden; margin-bottom: 10px; }
.kq-timer i { display: block; height: 100%; width: 100%; background: #4ee3a0; transition: width 0.1s linear; }
.kq-timer i.late { background: #8d82c9; }
.kq-res { font-size: 1.6rem; font-weight: 700; text-align: center; margin-bottom: 4px; }
.kq-res.ok { color: #4ee3a0; } .kq-res.no { color: #ff6b6b; }
.kq-fact { text-align: center; font-size: 0.98rem; opacity: 0.9; margin: 4px 0 10px; }
.on-fr { display: grid; gap: 8px; margin: 4px 0; } .on-fr small { opacity: 0.8; }
.on-fr-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: rgba(255,255,255,0.12); border-radius: 14px; padding: 8px 8px 8px 14px; }
.nudge { font-weight: 600; margin: 2px 0; } .top-line { font-size: 0.95rem; opacity: 0.85; }

/* ---- Quiz Quest, Word Wonder, Number Park, Cosy Corner ---- */
.tv, .wd, .bk { display: flex; flex-direction: column; gap: 10px; width: min(100%, 430px); margin: 0 auto; padding: 6px 4px 10px; color: #fff; }
.tv-top { display: flex; justify-content: space-between; font-weight: 600; opacity: 0.9; }
.mg-q { font-size: 1.6rem !important; letter-spacing: 0.02em; }
.wd-slots { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; min-height: 52px; }
.wd-slot { width: 40px; height: 48px; border-radius: 10px; border: 0; background: rgba(255,255,255,0.18); border-bottom: 4px solid rgba(255,255,255,0.5); color: #fff; font: 700 1.5rem Fredoka, sans-serif; }
.wd-slot.on { background: #fff; color: #2a1a8c; }
.wd-slots.ok .wd-slot { background: #4ee3a0; color: #0b3a26; } .wd-slots.bad { animation: wdshake 0.4s; }
@keyframes wdshake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.wd-tiles { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.wd-tile { width: 48px; height: 52px; border: 0; border-radius: 12px; background: #fff; color: #2a1a8c; font: 700 1.5rem Fredoka, sans-serif; box-shadow: 0 4px 0 rgba(0,0,0,0.25); cursor: pointer; }
.wd-tile:disabled { opacity: 0.25; box-shadow: none; }
.wd-btns { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.hg-hearts { text-align: center; font-size: 1.5rem; min-height: 1.6em; }
.hg-word { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.hg-l { width: 34px; height: 44px; border-bottom: 4px solid #fff; text-align: center; font: 700 1.7rem/calc(44px * var(--ts, 1)) Fredoka, sans-serif; }
.hg-keys { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.hg-k { min-height: 44px; border: 0; border-radius: 10px; background: #fff; color: #2a1a8c; font: 700 1.1rem Fredoka, sans-serif; box-shadow: 0 3px 0 rgba(0,0,0,0.25); cursor: pointer; }
.hg-k.ok { background: #4ee3a0; } .hg-k.no { background: #ff6b6b; color: #fff; } .hg-k:disabled { cursor: default; }
.bk { position: relative; align-items: center; }
.bk-count { text-align: center; } .bk-count b { display: block; font-size: 2rem; } .bk-count small { opacity: 0.85; }
.bk-cookie { font-size: 6.5rem; line-height: 1; background: none; border: 0; cursor: pointer; padding: 4px; transition: transform 0.08s; }
.bk-cookie.bump { transform: scale(0.9); } .bk-cookie:active { transform: scale(0.92); }
.bk-note { min-height: 1.4em; font-weight: 600; text-align: center; }
.bk-shop { display: grid; gap: 8px; width: 100%; }
.bk-item { display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 12px; border: 0; border-radius: 14px; background: #fff; color: #2a1a8c; font-family: Fredoka, sans-serif; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,0.25); }
.bk-item:disabled { opacity: 0.5; cursor: default; } .bk-e { font-size: 1.7rem; } .bk-t { flex: 1; display: grid; } .bk-t small { opacity: 0.7; } .bk-c { font-weight: 700; text-align: right; } .bk-c small { display: block; font-weight: 500; opacity: 0.7; }
.bk-pop { position: absolute; pointer-events: none; font-weight: 700; font-size: 1.3rem; animation: bkup 0.8s forwards; }
@keyframes bkup { to { transform: translateY(-40px); opacity: 0; } }
.bk-gold { position: absolute; font-size: 3rem; background: none; border: 0; cursor: pointer; animation: bkgold 1s infinite alternate; }
@keyframes bkgold { to { transform: scale(1.2) rotate(10deg); } }
.pp-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 8px; width: min(100%, 430px); margin: 0 auto; }
.pp-c { width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.6); cursor: pointer; } .pp-c.on { border-color: #fff; transform: scale(1.2); box-shadow: 0 0 0 3px #1f1650; }
.pp-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }

.go-loading { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: rgba(20, 10, 60, 0.92); color: #fff; font-family: Fredoka, sans-serif; text-align: center; }
.go-card { display: grid; gap: 12px; justify-items: center; padding: 24px; max-width: 320px; }
.go-emoji { font-size: 4rem; } .go-card b { font-size: 1.6rem; } .go-card small { opacity: 0.85; font-size: 1rem; }
.go-spin { width: 44px; height: 44px; border-radius: 50%; border: 5px solid rgba(255,255,255,0.25); border-top-color: #ffd84d; animation: gospin 0.9s linear infinite; }
@keyframes gospin { to { transform: rotate(360deg); } }

/* ===== family games (emojifamilies.js, wordfamilies.js, mathfamily.js, blockfamily.js) ===== */
.fx { width: 100%; max-width: 380px; margin: 0 auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.fx-msg { font: 700 calc(22px * var(--ts, 1)) Fredoka, sans-serif; color: #fff; text-align: center; min-height: 30px; }
.fx-grid { width: 100%; display: grid; gap: 8px; }
.fx-cell { aspect-ratio: 1; border: 0; border-radius: 14px; background: rgba(255,255,255,.16); font-size: inherit; line-height: 1; padding: 0; cursor: pointer; touch-action: manipulation; }
.fx-cell:active { background: rgba(255,255,255,.3); }
.fx-cell.bad { background: rgba(255,80,80,.5); }
.fx-field { width: 100%; min-height: 220px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-content: center; font-size: calc(30px * var(--ts, 1)); padding: 10px; background: rgba(255,255,255,.12); border-radius: 16px; }
.fx-field span { display: inline-block; line-height: 1.1; }
.fx-ans { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fx-a { font-size: calc(26px * var(--ts, 1)); padding: 14px 0; }
.fx-a.good { background: #3ddc84 !important; color: #06361a !important; }
.fx-a.bad { background: #ff6b6b !important; color: #fff !important; }
.fx-4 { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fx-pad { aspect-ratio: 1; border: 0; border-radius: 22px; background: rgba(255,255,255,.2); font-size: calc(56px * var(--ts, 1)); cursor: pointer; touch-action: manipulation; transition: transform .1s, background .1s; }
.fx-pad.on { background: #ffd84d; transform: scale(.94); box-shadow: 0 0 22px #ffd84d; }
.fx-popfield { position: relative; width: 100%; aspect-ratio: 4 / 5; background: rgba(255,255,255,.12); border-radius: 18px; overflow: hidden; touch-action: manipulation; }
.fx-pp { position: absolute; width: 17%; aspect-ratio: 1; border: 0; padding: 0; border-radius: 50%; background: rgba(255,255,255,.28); font-size: 8vw; line-height: 1; cursor: pointer; animation: fxpop linear forwards; touch-action: manipulation; }
.fx-pp.bad { box-shadow: 0 0 0 3px #ff4d4d inset; }
@keyframes fxpop { 0% { transform: scale(.2); } 12% { transform: scale(1.1); } 22% { transform: scale(1); } 85% { transform: scale(1); opacity: 1; } 100% { transform: scale(.5); opacity: 0; } }
@media (min-width: 420px) { .fx-pp { font-size: calc(30px * var(--ts, 1)); } }
/* word families */
.fx-ws { width: 100%; display: grid; gap: 2px; touch-action: none; user-select: none; -webkit-user-select: none; }
.fx-ws i { font-style: normal; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.18); border-radius: 6px; font: 700 calc(15px * var(--ts, 1)) Fredoka, sans-serif; color: #fff; }
.fx-ws i.sel { background: #ffd84d; color: #3a2d00; }
.fx-ws i.found { background: #3ddc84; color: #06361a; }
.fx-wl { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; font: 600 calc(13px * var(--ts, 1)) Fredoka, sans-serif; color: #fff; }
.fx-wl b { padding: 3px 8px; border-radius: 10px; background: rgba(255,255,255,.18); }
.fx-wl b.done { background: #3ddc84; color: #06361a; text-decoration: line-through; }
.fx-slots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.fx-slots i { font-style: normal; width: 34px; height: 42px; border-radius: 8px; background: rgba(255,255,255,.2); color: #fff; font: 700 calc(24px * var(--ts, 1))/42px Fredoka, sans-serif; text-align: center; }
.fx-keys { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.fx-keys button { width: 40px; height: 44px; border: 0; border-radius: 10px; background: #fff; color: #3a2d9c; font: 700 calc(20px * var(--ts, 1)) Fredoka, sans-serif; cursor: pointer; touch-action: manipulation; }
.fx-keys button.used { opacity: .3; }
.fx-keys button.bad { background: #ff6b6b; color: #fff; }
.fx-hang { font-size: calc(34px * var(--ts, 1)); letter-spacing: 4px; }
/* block puzzle */
.bk { width: 100%; max-width: 380px; margin: 0 auto; padding: 6px 10px; display: flex; flex-direction: column; gap: 10px; align-items: center; touch-action: none; user-select: none; -webkit-user-select: none; }
.bk canvas { width: 100%; height: auto; display: block; touch-action: none; }

/* ---- Likes (heart + count) ---- */
.like-row { display: flex; justify-content: center; margin: 4px 0; }
.like-row:empty { display: none; }
.like-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 2px solid rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.12); color: #fff; font: 700 1rem "Fredoka", sans-serif; cursor: pointer; }
.like-btn .like-h { font-size: 1.3rem; transition: transform 0.15s; }
.like-btn.on { background: rgba(255, 107, 129, 0.28); border-color: #ff6b81; }
.like-btn.on .like-h { transform: scale(1.2); }
.like-btn:active .like-h { transform: scale(1.4); }
.like-n:empty { display: none; }

/* Imposter Online: pick-a-clue grid */
.imp-clues { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-height: 46vh; overflow-y: auto; }
.imp-clues .btn { min-height: 42px; padding: 0 6px; font-size: 0.9rem; }
.imp-clues .btn.on { background: var(--sun); color: var(--ink); }

/* chess on short screens (iPad landscape): drop the extras so the whole board stays visible */
.ch-short .ch-moves { display: none; }
.ch-tiny .ch-status { display: none; }
.ch-tiny .ch-strip { min-height: 30px; }
.ch-short .ch-btns button { height: 38px; }

/* ---- Bowling (js/games/bowling.js): perk cards, rewind button, style bar ---- */
.bw-over { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 12px; border-radius: 16px; background: rgba(20, 10, 70, 0.9); line-height: 1.25; text-align: center; }
.bw-over h3 { font-size: calc(17px * var(--ts, 1)); color: var(--sun); }
.bw-cards { display: flex; gap: 8px; width: 100%; }
.bw-card { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 16px; background: linear-gradient(180deg, #5b49d6, #3a2aa0); border: 3px solid rgba(255, 255, 255, 0.5); color: #fff; font-family: inherit; cursor: pointer; touch-action: manipulation; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); }
.bw-card:hover, .bw-card:focus-visible { border-color: var(--sun); transform: translateY(-3px); }
.bw-card .bw-e { font-size: calc(30px * var(--ts, 1)); line-height: 1.1; }
.bw-card b { font-size: calc(14px * var(--ts, 1)); }
.bw-card small { font-size: calc(11.5px * var(--ts, 1)); color: #ebe8ff; }
.bw-own { font-size: calc(13px * var(--ts, 1)); color: var(--muted); }
.bw-rewind { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 4; padding: 10px 16px; border-radius: 999px; border: 3px solid #fff; background: var(--sun); color: var(--ink); font: 700 calc(15px * var(--ts, 1)) Fredoka, sans-serif; line-height: 1.2; cursor: pointer; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); white-space: nowrap; }
.bw-style { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px; width: min(100%, 360px); }
.bw-style button { min-height: 40px; padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); border: 2px solid var(--line); color: #fff; font: 600 calc(13px * var(--ts, 1)) Fredoka, sans-serif; cursor: pointer; touch-action: manipulation; }
.bw-style small { width: 100%; text-align: center; color: var(--muted); font-size: calc(12px * var(--ts, 1)); }

/* ---- Chess 3D view (js/games/chess3d.js) ---- */
.ch-3d { width: 100%; aspect-ratio: var(--a3, 1 / 0.95); position: relative; border-radius: 14px; overflow: hidden; background: radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, 0.16), transparent 62%); }
.ch-3d[hidden] { display: none; }
.ch3d-cv { display: block; width: 100%; height: 100%; touch-action: manipulation; }
.ch-pre .ch-3d { display: none; }
.ch-3d-on .ch-moves { display: none; }

/* ---- Chess: bigger buttons in 3D, and the wide layout (board left, big options panel right) ---- */
.ch-3d-on .ch-btns button { height: 56px; font-size: 0.72rem; }
.ch-3d-on .ch-btns button i { font-size: 1.5rem; }
.ch-btns button[hidden] { display: none; }
.ch-wrap.ch-wide { display: grid; width: auto; grid-template-columns: var(--bw, 560px) 300px; column-gap: 18px; row-gap: 10px; align-content: start; align-items: start;
  grid-template-areas: "board opp" "board me" "board status" "board btns" "board offer" "board moves"; grid-template-rows: auto auto auto auto auto 1fr; }
.ch-wide .ch-bwrap { grid-area: board; }
.ch-wide .ch-strip[data-s="opp"] { grid-area: opp; } .ch-wide .ch-strip[data-s="me"] { grid-area: me; }
.ch-wide .ch-status { grid-area: status; font-size: 1.15rem; padding: 6px 0; }
.ch-wide .ch-btns { grid-area: btns; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ch-wide .ch-btns button { height: 74px; font-size: 1rem; border-radius: 16px; gap: 4px; }
.ch-wide .ch-btns button i { font-size: 2rem; }
.ch-wide .ch-offer { grid-area: offer; }
.ch-wide .ch-moves { grid-area: moves; display: block; white-space: normal; overflow-x: hidden; overflow-y: auto; max-height: 220px; line-height: 1.7; }
.ch-wide .ch-moves span { margin-right: 4px; }
.ch-wide .ch-strip { min-height: 56px; padding: 6px 12px; } .ch-wide .ch-nm { font-size: 1.1rem; } .ch-wide .ch-av { font-size: 1.6rem; } .ch-wide .ch-time { font-size: 1.4rem; min-width: 80px; }
.ch-wide.ch-3d-on .ch-moves { display: none; }

/* css/page.css */
/* ===== Static / SEO content: loading text, home page info section, per-game landing pages ===== */
.world-loading { text-align: center; padding: 40px 16px; font-size: 1.2rem; font-weight: 600; color: var(--muted); }

/* ---- Info section at the bottom of the home page (real text for search engines and parents) ---- */
.seo { max-width: 1120px; margin: 0 auto; padding: 8px calc(var(--gutter) + var(--safe-r)) 24px calc(var(--gutter) + var(--safe-l)); }
.seo-card { background: rgba(20, 10, 80, 0.55); border-radius: 28px; padding: 20px 18px; }
.seo h2 { font-size: 1.5rem; line-height: 1.2; margin-bottom: 8px; }
.seo h3 { font-size: 1.1rem; margin: 14px 0 4px; }
.seo p { color: var(--muted); font-size: 1rem; margin-bottom: 8px; }
.seo-lands { display: grid; gap: 14px; margin: 14px 0; }
.seo-lands h3 { margin: 0 0 4px; }
.seo-links { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.seo-links a, .seo a.inline { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.seo-links a:hover, .seo a.inline:hover { color: var(--sun); }
@media (min-width: 720px) { .seo-lands { grid-template-columns: repeat(2, minmax(0, 1fr)); } .seo-card { padding: 26px; } }

/* ---- Per-game landing pages (games/<id>/index.html) ---- */
.pg-head { max-width: 860px; margin: 0 auto; padding: calc(var(--safe-t) + 12px) var(--gutter) 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pg-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.pg-brand img { width: 40px; height: 40px; border-radius: 12px; }
.pg { max-width: 860px; margin: 0 auto; padding: 10px var(--gutter) 32px; }
.crumbs { font-size: 0.95rem; color: var(--muted); margin: 8px 0 12px; }
.crumbs a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.pg-card { border-radius: 32px; background: linear-gradient(180deg, var(--sky1), var(--sky2)); border: 4px solid rgba(255, 255, 255, 0.85); box-shadow: 0 10px 0 rgba(20, 10, 70, 0.35); padding: 22px 18px; color: var(--ink); text-align: center; }
.pg-ball { width: 110px; height: 110px; margin: 0 auto 10px; border-radius: 50%; background: #fff; border: 6px solid var(--c1); display: flex; align-items: center; justify-content: center; font-size: 3.6rem; line-height: 1; box-shadow: 0 6px 0 rgba(20, 10, 70, 0.32); }
.pg-card h1 { font-size: clamp(1.8rem, 7vw, 2.6rem); line-height: 1.1; margin-bottom: 6px; color: var(--ink); }
.pg-card .lead { font-size: 1.15rem; font-weight: 500; color: #2d2470; margin-bottom: 14px; }
.pg-play { display: inline-flex; align-items: center; justify-content: center; min-height: 64px; padding: 0 2.2rem; border-radius: 999px; background: var(--ink); color: #fff; text-decoration: none; font-weight: 700; font-size: 1.4rem; box-shadow: 0 6px 0 rgba(20, 10, 70, 0.4); }
.pg-play:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(20, 10, 70, 0.4); }
.pg-meta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.pg-meta span { padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.75); font-weight: 600; font-size: 0.95rem; }
.pg-body { margin-top: 18px; background: rgba(20, 10, 80, 0.55); border-radius: 28px; padding: 20px 18px; }
.pg-body h2 { font-size: 1.35rem; margin: 14px 0 6px; }
.pg-body h2:first-child { margin-top: 0; }
.pg-body p, .pg-body li { color: var(--muted); font-size: 1.05rem; }
.pg-body ul { padding-left: 1.2rem; margin-bottom: 8px; }
.pg-more { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pg-more a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 14px 4px 6px; border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 600; }
.pg-more a i { font-style: normal; width: 34px; height: 34px; border-radius: 50%; background: var(--c1); display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.pg-foot { text-align: center; padding: 8px 16px 28px; }
.pg-foot a { color: #fff; }

/* readability tweaks: opaque panels, paragraph spacing */
.seo-card, .pg-body { background: rgba(24, 12, 92, 0.86); }
.pg-body p { margin-bottom: 10px; }

/* ---- Privacy / policy pages ---- */
.policy h1 { font-size: clamp(1.7rem, 6vw, 2.3rem); margin-bottom: 8px; }
.policy .lead-p { font-size: 1.1rem; color: #fff; margin-bottom: 6px; }
.policy code { background: rgba(255, 255, 255, 0.15); padding: 1px 6px; border-radius: 6px; font-size: 0.95em; }
.policy a.inline, .consent-link { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.foot .link-btn { display: inline-flex; align-items: center; color: var(--muted); }
