/* PlayBeyond — shared styles. Design tokens live in :root. */
:root {
  /* Brand palette */
  --bamboo: #3FAE6A;
  --sky: #5BB8F0;
  --coral: #FF7A59;
  --honey: #FFC94D;
  --plum: #8E6CCF;
  --ink: #1E2A4A;
  --cream: #FFF8EC;

  /* Derived tones (for pressed shadows, AA-safe text on light backgrounds) */
  --bamboo-dark: #23794A;   /* 5.1:1 on white */
  --sky-dark: #1C6FA3;      /* 5.2:1 on white */
  --coral-dark: #C2462A;
  --honey-dark: #C9931A;
  --plum-dark: #5E3FA3;     /* 7.4:1 on white */
  --ink-soft: #3B4766;      /* 8.9:1 on cream */
  --paper: #FFFFFF;
  --line: #EADFCB;

  --radius-s: 12px;
  --radius-m: 20px;
  --radius-l: 28px;
  --shadow-soft: 0 6px 18px rgba(30, 42, 74, .12);
  --shadow-card: 0 10px 24px rgba(30, 42, 74, .14);
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --t-fast: 150ms;
  --t-med: 240ms;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.45;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
body.pb-locked { overflow: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--sky-dark); }
h1, h2, h3 { line-height: 1.15; margin: 0; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}
:focus-visible { outline: 4px solid var(--plum); outline-offset: 3px; border-radius: 10px; }

/* ---------- Buttons ---------- */
.pb-btn {
  --btn-bg: var(--honey);
  --btn-edge: var(--honey-dark);
  --btn-fg: var(--ink);
  appearance: none; border: 0; cursor: pointer;
  font: 800 1.05rem/1 var(--font);
  color: var(--btn-fg);
  background: var(--btn-bg);
  min-height: 52px; min-width: 52px;
  padding: 0 22px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 5px 0 var(--btn-edge), 0 8px 16px rgba(30,42,74,.14);
  transform: translateY(0);
  transition: transform var(--t-fast) ease, box-shadow var(--t-fast) ease, filter var(--t-fast);
  text-decoration: none;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
.pb-btn svg { width: 26px; height: 26px; flex: none; }
.pb-btn:active, .pb-btn.is-pressed {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--btn-edge), 0 3px 6px rgba(30,42,74,.14);
}
.pb-btn--green { --btn-bg: var(--bamboo); --btn-edge: var(--bamboo-dark); }
.pb-btn--sky { --btn-bg: var(--sky); --btn-edge: var(--sky-dark); }
.pb-btn--coral { --btn-bg: var(--coral); --btn-edge: var(--coral-dark); }
.pb-btn--cream { --btn-bg: var(--paper); --btn-edge: #D9CDB7; }
.pb-btn--plum { --btn-bg: var(--plum-dark); --btn-edge: #3E2775; --btn-fg: #fff; }
.pb-btn--big { min-height: 64px; font-size: 1.3rem; padding: 0 30px; }
.pb-btn--icon { padding: 0; width: 52px; }
.pb-btn[aria-pressed="false"] .on, .pb-btn[aria-pressed="true"] .off { display: none; }

/* ---------- Site header ---------- */
.site-header {
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + var(--safe-top)) calc(14px + var(--safe-right)) 6px calc(14px + var(--safe-left));
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.logo-mark { width: 54px; height: 54px; flex: none; }
.logo-text { display: flex; flex-direction: column; }
.logo-name { font-weight: 900; font-size: 1.45rem; letter-spacing: -.01em; }
.logo-name b { color: var(--bamboo-dark); }
.logo-tag { font-size: .82rem; font-weight: 700; color: var(--ink-soft); }
.site-nav-top { margin-left: auto; display: none; gap: 8px; }

/* ---------- Bottom nav (phones/tablets) ---------- */
.site-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  background: rgba(255,255,255,.96);
  border-top: 2px solid var(--line);
  padding: 6px calc(6px + var(--safe-right)) calc(6px + var(--safe-bottom)) calc(6px + var(--safe-left));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.nav-item {
  appearance: none; border: 0; background: none; cursor: pointer;
  font: 800 .8rem/1.1 var(--font); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 64px; min-height: 52px; padding: 4px 6px; border-radius: 16px;
  text-decoration: none; touch-action: manipulation;
}
.nav-item svg { width: 28px; height: 28px; }
.nav-item:active { background: var(--cream); transform: translateY(2px); }
.nav-item[aria-current="page"] { color: var(--bamboo-dark); }

/* ---------- Home ---------- */
main.home { padding: 0 calc(14px + var(--safe-right)) calc(110px + var(--safe-bottom)) calc(14px + var(--safe-left)); max-width: 1500px; margin: 0 auto; }
.home-actions { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 10px; }
.surprise { width: 100%; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  appearance: none; cursor: pointer; flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 16px 0 10px;
  border-radius: 999px; border: 3px solid var(--line); background: var(--paper);
  font: 800 1rem/1 var(--font); color: var(--ink);
  touch-action: manipulation;
  transition: transform var(--t-fast);
}
.chip svg { width: 28px; height: 28px; }
.chip:active { transform: translateY(2px); }
.chip[aria-pressed="true"] { border-color: var(--bamboo); background: #E6F6EC; }
.section-title { font-size: 1.25rem; font-weight: 900; margin: 14px 2px 10px; }

.featured { display: grid; grid-template-columns: 1fr; gap: 14px; }
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 359px) { .grid { grid-template-columns: 1fr; } }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .featured { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 820px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } .featured { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width: 1400px) { .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.card {
  appearance: none; border: 0; padding: 0; cursor: pointer; text-align: left;
  font: inherit; color: inherit;
  background: var(--paper); border-radius: var(--radius-m);
  box-shadow: 0 5px 0 var(--line), var(--shadow-soft);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform var(--t-fast) ease, box-shadow var(--t-fast) ease;
  content-visibility: auto; contain-intrinsic-size: 220px;
  touch-action: manipulation;
}
.card:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line), var(--shadow-soft); }
.card-thumb { aspect-ratio: 4 / 3; width: 100%; height: auto; background: linear-gradient(#CFEAFB, #EAF7EE); object-fit: contain; }
.card-body { padding: 10px 12px 12px; }
.card-title { font-size: 1.02rem; font-weight: 900; }
.card-world { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 800; color: var(--ink-soft); margin-top: 3px; }
.card-world svg { width: 18px; height: 18px; }
.card--featured { flex-direction: row; align-items: stretch; }
.card--featured .card-thumb { width: 46%; aspect-ratio: 4 / 3; height: auto; flex: none; align-self: center; }
.card--featured .card-body { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.card--featured .card-title { font-size: 1.15rem; }
.card-desc { font-size: .88rem; color: var(--ink-soft); margin: 2px 0 0; }
.badge-new { align-self: flex-start; background: var(--honey); border-radius: 999px; padding: 3px 10px; font-size: .75rem; font-weight: 900; }
.empty-note { color: var(--ink-soft); font-weight: 700; }

.site-footer {
  margin: 30px 0 10px; padding: 18px 4px; border-top: 2px dashed var(--line);
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: center;
  font-weight: 800; font-size: .95rem;
}
.site-footer a { color: var(--ink); min-height: 48px; display: inline-flex; align-items: center; padding: 0 6px; }
.site-footer .promise { width: 100%; text-align: center; color: var(--bamboo-dark); }

@media (min-width: 900px) {
  .site-nav { display: none; }
  .site-nav-top { display: flex; }
  main.home { padding-bottom: 30px; }
  .home-actions { flex-direction: row; align-items: center; }
  .surprise { width: auto; }
}

/* ---------- Detail sheet / game page ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgba(30,42,74,.45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: pb-fade var(--t-med) ease;
}
.sheet {
  width: min(560px, 100%); max-height: 92dvh; overflow: auto;
  background: var(--cream); border-radius: var(--radius-l) var(--radius-l) 0 0;
  padding: 0 0 calc(18px + var(--safe-bottom));
  animation: pb-rise var(--t-med) ease;
  box-shadow: var(--shadow-card);
}
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: var(--radius-l); } }
.detail-thumb { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; background: #CFEAFB; }
.detail-body { padding: 14px 18px 0; display: flex; flex-direction: column; gap: 10px; }
.detail-title { font-size: 1.6rem; font-weight: 900; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { background: var(--paper); border: 2px solid var(--line); border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: .88rem; display: inline-flex; gap: 6px; align-items: center; }
.pill svg { width: 18px; height: 18px; }
.detail-play { width: 100%; }
.detail-row { display: flex; gap: 10px; }
.detail-row .pb-btn { flex: 1; }
.learn-list { margin: 0; padding-left: 1.2em; font-weight: 600; }
.small-head { font-size: 1rem; font-weight: 900; margin-top: 6px; }

.page { max-width: 760px; margin: 0 auto; padding: 0 calc(18px + var(--safe-right)) calc(110px + var(--safe-bottom)) calc(18px + var(--safe-left)); }
.page h1 { font-size: 2rem; font-weight: 900; margin: 10px 0 12px; }
.page h2 { font-size: 1.3rem; font-weight: 900; margin: 22px 0 8px; }
.page p, .page li { font-size: 1.05rem; }
.page .panel { background: var(--paper); border-radius: var(--radius-m); padding: 16px 18px; box-shadow: var(--shadow-soft); }
.game-page-hero { border-radius: var(--radius-m); overflow: hidden; box-shadow: var(--shadow-card); margin-bottom: 14px; }
@media (min-width: 900px) { .page { padding-bottom: 30px; } }

/* ---------- Game shell ---------- */
.shell {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column;
  background: var(--ink);
  height: 100vh; height: 100dvh;
  padding: var(--safe-top) var(--safe-right) 0 var(--safe-left);
  touch-action: none;
  user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.shell-bar {
  flex: none; display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; background: var(--ink); color: #fff;
}
.shell-title { flex: 1; min-width: 0; text-align: center; font-weight: 900; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-btn {
  appearance: none; border: 0; cursor: pointer;
  width: 48px; height: 48px; border-radius: 14px;
  background: rgba(255,255,255,.12); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform var(--t-fast), background var(--t-fast);
  touch-action: manipulation;
}
.bar-btn svg { width: 28px; height: 28px; }
.bar-btn[hidden] { display: none; }
/* narrow phones: seven 48px buttons need the room, so the game title (also on the start card) hides */
@media (max-width: 400px) {
  .shell-bar:has(.read-btn:not([hidden])) .shell-title { visibility: hidden; }
  .shell-bar:has(.read-btn:not([hidden])) { gap: 3px; padding-left: 4px; padding-right: 4px; }
}
.bar-btn:active { transform: translateY(2px); background: rgba(255,255,255,.24); }
.bar-btn[aria-pressed="false"] .on, .bar-btn[aria-pressed="true"] .off { display: none; }
.shell-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #BFE3F7; }
.shell-stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.shell-hud { position: absolute; left: 10px; top: 8px; right: 10px; display: flex; gap: 8px; pointer-events: none; z-index: 2; }
.hud-pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 12px 4px 6px;
  border-radius: 999px; background: rgba(255,248,236,.92); color: var(--ink);
  font-weight: 900; font-size: 1.1rem; box-shadow: 0 3px 0 rgba(30,42,74,.18);
  white-space: nowrap;
}
.hud-pill canvas, .hud-pill svg { width: 30px; height: 30px; flex: none; }
.hud-pill.bump { animation: pb-bump 260ms ease; }
.hud-disc { display: inline-flex; gap: 2px; }
.hud-disc canvas { width: 28px !important; height: 28px !important; }
.hud-disc .missing { opacity: .28; filter: grayscale(1); }

.shell-controls { position: absolute; inset: auto 0 0 0; height: 0; z-index: 3; pointer-events: none; }
.vbtn {
  position: absolute; bottom: calc(14px + var(--safe-bottom));
  width: 78px; height: 78px; border-radius: 50%;
  background: rgba(255,255,255,.34); border: 3px solid rgba(255,255,255,.7);
  color: var(--ink); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 0 rgba(30,42,74,.25);
  pointer-events: auto; touch-action: none;
  transition: transform 90ms, background 90ms;
}
.vbtn svg { width: 40px; height: 40px; opacity: .85; }
.vbtn.is-down { transform: translateY(3px) scale(.96); background: rgba(255,255,255,.6); box-shadow: 0 1px 0 rgba(30,42,74,.25); }
.vbtn--left { left: calc(14px + var(--safe-left)); }
.vbtn--right { left: calc(104px + var(--safe-left)); }
.vbtn--jump { right: calc(18px + var(--safe-right)); width: 92px; height: 92px; }
.vbtn--jump svg { width: 46px; height: 46px; }
.vbtn--down { right: calc(124px + var(--safe-right)); }
.vbtn--super { right: calc(28px + var(--safe-right)); bottom: calc(118px + var(--safe-bottom)); width: 70px; height: 70px; }
.vbtn--super.is-ready { background: rgba(255,233,160,.75); border-color: #FFC94D; animation: pb-bump 900ms ease infinite; }
.hud-super { display: inline-flex; align-items: center; gap: 6px; }
.hud-super .bar { width: 46px; height: 10px; border-radius: 6px; background: rgba(30,42,74,.15); overflow: hidden; }
.hud-super .bar i { display: block; height: 100%; width: 0; background: #FFC94D; border-radius: 6px; }
.hud-pill.is-ready { box-shadow: 0 0 0 3px #FFC94D; }
.char-pick button { min-width: 72px; padding: 4px 6px; }
.char-pick canvas { width: 48px; height: 48px; }
@media (max-height: 420px) { .vbtn { width: 70px; height: 70px; } .vbtn--right { left: calc(94px + var(--safe-left)); } .vbtn--jump { width: 84px; height: 84px; } .vbtn--down { right: calc(112px + var(--safe-right)); } .vbtn--super { width: 62px; height: 62px; bottom: calc(104px + var(--safe-bottom)); } }

.shell-overlay {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  padding: 12px; background: rgba(30,42,74,.42);
  animation: pb-fade var(--t-med) ease;
}
.shell-overlay[hidden] { display: none; }
.game-card {
  width: min(520px, 100%); max-height: 100%; overflow: auto;
  background: var(--cream); color: var(--ink);
  border-radius: var(--radius-l); padding: 18px 18px 20px;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 12px; align-items: stretch;
  animation: pb-pop var(--t-med) ease;
  touch-action: pan-y;
}
.game-card h2 { font-size: 1.55rem; font-weight: 900; text-align: center; }
.game-card p { margin: 0; text-align: center; font-weight: 700; color: var(--ink-soft); }
.game-card-content { display: flex; flex-direction: column; gap: 12px; }
.picto-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.picto { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 104px; font-weight: 800; font-size: .85rem; text-align: center; }
.picto-icon { width: 74px; height: 74px; border-radius: 20px; background: var(--paper); display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 var(--line); }
.picto-icon svg { width: 52px; height: 52px; }
.seg { display: flex; background: var(--paper); border-radius: 999px; padding: 5px; gap: 5px; box-shadow: inset 0 0 0 2px var(--line); }
.seg button {
  flex: 1; appearance: none; border: 0; cursor: pointer; min-height: 48px; border-radius: 999px;
  background: transparent; font: 800 1rem/1 var(--font); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  touch-action: manipulation;
}
.seg button svg { width: 22px; height: 22px; }
.seg button[aria-pressed="true"] { background: var(--bamboo); box-shadow: 0 3px 0 var(--bamboo-dark); }
.seg--tiers button svg { width: 28px; height: 28px; flex: none; }
.seg--tiers button { padding: 0 6px; font-size: .95rem; flex: 1 1 0; min-width: 0; }
/* the chosen level's icon sits on a pale circle so it stays visible on the green (and the label reads as centred) */
.seg--tiers button svg { border-radius: 50%; }
.seg--tiers button[aria-pressed="true"] svg { background: rgba(255,253,247,.85); }
.clock-toggle[aria-pressed="true"] { background: var(--honey); }
.card-actions { display: grid; gap: 10px; }
.card-actions--three { grid-template-columns: 1fr; }
@media (min-width: 560px) { .card-actions--three { grid-template-columns: repeat(3, 1fr); } .card-actions--three .pb-btn { padding: 0 10px; font-size: .98rem; } }
.toggle-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.level-pick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.level-pick button {
  appearance: none; cursor: pointer; border: 3px solid var(--line); background: var(--paper);
  min-width: 56px; min-height: 56px; border-radius: 16px; font: 900 1.2rem/1 var(--font); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; padding: 4px 8px;
  touch-action: manipulation;
}
.level-pick button span { font-size: .68rem; font-weight: 800; }
.level-pick button[aria-pressed="true"] { border-color: var(--bamboo); background: #E6F6EC; }
.level-pick button:disabled { opacity: .45; cursor: default; }
.level-pick button svg { width: 22px; height: 22px; }
.result-row { display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; }
.result-item { display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 800; font-size: .85rem; text-align: center; width: 92px; }
.result-item canvas { width: 64px; height: 64px; background: var(--paper); border-radius: 18px; box-shadow: 0 3px 0 var(--line); }
.result-item.missing canvas { opacity: .35; filter: grayscale(1); }
.result-big { font-size: 1.6rem; font-weight: 900; display: inline-flex; align-items: center; gap: 8px; }
.result-big canvas { width: 54px; height: 54px; }

.toast {
  position: absolute; left: 50%; top: 58px; transform: translateX(-50%);
  z-index: 4; background: var(--cream); color: var(--ink);
  border-radius: 999px; padding: 6px 8px 6px 14px; font-weight: 800;
  display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-card);
  max-width: calc(100% - 24px);
  animation: pb-pop var(--t-med) ease;
}
.toast svg { width: 28px; height: 28px; flex: none; }
.toast > span { display: flex; flex: none; }
.toast .bar-btn { background: var(--paper); color: var(--ink); width: 48px; height: 48px; }
.banner {
  position: absolute; left: 50%; top: 56px; transform: translateX(-50%);
  z-index: 4; pointer-events: none;
  background: var(--honey); color: var(--ink); border-radius: 22px;
  padding: 8px 18px 8px 8px; font-weight: 900; font-size: 1.05rem;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 5px 0 var(--honey-dark), var(--shadow-card);
  animation: pb-banner 2400ms ease forwards;
  max-width: calc(100% - 24px);
}
.banner canvas { width: 48px; height: 48px; background: var(--cream); border-radius: 14px; }
@media (max-height: 420px) { .banner { font-size: .92rem; padding: 5px 14px; } }
/* the question box glows when a new question arrives, and again if nobody has tapped for a while */
.hud-q.is-new { animation: pb-q-new 1100ms ease; }
.hud-q.is-nudge { animation: pb-q-nudge 1500ms ease; }
@keyframes pb-q-new { 0% { box-shadow: 0 0 0 0 rgba(255,201,77,0); } 30% { box-shadow: 0 0 0 7px rgba(255,201,77,.9); } 100% { box-shadow: 0 0 0 0 rgba(255,201,77,0); } }
@keyframes pb-q-nudge { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(91,184,240,0); } 20%, 60% { transform: scale(1.05); box-shadow: 0 0 0 7px rgba(91,184,240,.85); } 40%, 80% { transform: scale(1); } }
.loading { color: #fff; font-weight: 900; font-size: 1.2rem; }

@keyframes pb-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pb-rise { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes pb-pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pb-bump { 50% { transform: scale(1.12); } }
@keyframes pb-banner {
  0% { opacity: 0; transform: translate(-50%, -10px); }
  10%, 85% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -6px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .banner { animation: none; }
}

/* Short landscape screens (phones on their side): two-column cards so Play is always visible */
@media (orientation: landscape) and (max-height: 540px) {
  .shell-bar { padding: 3px 8px; }
  .shell-title { font-size: .92rem; }
  .game-card {
    width: min(860px, 100%);
    display: grid; grid-template-columns: 1.15fr 1fr; gap: 10px 18px; align-items: center;
    padding: 12px 16px 14px;
  }
  .game-card > h2 { grid-column: 1 / -1; font-size: 1.3rem; }
  .game-card > p { grid-column: 1 / -1; }
  .game-card .game-card-content { display: contents; }
  .game-card .picto-row { grid-column: 1; grid-row: 2 / span 4; gap: 6px; }
  .game-card .seg, .game-card .level-pick, .game-card .char-pick, .game-card .toggle-row, .game-card .card-actions { grid-column: 2; }
  .card-actions--three { grid-template-columns: 1fr !important; }
  .picto { width: 88px; font-size: .78rem; }
  .picto-icon { width: 54px; height: 54px; border-radius: 16px; }
  .picto-icon svg { width: 40px; height: 40px; }
  .level-pick button { min-width: 52px; min-height: 52px; }
  .pb-btn--big { min-height: 56px; font-size: 1.15rem; }
  .result-item canvas { width: 52px; height: 52px; }
  .game-card .pause-content > * { grid-column: 1 / -1; } /* the pause card's own column: label, level switch and toggles stack */
  /* year chips sit on the left above the picture instructions, so Play stays on screen */
  .game-card .seg--years { grid-column: 1; grid-row: 2; margin-bottom: 0; align-self: end; }
  .game-card:has(.seg--years) .picto-row { grid-row: 3 / span 4; align-self: start; }
}
@media (max-height: 700px) and (orientation: portrait) {
  .picto { width: 92px; font-size: .8rem; }
  .picto-icon { width: 58px; height: 58px; }
  .picto-icon svg { width: 42px; height: 42px; }
  .game-card { gap: 10px; padding: 14px; }
}

/* Teachers page */
.muted { color: var(--ink-soft); font-size: .95rem; }
.page .chips { flex-wrap: wrap; overflow: visible; }
.t-list { display: grid; gap: 14px; }
.t-game { display: grid; grid-template-columns: 1fr; gap: 12px; }
.t-game h3 { font-size: 1.25rem; font-weight: 900; margin: 0 0 6px; }
.t-game h3 a { color: var(--ink); }
.t-game ul { margin: 6px 0; padding-left: 1.2em; }
.t-thumb img { width: 100%; max-width: 260px; height: auto; border-radius: 14px; aspect-ratio: 4 / 3; object-fit: contain; }
@media (min-width: 640px) { .t-game { grid-template-columns: 180px 1fr; } }
.t-table-wrap { overflow-x: auto; }
.t-table { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: var(--radius-m); overflow: hidden; }
.t-table th, .t-table td { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--line); vertical-align: top; }
.t-table th { background: #F4EBDA; }

/* For Schools / statements */
.qa { margin: 0; display: grid; gap: 10px; }
.qa dt { font-weight: 900; }
.qa dd { margin: 0 0 6px; padding-left: 14px; border-left: 4px solid var(--line); }
.ticks { list-style: none; padding-left: 0; }
.ticks li { padding-left: 30px; position: relative; margin: 6px 0; }
.ticks li::before { content: ''; position: absolute; left: 4px; top: 5px; width: 14px; height: 8px; border-left: 4px solid var(--bamboo-dark); border-bottom: 4px solid var(--bamboo-dark); transform: rotate(-45deg); }
.page h3 { font-size: 1.1rem; font-weight: 900; margin: 18px 0 8px; }
.t-table th[scope], .t-table tbody th { width: 42%; font-weight: 800; background: #FBF5EA; }

@media print {
  .site-nav, .site-nav-top, .site-footer, .no-print, .logo-mark { display: none !important; }
  body { background: #fff; }
  .page { max-width: none; padding: 0; }
  .panel { box-shadow: none; border: 1px solid #ddd; }
  a { color: inherit; }
  h2 { break-after: avoid; } .qa dt { break-after: avoid; } .qa dd, tr { break-inside: avoid; }
}

/* Game card sheet on phones held sideways: picture beside the text so Play is visible */
@media (orientation: landscape) and (max-height: 540px) {
  .sheet { width: min(860px, 96vw); max-height: 96dvh; border-radius: var(--radius-l); }
  .sheet-backdrop { align-items: center; }
  .detail { display: grid; grid-template-columns: 40% 1fr; align-items: start; }
  .detail .detail-thumb { border-radius: var(--radius-l) 0 0 0; }
  .detail-body { padding-top: 12px; gap: 8px; }
  .detail-title { font-size: 1.3rem; }
}
/* Very short screens (small phones sideways): compact start cards */
@media (orientation: landscape) and (max-height: 420px) {
  .shell-overlay { padding: 6px; }
  .game-card { padding: 8px 12px 10px; gap: 6px 14px; }
  .game-card > h2 { font-size: 1.1rem; }
  .picto { width: 76px; font-size: .72rem; gap: 2px; }
  .picto-icon { width: 46px; height: 46px; border-radius: 14px; }
  .picto-icon svg { width: 34px; height: 34px; }
  .level-pick { flex-wrap: nowrap; gap: 5px; }
  .level-pick button { min-width: 48px; min-height: 48px; padding: 2px 4px; font-size: 1rem; }
  .level-pick button span { font-size: .6rem; }
  .seg button { min-height: 48px; }
  .game-card .toggle-row .music-toggle { display: none; } /* Music is still in the Pause menu */
  .game-card .toggle-row .pb-btn { min-height: 48px; }
  .pb-btn--big { min-height: 52px; }
  .result-item canvas { width: 46px; height: 46px; }
}

/* "Looking ahead to the 2028 curriculum" notes (game pages, Teachers page) */
.outlook { border-left: 6px solid #3FAE6A; background: #EEF9F1; border-radius: 14px; padding: 10px 16px; margin: 12px 0; }
.outlook ul { margin: 4px 0 0; }
.panel.outlook h2 { margin-top: 0; }

/* Start card: Music is a round icon button beside "Beat the clock" (its label stays in the Pause menu) */
.game-card .toggle-row { flex-wrap: nowrap; align-items: center; }
.game-card .toggle-row .music-toggle { width: 52px; min-width: 52px; padding: 0; justify-content: center; border-radius: 50%; }
.game-card .toggle-row .music-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.game-card .toggle-row .music-toggle[aria-pressed="false"] svg { opacity: .45; }
.game-card .toggle-row .music-toggle[aria-pressed="true"] { background: var(--honey); }

/* Three levels of challenge (game pages, Teachers page) */
.tiers-table th { white-space: nowrap; vertical-align: top; text-align: left; }
.tier-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; }
.tier-name svg { width: 28px; height: 28px; }
.tier-teacher { display: block; font-size: .8rem; color: var(--ink-soft, #3B4766); font-weight: 700; margin-left: 34px; }
.small { font-size: .85rem; }
.tier-list { margin-top: 2px; }

/* ---- Small portrait phones (e.g. 320×568, 375×667): start cards keep Play on screen ---- */
@media (orientation: portrait) and (max-height: 640px), (orientation: portrait) and (max-width: 359px) {
  .shell-overlay { padding: 6px; }
  .game-card { padding: 12px 12px 14px; gap: 8px; }
  .game-card > h2 { font-size: 1.25rem; }
  .picto-row { gap: 4px 6px; flex-wrap: nowrap; }
  .picto { width: 64px; font-size: .68rem; gap: 2px; line-height: 1.15; }
  .picto-icon { width: 46px; height: 46px; border-radius: 14px; }
  .picto-icon svg { width: 34px; height: 34px; }
  .level-pick { flex-wrap: nowrap; gap: 4px; }
  .level-pick button { min-width: 48px; min-height: 48px; padding: 2px 3px; }
  .level-pick button span { font-size: .6rem; }
  .pb-btn--big { min-height: 54px; }
}
/* Picture instructions wrap when there are more than four */
@media (orientation: portrait) and (max-height: 640px), (orientation: portrait) and (max-width: 359px) {
  .picto-row:has(> .picto:nth-child(5)) { flex-wrap: wrap; }
}
@media (max-width: 359px) {
  .seg--tiers button svg { display: none; } /* names only, so all three fit */
  .seg--tiers button { font-size: .85rem; padding: 0 4px; }
}
/* Very short sideways phones (e.g. 568×320): pictures in three columns, level names without icons */
@media (orientation: landscape) and (max-height: 360px) {
  .seg--tiers button svg { display: none; }
  .seg--tiers button { font-size: .85rem; padding: 0 6px; }
  .game-card .picto-row { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; gap: 2px 6px; }
  .picto { width: 72px; font-size: .66rem; }
  .picto-icon { width: 40px; height: 40px; border-radius: 12px; }
  .picto-icon svg { width: 30px; height: 30px; }
  .game-card > h2 { font-size: 1rem; }
}

/* ---- Game HUD: on narrow screens the question box takes its own row under the counters ---- */
.hud-row { display: flex; gap: 8px; align-items: flex-start; width: 100%; }
.hud-side { display: flex; gap: 6px; flex: 1; min-width: 0; flex-wrap: wrap; }
.hud-side--right { justify-content: flex-end; }
.hud-q { flex-direction: column; justify-content: center; padding: 6px 16px; font-size: 1.35rem; min-height: 52px; max-width: 60vw; white-space: normal; text-align: center; transition: background .2s; }
@media (max-width: 479px) {
  .hud-row { flex-wrap: wrap; row-gap: 6px; }
  .hud-side { flex-wrap: nowrap; }
  .hud-q { order: 3; flex: 1 1 100%; max-width: none; min-height: 46px; font-size: 1.2rem; }
}

/* Detail sheet: Play stays on screen even when the description is long or the screen is short */
.sheet .detail-play { position: sticky; bottom: 8px; z-index: 2; box-shadow: 0 4px 0 var(--bamboo-dark), 0 6px 18px rgba(30,42,74,.25); }
.sheet .detail-thumb { max-height: 42dvh; width: auto; max-width: 100%; margin: 0 auto; display: block; }

/* Bramble's Pizza Kitchen: Serve button, and proper stacked fractions in the question */
.pz-serve { position: absolute; left: 50%; bottom: calc(12px + var(--safe-bottom)); transform: translateX(-50%); z-index: 3; min-width: 200px; min-height: 64px; }
.pz-serve:active { transform: translateX(-50%) translateY(3px); }
.pz-serve.pz-serve--side { left: auto; right: calc(10px + var(--safe-right)); bottom: calc(10px + var(--safe-bottom)); transform: none; min-width: 180px; }
.pz-serve.pz-serve--side:active { transform: translateY(3px); }
.pz-q { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.frac-wrap { display: inline-flex; align-items: center; gap: 3px; }
.frac { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; font-size: .82em; }
.frac > span:first-child { border-bottom: 3px solid currentColor; padding: 0 3px 2px; }
.frac > span:last-child { padding: 2px 3px 0; }
.hud-q.is-right { background: #9BE0B5; }
.tt-q { font-size: 1.3em; letter-spacing: .02em; }
.hud-q.is-wrong { background: #FFE3DA; }
/* ---- Screen standard (25 Nov): the question is the biggest text on screen and grows with the screen ----
   phone upright ≈ 24px, sideways phone ≈ 21px, tablet ≈ 28px, big screen ≈ 32px. The hint line above it is
   ~60% of its size. Same rule for every game. */
.hud-q { font-size: clamp(1.35rem, 1rem + 2vmin, 2.3rem); min-height: calc(2.6em); padding: 6px 18px 8px; line-height: 1.15; }
.hud-q-hint { display: block; font-size: .58em; font-weight: 800; color: #3B4766; line-height: 1.15; margin-bottom: 2px; }
@media (max-width: 479px) { .hud-q { font-size: 1.5rem; min-height: 64px; } }
@media (max-width: 359px) { .hud-q { font-size: 1.32rem; } }
/* phones: slightly smaller tier icons so "Seedling" has breathing room */
@media (max-width: 430px) {
  .seg--tiers button { gap: 4px; font-size: .9rem; padding: 0 4px; }
  .seg--tiers button svg { width: 22px; height: 22px; }
}

/* ==========================================================================
   PlayBeyond design refresh (Build 10, owner feedback round 3)
   Research-led: today's best children's products (Duolingo, Toca Boca, Khan Academy Kids) use solid,
   bright colours with a chunky darker "lip" under every button that presses down when tapped, big
   rounded type, generous white space and characters front and centre. Gloss and gradients on buttons
   read as dated, so they're gone. Contrast: white text only on deep colours (AA 4.5:1+), dark text on
   light warm colours.
   ========================================================================== */
@font-face { font-family: 'Poppins'; src: url('../assets/fonts/poppins-regular.woff') format('woff'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../assets/fonts/poppins-medium.woff') format('woff'); font-weight: 500 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../assets/fonts/poppins-bold.woff') format('woff'); font-weight: 700 900; font-style: normal; font-display: swap; }
:root {
  --font: 'Poppins', ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --lip: 5px;
  --green-btn: #23874A; --green-lip: #17633A;     /* white text 4.5:1 */
  --blue-btn: #1F78B4; --blue-lip: #155887;       /* white text 4.8:1 */
  --coral-btn: #FF7A59; --coral-lip: #D2502F;     /* dark text 5.5:1 */
  --honey-btn: #FFC94D; --honey-lip: #D99A1E;     /* dark text 9.2:1 */
  --card-line: #EEE3CF; --card-lip: #E3D5BB;
}
body { font-family: var(--font); letter-spacing: 0; }
body[data-page="home"], .page { background-color: var(--cream); background-image: radial-gradient(rgba(255,201,77,.16) 1.6px, transparent 1.7px); background-size: 26px 26px; }

/* ---------- Buttons ---------- */
:where(.pb-btn) { position: relative; }
.pb-btn {
  font: 700 1.05rem/1 var(--font); letter-spacing: .01em;
  background: var(--btn-bg);
  box-shadow: 0 var(--lip) 0 var(--btn-edge), 0 calc(var(--lip) + 6px) 14px rgba(30,42,74,.12);
  transition: transform 90ms ease, box-shadow 90ms ease, filter 120ms ease, background-color 120ms ease;
  text-shadow: none;
}
.pb-btn > svg { width: 26px; height: 26px; }
.pb-btn--big > svg { width: 30px; height: 30px; }
.pb-btn--green { --btn-bg: var(--green-btn); --btn-edge: var(--green-lip); --btn-fg: #fff; }
.pb-btn--sky { --btn-bg: var(--blue-btn); --btn-edge: var(--blue-lip); --btn-fg: #fff; }
.pb-btn--coral { --btn-bg: var(--coral-btn); --btn-edge: var(--coral-lip); }
.pb-btn--cream { --btn-bg: #fff; --btn-edge: var(--card-lip); box-shadow: inset 0 0 0 2px var(--card-line), 0 var(--lip) 0 var(--btn-edge), 0 calc(var(--lip) + 6px) 14px rgba(30,42,74,.08); }
.pb-btn--plum { --btn-bg: var(--plum-dark); --btn-edge: #3E2775; --btn-fg: #fff; }
@media (hover: hover) and (pointer: fine) { .pb-btn:hover { filter: brightness(1.06) saturate(1.05); } }
.pb-btn:not(.pz-serve):active, .pb-btn.is-pressed:not(.pz-serve) { transform: translateY(var(--lip)); }
.pb-btn:active, .pb-btn.is-pressed { box-shadow: 0 0 0 var(--btn-edge), 0 2px 6px rgba(30,42,74,.12); }
.pb-btn--cream:active { box-shadow: inset 0 0 0 2px var(--card-line), 0 0 0 var(--btn-edge); }

/* Focus ring: keyboard only, drawn evenly around the whole button INCLUDING its lip (owner: "why is it
   slightly off?" — a plain outline hugged the face but not the 3D edge underneath, so it looked lopsided). */
.pb-btn:focus-visible, .chip:focus-visible, .card:focus-visible, .seg button:focus-visible { outline: none; }
.pb-btn:focus-visible::after, .chip:focus-visible::after, .card:focus-visible::after {
  content: ''; position: absolute; pointer-events: none;
  inset: -7px -7px calc(-7px - var(--lip)) -7px;
  border-radius: 999px; border: 3.5px solid var(--plum-dark);
  box-shadow: 0 0 0 2px #fff, inset 0 0 0 2px #fff;
}
.card:focus-visible::after { border-radius: 28px; inset: -6px -6px calc(-6px - var(--lip)) -6px; }
.pb-btn:not(.pz-serve):active::after { transform: translateY(calc(-1 * var(--lip))); }
.seg button:focus-visible { box-shadow: inset 0 0 0 3px var(--plum-dark); }

/* "Surprise Me": coral with a few sparkles, dice that wiggles now and then */
.surprise {
  background:
    radial-gradient(circle at 14% 32%, rgba(255,255,255,.9) 0 2px, transparent 2.6px),
    radial-gradient(circle at 87% 28%, rgba(255,255,255,.85) 0 2.4px, transparent 3px),
    radial-gradient(circle at 80% 74%, rgba(255,255,255,.75) 0 1.7px, transparent 2.3px),
    var(--coral-btn);
}
@media (prefers-reduced-motion: no-preference) {
  .surprise > svg { animation: pb-dice 4.5s ease-in-out infinite; }
  @keyframes pb-dice { 0%, 82%, 100% { transform: rotate(0); } 88% { transform: rotate(-14deg); } 94% { transform: rotate(10deg); } }
}

/* ---------- Chips ---------- */
.chip {
  position: relative; background: #fff; border: 0;
  box-shadow: inset 0 0 0 2px var(--card-line), 0 4px 0 var(--card-lip);
  font: 600 1rem/1 var(--font); padding: 0 18px 0 10px; margin-bottom: 4px;
}
.chip svg { width: 28px; height: 28px; padding: 0; background: none; }
.chip:active { transform: translateY(4px); box-shadow: inset 0 0 0 2px var(--card-line), 0 0 0 var(--card-lip); }
.chip[aria-pressed="true"] { background: #E7F6EC; box-shadow: inset 0 0 0 2.5px var(--green-btn), 0 4px 0 var(--green-lip); color: #14532F; }
@media (hover: hover) and (pointer: fine) { .chip:hover { box-shadow: inset 0 0 0 2px #D8C9AD, 0 4px 0 var(--card-lip); } }

/* ---------- Header ---------- */
.logo-name { font-weight: 700; letter-spacing: -.01em; }
.logo-tag { font-weight: 500; }

/* ---------- Home hero: the whole cast on a sunny hillside ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 28px;
  height: clamp(250px, 52vw, 340px); margin: 4px 0 14px;
  background: linear-gradient(180deg, #8FD3F7 0%, #CDEEFB 70%, #E4F6EC 100%);
  box-shadow: 0 6px 0 #BFE0C9, 0 16px 30px rgba(30,42,74,.12);
}
.hero-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-copy { position: absolute; left: 18px; right: 18px; top: 16px; z-index: 1; }
.hero-title { margin: 0; font-weight: 700; font-size: clamp(1.35rem, 5.4vw, 2.3rem); line-height: 1.12; color: #13304F; letter-spacing: -.01em; text-shadow: 0 2px 0 rgba(255,255,255,.7); }
.hero-sub { margin: 4px 0 0; font-weight: 500; font-size: clamp(.9rem, 2.6vw, 1.1rem); color: #23476B; }
@media (min-width: 820px) { .hero-copy { left: 36px; top: 28px; max-width: 46%; } }
@media (prefers-reduced-motion: no-preference) {
  .hero .bob { animation: pb-bob 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
  .hero .bob:nth-of-type(2n) { animation-delay: -1.1s; animation-duration: 3.6s; }
  .hero .bob:nth-of-type(3n) { animation-delay: -2s; animation-duration: 2.9s; }
  .hero .fly { animation: pb-fly 4s ease-in-out infinite; }
  .hero .cloud { animation: pb-cloud 40s linear infinite alternate; }
  @keyframes pb-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
  @keyframes pb-fly { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(6px, -10px); } }
  @keyframes pb-cloud { from { transform: translateX(-30px); } to { transform: translateX(30px); } }
}
.home-actions { margin-top: 0; }

/* ---------- Section titles ---------- */
.section-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.35rem; letter-spacing: -.01em; margin: 20px 2px 12px; }
.section-title .st-icon { width: 36px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 rgba(0,0,0,.08); }
.section-title .st-icon svg { width: 22px; height: 22px; }
.st-icon--star { background: var(--honey-btn); }
.st-icon--grid { background: #CFE9FB; }

/* ---------- Game cards ---------- */
.card {
  position: relative; background: #fff; border-radius: 24px; overflow: visible;
  box-shadow: inset 0 0 0 2px var(--card-line), 0 var(--lip) 0 var(--card-lip), 0 14px 26px rgba(30,42,74,.08);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.card-thumb { border-radius: 22px 22px 0 0; margin: 2px 2px 0; width: calc(100% - 4px); }
.card--featured .card-thumb { border-radius: 22px 0 0 22px; margin: 2px 0 2px 2px; }
.card-title { font-weight: 700; font-size: 1.02rem; letter-spacing: -.005em; }
.card-world { font-weight: 500; }
.card-desc { font-weight: 400; line-height: 1.45; }
.badge-new { font-weight: 700; }
.card:active { transform: translateY(var(--lip)); box-shadow: inset 0 0 0 2px var(--card-line), 0 0 0 var(--card-lip), 0 4px 10px rgba(30,42,74,.06); }
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 2px #E2D3B6, 0 calc(var(--lip) + 3px) 0 var(--card-lip), 0 20px 34px rgba(30,42,74,.12); }
}
/* a round "play" badge on every card says "tap me" */
.card::before {
  content: ''; position: absolute; z-index: 1; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--green-btn) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6.5v11l9-5.5z' fill='%23fff'/%3E%3C/svg%3E") center / 22px no-repeat;
  box-shadow: 0 3px 0 var(--green-lip), 0 6px 12px rgba(30,42,74,.18);
}
.card--featured::before { display: none; }
.card-cta {
  align-self: flex-start; margin-top: 8px; display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 16px 0 10px; border-radius: 999px;
  background: var(--green-btn); color: #fff; font-weight: 700; font-size: .95rem;
  box-shadow: 0 4px 0 var(--green-lip);
}
.card-cta svg { width: 20px; height: 20px; }

/* ---------- Bottom navigation ---------- */
.site-nav { background: rgba(255,255,255,.97); border-top: 0; box-shadow: 0 -6px 20px rgba(30,42,74,.08); border-radius: 22px 22px 0 0; }
.nav-item { font-weight: 600; }
.nav-item[aria-current="page"] { background: #E7F6EC; color: #14532F; box-shadow: inset 0 0 0 2px rgba(35,135,74,.25); }

/* ---------- Game start cards and in-game choices ---------- */
.game-card h2 { font-weight: 700; letter-spacing: -.01em; }
.picto { font-weight: 600; }
.picto-icon { box-shadow: inset 0 0 0 2px var(--card-line), 0 4px 0 var(--card-lip); }
.seg { background: #F7F1E6; box-shadow: inset 0 0 0 2px var(--card-line); }
.seg button { font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--green-btn); color: #fff; box-shadow: 0 4px 0 var(--green-lip); }
.seg--tiers button[aria-pressed="true"] svg { background: rgba(255,255,255,.92); }
.clock-toggle[aria-pressed="true"] { --btn-bg: var(--honey-btn); --btn-edge: var(--honey-lip); background: var(--honey-btn); }
.hud-q, .hud-pill { font-family: var(--font); }
html[data-input="pointer"] :focus-visible { outline: none; }
html[data-input="pointer"] .pb-btn:focus-visible::after, html[data-input="pointer"] .chip:focus-visible::after, html[data-input="pointer"] .card:focus-visible::after { display: none; }
html[data-input="pointer"] .seg button:focus-visible { box-shadow: none; }
html[data-input="pointer"] .seg button[aria-pressed="true"]:focus-visible { box-shadow: 0 4px 0 var(--green-lip); }
@media (max-width: 599px) {
  .card--featured { flex-direction: column; }
  .card--featured .card-thumb { width: calc(100% - 4px); margin: 2px 2px 0; border-radius: 22px 22px 0 0; aspect-ratio: 4 / 3; }
  .card--featured .card-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ---------- B1: year chips, Help me, pause-card challenge switch, confidence check, exit ticket ---------- */
.seg--years { margin-bottom: 10px; }
.seg--years button { min-width: 0; min-height: 48px; flex: 1 1 0; font-weight: 700; }
.support-btn.is-on { background: var(--honey-btn); color: var(--ink); box-shadow: 0 3px 0 var(--honey-lip); }
.pause-content { display: grid; gap: 12px; justify-items: center; }
.pause-label { margin: 0; font-weight: 600; }
.face-row { display: grid; grid-template-columns: repeat(3, minmax(0, 104px)); gap: 8px; justify-content: center; }
.face-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; min-height: 96px; padding: 10px 4px; line-height: 1.15; border-radius: 20px; border: 0; background: #fff; font: 600 .95rem var(--font); color: var(--ink); box-shadow: inset 0 0 0 2px var(--card-line), 0 4px 0 var(--card-lip); cursor: pointer; }
.face-btn svg { width: 48px; height: 48px; }
.face-btn:active { transform: translateY(4px); box-shadow: inset 0 0 0 2px var(--card-line); }
.ticket { display: grid; gap: 10px; text-align: center; }
.ticket-count { margin: 0; font-weight: 600; color: #5E6E8C; }
.ticket-q { margin: 0; font-weight: 700; font-size: 1.25rem; }
.ticket-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 10px; }
.ticket-choice { min-height: 64px; border: 0; border-radius: 18px; background: #fff; font: 700 1.2rem var(--font); color: var(--ink); box-shadow: inset 0 0 0 2px var(--card-line), 0 4px 0 var(--card-lip); cursor: pointer; }
.ticket-choice.is-right { background: #E5F8EC; box-shadow: inset 0 0 0 3px #2E9E5B, 0 4px 0 #1F7A45; }
.ticket-choice.is-wrong { background: #FFE3DA; box-shadow: inset 0 0 0 3px #E2533C, 0 4px 0 #B33A25; }
.ticket-choice:disabled { cursor: default; color: var(--ink); }
.ticket-feedback { margin: 0; font-weight: 600; }
.ticket-big { margin: 0; font-weight: 700; font-size: 1.6rem; }
.ticket-note { margin: 0; color: #5E6E8C; font-size: .95rem; }

/* Question kit (core/qkit.js): worked-example card */
.worked { display: grid; gap: 10px; justify-items: center; }
.worked-steps { margin: 0; padding-left: 1.4em; text-align: left; font-weight: 600; line-height: 1.45; max-width: 34em; }
.worked-steps li + li { margin-top: 4px; }

/* CPA library: interactive base-ten blocks (core/cpa/blocks.js) */
.blocks { display: grid; gap: 10px; width: 100%; }
.blocks-canvas { display: block; width: 100%; touch-action: none; border-radius: 14px; }
.blocks-say { margin: 0; font-weight: 700; text-align: center; min-height: 1.5em; }
.blocks-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.blocks-col { display: grid; gap: 6px; align-content: start; }
.blocks-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.blocks-btn { min-height: 48px; min-width: 0; padding: 6px 6px; font-size: .86rem; line-height: 1.15; white-space: normal; }
.blocks-row .blocks-btn { font-size: 1.4rem; font-weight: 900; }
.blocks-btn:disabled { opacity: .45; cursor: default; }

/* CPA gallery (templates/cpa-gallery/, builders and teachers only) */
.cpa-gallery-page { background: var(--cream, #FFF8EC); }
.cpa-gallery { max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; }
.cpa-gallery h1 { margin: 0 0 6px; }
.cpa-intro, .cpa-note { margin: 0 0 14px; max-width: 46em; }
.cpa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; margin-top: 14px; }
.cpa-card { margin: 0; padding: 12px; background: #fff; border-radius: 18px; box-shadow: inset 0 0 0 2px #E3E9F2; min-width: 0; }
.cpa-card figcaption, .cpa-card h2 { font-weight: 800; margin: 0 0 8px; font-size: 1rem; }
.cpa-card canvas { display: block; max-width: 100%; }
.cpa-card--wide { max-width: 720px; }
@media (max-width: 400px) { .blocks-row { grid-template-columns: 1fr; } .cpa-gallery { padding: 16px 10px 40px; } .cpa-card { padding: 10px; } }
/* Long questions (reasoning formats): smaller type so the question box stays compact on short screens */
.hud-q.hud-q--long { font-size: clamp(1.15rem, .75rem + 1.3vmin, 1.7rem); line-height: 1.2; }
@media (max-width: 479px) { .hud-q.hud-q--long { font-size: 1.22rem; } }
@media (max-width: 359px) { .hud-q.hud-q--long { font-size: 1.08rem; } }
@media (max-height: 420px) { .hud-q.hud-q--long { font-size: 1.02rem; } }

/* ---- Screen standard (25 Nov): the start card ("how to play" window) ----
   Labelled rows (How to play · Your year · Challenge · Level), numbered steps, calm spacing; on tablets and big
   screens the whole card is drawn larger so nothing looks tiny. One design for every game. */
.game-card .opt { display: flex; flex-direction: column; gap: 6px; }
.game-card .opt-label { font-size: .74rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); padding-left: 6px; }
.game-card .opt { gap: 4px; }
.game-card .opt--howto .picto-row { background: var(--paper); border-radius: 18px; padding: 10px 6px 8px; box-shadow: inset 0 0 0 2px var(--line); gap: 4px; justify-content: space-around; flex-wrap: nowrap; }
.game-card .opt--howto .picto { flex: 1 1 0; width: auto; min-width: 0; max-width: 130px; }
.game-card .game-card-content { gap: 10px; }
.game-card .opt--howto .opt-label { text-align: left; }
.picto-icon { position: relative; }
.picto-num { position: absolute; top: -6px; left: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--bamboo); color: #fff; font: 900 .78rem/22px var(--font); text-align: center; box-shadow: 0 2px 0 var(--bamboo-dark); }
.game-card .opt--howto .picto { font-size: .82rem; line-height: 1.2; }
.game-card .opt--howto .picto-icon { width: 54px; height: 54px; border-radius: 16px; background: #fff; }
.game-card .opt--howto .picto-icon svg { width: 40px; height: 40px; }
.game-card > h2 { letter-spacing: .01em; }
/* big screens: draw the card larger (it was sized for phones) */
@media (min-width: 700px) and (min-height: 780px) { .shell-overlay .game-card { zoom: 1.22; max-height: calc(100% / 1.22); } }
@media (min-width: 1000px) and (min-height: 1150px) { .shell-overlay .game-card { zoom: 1.38; max-height: calc(100% / 1.38); } }
/* sideways phones: two columns — how to play and year on the left, challenge, level and Play on the right */
@media (orientation: landscape) and (max-height: 540px) {
  .game-card .opt { grid-column: 2; }
  .game-card .opt--years { grid-column: 1; grid-row: 2; align-self: end; }
  .game-card .opt--howto { grid-column: 1; grid-row: 3 / span 4; align-self: start; }
  .game-card:not(:has(.opt--years)) .opt--howto { grid-row: 2 / span 4; }
  .game-card .opt--howto .picto-icon { width: 50px; height: 50px; }
  .game-card .opt--howto .picto-icon svg { width: 36px; height: 36px; }
}
/* very short screens: the labels go (the rows still read in the same order) so Play stays on screen */
@media (orientation: portrait) and (max-height: 820px) { .game-card .opt--howto .opt-label { display: none; } .game-card > h2 { font-size: 1.4rem; } }
@media (orientation: landscape) and (max-height: 420px), (orientation: portrait) and (max-height: 640px), (orientation: portrait) and (max-width: 359px) {
  .game-card .opt:not(.opt--howto) .opt-label { display: none; }
  .game-card .opt--howto .opt-label { display: none; }
  .game-card .opt--howto .picto-row { padding: 8px 4px 6px; }
  .game-card .opt--howto .picto-icon { width: 46px; height: 46px; border-radius: 14px; }
  .game-card .opt--howto .picto-icon svg { width: 34px; height: 34px; }
  .picto-num { width: 18px; height: 18px; font-size: .66rem; line-height: 18px; top: -5px; left: -5px; }
}

/* ---- Feedback window after a slip (25 Nov): stays until the child taps Next; one window, never two ---- */
.feedback { display: grid; gap: 10px; text-align: center; }
.feedback-words { font-weight: 800; color: var(--ink); font-size: 1.08rem; line-height: 1.35; }
.feedback-answer { display: grid; justify-items: center; gap: 2px; background: #E5F8EC; border-radius: 18px; padding: 10px 14px; box-shadow: inset 0 0 0 2px #9BD9B2; }
.feedback-answer span { font-size: .8rem; font-weight: 800; color: #2E7D4F; text-transform: uppercase; letter-spacing: .06em; }
.feedback-answer strong { font-size: 1.9rem; font-weight: 900; color: #1E2A4A; line-height: 1.15; }
.feedback-how { font-weight: 600; color: var(--ink-soft); line-height: 1.4; }
.feedback-offer { font-weight: 800; color: var(--ink); }
.worked canvas { max-width: 100%; height: auto !important; }
.feedback-answer strong.is-long { font-size: 1.15rem; line-height: 1.3; }
/* phones up to ~720px tall (iPhone SE, 8): row labels hidden so Play stays on screen */
@media (orientation: portrait) and (max-height: 720px) { .game-card .opt-label { display: none; } }
.game-card .opt--howto .picto-row:has(.picto:nth-child(4)) { flex-wrap: wrap; }
.game-card .opt--howto .picto-row:has(.picto:nth-child(4)) .picto { flex: 0 1 96px; }
@media (orientation: portrait) and (max-height: 640px), (orientation: portrait) and (max-width: 359px) {
  .game-card .opt--howto .picto-row:has(.picto:nth-child(4)) { flex-wrap: nowrap; }
  .game-card .opt--howto .picto-row:has(.picto:nth-child(4)) .picto { flex: 1 1 0; font-size: .64rem; }
}
/* banners: one line (never wrap into the question), shortened with … if needed */
.banner { white-space: nowrap; }
.banner > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 479px) { .banner { font-size: .95rem; } }

/* ---------- Finder (N1): search + Year/Topic filters ---------- */
.finder { margin: 4px 0 6px; }
.finder-label { display: block; font-weight: 800; font-size: 1.05rem; margin: 0 2px 6px; }
.finder-box { position: relative; display: flex; align-items: center; }
.finder-icon { position: absolute; left: 14px; width: 24px; height: 24px; color: var(--ink-soft); pointer-events: none; }
.finder-box input {
  width: 100%; min-height: 52px; padding: 0 54px 0 48px; border: 0; border-radius: 999px;
  background: #fff; color: var(--ink); font: 600 1.05rem/1.2 var(--font);
  box-shadow: inset 0 0 0 2px var(--card-line), 0 4px 0 var(--card-lip);
  -webkit-appearance: none; appearance: none;
}
.finder-box input::placeholder { color: #5D6784; opacity: 1; } /* 5.6:1 on white */
.finder-box input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.finder-box input:focus-visible { outline: 3px solid var(--green-btn); outline-offset: 2px; }
.finder-clear {
  position: absolute; right: 2px; width: 48px; height: 48px; border: 0; border-radius: 999px;
  background: none; color: var(--ink-soft); cursor: pointer; display: grid; place-items: center; touch-action: manipulation;
}
.finder-clear svg { width: 24px; height: 24px; }
.finder-clear:focus-visible { outline: 3px solid var(--green-btn); outline-offset: -3px; }
.finder-more { margin-top: 8px; }
.finder-more > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  min-height: 48px; padding: 0 16px; border-radius: 999px; font-weight: 800; color: var(--ink);
  touch-action: manipulation;
}
.finder-more > summary::-webkit-details-marker { display: none; }
.finder-more > summary::before { content: ''; width: 9px; height: 9px; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: rotate(-45deg); }
.finder-more[open] > summary::before { transform: rotate(45deg); }
.finder-more > summary:focus-visible { outline: 3px solid var(--green-btn); outline-offset: 2px; }
.finder-picked:not(:empty) { background: #E7F6EC; color: #14532F; border-radius: 999px; padding: 4px 10px; font-weight: 700; }
.chips--wrap { flex-wrap: wrap; overflow: visible; padding-bottom: 4px; }
.chip--small { padding: 0 16px; }
.finder-count { margin: 4px 4px 0; min-height: 1.2em; font-weight: 700; color: var(--ink-soft); }
.finder-empty { text-align: center; padding: 18px 8px 8px; }
.finder-empty p { font-weight: 700; color: var(--ink-soft); margin: 0 0 12px; }
@media (min-width: 900px) { .finder-box { max-width: 640px; } }
.finder-clear[hidden], .finder-empty[hidden], #featured-sec[hidden] { display: none; }
/* Find by objective */
.obj-cta { margin: 14px 0; }
.obj-list { padding-left: 1.2em; }
.obj-list li { margin: 0 0 12px; line-height: 1.45; }
.obj-games { font-weight: 700; }
.obj-games a { display: inline-block; min-height: 32px; padding: 4px 0; }
.page [id^="year-"], #top-obj { scroll-margin-top: 80px; }
.page h2[tabindex="-1"]:focus, #top-obj:focus { outline: none; }
.page nav.chips a.chip { text-decoration: none; color: var(--ink); }

/* =====================================================================================
   Pippin games: bright kids' colour scheme (25 Nov 2026)
   Sunny yellow, candy purple, bubblegum pink and splash teal, chunky shapes and bouncy motion.
   Everything below overrides the calmer PlayBeyond look above. Text keeps WCAG AA contrast (dark ink on bright
   colours, white only on the deep purple).
   ===================================================================================== */
:root {
  --k-sun: #FFD23F; --k-sun-deep: #F2A922;
  --k-orange: #FF9F1C;
  --k-pink: #FF5D9E; --k-pink-soft: #FFE1EE;
  --k-purple: #6A3FE0; --k-purple-deep: #4B23B8; --k-purple-soft: #EDE5FF;
  --k-teal: #12B8A6; --k-teal-soft: #D8F7F2;
  --k-sky: #38B6FF; --k-sky-soft: #DDF2FF;
  --k-lime: #6CCB3F; --k-lime-soft: #E6F8D8;
  --ink: #241B4B;
  --ink-soft: #3E3570;
  --cream: #FFFBEF;
  --line: #F1E3B8;
}

/* ---- Home page: a sunny sky with bubbles ---- */
body[data-page="home"] {
  background:
    radial-gradient(circle at 8% 12%, rgba(255,255,255,.75) 0 38px, transparent 39px),
    radial-gradient(circle at 92% 22%, rgba(255,255,255,.6) 0 26px, transparent 27px),
    radial-gradient(circle at 85% 78%, rgba(255,210,63,.45) 0 60px, transparent 61px),
    radial-gradient(circle at 6% 70%, rgba(255,93,158,.22) 0 70px, transparent 71px),
    linear-gradient(180deg, #8FD8FF 0%, #C9EEFF 45%, #FFF1C9 100%);
  background-attachment: fixed;
}
body[data-page="home"] .solo h1 {
  color: var(--k-purple-deep); font-size: clamp(2rem, 7vw, 3.1rem); letter-spacing: .01em;
  text-shadow: 0 3px 0 var(--k-sun), 0 6px 0 rgba(36,27,75,.12);
}
body[data-page="home"] .solo > p { font-weight: 800; font-size: 1.1rem; color: var(--ink); }
body[data-page="home"] .solo-mark { width: 96px; height: 96px; animation: k-bob 2.6s ease-in-out infinite; }
.game-tile { border: 5px solid var(--k-sun); box-shadow: 0 8px 0 var(--k-sun-deep), 0 16px 30px rgba(75,35,184,.18); border-radius: 30px; transition: transform .2s ease; }
.game-tile:nth-child(3n+2) { border-color: var(--k-pink); box-shadow: 0 8px 0 #D93D7C, 0 16px 30px rgba(75,35,184,.18); }
.game-tile:nth-child(3n+3) { border-color: var(--k-teal); box-shadow: 0 8px 0 #0C8C7E, 0 16px 30px rgba(75,35,184,.18); }
.game-tile:hover { transform: translateY(-4px) rotate(-.4deg); }
.game-tile h2 { color: var(--k-purple-deep); }
.game-tile .badge { display: inline-block; align-self: flex-start; background: var(--k-purple-soft); color: var(--k-purple-deep); padding: 3px 12px; border-radius: 999px; }
.solo-promise { background: rgba(255,255,255,.7); display: inline-block; padding: 6px 16px; border-radius: 999px; }

/* ---- Buttons: sunny primary, white secondary with a purple edge ---- */
.pb-btn { font-weight: 900; }
.pb-btn--green {
  --btn-bg: linear-gradient(180deg, #FFE36E 0%, #FFC21F 100%); --btn-edge: #E08A00; --btn-fg: var(--ink);
  background: var(--btn-bg);
}
.pb-btn--green::before { content: none; }
.pb-btn--cream { --btn-bg: #FFFFFF; --btn-edge: #C9B8F5; --btn-fg: var(--k-purple-deep); }
.pb-btn--big { min-height: 68px; font-size: 1.4rem; border-radius: 26px; }
.pb-btn--big svg { width: 30px; height: 30px; }

/* ---- Game top bar: candy purple to pink ---- */
.shell-bar { background: linear-gradient(90deg, #5B2FD6 0%, #8A3FE0 55%, #D94A9A 100%); box-shadow: 0 3px 0 rgba(36,27,75,.25); position: relative; z-index: 3; }
.shell-title { font-size: 1.12rem; text-shadow: 0 2px 0 rgba(36,27,75,.35); }
.bar-btn { border-radius: 50%; background: rgba(255,255,255,.2); box-shadow: inset 0 -3px 0 rgba(36,27,75,.22); }
.bar-btn:hover { background: rgba(255,255,255,.3); }

/* ---- Overlay and cards: a chunky sticker look ---- */
.shell-overlay { background: radial-gradient(circle at 50% 40%, rgba(106,63,224,.30), rgba(36,27,75,.55)); }
.game-card {
  background: var(--cream); border: 5px solid var(--k-sun); border-radius: 34px;
  box-shadow: 0 9px 0 var(--k-sun-deep), 0 22px 44px rgba(36,27,75,.35);
  animation: k-card-in .45s cubic-bezier(.2,1.4,.4,1) both;
}
.game-card > h2 {
  align-self: center; background: linear-gradient(90deg, var(--k-purple), #9B4FE6); color: #fff;
  padding: 8px 22px 9px; border-radius: 999px; font-size: 1.45rem;
  box-shadow: 0 4px 0 var(--k-purple-deep); transform: rotate(-1.5deg); text-align: center;
}
.game-card p { color: var(--ink-soft); }
.game-card .opt-label {
  align-self: flex-start; color: #fff; background: var(--k-pink); padding: 3px 12px 4px; border-radius: 999px;
  letter-spacing: .04em; box-shadow: 0 2px 0 #D93D7C;
}
.game-card .opt--chars .opt-label { background: var(--k-teal); box-shadow: 0 2px 0 #0C8C7E; }
.game-card .opt--tiers .opt-label { background: var(--k-lime); box-shadow: 0 2px 0 #4A9A26; color: var(--ink); }
.game-card .opt--level .opt-label { background: var(--k-sky); box-shadow: 0 2px 0 #1F86C4; color: var(--ink); }

/* ---- How to play: a row of bouncy, colourful sticker tiles ---- */
.game-card .opt--howto .picto-row { background: transparent; box-shadow: none; padding: 4px 0 2px; gap: 8px; flex-wrap: wrap; justify-content: center; }
.game-card .opt--howto .picto {
  flex: 0 1 calc(25% - 8px); min-width: 86px; max-width: 140px;
  background: var(--k-sun); border-radius: 20px; padding: 10px 6px 8px;
  --tile: #FFF1C2; --edge: var(--k-sun);
  background: var(--tile); box-shadow: inset 0 0 0 3px var(--edge), 0 4px 0 var(--edge);
  animation: k-tile-in .5s cubic-bezier(.2,1.5,.4,1) both; animation-delay: calc(var(--i, 0) * 70ms + .15s);
  transition: transform .15s ease;
}
.game-card .opt--howto .picto:nth-child(6n+2) { --tile: var(--k-pink-soft); --edge: var(--k-pink); }
.game-card .opt--howto .picto:nth-child(6n+3) { --tile: var(--k-teal-soft); --edge: var(--k-teal); }
.game-card .opt--howto .picto:nth-child(6n+4) { --tile: var(--k-purple-soft); --edge: #9C7BF2; }
.game-card .opt--howto .picto:nth-child(6n+5) { --tile: var(--k-sky-soft); --edge: var(--k-sky); }
.game-card .opt--howto .picto:nth-child(6n+6) { --tile: var(--k-lime-soft); --edge: var(--k-lime); }
.game-card .opt--howto .picto:hover { transform: translateY(-3px) rotate(-2deg); }
.game-card .opt--howto .picto-icon {
  width: 56px; height: 56px; border-radius: 50%; background: #fff; box-shadow: 0 3px 0 rgba(36,27,75,.12);
  animation: k-bob 2.4s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -.3s);
}
.game-card .opt--howto .picto-icon svg { width: 40px; height: 40px; }
.picto-text { font-weight: 800; color: var(--ink); }
.picto-num { background: var(--k-purple); box-shadow: 0 2px 0 var(--k-purple-deep); width: 24px; height: 24px; line-height: 24px; top: -6px; left: -8px; }

/* ---- Hero panel: your character, big, with their super move ---- */
.start-hero {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: 26px;
  background: linear-gradient(100deg, var(--k-sky-soft), var(--k-purple-soft)); box-shadow: inset 0 0 0 3px #B9A6F5;
}
.hero-pic { flex: none; width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #fff 0 55%, #FFE9A8 56%); box-shadow: 0 4px 0 var(--k-sun-deep); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hero-pic canvas { width: 96px; height: 96px; }
.hero-bubble { min-width: 0; }
.hero-name { font-weight: 900; font-size: 1.15rem; color: var(--k-purple-deep); }
.hero-super { font-weight: 700; font-size: .92rem; color: var(--ink-soft); }
.start-hero.is-new .hero-pic { animation: k-hero-pop .5s cubic-bezier(.2,1.6,.4,1); }

/* ---- Pickers: chunky, colourful when chosen ---- */
.level-pick button { border-color: #E4DAFB; border-radius: 18px; box-shadow: 0 3px 0 #E4DAFB; }
.level-pick button[aria-pressed="true"] { border-color: var(--k-purple); background: var(--k-purple-soft); box-shadow: 0 3px 0 var(--k-purple); transform: translateY(-2px); }
.char-pick button[aria-pressed="true"] { border-color: var(--k-teal); background: var(--k-teal-soft); box-shadow: 0 3px 0 #0C8C7E; }
.char-pick button { transition: transform .15s ease; }
.char-pick button:hover { transform: translateY(-3px); }
.seg { box-shadow: inset 0 0 0 3px #E4DAFB; }
.seg--tiers button[data-tier="must"][aria-pressed="true"] { background: var(--k-lime); box-shadow: 0 3px 0 #4A9A26; }
.seg--tiers button[data-tier="should"][aria-pressed="true"] { background: var(--k-sun); box-shadow: 0 3px 0 var(--k-sun-deep); }
.seg--tiers button[data-tier="could"][aria-pressed="true"] { background: var(--k-pink); box-shadow: 0 3px 0 #D93D7C; }

/* ---- In-game: HUD stickers, banners and touch buttons ---- */
.hud-pill { background: rgba(255,255,255,.95); box-shadow: 0 3px 0 rgba(106,63,224,.35); border: 2px solid #E4DAFB; }
.hud-super .bar i { background: linear-gradient(90deg, var(--k-sun), var(--k-orange), var(--k-pink)); }
.vbtn { background: rgba(255,255,255,.38); border-color: rgba(255,255,255,.85); }
.vbtn--jump { background: rgba(255,210,63,.55); }
.vbtn--super { background: rgba(255,93,158,.35); }

/* ---- Motion ---- */
@keyframes k-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes k-card-in { from { opacity: 0; transform: translateY(24px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes k-tile-in { from { opacity: 0; transform: translateY(14px) scale(.7) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes k-hero-pop { 0% { transform: scale(.6) rotate(-10deg); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  body[data-page="home"] .solo-mark, .game-card, .game-card .opt--howto .picto, .game-card .opt--howto .picto-icon, .start-hero.is-new .hero-pic { animation: none !important; }
  .game-tile:hover, .game-card .opt--howto .picto:hover, .char-pick button:hover { transform: none; }
}
/* sideways phones: how to play fills the left column as a compact 4-across grid; the hero, pickers and Play sit on the right */
@media (orientation: landscape) and (max-height: 540px) {
  .game-card .opt--howto { grid-column: 1; grid-row: 2 / span 9; align-self: start; }
  .game-card:not(:has(.opt--years)) .opt--howto { grid-row: 2 / span 9; }
  .start-hero { grid-column: 2; padding: 4px 8px 4px 4px; gap: 8px; border-radius: 20px; }
  .hero-pic, .hero-pic canvas { width: 56px; height: 56px; }
  .hero-name { font-size: .95rem; }
  .hero-super { font-size: .74rem; line-height: 1.25; }
  .game-card .opt--howto .picto-row { gap: 6px; }
  .game-card .opt--howto .picto { flex: 0 0 calc(25% - 6px); min-width: 0; max-width: none; padding: 6px 2px 5px; border-radius: 14px; font-size: .68rem; }
  .game-card .opt--howto .picto-icon { width: 38px; height: 38px; }
  .game-card .opt--howto .picto-icon svg { width: 28px; height: 28px; }
  .picto-num { width: 18px; height: 18px; line-height: 18px; font-size: .62rem; top: -5px; left: -6px; }
  .game-card > h2 { font-size: 1.1rem; padding: 5px 16px 6px; justify-self: center; }
  .char-pick button { min-width: 56px; }
  .char-pick canvas { width: 36px; height: 36px; }
}
@media (orientation: portrait) and (max-height: 700px) { .hero-pic, .hero-pic canvas { width: 72px; height: 72px; } .hero-super { font-size: .82rem; } }

/* =====================================================================================
   Pippin's Playground: the FUN look (26 Nov 2026, owner: "a games playground, not a learning site")
   Loud colour blocks, rainbow stripes, chunky outlined tilted letters, stickers, everything squishes and bounces.
   Text stays readable: dark ink on bright colours, white only on deep purple / space black. Calm under "reduce motion".
   ===================================================================================== */
:root {
  --pg-ink: #241B4B;
  --pg-outline: 0 0 0 transparent;
  --pg-rainbow: linear-gradient(90deg, #FF3B3B 0 16.6%, #FF9F1C 0 33.3%, #FFD23F 0 50%, #2FBF71 0 66.6%, #1FA9FF 0 83.3%, #8A3FE0 0);
  --pg-display: 800 1rem/1 var(--font);
}
body.pg {
  background-color: #FFE45C;
  background-image:
    radial-gradient(circle at 20px 20px, rgba(255,255,255,.55) 0 5px, transparent 6px),
    radial-gradient(circle at 60px 60px, rgba(255,93,158,.35) 0 4px, transparent 5px);
  background-size: 80px 80px;
  background-attachment: scroll;
  overflow-x: hidden;
}
body.pg.pg-calm { background: #FFF8EC; }
.pg-skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: #fff; color: var(--pg-ink); padding: 10px 16px; border-radius: 14px; font-weight: 800; }
.pg-skip:focus { top: 8px; }
.pg-round {
  appearance: none; border: 3px solid var(--pg-ink); width: 54px; height: 54px; border-radius: 50%; flex: none;
  background: #fff; color: var(--pg-ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 0 var(--pg-ink);
  touch-action: manipulation;
}
.pg-round svg { width: 30px; height: 30px; }
.pg-round:active { transform: translateY(4px); box-shadow: 0 0 0 var(--pg-ink); }

/* ---- Header: rainbow stripes, bouncy logo, characters chasing each other ---- */
.pg-header {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(-12deg, rgba(255,255,255,.12) 0 22px, transparent 22px 44px),
    linear-gradient(135deg, #6A3FE0 0%, #B03FE0 45%, #FF4FA3 100%);
  border-bottom: 6px solid var(--pg-ink);
  padding: calc(14px + var(--safe-top)) calc(16px + var(--safe-right)) clamp(34px, 5vw, 44px) calc(16px + var(--safe-left));
}
.pg-header::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 12px; background: var(--pg-rainbow); }
.pg-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; max-width: 1200px; margin: 0 auto; position: relative; }
.pg-header-row .py-logo { z-index: 2; }
.pg-header-row .pg-sound { position: relative; z-index: 4; margin-top: 8px; }
/* PlayYippee! logo (approved 26 Nov 2026): glossy 3D letters on a comic burst. Sized in em from --py-f (the YIPPEE letter size). */
.py-logo { --py-f: clamp(28px, 6.6vw, 50px); margin: 0; position: relative; flex: none; font: 900 var(--py-f)/1 var(--font); width: 4.571em; height: 3.571em; cursor: pointer; }
.py-burst { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 .07em .06em rgba(28,10,85,.4)); }
.py-words { position: absolute; left: 0; right: 0; top: .58em; display: flex; flex-direction: column; align-items: center; transform: rotate(-4deg); }
.py-play { font-size: .814em; line-height: .92; letter-spacing: .03em; margin: 0 -.03em .02em 0; white-space: nowrap; }
.py-yip { line-height: 1; white-space: nowrap; }
.py-l { position: relative; display: inline-block; margin: 0 -.015em; transform: translateY(var(--y)) rotate(var(--r)); }
.py-l i, .py-l u, .py-l b { font-style: normal; text-decoration: none; font-weight: inherit; }
.py-l i { color: #241B4B; -webkit-text-stroke: .2em #241B4B; text-shadow: 0 .05em 0 #241B4B, 0 .1em 0 #241B4B, 0 .15em 0 #241B4B, 0 .19em .1em rgba(20,8,60,.5); }
.py-l u { position: absolute; left: 0; top: 0; color: var(--d); -webkit-text-stroke: .05em var(--d); text-shadow: 0 .03em 0 var(--d), 0 .06em 0 var(--d), 0 .09em 0 var(--d); }
.py-l b { position: absolute; left: 0; top: 0; color: transparent; background: linear-gradient(180deg, var(--g1) 0%, var(--g1) 22%, var(--g2) 78%, var(--g2) 100%); -webkit-background-clip: text; background-clip: text; }
.py-bang i, .py-bang u, .py-bang b { clip-path: inset(-20% -20% 30% -20%); }
.py-star { position: absolute; left: 50%; bottom: -.07em; width: .5em; height: .5em; margin-left: -.25em; display: block; filter: drop-shadow(0 .035em 0 #241B4B); }
.py-star svg { width: 100%; height: 100%; display: block; }
.pg-parade { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; display: block; }
.pg-duck { position: absolute; top: 4px; left: -90px; width: 64px; height: 64px; z-index: 1; pointer-events: none; opacity: 0; }
.pg-duck canvas { width: 64px; height: 64px; }
.pg-duck.is-floating { animation: pg-duck 9s linear both; }
@keyframes pg-duck { 0% { opacity: 1; transform: translate(0, 40px) rotate(-8deg); } 25% { transform: translate(28vw, 20px) rotate(8deg); } 50% { transform: translate(55vw, 44px) rotate(-8deg); } 75% { transform: translate(80vw, 18px) rotate(8deg); } 100% { opacity: 1; transform: translate(calc(100vw + 120px), 36px) rotate(-8deg); } }

/* ---- Shouty headings ---- */
.pg-shout {
  font: var(--pg-display); font-size: clamp(1.8rem, 7vw, 2.9rem); color: #fff; text-align: center; margin: 0 0 10px;
  -webkit-text-stroke: .1em var(--pg-ink); paint-order: stroke fill; text-shadow: 0 .1em 0 var(--pg-ink); transform: rotate(-2deg); letter-spacing: .02em;
}

/* ---- WHO'S PLAYING? ---- */
#main { max-width: 1200px; margin: 0 auto; padding: 18px calc(16px + var(--safe-right)) 24px calc(16px + var(--safe-left)); }
.pg-who { text-align: center; margin-bottom: 18px; }
.pg-pick { display: flex; justify-content: center; gap: 30px clamp(8px, 2vw, 18px); flex-wrap: wrap; padding-top: 16px; }
.pg-char {
  appearance: none; cursor: pointer; position: relative; border: 4px solid var(--pg-ink); border-radius: 28px;
  width: clamp(96px, 17vw, 150px); padding: 6px 4px 8px; background: #fff; color: var(--pg-ink);
  box-shadow: 0 6px 0 var(--pg-ink); transform: rotate(calc((var(--i) - 2) * 1.5deg)); transition: transform .15s ease, background .15s;
  touch-action: manipulation; font: inherit;
}
.pg-char:nth-child(1) { --tint: #E9E6FF; } .pg-char:nth-child(2) { --tint: #FFE3C8; } .pg-char:nth-child(3) { --tint: #FFF4B0; } .pg-char:nth-child(4) { --tint: #D2EEFF; } .pg-char:nth-child(5) { --tint: #FFDCEC; }
.pg-char-pic { display: block; border-radius: 20px; background: var(--tint); aspect-ratio: 1; display: grid; place-items: center; overflow: visible; }
.pg-char-pic canvas { width: 100%; height: auto; aspect-ratio: 1; }
.pg-char-name { display: block; font-weight: 800; font-size: clamp(1rem, 2.6vw, 1.25rem); margin-top: 4px; }
.pg-char[aria-pressed="true"] { background: #FFE14D; transform: rotate(0) scale(1.07); box-shadow: 0 6px 0 var(--pg-ink), 0 0 0 6px #fff, 0 0 0 10px #FF4FA3; z-index: 1; }
.pg-char[aria-pressed="true"]::before { content: '★ PLAYING'; position: absolute; top: -16px; left: 0; right: 0; margin: 0 auto; width: max-content; transform: rotate(-4deg); background: #FF4FA3; color: #fff; font-weight: 800; font-size: .78rem; padding: 3px 10px; border-radius: 999px; border: 3px solid var(--pg-ink); white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .pg-char:hover { transform: rotate(0) translateY(-4px); } }
.pg-picked { margin: 14px auto 0; font-weight: 700; font-size: 1.08rem; background: #fff; border: 3px solid var(--pg-ink); display: inline-block; padding: 6px 16px; border-radius: 999px; max-width: 100%; }
.pg-picked-tip { color: #6A3FE0; }

/* ---- Search and picture filters ---- */
.pg-find { background: #fff; border: 4px solid var(--pg-ink); border-radius: 28px; box-shadow: 0 6px 0 var(--pg-ink); padding: 12px; margin-bottom: 22px; display: grid; gap: 10px; }
.pg-search { display: block; position: relative; }
.pg-search::before { content: ''; position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; border: 4px solid var(--pg-ink); border-radius: 50%; transform: translateY(-62%); }
.pg-search::after { content: ''; position: absolute; left: 34px; top: 58%; width: 11px; height: 4px; background: var(--pg-ink); border-radius: 2px; transform: rotate(45deg); }
.pg-search input {
  width: 100%; min-height: 56px; border: 3px solid var(--pg-ink); border-radius: 999px; padding: 0 18px 0 56px;
  font: 700 1.15rem/1 var(--font); color: var(--pg-ink); background: #FFF8D6;
}
.pg-search input::placeholder { color: #6B6290; }
.pg-search input:focus { outline: none; box-shadow: 0 0 0 4px #FF4FA3; }
.pg-filters { display: grid; gap: 8px; }
.pg-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 8px; scroll-snap-type: x proximity; }
.pg-chips::-webkit-scrollbar { display: none; }
.pg-chip {
  --c: #fff; --e: var(--pg-ink);
  appearance: none; flex: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 52px; padding: 0 16px 0 6px;
  border: 3px solid var(--pg-ink); border-radius: 999px; background: #fff; color: var(--pg-ink); font: 800 1rem/1 var(--font);
  box-shadow: 0 4px 0 var(--pg-ink); scroll-snap-align: start; touch-action: manipulation; white-space: nowrap;
}
.pg-chip-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #F4F0FF; overflow: hidden; }
.pg-chip-ic svg { width: 30px; height: 30px; }
.pg-chip-ic canvas { width: 34px; height: 34px; }
.pg-chip[aria-pressed="true"] { background: #FFE14D; transform: translateY(2px); box-shadow: 0 2px 0 var(--pg-ink); }
.pg-chips--type .pg-chip[aria-pressed="true"][data-value]:not([data-value=""]) { background: var(--c); color: #fff; -webkit-text-stroke: 0; text-shadow: 0 2px 0 var(--pg-ink); }
.pg-chips--tier .pg-chip[data-value="must"][aria-pressed="true"] { background: #8BE05A; }
.pg-chips--tier .pg-chip[data-value="could"][aria-pressed="true"] { background: #FF8FC4; }

/* ---- Shelves ---- */
.pg-arcade { display: grid; gap: 22px; }
.pg-arcade:focus { outline: none; }
.pg-shelf {
  --c: #6A3FE0; --e: #3E1FA0; --ink: #fff; --a: #FFE14D;
  position: relative; background: var(--c); border: 4px solid var(--pg-ink); border-radius: 32px; box-shadow: 0 7px 0 var(--pg-ink);
  padding: 12px 0 14px; overflow: hidden;
}
.pg-shelf--new { --c: #FF4FA3; background: repeating-linear-gradient(45deg, #FF4FA3 0 26px, #FF6DB3 26px 52px); }
.pg-shelf--loved { --c: #FFB020; background: radial-gradient(circle at 10% 20%, rgba(255,255,255,.35) 0 18px, transparent 19px), radial-gradient(circle at 90% 70%, rgba(255,255,255,.3) 0 26px, transparent 27px), #FFB020; }
.pg-shelf--found { --c: #fff; background: #fff; }
.pg-world--neon { background: radial-gradient(circle at 15% 30%, #fff 0 1.5px, transparent 2px) 0 0/60px 50px, radial-gradient(circle at 70% 70%, #39FFE0 0 1.5px, transparent 2px) 0 0/90px 70px, linear-gradient(180deg, #12002E, #4B1593); }
.pg-world--chequered { background: linear-gradient(#FF7A00, #FF7A00) 0 28px/100% 100% no-repeat, conic-gradient(#fff 25%, #111 0 50%, #fff 0 75%, #111 0) 0 0/28px 28px; }
.pg-world--glitter { background: radial-gradient(circle at 20% 30%, #FFF27A 0 2px, transparent 3px) 0 0/50px 46px, radial-gradient(circle at 60% 80%, #fff 0 2px, transparent 3px) 0 0/70px 60px, linear-gradient(135deg, #FF4FB8, #B44CFF); }
.pg-world--playground { background: repeating-linear-gradient(90deg, #FF3B3B 0 40px, #FF5252 40px 80px); }
.pg-world--confetti { background: radial-gradient(circle at 30% 40%, #FFE14D 0 3px, transparent 4px) 0 0/40px 44px, radial-gradient(circle at 70% 20%, #FF4FB8 0 3px, transparent 4px) 0 0/56px 50px, #1FA9FF; }
.pg-world--jungle { background: radial-gradient(circle at 10% 110%, #23A85E 0 60px, transparent 61px), radial-gradient(circle at 85% 120%, #23A85E 0 80px, transparent 81px), #2FBF71; }
.pg-shelf-head { display: flex; align-items: center; gap: 10px; padding: 6px 16px 8px; flex-wrap: wrap; }
.pg-world--chequered .pg-shelf-head { padding-top: 26px; }
.pg-shelf-ic { width: 48px; height: 48px; background: #fff; border: 3px solid var(--pg-ink); border-radius: 50%; display: grid; place-items: center; flex: none; transform: rotate(-8deg); }
.pg-shelf-ic svg { width: 34px; height: 34px; }
.pg-shelf-title {
  font: var(--pg-display); font-size: clamp(1.6rem, 5.5vw, 2.3rem); color: #fff; letter-spacing: .02em; transform: rotate(-2deg);
  -webkit-text-stroke: .1em var(--pg-ink); paint-order: stroke fill; text-shadow: 0 .09em 0 var(--pg-ink);
}
.pg-shelf--found .pg-shelf-title { color: #FFE14D; }
.pg-shelf-shout { font-weight: 800; font-size: .95rem; background: var(--a); color: var(--pg-ink); border: 3px solid var(--pg-ink); border-radius: 999px; padding: 4px 12px; transform: rotate(3deg); }
.pg-row-wrap { position: relative; }
.pg-row {
  list-style: none; margin: 0; padding: 14px 16px 18px; display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-padding: 0 16px; scrollbar-width: none; overscroll-behavior-x: contain;
}
.pg-row::-webkit-scrollbar { display: none; }
.pg-grid { list-style: none; margin: 0; padding: 14px 16px 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.pg-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 56px; height: 56px; border-radius: 50%;
  border: 3px solid var(--pg-ink); background: #fff; color: var(--pg-ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 0 var(--pg-ink);
}
.pg-arrow svg { width: 30px; height: 30px; }
.pg-arrow--left { left: 8px; } .pg-arrow--right { right: 8px; }
.pg-arrow[hidden] { display: none; }
@media (hover: none) { .pg-arrow { display: none; } }

/* ---- Tiles: chunky toy boxes / arcade stickers ---- */
.tile { flex: 0 0 auto; width: clamp(236px, 70vw, 280px); scroll-snap-align: start; transform: rotate(var(--rot, 0deg)); }
.pg-grid .tile { width: auto; }
.tile-btn {
  appearance: none; display: flex; flex-direction: column; width: 100%; height: 100%; text-align: left; cursor: pointer; position: relative;
  background: #fff; color: var(--pg-ink); border: 4px solid var(--pg-ink); border-radius: 26px; padding: 0 0 12px; overflow: visible;
  box-shadow: 0 7px 0 var(--pg-ink); font: inherit; touch-action: manipulation; transition: transform .15s ease;
}
.tile-cover { position: relative; display: block; margin: 8px 8px 0; border-radius: 18px; overflow: hidden; border: 3px solid var(--pg-ink); aspect-ratio: 16 / 9; background: var(--c); }
.tile-cover canvas { width: 100%; height: 100%; display: block; }
.tile-title { display: block; font-weight: 800; font-size: 1.22rem; line-height: 1.15; margin: 10px 14px 2px; }
.tile-hook { display: block; font-weight: 600; font-size: 1rem; line-height: 1.3; margin: 0 14px 10px; color: #3E3570; flex: 1; }
.tile-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 12px; flex-wrap: wrap; }
.tile-only { margin-right: auto; font-weight: 800; font-size: .82rem; background: #F4F0FF; border-radius: 999px; padding: 4px 10px; color: #4B23B8; }
.tile-go {
  font-weight: 800; font-size: 1.25rem; background: #FFE14D; color: var(--pg-ink); border: 3px solid var(--pg-ink); border-radius: 999px;
  padding: 10px 22px; box-shadow: 0 4px 0 var(--pg-ink); letter-spacing: .03em; min-height: 52px; display: inline-flex; align-items: center;
}
.tile-sticker { position: absolute; top: 8px; right: 8px; font-weight: 800; font-size: .95rem; padding: 6px 12px; border: 3px solid var(--pg-ink); border-radius: 999px; transform: rotate(8deg); background: #FF4FA3; color: #fff; text-shadow: 0 2px 0 var(--pg-ink); }
.tile-sticker--loved { background: #FFE14D; color: var(--pg-ink); text-shadow: none; }
.tile-badge { position: absolute; left: 8px; bottom: 8px; font-weight: 800; font-size: .85rem; background: rgba(255,255,255,.95); border: 2px solid var(--pg-ink); border-radius: 999px; padding: 3px 10px; }
.tile-tape { position: absolute; left: -30px; right: -30px; top: 42%; transform: rotate(-8deg); background: repeating-linear-gradient(45deg, #FFE14D 0 16px, var(--pg-ink) 16px 32px); color: transparent; height: 34px; }
.tile-tape::after { content: 'COMING SOON!'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #fff; color: var(--pg-ink); font-weight: 800; font-size: .95rem; padding: 3px 12px; border: 3px solid var(--pg-ink); border-radius: 8px; white-space: nowrap; }
.tile--soon .tile-cover canvas { filter: saturate(.7) brightness(.92); }
.tile--soon .tile-go { background: #E8E3FF; color: #4B23B8; box-shadow: 0 4px 0 #4B23B8; border-color: #4B23B8; }
.tile--soon .tile-btn { border-style: dashed; cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .tile:not(.tile--soon) .tile-btn:hover { transform: translateY(-6px) rotate(calc(var(--rot, 0deg) * -1)); }
  .tile:not(.tile--soon) .tile-btn:hover .tile-go { background: #FF4FA3; color: #fff; }
}
.tile-btn:focus-visible { outline: none; box-shadow: 0 7px 0 var(--pg-ink), 0 0 0 5px #fff, 0 0 0 10px #6A3FE0; }
.pg-chip:focus-visible, .pg-char:focus-visible, .pg-round:focus-visible, .pg-arrow:focus-visible { outline: none; box-shadow: 0 0 0 4px #fff, 0 0 0 8px #6A3FE0; }
.pg-empty { text-align: center; padding: 6px 16px 18px; }
.pg-empty canvas { width: 110px; height: 110px; margin: 0 auto; }
.pg-empty p { font-weight: 700; font-size: 1.15rem; margin: 6px 0 14px; }

/* ---- Footer and the calm grown-ups page ---- */
.pg-foot[hidden] { display: none; }
.pg-foot { text-align: center; padding: 8px 16px calc(28px + var(--safe-bottom)); display: grid; gap: 10px; justify-items: center; }
.pg-promise { margin: 0; font-weight: 800; background: #fff; border: 3px solid var(--pg-ink); border-radius: 999px; padding: 6px 16px; }
.pg-grown-link { font-weight: 700; color: var(--pg-ink); background: rgba(255,255,255,.7); padding: 12px 18px; border-radius: 999px; min-height: 48px; display: inline-flex; align-items: center; }
.pg-grownups { max-width: 760px; margin: 0 auto; }
.gu-tag { font-weight: 800; font-size: 1.35rem; color: #7A2EE6; margin: -4px 0 12px; }
.gu-mail { font-weight: 700; color: #6A1FD0; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.gu-card { background: #fff; border-radius: 24px; padding: 20px clamp(16px, 4vw, 34px) 28px; box-shadow: 0 6px 20px rgba(36,27,75,.12); line-height: 1.6; font-size: 1.05rem; }
.gu-card h2 { font-size: 1.8rem; margin: 14px 0 8px; color: #4B23B8; }
.gu-card h3 { font-size: 1.2rem; margin: 18px 0 4px; color: #4B23B8; }
.gu-card ul { padding-left: 1.2em; margin: 6px 0; }
.gu-card li { margin: 4px 0; }
.gu-soon { background: #F4F0FF; border-radius: 14px; padding: 10px 14px; }
body.pg-calm .pg-parade, body.pg-calm .pg-duck { display: none; }
body.pg-calm .pg-header { padding-bottom: 18px; }

/* ---- Game shell: the same fun look ---- */
.game-card > h2 { font-weight: 800; letter-spacing: .02em; }
.game-card .opt-label { font-weight: 800; }
.seg--tiers button { color: var(--pg-ink); font-weight: 800; }
.seg--tiers button[aria-pressed="true"] { color: var(--pg-ink); }
.seg--tiers button svg { width: 32px; height: 32px; background: none !important; }
.seg--tiers button[data-tier="must"][aria-pressed="true"] { background: #8BE05A; box-shadow: 0 3px 0 #4A9A26; }
.seg--tiers button[data-tier="could"][aria-pressed="true"] { background: #FF8FC4; box-shadow: 0 3px 0 #D93D7C; }
.card-actions .pb-btn--big { letter-spacing: .03em; border: 3px solid var(--pg-ink); }
.pb-btn:active { transform: translateY(var(--lip)) scale(.97); }

/* ---- Silly reactions (core/fun.js) ---- */
.fun-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.fun-confetti { position: absolute; width: 10px; height: 6px; border-radius: 2px; animation: fun-confetti 1s cubic-bezier(.2,.7,.4,1) forwards; }
@keyframes fun-confetti { to { transform: translate(var(--dx), calc(var(--dy) + 120px)) rotate(var(--r)); opacity: 0; } }
.fun-bubble { position: absolute; width: 22px; height: 22px; margin: -11px; border-radius: 50%; border: 3px solid #38B6FF; background: radial-gradient(circle at 35% 35%, #fff 0 3px, rgba(56,182,255,.25) 4px); animation: fun-bubble 1.5s ease-out forwards; }
@keyframes fun-bubble { 0% { transform: scale(.3); } 20% { transform: scale(1); } 90% { transform: translate(14px, -120px) scale(1.15); opacity: 1; } 100% { transform: translate(14px, -130px) scale(1.6); opacity: 0; } }
.fun-sparkle { position: absolute; width: 14px; height: 14px; margin: -7px; animation: fun-sparkle .7s ease-out forwards; }
.fun-sparkle::before { content: ''; position: absolute; inset: 0; background: currentColor; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
@keyframes fun-sparkle { from { transform: scale(1) rotate(0); } to { transform: translateY(18px) scale(0) rotate(180deg); opacity: 0; } }
.fun-say {
  position: absolute; left: 50%; bottom: calc(100% - 4px); transform: translateX(-50%); z-index: 5; pointer-events: none;
  background: #fff; color: var(--pg-ink); border: 3px solid var(--pg-ink); border-radius: 16px; padding: 4px 10px; font-weight: 800; font-size: 1rem; white-space: nowrap;
  animation: fun-say 1.4s ease both;
}
.fun-say::after { content: ''; position: absolute; left: 50%; top: 100%; width: 12px; height: 12px; background: #fff; border-right: 3px solid var(--pg-ink); border-bottom: 3px solid var(--pg-ink); transform: translate(-50%, -7px) rotate(45deg); }
@keyframes fun-say { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.08); } 25% { transform: translate(-50%, 0) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -8px); } }
.fun-spin { animation: fun-spin .8s cubic-bezier(.3,1.4,.5,1); }
@keyframes fun-spin { to { transform: rotate(360deg); } }
.fun-boing { animation: fun-boing .7s cubic-bezier(.3,1.6,.5,1); }
@keyframes fun-boing { 0% { transform: scale(1); } 20% { transform: scale(1.15, .8); } 45% { transform: translateY(-22px) scale(.9, 1.12); } 70% { transform: translateY(0) scale(1.08, .92); } 100% { transform: none; } }
.fun-wobble { animation: fun-wobble .8s ease; }
@keyframes fun-wobble { 0%, 100% { transform: none; } 20% { transform: rotate(-9deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(4deg); } }
.fun-giggle { animation: fun-giggle .6s linear; }
@keyframes fun-giggle { 0%, 100% { transform: none; } 10%, 30%, 50%, 70%, 90% { transform: translate(-3px, -2px) rotate(-2deg); } 20%, 40%, 60%, 80% { transform: translate(3px, 1px) rotate(2deg); } }
.fun-squish { animation: fun-squish .3s ease; }
@keyframes fun-squish { 0% { transform: scale(1); } 40% { transform: scale(1.06, .9); } 100% { transform: none; } }
.fun-nope { animation: fun-nope .5s ease; }
@keyframes fun-nope { 0%, 100% { transform: rotate(var(--rot, 0deg)); } 20%, 60% { transform: translateX(-8px) rotate(var(--rot, 0deg)); } 40%, 80% { transform: translateX(8px) rotate(var(--rot, 0deg)); } }
.fun-pulse { animation: fun-pulse .4s ease; }
@keyframes fun-pulse { 50% { filter: brightness(1.12); } }

@media (prefers-reduced-motion: no-preference) {
  .py-l { animation: py-pop .55s cubic-bezier(.3,1.5,.5,1) both, py-bob 2.6s ease-in-out infinite; animation-delay: calc(var(--n) * 90ms), calc(.8s + var(--n) * 150ms); }
  @keyframes py-pop { 0% { scale: 0; opacity: 0; } 60% { scale: 1.18; opacity: 1; } 100% { scale: 1; } }
  @keyframes py-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -.05em; } }
  .py-pulse { transform-box: view-box; transform-origin: 500px 345px; animation: py-pulse 1.8s ease-in-out infinite; }
  @keyframes py-pulse { 0%, 100% { scale: 1; } 50% { scale: 1.035; } }
  .pg-shelf { opacity: 0; transform: translateY(30px) rotate(-1deg); }
  .pg-shelf.is-in { animation: pg-shelf-in .7s cubic-bezier(.2,1.5,.4,1) forwards; }
  @keyframes pg-shelf-in { 0% { opacity: 0; transform: translateY(30px) rotate(-1.5deg); } 60% { opacity: 1; transform: translateY(-4px) rotate(.8deg); } 80% { transform: rotate(-.4deg); } 100% { opacity: 1; transform: none; } }
  .pg-char { animation: pg-char-in .6s cubic-bezier(.2,1.6,.4,1) both; animation-delay: calc(var(--i) * 80ms); }
  @keyframes pg-char-in { from { opacity: 0; transform: translateY(30px) scale(.6); } }
}
@media (prefers-reduced-motion: reduce) { .pg-shelf { opacity: 1; transform: none; } }

/* sideways phones: a slimmer header so the games show sooner */
@media (orientation: landscape) and (max-height: 540px) {
  .py-logo { --py-f: 26px; }
  .pg-char { width: 92px; }
  .pg-shout { font-size: 1.6rem; }
}
@media (max-width: 420px) {
  .pg-pick { gap: 8px; }
  .pg-char { width: calc(33% - 8px); min-width: 90px; border-radius: 22px; }
  .pg-round { width: 50px; height: 50px; }
}
.seg--tiers button span { white-space: nowrap; }
@media (orientation: landscape) and (max-height: 540px) { .seg--tiers button { font-size: .85rem; gap: 4px; } .seg--tiers button svg { width: 26px; height: 26px; } }

/* =====================================================================================
   Dress-Up Studio (engine/studio.js): glitter-pink stage on one side, the wardrobe on the other.
   Wide screens: wardrobe on the right. Upright phones: wardrobe underneath. Short (sideways phone): compact.
   ===================================================================================== */
.studio { position: absolute; inset: 0; z-index: 2; pointer-events: none; font-family: var(--font); color: var(--pg-ink, #241B4B); }
.studio > * { pointer-events: auto; }
.studio-panel {
  position: absolute; top: 10px; right: 10px; bottom: 10px; width: clamp(290px, 40%, 470px);
  display: flex; flex-direction: column; gap: 8px; padding: 10px;
  background: #FFF6FC; border: 4px solid #241B4B; border-radius: 26px; box-shadow: 0 6px 0 #241B4B;
}
.studio-tabs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.studio-tab {
  position: relative; appearance: none; cursor: pointer; width: 52px; height: 52px; padding: 4px; flex: none;
  border: 3px solid #241B4B; border-radius: 16px; background: #fff; box-shadow: 0 3px 0 #241B4B;
  display: grid; place-items: center; touch-action: manipulation; transition: transform .12s ease;
}
.studio-tab canvas { width: 40px; height: 40px; }
.studio-tab[aria-pressed="true"] { background: #FFE14D; transform: translateY(-2px) rotate(-3deg); box-shadow: 0 5px 0 #241B4B, 0 0 0 3px #FF4FB8; }
.studio-tab-dot { position: absolute; top: -5px; right: -5px; width: 14px; height: 14px; border-radius: 50%; background: #2FBF71; border: 2px solid #241B4B; display: none; }
.studio-tab.is-worn .studio-tab-dot { display: block; }
.studio-tab.is-hint::after { content: '★'; position: absolute; left: -7px; top: -9px; font-size: 18px; line-height: 1; color: #FFC83D; -webkit-text-stroke: 1.5px #241B4B; animation: studio-wiggle 1s ease-in-out infinite; }
.studio-items-title { font-weight: 800; font-size: 1.05rem; letter-spacing: .04em; text-align: center; color: #C21F80; }
.studio-items {
  flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 80px));
  gap: 8px; align-content: start; justify-content: center; padding: 2px 2px 6px; overscroll-behavior: contain;
}
.studio-item {
  position: relative; appearance: none; cursor: pointer; aspect-ratio: 1; min-height: 64px; padding: 4px;
  border: 3px solid #241B4B; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 #241B4B;
  display: grid; place-items: center; touch-action: manipulation; transition: transform .1s ease;
}
.studio-item canvas { width: 52px; height: 52px; }
.studio-item:active { transform: translateY(3px) scale(.96); box-shadow: 0 1px 0 #241B4B; }
.studio-item[aria-pressed="true"] { background: #FFE14D; box-shadow: 0 4px 0 #241B4B, 0 0 0 4px #FF4FB8; }
.studio-item.is-hint::after { content: '★'; position: absolute; right: -6px; top: -10px; font-size: 22px; line-height: 1; color: #FFC83D; -webkit-text-stroke: 1.5px #241B4B; animation: studio-wiggle 1s ease-in-out infinite; }
.studio-actions { display: grid; grid-template-columns: 1fr 1fr 1fr 1.3fr; gap: 6px; }
.studio-act {
  appearance: none; cursor: pointer; min-height: 56px; padding: 4px 4px; border: 3px solid #241B4B; border-radius: 16px;
  font: 800 .82rem/1.05 var(--font); color: #241B4B; background: #fff; box-shadow: 0 4px 0 #241B4B;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; touch-action: manipulation;
}
.studio-act svg { width: 26px; height: 26px; flex: none; }
.studio-act:active { transform: translateY(3px); box-shadow: 0 1px 0 #241B4B; }
.studio-act:disabled { opacity: .55; cursor: default; }
.studio-act--surprise { background: #D9C4FF; }
.studio-act--pose { background: #FFD9A8; }
.studio-act--code { background: #C9F0FF; }
.studio-act--show { background: #2FBF71; color: #fff; font-size: .95rem; -webkit-text-stroke: 0; text-shadow: 0 2px 0 #17633A; }
.studio-goal {
  position: absolute; left: 10px; top: 10px; max-width: min(430px, calc(60% - 20px));
  background: #fff; border: 4px solid #241B4B; border-radius: 20px; box-shadow: 0 5px 0 #241B4B;
  padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; transform: rotate(-1deg);
}
.studio-goal strong { font-size: 1.15rem; font-weight: 800; color: #C21F80; letter-spacing: .02em; display: block; line-height: 1.1; }
.studio-goal span { font-size: .95rem; font-weight: 600; line-height: 1.25; }
.studio-goal--free { flex-direction: column; }
.studio-goal-top { display: flex; align-items: center; gap: 8px; }
.studio-goal-top > div { flex: 1; min-width: 0; }
.studio-goal-say { display: block; }
.studio-host { width: 46px; height: 46px; flex: none; background: #FFE9F6; border-radius: 50%; border: 2px solid #241B4B; }
.studio-goal-count { flex: none; align-self: flex-start; background: #8A3FE0; color: #fff; border-radius: 999px; padding: 3px 9px; font-size: .85rem !important; font-weight: 800 !important; white-space: nowrap; }
.studio-wishes { display: flex; flex-wrap: wrap; gap: 6px; }
.studio-wish { display: inline-flex; align-items: center; gap: 4px; background: #FFF1C9; border: 2px solid #241B4B; border-radius: 999px; padding: 2px 10px 2px 4px; font-weight: 700; font-size: .92rem; }
.studio-wish canvas { width: 26px; height: 26px; }
.studio-wish.is-ok { background: #BDF2CF; }
.studio-wish b { color: #17633A; font-size: 1.05rem; }
.studio-bubble {
  position: absolute; left: 0; top: 40%; max-width: 60%; pointer-events: none; z-index: 3;
  background: #FFE14D; border: 4px solid #241B4B; border-radius: 22px; padding: 6px 14px; box-shadow: 0 4px 0 #241B4B;
  font: 800 1.1rem/1.1 var(--font); color: #241B4B; opacity: 0; transform: translate(-50%, -100%) scale(.5) rotate(-4deg); white-space: nowrap;
  transition: opacity .15s ease, transform .25s cubic-bezier(.2,1.6,.4,1);
}
.studio-bubble.is-on { opacity: 1; transform: translate(-50%, -100%) scale(1) rotate(-4deg); }
.studio-bubble.is-big { font-size: 1.5rem; background: #FF4FB8; color: #fff; text-shadow: 0 2px 0 #241B4B; }
.studio.is-busy .studio-panel { filter: saturate(.7); }
.studio-photo-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.studio-photo { width: 220px; height: 250px; border-radius: 6px; box-shadow: 0 6px 18px rgba(36,27,75,.3), 0 0 0 3px #241B4B; transform: rotate(-2deg); background: #fff; }
.studio-code, .studio-code-card { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.studio-code-label { font-weight: 700; font-size: 1rem; color: #3B4766; }
.studio-code-text { font: 800 1.5rem/1.1 var(--font); letter-spacing: .06em; background: #fff; border: 3px dashed #8A3FE0; border-radius: 14px; padding: 6px 14px; color: #241B4B; word-break: break-word; }
.studio-code-input { font: 800 1.3rem var(--font); text-transform: uppercase; letter-spacing: .05em; width: min(320px, 100%); min-height: 56px; padding: 8px 14px; border: 3px solid #241B4B; border-radius: 16px; text-align: center; color: #241B4B; background: #fff; }
.studio-code-msg { min-height: 1.3em; margin: 0; font-weight: 700; color: #B81F1F !important; }
.studio-note { font-weight: 700; margin: 0; }
@keyframes studio-wiggle { 0%, 100% { transform: rotate(-12deg) scale(1); } 50% { transform: rotate(12deg) scale(1.2); } }

/* Upright phones and tablets: the wardrobe goes underneath */
.studio--tall .studio-panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 47%; padding: 8px; }
.studio--tall .studio-items-title { display: none; }
.studio--tall .studio-goal { max-width: calc(100% - 16px); left: 8px; top: 8px; }
.studio--tall .studio-tabs { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding: 2px 2px 6px; scrollbar-width: thin; }
/* Sideways phones: everything a bit smaller, tabs scroll sideways */
.studio--short .studio-panel { top: 6px; bottom: 6px; right: 6px; gap: 5px; padding: 6px; width: clamp(290px, 48%, 470px); border-radius: 20px; }
.studio--short .studio-tabs { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; }
.studio--short .studio-tab { width: 48px; height: 48px; }
.studio--short .studio-tab canvas { width: 36px; height: 36px; }
.studio--short .studio-items-title { display: none; }
.studio--short .studio-items { grid-template-columns: repeat(auto-fill, minmax(58px, 66px)); gap: 6px; }
.studio--short .studio-item { min-height: 56px; }
.studio--short .studio-item canvas { width: 44px; height: 44px; }
.studio--short .studio-act { min-height: 50px; font-size: .82rem; }
.studio--short .studio-act svg { width: 22px; height: 22px; }
.studio--short .studio-goal { left: 6px; top: 6px; padding: 5px 9px; gap: 4px; max-width: calc(52% - 16px); }
.studio--short .studio-goal strong { font-size: 1rem; }
.studio--short .studio-goal span { font-size: .82rem; }
.studio--short .studio-goal-say { display: none; }
.studio--short .studio-wish { font-size: .8rem; padding: 1px 8px 1px 3px; }
.studio--short .studio-wish canvas { width: 22px; height: 22px; }
@media (prefers-reduced-motion: reduce) {
  .studio-tab.is-hint::after, .studio-item.is-hint::after { animation: none; }
  .studio-bubble { transition: none; }
}
.studio--tall .studio-goal { padding: 6px 10px; gap: 4px; }
.studio--tall .studio-goal-say { display: none; }
.studio--tall .studio-host { width: 36px; height: 36px; }
.studio--tall .studio-wishes { gap: 4px; }
.studio--tall .studio-wish { font-size: .85rem; padding: 1px 8px 1px 3px; }
.studio--tall .studio-wish canvas { width: 22px; height: 22px; }

/* Playground Dash (engine/runner.js): the clock pill */
.rn-clock { display: inline-flex; align-items: center; gap: 6px; }
.rn-clock .bar { width: 56px; height: 10px; border-radius: 6px; background: rgba(30,42,74,.15); overflow: hidden; }
.rn-clock .bar i { display: block; height: 100%; width: 100%; background: #2FBF71; border-radius: 6px; transition: width .2s linear; }
.rn-clock.is-low .bar i { background: #FF3B3B; }
.rn-clock.is-low { animation: pb-bump 600ms ease infinite; }
.rn-clock > span:last-child { min-width: 1.6em; text-align: right; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .rn-clock.is-low { animation: none; } }
.rn-super { pointer-events: auto; cursor: pointer; border: 0; font: inherit; color: inherit; min-height: 48px; }
.rn-super.is-ready { animation: studio-wiggle 1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .rn-super.is-ready { animation: none; } }

/* Turbo Racers: the place pill glows gold when you're 1st */
.rc-place { min-width: 64px; justify-content: center; }
.rc-place.is-first { background: #FFE14D; box-shadow: 0 0 0 3px #FF9F1C; }

/* ===== Start card in short steps (core/shell.js showStart): every step fits on one screen, no scrolling ===== */
.shell-overlay .game-card.start-card { display: flex; flex-direction: column; gap: 10px; width: min(580px, 100%); max-height: 100%; overflow: hidden; zoom: 1; padding: 14px 16px 16px; }
.shell-overlay .game-card.start-card > h2 { margin: 0; font-size: 1.3rem; padding: 6px 20px 7px; }
.shell-overlay .game-card.start-card .sc-body { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.shell-overlay .game-card.start-card .sc-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.shell-overlay .game-card.start-card .opt { display: flex; flex-direction: column; gap: 6px; }
.shell-overlay .game-card.start-card .opt-label { display: inline-block; align-self: flex-start; font-size: .78rem; }
/* who's playing / how tricky: two big chips you tap to change */
.sc-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sc-chip { display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 6px 10px; border: 0; border-radius: 18px; background: #fff; color: var(--ink); font: inherit; text-align: left; cursor: pointer; box-shadow: inset 0 0 0 3px var(--line), 0 4px 0 var(--line); min-width: 0; transition: transform 90ms; }
.sc-chip:active { transform: translateY(3px); box-shadow: inset 0 0 0 3px var(--line); }
.sc-chip canvas, .sc-chip svg { width: 40px; height: 40px; flex: none; }
.sc-chip-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; flex: 1; }
.sc-chip-text small { font-size: .64rem; font-weight: 800; letter-spacing: .03em; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-chip-text b { font-size: 1.02rem; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-chip-edit { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--k-sun, #FFE14D); display: flex; align-items: center; justify-content: center; font-size: .95rem; box-shadow: inset 0 0 0 2px var(--line); }
/* how to play: compact sticker tiles, up to 4 to a row */
.shell-overlay .game-card.start-card .opt--howto .picto-row { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 6px; padding: 2px 0; flex-wrap: initial; }
.shell-overlay .game-card.start-card .opt--howto .picto { width: auto; min-width: 0; max-width: none; flex: initial; padding: 6px 3px 5px; border-radius: 16px; font-size: .7rem; line-height: 1.12; gap: 3px; }
.shell-overlay .game-card.start-card .opt--howto .picto-icon { width: 40px; height: 40px; }
.shell-overlay .game-card.start-card .opt--howto .picto-icon svg { width: 30px; height: 30px; }
.shell-overlay .game-card.start-card .picto-num { width: 18px; height: 18px; line-height: 18px; font-size: .62rem; top: -5px; left: -6px; }
/* levels: one row that slides sideways if there are lots */
.shell-overlay .game-card.start-card .sc-levels { display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 6px; overflow-x: auto; padding: 4px 2px 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.shell-overlay .game-card.start-card .sc-levels button { flex: none; scroll-snap-align: center; min-width: 58px; min-height: 56px; }
/* play + music */
.sc-play { display: flex; gap: 8px; align-items: stretch; }
.sc-play .pb-btn--big { flex: 1; min-height: 60px; }
.sc-play .music-toggle { width: 60px; min-width: 60px; padding: 0; justify-content: center; border-radius: 50%; flex: none; }
.sc-play .music-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sc-play .music-toggle[aria-pressed="false"] svg { opacity: .45; }
.sc-play .music-toggle[aria-pressed="true"] { background: var(--k-sun, #FFE14D); }
/* the "who" and "tricky" steps: big friendly buttons */
.sc-who { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.shell-overlay .game-card.start-card .sc-tricky { display: grid; grid-template-columns: 1fr; gap: 10px; background: none; box-shadow: none; padding: 0; border-radius: 0; }
.shell-overlay .game-card.start-card .sc-big { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 110px; padding: 10px 6px; border: 0; border-radius: 22px; background: #fff; color: var(--ink); font: inherit; cursor: pointer; box-shadow: inset 0 0 0 3px var(--line), 0 5px 0 var(--line); transition: transform 90ms; min-width: 0; }
.shell-overlay .game-card.start-card .sc-big:active { transform: translateY(3px) scale(.98); }
.shell-overlay .game-card.start-card .sc-big[aria-pressed="true"] { background: #E6F6EC; box-shadow: inset 0 0 0 4px var(--k-lime, #2FBF71), 0 5px 0 #4A9A26; }
.sc-big-name { font-size: 1.1rem; font-weight: 900; }
.sc-big-sub { font-size: .72rem; font-weight: 800; color: var(--ink-soft); text-align: center; }
.shell-overlay .game-card.start-card .sc-tricky .sc-big { display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto auto; column-gap: 14px; row-gap: 0; align-items: center; justify-items: start; min-height: 80px; padding: 10px 16px; text-align: left; }
.shell-overlay .game-card.start-card .sc-tricky .sc-big svg { grid-row: 1 / span 2; width: 56px; height: 56px; }
.shell-overlay .game-card.start-card .sc-tricky .sc-big-name { font-size: 1.3rem; align-self: end; }
.shell-overlay .game-card.start-card .sc-tricky .sc-big-sub { text-align: left; align-self: start; }
/* small phones held upright */
@media (max-width: 380px), (orientation: portrait) and (max-height: 700px) {
  .shell-overlay .game-card.start-card { padding: 12px 12px 14px; gap: 8px; }
  .shell-overlay .game-card.start-card > h2 { font-size: 1.15rem; }
  .sc-chip-text b { font-size: .95rem; }
  .shell-overlay .game-card.start-card .opt--howto .picto { font-size: .64rem; }
  .shell-overlay .game-card.start-card .opt--howto .picto-icon { width: 34px; height: 34px; }
  .shell-overlay .game-card.start-card .opt--howto .picto-icon svg { width: 26px; height: 26px; }
  .shell-overlay .game-card.start-card .opt-label { display: none; }
}
/* phones and tablets on their side: two columns, everything on one screen */
@media (orientation: landscape) and (max-height: 900px) {
  .shell-overlay .game-card.start-card { width: min(900px, 100%); }
  .shell-overlay .game-card.start-card .sc-body { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px 16px; align-items: center; }
  .shell-overlay .game-card.start-card .sc-col--left { grid-column: 1; }
  .shell-overlay .game-card.start-card .sc-col--right { grid-column: 2; }
  .sc-who { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .shell-overlay .game-card.start-card .sc-tricky { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shell-overlay .game-card.start-card .sc-tricky .sc-big { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; min-height: 130px; }
  .shell-overlay .game-card.start-card .sc-tricky .sc-big-name, .shell-overlay .game-card.start-card .sc-tricky .sc-big-sub { text-align: center; align-self: center; }
}
@media (orientation: landscape) and (max-height: 540px) {
  .shell-overlay .game-card.start-card { padding: 8px 14px 10px; gap: 6px; }
  .shell-overlay .game-card.start-card > h2 { font-size: 1.05rem; padding: 4px 16px 5px; }
  .shell-overlay .game-card.start-card .sc-col { gap: 6px; }
  .sc-chip { min-height: 50px; padding: 4px 8px; }
  .sc-chip canvas, .sc-chip svg { width: 32px; height: 32px; }
  .shell-overlay .game-card.start-card .opt-label { display: none; }
  .shell-overlay .game-card.start-card .opt--howto .picto { font-size: .6rem; padding: 4px 2px 4px; }
  .shell-overlay .game-card.start-card .opt--howto .picto-icon { width: 30px; height: 30px; }
  .shell-overlay .game-card.start-card .opt--howto .picto-icon svg { width: 22px; height: 22px; }
  .shell-overlay .game-card.start-card .sc-levels button { min-width: 50px; min-height: 50px; }
  .sc-play .pb-btn--big { min-height: 52px; }
  .sc-play .music-toggle { width: 52px; min-width: 52px; }
  .shell-overlay .game-card.start-card .sc-big { min-height: 92px; }
  .shell-overlay .game-card.start-card .sc-tricky .sc-big { min-height: 100px; }
}
/* Easy-peasy / Just right / BONKERS! as a row (the pause card): picture above the words so nothing overlaps */
.seg--tiers:not(.sc-tricky) button { flex-direction: column; gap: 2px; min-height: 64px; padding: 4px 2px; border-radius: 18px; font-size: .82rem; line-height: 1.05; white-space: normal; text-align: center; }
.seg--tiers:not(.sc-tricky) { border-radius: 24px; }
@media (orientation: landscape) and (max-height: 400px) {
  .shell-overlay .game-card.start-card--go > h2 { display: none; } /* the game's name is already in the top bar */
}
/* narrow phones held upright: the two chips stack, so names never get cut off */
@media (orientation: portrait) and (max-width: 480px) {
  .shell-overlay .game-card.start-card .sc-chips { grid-template-columns: 1fr; gap: 6px; }
  .shell-overlay .game-card.start-card .sc-chip { min-height: 52px; }
  .shell-overlay .game-card.start-card .sc-chip-text { flex-direction: row; align-items: baseline; gap: 8px; }
}
