/* ============================================================
   Nashville Numbers — Sun City Church
   Creative direction: Mel
   Palette: master brand (charcoal / orange / warm white)
   with a small dose of sun-amber for celebration.
   ============================================================ */

/* ---------- Gotham ---------- */
/* ---------- tokens ---------- */
:root {
  --paper: #FFFBF6;
  --card: #FFFFFF;
  --ink: #3A3A3C;
  --ink-soft: #6E6E74;
  --line: #F0E7DC;
  --orange: #F25832;
  --orange-deep: #D8431F;
  --orange-tint: #FEEFE8;
  --amber: #FFB547;
  --amber-tint: #FFF4DF;
  --gray: #B7B7BE;
  --good: #1F9D61;
  --good-tint: #E7F6EE;
  --bad: #D8504A;
  --bad-tint: #FBEDEC;
  --radius: 22px;
  --shadow: 0 12px 34px rgba(58, 58, 60, 0.07);
}

/* ---------- base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  background-image: radial-gradient(1100px 480px at 50% -140px, #FFF0DC, rgba(255, 240, 220, 0));
  background-repeat: no-repeat;
  min-height: 100vh;
  min-height: 100dvh;           /* iOS Safari: 100vh ignores the toolbar */
  line-height: 1.5;
  /* Phone-first: no double-tap zoom (piano taps come in fast), and no blue
     flash on every tap — we draw our own pressed states. */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
button:focus-visible, .pkey:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--amber-tint); }

#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  /* viewport-fit=cover means we own the notch and home-indicator gutters */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ---------- shared bits ---------- */
.eyebrow {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 10px;
}
.enter { animation: fadeUp 0.35s ease-out both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 28px;
  border-radius: 999px;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn.primary {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 6px 18px rgba(242, 88, 50, 0.3);
}
.btn.primary:hover { background: var(--orange-deep); transform: translateY(-1px); }
.btn.primary:active { transform: scale(0.97); }
.btn.ghost { background: transparent; border: 2px solid #E7DFD3; color: var(--ink); }
.btn.ghost:hover { border-color: var(--gray); }
.btn.ghost:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.35; cursor: default; box-shadow: none; }
.btn[disabled]:hover { transform: none; background: var(--orange); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ============================================================
   HOME
   ============================================================ */
.home { width: 100%; max-width: 680px; margin: 0 auto; padding: 48px 20px 20px; }

.hero { text-align: center; margin-bottom: 42px; }
.hero-sun { width: 96px; height: 96px; margin-bottom: 18px; }
.rays { transform-box: fill-box; transform-origin: center; animation: spin 80s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero h1 {
  font-weight: 900;
  font-size: clamp(40px, 9vw, 58px);
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin: 4px 0 12px;
}
.hero-tag { font-size: 17px; color: var(--ink-soft); font-weight: 500; }

.hero-progress { margin-top: 26px; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.hp-bar { width: min(320px, 82%); height: 10px; border-radius: 999px; background: #F3EADD; overflow: hidden; }
.hp-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), var(--amber));
  transition: width 0.5s ease;
}
.hp-text { font-size: 13px; font-weight: 500; color: var(--ink-soft); }

/* lesson path */
.path { list-style: none; display: flex; flex-direction: column; gap: 14px; position: relative; }
.path::before {
  content: "";
  position: absolute;
  left: 23px;
  top: 24px;
  bottom: 24px;
  width: 3px;
  border-radius: 3px;
  background: #F0E5D6;
}
.path-item { display: flex; align-items: center; gap: 16px; position: relative; }
.node {
  flex: 0 0 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  z-index: 1;
  background: #fff;
}
.path-item.open .node { border: 3px solid var(--orange); color: var(--orange); }
.path-item.done .node { background: var(--orange); color: #fff; box-shadow: 0 4px 12px rgba(242, 88, 50, 0.35); }
.path-item.done .node svg { width: 20px; height: 20px; }
.path-item.locked .node { background: #F2ECE2; color: #C9C4BB; }
.path-item.locked .node svg { width: 17px; height: 17px; }

.lesson-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lesson-card:not([disabled]):hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(58, 58, 60, 0.1); }
.lesson-card:not([disabled]):active { transform: scale(0.99); }
.lesson-card[disabled] { cursor: default; opacity: 0.62; box-shadow: none; }

.lc-text { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lc-title { font-weight: 700; font-size: 16.5px; }
.lc-tag { font-size: 13px; color: var(--ink-soft); }
.lc-cta {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 6px 13px;
  border-radius: 999px;
  white-space: nowrap;
}
.lc-cta.open { background: var(--orange-tint); color: var(--orange-deep); }
.lc-cta.done { background: #F4F0E9; color: var(--ink-soft); }
.lc-cta.locked { background: transparent; color: #C9C4BB; }
.score-chip {
  font-weight: 700;
  font-size: 12px;
  background: var(--amber-tint);
  color: #B07514;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.foot {
  margin-top: 48px;
  padding: 10px 0 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.linklike { text-decoration: underline; font-size: inherit; color: inherit; }
.linklike:hover { color: var(--orange-deep); }

/* ============================================================
   LESSON SHELL
   ============================================================ */
.lesson { display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 58px;
  padding: 0 16px;
  background: rgba(255, 251, 246, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.backbtn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(58, 58, 60, 0.06);
  transition: transform 0.12s ease;
}
.backbtn:hover { transform: translateX(-2px); }
.backbtn svg { width: 17px; height: 17px; }
.tb-title { font-weight: 700; font-size: 13.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }
.tb-spacer { flex: 1; }

.lesson-progress { height: 6px; background: #F3EADD; }
.lp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--amber));
  border-radius: 0 999px 999px 0;
  transition: width 0.45s ease;
}

.stage { width: 100%; max-width: 660px; margin: 0 auto; padding: 26px 20px 90px; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 30px;
}
.card h2 { font-weight: 900; font-size: 27px; line-height: 1.18; letter-spacing: -0.01em; margin-bottom: 14px; }
.card .body { font-size: 16px; line-height: 1.68; color: #4A4A4E; }
.card .body b { font-weight: 700; color: var(--ink); }

.viz-caption { font-size: 13.5px; color: var(--ink-soft); margin-top: 12px; text-align: center; }

/* ---------- chart visual ---------- */
.chartviz { margin-top: 24px; text-align: center; }
.chart-label {
  display: inline-block;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.1em;
  background: var(--ink);
  color: #fff;
  padding: 5px 13px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.chart-bars { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.bar {
  width: 66px;
  height: 66px;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-weight: 900;
  font-size: 23px;
  position: relative;
}
.bar.split { font-size: 17px; }
.bar.split::after {
  content: "";
  position: absolute;
  bottom: 9px;
  left: 15%;
  width: 70%;
  height: 3px;
  border-radius: 3px;
  background: var(--orange);
}
.diamond {
  width: 34px;
  height: 34px;
  border: 2.5px solid var(--orange);
  border-radius: 6px;
  transform: rotate(45deg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.diamond > span { transform: rotate(-45deg); font-size: 17px; }

/* ---------- flavor badges ---------- */
.flavor-badges { display: flex; justify-content: center; gap: 9px; flex-wrap: wrap; margin-top: 24px; }
.fbadge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 17px;
}
.fbadge.maj { background: var(--orange); color: #fff; box-shadow: 0 5px 14px rgba(242, 88, 50, 0.3); }
.fbadge.min { background: #fff; border: 2.5px solid var(--ink); color: var(--ink); }
.fbadge.dim { background: #fff; border: 2.5px dashed var(--gray); color: var(--ink-soft); }
.flavor-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}
.flavor-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.maj { background: var(--orange); }
.dot.min { background: #fff; border: 2px solid var(--ink); }
.dot.dim { background: #fff; border: 2px dashed var(--gray); }

/* ---------- key table ---------- */
.scroll-x { overflow-x: auto; margin-top: 22px; border-radius: 14px; border: 1px solid var(--line); }
.keytable { border-collapse: collapse; width: 100%; min-width: 470px; font-size: 15px; }
.keytable th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  text-transform: uppercase;
  padding: 11px 8px;
  border-bottom: 2px solid var(--line);
  background: #FDF9F3;
}
.keytable td { text-align: center; padding: 10px 8px; border-bottom: 1px solid var(--line); font-weight: 500; }
.keytable tr:last-child td { border-bottom: none; }
.keytable tbody tr:nth-child(even) td { background: #FDFAF5; }
.keycell {
  font-weight: 900;
  color: var(--orange-deep);
  background: var(--orange-tint) !important;
}

/* ---------- compare ---------- */
.compare { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.compare-row { display: flex; align-items: center; gap: 14px; }
.cmp-label {
  flex: 0 0 84px;
  text-align: right;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}
.compare-row.overlay .cmp-label { color: var(--orange-deep); }
.cmp-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.numchip, .letterchip {
  min-width: 46px;
  height: 46px;
  padding: 0 10px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
}
.numchip { background: var(--orange); color: #fff; box-shadow: 0 4px 12px rgba(242, 88, 50, 0.28); }
.letterchip { background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; }
.compare-row.overlay { padding-bottom: 8px; border-bottom: 2px dashed var(--line); margin-bottom: 4px; }

/* ---------- piano ---------- */
.piano-wrap { margin-top: 24px; }
.piano { width: 100%; height: auto; display: block; }
.pkey { cursor: pointer; }
.pkey.white rect { fill: #fff; stroke: #DDD5C8; stroke-width: 1.5; }
.pkey.white.in-scale rect { fill: #FFFAF2; stroke: #E8C9A8; }
.pkey.black rect { fill: var(--ink); }
.pkey.white.pressed rect { fill: var(--orange-tint); }
.pkey.black.pressed rect { fill: #6A6A6E; }
.klabel { font-size: 11px; font-weight: 500; fill: #B9B2A6; text-anchor: middle; }
.pkey.white .kbadge { fill: var(--orange); }
.pkey.black .kbadge { fill: var(--amber); }
.kbadge-num { font-size: 13px; font-weight: 700; fill: #fff; text-anchor: middle; }
.pkey.black .kbadge-num { fill: var(--ink); }
.kbadge-num.small { font-size: 11px; }
.piano-hint { font-size: 13px; color: var(--ink-soft); text-align: center; margin-top: 10px; }

/* chord mode — three states, because the lesson asks the learner to tell them
   apart: the chord tones, the scale notes they skipped over, and everything
   outside the key. */
.piano.chordmode .pkey.white.is-chord rect { fill: var(--orange-tint); stroke: var(--orange); stroke-width: 2.4; }
.piano.chordmode .pkey.black.is-chord rect { fill: var(--orange-deep); }
.piano.chordmode .pkey.white.is-chord .klabel { fill: var(--orange-deep); font-weight: 700; }
/* in the scale, but skipped by this chord */
.piano.chordmode .pkey.white.in-scale:not(.is-chord) rect { fill: #FFF4E6; stroke: #E8D2B4; }
.piano.chordmode .pkey.black.in-scale:not(.is-chord) rect { fill: #8A7F72; }
.piano.chordmode .pkey.in-scale:not(.is-chord) .klabel { fill: var(--ink-soft); }
/* outside the key entirely */
.piano.chordmode .pkey.white:not(.in-scale) rect { fill: #F4F1EC; stroke: #E6E1D9; }
.piano.chordmode .pkey.black:not(.in-scale) rect { fill: #CBC7C1; }
.piano.chordmode .pkey:not(.in-scale) .klabel { fill: #CFC9C0; }

/* reference piano inside a quiz — a tool beside the question, not a second
   headline. Numbers stay hidden until the answer settles. */
.piano-ref { margin: 18px 0 4px; padding: 14px 12px 4px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 14px; }
.piano-ref .piano { margin: 0 auto; }
.piano-ref .piano-hint { font-size: 12.5px; line-height: 1.45; margin-top: 8px; }
.piano-ref .piano-hint b { color: var(--ink); }
.piano-ref .kbadge, .piano-ref .kbadge-num { transition: opacity .28s ease; }
.piano-ref.nums-hidden .kbadge, .piano-ref.nums-hidden .kbadge-num { opacity: 0; }

/* The seven have to be unmistakable at a glance — in a key like A the scale
   skips C, F and G, so a faint tint isn't enough to separate in from out. */
.piano-ref .pkey.white.in-scale rect { fill: #FFEDE0; stroke: #F0B183; stroke-width: 1.8; }
.piano-ref .pkey.white.in-scale .klabel { fill: var(--ink); font-weight: 700; }
.piano-ref .pkey.white:not(.in-scale) rect { fill: #F3EFE9; stroke: #E4DDD2; }
.piano-ref .pkey.black:not(.in-scale) rect { fill: #CBC7C1; }
.piano-ref .pkey:not(.in-scale) .klabel { fill: #C9C3BA; }
/* The 1 is the anchor. Marking it gives nothing away — the hint names it.
   These need .white/.black in the selector to outweigh the .in-scale rules
   above; without it the root marker silently loses and vanishes. */
.piano-ref .pkey.white.is-root rect,
.piano-ref .pkey.black.is-root rect { stroke: var(--orange); stroke-width: 3; }
.piano-ref .pkey.white.is-root rect { fill: #FFD7C2; }
.piano-ref .pkey.white.is-root .klabel,
.piano-ref .pkey.black.is-root .klabel { fill: var(--orange-deep); font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  .piano-ref .kbadge, .piano-ref .kbadge-num { transition: none; }
}

/* ---------- audio buttons ---------- */
.audio-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 14px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 9px 18px 9px 9px;
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.audio-btn:hover { border-color: var(--amber); transform: translateY(-1px); }
.audio-btn .ico {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--orange);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.audio-btn .ico svg { width: 15px; height: 15px; color: #fff; fill: #fff; margin-left: 1px; }
.audio-btn.playing { border-color: var(--orange); }
.audio-btn.playing .ico { animation: pulse 0.9s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.14); }
}

/* ============================================================
   QUIZ
   ============================================================ */
.ck-counter { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 12px; }
.ck-meta { margin-top: 16px; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); }

.choices { display: flex; flex-direction: column; gap: 11px; margin-top: 22px; }
.choice {
  text-align: left;
  font-weight: 500;
  font-size: 16px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 15px;
  padding: 16px 18px;
  transition: border-color 0.14s ease, transform 0.12s ease, background 0.14s ease;
}
.choice:not(.settled):hover { border-color: var(--amber); transform: translateY(-1px); }
.choice.settled { cursor: default; }
.choice.settled:not(.correct):not(.wrong):not(.reveal) { opacity: 0.5; }
.choice.correct { border-color: var(--good); background: var(--good-tint); font-weight: 700; }
.choice.wrong { border-color: var(--bad); background: var(--bad-tint); }
.choice.reveal { border-color: var(--good); border-style: dashed; background: var(--good-tint); }

/* Paired practice sheet — source and answer stay together at every width. */
.sheet-instruction { margin-top: 12px; font-size: 15px; color: var(--ink-soft); }
.sheet-sections { margin-top: 24px; display: grid; gap: 24px; }
.sheet-section { min-width: 0; border: 0; }
.sheet-section legend { padding: 0; margin-bottom: 12px; font-size: 17px; font-weight: 700; color: var(--ink); }
.sheet-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.sheet-row + .sheet-row { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.sheet-pair {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(44px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 6px 10px;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.sheet-given { font-size: 16px; font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.sheet-input {
  width: 100%; min-width: 0; min-height: 48px;
  padding: 10px 12px;
  font: inherit; font-size: 16px;
  color: var(--ink); background: var(--card);
  border: 2px solid var(--gray); border-radius: 10px;
}
.sheet-input:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.sheet-result { grid-column: 1 / -1; font-size: 13px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.sheet-correct { border-color: var(--good); background: var(--good-tint); }
.sheet-incorrect { border-color: var(--bad); background: var(--bad-tint); }
@media (min-width: 520px) {
  .sheet-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* build-a-progression */
.slots { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.slot {
  width: 62px;
  height: 62px;
  border: 2.5px dashed #D8CFC0;
  border-radius: 14px;
  background: #FDFAF4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 20px;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.slot.filled { border-style: solid; border-color: var(--ink); background: #fff; }
.slot.s-ok { border-color: var(--good); background: var(--good-tint); }
.slot.s-bad { border-color: var(--bad); background: var(--bad-tint); animation: shake 0.35s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.bank { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.chip {
  font-weight: 700;
  font-size: 17px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  padding: 11px 19px;
  transition: transform 0.12s ease, opacity 0.15s ease, box-shadow 0.12s ease;
}
.chip:not(.used):hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(58, 58, 60, 0.12); }
.chip:not(.used):active { transform: scale(0.94); }
.chip.used { opacity: 0.22; cursor: default; }

/* feedback */
.feedback { margin-top: 22px; border-radius: 16px; padding: 18px 20px; }
.feedback.good { background: var(--good-tint); border-left: 5px solid var(--good); }
.feedback.bad { background: var(--amber-tint); border-left: 5px solid var(--amber); }
.fb-lead { font-weight: 700; font-size: 15.5px; margin-bottom: 6px; }
.feedback.good .fb-lead { color: var(--good); }
.feedback.bad .fb-lead { color: #B07514; }
.fb-explain { font-size: 15px; line-height: 1.6; color: #4A4A4E; }
.feedback .btn { margin-top: 16px; }

/* ============================================================
   RESULTS + FINALE
   ============================================================ */
.results, .ck-intro, .finale { text-align: center; }
.results .actions, .ck-intro .actions, .finale .actions { justify-content: center; }
.result-sun .mini-sun { width: 74px; height: 74px; margin-bottom: 8px; }
.finale-sun .big-sun { width: 130px; height: 130px; margin-bottom: 12px; }
.finale-score {
  font-weight: 900;
  font-size: 46px;
  color: var(--orange);
  margin: 10px 0 14px;
  letter-spacing: -0.02em;
}

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 999; }

/* ============================================================
   RESPONSIVE + MOTION
   ============================================================ */
@media (max-width: 600px) {
  .card { padding: 24px 19px; }

  /* The piano is the one thing that must not be squeezed by card padding —
     tap targets come first, so let it bleed to the card edges. */
  .piano-wrap { margin-left: -19px; margin-right: -19px; }
  .piano-ref { padding-left: 6px; padding-right: 6px; border-radius: 0;
    border-left: 0; border-right: 0; }
  .piano-ref .piano-hint, .piano-wrap .piano-hint { padding: 0 14px; }
  .card h2 { font-size: 23px; }
  .bar { width: 56px; height: 56px; font-size: 20px; }
  .bar.split { font-size: 15px; }
  .cmp-label { flex-basis: 70px; font-size: 11.5px; }
  .numchip, .letterchip { min-width: 40px; height: 40px; font-size: 14.5px; }
  .fbadge { width: 44px; height: 44px; font-size: 15px; }
  .slot { width: 54px; height: 54px; }
  .hero-sun { width: 78px; height: 78px; }
  .stage { padding: 20px 14px 80px; }
  .home { padding: 36px 14px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
