@font-face {
  font-family: "Bravura";
  src: url("../assets/fonts/bravura/Bravura.woff2") format("woff2");
  font-display: swap;
}

:root {
  --ink: #172b3a;
  --ink-soft: #4d6270;
  --paper: #f7f5ef;
  --surface: #fffdf8;
  --surface-muted: #edf1ee;
  --line: #d5ded8;
  --accent: #a93b25;
  --teal: #1b776c;
  --teal-dark: #14554e;
  --shadow: 0 18px 44px rgba(23, 43, 58, .11);
  font-family: "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 8% 12%, #fff5dc 0, transparent 28%), linear-gradient(135deg, #f7f5ef 0%, #e7f0ed 100%); font-size: 16px; }
button, select { font: inherit; }
button:focus-visible, select:focus-visible { outline: 3px solid rgba(27, 119, 108, .42); outline-offset: 3px; }
.app-shell { width: min(100% - 40px, 1000px); margin: 0 auto; padding: 32px 0 48px; }
.app-header, .action-row, .results-actions { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.app-header { margin-bottom: 40px; }
.eyebrow, .kicker { margin: 0 0 8px; color: var(--teal); font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; font-family: "Trebuchet MS", sans-serif; }
h1 { font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.05; }
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h3 { font-size: 1.15rem; }
.progress-block { width: min(240px, 32vw); flex: 0 0 auto; }
.progress-block > span { display: block; margin-bottom: 8px; color: var(--ink-soft); font-size: .9rem; font-weight: 700; text-align: right; }
.progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: #d4dfdb; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width 240ms ease; }
.instruction { max-width: 790px; margin: 14px 0 24px; color: var(--ink-soft); line-height: 1.55; }
.score-card { overflow-x: auto; padding: 20px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 253, 248, .9); box-shadow: var(--shadow); }
.notation { min-width: 660px; }
.notation svg { display: block; width: 100%; height: auto; }
.answer-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 253, 248, .86); }
.time-signature-input { display: grid; grid-template-rows: 42px 2px 42px; justify-items: center; width: 64px; }
.time-signature-input select { width: 64px; padding: 0 4px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--surface); font-size: 1.2rem; font-weight: 700; text-align: center; text-align-last: center; }
.signature-divider { width: 52px; background: var(--ink); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.action-row { align-items: flex-start; margin-top: 22px; }
.feedback { flex: 1; min-height: 1.5em; margin: 10px 0 0; color: var(--ink-soft); line-height: 1.5; }
.primary-button, .secondary-button { min-height: 48px; padding: 0 20px; border: 0; border-radius: 7px; font-weight: 700; cursor: pointer; }
.primary-button { flex: 0 0 auto; color: #fffaf5; background: var(--accent); }
.primary-button:hover { background: #832e1d; }
.primary-button:disabled { opacity: .6; cursor: wait; }
.secondary-button { color: var(--teal-dark); border: 2px solid var(--teal); background: transparent; }
.secondary-button:hover { color: #fff; background: var(--teal); }
.results-view { animation: rise-in 360ms ease both; }
.score-summary { margin: 12px 0 24px; color: var(--ink-soft); font-size: 1.1rem; }
.results-list { display: grid; gap: 10px; }
.result-item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-left: 5px solid var(--teal); border-radius: 8px; background: var(--surface); }
.result-item.is-wrong { border-left-color: var(--accent); }
.result-number { color: var(--ink-soft); font-weight: 700; }
.result-points { font-weight: 700; white-space: nowrap; }
.result-correction { grid-column: 2 / -1; padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink-soft); line-height: 1.5; }
.result-correction strong { color: var(--ink); }
.scorm-status { max-width: 520px; color: var(--ink-soft); font-size: .88rem; line-height: 1.5; }
.app-footer { padding: 0 20px 22px; color: var(--ink-soft); font-size: .8rem; text-align: center; }
[hidden] { display: none !important; }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 700px) {
  .app-shell { width: calc(100% - 28px); padding-top: 22px; }
  .app-header { align-items: flex-start; flex-direction: column; margin-bottom: 30px; }
  .progress-block { width: 100%; }
  .progress-block > span { text-align: left; }
  .action-row, .results-actions { align-items: stretch; flex-direction: column; gap: 8px; }
  .primary-button { width: 100%; }
}
@media (max-width: 390px) {
  .answer-panel { padding: 14px; }
  .result-item { grid-template-columns: 24px minmax(0, 1fr); }
  .result-points { grid-column: 2; }
  .result-correction { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
