:root {
  color-scheme: dark;
  --bg: #101422;
  --panel: #191f32;
  --surface: #20283e;
  --border: #354059;
  --muted: #a6b0c9;
  --text: #f4f5fc;
  --accent: #ffad91;
  --green: #c5f38b;
  --mint: #8de3ce;
  --board-bg: #171e30;
  --board-mask: #0d1120;
  --fret-wire: #56637d;
  --inlay: #455371;
  --inlay-muted: #242d43;
  --nut: #d1d9e8;
  --string: #a5b2ca;
  --target-ink: #172032;
  --font: 'Segoe UI', system-ui, sans-serif;
  --display: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 10% 0, #22304a66, transparent 45%), var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button { transition: background .16s, color .16s, border-color .16s, transform .16s, box-shadow .16s; }
button:disabled { cursor: default; }
button:active:not(:disabled) { transform: translateY(2px); }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 4px; }
[hidden] { display: none !important; }
.page-shell { width: min(1440px, 100%); margin: auto; padding: 0 40px; }
.site-header { display: flex; align-items: center; gap: 16px; min-height: 82px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 11px; font: 700 29px var(--display); letter-spacing: -1.5px; color: var(--text); text-decoration: none; }
.brand-period { color: var(--mint); margin-left: -10px; }
.brand-icon { display: flex; align-items: center; justify-content: center; gap: 3px; width: 32px; height: 34px; }
.brand-icon i { width: 4px; height: 17px; border-radius: 3px; background: var(--mint); }
.brand-icon i:nth-child(2) { height: 30px; }
.brand-icon i:nth-child(3) { height: 23px; }
.brand-icon i:nth-child(4) { height: 12px; background: var(--green); }
.header-tag { margin-left: 9px; color: var(--muted); font-size: 12px; }
.practice-label { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: 1.2px; }
.green-dot, .orange-dot { display: inline-block; flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }
.orange-dot { background: var(--accent); margin-right: 6px; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 29px 0 27px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; }
.intro .eyebrow { margin-bottom: 9px; color: var(--mint); font-size: 9px; }
h1 { margin: 0 0 9px; font: 700 clamp(27px, 2.8vw, 39px)/1.15 var(--display); letter-spacing: -1.5px; }
h1 > span { color: var(--mint); }
.intro-copy { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.intro-decoration { display: flex; align-items: center; gap: 6px; height: 62px; padding: 0 22px; }
.intro-decoration span { width: 7px; height: 20px; border-radius: 4px; background: var(--mint); opacity: .45; }
.intro-decoration span:nth-child(2n) { height: 34px; opacity: .7; }
.intro-decoration span:nth-child(3n) { height: 51px; background: var(--green); opacity: .85; }
.intro-decoration span:nth-child(5) { height: 62px; background: var(--accent); opacity: 1; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 294px; gap: 22px; align-items: start; }
.quiz-panel, .settings-panel { min-width: 0; border: 1px solid var(--border); border-radius: 20px; background: var(--panel); }
.quiz-panel { padding: 23px 25px 0; box-shadow: 0 15px 50px #070a152d; }
.quiz-topline { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.session-status { color: var(--muted); font-size: 9px; letter-spacing: .8px; border: 1px solid var(--border); border-radius: 20px; padding: 6px 9px; }
.session-status.live { color: var(--mint); border-color: #42665e; background: #8de3ce0a; }
.performance-hud { display: grid; grid-template-columns: 1.15fr 1.15fr 1fr; margin-top: 19px; border: 1px solid #465271; border-radius: 12px; background: linear-gradient(105deg, #27324b, #20273c); overflow: hidden; }
.performance-hud > div { min-width: 0; padding: 15px 18px; }
.performance-hud > div + div { border-left: 1px solid #465271; }
.hud-label { display: block; color: #c0cae0; font-size: 9px; font-weight: 700; letter-spacing: 1.2px; }
.performance-hud strong { display: block; margin: 5px 0; font: 700 34px/1.1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -1px; overflow-wrap: anywhere; }
.score-card strong { color: var(--green); }
.best-card strong { color: var(--mint); font-size: 27px; margin: 9px 0; }
.hud-caption { display: block; color: var(--muted); font-size: 10px; line-height: 1.5; }
.combo-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.combo-heading strong { color: var(--accent); font-size: 27px; margin: 0; }
#combo-progress { appearance: none; display: block; width: 100%; height: 9px; margin: 14px 0 10px; border: 0; border-radius: 5px; overflow: hidden; color: var(--accent); background: #101726; }
#combo-progress::-webkit-progress-bar { background: #101726; border-radius: 5px; }
#combo-progress::-webkit-progress-value { background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: 5px; }
#combo-progress::-moz-progress-bar { background: var(--accent); border-radius: 5px; }
.question-header { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 25px 0 20px; }
.question-header h2 { margin: 0 0 6px; font: 700 30px/1.2 var(--display); letter-spacing: -.9px; }
.question-header h2 > span { color: var(--accent); }
.question-header p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.clock { display: flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 8px; min-width: 94px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #12192a; font: 700 23px var(--display); font-variant-numeric: tabular-nums; }
.clock svg { width: 18px; color: var(--mint); }
.clock span span { margin-left: 3px; color: var(--muted); font-size: 12px; }
.board-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 7px 12px; margin-bottom: 10px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .8px; line-height: 1.5; }
#position-label { color: var(--accent); }
.fretboard-scroll { max-width: 100%; overflow-x: auto; border: 1px solid #475572; border-radius: 11px; background: var(--board-bg); box-shadow: inset 0 2px 10px #0003; scrollbar-width: thin; scrollbar-color: #6b7d9d var(--board-bg); }
.fretboard, .fretboard svg { height: 202px; }
.fretboard svg { display: block; overflow: visible; }
.fretboard.custom-board, .fretboard.custom-board svg { height: var(--board-height); }
.string-label { font: 700 12px var(--display); fill: #c5cee0; }
.fret-label { font: 400 10px var(--font); fill: #b4bfd6; }
.fret-label.outside { fill: #65738f; }
.board-legend { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 7px 12px; margin: 10px 0 22px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.board-legend > span:first-child { display: flex; align-items: center; gap: 7px; }
.target-key { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px #ffad9118; }
.answer-heading { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 12px; }
.keyboard-hint { color: var(--muted); font-size: 10px; }
.note-buttons { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 7px; }
.note-button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; min-width: 0; height: 78px; padding: 4px 0; border: 1px solid #65718a; border-bottom-width: 4px; border-radius: 9px; background: #dfe5f1; color: #172136; font: 700 21px var(--display); box-shadow: 0 3px 0 #0b1020; }
.note-button.accidental { border-color: #53617f; background: #303b57; color: var(--text); }
.note-button kbd { color: #475670; font: 600 10px var(--font); }
.note-button.accidental kbd { color: #b0bbd2; }
.note-button:hover:not(:disabled) { background: var(--mint); border-color: #5baf9c; color: #152c2b; transform: translateY(-2px); box-shadow: 0 5px 0 #0b1020; }
.note-button:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.note-button:disabled { opacity: .58; }
.note-button.correct, .note-button.correct:disabled { background: var(--green); border-color: #88b95a; color: #20301c; opacity: 1; }
.note-button.correct kbd { color: #405a2b; }
.note-button.wrong, .note-button.wrong:disabled { border-color: #b7787d; background: #543444; color: #ffd3d7; opacity: 1; }
.note-button.wrong kbd { color: #e5aab4; }
.feedback-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 105px; padding: 18px 0; }
.feedback-copy { min-width: 0; }
.feedback-row p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.feedback-row p.success { color: var(--green); }
.feedback-row p.error { color: #ffb5bf; }
.feedback-row .reward-label { margin-top: 5px; color: var(--accent); font-size: 11px; font-weight: 600; }
.primary-button { display: flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 16px; min-height: 44px; padding: 11px 17px; border: 1px solid #ec977a; border-bottom-width: 3px; border-radius: 9px; background: var(--accent); color: #30201e; font-size: 12px; font-weight: 700; white-space: nowrap; }
.primary-button:hover { background: #ffc2ad; }
.primary-button span { font-size: 18px; }
.text-button { min-height: 44px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: #20283e; color: var(--text); font-size: 12px; white-space: nowrap; }
.text-button:hover { border-color: var(--mint); }
.text-button span { margin-left: 8px; color: var(--mint); }
.tip-card { width: min(100%, 650px); margin: 0 auto 23px; padding: 20px; border: 1px solid #344a51; border-radius: 14px; background: linear-gradient(145deg, #1c2c36, #1a2336); text-align: center; }
.tip-card h3 { margin: 0 0 5px; color: var(--mint); font: 700 15px var(--display); }
.tip-icon { margin-right: 4px; font-size: 19px; }
.tip-card p { max-width: 490px; margin: 0 auto; color: #b0bfce; font-size: 11px; line-height: 1.75; }
.tip-card .guide-subtitle { color: var(--muted); font-size: 10px; }
.fourths-content { margin-top: 6px; }
.fourths-circle { width: 100%; max-width: 260px; margin: 0 auto 4px; }
.fourths-circle svg { display: block; width: 100%; height: auto; }
.fourths-note { font: 700 15px var(--display); }
.fourths-caption { fill: var(--muted); font: 600 8px var(--font); letter-spacing: 1.5px; }
.fourths-center { fill: var(--green); font: 700 30px var(--display); }
.guide-details { max-width: 490px; margin: 12px auto 0; color: var(--mint); font-size: 11px; }
.guide-details summary { padding: 5px; }
.guide-details p { margin-top: 8px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; padding: 22px 0; border-top: 1px solid var(--border); }
.stat-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .7px; line-height: 1.5; }
.stats-grid strong { display: block; font: 700 27px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.8px; }
.stats-grid small { margin-left: 4px; color: var(--muted); font: 400 12px var(--display); letter-spacing: 0; }
.stats-grid .streak-icon { margin-left: 8px; color: var(--accent); font-size: 18px; }
.scoring-guide { padding: 16px 0; border-top: 1px solid var(--border); }
.scoring-guide > summary { color: var(--text); font-size: 12px; line-height: 1.6; }
.scoring-guide > summary::marker { color: var(--mint); }
.summary-hint { float: right; color: var(--muted); font-size: 9px; letter-spacing: 1px; }
.scoring-content { padding: 2px 0 1px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.scoring-content strong { color: var(--text); font-weight: 600; }
.settings-panel { padding: 23px 20px; }
.settings-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.settings-heading .eyebrow { color: var(--accent); font-size: 9px; letter-spacing: 1.2px; }
.settings-heading h2 { margin: 6px 0 0; font: 700 23px var(--display); letter-spacing: -.6px; }
.settings-heading svg { width: 25px; color: var(--muted); }
.field-label { color: #bac4d9; font-size: 10px; font-weight: 600; letter-spacing: 1px; }
.segmented-control { display: flex; gap: 4px; margin: 10px 0 25px; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: #111828; }
.segmented-control button { flex: 1; min-width: 0; padding: 10px 2px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.segmented-control small { display: block; margin-top: 5px; font-size: 9px; font-weight: 400; }
.segmented-control button[aria-pressed=true] { border-color: #628779; background: #28433f; color: #bcf2df; }
.segmented-control button:hover:not([aria-pressed=true]) { background: var(--surface); color: var(--text); }
.range-heading { display: flex; align-items: center; justify-content: space-between; }
.range-heading > span { color: var(--mint); font: 700 14px var(--display); }
.field-description { margin: 9px 0 16px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.range-fields { display: grid; grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr); align-items: center; gap: 10px; margin-bottom: 19px; }
.range-fields label { color: var(--muted); font-size: 11px; }
.range-fields > span { padding-top: 20px; color: var(--muted); text-align: center; }
.range-fields input, .custom-count input { width: 100%; height: 43px; margin-top: 7px; padding: 9px 11px; border: 1px solid #4b5873; border-radius: 8px; background: #111a2b; color: var(--text); font: 700 17px var(--display); }
.slider-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.slider-label span { color: var(--text); font-variant-numeric: tabular-nums; }
.range-slider { display: block; width: 100%; height: 24px; margin: 5px 0 13px; accent-color: var(--mint); cursor: pointer; }
.presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-top: 15px; }
.presets button { min-height: 36px; padding: 7px 0; border: 1px solid #475570; border-radius: 6px; background: transparent; color: #bdc7dc; font-size: 11px; white-space: nowrap; }
.presets button[aria-pressed=true], .presets button:hover { border-color: var(--mint); background: #8de3ce10; color: var(--mint); }
.setting-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; color: var(--text); font-size: 12px; cursor: pointer; }
.setting-toggle small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.setting-toggle input { appearance: none; position: relative; flex-shrink: 0; width: 38px; height: 23px; margin: 0; border: 1px solid #697691; border-radius: 20px; background: #28324b; cursor: pointer; }
.setting-toggle input::before { content: ''; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #b2bed4; transition: transform .16s; }
.setting-toggle input:checked { border-color: var(--mint); background: var(--mint); }
.setting-toggle input:checked::before { background: #18342e; transform: translateX(15px); }
.settings-divider { height: 1px; margin: 23px 0 20px; background: var(--border); }
.notation-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.notation-row select, .custom-string select { min-height: 38px; padding: 8px; border: 1px solid #4b5873; border-radius: 7px; background: #111a2b; color: var(--text); font-size: 12px; }
.settings-note { margin: 17px 0; color: var(--muted); font-size: 10px; line-height: 1.8; }
.reset-button { width: 100%; min-height: 43px; padding: 10px; border: 1px solid #536078; border-radius: 8px; background: transparent; color: #ced6e7; font-size: 12px; }
.reset-button:hover { background: var(--surface); border-color: var(--accent); color: var(--accent); }
.reset-button span { margin-right: 7px; font-size: 16px; }
.custom-instrument { padding-bottom: 20px; margin-bottom: 23px; border-bottom: 1px solid var(--border); }
.custom-count { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.custom-count input { width: 68px; margin: 0; }
.custom-tuning { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
.custom-string { display: flex; justify-content: space-between; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.custom-string select { min-width: 0; width: 57px; padding: 7px 3px; }
.custom-instrument .settings-note { margin-bottom: 0; }
.below-workspace { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 18px 1px 30px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.below-workspace > span:first-child { display: flex; align-items: center; gap: 8px; }
.below-workspace .green-dot { width: 4px; height: 4px; }
footer { display: flex; justify-content: space-between; gap: 15px; padding: 21px 0 27px; border-top: 1px solid var(--border); color: var(--muted); font-size: 9px; letter-spacing: 1px; line-height: 1.6; }
footer > span:last-child { font-size: 11px; letter-spacing: 0; }
.footer-slash { margin: 0 8px; color: var(--mint); }

@media (min-width: 1350px) {
  .quiz-panel { padding: 25px 30px 0; }
  .note-button { height: 84px; }
}

@media (max-width: 1150px) {
  .page-shell { padding: 0 26px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 270px; gap: 18px; }
  .quiz-panel { padding: 21px 20px 0; }
  .settings-panel { padding: 22px 17px; }
  .header-tag { display: none; }
  .performance-hud > div { padding: 13px 12px; }
  .hud-caption { font-size: 9px; }
  .note-buttons { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
  .note-button { flex-direction: row; gap: 13px; height: 58px; }
  .stats-grid { gap: 10px; }
  .stat-label { font-size: 8px; letter-spacing: .3px; }
  .question-header h2 { font-size: 28px; }
  .summary-hint { display: none; }
}

@media (max-width: 850px) {
  .page-shell { padding: 0 22px; }
  .site-header { min-height: 74px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .note-button kbd, .keyboard-only { display: none; }
  .intro { padding: 25px 0; }
  .intro-decoration { padding-right: 0; gap: 4px; }
  .intro-decoration span { width: 5px; }
  .performance-hud > div { padding: 15px 18px; }
  .hud-caption { font-size: 10px; }
  .settings-panel { padding: 23px; }
  .custom-tuning { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .custom-string { font-size: 12px; }
  .stat-label { font-size: 9px; letter-spacing: .5px; }
  .below-workspace > span:last-child { display: none; }
  .summary-hint { display: inline; }
}

@media (max-width: 520px) {
  .page-shell { padding: 0 13px; }
  .site-header { min-height: 68px; gap: 12px; }
  .brand { font-size: 26px; }
  .practice-label { display: none; }
  .intro { padding: 22px 3px; }
  .intro .eyebrow { font-size: 8px; letter-spacing: 1px; }
  h1 { max-width: 340px; font-size: 30px; line-height: 1.13; letter-spacing: -1px; }
  h1 > span { display: block; }
  .intro-copy { max-width: 300px; font-size: 12px; }
  .intro-decoration { display: none; }
  .quiz-panel { padding: 16px 13px 0; border-radius: 15px; }
  .quiz-topline { gap: 7px; }
  .quiz-topline .eyebrow { font-size: 8px; letter-spacing: .7px; }
  .session-status { padding: 5px 7px; font-size: 7px; letter-spacing: .5px; }
  .performance-hud { grid-template-columns: 1fr 1fr; margin-top: 14px; }
  .performance-hud > div { padding: 12px; }
  .performance-hud .score-card { order: 0; }
  .performance-hud .best-card { order: 1; }
  .performance-hud .combo-card { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 2px 13px; order: 2; grid-column: 1 / -1; border-top: 1px solid #465271; border-left: 0; padding: 9px 12px; }
  .combo-heading { grid-row: 1 / 3; flex-direction: column; align-items: flex-start; gap: 2px; }
  .combo-heading strong { font-size: 25px; }
  #combo-progress { height: 8px; margin: 5px 0 3px; }
  .performance-hud strong { font-size: 30px; }
  .best-card strong { margin: 5px 0; }
  .performance-hud .combo-heading strong { font-size: 24px; margin: 0; }
  .hud-label { font-size: 9px; letter-spacing: .8px; }
  .hud-caption { font-size: 9px; }
  .question-header { gap: 10px; margin: 21px 0 17px; }
  .question-header h2 { font-size: 26px; }
  .question-header p { font-size: 11px; line-height: 1.5; }
  .clock { min-width: 77px; gap: 5px; padding: 9px 8px; font-size: 20px; }
  .clock svg { width: 16px; }
  .board-top { font-size: 8px; letter-spacing: .5px; }
  .fretboard, .fretboard svg { height: 190px; }
  .board-legend { font-size: 9px; margin-bottom: 19px; }
  .answer-heading .eyebrow { font-size: 9px; letter-spacing: .9px; }
  .keyboard-hint { font-size: 9px; }
  .note-buttons { gap: 7px 5px; }
  .note-button { height: 61px; flex-direction: column; gap: 4px; font-size: 19px; border-radius: 7px; }
  .feedback-row { flex-wrap: wrap; gap: 12px; padding: 18px 0; }
  .feedback-copy { flex: 1 1 100%; }
  .feedback-row p { font-size: 11px; }
  .primary-button, .text-button { width: 100%; }
  .tip-card { padding: 17px 12px; margin-bottom: 20px; }
  .tip-card h3 { font-size: 14px; }
  .fourths-circle { max-width: 245px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 15px; padding: 20px 0; }
  .stat-label { font-size: 9px; margin-bottom: 6px; }
  .stats-grid strong { font-size: 26px; }
  .summary-hint { display: none; }
  .settings-panel { padding: 21px 18px; border-radius: 15px; }
  .custom-tuning { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .below-workspace { font-size: 10px; margin-bottom: 23px; }
  footer { flex-direction: column; gap: 7px; }
}

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