/* Quiz styles (owner: quiz): lesson player, path, daily game. Built on site/styles/tokens.css only. */

/* ---------- lesson frame ---------- */
.lesson { max-width: var(--app); margin: 0 auto; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.lesson h1, .lesson h2 { margin: 0; }
.lesson h2 { font-size: clamp(22px, 5.5vw, 27px); }
.lesson h2:focus { outline: none; }
.lesson-top { display: flex; align-items: center; gap: 12px; }
.lesson-close { font-size: 28px; line-height: 1; color: var(--muted); text-decoration: none; padding: 2px 8px; border-radius: 8px; }
.lesson-bar { flex: 1; height: 14px; border-radius: 99px; background: var(--line); overflow: hidden; }
.lesson-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .35s ease; }
.lesson-xp { font-family: var(--mono); color: var(--xp); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lesson-xp .combo { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 1px 7px; font-size: 13px; }
.lesson-zone { display: flex; flex-direction: column; gap: 14px; }
.replay-row { display: flex; align-items: center; gap: 12px; }
.lesson-visual { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; display: grid; place-items: center; }
.sound-note { margin: 0; }

/* ---------- answers ---------- */
.lesson-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lesson-opts--list { grid-template-columns: 1fr; }
.lesson-opts--ladder { grid-template-columns: 1fr; gap: 8px; }
.lesson-opts--letters { grid-template-columns: repeat(7, 1fr); gap: 6px; }
.lesson-opts--letters .opt { padding: 16px 0; font-size: 21px; text-align: center; }
.opt { position: relative; background: var(--surface); color: var(--ink); border: 2px solid var(--line); border-bottom-width: 5px; border-radius: 16px; padding: 16px 14px; font-weight: 800; font-family: var(--display); font-size: 18px; text-align: left; display: flex; align-items: center; gap: 10px; min-height: 56px; }
.opt:hover:not(:disabled) { border-color: var(--brand); }
.opt:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 3px; }
.opt__n { font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; flex: none; }
.opt__n:empty { display: none; }
.opt.ok { border-color: var(--right); background: var(--right-soft); }
.opt.no { border-color: var(--wrong); background: var(--wrong-soft); }
.opt.right { border-color: var(--right); }
.opt.right::after { content: "✓"; margin-left: auto; color: var(--right); }
.opt.no::after { content: "✗"; margin-left: auto; color: var(--wrong); }
.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt:disabled { cursor: default; }
.opt svg.rhythm { width: 100%; max-width: 260px; height: auto; }
.lesson-opts--ladder .opt { justify-content: flex-start; padding: 12px 14px; min-height: 48px; }
.listen-row { display: flex; flex-wrap: wrap; gap: 8px; }
.listen-row .play { padding: 6px 14px 6px 6px; font-size: 15px; }
.listen-row .play__icon { width: 30px; height: 30px; }

/* ---------- feedback sheet ---------- */
.sheet { border-radius: var(--radius-l); padding: 18px; display: flex; flex-direction: column; gap: 10px; position: sticky; bottom: 12px; box-shadow: var(--shadow); }
.sheet.rise { animation: rise .25s ease; }
.sheet h3 { margin: 0; font-family: var(--display); font-size: 21px; }
.sheet p { margin: 0; }
.sheet.ok { background: var(--right-soft); } .sheet.ok h3 { color: var(--right); } .sheet.ok h3::before { content: "✓ "; }
.sheet.no { background: var(--wrong-soft); } .sheet.no h3 { color: var(--wrong); } .sheet.no h3::before { content: "✗ "; }
.sheet.neutral { background: var(--brand-soft); } .sheet.neutral h3 { color: var(--brand-press); }
.sheet-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sheet-actions .btn--block { flex: 1; width: auto; min-width: 140px; }
@keyframes rise { from { transform: translateY(14px); opacity: .3; } to { transform: none; opacity: 1; } }

/* ---------- keyboard ---------- */
.piano { position: relative; height: 150px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.piano__whites { display: flex; height: 100%; border: 2px solid var(--key-black); border-radius: 12px; overflow: hidden; background: var(--key-black); gap: 2px; }
.key { border: 0; padding: 0; }
.key--white { background: var(--key-white); border-radius: 0 0 8px 8px; position: relative; flex: none; }
.key--white span { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-weight: 800; font-family: var(--display); font-size: 13px; color: var(--key-white-ink); display: flex; flex-direction: column; gap: 2px; align-items: center; }
.key--white span i { font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--key-black); }
.key--white.is-home { background: var(--key-white-soft); }
.key--black { position: absolute; top: 2px; height: 60%; background: var(--key-black); border-radius: 0 0 6px 6px; z-index: 1; border: 2px solid var(--key-black); }
.key--white.is-on, .key--white:active:not(:disabled) { background: color-mix(in srgb, var(--accent) 35%, var(--key-white)); }
.key--black.is-on, .key--black:active:not(:disabled) { background: var(--accent-press); }
.key:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; z-index: 2; }
.key:disabled { cursor: default; }
.tap-slots { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; min-height: 44px; }
.slot { min-width: 44px; height: 44px; border-radius: 12px; border: 2px dashed var(--line); display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 17px; background: var(--surface); }
.slot.is-given { border-style: solid; color: var(--muted); }
.tap-slots.ok .slot { border-color: var(--right); } .tap-slots.no .slot { border-color: var(--wrong); }
.tap-actions { display: flex; gap: 10px; align-items: center; }
.tap-actions .btn--block { flex: 1; }

/* ---------- slider, mic, rhythm tap ---------- */
.slider { display: flex; flex-direction: column; gap: 8px; font-weight: 700; }
.slider input { width: 100%; accent-color: var(--brand); height: 36px; }
.mic-card p { margin: 0 0 10px; }
.tap-pad { width: 100%; height: 160px; border-radius: var(--radius-l); border: 3px solid var(--brand); background: var(--brand-soft); font-family: var(--display); font-size: 28px; font-weight: 900; color: var(--brand-press); touch-action: manipulation; }
.tap-pad.is-on { background: var(--brand); color: var(--brand-ink); }
.tap-pad:disabled { opacity: .5; }

/* ---------- notation ---------- */
.staff { width: 100%; max-width: 320px; height: auto; color: var(--ink); }
.st-line, .st-stem, .rh-line, .rh-stem { stroke: currentColor; stroke-width: 1.3; }
.st-stem, .rh-stem { stroke-width: 1.6; }
.st-head, .rh-fill { fill: currentColor; }
.rh-hollow { fill: none; stroke: currentColor; stroke-width: 1.8; }
.rh-rest, .rh-flag { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.st-clef { font-size: 62px; fill: currentColor; font-family: "Bravura", "Noto Music", "Apple Symbols", "Segoe UI Symbol", serif; }
.st-clef--bass { font-size: 40px; }
.st-acc { font-size: 18px; fill: currentColor; }
svg.rhythm { color: var(--ink); width: 100%; max-width: 280px; height: auto; }

/* ---------- intro card ---------- */
.intro-text { font-size: 18px; margin: 0; }
.intro-list { display: flex; flex-direction: column; gap: 10px; }
.intro-item { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.intro-item small { color: var(--muted); }
.intro-item .staff { max-width: 160px; }

/* ---------- summary ---------- */
.stars { font-size: 34px; color: var(--accent); margin: 0; letter-spacing: 4px; }
.stars span { color: var(--line); }
.level { display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.level__row { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.level__row span { color: var(--muted); font-family: var(--mono); }

/* ---------- path ---------- */
.unit { margin-top: 36px; }
.unit h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.unit__n { font-family: var(--mono); font-size: 15px; background: var(--brand); color: var(--brand-ink); width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; flex: none; }
.unit__goal { color: var(--muted); }
.unit__state { font-weight: 700; color: var(--brand-press); }
.unit.is-locked .unit__n { background: var(--line); color: var(--muted); }
.ladder li { padding: 0; }
.ladder li > a { display: flex; gap: 14px; align-items: center; padding: 14px 16px; width: 100%; border-radius: inherit; }
.ladder li > a:hover { background: var(--surface-2); }
.ladder__stars { margin-left: auto; color: var(--accent); white-space: nowrap; letter-spacing: 1px; }
.ladder li.checkpoint { border-style: dashed; }
.ladder li.checkpoint .n { background: var(--accent); color: var(--accent-ink); }
.ladder li.checkpoint.done .n { background: var(--right); color: var(--surface); }
.path-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 4px; }
.page .level { margin-top: 12px; }

/* ---------- daily ---------- */
.daily { display: flex; flex-direction: column; gap: 14px; }
.daily-head { display: flex; flex-direction: column; gap: 10px; }
.daily-modes { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { border: 2px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 14px; font-weight: 700; font-size: 14px; }
.chip-btn[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-press); }
.chip-btn:disabled { opacity: .6; cursor: default; }
.daily-guesses { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.daily-guesses li { display: flex; gap: 10px; align-items: baseline; background: var(--surface-2); border-radius: 10px; padding: 8px 12px; font-family: var(--display); font-weight: 800; }
.daily-guesses li span { font-family: var(--body); font-weight: 500; color: var(--muted); font-size: 15px; }
.daily-guesses li.ok { background: var(--right-soft); } .daily-guesses li.ok span { color: var(--right); }
.daily-left { margin: 0; font-weight: 700; }
.share-grid { font-family: var(--mono); background: var(--surface); border-radius: 10px; padding: 10px 12px; margin: 0; white-space: pre-wrap; font-size: 15px; }

@media (max-width: 380px) {
  .lesson-opts { gap: 8px; }
  .opt { font-size: 16px; padding: 14px 10px; }
  .lesson-opts--letters { gap: 4px; }
  .piano { height: 130px; }
}

@media (prefers-reduced-motion: reduce) {
  .lesson-bar i { transition: none; }
  .sheet.rise { animation: none; }
  .play.is-playing .play__icon { animation: none; }
  .opt:active:not(:disabled) { transform: none; }
}
.path-actions [hidden], .lesson [hidden] { display: none; }

/* ---------- embeddable staff-read drill (SEO pages) ---------- */
.drill { display: flex; flex-direction: column; gap: 12px; max-width: var(--app); }
.drill__top { display: flex; justify-content: space-between; align-items: center; }
.drill__score { font-size: 19px; }
@media (hover: none) { .replay-row .notice { display: none; } }
.lesson-visual .staff { max-height: 190px; width: auto; max-width: 100%; }
.lesson-opts--letters .opt { justify-content: center; }
.lesson-visual .staff.staff--grand { max-height: 280px; }
.lesson-opts--letters .opt::after { display: none; }

/* Onboarding (/learn/start/) and placement test (/learn/placement/) */
.onboard-title { font-size: clamp(26px, 6vw, 32px); }
.onboard-title:focus, .placement h1:focus { outline: none; }
.onboard-nav { display: flex; flex-direction: column; gap: 10px; }
.onboard-nav__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.onboard-tips { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 8px; }
.onboard-actions { display: flex; flex-direction: column; gap: 10px; }
.linklike { background: none; border: 0; padding: 6px 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; margin-left: auto; }
/* The placement test never shows right or wrong: a picked answer just looks selected. */
.placement .opt.ok, .placement .opt.no, .placement .opt.right { border-color: var(--brand); background: var(--brand-soft); }
.placement .opt.right:not(.ok):not(.no) { border-color: var(--line); background: var(--surface); }
.placement .opt.right::after, .placement .opt.no::after { content: none; }
.placement .tap-slots.ok .slot, .placement .tap-slots.no .slot { border-color: var(--brand); }

/* "For you" card and focus units on the path */
.foryou { margin: 18px 0 0; display: flex; flex-direction: column; gap: 8px; }
.foryou p, .foryou ul { margin: 0; }
.foryou ul { padding-left: 1.1em; display: flex; flex-direction: column; gap: 6px; }
.foryou .path-actions { margin: 4px 0 0; }
.unit.is-focus h2::after { content: "For you"; font-family: var(--body); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-ink); background: var(--brand); border-radius: 99px; padding: 2px 9px; }
