/* Fretnetic — styles for Home (hm-), Fretboard Games (gm-), Theory Path (ln-) and Daily Workout (wo-). */

/* ================= Shared effects ================= */
.fx-confetti { position: absolute; left: 0; right: 0; top: 40%; height: 0; pointer-events: none; z-index: 5; }
.fx-confetti i { position: absolute; top: 0; width: 8px; height: 12px; border-radius: 2px; background: var(--c); opacity: 0;
  animation: fxConfetti 1.7s cubic-bezier(.2, .7, .3, 1) var(--d) forwards; }
.fx-confetti i:nth-child(3n) { width: 6px; height: 6px; border-radius: 50%; }
@keyframes fxConfetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  60% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 260px)) rotate(var(--r)); }
}
@media (prefers-reduced-motion: reduce) { .fx-confetti { display: none; } }

/* ================= HOME ================= */
.view-home { overflow-x: hidden; }
.hm-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; padding: 26px 28px; border-radius: var(--radius); overflow: hidden;
  background: radial-gradient(110% 130% at 0% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%), var(--surface);
  border: 1px solid var(--border); }
.hm-hero > * { position: relative; z-index: 1; min-width: 0; }
.hm-greet { color: var(--text-2); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: 12px; }
.hm-title { font-size: clamp(40px, 7vw, 64px); font-weight: 600; line-height: 1; letter-spacing: -0.04em; margin: 4px 0 6px; }
.hm-title span { color: inherit; }
.hm-tag { font-size: 17px; color: var(--text-2); margin-bottom: 20px; }
.hm-level { display: flex; align-items: center; gap: 14px; max-width: 460px; }
.hm-lvl-badge { flex: none; width: 62px; height: 62px; border-radius: var(--radius); display: grid; place-items: center; align-content: center; line-height: 1;
  background: var(--action); color: var(--action-ink); }
.hm-lvl-badge small { font-size: 10px; font-weight: 800; letter-spacing: .1em; opacity: .8; }
.hm-lvl-badge b { font-family: var(--font-display); font-size: 28px; }
.hm-lvl-meta { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hm-lvl-meta > b { font-family: var(--font-display); font-size: 18px; }
.hm-xpbar { height: 10px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.hm-xpbar i { display: block; height: 100%; border-radius: 6px; width: 100%; background: var(--action); transform: scaleX(var(--p, 0)); animation: hmGrow .6s cubic-bezier(.25, 1, .5, 1) both; transform-origin: left; }
@keyframes hmGrow { from { transform: scaleX(0); } }
.hm-hero-side { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }
.hm-goal, .hm-streak { background: color-mix(in srgb, var(--surface-2) 80%, transparent); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.hm-ring-wrap { position: relative; width: 116px; height: 116px; }
.hm-ring { width: 100%; height: 100%; display: block; }
.hm-ring-track { fill: none; stroke: var(--surface-3); stroke-width: 11; }
.hm-ring-fill { fill: none; stroke: var(--accent); stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.2, .8, .2, 1); }
.hm-ring-label { position: absolute; inset: 0; display: grid; place-content: center; line-height: 1.1; }
.hm-ring-label b { font-family: var(--font-display); font-size: 28px; }
.hm-ring-label small { color: var(--text-3); font-size: 12px; font-weight: 600; }
.hm-streak b { font-family: var(--font-display); font-size: 30px; }
.hm-streak > div { display: flex; align-items: baseline; gap: 2px; }
.hm-streak-msg { font-size: 12px; line-height: 1.35; }
.hm-flame { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--surface-3); color: var(--text-3); }
.hm-flame .icon { width: 30px; height: 30px; }
.hm-streak.lit .hm-flame { color: var(--action); background: color-mix(in srgb, var(--action) 18%, transparent); }
.hm-streak.lit .hm-flame .icon { fill: color-mix(in srgb, var(--action) 45%, transparent); }
.hm-h2 { font-size: 19px; margin: 28px 0 12px; display: flex; align-items: center; gap: 8px; }
.hm-conts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hm-cont { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 42px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; transition: transform .15s, border-color .15s, box-shadow .15s; overflow: hidden; }
.hm-cont.c-workout { --cc: var(--warn); }
.hm-cont.c-game { --cc: var(--accent-2); }
.hm-cont:hover { border-color: color-mix(in srgb, var(--cc, var(--accent)) 60%, var(--border)); }
.hm-cont h3 { font-size: 18px; }
.hm-cont p { font-size: 13.5px; margin: 0; }
.hm-kicker { position: absolute; left: 18px; bottom: 12px; right: 70px; font-size: 12px; font-weight: 600; color: color-mix(in srgb, var(--cc, var(--accent)) 55%, var(--text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-cont-go { position: absolute; right: 14px; bottom: 12px; display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 13px; color: color-mix(in srgb, var(--cc, var(--accent)) 55%, var(--text)); }
.hm-minibar { margin-top: 8px; height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.hm-minibar i { display: block; height: 100%; background: var(--cc, var(--accent)); border-radius: 4px; }
.hm-two { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.hm-two .card + .card { margin-top: 0; }
.hm-heat { display: flex; flex-direction: column; gap: 10px; }
.hm-heat-grid { display: grid; grid-template-columns: 16px repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(7, auto); grid-auto-flow: column; gap: 5px; max-width: 300px; }
.hm-col { display: contents; }
.hm-days span { font-size: 10px; color: var(--text-3); display: grid; place-items: center; font-weight: 600; }
.hm-cell { display: block; aspect-ratio: 1; border-radius: 5px; background: var(--surface-3); }
.hm-cell.l1 { background: color-mix(in srgb, var(--accent) 28%, var(--surface-3)); }
.hm-cell.l2 { background: color-mix(in srgb, var(--accent) 52%, var(--surface-3)); }
.hm-cell.l3 { background: color-mix(in srgb, var(--accent) 78%, var(--surface-3)); }
.hm-cell.l4 { background: var(--action); }
.hm-cell.future { background: transparent; border: 1px dashed var(--border); }
.hm-cell.today { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.hm-heat-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: var(--text-2); }
.hm-legend { display: inline-flex; align-items: center; gap: 3px; color: var(--text-3); }
.hm-legend .hm-cell { width: 11px; height: 11px; border-radius: 3px; }
.hm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); text-align: center; }
.hm-stats b { display: block; font-family: var(--font-display); font-size: 22px; }
.hm-stats small { color: var(--text-3); font-size: 12px; }
.hm-best-list { display: flex; flex-direction: column; }
.hm-best-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: var(--radius); color: var(--text); text-decoration: none !important; }
.hm-best-row + .hm-best-row { border-top: 1px solid var(--border); }
.hm-best-row:hover { background: var(--surface-2); }
.hm-best-emoji { font-size: 20px; width: 28px; text-align: center; }
.hm-best-name { flex: 1; display: flex; flex-direction: column; font-weight: 600; min-width: 0; line-height: 1.25; }
.hm-best-name small { font-weight: 500; font-size: 12px; }
.hm-best-score { font-family: var(--font-display); font-size: 18px; }
.hm-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.hm-tool { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; transition: border-color .15s, transform .15s; }
.hm-tool:hover { transform: translateY(-2px); border-color: hsl(var(--h) 65% 55%); }
.hm-tool-icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--radius); color: hsl(var(--h) 70% 58%); background: hsl(var(--h) 70% 55% / .14); }
.hm-tool-icon .icon { width: 22px; height: 22px; }
.hm-tool-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.hm-tool-text small { color: var(--text-3); font-size: 12.5px; }
.hm-ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.hm-badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 14px 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); opacity: .55; }
.hm-badge.got { opacity: 1; border-color: color-mix(in srgb, var(--accent-2) 45%, var(--border)); background: color-mix(in srgb, var(--accent-2) 6%, var(--surface)); }
.hm-badge-icon { font-size: 28px; line-height: 1.2; filter: grayscale(1); }
.hm-badge.got .hm-badge-icon { filter: none; animation: hmBadge .5s ease both; }
@keyframes hmBadge { from { transform: scale(.6); } }
.hm-badge b { font-size: 13.5px; }
.hm-badge small { font-size: 11.5px; color: var(--text-3); line-height: 1.3; }
@media (max-width: 1100px) { .hm-hero { grid-template-columns: 1fr; } .hm-conts { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .hm-two, .hm-conts { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .hm-hero { padding: 20px 16px; border-radius: var(--radius); }
  .hm-hero-side { gap: 10px; }
  .hm-ring-wrap { width: 96px; height: 96px; }
  .hm-ach { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-tools { grid-template-columns: 1fr; }
  .hm-stats b { font-size: 18px; }
}

/* ================= GAMES ================= */
.gm-hubstats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.gm-hubstats > div { flex: 1; min-width: 110px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; display: flex; flex-direction: column; }
.gm-hubstats b { font-family: var(--font-display); font-size: 22px; }
.gm-hubstats small { color: var(--text-3); font-size: 12px; }
.gm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.gm-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none !important;
  transition: transform .18s, border-color .18s, box-shadow .18s; animation: gmIn .35s ease both; animation-delay: calc(var(--i) * 40ms); }
@keyframes gmIn { from { opacity: 0; transform: translateY(8px); } }
.gm-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.gm-card:hover .gm-emoji { transform: scale(1.12) rotate(-6deg); }
.gm-card h3 { font-size: 19px; }
.gm-card p { color: var(--text-2); font-size: 14px; margin: 0; flex: 1; }
.gm-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.gm-emoji { display: inline-grid; place-items: center; width: 50px; height: 50px; border-radius: var(--radius); font-size: 26px; background: var(--surface-2); border: 1px solid var(--border); transition: transform .2s; }
.gm-emoji.big { width: 72px; height: 72px; font-size: 38px; border-radius: var(--radius); flex: none; }
.gm-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 13px; }
.gm-best { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--warn-text); }
.gm-best .icon { width: 15px; height: 15px; }
.gm-card-play { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--accent); }
.gm-back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; margin-bottom: 12px; }
.gm-setup { max-width: 920px; }
.gm-setup-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.gm-setup-text { flex: 1; min-width: 220px; }
.gm-setup-text h1 { font-size: 28px; }
.gm-setup-go { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gm-start { min-width: 150px; font-size: 18px; }
.gm-opts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px 20px; }
.gm-opt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gm-opt .seg { max-width: 100%; }
.gm-strings sup { font-size: 9px; margin-left: 2px; opacity: .65; }
.gm-howto ul, .gm-stages { margin: 0; padding-left: 20px; color: var(--text-2); display: grid; gap: 6px; }

/* play screen */
.gm-play { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.gm-topline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gm-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 18px; }
.gm-stage-label { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; }
.gm-stage-label:empty { display: none; }
.gm-hud { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.gm-hud-item { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px; display: flex; flex-direction: column; min-width: 0; }
.gm-hud-item small { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 700; }
.gm-hud-val { font-family: var(--font-display); font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.gm-combo-row { display: flex; align-items: baseline; gap: 8px; }
.gm-mult { font-size: 13px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.gm-hud-combo.hot { border-color: var(--accent-2); box-shadow: 0 0 0 1px var(--accent-2) inset; }
.gm-hud-combo.hot .gm-mult { background: var(--accent-2); color: var(--accent-2-ink); }
.gm-hud-combo.bump .gm-hud-val { animation: gmBump .3s ease; }
@keyframes gmBump { 40% { transform: scale(1.35); color: var(--accent); } }
.gm-float { position: absolute; right: 12px; top: 6px; font-weight: 800; color: var(--good-text); font-family: var(--font-display); pointer-events: none; animation: gmFloat .9s ease forwards; }
@keyframes gmFloat { from { opacity: 1; transform: translateY(6px); } to { opacity: 0; transform: translateY(-22px); } }
.gm-bar { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.gm-bar i { display: block; height: 100%; width: 100%; background: var(--action); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .3s cubic-bezier(.16, 1, .3, 1); }
.gm-bar.timed i { transition: transform .1s linear; }
.gm-bar.low i { background: var(--bad); }
.gm-prompt-card { position: relative; text-align: center; padding: 14px 16px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.gm-prompt { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 4.2vw, 38px); line-height: 1.15; }
.gm-prompt.in { animation: gmPrompt .3s ease; }
@keyframes gmPrompt { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.gm-prompt-sub { color: var(--text-2); font-size: 14px; margin-top: 2px; min-height: 1.4em; }
.gm-feedback { min-height: 1.5em; margin-top: 4px; font-weight: 600; font-size: 14px; color: var(--text-2); }
.gm-feedback.good { color: var(--good-text); }
.gm-feedback.bad { color: var(--bad-text); }
.gm-feedback.info { color: var(--warn-text); }
.gm-banner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.6); font-family: var(--font-display); font-weight: 800; font-size: 34px; color: var(--accent-2);
  pointer-events: none; opacity: 0; white-space: nowrap; text-shadow: 0 2px 12px color-mix(in srgb, var(--bg) 70%, transparent); }
.gm-banner.show { animation: gmBanner 1s ease forwards; }
@keyframes gmBanner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -80%) scale(1); } }
.gm-stage { display: flex; flex-direction: column; gap: 12px; }
.gm-shake { animation: gmShake .38s ease; }
@keyframes gmShake { 25% { transform: translateX(-4px); } 50% { transform: translateX(3px); } 75% { transform: translateX(-2px); } }
.gm-board .fb-string.gm-off { opacity: .15; }
.gm-board .fb-strname.gm-off { opacity: .3; }
.gm-board.gm-short .fretboard { min-width: 480px; }
.gm-board .fb-hit:hover { fill: color-mix(in srgb, var(--accent) 22%, transparent); }
.gm-board .fb-marker.gm-pop circle, .gm-board .fb-marker.gm-pop rect { animation: gmMarkerPop .35s ease; transform-box: fill-box; transform-origin: center; }
@keyframes gmMarkerPop { 0% { transform: scale(.3); } 70% { transform: scale(1.2); } }
.gm-answers { display: flex; flex-direction: column; gap: 10px; }
.gm-notes { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.gm-notes.nat { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.gm-note { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; padding: 6px 2px; border-radius: var(--radius); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-strong); border-bottom-width: 3px; line-height: 1.1; transition: transform .08s, background .15s, border-color .15s; }
.gm-note b { font-family: var(--font-display); font-size: 19px; }
.gm-note small { font-size: 12px; color: var(--text-3); font-weight: 600; }
.gm-note.acc { background: var(--surface-3); }
.gm-note:hover { border-color: var(--accent); }
.gm-note:active { transform: translateY(2px); border-bottom-width: 1px; }
.gm-note.good, .gm-choice.good { background: color-mix(in srgb, var(--good) 22%, var(--surface)); border-color: var(--good); }
.gm-note.bad, .gm-choice.bad { background: color-mix(in srgb, var(--bad) 22%, var(--surface)); border-color: var(--bad); animation: gmShake .35s ease; }
.gm-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.gm-choices.many { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gm-choice { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 10px 14px; border-radius: var(--radius); cursor: pointer; text-align: left; font-weight: 700; font-size: 16px;
  background: var(--surface); border: 1px solid var(--border-strong); border-bottom-width: 3px; transition: transform .08s, border-color .15s, background .15s; }
.gm-choice:hover { border-color: var(--accent); }
.gm-choice:active { transform: translateY(2px); }
.gm-choice .kbd { flex: none; }
.gm-diagram-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.gm-diagram .chord-diagram { width: 190px; }
.gm-ear { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.gm-listen { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 120px; height: 120px; border-radius: 50%; cursor: pointer; font-weight: 700;
  color: var(--action-ink); background: var(--action); border: 0; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.gm-listen .icon { stroke-width: 2.2; width: 34px; height: 34px; }
.gm-listen.ping { animation: gmPing .7s ease; }
@keyframes gmPing { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 100% { box-shadow: 0 0 0 26px transparent; } }
.gm-ear-warn { font-size: 14px; color: var(--warn-text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.gm-formula { display: flex; justify-content: center; }
.gm-formula-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.gm-formula-key { font-family: var(--font-display); font-weight: 700; margin-right: 6px; }
.gm-deg { display: flex; flex-direction: column; align-items: center; min-width: 44px; padding: 5px 6px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); line-height: 1.15; }
.gm-deg b { font-family: var(--font-display); }
.gm-deg small { color: var(--text-3); font-weight: 700; }
.gm-deg.root { border-color: var(--accent); }
.gm-deg.ask { border-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 16%, var(--surface-2)); animation: pulse 1.2s ease-in-out infinite; }
/* results */
.gm-result-wrap { max-width: 640px; margin: 10px auto 0; }
.gm-results { position: relative; text-align: center; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 26px 20px; animation: gmIn .35s ease; }
.gm-results.best { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn) inset, var(--shadow); }
.gm-res-head { display: flex; align-items: center; gap: 14px; text-align: left; }
.gm-res-head h2 { font-size: 24px; }
.gm-newbest { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--warn-text); animation: gmBump .6s ease 2; }
.gm-newbest small { font-weight: 600; color: var(--text-2); font-size: 14px; }
.gm-res-score b { display: block; font-family: var(--font-display); font-size: 64px; line-height: 1; color: var(--text); letter-spacing: -0.03em; }
.gm-res-score small { color: var(--text-3); font-weight: 600; }
.gm-res-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; width: 100%; }
.gm-res-stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 4px; display: flex; flex-direction: column; }
.gm-res-stat b { font-family: var(--font-display); font-size: 20px; }
.gm-res-stat small { font-size: 11.5px; color: var(--text-3); }
.gm-res-ach { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.gm-ach { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--accent-2) 16%, var(--surface-2)); border: 1px solid var(--accent-2); font-size: 13px; animation: hmBadge .5s ease both; }
.gm-res-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.gm-res-keys { font-size: 12px; }
@media (max-width: 760px) {
  .gm-notes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .gm-notes.nat { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .gm-hud { gap: 6px; }
  .gm-hud-item { padding: 6px 8px; border-radius: var(--radius); }
  .gm-hud-item small { font-size: 9.5px; letter-spacing: .04em; }
  .gm-hud-val { font-size: 20px; }
  .gm-mult { font-size: 11px; padding: 0 5px; }
  .gm-combo-row { gap: 4px; }
  .gm-res-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gm-stage-label { margin-left: 0; }
}
@media (max-width: 420px) {
  .gm-choices { grid-template-columns: 1fr; }
  .gm-notes.nat .gm-note b { font-size: 16px; }
  .gm-setup-go { width: 100%; }
  .gm-start { width: 100%; }
}

/* ================= LEARN ================= */
.ln-overall { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.ln-overall-top { display: flex; justify-content: space-between; align-items: center; }
.ln-overall-top b { font-family: var(--font-display); font-size: 22px; }
.ln-bar { height: 8px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.ln-bar.big { height: 12px; }
.ln-bar i { display: block; height: 100%; width: 100%; background: var(--u, var(--accent)); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .6s cubic-bezier(.16, 1, .3, 1); }
.ln-map { list-style: none; margin: 0; padding: 0; position: relative; display: flex; flex-direction: column; gap: 14px; }
.ln-map::before { content: ''; position: absolute; left: 27px; top: 20px; bottom: 20px; width: 3px; border-radius: 2px; background: var(--border-strong); }
.ln-unit { position: relative; display: flex; gap: 16px; align-items: flex-start; }
.ln-unit-badge { position: relative; z-index: 1; flex: none; width: 56px; height: 56px; border-radius: var(--radius); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 22px;
  background: var(--u); color: var(--fn-note-ink); }
.ln-unit-badge .icon { width: 26px; height: 26px; stroke-width: 3; }
.ln-unit.locked .ln-unit-badge { background: var(--surface-3); color: var(--text-3); box-shadow: none; font-size: 20px; }
.ln-unit-body { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.ln-unit.complete .ln-unit-body { border-color: color-mix(in srgb, var(--u) 50%, var(--border)); }
.ln-unit.locked .ln-unit-body { background: color-mix(in srgb, var(--surface) 70%, var(--bg)); }
.ln-unit-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ln-unit-head h3 { font-size: 19px; }
.ln-unit-head p { margin: 2px 0 0; font-size: 14px; }
.ln-unit-prog { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 120px; }
.ln-unit-prog .ln-bar { width: 120px; }
.ln-unit-prog small { font-weight: 700; color: var(--text-2); }
.ln-lock-note { display: block; margin-top: 6px; color: var(--warn-text); }
.ln-nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-top: 12px; }
.ln-node { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; transition: border-color .15s, transform .15s; }
.ln-node:hover { border-color: var(--u); transform: translateY(-2px); }
.ln-node-dot { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-weight: 800; font-size: 13px; border: 2px solid var(--u); color: color-mix(in srgb, var(--u) 40%, var(--text)); }
.ln-node-dot .icon { width: 16px; height: 16px; stroke-width: 3; }
.ln-node.done .ln-node-dot { background: var(--u); color: var(--fn-note-ink); }
.ln-node.next { border-color: var(--u); box-shadow: 0 0 0 3px color-mix(in srgb, var(--u) 22%, transparent); }
.ln-node-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ln-node-text b { font-size: 14px; }
.ln-node-text small { font-size: 12px; color: var(--text-3); }
.ln-unit.locked .ln-node { opacity: .75; }
/* lesson page */
.ln-lesson { max-width: 880px; margin: 0 auto; }
.ln-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: 14px; margin-bottom: 12px; }
.ln-crumbs a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.ln-lesson-head { margin-bottom: 14px; }
.ln-lesson-head h1 { font-size: clamp(24px, 4vw, 32px); margin: 8px 0; }
.ln-dots { display: flex; gap: 6px; }
.ln-dot { width: 28px; height: 6px; border-radius: 3px; background: var(--surface-3); }
.ln-dot.done { background: color-mix(in srgb, var(--u) 60%, var(--surface-3)); }
.ln-dot.cur { background: var(--u); }
.ln-peek { padding: 10px 14px; border-radius: var(--radius); background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); margin-bottom: 14px; font-size: 14px; }
.ln-article { border-color: color-mix(in srgb, var(--u) 35%, var(--border)); }
.ln-body { display: flex; flex-direction: column; gap: 14px; font-size: 16px; line-height: 1.65; }
.ln-body > p { margin: 0; max-width: 70ch; }
.ln-body b { color: var(--text); }
.ln-fig { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ln-fig figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13.5px; color: var(--text-2); }
.ln-board { padding-top: 10px; }
.ln-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.ln-list p { margin: 0; }
.ln-tip { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); font-size: 14.5px; }
.ln-tip p { margin: 0; }
.ln-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; align-self: flex-start; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; }
.ln-link:hover { border-color: var(--accent); text-decoration: none; }
.ln-seg { display: flex; flex-direction: column; gap: 10px; }
.ln-seg > .seg { align-self: flex-start; max-width: 100%; }
.ln-seg-host { display: flex; flex-direction: column; gap: 10px; }
.ln-chords { display: flex; flex-wrap: wrap; gap: 10px; }
.ln-chord { font: inherit; color: inherit; }
.ln-chord-sub { font-size: 12px; color: var(--text-3); font-family: var(--mono); }
.ln-intervals { display: flex; flex-wrap: wrap; gap: 6px; }
.ln-int { display: flex; flex-direction: column; align-items: center; min-width: 88px; padding: 6px 8px; border-radius: var(--radius); cursor: pointer; line-height: 1.2;
  background: color-mix(in srgb, var(--c) 14%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); }
.ln-int:hover { background: color-mix(in srgb, var(--c) 26%, var(--surface-2)); }
.ln-int b { font-family: var(--font-display); }
.ln-int small { font-size: 11px; color: var(--text-2); }
.ln-table td:first-child, .ln-table td:nth-child(3) { font-family: var(--mono); }
.ln-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ln-step-note { display: flex; flex-direction: column; align-items: center; min-width: 42px; padding: 5px 6px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); line-height: 1.15; }
.ln-step-note b { font-family: var(--font-display); font-size: 17px; }
.ln-step-note small { font-size: 11px; color: var(--text-3); font-weight: 700; }
.ln-step-note.root { border-color: var(--u, var(--accent)); }
.ln-step-gap { font-size: 12px; font-weight: 800; padding: 2px 6px; border-radius: 6px; }
.ln-step-gap.w { color: var(--accent); background: var(--accent-soft); }
.ln-step-gap.h { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 14%, transparent); }
.ln-key p { margin: 8px 0 0; }
.ln-pos-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ln-diatonic { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.ln-dia { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: var(--radius); cursor: pointer; background: var(--surface-2); border: 1px solid color-mix(in srgb, var(--fc) 45%, var(--border)); min-width: 0; }
.ln-dia[data-fn="tonic"] { --fc: var(--accent); }
.ln-dia[data-fn="subdominant"] { --fc: var(--warn); }
.ln-dia[data-fn="dominant"] { --fc: var(--accent-2); }
.ln-dia:hover { background: var(--surface-3); }
.ln-roman { font-family: var(--font-display); font-size: 16px; }
.ln-dia-name { font-weight: 700; font-size: 14px; }
.ln-dia small { font-size: 10.5px; color: var(--text-3); }
.ln-prog { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ln-prog-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ln-prog-chip { display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: 6px 10px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); transition: all .15s; }
.ln-prog-chip small { font-size: 11px; color: var(--text-3); font-weight: 700; }
.ln-prog-chip b { font-family: var(--font-display); font-size: 17px; }
.ln-prog-chip.on { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.ln-vamp { margin-bottom: 4px; }
.ln-circle-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.ln-circle { width: min(320px, 100%); height: auto; flex: none; }
.ln-circle-info { flex: 1; min-width: 200px; }
.ln-circle-info h4 { font-size: 18px; margin-bottom: 4px; }
.ln-cseg { cursor: pointer; outline: none; }
.ln-c-out { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1; transition: fill .15s; }
.ln-c-in { fill: var(--surface-3); stroke: var(--border-strong); stroke-width: 1; transition: fill .15s; }
.ln-cseg:hover .ln-c-out, .ln-cseg:focus-visible .ln-c-out { fill: var(--surface-3); }
.ln-cseg.near .ln-c-out { fill: color-mix(in srgb, var(--accent) 22%, var(--surface-2)); }
.ln-cseg.near .ln-c-in { fill: color-mix(in srgb, var(--accent) 14%, var(--surface-3)); }
.ln-cseg.sel .ln-c-out { fill: var(--accent); }
.ln-cseg.sel .ln-c-in { fill: color-mix(in srgb, var(--accent) 55%, var(--surface-3)); }
.ln-c-maj { fill: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 15px; pointer-events: none; }
.ln-c-min { fill: var(--text-2); font-size: 10.5px; font-weight: 600; pointer-events: none; }
.ln-cseg.sel .ln-c-maj { fill: var(--accent-ink); }
.ln-c-center { fill: var(--text-3); font-size: 12px; font-weight: 700; font-family: var(--font-display); }
/* quiz */
.ln-quiz { margin-top: 16px; }
.ln-quiz-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.ln-q { padding: 12px 0; border-top: 1px solid var(--border); }
.ln-q-text { font-weight: 600; display: flex; gap: 10px; align-items: flex-start; }
.ln-q-num { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); font-size: 12px; font-weight: 800; margin-top: 1px; }
.ln-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ln-choice { text-align: left; padding: 10px 12px; min-height: 46px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; font-weight: 500; transition: border-color .15s, background .15s; }
.ln-choice:hover:not(:disabled) { border-color: var(--accent); }
.ln-choice:disabled { cursor: default; opacity: .75; }
.ln-choice.good { background: color-mix(in srgb, var(--good) 20%, var(--surface-2)); border-color: var(--good); opacity: 1; }
.ln-choice.bad { background: color-mix(in srgb, var(--bad) 20%, var(--surface-2)); border-color: var(--bad); opacity: 1; animation: gmShake .35s ease; }
.ln-why { margin: 8px 0 0; font-size: 14px; display: none; }
.ln-why.show { display: block; }
.ln-why.good { color: var(--good-text); }
.ln-why.bad { color: var(--bad-text); }
.ln-quiz-result { position: relative; display: none; }
.ln-quiz-result.show { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; padding: 14px 16px; border-radius: var(--radius); animation: gmIn .3s ease; }
.ln-quiz-result.pass { background: color-mix(in srgb, var(--good) 14%, var(--surface)); border: 1px solid var(--good); }
.ln-quiz-result.fail { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border: 1px solid var(--warn); }
.ln-score { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ln-score b { font-family: var(--font-display); font-size: 30px; }
.ln-pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.ln-pager .btn { max-width: 100%; }
.ln-pager .btn span { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .ln-map::before { left: 21px; }
  .ln-unit { gap: 10px; }
  .ln-unit-badge { width: 44px; height: 44px; border-radius: var(--radius); font-size: 18px; }
  .ln-unit-body { padding: 12px; }
  .ln-unit-prog { align-items: flex-start; }
  .ln-nodes { grid-template-columns: 1fr; }
  .ln-choices { grid-template-columns: 1fr; }
  .ln-diatonic { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ln-body { font-size: 15px; }
  .ln-pager .btn { flex: 1; }
}

/* ================= WORKOUT ================= */
.wo-session { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: flex-start; }
.wo-sess-block { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wo-tempo { flex: 1; min-width: 220px; max-width: 360px; }
.wo-prog { min-width: 160px; }
.wo-time { font-family: var(--font-display); font-size: 26px; font-variant-numeric: tabular-nums; min-width: 64px; }
.wo-bpm-val { font-family: var(--font-display); font-size: 24px; font-variant-numeric: tabular-nums; min-width: 42px; text-align: center; }
.wo-tempo .icon-btn { border-color: var(--border); background: var(--surface-2); font-size: 20px; font-weight: 700; }
.wo-dots { display: inline-flex; gap: 5px; margin-left: 6px; }
.wo-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); transition: background .05s; }
.wo-dots i.on { background: var(--action); transform: scale(1.25); }
.wo-dots i:first-child.on { background: var(--accent-2); transform: scale(1.35); }
.wo-bar { height: 8px; width: 100%; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.wo-bar i { display: block; height: 100%; width: 100%; background: var(--action); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .4s cubic-bezier(.16, 1, .3, 1); }
.wo-done { position: relative; }
.wo-done-inner { margin-top: 12px; padding: 12px 16px; border-radius: var(--radius); font-weight: 700; background: color-mix(in srgb, var(--good) 15%, var(--surface)); border: 1px solid var(--good); animation: gmIn .3s ease; }
.wo-keycard { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.wo-key-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.wo-key { font-size: 30px; line-height: 1.1; color: var(--text); }
.wo-mini-circle { position: relative; width: 124px; height: 124px; flex: none; border-radius: 50%; border: 1px dashed var(--border-strong); }
.wo-mini-circle span { position: absolute; left: 50%; top: 50%; width: 26px; height: 20px; margin: -10px 0 0 -13px; text-align: center; font-size: 10.5px; font-weight: 700; color: var(--text-3);
  transform: rotate(var(--a)) translateY(-50px) rotate(calc(var(--a) * -1)); }
.wo-mini-circle span.on { color: var(--select-ink); background: var(--select); border-radius: 6px; }
.wo-keys { display: flex; flex-wrap: wrap; gap: 6px; }
.wo-keypill { min-width: 44px; padding: 6px 10px; border-radius: 999px; cursor: pointer; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); }
.wo-keypill.done { background: color-mix(in srgb, var(--good) 18%, var(--surface-2)); border-color: var(--good); }
.wo-keypill.cur { background: var(--select); color: var(--select-ink); border-color: var(--select); }
.wo-posrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.wo-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.wo-list .card + .card { margin-top: 0; }
.wo-item { display: flex; flex-direction: column; gap: 10px; transition: border-color .2s, opacity .2s; }
.wo-item.checked { border-color: color-mix(in srgb, var(--good) 55%, var(--border)); }
.wo-item.checked .wo-item-title h3 { color: var(--text-2); }
.wo-item.playing { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.wo-item-head { display: flex; align-items: center; gap: 12px; }
.wo-item-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.wo-item-title h3 { font-size: 17px; }
.wo-check { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; background: var(--surface-2); border: 2px solid var(--border-strong); color: transparent; transition: all .2s; }
.wo-check:hover { border-color: var(--good); color: color-mix(in srgb, var(--good) 50%, transparent); }
.wo-check .icon { width: 22px; height: 22px; stroke-width: 3; }
.wo-item.checked .wo-check { background: var(--good); border-color: var(--good); color: var(--fn-note-ink); animation: gmBump .35s ease; }
.wo-tip { margin: 0; font-size: 14px; color: var(--text-2); }
.wo-count { font-size: 12px; }
.wo-chords { display: flex; flex-wrap: wrap; gap: 6px; }
.wo-chordchip { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 4px 8px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); line-height: 1.2; transition: all .12s; }
.wo-chordchip small { font-size: 11px; color: var(--text-3); font-weight: 700; }
.wo-chordchip b { font-family: var(--font-display); font-size: 14px; }
.wo-chordchip.on { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.wo-why { margin-top: 16px; }
@media (max-width: 640px) {
  .wo-session { gap: 12px 18px; }
  .wo-tempo { max-width: none; min-width: 0; flex-basis: 100%; }
  .wo-prog { flex: 1; }
  .wo-item-head { flex-wrap: wrap; }
  .wo-item-title { flex: 1 1 calc(100% - 60px); }
  .wo-item-head .btn { margin-left: 56px; }
  .wo-mini-circle { width: 108px; height: 108px; }
  .wo-mini-circle span { transform: rotate(var(--a)) translateY(-43px) rotate(calc(var(--a) * -1)); }
  .wo-key { font-size: 26px; }
}
