:root {
  --bg: #e8f6ff;
  --bg-deep: #fff6e8;
  --panel: #ffffffee;
  --ink: #1f3a5f;
  --ink-soft: #3d5a7a;
  --muted: #5a7a96;
  --gold: #ffb703;
  --gold-soft: #ffd56a;
  --line: #7ec8e888;
  --ok: #2bb673;
  --bad: #e85d5d;
  --coral: #ff6b6b;
  --sky: #4cc9f0;
  --mint: #57cc99;
  --sunny: #ffd166;
  --grape: #7b68ee;
  --peach: #ff9f6b;
  --child-bg1: #fff9e8;
  --child-bg2: #e5f9ff;
  --child-ink: #1f3a5f;
  --child-soft: #4a6a88;
  --touch: #ff6b6b;
  --touch-hover: #ef5350;
  --touch-shadow: #c44a4a;
  --star: #ffb703;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --sans: "Trebuchet MS", "Segoe UI", "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --display: "Trebuchet MS", "Segoe UI", "Avenir Next", "Century Gothic", sans-serif;
  color-scheme: light;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #ff6b6baa; outline-offset: 3px; }

.skip-link {
  position: fixed; z-index: 100; top: 10px; left: 10px;
  padding: 12px 18px; border-radius: 999px;
  background: var(--coral); color: #fff; font-weight: 700;
  transform: translateY(-160%); transition: transform .2s;
}
.skip-link:focus { transform: translateY(0); }

.page-atmosphere {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(ellipse at 15% 10%, #ffd166aa, transparent 42%),
    radial-gradient(ellipse at 88% 18%, #4cc9f088, transparent 40%),
    radial-gradient(ellipse at 70% 85%, #57cc9988, transparent 45%),
    radial-gradient(ellipse at 20% 90%, #ff9f6b77, transparent 40%),
    linear-gradient(165deg, #e8f6ff 0%, #fff6e8 48%, #eafaf3 100%);
}
.orb { position: absolute; border-radius: 50%; }
.orb-one {
  width: 220px; height: 220px; right: -40px; top: 60px;
  background: radial-gradient(circle at 35% 35%, #ffe08a, #ffb70388);
  animation: bob 7s ease-in-out infinite;
  opacity: .85;
}
.orb-two {
  width: 180px; height: 180px; left: -50px; bottom: 12%;
  background: radial-gradient(circle at 40% 40%, #9ae7ff, #4cc9f088);
  animation: bob 9s ease-in-out infinite reverse;
  opacity: .8;
}
.orb-three {
  width: 120px; height: 120px; left: 42%; top: 18%;
  background: radial-gradient(circle at 40% 40%, #b8f2d8, #57cc9988);
  animation: bob 8s ease-in-out infinite;
  opacity: .55;
}
.dots {
  position: absolute; inset: 0; opacity: .45;
  background-image:
    radial-gradient(circle at 18% 28%, #ff6b6b 0 3px, transparent 4px),
    radial-gradient(circle at 72% 22%, #4cc9f0 0 3px, transparent 4px),
    radial-gradient(circle at 55% 68%, #ffb703 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 30% 78%, #57cc99 0 3px, transparent 4px),
    radial-gradient(circle at 85% 55%, #7b68ee 0 2.5px, transparent 3.5px);
  background-size: 380px 340px, 460px 400px, 320px 300px, 500px 420px, 280px 260px;
  animation: drift 36s linear infinite;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-28px, 14px, 0); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-14px) scale(1.04); }
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(.94) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes pulse-soft {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes star-twinkle {
  0%, 100% { opacity: .7; transform: scale(.92) rotate(-6deg); }
  50% { opacity: 1; transform: scale(1.12) rotate(6deg); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

.site-header {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 22px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  border-bottom: 3px solid #ffffffaa;
  background: #ffffffcc; backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 8px 24px #1f3a5f12;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-size: 1.35rem; font-weight: 800;
  letter-spacing: .01em; color: var(--ink);
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: contain; background: transparent;
  box-shadow: 0 3px 0 #7ec8e844;
  animation: wiggle 3.5s ease-in-out infinite;
}
.lobby-logo {
  display: block; width: 112px; height: 112px;
  margin: 0 auto 12px; border-radius: 50%;
  object-fit: contain; background: #ffecd2;
  box-shadow: 0 10px 24px #1f3a5f28;
}
.header-course {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink-soft); font-weight: 700; font-size: 1rem;
}
.header-divider { width: 3px; height: 18px; border-radius: 3px; background: var(--sky); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip-btn, .home-link {
  padding: 10px 14px; border-radius: 999px;
  border: 2px solid #7ec8e866; background: #fff;
  color: var(--ink-soft); font-size: .9rem; font-weight: 700;
  min-height: 44px; display: inline-flex; align-items: center;
  box-shadow: 0 3px 0 #7ec8e833;
}
.chip-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, #4cc9f0, #57cc99);
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 0 #2a9bb088;
}
.speed-group {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px 4px 3px 12px; border-radius: 999px;
  border: 2px solid #7ec8e866; background: #fff;
  min-height: 44px; box-shadow: 0 3px 0 #7ec8e833;
}
.speed-label { color: var(--ink-soft); font-size: .85rem; font-weight: 700; margin-right: 4px; }
.speed-btn {
  border: 0; background: transparent; color: var(--ink-soft);
  font: inherit; font-size: .9rem; font-weight: 700;
  min-width: 44px; min-height: 44px; padding: 8px 10px; border-radius: 999px; cursor: pointer;
}
.parent-speech {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.parent-speech .chip-btn, .parent-speech .speed-group {
  min-height: 44px;
}
.speed-btn:hover { background: #7ec8e822; }
.speed-btn[aria-pressed="true"] { background: linear-gradient(135deg, #4cc9f0, #57cc99); color: #fff; }
.speed-btn:focus-visible { outline: 3px solid #4cc9f0; outline-offset: 1px; }

.app-shell { max-width: 1180px; margin: 0 auto; padding: 24px 18px 56px; }
.state-panel {
  min-height: 50vh; display: grid; place-content: center; text-align: center; gap: 14px;
}
.loading-symbol { display: flex; gap: 10px; justify-content: center; }
.loading-symbol span {
  width: 14px; height: 14px; border-radius: 50%;
  animation: pulse-soft 1.1s ease-in-out infinite;
}
.loading-symbol span:nth-child(1) { background: var(--coral); }
.loading-symbol span:nth-child(2) { background: var(--sunny); animation-delay: .15s; }
.loading-symbol span:nth-child(3) { background: var(--sky); animation-delay: .3s; }
.state-error .state-icon {
  width: 56px; height: 56px; margin: 0 auto; border-radius: 50%;
  display: grid; place-items: center;
  background: #ffe0e0; color: var(--bad); font-weight: 800; font-size: 1.4rem;
}
.state-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 20px; border-radius: 999px;
  border: 2px solid #7ec8e866; background: #fff;
  font-weight: 700; transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 0 #7ec8e844;
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(2px); box-shadow: 0 2px 0 #7ec8e844; }
.button-primary {
  background: linear-gradient(135deg, #ff6b6b, #ff9f6b);
  color: #fff; border-color: transparent;
  box-shadow: 0 5px 0 #c44a4a88;
}
.button-quiet { background: #fff; color: var(--ink-soft); }

.lobby { animation: pop-in .45s ease both; }
.eyebrow {
  margin: 0 0 10px; letter-spacing: .08em; font-size: .78rem;
  font-weight: 800; color: var(--coral); text-transform: uppercase;
}
#lobby-title {
  margin: 0 0 12px; font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800; line-height: 1.12; color: var(--ink);
  text-shadow: 0 2px 0 #ffffffaa;
}
.lobby-lead {
  max-width: 40rem; color: var(--ink-soft); margin: 0 0 20px;
  font-size: 1.12rem; font-weight: 600;
}
.disclaimer-banner {
  border: 3px solid #ffd166;
  background: linear-gradient(135deg, #fff9e0, #e8fbff);
  border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 18px;
  box-shadow: 0 8px 0 #ffd16655;
}
.disclaimer-banner strong {
  color: #c47a00; display: block; margin-bottom: 6px;
  font-size: 1.02rem;
}
.disclaimer-banner p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.age-note { margin-top: 8px !important; color: var(--muted) !important; font-size: .9rem !important; }
.lobby-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.user-chip, #progress-chip, .balance-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px;
  border: 2px solid #ffffffaa; background: #ffffffdd;
  color: var(--ink-soft); font-size: .95rem; font-weight: 700;
  box-shadow: 0 4px 12px #1f3a5f12;
}
.balance-chip, #session-balance {
  background: linear-gradient(145deg, #fff7d6, #ffe8a3);
  border-color: #ffd166;
  color: #7a4e00;
  font-size: 1.05rem;
  font-weight: 800;
}
.session-balance {
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 18px;
  text-align: center;
}
.sticker-shelf {
  margin: 0 0 20px; padding: 14px 16px; border-radius: 22px;
  background: #ffffffdd; border: 3px solid #ffd166aa;
  box-shadow: 0 8px 0 #1f3a5f12;
}
.sticker-shelf-label {
  margin: 0 0 8px; letter-spacing: .08em; text-transform: uppercase;
  font-size: .72rem; font-weight: 800; color: var(--muted);
}
.sticker-row { display: flex; flex-wrap: wrap; gap: 10px; }
.sticker-badge {
  min-width: 64px; min-height: 64px; padding: 8px;
  border-radius: 18px; border: 3px solid #fff;
  background: linear-gradient(145deg, #fff7d6, #ffe8a3);
  display: grid; place-items: center; gap: 2px;
  box-shadow: 0 4px 0 #c9953a44; font-weight: 800;
}
.sticker-badge.locked {
  background: #eef4f8; color: var(--muted); opacity: .72;
  box-shadow: none; border-style: dashed;
}
.sticker-badge .sticker-mark { font-size: 1.45rem; line-height: 1; }
.sticker-badge .sticker-name { font-size: .7rem; color: var(--ink-soft); }
.sticker-hint { margin: 10px 0 0; font-size: .88rem; font-weight: 700; color: var(--muted); }
.summary-stickers {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.milestone-toast {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 12; max-width: min(92%, 22rem);
  padding: 12px 18px; border-radius: 999px;
  background: #fff; border: 3px solid #ffd166;
  color: #7a4e00; font-weight: 800; font-size: 1.05rem;
  box-shadow: 0 8px 0 #a8c4d8; animation: pop-in .3s ease both;
}
.earn-pop {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  pointer-events: none;
  padding: 10px 18px;
  border-radius: 999px;
  background: #fff;
  border: 3px solid #ffd166;
  color: #2bb673;
  font-weight: 900;
  font-size: 1.35rem;
  box-shadow: 0 8px 0 #a8c4d8;
  animation: earn-float 1.35s ease-out forwards;
}
@keyframes earn-float {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(.85); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -28px) scale(1); }
}
.status-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 4px #2bb67333;
}

.mode-grid {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 18px;
}
@media (max-width: 820px) { .mode-grid { grid-template-columns: 1fr; } }
.mode-card {
  text-align: left; border-radius: var(--radius-xl); padding: 24px;
  border: 3px solid #fff; background: var(--panel);
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 10px 0 #1f3a5f14, 0 16px 32px #1f3a5f12;
  min-height: 200px;
}
.mode-exam {
  background: linear-gradient(160deg, #fff 0%, #ffe8e8 100%);
  border-color: #ffb0b0;
}
.mode-exam:hover { transform: translateY(-4px); box-shadow: 0 14px 0 #ff6b6b33, 0 20px 36px #1f3a5f18; }
.mode-practice {
  background: linear-gradient(160deg, #fff 0%, #e8f9ff 100%);
  border-color: #9ae0f5;
}
.mode-kicker {
  letter-spacing: .1em; font-size: .75rem; font-weight: 800;
  color: var(--coral); text-transform: uppercase;
}
.mode-practice .mode-kicker { color: #1a8fb8; }
.mode-card strong {
  font-size: 1.45rem; font-family: var(--display); font-weight: 800; color: var(--ink);
}
.mode-card > span { color: var(--muted); font-size: 1rem; font-weight: 600; }
.mode-icon {
  width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center; font-size: 1.6rem; font-weight: 800;
  color: #fff; margin-bottom: 4px;
  box-shadow: 0 5px 0 #00000022;
}
.mode-exam .mode-icon {
  background: linear-gradient(145deg, #ff6b6b, #ff9f6b);
}
.mode-practice .mode-icon {
  background: linear-gradient(145deg, #4cc9f0, #57cc99);
}
.domain-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.domain-buttons button {
  min-height: 56px; min-width: 140px; padding: 12px 16px; border-radius: 18px;
  border: 3px solid transparent; color: #fff;
  font-weight: 800; font-size: 1rem;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 5px 0 #00000022;
  transition: transform .12s, box-shadow .12s;
}
.domain-buttons button:hover { transform: translateY(-2px); }
.domain-buttons button:active { transform: translateY(3px); box-shadow: 0 2px 0 #00000022; }
.domain-icon {
  width: 28px; height: 28px; border-radius: 10px;
  background: #ffffff44; display: grid; place-items: center;
  font-size: .85rem; font-weight: 900;
}

.session-view {
  display: grid; grid-template-columns: minmax(250px, 300px) 1fr; gap: 18px;
  min-height: calc(100vh - 140px);
  min-height: calc(100dvh - 140px);
  animation: pop-in .4s ease both;
}
@media (max-width: 900px) {
  .session-view { grid-template-columns: 1fr; }
  .proctor-panel { order: 2; }
}

.proctor-panel {
  border-radius: var(--radius-xl); border: 3px solid #fff;
  background: linear-gradient(180deg, #ffffff, #f0f8ff);
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 10px 0 #1f3a5f12, 0 16px 28px #1f3a5f10;
  align-self: start;
}
.proctor-toggle {
  display: none;
  width: 100%; min-height: 48px; padding: 12px 16px;
  border-radius: 18px; border: 2px solid #7ec8e866; background: #fff;
  align-items: center; justify-content: space-between; gap: 10px;
  font-weight: 800; color: var(--ink);
  box-shadow: 0 3px 0 #7ec8e833;
}
.proctor-toggle-hint { font-size: .85rem; color: var(--muted); font-weight: 700; }
.proctor-body { display: flex; flex-direction: column; gap: 12px; }
.proctor-label {
  margin: 0; letter-spacing: .1em; font-size: .72rem;
  font-weight: 800; color: var(--muted); text-transform: uppercase;
}
#proctor-domain { margin: 0; font-family: var(--display); font-size: 1.4rem; font-weight: 800; }
.proctor-instructions { margin: 0; color: var(--ink-soft); font-size: .95rem; font-weight: 600; }
.proctor-progress { display: grid; gap: 6px; }
.bar-track {
  height: 14px; border-radius: 999px; background: #dceef8; overflow: hidden;
  border: 2px solid #fff;
}
.bar-fill {
  height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, #4cc9f0, #ffb703, #ff6b6b);
  transition: width .35s ease;
}
#progress-text { font-size: .9rem; color: var(--muted); font-weight: 700; }
.proctor-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.proctor-actions .button {
  min-height: 44px; min-width: 44px; padding: 10px 14px;
}
.proctor-note { margin: auto 0 0; font-size: .85rem; color: var(--muted); font-weight: 600; }
.voice-status { margin: 0; font-size: .8rem; color: #1a8fb8; font-weight: 700; }

.child-stage {
  min-height: min(540px, calc(100dvh - 160px));
  display: flex; flex-direction: column;
}
.child-canvas {
  height: 100%; flex: 1;
  min-height: min(540px, calc(100dvh - 160px));
  border-radius: var(--radius-xl); overflow: hidden;
  border: 5px solid #fff;
  background:
    radial-gradient(circle at 12% 12%, #ffffffcc, transparent 38%),
    radial-gradient(circle at 90% 18%, #ffd16666, transparent 35%),
    radial-gradient(circle at 80% 85%, #4cc9f055, transparent 40%),
    linear-gradient(160deg, var(--child-bg1), var(--child-bg2) 55%, #e8ffe8);
  color: var(--child-ink);
  box-shadow:
    0 0 0 4px #ff6b6b55,
    0 0 0 8px #ffd16655,
    0 0 0 12px #4cc9f044,
    0 22px 48px #1f3a5f22;
  position: relative;
}
.stage-screen {
  position: relative;
  height: 100%;
  min-height: min(540px, calc(100dvh - 160px));
  padding: 28px 22px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 16px; animation: pop-in .35s ease both;
}
.pause-restart {
  margin-top: 4px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 2px solid #7ec8e866;
  background: #fff;
  font-weight: 800;
}
.child-soft {
  margin: 0; color: var(--child-soft); font-size: 1.15rem; font-weight: 800;
}
.child-big {
  margin: 0; font-family: var(--display);
  font-size: clamp(2.2rem, 5.5vw, 3.1rem);
  color: var(--child-ink); line-height: 1.12; font-weight: 800;
}
.big-touch {
  min-width: 200px; min-height: 78px; padding: 18px 32px; margin-top: 8px;
  border-radius: 28px;
  background: linear-gradient(145deg, #ff6b6b, #ff9f6b);
  color: #fff; font-size: 1.45rem; font-weight: 800; letter-spacing: .02em;
  box-shadow: 0 10px 0 var(--touch-shadow);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s, box-shadow .12s;
  animation: pulse-soft 2.4s ease-in-out infinite;
}
.big-touch:hover { background: linear-gradient(145deg, var(--touch-hover), #ff9f6b); }
.big-touch:active { transform: translateY(5px); box-shadow: 0 5px 0 var(--touch-shadow); }

.item-host-row {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  width: min(100%, 40rem);
}
.item-prompt {
  margin: 0; max-width: 38rem;
  font-size: clamp(1.35rem, 3.2vw, 1.7rem);
  font-weight: 800; color: var(--child-ink);
}

/* Always-visible Next / Skip on the child item stage (not buried in parent drawer). */
.item-nav {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: auto;
}
.item-nav-btn {
  min-width: 72px;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 3px solid #fff;
  background: #ffffffee;
  color: var(--child-ink);
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 4px 0 #a8c4d855;
  touch-action: manipulation;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.item-nav-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #a8c4d855; }
.item-nav-next {
  background: linear-gradient(145deg, #ff9f6b, #e85d5d);
  color: #fff;
  box-shadow: 0 4px 0 #c45a3a88;
  min-width: 96px; min-height: 56px; font-size: 1.2rem;
}
/* Next is always in the top-right corner: it pops in and pulses gently so it is easy to find. */
.item-nav-next:not([hidden]) { animation: next-pop .4s cubic-bezier(.3, 1.6, .5, 1) both, next-pulse 1.8s ease-in-out .6s infinite; }
@keyframes next-pop { from { transform: scale(.4); opacity: 0; } }
@keyframes next-pulse { 0%, 100% { box-shadow: 0 4px 0 #c45a3a88, 0 0 0 0 #ff9f6b88; } 50% { box-shadow: 0 4px 0 #c45a3a88, 0 0 0 10px #ff9f6b00; } }
.item-nav-next:active { box-shadow: 0 2px 0 #c45a3a88; }

/* —— Tiger host mascot —— */
.tiger-slot { display: grid; place-items: center; }
.tiger-host {
  width: min(168px, 42vw); height: auto; line-height: 0;
  filter: drop-shadow(0 10px 0 #f06a1044);
}
.tiger-host-sm { width: min(120px, 34vw); }
.tiger-svg { width: 100%; height: auto; display: block; overflow: visible; }
.tiger-figure { transform-origin: 100px 200px; }
.tiger-head { transform-origin: 100px 78px; }
.tiger-arm-l { transform-origin: 58px 150px; }
.tiger-arm-r { transform-origin: 142px 150px; }
.tiger-ear-l, .tiger-ear-r { transform-origin: center; }

.tiger-host[data-mood="welcome"] .tiger-figure,
.tiger-host[data-mood="idle"] .tiger-figure {
  animation: tiger-bounce 2.2s ease-in-out infinite;
}
.tiger-host[data-mood="welcome"] .tiger-arm-l,
.tiger-host[data-mood="welcome"] .tiger-arm-r {
  animation: tiger-wave 1.6s ease-in-out infinite;
}
.tiger-host[data-mood="welcome"] .tiger-arm-r { animation-delay: .2s; }

.tiger-host[data-mood="listen"] .tiger-head {
  animation: tiger-tilt 1.8s ease-in-out infinite;
}
.tiger-host[data-mood="listen"] .fx-think { opacity: 1; animation: tiger-pop .45s ease both; }
.tiger-host[data-mood="listen"] .tiger-ear-l,
.tiger-host[data-mood="listen"] .tiger-ear-r {
  animation: tiger-ear-twitch 1.2s ease-in-out infinite;
}

.tiger-host[data-mood="go"] .tiger-figure {
  animation: tiger-bounce 0.7s ease-in-out infinite;
}
.tiger-host[data-mood="go"] .fx-go { opacity: 1; animation: tiger-pop .35s ease both, tiger-bob-badge 0.9s ease-in-out infinite; }
.tiger-host[data-mood="go"] .mouth-smile { opacity: 0; }
.tiger-host[data-mood="go"] .mouth-big { opacity: 1; }

.tiger-host[data-mood="correct"] .tiger-figure {
  animation: tiger-celebrate 0.7s ease-in-out infinite;
}
.tiger-host[data-mood="correct"] .tiger-arm-l {
  animation: tiger-arms-up-l 0.7s ease-in-out infinite;
}
.tiger-host[data-mood="correct"] .tiger-arm-r {
  animation: tiger-arms-up-r 0.7s ease-in-out infinite;
}
.tiger-host[data-mood="correct"] .eyes-open { opacity: 0; }
.tiger-host[data-mood="correct"] .eyes-happy { opacity: 1; }
.tiger-host[data-mood="correct"] .mouth-smile { opacity: 0; }
.tiger-host[data-mood="correct"] .mouth-big { opacity: 1; }
.tiger-host[data-mood="correct"] .fx-sparkles {
  opacity: 1; animation: tiger-sparkle 1s ease-in-out infinite;
}

.tiger-host[data-mood="dance"] .tiger-figure {
  animation: tiger-dance 0.55s ease-in-out infinite;
}
.tiger-host[data-mood="dance"] .tiger-arm-l {
  animation: tiger-arms-up-l 0.45s ease-in-out infinite;
}
.tiger-host[data-mood="dance"] .tiger-arm-r {
  animation: tiger-arms-up-r 0.45s ease-in-out infinite alternate;
}
.tiger-host[data-mood="dance"] .tiger-leg-l {
  animation: tiger-leg-step-l 0.45s ease-in-out infinite;
}
.tiger-host[data-mood="dance"] .tiger-leg-r {
  animation: tiger-leg-step-r 0.45s ease-in-out infinite;
}
.tiger-host[data-mood="dance"] .tiger-tail {
  animation: tiger-tail-swish 0.5s ease-in-out infinite;
}
.tiger-host[data-mood="dance"] .eyes-open { opacity: 0; }
.tiger-host[data-mood="dance"] .eyes-happy { opacity: 1; }
.tiger-host[data-mood="dance"] .mouth-smile { opacity: 0; }
.tiger-host[data-mood="dance"] .mouth-big { opacity: 1; }
.tiger-host[data-mood="dance"] .fx-sparkles {
  opacity: 1; animation: tiger-sparkle 0.7s ease-in-out infinite;
}

.tiger-host[data-mood="retry"] .tiger-figure {
  animation: tiger-nod 1.4s ease-in-out infinite;
}
.tiger-host[data-mood="retry"] .eyes-open { opacity: 0; }
.tiger-host[data-mood="retry"] .eyes-soft { opacity: 1; }
.tiger-host[data-mood="retry"] .mouth-smile { opacity: 0; }
.tiger-host[data-mood="retry"] .mouth-soft { opacity: 1; }
.tiger-host[data-mood="retry"] .blush { opacity: .85; }

@keyframes tiger-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes tiger-wave {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-18deg); }
}
@keyframes tiger-tilt {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
}
@keyframes tiger-ear-twitch {
  0%, 100% { transform: rotate(0deg); }
  40% { transform: rotate(-8deg); }
  60% { transform: rotate(6deg); }
}
@keyframes tiger-celebrate {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-12px) scale(1.05); }
}
@keyframes tiger-arms-up-l {
  0%, 100% { transform: rotate(-28deg) translateY(-4px); }
  50% { transform: rotate(-42deg) translateY(-10px); }
}
@keyframes tiger-arms-up-r {
  0%, 100% { transform: rotate(28deg) translateY(-4px); }
  50% { transform: rotate(42deg) translateY(-10px); }
}
@keyframes tiger-nod {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(3deg) translateY(3px); }
}
@keyframes tiger-pop {
  from { opacity: 0; transform: scale(.6); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes tiger-sparkle {
  0%, 100% { opacity: .55; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1.08); }
}
@keyframes tiger-bob-badge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes tiger-dance {
  0%, 100% { transform: translateY(0) rotate(-4deg) scale(1); }
  25% { transform: translateY(-14px) rotate(4deg) scale(1.06); }
  50% { transform: translateY(-4px) rotate(-3deg) scale(1.02); }
  75% { transform: translateY(-12px) rotate(5deg) scale(1.06); }
}
@keyframes tiger-leg-step-l {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-6px) rotate(6deg); }
}
@keyframes tiger-leg-step-r {
  0%, 100% { transform: translateY(-6px) rotate(4deg); }
  50% { transform: translateY(0) rotate(-6deg); }
}
@keyframes tiger-tail-swish {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(14deg); }
}

/* —— Supermarket shop: tiger + girl + cart —— */
.friends-row {
  display: flex; align-items: flex-end; justify-content: center; gap: 4px;
  width: min(100%, 28rem);
}
.girl-slot, .shop-cart { display: grid; place-items: end center; }
.girl-host {
  position: relative;
  width: min(128px, 32vw); height: auto; line-height: 0;
  filter: drop-shadow(0 8px 0 #3db4dc44);
}
.girl-pose {
  width: 100%; height: auto; display: none;
  user-select: none; -webkit-user-drag: none; pointer-events: none;
}
/* Welcome / idle: front happy; listen/go: side profile (walking to shelf). */
.girl-host[data-mood="welcome"] .girl-pose-front,
.girl-host[data-mood="idle"] .girl-pose-front { display: block; animation: tiger-bounce 2.2s ease-in-out infinite; }
.girl-host[data-mood="listen"] .girl-pose-side,
.girl-host[data-mood="go"] .girl-pose-side { display: block; animation: tiger-bounce 0.9s ease-in-out infinite; }
.girl-host[data-mood="retry"] .girl-pose-smile { display: block; animation: tiger-nod 1.4s ease-in-out infinite; }
/* Correct / dance: cycle arms-up celebrate ↔ closed-eye smile + bounce + sparkles. */
.girl-host[data-mood="correct"] .girl-pose-celebrate,
.girl-host[data-mood="dance"] .girl-pose-celebrate {
  display: block;
  animation: girl-cele-swap-a 1.1s steps(1, end) infinite, tiger-celebrate 0.7s ease-in-out infinite;
}
.girl-host[data-mood="correct"] .girl-pose-smile,
.girl-host[data-mood="dance"] .girl-pose-smile {
  display: block;
  position: absolute; left: 0; bottom: 0; width: 100%;
  animation: girl-cele-swap-b 1.1s steps(1, end) infinite, tiger-celebrate 0.7s ease-in-out infinite;
}
.girl-sparkles {
  position: absolute; inset: -8% -4% auto; height: 42%; pointer-events: none; opacity: 0;
  background:
    radial-gradient(circle at 18% 40%, #ffd166 0 3px, transparent 4px),
    radial-gradient(circle at 78% 28%, #4cc9f0 0 3px, transparent 4px),
    radial-gradient(circle at 52% 12%, #ff8fab 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 88% 58%, #57cc99 0 2.5px, transparent 3.5px);
}
.girl-host[data-mood="correct"] .girl-sparkles,
.girl-host[data-mood="dance"] .girl-sparkles {
  opacity: 1;
  animation: girl-sparkle-twinkle 0.85s ease-in-out infinite;
}
@keyframes girl-cele-swap-a {
  0%, 49.9% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes girl-cele-swap-b {
  0%, 49.9% { opacity: 0; }
  50%, 100% { opacity: 1; }
}
@keyframes girl-sparkle-twinkle {
  0%, 100% { opacity: .35; transform: translateY(0) scale(1); }
  50% { opacity: 1; transform: translateY(-4px) scale(1.08); }
}
.cart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.shop-cart { width: min(108px, 28vw); }
.cart-figure { transform-origin: 70px 88px; }

.shop-list {
  margin: 0; padding: 10px 22px 14px;
  min-width: min(100%, 16rem);
  border-radius: 16px;
  background:
    repeating-linear-gradient(transparent, transparent 27px, #d7e6f0 28px),
    #fffef6;
  border: 3px solid #fff;
  box-shadow: 0 6px 0 #c9a56a66;
  text-align: center;
}
.shop-list-kicker {
  display: block; font-size: .72rem; letter-spacing: .16em;
  text-transform: uppercase; color: #8a6a3a; font-weight: 800;
}
.shop-list strong {
  display: block; margin-top: 2px;
  font-size: clamp(1.55rem, 4vw, 2.1rem);
  color: #1f3a5f; text-transform: lowercase;
}
.shop-price {
  display: inline-block; margin-top: 8px; padding: 4px 12px;
  border-radius: 999px; background: #ffe8a3; color: #7a4e12;
  font-weight: 800; font-size: .95rem;
}
.shop-purse {
  display: block; margin-top: 6px;
  font-weight: 800; color: #2a6f8f; font-size: .95rem;
}
.shop-broke {
  margin: 8px auto 0; max-width: 28rem; padding: 18px 20px;
  border-radius: 22px; background: #fff8e8; border: 3px solid #fff;
  box-shadow: 0 8px 0 #e0c48a66; text-align: center;
}
.shop-broke-title {
  margin: 0 0 8px; font-size: clamp(1.35rem, 4vw, 1.7rem);
  color: #1f3a5f; font-weight: 900;
}
.shop-broke-lead { margin: 0 0 10px; color: #3a556f; font-weight: 700; line-height: 1.35; }
.shop-broke-parent {
  margin: 0 0 14px; color: #6a7a8a; font-size: .9rem; line-height: 1.4;
}
.shop-broke-back { margin-top: 4px; }
.earn-pop.spend-pop { background: #ffd4c8; color: #8a2f1c; }

#item-screen.shop-mode {
  background:
    linear-gradient(#cfe8f7 0 18%, transparent 18%),
    repeating-linear-gradient(90deg, #f4efe4 0 28px, #efe6d6 28px 56px);
}
#item-screen.shop-mode .friends-row {
  position: relative;
  width: min(100%, 34rem);
  min-height: 168px;
  padding: 18px 12px 8px;
  border-radius: 28px;
  background:
    linear-gradient(#8ec5e8 0 22%, transparent 22%),
    repeating-linear-gradient(#f7d9a8 0 10px, #e8c48a 10px 20px) 0 28px / 100% 52px no-repeat,
    repeating-linear-gradient(#f7d9a8 0 10px, #e8c48a 10px 20px) 0 88px / 100% 52px no-repeat,
    linear-gradient(#fff 0 0) 0 28px / 100% 112px no-repeat,
    #f3eee3;
  box-shadow: inset 0 0 0 4px #fff, 0 8px 0 #d4b48a66;
  overflow: hidden;
}
#item-screen.shop-mode .friends-row::before,
#item-screen.shop-mode .friends-row::after {
  content: "";
  position: absolute; top: 34px; width: 22px; height: 96px;
  background:
    repeating-linear-gradient(#ff8fab 0 12px, #ffd166 12px 24px, #4cc9f0 24px 36px);
  border-radius: 4px;
  opacity: .85;
}
#item-screen.shop-mode .friends-row::before { left: 10px; }
#item-screen.shop-mode .friends-row::after { right: 10px; }
#item-screen.shop-mode .tiger-host { width: min(118px, 28vw); }
#item-screen.shop-mode .friends-row .tiger-host,
#item-screen.shop-mode .friends-row .girl-host,
#item-screen.shop-mode .friends-row .shop-cart {
  animation: shop-walk 2.4s ease-in-out infinite;
}
#item-screen.shop-mode .shop-shelf-hint {
  margin: 0 0 6px; font-weight: 700; color: #5a7a92; font-size: .95rem;
}

#item-screen.shop-mode .shop-cart .cart-figure {
  animation: cart-wobble 1.1s ease-in-out infinite;
}
#item-screen.shop-mode .friends-row.is-celebrating .shop-cart .cart-figure {
  animation: cart-hop 0.55s ease-in-out infinite;
}

@keyframes shop-walk {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(10px); }
}
@keyframes cart-wobble {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(3deg); }
}
@keyframes cart-hop {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(3deg); }
}

.celebrate-layer {
  pointer-events: none;
  position: absolute; inset: 0; z-index: 6;
  overflow: hidden;
}
.cele-petal, .cele-spark {
  position: absolute; display: block;
  will-change: transform, opacity;
}
.cele-petal {
  top: -8%;
  width: 18px; height: 24px;
  border-radius: 60% 60% 60% 10%;
  opacity: 0;
  animation: cele-bloom 1.6s ease-out forwards;
  box-shadow: 0 0 0 2px #ffffff55 inset;
}
.cele-spark {
  width: 10px; height: 10px; border-radius: 50%;
  opacity: 0;
  animation: cele-burst 1.4s ease-out forwards;
  box-shadow: 0 0 10px currentColor;
}
.cele-spark.soft {
  width: 8px; height: 8px;
  background: #ffd166;
  animation-duration: 1.5s;
}
@keyframes cele-bloom {
  0% { opacity: 0; transform: translateY(0) scale(.4) rotate(0deg); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateY(110%) scale(1.1) rotate(var(--spin, 20deg)); }
}
@keyframes cele-burst {
  0% { opacity: 0; transform: scale(.2); }
  20% { opacity: 1; transform: scale(1.4); }
  100% { opacity: 0; transform: scale(.3) translateY(28px); }
}

.item-body {
  width: min(100%, 680px); display: flex; flex-wrap: wrap; gap: 16px;
  justify-content: center; align-items: center; margin-top: 8px;
}
.choices-row {
  width: 100%; display: flex; flex-wrap: wrap; gap: 16px;
  justify-content: center; align-items: center;
}
.choice-btn, .target-btn {
  min-width: 120px; min-height: 120px; padding: 14px;
  border-radius: 26px; border: 4px solid #fff;
  background: #ffffffee; color: var(--child-ink);
  display: grid; place-items: center; gap: 8px;
  font-weight: 800; font-size: 1.05rem;
  box-shadow: 0 8px 0 #a8c4d8;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.choice-btn:hover, .target-btn:hover { transform: translateY(-3px); }
.choice-btn:active, .target-btn:active { transform: translateY(4px); box-shadow: 0 4px 0 #a8c4d8; }
.choice-btn.selected, .target-btn.selected {
  border-color: var(--sky); box-shadow: 0 8px 0 #2a9bb088;
}
.choice-btn.correct, .target-btn.correct {
  border-color: var(--ok); background: #e4ffe8; box-shadow: 0 8px 0 #2bb67366;
}
.choice-btn.wrong, .target-btn.wrong {
  border-color: var(--bad); background: #ffe8e4; box-shadow: 0 8px 0 #e85d5d55;
}
.choice-label { font-size: 1rem; }

.stimulus {
  width: 80px; height: 80px; display: grid; place-items: center;
}
.stimulus svg { width: 72px; height: 72px; display: block; }
.color-swatch {
  width: 58px; height: 58px; border-radius: 18px; border: 3px solid #ffffffaa;
  box-shadow: inset 0 -6px 0 #00000022;
}

.pattern-board, .memory-grid {
  display: grid; gap: 10px; padding: 14px; border-radius: 22px;
  background: #ffffffdd; border: 3px dashed #4cc9f066;
}
.pattern-cell, .grid-cell {
  width: 68px; height: 68px; border-radius: 16px; border: 3px solid #fff;
  background: #eef6fb; cursor: pointer;
  box-shadow: 0 4px 0 #a8c4d855;
}
.pattern-cell.locked { cursor: default; }
.palette {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; width: 100%;
}
.palette button {
  width: 64px; height: 64px; min-width: 48px; min-height: 48px;
  border-radius: 18px; border: 3px solid #fff;
  box-shadow: 0 5px 0 #00000022;
  touch-action: manipulation;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.matrix-row {
  display: grid; grid-template-columns: repeat(2, 96px); gap: 12px;
  padding: 14px; background: #ffffffdd; border-radius: 20px;
}
.matrix-row.matrix-3 {
  grid-template-columns: repeat(3, 72px); gap: 8px;
}
.matrix-row.matrix-3 .matrix-cell {
  width: 72px; height: 72px;
}
.matrix-cell {
  width: 96px; height: 96px; border-radius: 18px; border: 3px dashed #4cc9f066;
  display: grid; place-items: center; background: #f7fbff;
}
.matrix-cell.empty {
  background: repeating-linear-gradient(45deg, #eef4f8, #eef4f8 6px, #f7fbff 6px, #f7fbff 12px);
}

.scene-box {
  width: min(100%, 300px); height: 170px; border-radius: 24px;
  background: #ffffffdd; border: 3px solid #fff;
  display: grid; place-items: center; margin-bottom: 4px;
  box-shadow: 0 8px 0 #a8c4d855;
}

.timer-wrap {
  position: absolute; top: 16px; right: 16px;
  background: #ffffffee; border-radius: 20px; padding: 10px 16px;
  display: flex; align-items: baseline; gap: 8px; color: var(--child-soft);
  box-shadow: 0 6px 16px #1f3a5f18; border: 3px solid #ffd166;
  font-weight: 700;
}
#timer-value { font-size: 1.5rem; color: var(--coral); font-weight: 800; }

.feedback {
  min-height: 52px; padding: 12px 22px; border-radius: 999px;
  background: #ffffffee; font-weight: 800; font-size: 1.25rem;
  box-shadow: 0 6px 0 #a8c4d8; border: 3px solid #fff;
  animation: pop-in .25s ease both;
}
.feedback.ok { color: #1f8a4a; border-color: #57cc99; }
.feedback.no { color: #c44a4a; border-color: #ff9f6b; }
.feedback.neutral { color: var(--ink-soft); border-color: #7ec8e8; }
.feedback.reveal { color: #1f6f8a; border-color: #4cc9f0; }

/* Second try: the picture already tried is greyed out; after the last try the right one glows. */
.choice-btn.is-tried, .target-btn.is-tried {
  opacity: .35; filter: grayscale(1); pointer-events: none; transform: none;
  box-shadow: 0 3px 0 #c9d6e0;
}
.choice-btn.is-answer, .target-btn.is-answer, .grid-cell.is-answer {
  border-color: var(--ok); background: #e4ffe8;
  box-shadow: 0 0 0 6px #57cc9966, 0 8px 0 #2bb67366;
  animation: answer-glow 1.1s ease-in-out 3;
}
.grid-cell.is-answer { background: #57cc99 !important; }
@keyframes answer-glow { 50% { box-shadow: 0 0 0 12px #57cc9933, 0 8px 0 #2bb67366; } }

/* Parent report (lobby) */
.report-open {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px;
  border-radius: 999px; border: 2px solid #7ec8e8; background: #ffffff; color: var(--ink);
  font: inherit; font-size: .95rem; font-weight: 800; cursor: pointer; touch-action: manipulation;
}
.report-panel {
  scroll-margin-top: 96px;
  margin: 0 0 22px; padding: 20px; border-radius: 24px; background: #ffffffee;
  border: 3px solid #7ec8e866; box-shadow: 0 10px 24px #1f3a5f14;
}
.report-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.report-head h2 { margin: 0; font-size: 1.35rem; color: var(--ink); }
.report-note { margin: 6px 0 14px; color: var(--muted); font-size: .9rem; font-weight: 600; }
.report-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.report-table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 560px; }
.report-table th, .report-table td { padding: 9px 8px; border-bottom: 1px solid #7ec8e844; text-align: right; white-space: nowrap; }
.report-table th:first-child, .report-table td:first-child { text-align: left; white-space: normal; }
.report-table th { color: var(--muted); font-size: .8rem; font-weight: 800; letter-spacing: .02em; }
.report-table td { color: var(--ink-soft); font-weight: 700; }
.report-pct { color: var(--ink); font-weight: 900; }
.trend-up { color: #1f8a4a; } .trend-down { color: #c44a4a; } .trend-flat { color: var(--muted); }
.report-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
@media (max-width: 760px) { .report-cols { grid-template-columns: 1fr; } }
.report-cols h3 { margin: 0 0 8px; font-size: 1rem; color: var(--ink); }
.report-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.report-list li { padding: 10px 12px; border-radius: 14px; background: #f3fbff; color: var(--ink-soft); font-size: .9rem; font-weight: 600; }
.report-list li b { color: var(--ink); }
.report-empty { color: var(--muted); font-weight: 700; }

.summary-stats {
  margin: 0; padding: 14px 20px; border-radius: 20px;
  background: #ffffffdd; font-weight: 800; font-size: 1.2rem;
  border: 3px solid #ffd166;
}
.summary-disclaimer {
  max-width: 28rem; margin: 0; color: var(--child-soft); font-size: .95rem; font-weight: 600;
}
.stars {
  display: flex; gap: 12px; font-size: 2.4rem; color: var(--star);
  filter: drop-shadow(0 4px 0 #c9953a66);
}
.stars span { animation: star-twinkle 1.4s ease-in-out infinite; }
.stars span:nth-child(2) { animation-delay: .2s; }
.stars span:nth-child(3) { animation-delay: .4s; }

.star-burst {
  width: 100px; height: 100px; border-radius: 50%;
  background:
    radial-gradient(circle, #ffd166cc, transparent 65%),
    radial-gradient(circle at 30% 30%, #ff6b6b66, transparent 50%);
  animation: pulse-soft 2s ease-in-out infinite;
}

.show-strip {
  display: flex; gap: 14px; padding: 16px; border-radius: 22px;
  background: #ffffffdd; border: 3px solid #fff;
  box-shadow: 0 6px 0 #a8c4d855;
}

/* Short / landscape viewports: child stage fills; parent tucks into a drawer. */
@media (max-height: 760px), (orientation: landscape) and (max-height: 900px) {
  .child-stage, .child-canvas, .stage-screen {
    min-height: 0;
  }
  .session-view {
    min-height: calc(100dvh - 110px);
  }
  .tiger-host { width: min(110px, 28vw); }
  .tiger-host-sm { width: min(88px, 22vw); }
  .girl-host { width: min(96px, 24vw); }
  .shop-cart { width: min(80px, 20vw); }
  #item-screen.shop-mode .friends-row { min-height: 132px; }
  .stage-screen { padding: 16px 14px; gap: 10px; }
  .item-prompt { font-size: clamp(1.15rem, 2.8vw, 1.45rem); }
}

@media (orientation: landscape) and (min-width: 901px) and (max-height: 900px) {
  .session-view {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .proctor-panel {
    order: 2;
    padding: 10px 12px;
    position: sticky;
    bottom: 0;
    z-index: 15;
  }
  .proctor-toggle { display: flex; }
  .proctor-panel:not(.is-open) .proctor-body { display: none; }
  .proctor-panel.is-open .proctor-toggle-hint::after { content: none; }
  .proctor-panel.is-open .proctor-toggle-hint { content: "Tap to hide"; }
  .proctor-panel.is-open .proctor-toggle-hint { font-size: 0; }
  .proctor-panel.is-open .proctor-toggle-hint::before { content: "Tap to hide"; font-size: .85rem; }
  .child-stage {
    min-height: calc(100dvh - 170px);
  }
  .child-canvas, .stage-screen {
    min-height: calc(100dvh - 170px);
  }
}

@media (max-width: 900px) {
  .proctor-toggle { display: flex; }
  .proctor-panel:not(.is-open) .proctor-body { display: none; }
  .proctor-panel.is-open .proctor-toggle-hint { font-size: 0; }
  .proctor-panel.is-open .proctor-toggle-hint::before { content: "Tap to hide"; font-size: .85rem; }
}

@media (max-width: 560px) {
  .domain-buttons button { min-width: calc(50% - 8px); flex: 1 1 140px; }
  .choice-btn, .target-btn { min-width: 100px; min-height: 100px; }
  .big-touch { min-width: 160px; min-height: 68px; font-size: 1.25rem; }
  .header-actions { gap: 6px; }
  .chip-btn, .home-link { padding: 8px 11px; font-size: .85rem; }
  .speed-group { padding-left: 9px; }
  .speed-label { font-size: .78rem; margin-right: 0; }
  .speed-btn { min-width: 44px; min-height: 44px; padding: 8px 8px; font-size: .85rem; }
}

/* —— Create & color —— */
.creative-stage {
  width: min(100%, 360px);
  margin: 0 auto 8px;
}
.creative-svg {
  width: 100%;
  height: auto;
  max-height: min(42vh, 280px);
  display: block;
}
.creative-svg-sm { max-height: 140px; }
.creative-raster {
  width: 100%;
  height: auto;
  max-height: min(42vh, 300px);
  display: block;
  object-fit: contain;
  border-radius: 16px;
  background: #fff;
}
.creative-raster-wrap {
  position: relative;
  width: 100%;
  touch-action: manipulation;
}
/* Image must not steal taps from the SVG hotspot overlay (iOS Safari). */
.creative-raster-wrap .creative-raster {
  max-height: min(42vh, 300px);
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}
.creative-hotspots {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  touch-action: manipulation;
  pointer-events: auto;
}
/* fill:transparent often fails hit-testing on iOS; use near-invisible fill. */
.creative-hotspots [data-region] {
  fill: rgba(0, 0, 0, 0.001);
  cursor: pointer;
  pointer-events: all;
  touch-action: manipulation;
  transition: fill 0.12s ease;
}
.creative-hotspots [data-region].is-filled {
  fill-opacity: 0.45;
}
.find-scene,
.find-target,
.tap-target {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.find-target {
  pointer-events: all;
  cursor: pointer;
}
.find-hit {
  pointer-events: all;
  fill: rgba(0, 0, 0, 0.001);
}
.choice-btn .creative-raster,
.choice-btn img.creative-piece {
  width: 88px;
  height: 88px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  background: #fff;
  border-radius: 10px;
}
.mirror-flip-img { transform: scaleY(-1); }
.creative-palette { margin-top: 4px; }
/* Found pictures: a green ring and a tick, drawn with SVG fill/stroke (Safari on iPad ignores CSS filter and outline on SVG parts). */
.find-target.found .find-hit { fill: rgba(87, 204, 153, .32); stroke: #2f9e6e; stroke-width: 2.5; }
.find-check { display: none; }
.find-target.found .find-check { display: inline; transform-box: fill-box; transform-origin: center; animation: find-pop .3s cubic-bezier(.3, 1.6, .5, 1) both; }
.find-target.deco.found { opacity: .55; }
@keyframes find-pop { from { transform: scale(0); } }
.match-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  width: min(100%, 420px);
}
.match-col { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.match-btn.matched { opacity: .55; pointer-events: none; }
.match-status {
  margin: 0; font-weight: 800; color: var(--child-soft); font-size: 1rem;
}
.draw-stage {
  position: relative; width: min(100%, 340px); min-height: 220px;
  margin: 0 auto; border-radius: 22px; border: 3px dashed #4cc9f066;
  background: #ffffffdd; overflow: hidden;
}
.draw-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  touch-action: none; z-index: 2;
}
.draw-template, .empty-frame, .draw-split {
  position: relative; z-index: 1; width: 100%; pointer-events: none;
}
.draw-template { max-height: 200px; margin: 8px auto; display: block; }
.empty-frame { min-height: 200px; }
.draw-split {
  display: flex; align-items: center; gap: 10px; padding: 10px;
}
.draw-side { width: 42%; height: auto; }
.draw-box-label {
  flex: 1; min-height: 120px; border: 3px dashed #7ec8e888; border-radius: 16px;
  display: grid; place-items: center; font-weight: 800; color: var(--muted);
}
.dots-stage { width: min(100%, 320px); margin: 0 auto; }
.dots-svg { width: 100%; height: auto; background: #ffffffdd; border-radius: 20px; border: 3px solid #fff; touch-action: none; }
/* Pictures you tap on never pan the page, so a tap that rolls a little is still a tap (iPad). */
#item-body .creative-svg, #item-body .creative-hotspots, #item-body .stamp-svg, #item-body .marks-svg { touch-action: none; }
.match-status.is-nudged { animation: status-nudge .45s ease 2; color: #d1495b; }
@keyframes status-nudge { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.stamp-stage { cursor: crosshair; }

@media (max-height: 760px), (orientation: landscape) and (max-height: 900px) {
  .creative-svg { max-height: min(34vh, 200px); }
  .draw-stage { min-height: 160px; }
}

/* ——— Speed sheets (Bug Search, Animal Coding, Cancellation) ——— */
/* Pages keep the tiger beside the prompt and use the same top-right Next as every other item. */
#item-screen.is-sheet .item-prompt { font-size: clamp(1.05rem, 2.6vw, 1.35rem); margin: 4px 0 0; }
#item-screen.is-sheet .item-body { width: min(100%, 780px); display: block; }
#item-screen.is-sheet .timer-wrap {
  position: fixed; top: auto; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40;
}

.sheet { width: 100%; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.sheet-cell {
  position: relative; border: 0; padding: 0; background: #fff; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.sheet-cell svg { display: block; width: 100%; height: 100%; pointer-events: none; }
.sheet-x { position: absolute; inset: 6%; display: none; pointer-events: none; }
.sheet-x svg path { fill: none; stroke: #d62839; stroke-width: 11; stroke-linecap: round; }
.sheet-cell.is-marked .sheet-x { display: block; }
.sheet-done { display: block; margin: 18px auto 4px; }

/* Bug Search: target on the left, the row to search on the right. */
.bug-rows { list-style: none; margin: 0; padding: 0; border: 2px solid #1f3a5f; border-radius: 14px; overflow: hidden; background: #fff; }
.bug-row { display: grid; grid-template-columns: minmax(64px, 1.05fr) 6.3fr; border-top: 1.5px solid #c9d6e2; }
.bug-row:first-child { border-top: 0; }
.bug-target {
  display: grid; place-items: center; padding: 6px;
  background: color-mix(in srgb, var(--row, #3a86c8) 12%, #fff);
  border-right: 2px solid #1f3a5f;
}
.bug-target svg { width: min(100%, 76px); height: auto; aspect-ratio: 1; }
.bug-choices { display: grid; grid-template-columns: repeat(var(--n, 6), 1fr); }
.bug-cell { aspect-ratio: 1; max-height: 92px; padding: 6px; border-left: 1px solid #edf1f5; }
.bug-cell:first-child { border-left: 0; }

/* Animal Coding: the key stays on top, then the cards. */
.code-key {
  position: sticky; top: 84px; z-index: 2; display: flex; justify-content: center; gap: 10px;
  padding: 8px; margin-bottom: 12px; background: #fff7ec; border-radius: 16px;
  box-shadow: 0 4px 12px #1f3a5f18;
}
.code-key-box { width: 92px; border-radius: 12px; background: #ffe8cc; border: 2px solid #f4a261; overflow: hidden; }
.code-key-pic { height: 64px; padding: 6px; }
.code-key-shape { height: 42px; padding: 4px 22px; background: #fff3e0; border-top: 2px solid #f4a261; }
.code-key-pic svg, .code-key-shape svg { width: 100%; height: 100%; display: block; }
.code-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.code-card { border: 2px solid #c9d6e2; border-radius: 14px; background: #fff; padding: 6px 6px 8px; }
.code-card.is-next { border-color: #4cc9f0; box-shadow: 0 0 0 3px #4cc9f044; }
.code-pic { height: 66px; padding: 2px; }
.code-pic svg { width: 100%; height: 100%; display: block; }
.code-opts { display: flex; justify-content: center; gap: 4px; border-top: 1.5px solid #e3eaf0; padding-top: 6px; }
.code-opt { width: 44px; height: 44px; border-radius: 10px; padding: 4px; }

/* Cancellation: targets in a row, then the pile (scattered or in rows). */
.cancel-targets {
  position: sticky; top: 84px; z-index: 2; display: flex; justify-content: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 10px; background: #fff; border: 3px solid #e07a5f; border-radius: 16px;
  box-shadow: 0 4px 12px #1f3a5f18;
}
.cancel-target { width: 62px; height: 62px; }
.cancel-target svg { width: 100%; height: 100%; display: block; }
.cancel-field {
  position: relative; width: 100%; background: #fff; border: 2px solid #c9d6e2; border-radius: 16px;
}
.sheet-cancel.is-scatter .cancel-field { aspect-ratio: calc(var(--cols) * 1) / calc(var(--rows) * 1.05); }
.sheet-cancel.is-scatter .cancel-item {
  position: absolute; width: calc(64% / var(--cols)); aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(var(--turn, 0deg)); background: transparent; border-radius: 12px;
}
.sheet-cancel.is-rows .cancel-field {
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 4px; padding: 8px;
}
.sheet-cancel.is-rows .cancel-item { aspect-ratio: 1; border-radius: 10px; padding: 4px; }

/* After the page: green = right, red = wrong, dashed green = one she missed. */
.sheet.is-checked .sheet-cell { cursor: default; }
.sheet-cell.is-right { box-shadow: inset 0 0 0 4px var(--ok); background: #e4ffe8; }
.sheet-cell.is-right .sheet-x svg path { stroke: var(--ok); }
.sheet-cell.is-wrong { box-shadow: inset 0 0 0 4px var(--bad); background: #ffe8e4; }
.sheet-cell.is-missed { outline: 4px dashed var(--ok); outline-offset: -5px; }
.sheet-cancel.is-scatter .sheet-cell.is-right,
.sheet-cancel.is-scatter .sheet-cell.is-wrong { border-radius: 50%; }

/* Picker shown before a speed-sheet session. */
.sheet-picker {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: #1f3a5f66;
}
.sheet-picker-card {
  width: min(100%, 560px); max-height: calc(100dvh - 32px); overflow: auto;
  background: #fff; border-radius: 24px; padding: 22px; box-shadow: 0 20px 50px #1f3a5f44; color: var(--child-ink);
}
.sheet-picker-card h2 { margin: 0 0 6px; font-size: 1.5rem; }
.sheet-picker-lead { margin: 0 0 14px; color: #48607a; }
.sheet-picker-label { margin: 14px 0 6px; font-weight: 800; }
.sheet-picker-games, .sheet-picker-levels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sheet-picker-levels { grid-template-columns: repeat(3, 1fr); }
.sheet-choice {
  display: grid; gap: 2px; text-align: left; min-height: 60px; padding: 10px 12px;
  border: 3px solid #e3eaf0; border-radius: 14px; background: #f7fafc; color: var(--child-ink);
  font: inherit; cursor: pointer;
}
.sheet-choice strong { font-size: 1.02rem; }
.sheet-choice span { font-size: .82rem; color: #5a7088; }
.sheet-choice[aria-checked="true"] { border-color: #e07a5f; background: #fff1ec; }
.sheet-picker-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 18px; }
.report-sheets-title { margin: 18px 0 4px; }

@media (max-width: 560px) {
  .code-cards { grid-template-columns: repeat(2, 1fr); }
  .code-key-box { width: 76px; }
  .cancel-target { width: 48px; height: 48px; }
  .sheet-picker-games { grid-template-columns: 1fr; }
}

/* ——— Puzzle book (Block Design, Matrix, Picture Concepts, Picture Memory, Zoo Locations, Object Assembly) ——— */
.puzzle-picker-games { grid-template-columns: repeat(2, 1fr); }
#item-screen.is-puzzle .item-body { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pz-choice {
  position: relative; display: grid; place-items: center; padding: 8px;
  border-radius: 20px; border: 4px solid #fff; background: #fff;
  box-shadow: 0 6px 0 #a8c4d8; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.pz-choice svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.pz-choice:active { transform: translateY(3px); box-shadow: 0 3px 0 #a8c4d8; }
.pz-choice.selected { border-color: var(--sky); background: #eaf8ff; box-shadow: 0 6px 0 #2a9bb088; }
.pz-choice.is-tried { opacity: .35; filter: grayscale(1); pointer-events: none; transform: none; box-shadow: 0 3px 0 #c9d6e0; }
.pz-choice.is-answer {
  border-color: var(--ok); background: #e4ffe8;
  box-shadow: 0 0 0 6px #57cc9966, 0 6px 0 #2bb67366; animation: answer-glow 1.1s ease-in-out 3;
}
.pz-choice-num {
  position: absolute; bottom: 4px; right: 8px; font-size: .8rem; font-weight: 800; color: #8aa2b8;
}
.pz-done { display: block; margin: 18px auto 4px; }
.pz-done:disabled { opacity: .45; filter: grayscale(.4); }

/* Matrix: the grid in a frame, then four numbered choices like the book. */
.pz-matrix {
  display: grid; gap: 0; margin: 4px auto 22px; width: max-content;
  border: 3px solid #e9c46a; border-radius: 10px; overflow: hidden; background: #fff;
}
.pz-matrix-2 { grid-template-columns: repeat(2, clamp(110px, 20vw, 150px)); }
.pz-matrix-3 { grid-template-columns: repeat(3, clamp(92px, 15vw, 118px)); }
.pz-matrix-cell { aspect-ratio: 1; padding: 10px; border: 1.5px solid #f1dfae; display: grid; place-items: center; }
.pz-matrix-cell svg { width: 100%; height: 100%; display: block; }
.pz-matrix-cell.is-gap { background: #fffaf0; }
.pz-matrix-cell.is-filled { background: #e4ffe8; animation: answer-glow 1.1s ease-in-out 2; }
.pz-gap { font-size: 3rem; font-weight: 900; color: var(--ink); }
.pz-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 132px)); gap: 14px; justify-content: center; }
.pz-choices .pz-choice { aspect-ratio: 1; }

/* Picture Concepts: one framed row per line; pick one picture in each. */
.pz-concepts { display: grid; gap: 0; width: min(100%, 640px); margin: 0 auto; border: 2.5px solid #7b68ee; border-radius: 16px; overflow: hidden; background: #fff; }
.pz-concept-row { display: grid; grid-template-columns: repeat(var(--n, 2), 1fr); gap: 14px; padding: 14px 18px; border-top: 2px solid #d9d2ff; }
.pz-concept-row:first-child { border-top: 0; }
.pz-concept { aspect-ratio: 1; max-height: 170px; justify-self: center; width: 100%; max-width: 170px; }
.pz-concepts-3 .pz-concept { max-height: 132px; max-width: 132px; }

/* Picture Memory: study page, then the answer page. */
.pz-memory-show { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin: 10px auto; }
.pz-card { width: clamp(120px, 24vw, 190px); aspect-ratio: 1; padding: 12px; background: #fff; border: 2px solid #b8d8e8; border-radius: 16px; }
.pz-memory-show.pz-n-3 .pz-card, .pz-memory-show.pz-n-4 .pz-card { width: clamp(110px, 20vw, 150px); }
.pz-card svg { width: 100%; height: 100%; display: block; }
.pz-memory-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 150px)); gap: 14px; justify-content: center; }
.pz-memory-choices.pz-n-2 { grid-template-columns: repeat(2, minmax(0, 190px)); }
.pz-memory-choices.pz-n-3 { grid-template-columns: repeat(3, minmax(0, 170px)); }
.pz-memory-choices .pz-choice { aspect-ratio: 1; }

/* Zoo Locations: a scene with spots; animals go back where they were. */
.pz-zoo-board {
  position: relative; width: min(100%, 640px); aspect-ratio: 4 / 3; margin: 0 auto;
  border-radius: 18px; overflow: hidden; border: 3px solid #4a90c2; background: #caf0f8;
}
.pz-zoo-board > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pz-zoo-spot {
  position: absolute; width: 17%; aspect-ratio: 1; transform: translate(-50%, -50%); padding: 0;
  border: 2.5px solid #1f3a5fcc; border-radius: 8px; background: #ffffff66;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; cursor: pointer;
}
.pz-zoo-board.is-placing .pz-zoo-spot:not(.is-filled) { border-color: #ffb703; box-shadow: 0 0 0 4px #ffb70366; }
.pz-zoo-card { position: absolute; inset: 0; display: grid; place-items: center; padding: 8%; background: #fff; border-radius: 6px; }
.pz-zoo-card svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.pz-zoo-card.is-right { box-shadow: inset 0 0 0 4px var(--ok); background: #e4ffe8; }
.pz-zoo-card.is-wrong { box-shadow: inset 0 0 0 4px var(--bad); background: #ffe8e4; }
.pz-zoo-card.is-missed { opacity: .8; background: #ffffffcc; outline: 4px dashed var(--ok); outline-offset: -4px; }
.pz-zoo-card.is-missed.is-badge { inset: auto -14% -14% auto; width: 58%; height: 58%; opacity: 1; background: #fff; border-radius: 8px; outline-width: 3px; outline-offset: -3px; z-index: 2; }
.pz-zoo-spot { overflow: visible; }
.pz-zoo-tray { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 14px auto 0; min-height: 104px; }
.pz-zoo-tray-card { width: 96px; height: 96px; }

/* Object Assembly: drag pieces from the tray into the box; they click in near their place. */
.pz-assembly { display: flex; justify-content: center; }
.pz-stage { position: relative; }
.pz-board { position: absolute; left: 0; top: 0; border: 3px dashed #8aa2b8; border-radius: 12px; background: #fffdf7; }
.pz-board svg { width: 100%; height: 100%; display: block; opacity: 0; }
.pz-board.has-outline svg { opacity: .14; filter: grayscale(1); }
.pz-tray { position: absolute; border-radius: 16px; background: #eaf4fb; border: 2px solid #c9dceb; }
.pz-piece {
  position: absolute; left: 0; top: 0; background: transparent; cursor: grab;
  touch-action: none; -webkit-tap-highlight-color: transparent; z-index: 2; will-change: transform;
}
.pz-piece svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.pz-piece.is-dragging { cursor: grabbing; filter: brightness(1.04); }
.pz-piece.is-placed { cursor: default; z-index: 1; }
.pz-piece.is-missed { opacity: .55; }

/* Block Design: the picture to copy, the empty squares, then the block faces to pick from. */
.pz-blocks-label { text-align: center; font-weight: 800; color: var(--ink-soft); margin: 0 0 6px; }
.pz-blocks-model, .pz-blocks-work { display: grid; grid-template-columns: repeat(var(--cols), var(--b)); justify-content: center; }
.pz-blocks-model { --b: clamp(54px, 9vw, 74px); gap: 3px; margin: 0 auto 18px; }
.pz-blocks-work { --b: clamp(72px, 12vw, 96px); gap: 0; width: max-content; margin: 0 auto 18px; border: 3px solid #1f3a5f; border-radius: 6px; overflow: hidden; }
.pz-block { width: var(--b, 72px); height: var(--b, 72px); padding: 0; border: 0; display: block; background: transparent; }
.pz-block svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.pz-blocks-model .pz-block { box-shadow: 0 0 0 1.5px #1f3a5f55; }
.pz-slot { background: #f1f3f5; box-shadow: inset 0 0 0 1px #c9d6e2; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.pz-slot.is-right { box-shadow: inset 0 0 0 4px var(--ok); }
.pz-slot.is-wrong { box-shadow: inset 0 0 0 4px var(--bad); }
.pz-slot.is-missed { box-shadow: inset 0 0 0 4px var(--bad); background: #ffe8e4; }
.pz-blocks-tray { --b: 64px; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.pz-face {
  border-radius: 10px; overflow: hidden; cursor: pointer; box-shadow: 0 0 0 2px #1f3a5f55, 0 5px 0 #a8c4d8;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.pz-face.selected { box-shadow: 0 0 0 5px var(--sky), 0 5px 0 #2a9bb088; transform: translateY(-2px); }
.pz-blocks-tray.is-done { opacity: .5; pointer-events: none; }
.pz-blocks-hint { text-align: center; color: var(--ink-soft); font-weight: 700; font-size: .9rem; margin: 10px 0 0; }

@media (max-width: 560px) {
  .pz-choices, .pz-memory-choices { grid-template-columns: repeat(2, minmax(0, 150px)); }
  .pz-concept-row { gap: 8px; padding: 10px; }
}

/* ——— Newer items drawn with puzzle-art pictures ——— */
.pic-stimulus.pic-2x1 { width: 128px; height: 66px; }
.pic-stimulus.pic-2x1 svg { width: 124px; height: 62px; }
.pic-stimulus.pic-3x1 { width: 140px; height: 50px; }
.pic-stimulus.pic-3x1 svg { width: 138px; height: 47px; }
.pic-stimulus.pic-1x2 { width: 52px; height: 100px; }
.pic-stimulus.pic-1x2 svg { width: 50px; height: 100px; }
.scene-box.scene-pic { width: min(100%, 220px); height: auto; aspect-ratio: 1; padding: 10px; }
.scene-box.scene-pic svg { width: 100%; height: 100%; display: block; }
.creative-stage .scene-box.scene-pic { margin: 0 auto 6px; }
.mirror-scene { display: grid; justify-items: center; gap: 0; margin: 0 auto 6px; width: min(100%, 260px); }
.mirror-thing { width: 150px; height: 150px; }
.mirror-thing svg { width: 100%; height: 100%; display: block; }
.mirror-scene.is-water .mirror-surface {
  width: 100%; height: 56px; border-radius: 0 0 20px 20px;
  background: linear-gradient(#7fd3f5, #48cae4); box-shadow: inset 0 6px 0 #ffffff66;
}
.mirror-scene.is-mirror { grid-template-columns: 1fr auto; align-items: center; column-gap: 16px; }
.mirror-scene.is-mirror .mirror-surface {
  width: 70px; height: 150px; border-radius: 14px; border: 6px solid #bc8a5f;
  background: linear-gradient(135deg, #e9f5ff, #c7e3f7 55%, #eef8ff);
}
.draw-pics { max-height: 230px; }
.stamp-pics { width: min(100%, 380px); margin: 0 auto; border-radius: 20px; overflow: hidden; border: 3px solid #fff; box-shadow: 0 6px 0 #a8c4d855; }
.stamp-svg { display: block; width: 100%; height: auto; aspect-ratio: 8 / 7; touch-action: none; cursor: pointer; }
.stamp-mark { pointer-events: none; }
.stamp-actions { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 12px; }
.marks-stage { width: min(100%, 520px); }
.marks-svg { max-height: none; touch-action: none; cursor: pointer; border-radius: 14px; }
/* Picture hide-and-seek and drawing pages use the iPad's width, with Done underneath. */
#item-body:has(> .creative-stage.is-wide), #item-body:has(> .draw-stage.is-wide) { flex-direction: column; }
.creative-stage.is-wide { width: min(100%, 640px); }
.creative-stage.is-wide .find-scene-pics { max-height: none; border-radius: 18px; }
.draw-stage.is-wide { width: min(100%, 460px); min-height: 0; aspect-ratio: 1; }
.draw-stage.is-wide .draw-pics { max-height: none; width: 100%; height: 100%; margin: 0; }
.draw-stage.is-wide .draw-split { height: 100%; }
/* Picture choices are a little bigger than the old icons, so small details (a missing wheel) show. */
.choice-btn .pic-stimulus:not(.pic-2x1):not(.pic-3x1):not(.pic-1x2),
.target-btn .pic-stimulus:not(.pic-2x1):not(.pic-3x1):not(.pic-1x2) { width: 92px; height: 92px; }
.choice-btn .pic-stimulus:not(.pic-2x1):not(.pic-3x1):not(.pic-1x2) svg,
.target-btn .pic-stimulus:not(.pic-2x1):not(.pic-3x1):not(.pic-1x2) svg { width: 88px; height: 88px; }

/* ——— While playing, the game fits the screen: no page scrolling on the iPad ———
   body.in-session is set while the session view is open. The header hides, the stage fills the
   visible height (100dvh), the tiger sits beside the prompt, and the page script scales the item
   (--fit, see fitItem in wppsi.js) when it would not fit. On tablets the parent helper becomes a
   small button in the top-left corner that opens over the game. */
body.in-session { overflow: hidden; overscroll-behavior: none; }
body.in-session .site-header,
body.in-session .skip-link { display: none; }
body.in-session .app-shell {
  max-width: none; height: 100vh; height: 100dvh; box-sizing: border-box;
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  display: flex; flex-direction: column;
}
body.in-session #practice-app { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body.in-session .session-view { flex: 1; min-height: 0; height: auto; animation: none; }
body.in-session .proctor-panel { max-height: 100%; overflow-y: auto; }
body.in-session .child-stage { min-height: 0; height: 100%; }
body.in-session .child-canvas {
  min-height: 0; height: 100%; display: flex; flex-direction: column;
  box-shadow: 0 0 0 3px #ff6b6b55, 0 0 0 6px #ffd16655, 0 10px 24px #1f3a5f22;
}
body.in-session .stage-screen {
  flex: 1; min-height: 0; height: auto; padding: 12px 16px; gap: 10px; overflow-y: auto;
}
body.in-session #item-screen { overflow: hidden; justify-content: flex-start; }
body.in-session #item-screen .item-host-row,
body.in-session #item-screen .feedback,
body.in-session #item-screen .item-nav { flex: 0 0 auto; }
body.in-session #item-screen .item-host-row {
  flex-direction: row; justify-content: center; gap: 12px; width: 100%;
  padding: 0 136px; box-sizing: border-box; min-height: 56px;
}
body.in-session #item-screen .friends-row { width: auto; flex: 0 0 auto; }
body.in-session #item-screen .tiger-host { width: clamp(56px, 8vh, 84px); }
body.in-session #item-screen .item-prompt { font-size: clamp(1.1rem, 2.4vh, 1.5rem); line-height: 1.25; text-align: left; }
body.in-session #item-screen.shop-mode .item-host-row { flex-direction: column; gap: 6px; padding: 0 96px; }
body.in-session #item-screen.shop-mode .friends-row { width: min(100%, 30rem); min-height: 0; padding: 8px 10px 4px; }
body.in-session #item-screen.shop-mode .tiger-host { width: clamp(58px, 9vh, 92px); }
body.in-session #item-screen.shop-mode .girl-host { width: clamp(64px, 10vh, 100px); }
body.in-session #item-screen.shop-mode .shop-cart { width: clamp(52px, 8vh, 80px); }
body.in-session #item-screen.shop-mode .item-prompt { text-align: center; }
body.in-session .shop-list { padding: 6px 16px 8px; }
body.in-session #item-screen .item-body {
  --fit: 1;
  flex: 1 1 0; min-height: 0; width: min(100%, 1000px); margin-top: 0;
  align-content: center; overflow: visible;
}
body.in-session #item-screen .item-body > * { zoom: var(--fit); }
body.in-session #item-screen .item-body.is-scrolling { overflow-y: auto; align-content: flex-start; }
body.in-session #item-screen.is-sheet .item-body { width: min(100%, 780px); display: flex; flex-direction: column; align-items: stretch; justify-content: center; flex-wrap: nowrap; }
body.in-session #item-screen.is-sheet .item-body:has(.sheet-code) { width: min(100%, 1060px); }
body.in-session #item-screen.is-sheet .item-host-row { min-height: 44px; }
body.in-session #item-screen.is-sheet .tiger-host { width: clamp(48px, 6.5vh, 70px); }
body.in-session #item-screen.is-sheet .item-prompt { margin: 0; font-size: clamp(1rem, 2.2vh, 1.3rem); }
body.in-session #item-screen.is-sheet .item-body { justify-content: flex-start; }
body.in-session .proctor-toggle-label { font-size: .9rem; }
body.in-session .code-key, body.in-session .cancel-targets { position: static; }
body.in-session .feedback { min-height: 0; padding: 8px 18px; font-size: 1.1rem; flex: 0 0 auto; }
body.in-session .big-touch { margin-top: 4px; }

/* Tablets (portrait, or landscape up to 900 px tall): parent helper as a corner button over the game. */
@media (max-width: 900px), (orientation: landscape) and (max-height: 900px) {
  body.in-session .session-view { display: flex; flex-direction: column; gap: 0; }
  body.in-session .child-stage { flex: 1; min-height: 0; }
  body.in-session .proctor-panel {
    position: fixed; z-index: 45; order: 0;
    top: calc(14px + env(safe-area-inset-top)); left: calc(14px + env(safe-area-inset-left)); bottom: auto;
    width: auto; max-width: calc(100vw - 28px); max-height: calc(100dvh - 28px);
    padding: 4px; border-width: 2px; border-radius: 16px;
    box-shadow: 0 4px 0 #a8c4d855, 0 10px 24px #1f3a5f22;
  }
  body.in-session .proctor-toggle { width: auto; min-height: 44px; padding: 6px 12px; border-radius: 12px; gap: 8px; }
  body.in-session .proctor-panel:not(.is-open) .proctor-toggle-hint { display: none; }
  body.in-session .proctor-panel.is-open { width: min(440px, calc(100vw - 28px)); padding: 10px; }
  body.in-session .proctor-panel.is-open .proctor-toggle { width: 100%; }
}
/* The answer line and the timer live in a band at the bottom, so the item never jumps when they appear. */
body.in-session #item-screen { padding-bottom: 64px; }
body.in-session #item-screen #feedback {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 8;
  width: max-content; max-width: calc(100% - 40px); text-align: center; animation: none;
}
body.in-session #item-screen:has(#timer-wrap:not([hidden])) #feedback { max-width: calc(100% - 440px); }
body.in-session #item-screen .timer-wrap { top: auto; bottom: 8px; right: 14px; padding: 8px 14px; }
body.in-session #item-screen.is-sheet .timer-wrap { position: absolute; bottom: 8px; right: 14px; }
/* A % width does not shrink with zoom; give the full-width sheet a pixel width (set by fitItem). */
body.in-session #item-screen .item-body > .sheet { width: var(--bodyw, 100%); flex: 0 0 auto; align-self: center; }

/* ——— Remember: what went away, where was it, how many, one at a time ——— */
.show-strip { flex-wrap: wrap; justify-content: center; max-width: 100%; }
.gap-strip .gap-slot {
  width: 80px; height: 80px; border-radius: 18px; border: 3px dashed #7b68ee99;
  background: repeating-linear-gradient(45deg, #f4f1ff, #f4f1ff 6px, #fbfaff 6px, #fbfaff 12px);
  display: grid; place-items: center; font-size: 2.2rem; font-weight: 900; color: #7b68ee;
}
.sequence-stage { display: grid; justify-items: center; gap: 16px; }
.sequence-card {
  width: 190px; height: 190px; border-radius: 30px; background: #ffffffee; border: 4px solid #fff;
  box-shadow: 0 8px 0 #a8c4d855; display: grid; place-items: center; animation: pop-in .25s ease both;
}
.sequence-card .stimulus { width: 160px; height: 160px; }
.sequence-card .stimulus svg { width: 150px; height: 150px; }
.sequence-card.is-ready { font-size: 2rem; font-weight: 900; color: #7b68ee; }
.sequence-dots { display: flex; gap: 10px; }
.sequence-dots span { width: 14px; height: 14px; border-radius: 50%; background: #d9e3ea; }
.sequence-dots span.on { background: #7b68ee; }
.where-grid { --where-cell: 104px; gap: 12px; }
.where-box {
  width: var(--where-cell); height: var(--where-cell); padding: 0; border-radius: 20px; border: 3px solid #fff;
  background: linear-gradient(#ffe9b8, #ffd27a); box-shadow: 0 5px 0 #d9a44188;
  display: grid; place-items: center; font: inherit; color: inherit;
}
.where-box.open { background: #fffaf0; }
.where-box .pic-stimulus { width: 86px; height: 86px; }
.where-box .pic-stimulus svg { width: 82px; height: 82px; }
button.where-box { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: transform .12s; }
button.where-box:active { transform: translateY(3px); box-shadow: 0 2px 0 #d9a44188; }
.where-box.is-tried { opacity: .35; filter: grayscale(1); pointer-events: none; }
.where-box.is-answer {
  border-color: var(--ok); background: #e4ffe8;
  box-shadow: 0 0 0 6px #57cc9966, 0 5px 0 #2bb67366; animation: answer-glow 1.1s ease-in-out 3;
}
.where-cue { width: 100%; display: flex; justify-content: center; align-items: center; gap: 12px; font-weight: 800; font-size: 1.2rem; color: var(--child-ink); }
.where-cue .stimulus { background: #fff; border-radius: 18px; border: 3px solid #fff; box-shadow: 0 5px 0 #a8c4d855; }

/* ——— Add & take away ——— */
.math-card {
  width: 100%; display: grid; justify-items: center; gap: 14px; padding: 16px; border-radius: 26px;
  background: #ffffffdd; border: 3px solid #fff; box-shadow: 0 6px 0 #a8c4d855;
}
.math-pics { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; }
.math-group {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 300px; padding: 8px;
  border-radius: 18px; background: #effbf9; border: 2px dashed #2ec4b677;
}
.math-group.second { background: #fff7e6; border-color: #ffb70377; }
.math-group.is-empty { width: 70px; height: 70px; }
.math-pic { position: relative; display: grid; }
.math-pic .pic-stimulus { width: 54px; height: 54px; }
.math-pic .pic-stimulus svg { width: 50px; height: 50px; }
/* A taken-away picture: faded, with a red cross. */
.math-pic.gone .pic-stimulus { opacity: .4; }
.math-pic.gone::after {
  content: ""; position: absolute; inset: 4px;
  background:
    linear-gradient(to top right, transparent 45%, #e63946 45%, #e63946 55%, transparent 55%),
    linear-gradient(to top left, transparent 45%, #e63946 45%, #e63946 55%, transparent 55%);
}
.math-sign { font-size: 2.6rem; font-weight: 900; color: #2ec4b6; line-height: 1; }
.math-sum { display: flex; align-items: center; gap: 14px; font-size: 3rem; font-weight: 900; line-height: 1; color: var(--child-ink); font-variant-numeric: tabular-nums; }
.math-op { color: #2ec4b6; }
.math-ask.is-solved { background: #e4ffe8; border-style: solid; border-color: var(--ok); color: #1f8a4a; }
.math-ask { min-width: 1.5em; padding: 4px 8px; text-align: center; border-radius: 16px; background: #fff3c4; border: 3px dashed #ffb703; color: #c27c00; }
.num-stimulus { font-size: 3.2rem; font-weight: 900; line-height: 1; color: var(--child-ink); font-variant-numeric: tabular-nums; }
.choice-btn .num-stimulus { width: 72px; height: 72px; }
