/* =========================================================================
 * THE PARLOR  ·  parlor.css
 * Themes: Sunny (default, playful) · Parlor (calm, grown-up) · Night (dark)
 * plus High Contrast, big text, letter spacing and reduced motion.
 * Accessibility: 60px+ targets, visible focus, colour never used alone.
 * ========================================================================= */

/* ---------- tokens ---------- */
:root {
  --text-scale: 1;
  --extra-spacing: 0em;
  --bg: #fff8ef;
  --bg-a: #ffe3ec;
  --bg-b: #e3f4ff;
  --bg-c: #fff1c7;
  --panel: #ffffff;
  --panel-2: #fff9f2;
  --ink: #2a2140;
  --muted: #6e6583;
  --line: rgba(60, 36, 100, 0.12);
  --shadow: 0 18px 40px rgba(80, 50, 120, 0.16);
  --shadow-sm: 0 6px 16px rgba(80, 50, 120, 0.12);
  --focus: #5c7cfa;

  --coral: #ff6b6b;
  --orange: #ff922b;
  --sun: #fcc419;
  --mint: #20c997;
  --teal: #15aabf;
  --sky: #339af0;
  --blue: #4c6ef5;
  --violet: #845ef7;
  --pink: #f06595;

  --good: #2b9348;
  --good-bg: #d3f9d8;
  --near: #e8890c;
  --near-bg: #fff3bf;
  --miss: #8a8fa3;
  --cued: #f59f00;

  --tile-g: #37b24d;
  --tile-y: #f59f00;
  --tile-x: #868e96;

  --r: 22px;
  --r-sm: 14px;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-display: "Fredoka", "Baloo 2", "Segoe UI Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  --emoji: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}
[data-theme="parlor"] {
  --bg: #f4efe6;
  --bg-a: #e6ded0;
  --bg-b: #dfe9e3;
  --bg-c: #efe3d3;
  --panel: #fffdf8;
  --panel-2: #f8f3ea;
  --ink: #26302b;
  --muted: #5f6a64;
  --line: rgba(38, 48, 43, 0.14);
  --shadow: 0 18px 40px rgba(40, 50, 45, 0.14);
  --shadow-sm: 0 6px 16px rgba(40, 50, 45, 0.1);
  --coral: #c8553d;
  --orange: #d4843b;
  --sun: #d4a72c;
  --mint: #2a9d8f;
  --teal: #287271;
  --sky: #3d7ea6;
  --blue: #3d5a80;
  --violet: #6d4c8d;
  --pink: #b5577b;
  --focus: #2a9d8f;
}
[data-theme="night"] {
  --bg: #15122a;
  --bg-a: #2a1f4d;
  --bg-b: #10263f;
  --bg-c: #2d1d3a;
  --panel: #221d3d;
  --panel-2: #2a2449;
  --ink: #f4f0ff;
  --muted: #b7aed6;
  --line: rgba(220, 210, 255, 0.14);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 6px 16px rgba(0, 0, 0, 0.35);
  --good-bg: #1f4d2c;
  --near-bg: #4d3d10;
  --focus: #9775fa;
  color-scheme: dark;
}
html.hc {
  --ink: #000;
  --muted: #222;
  --panel: #fff;
  --panel-2: #fff;
  --bg: #fff;
  --bg-a: #fff;
  --bg-b: #fff;
  --bg-c: #fff;
  --line: #000;
  --good: #006b1f;
  --tile-g: #0b7a2a;
  --tile-y: #b35c00;
  --tile-x: #444;
  --focus: #0033cc;
}
html.hc[data-theme="night"] {
  --ink: #fff; --muted: #eee; --panel: #000; --panel-2: #000; --bg: #000; --bg-a: #000; --bg-b: #000; --bg-c: #000; --line: #fff; --focus: #ffd43b;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: calc(18px * var(--text-scale)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  letter-spacing: var(--extra-spacing);
  word-spacing: calc(var(--extra-spacing) * 2);
  line-height: 1.5;
  background: var(--bg);
  overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 600px at 8% -10%, var(--bg-a), transparent 60%),
    radial-gradient(800px 600px at 100% 10%, var(--bg-b), transparent 55%),
    radial-gradient(900px 700px at 50% 120%, var(--bg-c), transparent 60%),
    var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--blue); }
[data-theme="night"] a { color: #91a7ff; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 0.4em; font-weight: 600; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; border-radius: 10px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
[hidden] { display: none !important; }
#app { min-height: 100dvh; }
.page { max-width: 1180px; margin: 0 auto; padding: 0 clamp(14px, 3vw, 28px) 60px; }
.noscript { padding: 40px; text-align: center; font-size: 1.2rem; }

/* ---------- top navigation ---------- */
.topnav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 48px; height: 48px; display: grid; place-items: center; font-size: 28px; font-family: var(--emoji);
  background: linear-gradient(135deg, var(--coral), var(--sun)); border-radius: 16px; box-shadow: var(--shadow-sm);
}
.brand-name { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; }
.navlinks { display: flex; gap: 6px; flex-wrap: wrap; }
.navlinks a {
  text-decoration: none; color: var(--ink); padding: 10px 16px; border-radius: 999px; font-weight: 700;
  min-height: 48px; display: inline-flex; align-items: center; gap: 6px; transition: background 0.2s;
}
.navlinks a:hover { background: var(--panel); }
.navlinks a.on { background: var(--panel); box-shadow: var(--shadow-sm); }

.player-chip {
  display: inline-flex; align-items: center; gap: 8px; margin-left: auto; padding: 6px 14px 6px 6px; min-height: 48px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-sm); text-decoration: none; color: var(--ink); font-weight: 700; max-width: 45vw;
}
.pc-av { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--sun), var(--orange)); font-size: 22px; font-family: var(--emoji); flex: none; }
.pc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- welcome / sign-up ---------- */
.page.welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100dvh; padding-top: 20px; padding-bottom: 20px; }
.welcome-card { width: 100%; max-width: 620px; min-width: 0;text-align: center; background: var(--panel); border-radius: 32px; padding: clamp(20px, 5vw, 40px); box-shadow: var(--shadow); border: 1px solid var(--line); }
.welcome-card .hero-title { font-size: clamp(2.2rem, 9vw, 3.6rem); }
.wc-h { font-size: clamp(1.3rem, 5vw, 1.7rem); margin-top: 14px; }
.wc-form { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-top: 8px; text-align: left; }
.wc-label { font-weight: 700; margin-top: 6px; }
.wc-input { min-height: 64px; font-size: 1.4rem; border-radius: 18px; border: 3px solid var(--line); background: var(--panel-2); padding: 10px 18px; width: 100%; }
.wc-input:focus { border-color: var(--coral); outline: none; box-shadow: 0 0 0 5px color-mix(in srgb, var(--coral) 25%, transparent); }
.wc-go { margin-top: 12px; width: 100%; }
.avatar-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.av { aspect-ratio: 1; min-width: 0; border-radius: 16px; border: 3px solid var(--line); background: var(--panel-2); font-size: clamp(22px, 5.5vw, 30px); cursor: pointer; font-family: var(--emoji); padding: 0; transition: transform 0.15s; }
.av:hover { transform: scale(1.08); }
.av.on { border-color: var(--coral); background: color-mix(in srgb, var(--coral) 14%, var(--panel)); transform: scale(1.1); }
.avatar-pick.small { max-width: 520px; margin-bottom: 8px; }
.who-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 8px 0; }
.btn.who { min-height: 64px; font-size: 1.15rem; padding: 8px 22px 8px 8px; }
.who-av { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; background: linear-gradient(135deg, var(--sun), var(--orange)); font-family: var(--emoji); }
.wc-or { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 18px 0 4px; font-size: 0.9rem; }
.wc-or::before, .wc-or::after { content: ""; flex: 1; border-top: 2px dashed var(--line); }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding: 14px 16px; border-radius: 18px; border: 2px dashed rgba(201, 42, 42, 0.4); background: color-mix(in srgb, #ff6b6b 6%, var(--panel)); }
.danger-zone small { display: block; color: var(--muted); }
.danger-zone > div { flex: 1; min-width: 200px; }

/* ---------- buttons ---------- */
.btn {
  --b1: var(--panel); --b2: var(--panel); --bt: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 10px 22px; border-radius: 999px; border: 2px solid transparent;
  background: linear-gradient(135deg, var(--b1), var(--b2)); color: var(--bt);
  font-weight: 700; font-size: 1rem; cursor: pointer; text-decoration: none;
  box-shadow: var(--shadow-sm); transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn .bi { font-size: 1.3em; line-height: 1; font-family: var(--emoji); }
.btn-primary { --b1: var(--coral); --b2: var(--orange); --bt: #fff; }
.btn-sky { --b1: var(--sky); --b2: var(--teal); --bt: #fff; }
.btn-coral { --b1: var(--pink); --b2: var(--coral); --bt: #fff; }
.btn-violet { --b1: var(--violet); --b2: var(--blue); --bt: #fff; }
.btn-ghost { background: var(--panel); border-color: var(--line); box-shadow: none; }
.btn-ghost.danger { color: #c92a2a; border-color: rgba(201, 42, 42, 0.35); }
.btn-big { min-height: 64px; padding: 12px 26px; font-size: 1.05rem; }
.btn-xl { min-height: 74px; padding: 14px 40px; font-size: 1.3rem; }
.btn.small { min-height: 44px; padding: 6px 16px; font-size: 0.9rem; }
.btn-round {
  width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--line); background: var(--panel);
  font-size: 24px; cursor: pointer; display: inline-grid; place-items: center; flex: none; font-family: var(--emoji);
  box-shadow: var(--shadow-sm); transition: transform 0.15s;
}
.btn-round:hover { transform: scale(1.06); }
.btn-score { min-height: 68px; padding: 10px 22px; font-size: 1.05rem; border: 3px solid var(--line); background: var(--panel); box-shadow: none; }
.btn-score.good { border-color: var(--good); color: var(--good); }
.btn-score.good:hover { background: var(--good-bg); }
.btn-score.cued { border-color: var(--cued); color: #b35c00; }
[data-theme="night"] .btn-score.cued { color: #ffc078; }
.btn-score.cued:hover { background: var(--near-bg); }
.btn-score.notyet { border-color: var(--miss); color: var(--muted); }
.btn-score.neutral { border-color: var(--sky); }
.btn-hint { --b1: #fff3bf; --b2: #ffe066; --bt: #5c3d00; }
[data-theme="night"] .btn-hint { --b1: #5c4813; --b2: #7a5d10; --bt: #fff3bf; }
.btn.mic.on { animation: micPulse 1.2s ease-in-out infinite; }
@keyframes micPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(240, 101, 149, 0.55); } 50% { box-shadow: 0 0 0 16px rgba(240, 101, 149, 0); } }
.tool-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 12px 0; }
.tool-row.center { justify-content: center; }

/* ---------- home hero ---------- */
.hero { text-align: center; padding: clamp(10px, 3vw, 30px) 0 10px; }
.hero-tiles { display: inline-flex; gap: clamp(6px, 1.2vw, 12px); margin-bottom: 12px; perspective: 600px; }
.htile {
  width: clamp(44px, 9vw, 76px); height: clamp(44px, 9vw, 76px); display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 5vw, 42px); color: #fff; border-radius: 16px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.12), var(--shadow-sm);
  animation: tileIn 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.3) both, bob 4s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.09s), calc(1s + var(--i) * 0.25s);
}
.htile:nth-child(1) { background: var(--coral); }
.htile:nth-child(2) { background: var(--orange); }
.htile:nth-child(3) { background: var(--sun); color: #5c3d00; }
.htile:nth-child(4) { background: var(--mint); }
.htile:nth-child(5) { background: var(--sky); }
.htile:nth-child(6) { background: var(--violet); }
@keyframes tileIn { from { transform: rotateX(-100deg) translateY(-20px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
.hero-title {
  font-size: clamp(2.6rem, 7vw, 4.6rem); margin: 4px 0 0;
  background: linear-gradient(90deg, var(--coral), var(--orange) 25%, var(--violet) 60%, var(--sky));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
html.hc .hero-title { color: var(--ink); background: none; }
.hero-sub { font-size: clamp(1.05rem, 2.4vw, 1.35rem); margin: 6px auto 4px; max-width: 640px; color: var(--muted); }
.hero-hello { font-size: 1.2rem; margin: 8px 0 18px; }
.stats { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.stat {
  display: flex; align-items: center; gap: 12px; background: var(--panel); padding: 12px 22px 12px 14px; border-radius: 999px;
  box-shadow: var(--shadow-sm); text-align: left; border: 1px solid var(--line);
}
.stat b { font-size: 1.5rem; font-family: var(--font-display); }
.stat small { display: block; color: var(--muted); font-size: 0.8rem; line-height: 1.1; }
.stat-ico { font-size: 30px; font-family: var(--emoji); }
.ring { width: 52px; height: 52px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: url(#none); stroke: var(--mint); transition: stroke-dasharray 1s; }

.plan-banner {
  display: flex; align-items: center; gap: 14px; margin: 20px auto 0; padding: 14px 18px; border-radius: var(--r);
  background: linear-gradient(135deg, rgba(132, 94, 247, 0.14), rgba(51, 154, 240, 0.14)); border: 2px dashed var(--violet); flex-wrap: wrap;
}
.pb-ico { font-size: 34px; font-family: var(--emoji); }
.pb-text { flex: 1; min-width: 200px; }
.pb-text b { display: block; font-size: 1.1rem; }
.pb-text span { color: var(--muted); }

/* ---------- game grid ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 20px; margin-top: 28px; }
.game-card {
  position: relative; display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  background: var(--panel); border-radius: 26px; overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.3), box-shadow 0.2s;
  animation: cardIn 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; animation-delay: calc(0.15s + var(--i) * 0.06s);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(0.96); } to { opacity: 1; transform: none; } }
.game-card:hover { transform: translateY(-6px) rotate(-0.4deg); box-shadow: var(--shadow); }
.game-card.planned { outline: 3px solid var(--violet); outline-offset: 2px; }
.gc-top {
  height: 128px; display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.45), transparent 40%), linear-gradient(135deg, var(--c1), var(--c2));
}
.gc-top::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.25) 2px, transparent 2.5px); background-size: 22px 22px; opacity: 0.6;
}
.gc-emoji { font-size: 70px; font-family: var(--emoji); filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.2)); transition: transform 0.3s; position: relative; z-index: 1; }
.game-card:hover .gc-emoji { transform: scale(1.12) rotate(-6deg); }
.gc-badge { position: absolute; top: 12px; right: 12px; z-index: 2; background: #fff; color: var(--violet); font-weight: 700; font-size: 0.75rem; padding: 4px 10px; border-radius: 999px; }
.gc-body { padding: 16px 18px 8px; flex: 1; }
.gc-body h2 { font-size: 1.45rem; margin-bottom: 4px; }
.gc-body p { margin: 0 0 10px; color: var(--muted); }
.gc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.gc-tags span { font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); }
.gc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 18px 16px; }
.gc-skill { font-size: 0.8rem; color: var(--muted); line-height: 1.25; }
.gc-play {
  flex: none; font-weight: 700; color: #fff; padding: 8px 16px; border-radius: 999px; background: linear-gradient(135deg, var(--c1), var(--c2));
}
html.hc .gc-play { background: #000; }

.home-foot { margin-top: 40px; }
.foot-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.foot-card {
  display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; text-decoration: none; color: var(--ink);
  background: var(--panel); border-radius: var(--r); padding: 16px 18px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform 0.2s;
}
.foot-card:hover { transform: translateY(-3px); }
.foot-card > span { grid-row: span 2; font-size: 36px; font-family: var(--emoji); }
.foot-card small { color: var(--muted); }
.fine { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 24px; }

/* ---------- panels ---------- */
.panel { background: var(--panel); border-radius: var(--r); padding: clamp(18px, 3vw, 30px); box-shadow: var(--shadow-sm); border: 1px solid var(--line); margin-top: 18px; }

/* ---------- intro ---------- */
.intro-card { background: var(--panel); border-radius: 28px; box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); padding: 0 0 26px; }
.intro-head {
  display: flex; align-items: center; gap: 18px; padding: 26px clamp(18px, 3vw, 32px); color: #fff;
  background: radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.35), transparent 40%), linear-gradient(135deg, var(--c1), var(--c2));
}
html.hc .intro-head { background: #000; }
.intro-head h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: 0; }
.intro-head > div { flex: 1; }
.intro-tag { margin: 4px 0 0; font-size: 1.1rem; opacity: 0.95; }
.intro-emoji { font-size: clamp(56px, 10vw, 86px); font-family: var(--emoji); animation: wiggle 3s ease-in-out infinite; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.25)); }
@keyframes wiggle { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) scale(1.05); } }
.intro-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; padding: 22px clamp(18px, 3vw, 32px) 0; }
.intro-how ol { margin: 0; padding-left: 1.3em; }
.intro-how li { margin: 6px 0; font-size: 1.05rem; }
.intro-why { background: var(--panel-2); border-radius: var(--r-sm); padding: 16px; border: 1px solid var(--line); }
.intro-why details { margin-top: 12px; }
.intro-why summary { cursor: pointer; font-weight: 700; color: var(--blue); min-height: 44px; display: flex; align-items: center; }
.intro-why details p { font-size: 0.92rem; }
.lvl-title, .intro-setup, .levels, .intro-go { margin-left: clamp(18px, 3vw, 32px); margin-right: clamp(18px, 3vw, 32px); }
.lvl-title { margin-top: 22px; }
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.level {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; min-height: 76px; border-radius: var(--r-sm);
  border: 3px solid var(--line); background: var(--panel); cursor: pointer; transition: border-color 0.2s, transform 0.15s;
}
.level:hover { transform: translateY(-2px); }
.level.on { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 10%, var(--panel)); }
.lv-n {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-family: var(--font-display); font-size: 1.2rem;
  background: var(--panel-2); border: 2px solid var(--line);
}
.level.on .lv-n { background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; border-color: transparent; }
.lv-text b { display: block; }
.lv-text small { color: var(--muted); }
.intro-setup:not(:empty) { margin-top: 20px; }
.intro-setup h3 small { font-family: var(--font-body); font-weight: 400; font-size: 0.8rem; }
.intro-go { margin-top: 24px; display: flex; justify-content: center; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; align-items: center; }
.chip-group { font-weight: 700; color: var(--muted); font-size: 0.85rem; min-width: 110px; }
.chip {
  min-height: 52px; padding: 8px 16px; border-radius: 999px; border: 3px solid var(--line); background: var(--panel); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip small { color: var(--muted); }
.chip.on { border-color: var(--c1, var(--blue)); background: color-mix(in srgb, var(--c1, var(--blue)) 14%, var(--panel)); }
.chip.snd { min-width: 62px; justify-content: center; font-weight: 700; font-size: 1.1rem; }
.setup-row { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 8px; }
.seg-field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.seg-field > span { font-weight: 700; font-size: 0.9rem; color: var(--muted); }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--panel-2); border-radius: 999px; padding: 4px; border: 1px solid var(--line); gap: 2px; }
.seg button { min-height: 48px; padding: 6px 16px; border: 0; background: transparent; border-radius: 999px; cursor: pointer; font-weight: 700; }
.seg button.on { background: linear-gradient(135deg, var(--c1, var(--coral)), var(--c2, var(--orange))); color: #fff; box-shadow: var(--shadow-sm); }
html.hc .seg button.on { background: #000; color: #fff; }

/* ---------- play bar + stage ---------- */
.page.play { max-width: 980px; }
.playbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 0; flex-wrap: wrap;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.pb-title { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; flex: 1; min-width: 160px; }
.pb-title b { font-family: var(--font-display); font-size: 1.3rem; }
.pb-level { font-size: 0.8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); }
html.hc .pb-level { background: #000; }
.pb-dots { display: flex; gap: 5px; flex-wrap: wrap; max-width: 330px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--line); border: 2px solid transparent; }
.dot.now { border-color: var(--c1); background: var(--panel); transform: scale(1.25); }
.dot.correct { background: var(--tile-g); }
.dot.cued { background: var(--tile-y); }
.dot.skip { background: var(--tile-x); }
.pb-gems { background: var(--panel); border-radius: 999px; padding: 8px 14px; font-weight: 700; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.stage { background: var(--panel); border-radius: 28px; padding: clamp(16px, 3vw, 30px); box-shadow: var(--shadow); border: 1px solid var(--line); position: relative; min-height: 420px; }
.stage.enter { animation: stageIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
@keyframes stageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.pq-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; }
.pq-head > div { flex: 1; }
.pq-head small { display: block; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.75rem; }
.pq-head b { font-size: clamp(1.2rem, 3vw, 1.5rem); font-family: var(--font-display); font-weight: 500; }
.pq-icon { font-size: 40px; font-family: var(--emoji); }

/* ---------- choices ---------- */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.choice {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 120px; padding: 14px 12px;
  border-radius: 20px; border: 3px solid var(--line); background: var(--panel-2); cursor: pointer; font-size: 1.15rem; font-weight: 700;
  transition: transform 0.15s, border-color 0.2s, background 0.2s; animation: pop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.4) both; animation-delay: calc(var(--i) * 0.06s);
}
.choice:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--sky); }
.ch-emoji { font-size: 52px; line-height: 1.1; font-family: var(--emoji); }
.ch-say { position: absolute; top: 6px; right: 8px; font-size: 20px; opacity: 0.7; padding: 6px; font-family: var(--emoji); }
.ch-say:hover { opacity: 1; transform: scale(1.2); }
.choices-text .choice { min-height: 84px; font-size: 1.1rem; }
.choices-sound .choice { min-height: 110px; }
.choices-sound .ch-label { font-family: var(--font-display); font-size: 2.4rem; }
.choice.glow { border-color: var(--sun); box-shadow: 0 0 0 6px color-mix(in srgb, var(--sun) 35%, transparent); animation: glowPulse 1.6s ease-in-out infinite; }
@keyframes glowPulse { 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--sun) 15%, transparent); } }
.choice.right { border-color: var(--good); background: var(--good-bg); animation: bounce 0.6s; }
.choice.right::after { content: "✓"; position: absolute; top: 6px; left: 10px; color: var(--good); font-size: 1.4rem; font-weight: 700; }
.choice.wrong { opacity: 0.45; animation: shake 0.45s; }
.choices.locked .choice:not(.right) { opacity: 0.4; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bounce { 30% { transform: scale(1.08); } 60% { transform: scale(0.97); } }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }

/* ---------- SayIt ---------- */
.sayit { margin-top: 18px; padding: 18px; border-radius: 24px; background: linear-gradient(135deg, color-mix(in srgb, var(--c1, var(--coral)) 12%, var(--panel)), color-mix(in srgb, var(--c2, var(--sky)) 12%, var(--panel))); border: 2px solid var(--line); text-align: center; animation: stageIn 0.4s; }
.sayit-prompt { font-family: var(--font-display); font-size: clamp(1.25rem, 3vw, 1.6rem); margin-bottom: 8px; }
.sayit-card { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 34px; background: var(--panel); border-radius: 22px; box-shadow: var(--shadow-sm); min-width: 220px; position: relative; }
.sayit.speaking .sayit-card { box-shadow: 0 0 0 6px color-mix(in srgb, var(--sky) 40%, transparent), var(--shadow-sm); }
.sayit-emoji { font-size: 72px; line-height: 1.1; font-family: var(--emoji); }
.sayit-word { font-family: var(--font-display); font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 600; letter-spacing: calc(0.02em + var(--extra-spacing)); }
.sayit-word.veiled { filter: blur(14px); user-select: none; }
html.hc .sayit-word.veiled { filter: none; color: transparent; text-shadow: none; background: #000; border-radius: 10px; }
.sayit-reps { display: flex; gap: 8px; margin: 4px 0; }
.rep { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--good); }
.rep.on { background: var(--good); animation: bounce 0.5s; }
.sayit-heard { min-height: 2.2em; margin: 12px auto 4px; font-size: 1.1rem; max-width: 600px; }
.sayit-heard .yay { color: var(--good); font-weight: 700; font-size: 1.25rem; }
.sayit-heard .tip { display: inline-block; margin-top: 6px; color: var(--ink); background: var(--near-bg); padding: 6px 12px; border-radius: 12px; }
.sayit-actions, .sayit-score { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 10px; }
.sayit-score { padding-top: 12px; border-top: 2px dashed var(--line); margin-top: 14px; }
.sayit.done .sayit-actions, .sayit.done .sayit-score { opacity: 0.4; pointer-events: none; }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--pink); animation: dot 1s infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 50% { transform: translateY(-8px); opacity: 0.5; } }

/* ---------- Word Lock ---------- */
.wl-clue { display: flex; align-items: center; gap: 16px; background: var(--panel-2); border-radius: 22px; padding: 12px 16px; border: 1px solid var(--line); }
.wl-pic { width: 96px; height: 96px; flex: none; display: grid; place-items: center; font-size: 62px; background: var(--panel); border-radius: 20px; box-shadow: var(--shadow-sm); font-family: var(--emoji); }
.wl-pic.hidden-pic { background: repeating-linear-gradient(45deg, var(--panel), var(--panel) 10px, var(--panel-2) 10px, var(--panel-2) 20px); }
.wl-clue-text { flex: 1; }
.wl-cat { font-size: 1.25rem; }
.wl-hint { font-size: 1.05rem; padding: 4px 0; animation: stageIn 0.3s; }
.wl-board { display: grid; gap: 8px; justify-content: center; margin: 18px 0 8px; }
.wl-row { display: grid; grid-template-columns: repeat(var(--n), clamp(48px, 13vw, 66px)); gap: 8px; }
.wl-row.shake { animation: shake 0.45s; }
.wl-tile {
  aspect-ratio: 1; display: grid; place-items: center; position: relative; border: 3px solid var(--line); border-radius: 14px; background: var(--panel);
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 5vw, 2.1rem); text-transform: uppercase;
}
.wl-tile.filled { border-color: color-mix(in srgb, var(--ink) 45%, transparent); }
.wl-tile.given { background: color-mix(in srgb, var(--tile-g) 14%, var(--panel)); border-style: dashed; border-color: var(--tile-g); }
.wl-tile.pop { animation: tilePop 0.14s; }
@keyframes tilePop { 50% { transform: scale(1.12); } }
.wl-tile.flip { animation: flip 0.46s ease-in-out; }
@keyframes flip { 50% { transform: rotateX(90deg); } }
.wl-tile[data-s] { color: #fff; border-color: transparent; }
.wl-tile[data-s="g"] { background: var(--tile-g); }
.wl-tile[data-s="y"] { background: var(--tile-y); }
.wl-tile[data-s="x"] { background: var(--tile-x); }
.wl-tile[data-s="g"]::after, .wl-tile[data-s="y"]::after { position: absolute; top: 2px; right: 5px; font-size: 0.85rem; line-height: 1; }
.wl-tile[data-s="g"]::after { content: "✓"; }
.wl-tile[data-s="y"]::after { content: "↔"; }
.wl-row.win .wl-tile { animation: winHop 0.6s ease both; }
.wl-row.win .wl-tile:nth-child(2) { animation-delay: 0.08s; }
.wl-row.win .wl-tile:nth-child(3) { animation-delay: 0.16s; }
.wl-row.win .wl-tile:nth-child(4) { animation-delay: 0.24s; }
.wl-row.win .wl-tile:nth-child(5) { animation-delay: 0.32s; }
@keyframes winHop { 40% { transform: translateY(-18px); } 60% { transform: translateY(4px); } }
.wl-msg { text-align: center; min-height: 1.6em; font-size: 1.15rem; margin: 6px 0; }
.wl-tools { display: flex; justify-content: center; margin: 6px 0 12px; }
.wl-kb { display: flex; flex-direction: column; gap: 8px; align-items: center; user-select: none; }
.kb-row { display: flex; gap: 6px; justify-content: center; width: 100%; }
.kb-key {
  flex: 1; max-width: 58px; min-width: 0; height: 62px; border: 0; border-radius: 12px; background: var(--panel-2); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.1), 0 0 0 1px var(--line);
  font-weight: 700; font-size: 1.2rem; cursor: pointer; text-transform: uppercase; padding: 0;
}
.kb-key:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1); }
.kb-key.wide { max-width: 104px; flex: 1.6; font-size: 1rem; text-transform: none; }
.kb-key.enter { background: linear-gradient(135deg, var(--coral), var(--orange)); color: #fff; }
.kb-key[data-s="g"] { background: var(--tile-g); color: #fff; }
.kb-key[data-s="y"] { background: var(--tile-y); color: #fff; }
.kb-key[data-s="x"] { background: var(--tile-x); color: #fff; opacity: 0.7; }

/* ---------- Feature Garden ---------- */
.garden { overflow-x: clip; }
.garden .flower { position: relative; width: min(520px, 100%); aspect-ratio: 1; margin: 0 auto; --r: min(190px, 31vw); --pw: clamp(78px, 25vw, 140px); --ph: clamp(70px, 21vw, 118px); }
.petal {
  position: absolute; left: 50%; top: 50%; width: var(--pw); height: var(--ph); margin: calc(var(--ph) / -2) 0 0 calc(var(--pw) / -2);
  transform: rotate(var(--a)) translateY(calc(var(--r) * -1)) rotate(calc(var(--a) * -1)); border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%;
  border: 3px solid var(--line); background: var(--panel-2); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px;
  font-weight: 700; font-size: 0.85rem; line-height: 1.15; text-align: center; transition: background 0.4s, border-color 0.3s, box-shadow 0.3s;
  animation: petalIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4) both; animation-delay: calc(var(--i) * 0.07s);
}
@keyframes petalIn { from { opacity: 0; scale: 0.3; } to { opacity: 1; scale: 1; } }
.pt-icon { font-size: 28px; font-family: var(--emoji); }
.petal.active { border-color: var(--pink); box-shadow: 0 0 0 6px color-mix(in srgb, var(--pink) 30%, transparent); }
.petal.filled { background: linear-gradient(160deg, #ffc9de, #eebefa); border-color: transparent; color: #4a1942; }
.petal:nth-child(2).filled { background: linear-gradient(160deg, #ffd8a8, #ffc9de); }
.petal:nth-child(3).filled { background: linear-gradient(160deg, #fff3bf, #ffd8a8); }
.petal:nth-child(4).filled { background: linear-gradient(160deg, #c3fae8, #d0ebff); color: #0b3d3a; }
.petal:nth-child(5).filled { background: linear-gradient(160deg, #d0ebff, #e5dbff); color: #1b2a5c; }
.petal:nth-child(6).filled { background: linear-gradient(160deg, #e5dbff, #ffc9de); }
.petal.helped::after { content: "💡"; position: absolute; top: -6px; right: -2px; font-size: 18px; }
.petal .pt-text { overflow-wrap: break-word; hyphens: auto; }
.flower-core {
  position: absolute; left: 50%; top: 50%; width: clamp(120px, 28vw, 170px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff9db, #ffd43b 70%, #fab005); display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(250, 176, 5, 0.45); z-index: 2; color: #5c3d00;
}
.core-emoji { font-size: clamp(50px, 12vw, 72px); line-height: 1; font-family: var(--emoji); }
.core-word { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; }
.garden.bloom .flower { animation: bloomSpin 1.2s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes bloomSpin { 50% { transform: scale(1.06) rotate(8deg); } }
.petal-q { margin-top: 8px; }

/* ---------- Sound Detective ---------- */
.det-case { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.det-pic {
  width: clamp(130px, 28vw, 190px); aspect-ratio: 1; display: grid; place-items: center; position: relative; border-radius: 26px; overflow: hidden;
  background: radial-gradient(circle, #e7f5ff, #a5d8ff); box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.5), var(--shadow-sm);
}
.det-pic > span { font-size: clamp(80px, 17vw, 120px); filter: blur(var(--blur)); transition: filter 0.9s; font-family: var(--emoji); }
.det-glass { position: absolute; right: 6px; bottom: 2px; font-size: 44px; animation: wiggle 3s infinite; }
.det-pic.solved { animation: bounce 0.7s; }
.det-pic.solved .det-glass { display: none; }
.det-board { background: #fffdf3; border-radius: 18px; padding: 12px 16px; border: 2px solid #e9d8a6; color: #3b2f0b; box-shadow: var(--shadow-sm); background-image: repeating-linear-gradient(transparent 0 33px, rgba(0, 0, 0, 0.05) 33px 34px); }
[data-theme="night"] .det-board { background-color: #2c2a1d; color: #fff3bf; border-color: #5c4b1d; }
.det-title { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #b8860b; }
.det-clues { list-style: none; padding: 0; margin: 4px 0 0; }
.det-clues li { display: flex; align-items: center; gap: 10px; min-height: 34px; opacity: 0.65; }
.det-clues li.now { opacity: 1; font-weight: 700; }
.det-clues li.done { opacity: 1; }
.dc-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #e9d8a6; font-size: 0.85rem; font-weight: 700; flex: none; color: #3b2f0b; }
.det-clues li.done .dc-n { background: var(--tile-g); color: #fff; }
.det-clues li.helped .dc-n { background: var(--tile-y); }
.dc-label { flex: 1; }
.dc-val { font-weight: 700; font-family: var(--font-display); }
.det-drum { text-align: center; }
.drum {
  width: 150px; height: 150px; border-radius: 50%; border: 0; cursor: pointer; font-size: 84px; font-family: var(--emoji);
  background: radial-gradient(circle at 40% 35%, #fff, #ffe8cc 55%, #ffc078); box-shadow: 0 12px 0 #e8590c, var(--shadow);
  transition: transform 0.08s, box-shadow 0.08s; -webkit-tap-highlight-color: transparent;
}
.drum.big { width: clamp(150px, 36vw, 200px); height: clamp(150px, 36vw, 200px); font-size: clamp(84px, 20vw, 110px); }
.drum:active, .drum.hit { transform: translateY(8px) scale(0.97); box-shadow: 0 4px 0 #e8590c, var(--shadow-sm); }
.drum:disabled { opacity: 0.6; cursor: default; }
.drum-count { font-size: 1.3rem; margin-top: 14px; }
.drum-count b { font-size: 2.2rem; font-family: var(--font-display); }
.det-help { margin-top: 10px; font-weight: 700; color: var(--blue); }

/* ---------- Pair Up ---------- */
.pair { position: relative; }
.pair-ask { display: flex; align-items: center; gap: 12px; justify-content: center; text-align: left; }
.pair-ask small { display: block; color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.06em; }
.pair-ask b { font-family: var(--font-display); font-size: clamp(1.3rem, 3.5vw, 1.8rem); font-weight: 500; }
.pair-polly { font-size: 56px; animation: wiggle 2.4s infinite; font-family: var(--emoji); }
.pair-cards { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 3vw, 28px); margin: 22px 0 12px; }
.pcard {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: clamp(170px, 34vw, 240px); border-radius: 26px;
  background: var(--panel-2); border: 4px solid var(--line); cursor: pointer; transition: transform 0.2s, border-color 0.2s;
}
div.pcard { cursor: default; }
button.pcard:hover { transform: translateY(-4px); border-color: var(--mint); }
.pc-emoji { font-size: clamp(76px, 16vw, 116px); line-height: 1.05; font-family: var(--emoji); }
.pc-word { font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 600; }
.pc-star { position: absolute; top: 10px; left: 12px; font-size: 32px; animation: bob 2s infinite; }
.pcard.star { border-color: var(--sun); background: color-mix(in srgb, var(--sun) 14%, var(--panel)); }
.pcard.right { border-color: var(--good); background: var(--good-bg); animation: bounce 0.6s; }
.pcard.wrong { animation: shake 0.45s; border-color: var(--miss); }
.pcard.oops { animation: shake 0.5s; border-color: var(--orange); }
.pcard.pulse { transform: scale(1.06); border-color: var(--sky); }
.pair-heard { text-align: center; min-height: 2.4em; font-size: 1.15rem; }
.pair-heard .yay { color: var(--good); font-weight: 700; }
.pair-heard .tip { display: inline-block; margin-top: 8px; background: var(--near-bg); padding: 8px 14px; border-radius: 14px; }
.pair-judge { text-align: center; margin-top: 12px; padding-top: 12px; border-top: 2px dashed var(--line); }
.pair-judge > span { color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.flying-polly {
  position: absolute; left: 50%; top: 20px; font-size: 54px; pointer-events: none; z-index: 5; transform: translate(-50%, -50%); opacity: 0;
  transition: left 0.7s cubic-bezier(0.3, 0.1, 0.3, 1.2), top 0.7s cubic-bezier(0.3, -0.4, 0.3, 1.2), opacity 0.2s; font-family: var(--emoji);
}
.flying-polly.go { opacity: 1; animation: flap 0.25s 3; }
@keyframes flap { 50% { transform: translate(-50%, -60%) scaleY(0.85); } }

/* ---------- Beat Keeper ---------- */
.beat, .sing, .roll { text-align: center; }
.beat-pic, .sing-emoji { font-size: clamp(70px, 16vw, 104px); line-height: 1.1; font-family: var(--emoji); }
.beat-bubbles { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 10px 0; }
.bub {
  min-width: 84px; padding: 12px 18px; border-radius: 999px; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 4vw, 2rem);
  background: var(--panel-2); border: 3px dashed var(--line); transition: background 0.2s, transform 0.2s;
}
.bub.on { background: linear-gradient(135deg, var(--sun), var(--orange)); border: 3px solid transparent; color: #fff; transform: translateY(-4px); }
.bub.flash { background: var(--sky); color: #fff; transform: scale(1.15); border-color: transparent; }
.beat-msg { font-size: 1.2rem; min-height: 1.6em; }
.beat-drum-row { margin: 14px 0; }
.sing-staff { position: relative; display: flex; justify-content: center; align-items: stretch; gap: 10px; height: 170px; margin: 12px auto; max-width: 720px; flex-wrap: nowrap; background: repeating-linear-gradient(transparent 0 33px, var(--line) 33px 35px); border-radius: 18px; padding: 0 10px; }
.note {
  align-self: flex-end; margin-bottom: 18px; padding: 10px 16px; border-radius: 999px; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.1rem, 3.5vw, 1.7rem);
  background: linear-gradient(135deg, var(--sky), var(--teal)); color: #fff; box-shadow: var(--shadow-sm); transition: transform 0.2s; white-space: nowrap;
}
.note.hi { align-self: flex-start; margin: 18px 0 0; background: linear-gradient(135deg, var(--orange), var(--pink)); }
.note.sing-on { transform: scale(1.25); box-shadow: 0 0 0 8px color-mix(in srgb, var(--sun) 50%, transparent); }
.sing-steps { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.sstep { display: inline-flex; align-items: center; gap: 10px; min-height: 64px; padding: 8px 20px 8px 8px; border-radius: 999px; border: 3px solid var(--line); background: var(--panel); font-weight: 700; font-size: 1.05rem; cursor: pointer; }
.sstep.on:not(:disabled) { border-color: var(--orange); }
.sstep:disabled { opacity: 0.45; cursor: not-allowed; }
.ss-n { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--sun), var(--orange)); color: #fff; font-family: var(--font-display); }
.sing-pad-row { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.hand-pad { width: 96px; height: 96px; border-radius: 50%; border: 0; font-size: 54px; background: radial-gradient(circle at 40% 35%, #fff, #d0ebff 60%, #74c0fc); box-shadow: 0 8px 0 #1c7ed6; cursor: pointer; font-family: var(--emoji); }
.hand-pad.hit { animation: padHit 0.25s; }
@keyframes padHit { 50% { transform: translateY(6px) scale(0.94); box-shadow: 0 2px 0 #1c7ed6; } }
.sing-msg { font-size: 1.15rem; max-width: 420px; }
.roll-card { display: inline-flex; flex-direction: column; align-items: center; padding: 14px 40px; background: var(--panel-2); border-radius: 24px; border: 1px solid var(--line); }
.roll-emoji { font-size: 48px; font-family: var(--emoji); }
.roll-syl { font-family: var(--font-display); font-size: clamp(3rem, 12vw, 5rem); font-weight: 700; line-height: 1; background: linear-gradient(90deg, var(--orange), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
html.hc .roll-syl { color: var(--ink); background: none; }
.roll-tip { color: var(--muted); }
.roll-best { margin-top: 6px; font-weight: 700; }
.roll-stage { display: flex; align-items: center; justify-content: center; gap: 24px; margin: 18px 0; flex-wrap: wrap; }
.roll-timer { width: min(260px, 60vw); height: 18px; border-radius: 999px; background: var(--line); overflow: hidden; order: 3; flex-basis: 100%; max-width: 360px; margin: 0 auto; }
.roll-timer span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sun), var(--orange), var(--pink)); transition: width 0.1s linear; }
.roll-count b { display: block; font-family: var(--font-display); font-size: 3.5rem; line-height: 1; }
.roll-msg { font-size: 1.15rem; }
.roll-stats { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.rs { background: var(--panel-2); border-radius: 18px; padding: 12px 22px; min-width: 130px; border: 1px solid var(--line); }
.rs b { display: block; font-family: var(--font-display); font-size: 2rem; }
.rs small { color: var(--muted); }
.roll-badge { display: inline-block; margin-top: 12px; padding: 8px 18px; border-radius: 999px; background: linear-gradient(135deg, var(--sun), var(--orange)); color: #fff; font-weight: 700; animation: bounce 0.8s; }
.meter { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 6px; min-width: 60px; display: inline-block; width: 100%; vertical-align: middle; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), var(--sky)); }
td .meter { width: 90px; margin: 0 6px 0 0; }

/* ---------- Finish the Line ---------- */
.fl-card { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--violet) 12%, var(--panel)), color-mix(in srgb, var(--blue) 10%, var(--panel))); border-radius: 24px; padding: 20px 22px; margin-bottom: 18px; }
.fl-stem { flex: 1; font-family: var(--font-display); font-size: clamp(1.6rem, 4.5vw, 2.4rem); font-weight: 500; line-height: 1.35; }
.fl-blank { display: inline-block; min-width: 3.2em; margin: 0 0.25em; padding: 0 0.3em; text-align: center; border-bottom: 5px solid var(--violet); color: var(--violet); font-weight: 700; }
.fl-blank.filled { border-bottom-color: var(--good); color: var(--good); animation: bounce 0.6s; }
.vn-builder { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; margin-bottom: 16px; }
.vn-slot { background: var(--panel-2); border: 3px dashed var(--line); border-radius: 20px; padding: 10px; text-align: center; }
.vn-slot small { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.06em; }
.vn-fill { font-family: var(--font-display); font-size: clamp(1.3rem, 3.5vw, 1.8rem); font-weight: 600; }
.vn-slot.verb { border-style: solid; border-color: var(--violet); background: color-mix(in srgb, var(--violet) 12%, var(--panel)); }
.vn-slot.filled { border-style: solid; border-color: var(--good); background: var(--good-bg); }
.vn.built .vn-builder { animation: bounce 0.7s; }

/* ---------- Hundred Club ---------- */
.hc-top { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; margin-bottom: 6px; }
.jar {
  position: relative; width: 120px; height: 150px; border-radius: 22px 22px 34px 34px; border: 5px solid color-mix(in srgb, var(--sky) 60%, #fff);
  background: rgba(255, 255, 255, 0.55); overflow: hidden; box-shadow: inset 0 0 20px rgba(51, 154, 240, 0.25), var(--shadow-sm);
}
[data-theme="night"] .jar { background: rgba(255, 255, 255, 0.06); }
.jar-fill { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, #12b886, #63e6be 60%, #a5d8ff); transition: height 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.jar-fill::before { content: "💎 💎 💎 💎 💎 💎 💎 💎 💎 💎 💎 💎"; position: absolute; inset: 4px; font-size: 16px; line-height: 20px; word-break: break-all; opacity: 0.55; overflow: hidden; }
.jar-count { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; z-index: 2; text-shadow: 0 1px 0 #fff, 0 0 8px #fff; color: #0b3d3a; }
.jar-count b { font-family: var(--font-display); font-size: 2.2rem; line-height: 1; }
.jar-lid { position: absolute; top: -2px; left: 12px; right: 12px; height: 8px; border-radius: 0 0 8px 8px; background: color-mix(in srgb, var(--sky) 60%, #fff); }
.gem-drop { position: absolute; left: 50%; top: -30px; font-size: 34px; z-index: 3; animation: gemDrop 0.7s cubic-bezier(0.4, 0, 1, 1) forwards; font-family: var(--emoji); }
@keyframes gemDrop { to { transform: translate(-50%, 120px) rotate(200deg); opacity: 0; } from { transform: translate(-50%, 0); } }
.ladder { display: flex; flex-wrap: wrap; gap: 6px; }
.rung { font-size: 0.8rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: var(--panel-2); border: 2px solid var(--line); color: var(--muted); }
.rung.past { border-color: var(--mint); color: var(--mint); }
.rung.on { background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; border-color: transparent; }
.hc-tip { display: flex; align-items: center; gap: 12px; margin: 12px 0 8px; background: var(--near-bg); padding: 10px 14px; border-radius: 16px; }
.hc-snd { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; color: var(--c2); flex: none; }
.stickers { display: flex; flex-wrap: wrap; gap: 4px; font-size: 30px; min-height: 36px; align-items: center; font-family: var(--emoji); }
.stickers span { animation: pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.5) both; }
.stickers .muted { font-family: var(--font-body); }

/* ---------- Smooth Sailing ---------- */
.sail { text-align: center; }
.sail-card { background: var(--panel-2); border-radius: 22px; padding: 14px 18px; border: 1px solid var(--line); }
.sail-card small { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.06em; }
.sail-text { font-family: var(--font-display); font-size: clamp(2rem, 6vw, 3rem); font-weight: 600; }
.sail-hint { margin: 4px 0 0; color: var(--muted); }
.sea {
  position: relative; height: 220px; margin: 14px 0 8px; border-radius: 24px; overflow: hidden;
  background: linear-gradient(#bfe9ff, #e8f7ff 55%, #74c0fc 56%, #339af0);
}
[data-theme="night"] .sea { background: linear-gradient(#1b1f4b, #2b2f6b 55%, #1c4f82 56%, #0f2f57); }
.sea-sun { position: absolute; top: 16px; right: 26px; font-size: 44px; animation: bob 5s infinite; font-family: var(--emoji); }
.boat { position: absolute; left: 50%; bottom: 58px; margin-left: -40px; font-size: 80px; transition: transform 0.12s linear; z-index: 3; font-family: var(--emoji); animation: rock 3s ease-in-out infinite; }
@keyframes rock { 0%, 100% { rotate: -4deg; } 50% { rotate: 4deg; } }
.wave { position: absolute; left: -10%; right: -10%; height: 90px; bottom: -30px; border-radius: 45%; background: rgba(51, 154, 240, 0.55); animation: wave 6s ease-in-out infinite; z-index: 2; }
.wave.w2 { bottom: -44px; background: rgba(34, 139, 230, 0.6); animation-duration: 8s; animation-direction: reverse; z-index: 4; }
.wave.w3 { bottom: -58px; background: rgba(28, 126, 214, 0.7); animation-duration: 10s; z-index: 5; }
@keyframes wave { 50% { transform: translateX(4%) translateY(6px); } }
.sea.breathe .sea-sun { animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.6); } }
.sea.loud { background: linear-gradient(#ffe8cc, #fff4e6 70%, #b2f2bb 71%, #69db7c); }
[data-theme="night"] .sea.loud { background: linear-gradient(#2d1d3a, #3b2a55 70%, #2b8a3e 71%, #1b5e20); }
.balloon { position: absolute; left: 50%; bottom: 8%; font-size: 64px; margin-left: -32px; transition: bottom 0.12s linear; z-index: 3; font-family: var(--emoji); }
.balloon.over { filter: drop-shadow(0 0 16px gold); }
.loud-line { position: absolute; left: 0; right: 0; bottom: 62%; border-top: 4px dashed var(--coral); z-index: 2; text-align: left; }
.loud-line span { position: relative; top: -1.7em; left: 12px; font-weight: 700; color: var(--coral); background: rgba(255, 255, 255, 0.8); padding: 2px 10px; border-radius: 999px; font-size: 0.85rem; }
.sea.loud .wave { display: none; }
.env-graph { width: 100%; height: 90px; background: var(--panel-2); border-radius: 14px; border: 1px solid var(--line); }
.sail-msg { font-size: 1.2rem; min-height: 1.6em; margin: 10px 0 0; }
.glide { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin: 10px 0; }
.gw { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.gdots { display: flex; gap: 6px; }
.gd { width: 24px; height: 24px; border-radius: 50%; background: var(--line); transition: background 0.25s, transform 0.25s; }
.gd.on { background: linear-gradient(135deg, var(--teal), var(--sky)); transform: scale(1.2); box-shadow: 0 0 12px rgba(21, 170, 191, 0.6); }
.gword { font-family: var(--font-display); font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 500; }
.feel { margin-top: 14px; padding-top: 12px; border-top: 2px dashed var(--line); }
.feel p { font-weight: 700; margin: 0 0 4px; }

/* ---------- summary / overlay ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(30, 20, 60, 0.5); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.25s; }
.overlay.show { opacity: 1; }
.modal {
  width: min(560px, 94vw); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; background: var(--panel); border-radius: 28px; padding: 26px; text-align: center;
  box-shadow: 0 30px 70px rgba(20, 10, 50, 0.35); transform: translateY(20px) scale(0.95); transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.overlay.show .modal { transform: none; }
.help-list { text-align: left; font-size: 1.1rem; }
.sum-stars { display: flex; justify-content: center; gap: 10px; font-size: 64px; line-height: 1; margin-bottom: 8px; }
.sum-stars span { color: var(--line); animation: starIn 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.6) both; animation-delay: calc(0.2s + var(--i) * 0.25s); }
.sum-stars span.on { color: #fcc419; text-shadow: 0 4px 0 #f08c00; }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.sum-line { font-size: 1.15rem; }
.sum-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.sg { border-radius: 16px; padding: 10px; background: var(--panel-2); border: 2px solid var(--line); }
.sg b { display: block; font-family: var(--font-display); font-size: 2rem; }
.sg.good { border-color: var(--good); }
.sg.cued { border-color: var(--cued); }
.sg small { color: var(--muted); }
.sum-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 28px; margin: 6px 0 16px; font-family: var(--emoji); }
.si { padding: 2px 4px; border-radius: 10px; border-bottom: 4px solid var(--tile-g); }
.si.cued { border-color: var(--tile-y); }
.si.skip { border-color: var(--tile-x); opacity: 0.6; }
.sum-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }

/* ---------- toasts, fx, Polly ---------- */
.toast-area { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { background: var(--panel); color: var(--ink); border: 2px solid var(--line); border-radius: 999px; padding: 12px 22px; font-weight: 700; box-shadow: var(--shadow); opacity: 0; transform: translateY(-12px) scale(0.96); transition: opacity 0.3s, transform 0.3s; }
.toast.show { opacity: 1; transform: none; }
.toast.good { border-color: var(--good); }
.toast.bad { border-color: #e03131; }
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 95; overflow: hidden; }
.confetti { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; }
.confetti.round { border-radius: 50%; width: 11px; height: 11px; }
.spark { position: fixed; width: 12px; height: 12px; border-radius: 50%; font-size: 24px; line-height: 1; display: grid; place-items: center; font-family: var(--emoji); }
.polly { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: flex; align-items: flex-end; gap: 8px; transform: translateY(160%); transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3); cursor: pointer; max-width: min(360px, 88vw); }
.polly.show { transform: none; }
.polly-bird { font-size: 64px; line-height: 1; animation: wiggle 1.6s ease-in-out infinite; order: 2; font-family: var(--emoji); }
.polly-say { background: var(--panel); border: 3px solid var(--mint); border-radius: 22px 22px 4px 22px; padding: 12px 16px; font-weight: 700; box-shadow: var(--shadow); }

/* ---------- progress ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 12px; }
.kpi { background: var(--panel-2); border-radius: 18px; padding: 14px; border: 1px solid var(--line); }
.kpi b { display: block; font-family: var(--font-display); font-size: 2rem; }
.kpi small { color: var(--muted); }
.kpi.good b { color: var(--good); }
.kpi.cued b { color: var(--cued); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 0.85rem; color: var(--muted); margin-bottom: 10px; }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.lg.good { background: var(--tile-g); }
.lg.cued { background: var(--tile-y); }
.lg.goal { border-top: 3px dashed var(--coral); height: 0; border-radius: 0; }
.bars { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 220px; padding-top: 10px; }
.goal-line { position: absolute; left: 0; right: 0; border-top: 3px dashed var(--coral); margin-bottom: 22px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-stack { flex: 1; width: 100%; max-width: 44px; display: flex; flex-direction: column-reverse; }
.bar { width: 100%; border-radius: 6px 6px 0 0; }
.bar.good { background: linear-gradient(0deg, #2f9e44, #69db7c); }
.bar.cued { background: linear-gradient(0deg, #f08c00, #ffd43b); border-radius: 6px 6px 0 0; }
.bar.good + .bar.cued, .bar-stack .bar.cued { border-radius: 6px 6px 0 0; }
.bar-col small { color: var(--muted); height: 22px; line-height: 22px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { font-size: 0.85rem; color: var(--muted); }
table.data.small td { font-size: 0.9rem; }
.res { font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--panel-2); }
.res.correct { color: var(--good); }
.res.cued { color: #b35c00; }
[data-theme="night"] .res.cued { color: #ffc078; }
.empty { font-size: 1.1rem; }
.plan-games { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip-check { display: inline-flex; align-items: center; gap: 8px; min-height: 50px; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--line); cursor: pointer; background: var(--panel-2); }
.chip-check input { width: 22px; height: 22px; accent-color: var(--violet); }
.plan-opts { display: flex; flex-wrap: wrap; gap: 12px; }
.plan-opts label { display: flex; flex-direction: column; font-weight: 700; font-size: 0.85rem; gap: 4px; }
.plan-opts label.grow { flex: 1; min-width: 220px; }
select, input[type="text"], input:not([type]), .pl-link {
  min-height: 50px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel-2); padding: 8px 12px; font-size: 1rem;
}
.pl-link { width: 100%; font-size: 0.9rem; }
.pl-link:placeholder-shown, .pl-link[value=""] { display: none; }

/* ---------- settings ---------- */
.set-group { padding: 16px 0; border-bottom: 1px solid var(--line); }
.set-group:last-of-type { border-bottom: 0; }
.set-group h2 { font-size: 1.35rem; }
.set-group h3 { font-size: 1.05rem; margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; margin: 10px 0; max-width: 520px; }
.field input[type="range"] { accent-color: var(--coral); min-height: 44px; }
.rate-val { color: var(--coral); }
.theme-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.theme-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 16px; border-radius: 18px; border: 3px solid var(--line); cursor: pointer; text-align: left; min-height: 100px; }
.theme-opt.on { border-color: var(--coral); box-shadow: 0 0 0 4px color-mix(in srgb, var(--coral) 25%, transparent); }
.to-sw { font-size: 30px; font-family: var(--emoji); }
.theme-opt small { opacity: 0.8; }
.t-sunny { background: linear-gradient(135deg, #fff8ef, #ffe3ec); color: #2a2140; }
.t-parlor { background: linear-gradient(135deg, #f4efe6, #dfe9e3); color: #26302b; }
.t-night { background: linear-gradient(135deg, #221d3d, #10263f); color: #f4f0ff; }
.toggles { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.tgl { display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 18px 8px 10px; border-radius: 999px; border: 2px solid var(--line); background: var(--panel-2); cursor: pointer; font-weight: 700; }
.tgl-knob { width: 50px; height: 30px; border-radius: 999px; background: var(--line); position: relative; transition: background 0.2s; flex: none; }
.tgl-knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: left 0.2s; }
.tgl.on .tgl-knob { background: var(--mint); }
.tgl.on .tgl-knob::after { left: 23px; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.rc { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 14px; border-radius: 18px; border: 3px solid var(--line); background: var(--panel-2); cursor: pointer; min-height: 96px; }
.rc > span { font-size: 28px; font-family: var(--emoji); }
.rc small { color: var(--muted); }
.rc.on { border-color: var(--violet); background: color-mix(in srgb, var(--violet) 10%, var(--panel)); }
.mini-meter { width: 180px; height: 16px; border-radius: 999px; background: var(--line); overflow: hidden; }
.mini-meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), var(--sun), var(--coral)); transition: width 0.08s; }

/* ---------- guide ---------- */
.prose { font-size: 1.05rem; }
.prose h2 { margin-top: 28px; }
.lead { font-size: 1.2rem; }
.callout { background: var(--near-bg); border-left: 6px solid var(--sun); padding: 14px 18px; border-radius: 14px; margin: 14px 0; }
.rules li { margin: 8px 0; }
.guide-games { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.gg { background: var(--panel-2); border-radius: 20px; padding: 16px; border: 1px solid var(--line); border-top: 8px solid var(--c1); }
.gg header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.gg header > span { font-size: 42px; font-family: var(--emoji); }
.gg h3 { margin: 0; }
.gg header small { color: var(--muted); }
.gg p { font-size: 0.95rem; }
code { background: var(--panel-2); padding: 2px 6px; border-radius: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .intro-grid { grid-template-columns: 1fr; }
  .det-case { grid-template-columns: 1fr; justify-items: center; }
  .det-board { width: 100%; }
  .hc-top { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .ladder, .stickers { justify-content: center; }
  .vn-builder { grid-template-columns: 1fr; }
  .navlinks a { padding: 8px 12px; }
  .pb-dots { order: 5; max-width: none; flex-basis: 100%; justify-content: center; }
  .wl-clue { flex-wrap: wrap; }
  .kb-key { height: 56px; font-size: 1.05rem; }
  .kb-row { gap: 4px; }
  .choices { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .sum-grid { grid-template-columns: repeat(3, 1fr); }
  .sing-staff { gap: 6px; }
  .note { padding: 8px 10px; }
}
/* phones: one-row play bar, keyboard always within reach */
@media (max-width: 600px) {
  .playbar { flex-wrap: wrap; gap: 6px; padding: 8px 0 6px; }
  .playbar .btn-round { width: 46px; height: 46px; font-size: 20px; }
  .pb-title { flex: 1; min-width: 0; font-size: 1rem; gap: 6px; }
  .pb-title > span[aria-hidden] { display: none; }
  .pb-title b { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .pb-level { display: none; }
  .pb-gems { padding: 6px 10px; font-size: 0.9rem; }
  .pb-dots { order: 10; flex-basis: 100%; max-width: none; justify-content: center; gap: 4px; }
  .dot { width: 11px; height: 11px; }
  .stage { min-height: 0; }
  .wl-clue { flex-wrap: nowrap; padding: 8px 10px; gap: 10px; border-radius: 18px; }
  .wl-pic { width: 64px; height: 64px; font-size: 42px; border-radius: 16px; }
  .wl-cat { font-size: 1.05rem; }
  .wl-hint { font-size: 0.95rem; }
  .wl-clue .btn-round { width: 46px; height: 46px; font-size: 20px; }
  .wl-board { gap: 6px; margin: 10px 0 4px; }
  .wl-row { grid-template-columns: repeat(var(--n), min(12.5vw, 52px)); gap: 6px; }
  .wl-tile { font-size: 1.5rem; border-radius: 11px; border-width: 2px; }
  .wl-msg { font-size: 1rem; margin: 2px 0; }
  .wl-tools { margin: 2px 0 6px; }
  .btn-hint { min-height: 48px; padding: 6px 18px; }
  .wl-kb {
    position: sticky; bottom: 0; z-index: 6; margin: 0 -10px -14px; padding: 8px 4px calc(10px + env(safe-area-inset-bottom));
    background: var(--panel); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 20px rgba(40, 30, 80, 0.08);
  }
  .kb-key { height: 52px; font-size: 1.1rem; }
  .kb-key.enter { font-size: 0.8rem; white-space: nowrap; letter-spacing: 0; }
  .sayit { padding: 14px 10px; }
  .sayit-card { padding: 10px 20px; min-width: 0; max-width: 100%; }
  .sayit-emoji { font-size: 56px; }
  .btn-score { min-height: 60px; padding: 8px 16px; }
  .sayit-actions .btn-big { min-height: 56px; padding: 8px 18px; font-size: 1rem; }
  .intro-head { padding: 18px 16px; gap: 12px; }
  .intro-head .btn-round { width: 46px; height: 46px; }
}

@media (max-width: 460px) {
  .page { padding-left: 10px; padding-right: 10px; }
  .stage { padding: 14px 10px; border-radius: 22px; }
  .kb-row { gap: 3px; }
  .pb-title b { font-size: 0.95rem; }
  .pb-gems { padding: 5px 8px; }
  .pq-head { gap: 8px; margin: 4px 0 10px; }
  .pq-head .pq-icon { display: none; }
  .pq-head b { font-size: 1.1rem; }
  .pq-head .btn-round { width: 46px; height: 46px; font-size: 20px; }
  .det-case { grid-template-columns: 104px 1fr; gap: 10px; align-items: stretch; justify-items: stretch; }
  .det-pic { width: 104px; align-self: center; border-radius: 20px; }
  .det-pic > span { font-size: 68px; }
  .det-glass { font-size: 30px; }
  .det-board { width: auto; padding: 8px 10px; background-image: none; }
  .det-title { font-size: 0.8rem; }
  .det-clues li { min-height: 26px; gap: 6px; font-size: 0.82rem; }
  .dc-n { width: 20px; height: 20px; font-size: 0.7rem; }
  .drum.big, .drum { width: 130px; height: 130px; font-size: 72px; }
  .choice { min-height: 96px; }
  .ch-emoji { font-size: 44px; }
  .hc-top { grid-template-columns: 84px 1fr; gap: 10px; justify-items: stretch; text-align: left; align-items: center; }
  .jar { width: 84px; height: 108px; border-width: 4px; border-radius: 16px 16px 26px 26px; }
  .jar-count b { font-size: 1.6rem; }
  .ladder { justify-content: flex-start; gap: 4px; }
  .rung { font-size: 0.68rem; padding: 3px 7px; }
  .hc-tip { margin: 8px 0 4px; padding: 6px 10px; gap: 8px; font-size: 0.85rem; }
  .hc-snd { font-size: 1.3rem; }
  .stickers { justify-content: flex-start; font-size: 22px; min-height: 0; }
  .stickers .muted { display: none; }
  .vn-builder { grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-bottom: 10px; }
  .vn-slot { padding: 6px 4px; border-radius: 14px; }
  .vn-fill { font-size: 0.95rem; overflow-wrap: anywhere; }
  .fl-card { padding: 14px; gap: 8px; }
  .fl-stem { font-size: 1.5rem; }
  .sail-text { font-size: 1.8rem; }
  .sea { height: 170px; }
  .boat { font-size: 64px; bottom: 44px; margin-left: -32px; }
  .intro-setup .chips:not(.sound-chips) { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .intro-setup .chips:not(.sound-chips) .chip { flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 12px; border-radius: 16px; line-height: 1.25; }
  .intro-setup .chip small { font-size: 0.72rem; }
  .chip-group { min-width: 0; flex-basis: 100%; }
  .chip.snd { min-width: 52px; min-height: 48px; padding: 6px 10px; }
  .setup-row { gap: 4px 12px; }
  .avatar-pick { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
  .intro-card { display: flex; flex-direction: column; padding-bottom: 16px; }
  .intro-grid { order: 10; padding-top: 18px; }
  .intro-go { order: 5; margin-top: 16px; }
  .intro-go .btn-xl { width: 100%; }
  .intro-emoji { font-size: 50px; }
  .intro-head h1 { font-size: 1.7rem; }
  .intro-tag { font-size: 0.95rem; }
  .lvl-title { margin-top: 16px; }
  .levels { gap: 8px; }
  .level { min-height: 64px; padding: 10px 12px; }
  .sayit-score { gap: 6px; flex-wrap: nowrap; }
  .sayit-score .btn-score { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 0; padding: 6px 4px; font-size: 0.88rem; min-height: 66px; }
  .sayit-actions { gap: 8px; }
  .stats { gap: 8px; flex-wrap: nowrap; }
  .stat { flex-direction: column; text-align: center; gap: 2px; padding: 10px 8px; border-radius: 18px; flex: 1; min-width: 0; }
  .stat b { font-size: 1.2rem; }
  .stat-ico { font-size: 24px; }
  .ring { width: 38px; height: 38px; }
  .navlinks { width: 100%; justify-content: space-between; }
  .navlinks a { flex: 1; justify-content: center; font-size: 0.85rem; padding: 6px 4px; flex-direction: column; gap: 0; }
  .brand-name { font-size: 1.25rem; }
  .game-grid { grid-template-columns: 1fr; }
  .garden .petal { font-size: 0.72rem; }
  .pt-icon { font-size: 20px; }
  .btn-big { padding: 10px 18px; }
  .pcard { min-height: 150px; }
}

@media (max-width: 360px) {
  .petal { font-size: 0.66rem; padding: 4px; }
  .petal .pt-icon { font-size: 16px; }
  .flower-core { width: 104px; }
  .core-emoji { font-size: 44px; }
  .core-word { font-size: 1rem; }
  .pb-gems { display: none; }
}

/* ---------- motion & print ---------- */
html.calm-motion *, html.calm-motion *::before, html.calm-motion *::after {
  animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.05ms !important; scroll-behavior: auto !important;
}
@media print {
  body { background: #fff; }
  .topnav, .tool-row, .plan, .polly, .toast-area { display: none !important; }
  .panel { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
