/* Maestro · "Playful" design system (see docs/brand/playful/spec.md).
   Warm cream paper, one confident violet, chunky 3D buttons and Pip the penguin. */

/* ---------- fonts (self-hosted, SIL OFL 1.1: assets/fonts/OFL-*.txt) ---------- */
@font-face { font-family: 'Fredoka'; font-style: normal; font-display: swap; font-weight: 300 700;
  src: url(../assets/fonts/fredoka-latin-wght-normal.woff2) format('woff2-variations'), url(../assets/fonts/fredoka-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fredoka'; font-style: normal; font-display: swap; font-weight: 300 700;
  src: url(../assets/fonts/fredoka-latin-ext-wght-normal.woff2) format('woff2-variations'), url(../assets/fonts/fredoka-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url(../assets/fonts/nunito-latin-wght-normal.woff2) format('woff2-variations'), url(../assets/fonts/nunito-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url(../assets/fonts/nunito-latin-ext-wght-normal.woff2) format('woff2-variations'), url(../assets/fonts/nunito-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- tokens ---------- */
:root {
  --bg: #FFF7EA; --bg-sunk: #FBEEDA; --surface: #FFFFFF; --paper: #FFFCF4;
  --line: #F0E3CD; --edge: #E6D6BC; --ink: #2A2346; --ink-2: #5E5775; --ink-3: #736A8A;
  --disabled: #E9E0D0; --disabled-edge: #D7CAB3;
  --brand: #6F4BF2; --brand-edge: #4F30C9; --brand-hi: #9B82FF; --brand-soft: #EEE8FF; --brand-ink: #4A2FC2; --on-brand: #F3EFFF;
  --sun: #FFC23D; --sun-edge: #E09A0B; --sun-soft: #FFF1C9; --sun-ink: #8A5A00;
  --flame: #FF7A2F; --flame-edge: #D95A12; --flame-soft: #FFE6D6; --flame-ink: #A8430B;
  --mint: #20C07A; --mint-edge: #12985C; --mint-soft: #DDF7EA; --mint-ink: #0E7A48;
  --coral: #FF5A6A; --coral-edge: #D93A4C; --coral-soft: #FFE3E6; --coral-ink: #B4232F;
  --early: #2F9BFF; --early-edge: #1673D1; --early-soft: #DDEEFF; --early-ink: #1463B8;
  --late: #FF9A2E; --late-edge: #D9760C; --late-soft: #FFE9CF; --late-ink: #A65400;
  --rh: #6F4BF2; --lh: #14B8A6;
  --stage-1: #20C07A; --stage-1-edge: #12985C; --stage-2: #6F4BF2; --stage-2-edge: #4F30C9; --stage-3: #2F9BFF; --stage-3-edge: #1673D1;
  --stage-4: #FF7A2F; --stage-4-edge: #D95A12; --stage-5: #E0436F; --stage-5-edge: #B32651;
  /* softened stage tints (locked / not-yet-placed path, intro glow) and their ink */
  --stage-1-soft: #D5F5E5; --stage-1-soft-edge: #AEE6C9; --stage-1-ink: #0E7A48;
  --stage-2-soft: #E6DEFF; --stage-2-soft-edge: #CBBDFB; --stage-2-ink: #4A2FC2;
  --stage-3-soft: #D8ECFF; --stage-3-soft-edge: #AFD4FA; --stage-3-ink: #1463B8;
  --stage-4-soft: #FFE3D2; --stage-4-soft-edge: #F7C3A2; --stage-4-ink: #A8430B;
  --stage-5-soft: #FBD9E3; --stage-5-soft-edge: #F0B0C4; --stage-5-ink: #A3204A;
  --font-display: 'Fredoka', 'Nunito', ui-rounded, system-ui, sans-serif;
  --font-ui: 'Nunito', ui-rounded, system-ui, sans-serif;
  --r-sm: 12px; --r-md: 16px; --r-lg: 22px; --r-xl: 28px;
  --shadow-card: 0 1px 0 rgba(42,35,70,.04), 0 10px 24px -14px rgba(42,35,70,.28);
  --shadow-pop: 0 18px 40px -16px rgba(42,35,70,.38);
  --ease-out: cubic-bezier(.22, 1, .36, 1); --ease-in: cubic-bezier(.55, 0, 1, .45); --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --t-press: 90ms; --t-fast: 160ms; --t-base: 240ms; --t-slow: 420ms;
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --rail-w: 212px;
  /* legacy names still read by a few scripts */
  --muted: var(--ink-3); --accent: var(--brand);
}

/* ---------- base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--font-ui); font-weight: 600; font-size: 18px; line-height: 1.45;
  overflow: hidden; overscroll-behavior: none; -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; background: none; border: 0; padding: 0; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 36px; line-height: 1.1; }
h2 { font-size: 28px; line-height: 1.15; }
h3 { font-size: 21px; line-height: 1.2; }
p { margin: 0; }
small { color: var(--ink-3); }
.hidden { display: none !important; }
.muted { color: var(--ink-2); font-weight: 600; }
.fine { color: var(--ink-3); font-size: 15px; line-height: 1.45; font-weight: 700; }
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.col { display: flex; flex-direction: column; gap: 12px; }
.ic { display: inline-block; vertical-align: middle; flex: none; }
.num, .stat b, .pill { font-variant-numeric: normal; }
:focus-visible { outline: 4px solid var(--brand-hi); outline-offset: 3px; border-radius: 14px; }

/* ---------- buttons: chunky 3D ---------- */
.btn {
  --b-bg: var(--surface); --b-edge: var(--edge); --b-ink: var(--brand-ink); --b-line: var(--line); --depth: 5px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 24px; border-radius: var(--r-md);
  background: var(--b-bg); color: var(--b-ink); border: 2px solid var(--b-line);
  box-shadow: 0 var(--depth) 0 var(--b-edge);
  font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: .01em; white-space: nowrap;
  transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out), background var(--t-fast);
}
.btn:active:not([disabled]) { transform: translateY(var(--depth)); box-shadow: 0 0 0 var(--b-edge); }
.btn-primary { --b-bg: var(--brand); --b-edge: var(--brand-edge); --b-ink: #fff; --b-line: var(--brand); }
.btn-white { --b-bg: #fff; --b-edge: #D8CCFF; --b-ink: var(--brand-ink); --b-line: #fff; }
.btn-onbrand { --b-bg: rgba(255,255,255,.14); --b-edge: rgba(33,14,110,.35); --b-ink: #fff; --b-line: rgba(255,255,255,.4); }
.btn-sun { --b-bg: var(--sun); --b-edge: var(--sun-edge); --b-ink: var(--ink); --b-line: var(--sun); }
.btn-ghost { --b-bg: transparent; --b-edge: transparent; --b-line: transparent; --b-ink: var(--brand-ink); box-shadow: none; }
.btn-ghost.on-brand { --b-ink: #fff; }
.btn-danger { --b-bg: var(--coral-edge); --b-edge: #A92637; --b-ink: #fff; --b-line: var(--coral-edge); }
.btn-lg { min-height: 66px; padding: 0 32px; border-radius: var(--r-lg); font-size: 24px; --depth: 7px; }
.btn-sm { min-height: 44px; padding: 0 14px; border-radius: var(--r-sm); font-size: 17px; --depth: 4px; }
.btn-block { width: 100%; }
.btn[disabled] { --b-bg: var(--disabled); --b-edge: var(--disabled-edge); --b-ink: #A79D8A; --b-line: var(--disabled); cursor: default; }
.icon-btn {
  width: 52px; height: 52px; flex: none; border-radius: var(--r-md); display: inline-grid; place-items: center;
  background: var(--surface); color: var(--ink-2); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--edge);
  transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out);
}
.icon-btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--edge); }
.link { color: var(--brand-ink); font-family: var(--font-display); font-weight: 600; font-size: 18px; padding: 8px 4px; }

/* ---------- cards, chips, pills ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); border: 2px solid var(--line); box-shadow: 0 5px 0 var(--edge); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px;
  background: var(--surface); color: var(--ink-2); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--edge);
  font-weight: 800; font-size: 16px; white-space: nowrap;
  transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out), background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.chip:active { transform: translateY(3px) scale(.97); box-shadow: 0 1px 0 var(--edge); }
.chip.on:active { box-shadow: 0 1px 0 var(--brand-hi); }
.chip.just-on { animation: sel-pop var(--t-base) var(--ease-spring); }
@keyframes sel-pop { 0% { transform: scale(.94); } 55% { transform: scale(1.06); } 100% { transform: none; } }
.chip.on { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand); box-shadow: 0 4px 0 var(--brand-hi); }
.chip .count { font-weight: 800; color: var(--ink-3); font-size: 14px; }
.chip.on .count { color: var(--brand); }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 10px; border-radius: 999px;
  background: var(--surface); border: 2px solid var(--line); font-family: var(--font-ui); font-weight: 900; font-size: 19px; white-space: nowrap;
}
.pill.flame { color: var(--flame-ink); }
.pill.sun { color: var(--sun-ink); }
.mic-pill { font-weight: 800; font-size: 16px; color: var(--ink-3); }
.mic-pill .dot { width: 12px; height: 12px; border-radius: 50%; background: #CFC4B1; margin: 0 2px 0 6px; }
.mic-pill.on { color: var(--mint-ink); }
.mic-pill.on .dot { background: var(--mint); box-shadow: 0 0 0 4px var(--mint-soft); }
.bar { height: 16px; border-radius: 999px; background: #EFE4D2; overflow: hidden; position: relative; display: block; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--brand); position: relative; transition: width .8s var(--ease-out); }
.bar > i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 3px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.35); }
.bar.mint > i { background: var(--mint); } .bar.sun > i { background: var(--sun); }

/* ---------- speech bubble ---------- */
.bubble {
  position: relative; background: var(--surface); color: var(--ink); border: 2.5px solid var(--line); border-radius: 22px;
  padding: 14px 18px; box-shadow: 0 5px 0 var(--edge); font-weight: 700; font-size: 20px; line-height: 1.35;
}
.bubble:empty { display: none; }
.bubble b, .bubble strong { color: var(--brand-ink); font-weight: 800; }
.bubble.big { font-family: var(--font-display); font-weight: 600; font-size: 32px; line-height: 1.15; padding: 20px 24px; }
.bubble::after {
  content: ""; position: absolute; width: 20px; height: 20px; background: var(--surface);
  border: 2.5px solid var(--line); border-top: 0; border-right: 0; border-radius: 0 0 0 5px;
}
.bubble.tail-left::after { left: -12px; top: 50%; margin-top: -10px; transform: rotate(45deg); }
.bubble.tail-bottom::after { bottom: -12px; left: 50%; margin-left: -10px; transform: rotate(-45deg); }
.bubble.tail-bottom-left::after { bottom: -12px; left: 48px; transform: rotate(-45deg); }
.bubble.speaking::before { content: ""; display: inline-block; width: 22px; height: 18px; margin-right: 6px; vertical-align: -2px;
  background: var(--brand); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 3 20 18'%3E%3Cpath d='M11.3 4.3c.9-.7 2.2-.1 2.2 1.1v13.2c0 1.2-1.3 1.8-2.2 1.1L7 16H4.6C3.7 16 3 15.3 3 14.4V9.6C3 8.7 3.7 8 4.6 8H7l4.3-3.7Z M16.3 8.2a1.3 1.3 0 0 1 1.8.2 5.8 5.8 0 0 1 0 7.2 1.3 1.3 0 1 1-2-1.6 3.2 3.2 0 0 0 0-4 1.3 1.3 0 0 1 .2-1.8Z M18.6 5.2a1.3 1.3 0 0 1 1.8 0 9.8 9.8 0 0 1 0 13.6 1.3 1.3 0 0 1-1.9-1.8 7.2 7.2 0 0 0 0-10 1.3 1.3 0 0 1 .1-1.8Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 3 20 18'%3E%3Cpath d='M11.3 4.3c.9-.7 2.2-.1 2.2 1.1v13.2c0 1.2-1.3 1.8-2.2 1.1L7 16H4.6C3.7 16 3 15.3 3 14.4V9.6C3 8.7 3.7 8 4.6 8H7l4.3-3.7Z M16.3 8.2a1.3 1.3 0 0 1 1.8.2 5.8 5.8 0 0 1 0 7.2 1.3 1.3 0 1 1-2-1.6 3.2 3.2 0 0 0 0-4 1.3 1.3 0 0 1 .2-1.8Z M18.6 5.2a1.3 1.3 0 0 1 1.8 0 9.8 9.8 0 0 1 0 13.6 1.3 1.3 0 0 1-1.9-1.8 7.2 7.2 0 0 0 0-10 1.3 1.3 0 0 1 .1-1.8Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.bubble.pop { animation: bubble-in var(--t-base) var(--ease-spring) both; }
@keyframes bubble-in { from { opacity: 0; transform: scale(.88); } }

/* ---------- Pip ---------- */
.pip { display: block; overflow: visible; }
.pip-slot { display: flex; justify-content: center; }
/* Idle life: a slow 2 px breath on the <svg> (compositor only) and a blink every ~3-6 s: each
   Pip has its own cycle and phase (--blink, --blink-at from brand.js), two blinks per cycle at
   uneven spacing. Pips on hidden screens are display:none, so they cost nothing. */
.pip-slot > .pip:not(.pip-face), .pip.breathe { animation: pip-breathe 3.2s ease-in-out var(--breathe-at, 0s) infinite; }
.pip .pip-eyes { transform-box: fill-box; transform-origin: center; animation: pip-blink var(--blink, 9s) linear var(--blink-at, 0s) infinite; }
.pip-cheer .pip-eyes, .pip-sleep .pip-eyes, .pip.no-blink .pip-eyes { animation: none; }
.pip-flip { transform: scaleX(-1); }
.pip .pip-talk { display: none; }
.pip-talking .screen.active .pip:not(.no-talk) .pip-talk, .pip-talking #results:not(.hidden) .pip .pip-talk { display: inline; animation: pip-talk .22s steps(1) infinite; }
.pip-talking .screen.active .pip:not(.no-talk) .pip-beak, .pip-talking #results:not(.hidden) .pip .pip-beak { animation: pip-talk .22s steps(1) infinite reverse; }
.pip.pip-swap { animation: pip-swap var(--t-slow) var(--ease-spring); }
.pip-slot > .pip.pip-swap:not(.pip-face) { animation: pip-swap var(--t-slow) var(--ease-spring), pip-breathe 3.2s ease-in-out var(--t-slow) infinite; }
@keyframes pip-breathe { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -2px, 0); } }
@keyframes pip-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes pip-blink { 0%, 43.8%, 46.2%, 97.4%, 99.8%, 100% { transform: scaleY(1); } 45%, 98.6% { transform: scaleY(.08); } }
@keyframes pip-talk { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes pip-swap { 0% { transform: scale(1.04, .94); } 100% { transform: none; } }
@keyframes pop-in { 0% { opacity: 0; transform: scale(.6) translateY(20px); } 70% { opacity: 1; transform: scale(1.06); } 100% { transform: none; } }

/* ---------- wordmark ---------- */
.wordmark { display: inline-block; white-space: nowrap; font-family: var(--font-display); font-weight: 700; color: var(--brand); letter-spacing: -0.02em; line-height: 1; }

/* ---------- app frame & screens ---------- */
#app { position: fixed; inset: 0; }
.screen { position: absolute; inset: 0; display: none; }
.screen.active, .screen.leaving { display: flex; }
.screen.active { z-index: 2; }
.screen.leaving { z-index: 1; pointer-events: none; }
.screen.focus { flex-direction: column; padding: calc(18px + var(--safe-t)) calc(24px + var(--safe-r)) calc(18px + var(--safe-b)) calc(24px + var(--safe-l)); overflow-y: auto; }
.screen.railed { flex-direction: row; }
.screen.railed > .content { flex: 1; min-width: 0; position: relative; }
.scroller { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(24px + var(--safe-t)) calc(28px + var(--safe-r)) calc(32px + var(--safe-b)) 28px; }
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 40px; line-height: 1; }
.page-head .sub { font-weight: 800; font-size: 15px; color: var(--ink-3); margin-top: 6px; }
.focus-top { display: flex; align-items: center; gap: 18px; min-height: 56px; }
.focus-top h2 { font-size: 26px; }
.focus-top .top-bar { flex: 1; height: 18px; }
.focus-top .step-label { font-weight: 800; font-size: 15px; color: var(--ink-3); white-space: nowrap; }
.focus-foot { display: flex; align-items: center; justify-content: space-between; border-top: 2px solid var(--line); padding-top: 16px; margin: 0 -24px; padding-left: 28px; padding-right: 28px; }
.focus-foot .btn-lg { min-width: 240px; }

/* ---------- navigation rail ---------- */
.rail {
  flex: none; width: var(--rail-w); height: 100%; padding: calc(22px + var(--safe-t)) 14px calc(16px + var(--safe-b)) calc(14px + var(--safe-l));
  border-right: 2px solid var(--line); background: var(--bg); display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
}
.rail .logo { padding: 2px 10px 18px; }
.rail .logo .pip-face { display: none; }
.nav {
  display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 0 12px; border-radius: var(--r-md); width: 100%; text-align: left;
  border: 2px solid transparent; font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--ink-2);
  transition: background var(--t-fast), transform var(--t-press);
}
.nav:active { transform: scale(.97); }
.nav .tile { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; color: #fff; box-shadow: inset 0 -3px 0 rgba(0,0,0,.14); }
.nav.on { background: var(--brand-soft); border-color: #D6CAFF; color: var(--brand-ink); }
.t-home { background: var(--brand); } .t-songs { background: #E0436F; } .t-practice { background: var(--mint); }
.t-free { background: var(--early); } .t-progress { background: var(--sun); color: var(--ink) !important; } .t-settings { background: #A79FB8; }
.rail .spacer { flex: 1; }
.rail .me { display: flex; align-items: center; gap: 10px; padding: 12px 10px 0; margin-top: 8px; border-top: 2px solid var(--line); }
.rail .me .pip-face { border-radius: 14px; flex: none; }
.rail .me b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1.1; }
.rail .me small { display: block; color: var(--ink-3); font-weight: 800; font-size: 13px; }

/* ---------- HOME ---------- */
.content.home { display: flex; gap: 20px; padding: 0 calc(20px + var(--safe-r)) 0 0; }
.path-col { flex: 1; min-width: 380px; position: relative; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
.path { padding: 18px 20px 60px; }
.stage-sec { position: relative; margin-bottom: 26px; }
.banner {
  position: sticky; top: 16px; z-index: 6; height: 92px; border-radius: 22px; color: #fff;
  background: var(--sc); box-shadow: 0 6px 0 var(--sce), 0 -20px 0 0 var(--bg); display: flex; align-items: center; justify-content: space-between; padding: 0 16px 0 24px;
}
.stage-sec::before { content: ""; position: sticky; top: 0; display: block; height: 0; }
.banner .eyebrow { color: rgba(255,255,255,.9); }
.banner h2 { font-size: 30px; line-height: 1.05; margin-top: 2px; }
.banner .guide { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 16px; border-radius: 16px; border: 2.5px solid rgba(255,255,255,.45); box-shadow: 0 4px 0 rgba(0,0,0,.14); font-family: var(--font-display); font-size: 18px; font-weight: 600; color: #fff; }
/* Stages you haven't reached (or before placement) keep their colour, softened. */
.banner.locked { background: var(--scs, #E7DDCC); box-shadow: 0 6px 0 var(--scse, #D6C8B0), 0 -20px 0 0 var(--bg); color: var(--sci, var(--ink-2)); }
.banner.locked .eyebrow { color: var(--sci, var(--ink-3)); opacity: .85; }
.banner.locked .guide { color: var(--sci, var(--ink-2)); border-color: rgba(42,35,70,.14); box-shadow: 0 4px 0 rgba(42,35,70,.08); }
.path-nodes { position: relative; margin: 14px auto 0; width: 460px; max-width: 100%; }
.path-nodes .trail { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.node {
  --n: var(--brand); --n-edge: var(--brand-edge);
  position: absolute; width: 84px; height: 76px; border-radius: 50%; background: var(--n); box-shadow: 0 8px 0 var(--n-edge);
  display: grid; place-items: center; color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 28px; z-index: 2;
  transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out);
  animation: node-in .42s var(--ease-spring) backwards; animation-delay: calc(90ms + var(--i, 0) * 45ms);
}
.node:active { transform: translateY(6px) scale(.97); box-shadow: 0 2px 0 var(--n-edge); }
.node::before { content: ""; position: absolute; left: 16px; right: 16px; top: 8px; height: 14px; border-radius: 50%; background: rgba(255,255,255,.28); }
.node.done { --n: var(--sun); --n-edge: var(--sun-edge); color: var(--ink); }
.node.locked { --n: var(--scs, #EAE1D2); --n-edge: var(--scse, #D3C6AF); color: var(--sci, #9F927B); }
.node.locked::before { background: rgba(255,255,255,.5); }
.node.sel { z-index: 3; }
.node .badge { position: absolute; right: -2px; top: -4px; width: 28px; height: 28px; border-radius: 50%; background: var(--mint); color: #fff; box-shadow: 0 3px 0 var(--mint-edge); display: grid; place-items: center; }
.node.current { width: 104px; height: 92px; font-size: 38px; box-shadow: 0 9px 0 var(--n-edge); }
.node.current::before { left: 20px; right: 20px; top: 10px; height: 16px; }
@keyframes node-in { from { opacity: 0; transform: scale(.6); } }
.node-stars { position: absolute; display: flex; justify-content: center; width: 84px; z-index: 2; pointer-events: none; animation: node-in .42s var(--ease-spring) backwards; animation-delay: calc(220ms + var(--i, 0) * 45ms); }
.node-stars .ic:nth-child(2) { transform: translateY(3px); }
.cur-ring { position: absolute; width: 132px; height: 132px; border-radius: 50%; pointer-events: none; z-index: 1; }
.cur-ring svg { position: absolute; inset: 0; }
.cur-ring { animation: fade-in .4s var(--ease-out) .25s backwards; }
.cur-ring.pulse { border: 6px solid var(--brand); opacity: 0; animation: none; }
/* "You are here": two rings breathe out of the current node, and a tag bobs above it. */
@media (prefers-reduced-motion: no-preference) {
  .cur-ring.pulse { animation: pulse-ring 2.2s var(--ease-out) .6s infinite; }
  .cur-ring.pulse.p2 { animation-delay: 1.7s; }
  .here-tag { animation: node-in .42s var(--ease-spring) .35s backwards, tag-bob 1.8s ease-in-out .8s infinite; }
}
@keyframes pulse-ring { 0% { transform: scale(.92); opacity: .55; } 100% { transform: scale(1.42); opacity: 0; } }
@keyframes tag-bob { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -5px, 0); } }
.here-tag { position: absolute; z-index: 4; width: 120px; margin-left: -60px; display: flex; justify-content: center; pointer-events: none; }
.here-tag span { position: relative; display: block; padding: 5px 14px 6px; border-radius: 14px; background: #fff; color: var(--brand-ink); border: 2.5px solid #D6CAFF; box-shadow: 0 4px 0 #D6CAFF;
  font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.here-tag span::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 14px; height: 14px; margin-left: -7px; background: #fff; border: 2.5px solid #D6CAFF; border-top: 0; border-left: 0; border-radius: 0 0 4px 0; transform: rotate(45deg); }
.path-pip { position: absolute; z-index: 5; width: 230px; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.path-pip .bubble { font-size: 17px; padding: 11px 15px; line-height: 1.3; width: 230px; pointer-events: auto; }
.path-pip .pip-slot { animation: pop-in .5s var(--ease-spring) .3s backwards; }
.path-pip .bubble { animation: bubble-in var(--t-base) var(--ease-spring) .5s backwards; transform-origin: 50% 100%; }
.path-more { display: flex; justify-content: center; margin-top: 4px; }

.side { flex: none; width: 412px; padding-top: calc(20px + var(--safe-t)); padding-bottom: calc(14px + var(--safe-b)); display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.side > * { flex-shrink: 0; }
.pills { display: flex; gap: 10px; flex-wrap: wrap; }
.hero { position: relative; overflow: hidden; border-radius: 26px; padding: 20px 24px 22px; background: var(--brand); box-shadow: 0 7px 0 var(--brand-edge); color: #fff; }
.hero .hero-deco { position: absolute; right: 16px; top: 14px; opacity: .2; color: #fff; }
.hero .eyebrow { color: var(--on-brand); }
.hero h1 { font-size: 34px; line-height: 1.05; margin: 6px 0 6px; padding-right: 60px; }
.hero p { font-size: 17px; font-weight: 700; color: var(--on-brand); line-height: 1.4; }
.hero .prog { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; font-weight: 800; font-size: 15px; }
.hero .prog .bar { flex: 1; height: 14px; background: rgba(255,255,255,.22); }
.hero .prog .bar > i { background: var(--sun); }
.hero-actions { display: flex; gap: 10px; margin-top: 16px; }
.hero-actions .btn-lg { flex: 1; }
.hero-actions #btn-hear { min-height: 66px; --depth: 7px; border-radius: var(--r-lg); padding: 0 16px; font-size: 18px; }
.goal { display: grid; grid-template-columns: 104px 1fr; gap: 18px; align-items: center; padding: 16px 20px; }
.ring { position: relative; width: 104px; height: 104px; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 13; }
.ring .ring-bg { stroke: #F3EADB; }
.ring .ring-fg { stroke: var(--sun); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease-out) .15s; }
.ring .v { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .v b { font-family: var(--font-ui); font-weight: 900; font-size: 27px; line-height: 1; }
.ring .v small { font-weight: 800; font-size: 13px; color: var(--ink-3); }
.goal h3 { font-size: 21px; }
.goal p { font-size: 15px; color: var(--ink-2); font-weight: 700; margin: 2px 0 10px; }
.week { display: flex; gap: 3px; }
.week .d { width: 32px; text-align: center; font-weight: 800; font-size: 12px; color: var(--ink-3); line-height: 1.2; }
.week .d i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--flame-soft); margin-bottom: 3px; }
.week .d.off i { background: #F3EADB; }
.week .d.today i { background: #fff; border: 2.5px dashed var(--flame); }
.week .d.today.lit i { background: var(--flame-soft); border-style: solid; }
.week .d.today { color: var(--flame-ink); }
.journey { padding: 14px 20px 10px; }
.journey h3 { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.journey h3 small { font-family: var(--font-ui); font-weight: 800; font-size: 14px; color: var(--ink-3); }
.jrow { display: grid; grid-template-columns: 30px 1fr 84px 42px; gap: 12px; align-items: center; min-height: 38px; }
.jrow .dot { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; box-shadow: inset 0 -3px 0 rgba(0,0,0,.16); }
.jrow b { font-family: var(--font-display); font-weight: 600; font-size: 18px; white-space: nowrap; }
.jrow b small { font-family: var(--font-ui); font-weight: 700; font-size: 13px; color: var(--ink-3); margin-left: 6px; }
.jrow .bar { height: 12px; }
.jrow .cnt { font-weight: 800; font-size: 14px; color: var(--ink-2); text-align: right; }
.jrow.locked b { color: var(--ink-3); }
.jrow.locked .dot { opacity: .45; }
.jrow.now { background: var(--brand-soft); margin: 0 -10px; padding: 0 10px; border-radius: 12px; }

/* ---------- coach column (setup, placement, intro) ---------- */
.coach-col { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.coach-col .pip-slot { align-self: stretch; }
.coach-col .note { font-weight: 700; font-size: 17px; color: var(--ink-2); max-width: 440px; }

/* setup */
.content.setup { flex: 1; display: grid; grid-template-columns: minmax(300px, 440px) minmax(420px, 560px); gap: 48px; align-items: center; justify-content: center; }
.setup-card { padding: 26px 28px; display: flex; flex-direction: column; gap: 14px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; gap: 14px; align-items: center; padding: 10px 14px; border-radius: 18px; border: 2px solid transparent; transition: background var(--t-base); }
.steps li b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.steps li span:not(.step-coin) { display: block; font-size: 15px; color: var(--ink-2); font-weight: 700; }
.step-coin { width: 46px; height: 42px; flex: none; border-radius: 50%; background: #EAE1D2; box-shadow: 0 5px 0 #D3C6AF; display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 20px; color: #9F927B; }
.step-coin::before { content: attr(data-n); }
.steps li.doing { background: var(--brand-soft); border-color: #D6CAFF; }
.steps li.doing .step-coin { background: var(--brand); box-shadow: 0 5px 0 var(--brand-edge); color: #fff; }
.steps li.done .step-coin { background: var(--mint); box-shadow: 0 5px 0 var(--mint-edge); color: #fff; animation: pop-in .4s var(--ease-spring); }
.steps li.done .step-coin::before { content: "✓"; font-size: 22px; }
.meter { height: 22px; border-radius: 999px; background: #EFE4D2; overflow: hidden; box-shadow: inset 0 3px 0 rgba(42,35,70,.06); }
#setup-meter { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--mint), #7BE3A8); transition: width 80ms linear; }
.msg { font-family: var(--font-display); font-weight: 600; font-size: 21px; color: var(--brand-ink); min-height: 1.3em; }
.room { font-weight: 800; }
.room-quiet { color: var(--mint-ink); } .room-moderate { color: var(--late-ink); } .room-noisy { color: var(--coral-ink); }

/* placement: experience */
.content.placement { flex: 1; display: grid; grid-template-columns: minmax(320px, 470px) minmax(440px, 560px); gap: 48px; align-items: center; justify-content: center; padding: 10px 0; }
.content.placement .coach-col .bubble.big { max-width: 470px; }
.exp-options { display: flex; flex-direction: column; gap: 16px; }
.exp-option {
  display: grid; grid-template-columns: 56px 1fr 32px; align-items: center; gap: 16px; text-align: left;
  min-height: 104px; padding: 12px 22px; border-radius: 24px; background: #fff; border: 2.5px solid var(--line); box-shadow: 0 5px 0 var(--edge);
  transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-press), background var(--t-fast), border-color var(--t-fast);
}
.exp-option:active { transform: translateY(4px) scale(.98); box-shadow: 0 1px 0 var(--edge); }
.exp-option.just-on { animation: sel-pop var(--t-base) var(--ease-spring); }
.exp-option .ico { width: 56px; height: 56px; border-radius: 16px; background: var(--brand-soft); display: grid; place-items: center; }
.exp-option b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.15; }
.exp-option small { display: block; font-weight: 700; font-size: 16px; color: var(--ink-2); margin-top: 2px; }
.exp-option .radio { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--edge); display: grid; place-items: center; color: #fff; }
.exp-option.picked { background: var(--brand-soft); border-color: var(--brand); box-shadow: 0 5px 0 var(--brand-hi); }
.exp-option.picked b { color: var(--brand-ink); }
.exp-option.picked .ico { background: #fff; }
.exp-option.picked .radio { border: 0; background: var(--brand); animation: pop-in .3s var(--ease-spring); }
.exp-option[disabled]:not(.picked) { opacity: .5; }
@keyframes rise-in { from { opacity: 0; transform: translateY(16px); } }

/* placement: reveal */
.reveal-screen { background: var(--brand); color: #fff; align-items: center; justify-content: center; overflow: hidden; }
.reveal-screen .rays { position: absolute; left: 50%; top: 250px; width: 1600px; height: 1600px; margin: -800px 0 0 -800px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.07) 0deg 9deg, rgba(255,255,255,0) 9deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 62%); mask: radial-gradient(circle, #000 20%, transparent 62%); }
@media (prefers-reduced-motion: no-preference) { .reveal-screen.active .rays { animation: spin 60s linear infinite; } }
@keyframes spin { to { transform: rotate(360deg); } }
.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.reveal-screen > *:not(.rays):not(.confetti) { position: relative; z-index: 2; }
.reveal-pip { position: absolute !important; left: calc(40px + var(--safe-l)); top: calc(40px + var(--safe-t)); display: flex; align-items: center; gap: 12px; }
.reveal-pip .bubble { width: 230px; font-size: 18px; padding: 12px 16px; color: var(--ink); }
.coin-wrap { width: 220px; height: 214px; margin-top: 30px; flex: none; }
.coin { position: absolute; left: 20px; top: 0; width: 180px; height: 166px; border-radius: 50%; background: var(--sun); box-shadow: 0 12px 0 var(--sun-edge), 0 26px 40px -10px rgba(30,10,90,.45);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 84px; color: var(--ink); animation: coin-drop .8s var(--ease-spring) both; }
.coin::before { content: ""; position: absolute; left: 30px; right: 30px; top: 14px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.35); }
.coin::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; border: 5px dashed rgba(138,90,0,.25); }
.coin span { position: relative; z-index: 1; }
@keyframes coin-drop { 0% { opacity: 0; transform: translateY(-60px) rotateY(0); } 60% { opacity: 1; transform: translateY(6px) rotateY(300deg); } 100% { transform: none; } }
.ribbon { position: absolute; left: 0; right: 0; top: 150px; height: 50px; background: #fff; color: var(--brand-ink); border-radius: 14px; box-shadow: 0 5px 0 #D8CCFF;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: .06em; text-transform: uppercase; animation: ribbon .4s var(--ease-out) .5s both; }
@keyframes ribbon { from { transform: scaleX(0); } }
.reveal-screen h1 { margin-top: 18px; text-align: center; font-size: 54px; line-height: 1.05; font-weight: 700; text-shadow: 0 4px 0 var(--brand-edge); animation: rise-in .5s var(--ease-out) .35s both; }
.reveal-sub { margin-top: 10px; text-align: center; font-size: 21px; font-weight: 700; color: var(--on-brand); max-width: 820px; animation: rise-in .5s var(--ease-out) .45s both; }
.facts { display: flex; justify-content: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; animation: rise-in .5s var(--ease-out) .55s both; }
.fact { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px 0 10px; border-radius: 999px; background: rgba(255,255,255,.14); border: 2px solid rgba(255,255,255,.22); font-weight: 800; font-size: 16px; }
.fact i { width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--brand); display: grid; place-items: center; font-style: normal; }
.journey-strip { margin-top: 20px; display: flex; gap: 16px; padding: 14px 22px 10px; border-radius: 22px; background: rgba(33,14,110,.28); }
.journey-strip .grp { text-align: center; }
.journey-strip .grp small { display: block; margin-top: 6px; font-weight: 800; font-size: 14px; color: var(--on-brand); letter-spacing: .04em; }
.journey-strip .dots { display: flex; gap: 5px; align-items: center; height: 40px; }
.journey-strip .dots i { width: 16px; height: 16px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; font-style: normal; }
.journey-strip .dots i.got { background: #fff; animation: pop-in .3s var(--ease-spring) both; animation-delay: calc(.8s + var(--k) * 25ms); }
.journey-strip .dots i.here { width: 40px; height: 40px; background: var(--sun); box-shadow: 0 4px 0 var(--sun-edge), 0 0 0 5px rgba(255,194,61,.3); font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--ink); animation: pop-in .5s var(--ease-spring) both; animation-delay: calc(.9s + var(--k) * 25ms); }
.reveal-fine { margin-top: 12px; font-size: 15px; font-weight: 700; color: var(--on-brand); max-width: 760px; text-align: center; }
.reveal-actions { margin-top: 26px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.reveal-actions .btn-lg { min-width: 340px; height: 72px; font-size: 26px; }

/* level intro */
.stage-chip { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 800; font-size: 16px; }
.tips { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tips li { position: relative; padding-left: 34px; font-weight: 700; font-size: 17px; line-height: 1.4; }
.tips li::before { content: "♪"; position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 15px; }

/* ---------- PLAY ---------- */
.screen.play { flex-direction: column; padding: calc(12px + var(--safe-t)) calc(16px + var(--safe-r)) calc(8px + var(--safe-b)) calc(16px + var(--safe-l)); background: var(--bg); }
.hud { display: flex; align-items: center; gap: 12px; min-height: 58px; flex: none; }
.hud .icon-btn { width: 58px; height: 58px; border-radius: 18px; }
.hud-title { min-width: 0; flex: 0 1 260px; }
.hud-title b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-title small { display: block; font-weight: 800; font-size: 14px; color: var(--ink-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat { height: 58px; padding: 0 16px; border-radius: 18px; background: #fff; border: 2px solid var(--line); box-shadow: 0 4px 0 var(--edge); display: flex; flex-direction: column; justify-content: center; flex: none; }
.stat small { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); line-height: 1; }
.stat b { font-family: var(--font-ui); font-weight: 900; font-size: 26px; line-height: 1.05; min-width: 64px; }
.stat.combo { flex-direction: row; align-items: center; gap: 8px; }
.stat.combo b { color: var(--flame-ink); min-width: 0; }
.stat.combo small { color: var(--flame-ink); text-transform: none; letter-spacing: 0; font-size: 13px; line-height: 1.05; }
.stat.combo .flame-ic { display: grid; transition: transform var(--t-slow) var(--ease-spring); }
.stat.combo.hot .flame-ic { transform: scale(1.3); }
.stat.combo.bump .flame-ic { animation: combo-bump var(--t-slow) var(--ease-spring); }
@keyframes combo-bump { 40% { transform: scale(1.45) rotate(-8deg); } }
.grow { flex: 1; }
.stepper { display: flex; align-items: center; height: 58px; border-radius: 18px; background: #fff; border: 2px solid var(--line); box-shadow: 0 4px 0 var(--edge); padding: 0 6px; gap: 4px; flex: none; }
.stepper button { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--brand-ink); background: var(--brand-soft); }
.stepper button:active { transform: scale(.94); }
.stepper .bpm { min-width: 74px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.stepper .bpm b { font-family: var(--font-ui); font-weight: 900; font-size: 21px; line-height: 1.1; display: inline-flex; align-items: center; gap: 3px; }
.stepper .bpm b::before { content: "♩"; font-family: 'Noto Music', serif; font-weight: 400; font-size: 20px; color: var(--ink-2); }
.beat-dots { display: flex; gap: 4px; height: 8px; align-items: center; margin-top: 2px; }
.beat-dots i { width: 7px; height: 7px; border-radius: 50%; background: #E6D9C3; transition: transform 80ms; }
.beat-dots i.on { background: var(--brand); transform: scale(1.3); }
.beat-dots i.first.on { background: var(--flame); }
.seg-mode { display: flex; height: 58px; padding: 5px; border-radius: 18px; background: #F1E6D4; gap: 4px; flex: none; }
.seg-mode span { display: grid; place-items: center; padding: 0 16px; border-radius: 13px; font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--ink-2); transition: background var(--t-fast), color var(--t-fast); }
.seg-mode:not(.on) .t, .seg-mode.on .w { background: var(--brand); color: #fff; box-shadow: 0 4px 0 var(--brand-edge); }
.hud-btn { min-height: 58px; border-radius: 18px; padding: 0 18px; font-size: 19px; --depth: 4px; }
.hud-progress { display: flex; flex-direction: column; gap: 6px; flex: 0 1 300px; min-width: 200px; }
.hud-progress .hp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hud-progress b { font-family: var(--font-display); font-weight: 600; font-size: 19px; white-space: nowrap; }
.hud-progress b span { color: var(--ink-3); }
.segs { display: flex; gap: 5px; }
.segs i { flex: 1; height: 12px; border-radius: 999px; background: #EADFCC; }
.segs i.done { background: var(--mint); box-shadow: inset 0 -3px 0 var(--mint-edge); }
.segs i.cur { background: var(--brand); box-shadow: inset 0 -3px 0 var(--brand-edge), 0 0 0 3px var(--brand-soft); }
.segs i.maybe { background: transparent; border: 2.5px dashed #DCCDB3; }
.cue { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 6px; border-radius: 999px; font-weight: 800; font-size: 15px; white-space: nowrap; }
.cue .arrow { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cue.harder { background: var(--sun-soft); color: var(--sun-ink); border: 2.5px solid var(--sun); }
.cue.harder .arrow { background: var(--sun); color: var(--ink); }
.cue.easier { background: var(--early-soft); color: var(--early-ink); border: 2.5px solid var(--early); }
.cue.easier .arrow { background: var(--early); color: #fff; }
.cue.same { background: var(--brand-soft); color: var(--brand-ink); border: 2.5px solid var(--brand-hi); }
.cue.same .arrow { background: var(--brand); color: #fff; }
.screen.play.placement #btn-mode, .screen.play.placement .stepper, .screen.play.placement #btn-listen { display: none; }
.stage-wrap { position: relative; flex: 1; min-height: 0; margin-top: 10px; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.status-strip { position: absolute; left: 12px; right: 12px; top: 0; height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 12px; z-index: 3; pointer-events: none; }
.mic-ind { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 10px; border-radius: 999px; background: #fff; border: 2px solid var(--line); font-weight: 800; font-size: 14px; color: var(--ink-3); }
.mic-ind .mic-ic { display: grid; color: #B8AC97; }
.mic-ind .lv { display: inline-flex; align-items: center; gap: 2px; height: 16px; }
.mic-ind .lv i { width: 3px; height: 4px; border-radius: 2px; background: #D8CCB6; transition: height 60ms linear; }
.mic-ind.on { color: var(--mint-ink); }
.mic-ind.on .mic-ic { color: var(--mint); }
.mic-ind.on .lv i { background: var(--mint); }
.mic-ind.held { color: var(--brand-ink); }
.mic-ind.held .mic-ic { color: var(--brand); }
.feedback-pop { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; background: #fff; border: 2.5px solid var(--flame); box-shadow: 0 4px 0 var(--flame-edge); font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--flame-ink); opacity: 0; transform: scale(.7); }
.feedback-pop.info { border-color: var(--brand-hi); box-shadow: 0 4px 0 var(--brand-hi); color: var(--brand-ink); }
.feedback-pop.show { animation: pop-toast 2.2s var(--ease-out) both; }
@keyframes pop-toast { 0% { opacity: 0; transform: scale(.6); } 10% { opacity: 1; transform: scale(1.06); } 16% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }
.bar-prog { display: inline-flex; align-items: center; gap: 10px; height: 32px; padding: 0 12px; border-radius: 999px; background: #fff; border: 2px solid var(--line); font-weight: 800; font-size: 14px; color: var(--ink-2); }
.bar-prog .bar { width: 90px; height: 10px; }
.bar-prog .bar > i { transition: width .3s linear; }
.screen.play.free .bar-prog, .screen.play.free .stat, .screen.play.free .stepper, .screen.play.free .seg-mode, .screen.play.free #btn-listen { display: none; }
/* Count-in: the number sits in a ring that closes over one beat (--beat); "Go!" bursts. */
.countdown { position: absolute; left: 50%; top: 66%; width: 180px; height: 180px; margin: -90px 0 0 -90px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 104px; color: var(--brand); text-shadow: 0 6px 0 var(--brand-soft); pointer-events: none; z-index: 4; line-height: 1; }
.countdown:empty { display: none; }
.countdown::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.92) 0 58%, rgba(255,255,255,0) 72%); }
.countdown::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 7px solid var(--brand-hi); opacity: 0; }
.countdown b { position: relative; font-weight: 700; }
.countdown.pulse b { animation: count-num .32s var(--ease-spring) both; }
.countdown.pulse::after { animation: count-ring var(--beat, .8s) linear both; }
.countdown.go { color: var(--sun-ink); text-shadow: 0 6px 0 var(--sun-soft); font-size: 84px; }
.countdown.go::after { border-color: var(--sun); animation: count-go .5s var(--ease-out) both; }
@keyframes count-num { from { transform: scale(.55); opacity: .2; } }
@keyframes count-ring { 0% { opacity: .9; transform: scale(1.18); } 100% { opacity: .15; transform: scale(.78); } }
@keyframes count-go { 0% { opacity: .9; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.6); } }
@media (prefers-reduced-motion: reduce) { .countdown.pulse b, .countdown.pulse::after, .countdown.go::after { animation: none; } .countdown::after { opacity: .5; } }

/* Listening lost: the lesson pauses until a tap brings the microphone back (iOS needs a tap). */
.lost-dialog { max-width: 520px; text-align: center; }
.lost-dialog .dialog-pip { display: flex; justify-content: center; }
.lost-dialog h2 { margin-top: 6px; }
.lost-dialog p { margin: 8px 0 18px; font-size: 18px; }
.lost-dialog .col { align-items: stretch; }
.mic-ind.lost { color: var(--coral-ink); background: var(--coral-soft); border-color: var(--coral); }
.status-strip .mic-ind { cursor: pointer; pointer-events: auto; }

#btn-setup-diag { padding-left: 4px; padding-right: 4px; } /* aligns with the column when it wraps */

/* "Get ready" card: over the falling-notes lane, above the hand brackets on the keyboard. */
.prep { position: absolute; left: 50%; transform: translateX(-50%); z-index: 5; width: min(880px, calc(100% - 40px));
  display: flex; align-items: center; gap: 18px; padding: 14px 20px 14px 14px; overflow: hidden;
  background: var(--surface); border: 2.5px solid var(--line); border-radius: var(--r-xl); box-shadow: 0 6px 0 var(--edge), var(--shadow-pop);
  animation: prep-in var(--t-slow) var(--ease-spring) both; }
.prep-pip { flex: none; width: 92px; display: flex; justify-content: center; }
.prep-pip svg { display: block; }
.prep-body { flex: 1; min-width: 0; }
.prep-title { font-family: var(--font-display); font-weight: 600; font-size: 26px; line-height: 1.15; margin: 2px 0 4px; }
.prep-text { font-size: 18px; line-height: 1.35; color: var(--ink-2); font-weight: 700; }
.prep-text b { color: var(--brand-ink); font-weight: 800; }
.prep-text.nudge { animation: prep-nudge .45s var(--ease-out); }
.prep-go { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.prep-go .btn { overflow: hidden; }
.prep-or { font-size: 14px; font-weight: 800; color: var(--ink-3); }
.prep-keep { display: flex; align-items: center; gap: 10px; max-width: 214px; font-size: 14px; font-weight: 800; line-height: 1.2; color: var(--ink-2); cursor: pointer; }
.prep-keep input { width: 44px; height: 28px; }
.prep-keep input::after { width: 20px; height: 20px; }
.prep-keep input:checked::after { transform: translateX(16px); }
.prep-keep input:checked:active::after { transform: translateX(16px) scaleX(1.18); }
.prep-ring { position: absolute; left: 0; bottom: 0; height: 5px; width: calc(var(--p, 0) * 100%); background: rgba(255,255,255,.55); border-radius: 0 3px 3px 0; display: none; }
.prep-ring.on { display: block; }
.prep.leave { animation: prep-out .18s var(--ease-in) both; pointer-events: none; }
@keyframes prep-out { to { opacity: 0; transform: translate(-50%, 16px) scale(.97); } }
@keyframes prep-in { from { opacity: 0; transform: translate(-50%, 14px) scale(.97); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes prep-nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 60% { transform: translateX(5px); } }
@media (max-width: 1100px) { .prep-pip { width: 72px; } .prep-pip svg { width: 72px; height: auto; } .prep-title { font-size: 22px; } .prep-text { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { .prep, .prep-text.nudge { animation: none; } }
@keyframes count-pulse { from { transform: translate(-50%, -50%) scale(.6); opacity: .2; } }
.free-display { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 12px; pointer-events: none; z-index: 3; text-align: center; }
.fd-notes { font-family: var(--font-display); font-weight: 600; font-size: 56px; color: var(--ink); background: #fff; border: 2.5px solid var(--line); box-shadow: 0 6px 0 var(--edge); border-radius: 26px; padding: 8px 28px; }
.fd-chord { font-family: var(--font-display); font-weight: 600; font-size: 30px; color: #fff; background: var(--brand); box-shadow: 0 6px 0 var(--brand-edge); border-radius: 999px; padding: 4px 24px; }
.fd-idle { display: flex; align-items: center; gap: 14px; }
.fd-idle .bubble { font-size: 20px; }

/* overlays & dialogs */
.overlay { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(42,35,70,.5); animation: fade-in var(--t-base) var(--ease-out); }
@keyframes fade-in { from { opacity: 0; } }
.dialog { position: relative; background: #fff; border-radius: 28px; border: 2px solid var(--line); box-shadow: 0 7px 0 var(--edge), var(--shadow-pop); padding: 26px 28px; animation: sheet-rise var(--t-base) var(--ease-out) backwards; }
@keyframes sheet-rise { from { opacity: 0; transform: translate3d(0, 24px, 0); } }
.overlay.closing { animation: fade-out var(--t-fast) var(--ease-in) forwards; pointer-events: none; }
.overlay.closing .dialog { animation: sheet-drop var(--t-fast) var(--ease-in) forwards; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-drop { to { opacity: 0; transform: translate3d(0, 16px, 0); } }
.pause-dialog { width: 660px; max-width: calc(100% - 32px); max-height: calc(100% - 20px); overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto 1fr; gap: 10px 28px; }
.pause-dialog > h2 { grid-column: 1; grid-row: 2; }
.pause-dialog .col { grid-column: 1; grid-row: 3; align-self: end; }
.pause-dialog .dialog-pip { grid-column: 1; grid-row: 1; justify-content: flex-start; }
.view-menu { grid-column: 2; grid-row: 1 / span 3; display: flex; flex-direction: column; gap: 4px; border-left: 2px solid var(--line); padding-left: 24px; }
.view-menu h3 { margin-bottom: 4px; }

/* switches, selects, sliders */
.switch-row, .select-row, .range-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; font-weight: 700; font-size: 17px; }
.range-row { flex-direction: column; align-items: stretch; gap: 6px; padding: 6px 0; }
.range-row > span b { color: var(--brand-ink); margin-left: 6px; }
input[type=checkbox] { -webkit-appearance: none; appearance: none; flex: none; width: 56px; height: 34px; border-radius: 999px; background: #E6DBC8; position: relative; cursor: pointer; box-shadow: inset 0 -3px 0 rgba(42,35,70,.08); transition: background var(--t-fast); margin: 0; }
input[type=checkbox]::after { content: ""; position: absolute; left: 4px; top: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 0 rgba(42,35,70,.15); transition: transform var(--t-base) var(--ease-spring); }
input[type=checkbox]:checked { background: var(--brand); box-shadow: inset 0 -3px 0 var(--brand-edge); }
input[type=checkbox]:checked::after { transform: translateX(22px); }
input[type=checkbox]:active::after { transform: scaleX(1.18); }
input[type=checkbox]:checked:active::after { transform: translateX(22px) scaleX(1.18); }
select { -webkit-appearance: none; appearance: none; min-height: 46px; padding: 0 40px 0 14px; border-radius: 14px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234A2FC2'%3E%3Cpath d='M5.6 8.9a1.6 1.6 0 0 1 2.3 0l4.1 4.1 4.1-4.1a1.6 1.6 0 1 1 2.3 2.3l-5.3 5.2a1.6 1.6 0 0 1-2.2 0L5.6 11.2a1.6 1.6 0 0 1 0-2.3Z'/%3E%3C/svg%3E") right 12px center / 20px no-repeat; border: 2px solid var(--line); box-shadow: 0 3px 0 var(--edge); font-weight: 800; font-size: 16px; color: var(--ink); max-width: 60%; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 14px; border-radius: 999px; background: linear-gradient(90deg, #C9BAFF 0 var(--p, 0%), var(--brand-soft) var(--p, 0%) 100%); box-shadow: inset 0 2px 0 rgba(42,35,70,.06); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 32px; height: 32px; margin-top: -9px; border-radius: 50%; background: var(--brand); border: 4px solid #fff; box-shadow: 0 3px 0 var(--brand-edge), 0 0 0 2px var(--brand); transition: transform var(--t-fast) var(--ease-spring); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.14); }
input[type=range]::-moz-range-track { height: 14px; border-radius: 999px; background: var(--brand-soft); }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); border: 4px solid #fff; box-shadow: 0 3px 0 var(--brand-edge); }
input[type=search] { -webkit-appearance: none; appearance: none; }

/* ---------- RESULTS ---------- */
.results { position: fixed; inset: 0; z-index: 30; background: radial-gradient(900px 620px at 24% 52%, #F1EAFF 0%, rgba(241,234,255,0) 70%), var(--bg); display: grid; grid-template-columns: minmax(340px, 470px) minmax(460px, 640px); gap: 36px; justify-content: center; align-content: center; padding: calc(24px + var(--safe-t)) calc(28px + var(--safe-r)) calc(20px + var(--safe-b)) calc(28px + var(--safe-l)); overflow-y: auto; }
.results .confetti { position: fixed; z-index: 0; }
.res-left, .res-right { position: relative; z-index: 1; }
.res-left { display: flex; flex-direction: column; align-items: center; }
.res-right h1 { font-size: 46px; line-height: 1.05; color: var(--brand); letter-spacing: -0.015em; }
.res-sub { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-weight: 800; color: var(--ink-2); font-size: 17px; }
.xp-chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 8px; border-radius: 999px; background: var(--sun-soft); color: var(--sun-ink); font-family: var(--font-ui); font-weight: 900; font-size: 17px; border: 2px solid #FFE08A; }
.xp-chip:empty { display: none; }
.res-level { margin-top: 12px; font-weight: 800; font-size: 17px; color: var(--ink-2); }
.res-level:empty { display: none; }
.res-level .mastery { display: flex; align-items: center; gap: 12px; }
.res-level .mastery .bar { flex: 1; height: 14px; }
.res-level .levelup { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 999px; background: var(--sun-soft); border: 2.5px solid var(--sun); color: var(--sun-ink); font-size: 18px; }
.res-level .levelup b { color: var(--ink); }
.res-level .cue { height: 44px; font-size: 18px; padding: 0 16px 0 8px; }
.res-level .cue .arrow { width: 30px; height: 30px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.tiles .tile { border-radius: 20px; border: 3px solid var(--c); background: var(--c); box-shadow: 0 5px 0 var(--ce); overflow: hidden; }
.tiles .tile .hd { color: var(--ink); font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; text-align: center; padding: 4px 0 5px; }
.tiles .tile .bd { background: #fff; border-radius: 16px 16px 17px 17px; padding: 10px 8px 10px; text-align: center; }
.tiles .tile .v b { font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 1.1; }
.tiles .tile .d { font-weight: 800; font-size: 14px; color: var(--ink-2); }
.t-hit { --c: var(--mint); --ce: var(--mint-edge); } .t-time { --c: var(--sun); --ce: var(--sun-edge); }
.t-off { --c: var(--late); --ce: var(--late-edge); } .t-off.early { --c: var(--early); --ce: var(--early-edge); } .t-off.none { --c: #E6DBC8; --ce: #D3C6AF; }
.histo-card { margin-top: 18px; padding: 14px 22px 12px; }
.histo-top { display: flex; justify-content: space-between; align-items: baseline; }
.legend { display: flex; gap: 14px; font-weight: 800; font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.legend .e { color: var(--early-ink); } .legend .e i { background: var(--early); }
.legend .o { color: var(--mint-ink); } .legend .o i { background: var(--mint); }
.legend .l { color: var(--late-ink); } .legend .l i { background: var(--late); }
.histo { margin-top: 8px; }
.histo-bars { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 104px; border-bottom: 2px solid #EADFCC; padding: 0 4px; }
.histo-bars .win { position: absolute; top: 0; bottom: 0; background: var(--mint-soft); border-radius: 10px; }
.histo-bars .avg { position: absolute; top: 4px; bottom: 0; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--brand); z-index: 2; }
.histo-bars .avg::before { content: ""; position: absolute; top: -4px; left: -6.5px; border: 8px solid transparent; border-top: 10px solid var(--brand); border-bottom: 0; }
.histo-bars i { position: relative; flex: 1; display: grid; place-items: start center; border-radius: 9px; min-height: 4px; background: var(--c, #EADFCC); box-shadow: inset 0 -4px 0 var(--ce, transparent); z-index: 1; transform-origin: bottom; font-style: normal; font-family: var(--font-display); font-weight: 600; font-size: 13px; color: #fff; padding-top: 2px; }
.histo-bars i.on { --c: var(--mint); --ce: var(--mint-edge); color: var(--ink); }
.histo-bars i.early { --c: var(--early); --ce: var(--early-edge); }
.histo-bars i.late { --c: var(--late); --ce: var(--late-edge); color: var(--ink); }
.histo-bars i.zero { --c: #EADFCC; --ce: transparent; }
.histo-axis { display: flex; justify-content: space-between; font-size: 13px; font-weight: 800; color: var(--ink-3); padding: 4px 2px 0; }
.timing-summary { font-weight: 700; font-size: 16px; color: var(--ink-2); margin-top: 6px; }
.timing-summary:empty { display: none; }
#res-latency:empty { display: none; }
#res-latency .btn { margin-top: 8px; }
.res-tips { margin-top: 12px; }
.res-tips li { font-size: 16px; }
.actions { display: flex; gap: 14px; margin-top: 18px; align-items: center; }
.actions .next { flex: 1; }
.auto { margin-top: 8px; text-align: right; font-weight: 800; font-size: 14px; color: var(--ink-3); min-height: 1.2em; }
/* placement results: a compact cue card */
.results.placement-card .tiles, .results.placement-card .histo-card, .results.placement-card .res-tips { display: none; }
.results.placement-card .res-level { margin-top: 20px; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.results.placement-card { align-items: center; }
.results.placement-card .res-level .segs { width: 100%; max-width: 420px; }
.results.placement-card .res-level .segs i { height: 16px; }
/* results timeline: every block is laid out from the first frame (no shifts); each one only
   fades/rises into place, in reading order. The gauge counts up from 350 ms and pops a star as
   it passes 70 / 85 / 95 (results.js). A tap anywhere (.skip) jumps to the end. */
.results.anim { animation: fade-in 200ms var(--ease-out) backwards; }
.results.anim .gauge { animation: gauge-in .5s var(--ease-spring) .08s backwards; }
.results.anim .g-star { animation: fade-in .3s var(--ease-out) .25s backwards; }
.results.anim .g-star.lit { animation: star-pop var(--t-slow) var(--ease-spring) backwards; }
.results.anim .best-tag { animation: best-pop .5s var(--ease-spring) 1.5s backwards; }
.results.anim .res-right h1 { animation: drop-in var(--t-slow) var(--ease-spring) .15s backwards; }
.results.anim .res-sub { animation: rise-in .36s var(--ease-out) .28s backwards; }
.results.anim .res-level { animation: rise-in .36s var(--ease-out) .4s backwards; }
.results.anim .actions { animation: rise-in .36s var(--ease-out) .45s backwards; }
.results.anim .tiles .tile { animation: rise-in .4s var(--ease-out) backwards; }
.results.anim .tiles .tile:nth-child(1) { animation-delay: .55s; } .results.anim .tiles .tile:nth-child(2) { animation-delay: .63s; } .results.anim .tiles .tile:nth-child(3) { animation-delay: .71s; }
.results.anim .histo-card { animation: rise-in .4s var(--ease-out) .85s backwards; }
.results.anim .histo-bars i { animation: grow-up .5s var(--ease-out) backwards; animation-delay: calc(.95s + var(--k, 0) * 30ms); }
.results.anim .res-tips li { animation: rise-in .36s var(--ease-out) backwards; animation-delay: calc(1.1s + var(--i, 0) * 70ms); }
.results.anim .res-pip { animation: pop-in .5s var(--ease-spring) 1.45s backwards; }
.results.anim .res-coach .bubble { animation: bubble-in var(--t-base) var(--ease-spring) 1.6s backwards; }
.results.anim #res-auto { animation: fade-in .3s var(--ease-out) backwards; }
.results.skip, .results.skip * { animation-delay: 0s !important; animation-duration: 1ms !important; }
@keyframes gauge-in { from { opacity: 0; transform: scale(.86); } }
@keyframes best-pop { 0% { opacity: 0; transform: translateX(-50%) scale(.4) rotate(-8deg); } 70% { opacity: 1; transform: translateX(-50%) scale(1.1) rotate(2deg); } 100% { transform: translateX(-50%); } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-30px); } }
@keyframes star-pop { 0% { opacity: 0; transform: scale(.3) rotate(-15deg); } 70% { opacity: 1; transform: scale(1.12) rotate(0); } 100% { transform: none; } }
@keyframes grow-up { from { transform: scaleY(0); } }

/* ---------- SONGS ---------- */
.page-head .search { margin-left: auto; width: 250px; min-height: 52px; border-radius: 16px; background: #fff; border: 2px solid var(--line); box-shadow: inset 0 3px 0 #F6EEE1; display: flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--ink-3); }
.page-head .search input { border: 0; outline: 0; background: none; width: 100%; font-weight: 700; font-size: 17px; color: var(--ink); min-width: 0; }
.page-head .search input::placeholder { color: var(--ink-3); }
.page-head .search:focus-within { border-color: var(--brand-hi); }
#song-cats { margin: 0 -28px 16px; padding: 2px 28px 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
#song-cats::-webkit-scrollbar { display: none; }
.feat { display: flex; align-items: center; gap: 22px; min-height: 128px; padding: 0 28px; margin-bottom: 22px; border-radius: 24px; background: var(--brand); box-shadow: 0 6px 0 var(--brand-edge); color: #fff; overflow: hidden; }
.feat .art { width: 150px; height: 96px; border-radius: 16px; overflow: hidden; flex: none; box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.feat .eyebrow { color: var(--on-brand); }
.feat h2 { font-size: 32px; line-height: 1.05; margin: 4px 0; }
.feat p { font-weight: 700; font-size: 16px; color: var(--on-brand); }
.feat .btn { margin-left: auto; }
.feat .pip { flex: none; margin: 18px -8px 0 0; }
.song-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px 16px; }
.song { display: flex; flex-direction: column; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 22px; box-shadow: 0 5px 0 var(--edge); overflow: hidden; min-height: 232px; transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out); }
.song:active { transform: translateY(4px) scale(.97); box-shadow: 0 1px 0 var(--edge); }
.cover { position: relative; height: 100px; flex: none; }
.cover > svg { display: block; width: 100%; height: 100%; }
.cover .cat { position: absolute; left: 10px; top: 10px; height: 26px; padding: 0 10px; border-radius: 999px; background: rgba(255,255,255,.94); font-weight: 800; font-size: 12px; color: var(--ink); display: flex; align-items: center; }
.cover .got { position: absolute; right: 10px; top: 10px; height: 26px; display: flex; align-items: center; padding: 0 5px; border-radius: 999px; background: rgba(255,255,255,.94); }
.song .info { padding: 10px 14px 12px; display: flex; flex-direction: column; flex: 1; }
.song h3 { font-size: 19px; line-height: 1.12; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.song .by { font-weight: 700; font-size: 14px; color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song .foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.lvs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.lvs small { font-weight: 800; font-size: 12px; color: var(--ink-3); margin-right: 2px; }
.lv { min-width: 28px; height: 26px; padding: 0 6px; border-radius: 8px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.lv.ok { background: var(--brand-soft); color: var(--brand-ink); } .lv.soon { background: var(--sun-soft); color: var(--sun-ink); } .lv.later { background: #F3EADB; color: var(--ink-3); }
.song .play-ic { width: 38px; height: 38px; flex: none; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 0 var(--brand-edge); }
.song .soon-txt { font-weight: 800; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.empty-state { display: flex; align-items: center; gap: 16px; padding: 18px; color: var(--ink-2); font-weight: 700; }
.empty-state .bubble { font-size: 18px; }
.sources { margin-top: 26px; padding: 20px 24px; }
.sources ul { padding-left: 20px; line-height: 1.7; margin: 10px 0 0; }
.sources li { font-size: 16px; }
.sources a { color: var(--brand-ink); font-weight: 800; }
.sources small { color: var(--ink-2); font-weight: 600; }
.up-ic, .search-ic { display: grid; }
/* song sheet */
.sheet .sheet-card { width: 700px; max-width: calc(100% - 32px); max-height: calc(100% - 32px); overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.sheet-card .close { position: absolute; top: 18px; right: 18px; }
.sheet-head { display: flex; gap: 18px; align-items: center; padding-right: 60px; }
.sheet-cover { width: 140px; height: 90px; border-radius: 18px; overflow: hidden; flex: none; box-shadow: 0 5px 0 rgba(42,35,70,.12); }
.sheet-cover svg { display: block; width: 100%; height: 100%; }
.sheet-card h2 { font-size: 30px; }
.arrs { display: flex; flex-direction: column; gap: 10px; }
.arr { text-align: left; background: #fff; border: 2.5px solid var(--line); border-radius: 18px; padding: 10px 14px 10px 10px; display: grid; grid-template-columns: 48px 1fr auto; column-gap: 14px; align-items: center; box-shadow: 0 4px 0 var(--edge); transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out), background var(--t-fast), border-color var(--t-fast); }
.arr:active { transform: translateY(3px) scale(.98); box-shadow: 0 1px 0 var(--edge); }
.arr .arr-lv { grid-row: 1 / span 2; width: 48px; height: 44px; border-radius: 50%; background: var(--sc, var(--brand)); box-shadow: 0 4px 0 var(--sce, var(--brand-edge)); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 21px; }
.arr b { font-family: var(--font-display); font-weight: 600; font-size: 19px; }
.arr small { grid-column: 2; color: var(--ink-2); font-weight: 700; font-size: 14px; }
.arr .arr-best { grid-row: 1 / span 2; grid-column: 3; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-weight: 900; font-size: 15px; color: var(--sun-ink); }
.arr .mini-stars { display: flex; }
.arr.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 4px 0 var(--brand-hi); }
.arr.on.just-on { animation: sel-pop var(--t-base) var(--ease-spring); }
.tempo-row { display: flex; flex-direction: column; gap: 4px; font-weight: 700; }
.tempo-row b { color: var(--brand-ink); }

/* ---------- MAP ---------- */
.map-stage { margin-bottom: 26px; }
.map-stage h3 { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 24px; }
.map-stage h3 .dot { width: 34px; height: 34px; border-radius: 11px; background: var(--sc); box-shadow: inset 0 -3px 0 rgba(0,0,0,.16); display: grid; place-items: center; color: #fff; }
.map-stage h3 small { font-family: var(--font-ui); font-weight: 800; font-size: 15px; color: var(--ink-3); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.lvl { position: relative; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 20px; box-shadow: 0 5px 0 var(--edge); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-height: 112px; transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out); }
.lvl:active { transform: translateY(4px) scale(.97); box-shadow: 0 1px 0 var(--edge); }
.lvl .lvl-ic { position: absolute; right: 12px; top: 10px; display: flex; gap: 1px; color: var(--ink-3); }
.lvl.current .lvl-ic { color: var(--brand); }
.lvl .n { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--ink-3); }
.lvl b { font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1.15; }
.lvl .bar { margin-top: auto; height: 10px; }
.lvl.done .bar > i { background: var(--sun); }
.lvl.current { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 5px 0 var(--brand-hi); }
.lvl.current .n { color: var(--brand-ink); }
.lvl.locked { background: #FBF5EA; }
.lvl.locked b { color: var(--ink-2); }

/* ---------- PRACTICE / PROGRESS / SETTINGS ---------- */
.form { padding: 20px 26px 22px; display: flex; flex-direction: column; gap: 8px; }
.form h3 { margin: 14px 0 4px; }
.form h3:first-child { margin-top: 0; }
.field { display: flex; flex-direction: column; gap: 8px; padding: 6px 0; }
.field .label { font-family: var(--font-display); font-weight: 600; font-size: 19px; }
.field .label .muted { font-family: var(--font-ui); font-weight: 700; font-size: 16px; margin-left: 6px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-tile { border-radius: 20px; border: 3px solid var(--c); background: var(--c); box-shadow: 0 5px 0 var(--ce); overflow: hidden; animation: rise-in .36s var(--ease-out) backwards; animation-delay: calc(80ms + var(--i) * 45ms); }
.stat-tile .hd { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; text-align: center; padding: 4px 0 5px; color: var(--hc, var(--ink)); }
.stat-tile .bd { background: #fff; border-radius: 16px 16px 17px 17px; padding: 10px 10px 12px; text-align: center; }
.stat-tile b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 28px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-tile small { display: block; font-weight: 800; font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-card { padding: 18px 22px; }
#history-chart { width: 100%; height: 200px; display: block; margin-top: 8px; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; max-width: 1040px; }
.settings .form .row { margin-top: 8px; }
.switch-row span, .select-row span { flex: 1; }

/* ---------- toast & rotate hint ---------- */
.toast { position: fixed; bottom: calc(24px + var(--safe-b)); left: 50%; transform: translate(-50%, 24px); z-index: 60; max-width: 90vw; text-align: center;
  background: #fff; border: 2px solid var(--line); box-shadow: 0 5px 0 var(--edge), var(--shadow-card); padding: 12px 20px; border-radius: 999px; font-weight: 800; font-size: 16px; opacity: 0; pointer-events: none; transition: opacity var(--t-fast) var(--ease-out), transform var(--t-base) var(--ease-spring); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.rotate-hint { display: none; }
@media (orientation: portrait) and (max-width: 900px) {
  .rotate-hint { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 70; align-items: center; gap: 12px; padding: 10px 16px; background: #fff; border: 2px solid var(--line); box-shadow: 0 5px 0 var(--edge), var(--shadow-pop); border-radius: 22px; font-weight: 800; font-size: 16px; pointer-events: none; animation: hint-fade 8s var(--ease-out) forwards; }
  @keyframes hint-fade { 0% { opacity: 0; transform: translateY(20px); } 6%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(20px); } }
  .rotate-hint .pip { width: 64px; height: 64px; }
}

/* ---------- responsive ---------- */
@media (max-width: 1120px) {
  :root { --rail-w: 96px; }
  .rail { padding-left: calc(10px + var(--safe-l)); padding-right: 10px; align-items: center; }
  .rail .logo { padding: 0 0 12px; }
  .rail .logo .wordmark { display: none; }
  .rail .logo .pip-face { display: block; }
  .nav { flex-direction: column; justify-content: center; gap: 4px; min-height: 72px; padding: 6px 2px; font-size: 13px; text-align: center; line-height: 1.1; }
  .rail .me { padding: 10px 0 0; }
  .rail .me div { display: none; }
  .side { width: 360px; }
  .pills { gap: 6px; flex-wrap: nowrap; }
  .pill { height: 40px; font-size: 17px; padding: 0 10px 0 8px; gap: 6px; }
  .pill svg { width: 22px; height: 22px; }
  .mic-pill { font-size: 14px; }
  .hero-actions { flex-direction: column; }
  .hero-actions #btn-hear { min-height: 52px; --depth: 5px; }
  .hero h1 { font-size: 30px; }
  .goal { grid-template-columns: 88px 1fr; gap: 12px; padding: 14px 16px; }
  .ring, .ring svg { width: 88px; height: 88px; }
  .ring .v b { font-size: 23px; }
  .week { gap: 2px; }
  .week .d { width: 29px; font-size: 11px; }
  .week .d i { width: 29px; height: 29px; }
  .week .d i svg { width: 17px; height: 17px; }
  .jrow { grid-template-columns: 28px 1fr 64px 38px; gap: 10px; }
  .jrow b small { display: none; }
  .hud-title { flex-basis: 200px; }
  .hud .stat.score { display: none; }
  .content.setup, .content.placement, .content.intro { gap: 28px; }
}
@media (max-width: 1000px) {
  .content.home { flex-direction: column; overflow-y: auto; padding: 0 16px; }
  .path-col { min-width: 0; flex: none; height: 62vh; }
  .side { width: auto; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .settings, .practice { grid-template-columns: 1fr; }
  .practice-pip { display: none; }
  .content.setup, .content.placement, .content.intro { grid-template-columns: 1fr; }
  .coach-col .pip-slot { display: none; }
  .results { grid-template-columns: 1fr; align-content: start; }
  .res-coach { min-height: 0; }
  .res-coach .bubble { margin-left: 0; }
  .res-coach .res-pip { display: none; }
  .hud { flex-wrap: wrap; }
  .hud-btn { padding: 0 12px; }
}
@media (max-height: 740px) {
  .reveal-screen h1 { font-size: 44px; }
  .coin-wrap { transform: scale(.8); margin-top: 0; margin-bottom: -30px; }
  .journey-strip { margin-top: 12px; }
  .big-score { font-size: 88px; }
  .stars { height: 100px; }
  .res-coach { min-height: 220px; }
}
@media (min-width: 1300px) and (min-height: 950px) {
  .path-nodes { transform-origin: top center; }
  .side { width: 440px; }
  .results { gap: 56px; }
}

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

/* ---- listening check ---- */
/* The "Listening check" sheet (js/ui/diagnostics.js): live mic level, note test, status, fixes. */
.overlay.diag { position: fixed; z-index: 40; padding: calc(12px + var(--safe-t)) calc(12px + var(--safe-r)) calc(12px + var(--safe-b)) calc(12px + var(--safe-l)); }
.diag-card { width: 1100px; max-width: 100%; max-height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--bg); padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 12px; }
.diag-card .close { position: absolute; top: 18px; right: 18px; }
.diag-head { display: flex; align-items: center; gap: 18px; padding-right: 64px; min-height: 96px; }
.diag-pip { flex: none; width: 112px; display: flex; justify-content: center; }
.diag-pip .pip { animation: pip-breathe 3.2s ease-in-out infinite; }
.diag-title { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.diag-title h2 { font-size: 30px; }
.diag-verdict { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 6px 18px 6px 14px; border-radius: 999px; font-weight: 800; font-size: 18px; line-height: 1.25; border: 2.5px solid var(--vb); background: var(--vs); color: var(--vi); }
.diag-verdict i { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--vb); box-shadow: 0 0 0 5px color-mix(in srgb, var(--vb) 22%, transparent); }
.diag-verdict.ok { --vb: var(--mint); --vs: var(--mint-soft); --vi: var(--mint-ink); }
.diag-verdict.ok i { animation: diag-pulse 1.6s ease-in-out infinite; }
.diag-verdict.warn { --vb: var(--sun); --vs: var(--sun-soft); --vi: var(--sun-ink); }
.diag-verdict.bad { --vb: var(--coral); --vs: var(--coral-soft); --vi: var(--coral-ink); }
@keyframes diag-pulse { 50% { transform: scale(.7); } }

.diag-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.diag-main, .diag-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.diag-panel { background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 5px 0 var(--edge); padding: 12px 18px 14px; }
.diag-panel h3 { font-size: 20px; }
.diag-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.diag-panel-head .fine { text-align: right; }
.diag-big { font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 1; color: var(--brand-ink); font-variant-numeric: tabular-nums; }

/* level meter: -90..0 dBFS; --lvl, --pk, --room, --piano are set from JS (percent) */
.diag-meter { --lvl: 0%; --pk: 0%; --room: 0%; --piano: 0%; position: relative; height: 40px; margin: 26px 0 4px; border-radius: 14px; background: #EFE4D2; box-shadow: inset 0 3px 0 rgba(42,35,70,.06); }
.diag-meter-fill { position: absolute; inset: 0; border-radius: 14px; background: linear-gradient(90deg, var(--mint) 0%, #7BE3A8 58%, var(--sun) 78%, var(--late) 90%, var(--coral) 100%); clip-path: inset(0 calc(100% - var(--lvl)) 0 0 round 14px); -webkit-clip-path: inset(0 calc(100% - var(--lvl)) 0 0 round 14px); }
.diag-peak { position: absolute; top: 5px; bottom: 5px; left: calc(var(--pk) - 2px); width: 4px; border-radius: 2px; background: var(--ink); transition: left 90ms linear; }
.diag-meter.no-peak .diag-peak { display: none; }
.diag-mark { position: absolute; top: -6px; bottom: -6px; left: var(--x); width: 0; border-left: 3px dashed var(--c); }
.diag-mark span { position: absolute; top: -26px; left: 0; transform: translateX(-50%); padding: 1px 9px; border-radius: 999px; background: var(--c); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .04em; white-space: nowrap; }
.diag-mark.room { --c: var(--ink-3); --x: var(--room); }
.diag-mark.piano { --c: var(--brand); --x: var(--piano); }
.diag-mark.piano span { top: auto; bottom: -25px; }
.diag-meter.no-room .diag-mark.room, .diag-meter.no-piano .diag-mark.piano { display: none; }
.diag-scale { display: flex; justify-content: space-between; font-weight: 800; font-size: 13px; color: var(--ink-3); margin-top: 30px; font-variant-numeric: tabular-nums; }
.diag-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dl { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px 0 10px; border-radius: 999px; background: var(--bg-sunk); font-weight: 800; font-size: 15px; color: var(--ink-2); }
.dl::before { content: ""; width: 12px; height: 12px; border-radius: 4px; background: var(--c); }
.dl b { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.dl.room { --c: var(--ink-3); } .dl.piano { --c: var(--brand); } .dl.peak { --c: var(--ink); }

/* note test */
.diag-test { display: grid; grid-template-columns: 132px 1fr; gap: 20px; align-items: center; }
.diag-note { width: 132px; height: 132px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--brand-soft); border: 4px solid #D6CAFF; box-shadow: 0 6px 0 #C9BAFF; color: var(--brand-ink); transition: background var(--t-base), border-color var(--t-base); }
.diag-note b { font-family: var(--font-display); font-weight: 600; font-size: 48px; line-height: 1; }
.diag-note small { font-weight: 800; font-size: 13px; color: var(--ink-2); }
.diag-note.waiting { animation: diag-wait 1.4s ease-in-out infinite; }
.diag-note.heard { background: var(--mint-soft); border-color: var(--mint); box-shadow: 0 6px 0 var(--mint-edge); color: var(--mint-ink); }
.diag-note.heard.gated { background: var(--sun-soft); border-color: var(--sun); box-shadow: 0 6px 0 var(--sun-edge); color: var(--sun-ink); }
.diag-note.pop { animation: pop-in .4s var(--ease-spring); }
@keyframes diag-wait { 50% { transform: scale(.94); border-color: var(--brand-hi); } }
.diag-test-body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.diag-test-body .fine { font-size: 16px; color: var(--ink-2); min-height: 2.9em; }

/* last notes */
.diag-chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 44px; align-items: center; }
.dn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--edge); }
.dn b { font-family: var(--font-display); font-weight: 600; font-size: 19px; }
.dn .conf { width: 34px; height: 8px; border-radius: 4px; background: #EFE4D2; overflow: hidden; }
.dn .conf i { display: block; height: 100%; border-radius: 4px; background: var(--mint); }
.dn small { font-weight: 800; font-size: 13px; color: var(--ink-3); }
.dn.gated { border-style: dashed; box-shadow: none; background: var(--bg-sunk); }
.dn.gated .conf i { background: var(--sun); }

/* status rows */
.diag-rows { list-style: none; margin: 8px 0 0; padding: 0; }
.diag-rows li { display: grid; grid-template-columns: 14px auto 1fr; align-items: center; gap: 10px; min-height: 44px; border-bottom: 2px solid var(--line); font-size: 16px; }
.diag-rows li:last-child { border-bottom: 0; }
.diag-rows li b { font-weight: 800; color: var(--ink-2); white-space: nowrap; }
.diag-rows li span { font-weight: 800; text-align: right; color: var(--ink); line-height: 1.25; }
.diag-rows .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); }
.diag-rows .ok { --c: var(--mint); } .diag-rows .warn { --c: var(--sun); } .diag-rows .bad { --c: var(--coral); }
.diag-rows .bad span { color: var(--coral-ink); }

/* actions + recording */
.diag-actions { display: flex; flex-direction: column; gap: 14px; }
.diag-rec { background: var(--brand-soft); border: 2px solid #D6CAFF; border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.diag-rec-top { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--brand-ink); }
.diag-rec-top b { font-weight: 600; }
.diag-rec .bar > i { transition: width .2s linear; }
.diag-rec .row { gap: 10px; }
.diag-rec a.btn { text-decoration: none; }
.rec-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--coral); animation: diag-pulse 1s ease-in-out infinite; }
.rec-ok { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: #fff; }

@media (max-width: 900px) {
  .diag-grid { grid-template-columns: 1fr; }
  .diag-head { min-height: 0; }
  .diag-pip { display: none; }
}

/* =====================================================================================
   Screens v3: motion, first-run home, node cards, level intro, results gauge, practice.
   (Screen transitions are Web Animations run by show() in js/ui/core.js.)
   ===================================================================================== */

/* ---------- home: first-run start node, Pip pointing at it ---------- */
.path-start { position: relative; height: 262px; margin: 0 auto; width: 460px; max-width: 100%; }
.ps-coin { position: absolute; left: 70px; top: 44px; width: 124px; height: 110px; border-radius: 50%; background: var(--brand); box-shadow: 0 9px 0 var(--brand-edge); color: #fff; display: grid; place-items: center; z-index: 2;
  transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out); animation: node-in .5s var(--ease-spring) .12s backwards; }
.ps-coin::before { content: ""; position: absolute; left: 22px; right: 22px; top: 10px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.28); }
.ps-coin:active { transform: translateY(7px) scale(.97); box-shadow: 0 2px 0 var(--brand-edge); }
.ps-ring { position: absolute; left: 50px; top: 17px; width: 164px; height: 164px; border-radius: 50%; border: 6px solid var(--brand); opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) { .ps-ring { animation: pulse-ring 2.2s var(--ease-out) .6s infinite; } .ps-ring.p2 { animation-delay: 1.7s; } }
.ps-btn { position: absolute; left: 132px; top: 176px; transform: translateX(-50%); min-height: 52px; padding: 0 22px; border-radius: 16px; background: #fff; color: var(--brand-ink); border: 2.5px solid #D6CAFF; box-shadow: 0 5px 0 #D6CAFF;
  font-family: var(--font-display); font-weight: 600; font-size: 20px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; z-index: 2;
  transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out); animation: rise-in .4s var(--ease-out) .3s backwards; }
.ps-btn:active { transform: translateX(-50%) translateY(4px) scale(.97); box-shadow: 0 1px 0 #D6CAFF; }
.ps-pip { left: 214px; top: 0; width: 240px; }
.ps-pip .pip-slot { margin-left: -40px; }
.path-start + .stage-sec .banner { top: 16px; }

/* ---------- home: tapping a node opens a card anchored to it ---------- */
.node-pop { position: absolute; z-index: 9; width: 300px; --np-bg: #fff; --np-edge: var(--edge); --np-line: var(--line); --np-ink: var(--ink);
  transform-origin: var(--ax, 150px) -10px; animation: np-in var(--t-base) var(--ease-spring) backwards; }
.node-pop.out { animation: np-out 120ms var(--ease-in) forwards; pointer-events: none; }
@keyframes np-in { from { opacity: 0; transform: translate3d(0, -6px, 0) scale(.88); } }
@keyframes np-out { to { opacity: 0; transform: scale(.94); } }
.node-pop::before { content: ""; position: absolute; top: -10px; left: calc(var(--ax, 150px) - 12px); width: 24px; height: 24px; border-radius: 5px; background: var(--np-bg); border: 2.5px solid var(--np-line); border-right: 0; border-bottom: 0; transform: rotate(45deg); z-index: 1; }
.np-card { position: relative; background: var(--np-bg); color: var(--np-ink); border: 2.5px solid var(--np-line); border-radius: 22px; padding: 14px 18px 18px; box-shadow: 0 6px 0 var(--np-edge), var(--shadow-pop); }
.np-card .eyebrow { display: flex; align-items: center; gap: 8px; color: var(--sci, var(--brand-ink)); }
.np-card h3 { font-size: 22px; line-height: 1.15; margin: 4px 0 4px; }
.np-card p { font-size: 15px; font-weight: 700; color: var(--ink-2); line-height: 1.4; }
.np-card .np-prog { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-weight: 800; font-size: 14px; }
.np-card .np-prog .bar { flex: 1; height: 12px; }
.np-card .np-stars { display: flex; align-items: center; gap: 2px; margin-top: 8px; font-weight: 800; font-size: 14px; color: var(--sun-ink); }
.np-card .np-stars span { margin-left: 8px; }
.np-actions { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 14px; }
.np-actions .btn { flex: 1; min-height: 54px; }
.np-actions .btn-ghost { flex: 1 0 100%; min-height: 44px; font-size: 18px; }
.np-xp { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; padding: 2px 8px 2px 4px; border-radius: 999px; background: rgba(255,255,255,.2); font-family: var(--font-ui); font-weight: 900; font-size: 14px; }
.node-pop.cur { --np-bg: var(--brand); --np-edge: var(--brand-edge); --np-line: var(--brand); --np-ink: #fff; }
.node-pop.cur .eyebrow, .node-pop.cur p, .node-pop.cur .np-prog { color: var(--on-brand); }
.node-pop.cur .bar { background: rgba(255,255,255,.22); }
.node-pop.cur .bar > i { background: var(--sun); }
.node-pop.done { --np-line: #FFE08A; --np-edge: var(--sun-edge); }
.node-pop.done .eyebrow { color: var(--sun-ink); }
.node-pop.locked .eyebrow { color: var(--sci, var(--ink-3)); }

/* ---------- level intro ---------- */
.intro-screen { background: radial-gradient(720px 520px at 24% 36%, var(--scs, var(--brand-soft)) 0%, rgba(255,247,234,0) 72%), var(--bg); }
.intro-top-facts { margin-left: auto; display: flex; gap: 8px; }
.fact-chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 10px; border-radius: 999px; background: #fff; border: 2px solid var(--line); box-shadow: 0 3px 0 var(--edge); font-weight: 800; font-size: 15px; color: var(--ink-2); white-space: nowrap; }
.fact-chip .ic { color: var(--sci, var(--brand)); }
.content.intro { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(340px, 480px) minmax(430px, 540px); gap: 48px; align-items: center; justify-content: center; padding: 6px 0 4px; }
.intro-hero { display: flex; align-items: center; gap: 24px; }
.intro-coin { position: relative; flex: none; width: 136px; height: 124px; border-radius: 50%; background: var(--sc, var(--brand)); box-shadow: 0 10px 0 var(--sce, var(--brand-edge)), 0 24px 30px -14px rgba(42,35,70,.45);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 66px; color: #fff; text-shadow: 0 3px 0 var(--sce, var(--brand-edge)); }
.intro-coin::before { content: ""; position: absolute; left: 24px; right: 24px; top: 11px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.3); }
.intro-coin::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; border: 4px dashed rgba(255,255,255,.35); }
.intro-coin span { position: relative; z-index: 1; }
.intro-titles { min-width: 0; }
.intro-titles .eyebrow { color: var(--sci, var(--brand-ink)); }
.intro-titles h1 { font-size: 40px; line-height: 1.06; margin-top: 4px; font-weight: 700; }
.intro-concept { margin-top: 22px; font-size: 19px; line-height: 1.5; font-weight: 600; color: var(--ink); max-width: 480px; }
.intro-main .tips { margin-top: 18px; }
.intro-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.intro-skill { padding: 16px 20px 16px; }
.skill-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.skill-head h3 { font-size: 20px; }
.skill-head small { font-weight: 800; font-size: 14px; color: var(--ink-3); white-space: nowrap; }
.mini-keys { margin-top: 10px; }
.mini-keys svg { display: block; width: 100%; height: auto; overflow: visible; }
.intro-hands { margin-top: 10px; font-size: 16px; line-height: 1.4; color: var(--ink-2); font-weight: 700; }
.intro-coach { display: flex; align-items: center; gap: 14px; }
.intro-coach .pip-slot { flex: none; }
.intro-coach .bubble { flex: 1; font-size: 19px; }
.intro-actions { display: flex; gap: 12px; }
.intro-actions #btn-intro-go { flex: 1; }
.mk-f { transform-box: fill-box; transform-origin: center; }
.mk-hand { transform-box: fill-box; transform-origin: 50% 100%; }
@media (prefers-reduced-motion: no-preference) {
  .screen.active .mk-f { animation: mk-pop .38s var(--ease-spring) backwards; animation-delay: calc(480ms + var(--k, 0) * 70ms); }
  .screen.active .mk-hand { animation: mk-pop .38s var(--ease-spring) backwards; animation-delay: calc(400ms + var(--k, 0) * 70ms); }
  .screen.active .intro-coin { animation: coin-stamp .6s var(--ease-spring) .06s backwards; }
}
@keyframes mk-pop { from { opacity: 0; transform: scale(.3); } }
@keyframes coin-stamp { 0% { opacity: 0; transform: translateY(-24px) scale(.6) rotate(-10deg); } 70% { opacity: 1; transform: translateY(0) scale(1.08) rotate(2deg); } 100% { transform: none; } }

/* ---------- results: radial score gauge with the stars on the arc ---------- */
.results { grid-template-columns: minmax(320px, 420px) minmax(460px, 640px); gap: 44px; }
.gauge { position: relative; width: 300px; height: 282px; flex: none; }
.gauge > svg { position: absolute; left: 0; top: 0; width: 100%; height: auto; overflow: visible; }
.res-left { justify-content: center; }
.gauge .g-track, .gauge .g-fill { fill: none; stroke-width: 24; stroke-linecap: round; }
.gauge .g-track { stroke: #F1E6D4; }
.gauge .g-track.edge { stroke: #E6D6BC; }
.gauge .g-fill { stroke: var(--brand); }
.gauge .g-fill.edge { stroke: var(--brand-edge); }
.gauge .g-shine { fill: none; stroke: rgba(255,255,255,.35); stroke-width: 5; stroke-linecap: round; }
.g-star { position: absolute; width: 17%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: #fff; border: 2.5px solid var(--line); box-shadow: 0 4px 0 var(--edge); display: grid; place-items: center; z-index: 2; }
.g-star .ic { width: 70%; height: 70%; }
.g-star.lit { background: var(--sun-soft); border-color: var(--sun); box-shadow: 0 4px 0 var(--sun-edge), 0 0 0 5px rgba(255,194,61,.22); }
@keyframes star-pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(-15deg); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(0); } 100% { transform: translate(-50%, -50%); } }
.g-center { position: absolute; left: 0; right: 0; top: 26%; display: flex; flex-direction: column; align-items: center; }
.big-score { font-family: var(--font-display); font-weight: 700; font-size: 92px; line-height: .95; letter-spacing: -0.02em; display: flex; align-items: baseline; color: var(--ink); }
.big-score #res-score { display: inline-flex; }
.big-score.wide { font-size: 76px; }
.big-score.wide small { font-size: 38px; }
.big-score #res-score i { display: inline-block; width: .62em; text-align: center; font-style: normal; }
.big-score small { font-size: 44px; color: var(--ink); margin-left: 2px; }
.pct-label { margin-top: 4px; font-weight: 800; font-size: 15px; color: var(--ink-2); letter-spacing: .1em; text-transform: uppercase; }
.best-tag { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); z-index: 3; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px 0 10px; border-radius: 999px; background: var(--sun); color: var(--ink); box-shadow: 0 4px 0 var(--sun-edge);
  font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.res-coach { display: flex; align-items: flex-end; gap: 6px; width: 100%; min-height: 186px; margin-top: 8px; }
.res-coach .res-pip { flex: none; width: 150px; }
.res-coach .bubble { flex: 1; margin-bottom: 64px; font-size: 19px; }
.res-coach .bubble.tail-left::after { top: auto; bottom: 22px; margin-top: 0; }
.res-tips { min-height: 0; }

/* ---------- practice: exercise cards ---------- */
.practice { display: grid; grid-template-columns: minmax(0, 1fr) 196px; gap: 24px; align-items: start; max-width: 1080px; }
.pr-label { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.pr-label .muted { font-family: var(--font-ui); font-weight: 700; font-size: 15px; }
.pr-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kind { position: relative; display: flex; flex-direction: column; align-items: flex-start; text-align: left; min-height: 0; padding: 14px 16px 14px;
  border-radius: 22px; background: #fff; border: 2.5px solid var(--line); box-shadow: 0 5px 0 var(--edge);
  transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out), background var(--t-fast), border-color var(--t-fast); }
.kind:active { transform: translateY(4px) scale(.97); box-shadow: 0 1px 0 var(--edge); }
.kind .k-ic { width: 52px; height: 52px; margin-bottom: 10px; border-radius: 16px; background: var(--k); box-shadow: inset 0 -4px 0 var(--ke); display: grid; place-items: center; color: #fff; }
.kind .k-ic svg { display: block; }
.kind b { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.1; }
.kind small { font-weight: 700; font-size: 14px; color: var(--ink-2); line-height: 1.3; margin-top: 3px; }
.pr-hint { min-height: 1.4em; margin-top: 6px; font-weight: 700; font-size: 14px; color: var(--ink-3); }
.kind .k-check { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center;
  transform: scale(0); opacity: 0; transition: transform var(--t-base) var(--ease-spring), opacity var(--t-fast); }
.kind.on { background: var(--brand-soft); border-color: var(--brand); box-shadow: 0 5px 0 var(--brand-hi); }
.kind.on:active { box-shadow: 0 1px 0 var(--brand-hi); }
.kind.on .k-check { transform: none; opacity: 1; }
.kind.just-on .k-ic { animation: sel-pop var(--t-base) var(--ease-spring); }
.pr-card { margin-top: 20px; padding: 18px 22px 20px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 6px 28px; align-items: center; }
.pr-card .field { padding: 4px 0; }
.pr-lv { display: inline-grid; place-items: center; min-width: 34px; height: 30px; padding: 0 8px; border-radius: 50%; background: var(--sc, var(--brand)); color: #fff; box-shadow: 0 3px 0 var(--sce, var(--brand-edge)); font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.pr-go { grid-column: 2; grid-row: 2; }
.pr-go .btn { width: 100%; }
.seg-slide { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 5px; border-radius: 18px; background: #F1E6D4; }
.seg-slide button { position: relative; z-index: 1; min-height: 50px; border-radius: 13px; font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--ink-2); transition: color var(--t-fast); line-height: 1.1; }
.seg-slide button small { display: block; font-family: var(--font-ui); font-weight: 800; font-size: 12px; color: inherit; opacity: .8; }
.seg-slide button.on { color: #fff; }
.seg-slide .thumb { position: absolute; left: 5px; top: 5px; bottom: 5px; width: calc(50% - 5px); border-radius: 13px; background: var(--brand); box-shadow: 0 4px 0 var(--brand-edge); transition: transform var(--t-base) var(--ease-spring); }
.seg-slide[data-i="1"] .thumb { transform: translateX(100%); }
.seg-slide.locked { opacity: .6; pointer-events: none; }
.practice-pip { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 64px; }
.practice-pip .bubble { font-size: 17px; }

/* ---------- map / progress / settings extras ---------- */
.map-stage h3 .dot { color: #fff; }
.lvl.locked { background: #FBF5EA; }
.lvl.done .lvl-ic .ic { color: var(--sun-edge); }
.chart-card { position: relative; }

/* ---------- responsive for the new pieces ---------- */
@media (max-width: 1120px) {
  .content.intro { grid-template-columns: minmax(320px, 440px) minmax(400px, 500px); gap: 32px; }
  .intro-titles h1 { font-size: 34px; }
  .intro-coin { width: 116px; height: 106px; font-size: 56px; }
  .intro-concept { font-size: 18px; }
  .intro-top-facts .fact-chip:nth-child(3) { display: none; }
  .kind { padding: 12px 14px; }
  .kind b { font-size: 19px; }
  .practice { grid-template-columns: minmax(0, 1fr) 150px; }
  .practice-pip .pip { width: 130px; height: 130px; }
  .pr-card { grid-template-columns: minmax(0, 1fr) 250px; }
  .results { grid-template-columns: minmax(300px, 380px) minmax(440px, 600px); gap: 28px; }
}
@media (max-width: 1000px) {
  .content.intro { grid-template-columns: 1fr; align-content: start; gap: 22px; }
  .intro-coach .pip-slot { display: none; }
  .intro-coach .bubble::after { display: none; }
  .intro-top-facts { display: none; }
  .pr-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pr-card { grid-template-columns: 1fr; }
  .pr-go { grid-column: 1; grid-row: auto; }
  .res-coach { min-height: 0; }
  .res-coach .res-pip { display: none; }
  .res-coach .bubble { margin-bottom: 0; }
}
@media (max-height: 740px) {
  .gauge { width: 250px; height: 235px; }
  .big-score { font-size: 76px; }
  .big-score small { font-size: 36px; }
  .res-coach { min-height: 160px; }
  .res-coach .res-pip { width: 130px; }
  .res-coach .res-pip .pip { width: 130px; height: 130px; }
  .intro-coin { width: 110px; height: 100px; font-size: 52px; }
  .intro-titles h1 { font-size: 34px; }
  .intro-concept { margin-top: 16px; font-size: 17px; }
}
.res-level .bar.grow > i { width: 100%; transform-origin: left center; transition: transform .9s var(--ease-out) .55s; }
.res-level .mastery .was { font-weight: 800; font-size: 15px; color: var(--ink-3); }

/* ---------- lessons: plan progress, Pip's lesson tips, the bar loop ---------- */
/* The level's lesson plan as segments; the last one (the level check) is a sun-coloured flag. */
.plan-segs { gap: 4px; }
.plan-segs i { height: 12px; }
.plan-segs i.check { flex: 1.6; background: var(--sun-soft); box-shadow: inset 0 0 0 2.5px var(--sun); }
.plan-segs i.check.cur { background: var(--sun); box-shadow: inset 0 -3px 0 var(--sun-edge), 0 0 0 3px var(--sun-soft); }
.plan-prog { margin-bottom: 12px; }
.pp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.pp-n { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--ink); }
.pp-next { font-size: 15px; font-weight: 800; color: var(--ink-2); text-align: right; }
.pp-next b { color: var(--brand-ink); }
.check-miss { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px 14px; border-radius: 16px; background: var(--sun-soft); border: 2.5px solid var(--sun); color: var(--sun-ink); font-size: 16px; line-height: 1.35; }
.check-miss b { color: var(--ink); }
.check-miss .ic { flex: none; }
/* on the purple hero card */
.hero .prog.plan { gap: 10px; }
.hero .prog.plan > span { font-family: var(--font-display); font-weight: 600; font-size: 17px; min-width: 42px; }
.hero .plan-segs { flex: 1; }
.hero .plan-segs i { background: rgba(255,255,255,.22); box-shadow: none; }
.hero .plan-segs i.done { background: var(--sun); box-shadow: inset 0 -3px 0 var(--sun-edge); }
.hero .plan-segs i.cur { background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.hero .plan-segs i.check { background: transparent; box-shadow: inset 0 0 0 2.5px var(--sun); }
.hero .plan-segs i.check.cur { background: var(--sun); }
.hero-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; font-weight: 800; color: var(--on-brand); opacity: .9; }
.np-card .np-prog .plan-segs { flex: 1; }
.node-pop.cur .plan-segs i { background: rgba(255,255,255,.25); box-shadow: none; }
.node-pop.cur .plan-segs i.done { background: var(--sun); }
.node-pop.cur .plan-segs i.cur { background: #fff; }
.node-pop.cur .plan-segs i.check { background: transparent; box-shadow: inset 0 0 0 2px var(--sun); }

/* "Get ready": Pip's tip for this lesson step */
.prep-tip { margin-top: 8px; padding: 7px 12px; border-radius: 14px; background: var(--sun-soft); color: var(--ink-2); font-size: 15px; font-weight: 700; line-height: 1.35; }
.prep-tip b { color: var(--sun-ink); font-weight: 900; }

/* Pip's card over the falling notes: a lesson tip, "let's try bar 3 again", or the offer. */
/* (left of the count-in ring, which sits in the middle of the lane) */
.coach-card { position: absolute; left: 20px; z-index: 6; width: min(460px, calc(50% - 120px));
  display: flex; align-items: center; gap: 14px; padding: 10px 18px 10px 10px;
  background: var(--surface); border: 2.5px solid var(--sun); border-radius: var(--r-xl); box-shadow: 0 6px 0 var(--sun-edge), var(--shadow-pop); pointer-events: none; }
.coach-card.show { animation: cc-in var(--t-slow) var(--ease-spring) both; }
.coach-card.leave { animation: cc-out .2s var(--ease-in) both; }
.coach-card.offer { left: 50%; transform: translateX(-50%); width: min(760px, calc(100% - 40px)); border-color: var(--brand-hi); box-shadow: 0 6px 0 var(--brand-hi), var(--shadow-pop); pointer-events: auto; flex-wrap: wrap; }
.coach-card.offer.show { animation: prep-in var(--t-slow) var(--ease-spring) both; }
.coach-card.offer.leave { animation: prep-out .2s var(--ease-in) both; }
@keyframes cc-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes cc-out { to { opacity: 0; transform: translateY(16px) scale(.97); } }
.cc-pip { flex: none; width: 70px; display: flex; justify-content: center; }
.cc-pip svg { display: block; }
.cc-body { flex: 1; min-width: 0; }
.coach-card .eyebrow { color: var(--sun-ink); }
.coach-card.offer .eyebrow { color: var(--brand-ink); }
.cc-title { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.15; margin: 1px 0 2px; }
.cc-text { font-size: 15px; line-height: 1.35; color: var(--ink-2); font-weight: 700; }
.cc-actions { display: flex; gap: 10px; flex-wrap: wrap; width: 100%; padding-left: 84px; }
.cc-actions .btn { height: 52px; font-size: 17px; }
@media (prefers-reduced-motion: reduce) { .coach-card.show, .coach-card.leave { animation: none; } }
.bar-prog.looping { border-color: var(--sun); background: var(--sun-soft); color: var(--sun-ink); }
.bar-prog.looping .bar > i { background: var(--sun); }

/* Results: the bars that were played again */
.res-loops { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.res-loops:empty { display: none; }
.rl-hd { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; font-size: 15px; color: var(--ink-2); margin-right: 2px; }
.loop-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 8px; border-radius: 999px; background: var(--mint-soft); border: 2px solid var(--mint); color: var(--mint-ink); font-weight: 800; font-size: 15px; }
.loop-chip b { color: var(--ink); font-weight: 900; }
.loop-chip.open { background: var(--sun-soft); border-color: var(--sun); color: var(--sun-ink); }

/* ---------- key lessons: hand position, scale fingering up and down, chords ---------- */
.content.keylesson { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 0 4px; }
.key-top { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.key-head { flex: none; display: flex; align-items: center; gap: 18px; }
.key-head .intro-coin { width: 80px; height: 74px; font-size: 38px; box-shadow: 0 6px 0 var(--sce, var(--brand-edge)), 0 14px 20px -12px rgba(42,35,70,.45); }
.key-head .intro-coin::before { left: 14px; right: 14px; top: 7px; height: 12px; }
.key-head .intro-coin::after { inset: 7px; border-width: 3px; }
.key-head .intro-titles h1 { font-size: 34px; margin-top: 1px; }
.key-sub { margin-top: 2px; font-weight: 800; font-size: 16px; color: var(--ink-2); }
.key-tabs { flex: 1; max-width: 640px; display: flex; gap: 8px; }
.key-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 10px; border-radius: 16px; background: #fff; border: 2.5px solid var(--line); box-shadow: 0 4px 0 var(--edge);
  font-family: var(--font-display); font-weight: 600; font-size: 17px; line-height: 1.1; color: var(--ink-2); transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out), background var(--t-fast), border-color var(--t-fast); }
.key-tab:active { transform: translateY(3px) scale(.98); box-shadow: 0 1px 0 var(--edge); }
.key-tab b { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-size: 15px; }
.key-tab.on { background: var(--brand-soft); border-color: var(--brand); box-shadow: 0 4px 0 var(--brand-hi); color: var(--brand-ink); }
.key-tab.on b { background: var(--brand); color: #fff; }
.key-card { padding: 10px 18px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1 0 auto; justify-content: center; }
.key-toolbar { min-height: 44px; align-items: center; }
.key-toolbar .chip { min-height: 42px; padding: 0 16px; font-size: 16px; }
.key-toolbar .chip .dot { width: 12px; height: 12px; border-radius: 50%; }
.key-toolbar .chip .ic { width: 16px; height: 16px; }
.key-sep { flex: 1; }
.key-hint { font-weight: 700; font-size: 16px; color: var(--ink-2); }
.key-board { display: flex; justify-content: center; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.key-strip { margin: 0; flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.key-strip.wide { flex: 1 1 100%; }
.key-strip figcaption { align-self: flex-start; background: var(--c); color: #fff; font-weight: 900; font-size: 14px; padding: 3px 12px; border-radius: 999px; }
svg.kb { display: block; width: 100%; height: auto; max-height: 230px; overflow: visible; }
.key-strip.wide svg.kb { height: 292px; }
.key-chord { margin: 0; flex: 1 1 190px; max-width: 250px; padding: 8px 10px 10px; text-align: center; background: #FFFCF6; border: 2px solid var(--line); border-radius: 18px; transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast); }
.key-chord svg.kb { height: auto; max-height: 170px; }
.key-chord figcaption { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.1; margin-bottom: 4px; }
.key-chord figcaption b { color: var(--brand); margin-right: 6px; font-family: var(--font-ui); font-weight: 900; letter-spacing: .03em; }
.key-chord small { display: block; margin-top: 4px; font-weight: 800; font-size: 14px; color: var(--ink-2); }
.key-chord.on { background: var(--sun-soft); border-color: var(--sun); box-shadow: 0 0 0 4px rgba(255,194,61,.35); }
.kb-note { transform-box: fill-box; transform-origin: center; transition: transform .16s var(--ease-spring); }
.kb-note.on { transform: scale(1.32); }
.kb-k { transition: fill .12s; }
.kb-k.on { fill: #FFE3A0; }
.kb-k.kb-b.on { fill: var(--sun-edge); }
.key-seq { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 12px; }
.seq-run { display: inline-flex; gap: 6px; }
.seq-f { display: inline-flex; flex-direction: column; align-items: center; min-width: 44px; padding: 4px 6px 3px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-ink); transition: transform .15s var(--ease-spring), background .12s; }
.seq-f b { font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1; }
.seq-f i { font-style: normal; font-weight: 800; font-size: 13px; color: var(--ink-2); }
.seq-f.on { background: var(--sun); color: var(--ink); transform: scale(1.12); }
.seq-move { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px 0 8px; border-radius: 999px; background: var(--sun-soft); border: 2px solid var(--sun); color: var(--sun-ink); font-weight: 900; font-size: 14px; white-space: nowrap; }
.seq-move .ic { width: 16px; height: 16px; }
.key-words { margin: 0; text-align: center; font-size: 16px; line-height: 1.4; font-weight: 700; color: var(--ink); }
.key-note { color: var(--ink-3); font-size: 15px; }
.key-foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.key-foot .intro-coach { flex: 1; min-width: 0; }
.key-foot .intro-coach .bubble { font-size: 16px; line-height: 1.35; padding: 10px 16px; }
.key-actions { flex: none; display: flex; align-items: center; gap: 12px; }
.key-actions .btn-lg { min-height: 58px; padding: 0 22px; font-size: 20px; }
.key-actions .btn-ghost { font-size: 17px; }
@media (prefers-reduced-motion: no-preference) {
  .screen.active .kb-note { animation: mk-pop .38s var(--ease-spring) backwards; animation-delay: calc(200ms + var(--k, 0) * 55ms); }
}
/* Practice: pick any key to learn */
.pr-keys { margin-top: 20px; padding: 18px 22px 20px; }
.key-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.key-grid h3 { grid-column: 1 / -1; margin: 6px 0 -2px; font-size: 15px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.key-pick { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 64px; padding: 8px 6px 7px; border-radius: 18px; background: #fff; border: 2.5px solid var(--line); box-shadow: 0 4px 0 var(--edge);
  font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.1; color: var(--ink); transition: transform var(--t-press) var(--ease-out), box-shadow var(--t-press) var(--ease-out); }
.key-pick:active { transform: translateY(3px) scale(.97); box-shadow: 0 1px 0 var(--edge); }
.key-pick small { font-family: var(--font-ui); font-weight: 800; font-size: 12px; color: var(--ink-3); }
.key-pick.minor { font-size: 20px; background: #FBF7FF; }
.key-pick .kp-check { position: absolute; top: -7px; right: -5px; width: 22px; height: 22px; border-radius: 50%; background: var(--mint); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 900; font-family: var(--font-ui); box-shadow: 0 2px 0 var(--mint-edge); }
.key-pick.now { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 4px 0 var(--brand-hi); }
@media (max-width: 1120px) {
  .key-tab { font-size: 16px; }
  .key-actions .btn-lg { padding: 0 18px; font-size: 19px; }
}
@media (max-width: 1000px) {
  .key-top { flex-direction: column; align-items: stretch; gap: 12px; }
  .key-tabs { max-width: none; }
  .key-foot { flex-direction: column; align-items: stretch; }
  .key-foot .intro-coach .pip-slot { display: none; }
  .key-foot .intro-coach .bubble::after { display: none; }
  .key-actions { justify-content: flex-end; }
  .key-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-height: 780px) {
  .key-head .intro-coin { width: 64px; height: 60px; font-size: 30px; }
  .key-head .intro-titles h1 { font-size: 28px; }
  .key-sub { font-size: 14px; }
  .key-strip.wide svg.kb { height: 204px; }
  svg.kb { max-height: 160px; }
  .key-chord svg.kb { max-height: 130px; }
  .key-tab { min-height: 46px; }
  .key-foot .intro-coach .pip-slot { display: none; }
}
