@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  color-scheme: light;
  font-family: Nunito, ui-rounded, "Segoe UI", sans-serif;
  color: #284c52;
  background: #fbfaf3;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 15% 30%, #e4f4e9 0, transparent 48%), radial-gradient(ellipse at 90% 70%, #e7f2fc 0, transparent 45%), #fbfaf3;
}
button, select, input { font: inherit; }
button, summary, input[type="range"], select { -webkit-tap-highlight-color: transparent; }
button, summary { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
a { color: #356b76; }
.topbar { max-width: 1000px; margin: auto; padding: 24px 28px 12px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 900; letter-spacing: -.8px; text-decoration: none; color: #397b73; }
.wordmark > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 11px; background: #dcefe4; color: #35766b; }
main { width: min(100% - 32px, 570px); margin: 14px auto 30px; }
.lesson-card { padding: 30px 42px 18px; border: 2px solid #fff; border-radius: 36px; background: #fffefa; box-shadow: 0 16px 60px #547a681a; text-align: center; }
.song-heading { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 9px; }
h1 { margin: 0; font-size: 25px; line-height: 1.3; font-weight: 900; letter-spacing: -.6px; }
.song-art { font-size: 25px; }
.singing-friend { width: 148px; height: 148px; margin: 24px auto 12px; display: grid; place-items: center; border-radius: 50%; background: #e5f4ed; box-shadow: 0 0 0 9px #f2f9f1; }
.singing-friend > span { font-size: 104px; line-height: 1; filter: drop-shadow(0 5px 0 #b6d5c542); transform: rotate(-5deg); }
.note-card { padding: 13px 0 0; }
.target-note { min-height: 83px; display: flex; align-items: center; justify-content: center; color: #28575d; font-size: clamp(27px, 5.7vw, 35px); line-height: 1.25; font-weight: 900; letter-spacing: -.6px; text-wrap: balance; }
.note-hint { margin: 8px auto 18px; color: #557078; font-size: 16px; line-height: 1.5; min-height: 24px; text-wrap: balance; }
.pitch-feedback { margin: 0 auto 16px; }
.note-card.is-ready .pitch-feedback, .note-card.is-song-playing:not(.is-scored) .pitch-feedback { display: none; }
.controls { margin: 0 auto; }
.button { min-height: 52px; display: inline-flex; justify-content: center; align-items: center; gap: 10px; border-radius: 18px; font-weight: 800; }
.button-primary { width: 100%; max-width: 330px; min-height: 70px; border: 0; background: #287767; color: #fff; font-size: 23px; box-shadow: 0 5px 0 #1b584d; transition: background .15s, transform .15s; }
.button-primary:hover { background: #216758; }
.button-primary:active { transform: translateY(3px); box-shadow: 0 2px 0 #1b584d; }
.button-primary.is-listening { background: #347aa7; box-shadow: 0 5px 0 #245d82; }
.button-primary:disabled { opacity: .7; }
.mic-message { margin: 20px 0 0; padding: 12px 16px; border-radius: 16px; background: #fff1df; color: #795438; font-size: 14px; line-height: 1.5; }
.progress-block { max-width: 330px; margin: 25px auto 16px; }
.progress-track { height: 7px; border-radius: 20px; background: #e5eeeb; overflow: hidden; }
.progress-track > span { display: block; width: 0; height: 100%; background: #83bcb0; border-radius: inherit; transition: width .2s linear; }
summary { cursor: pointer; }
.recording-info { margin: 18px auto 0; padding: 0 12px; color: #5e7478; font-size: 12px; line-height: 1.6; }
.recording-info > summary { width: fit-content; min-height: 44px; margin: auto; padding: 12px; }
.recording-info p { margin: 8px 0 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 3px solid #237fa2; outline-offset: 4px; }
@media (max-width: 480px) {
  .topbar { padding: 18px 22px 8px; }
  main { margin-top: 8px; }
  .lesson-card { padding: 24px 22px 14px; border-radius: 28px; }
  .singing-friend { width: 128px; height: 128px; margin-top: 23px; }
  .singing-friend > span { font-size: 90px; }
  .target-note { min-height: 78px; }
  .button-primary { min-height: 66px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}


.star-lane { position: relative; height: 112px; overflow: hidden; border: 1px solid #d9e9df; border-radius: 24px; background: repeating-linear-gradient(to bottom, transparent 0, transparent 27px, #cddfdc60 27px, #cddfdc60 28px), linear-gradient(110deg, #e5f4ed, #edf6ff); }
.star-target { position: absolute; left: 18%; top: 50%; width: 43px; height: 43px; border: 3px dashed #77a7b7; border-radius: 50%; transform: translate(-50%, -50%); transition: top .12s ease; }
.star-target.is-waiting { opacity: .35; }
.voice-dot { position: absolute; z-index: 2; left: 18%; top: 50%; width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: #347aa7; color: white; font-size: 19px; font-weight: 900; transform: translate(-50%, -50%); transition: top .12s ease, background .15s; box-shadow: 0 2px 8px #35768b33; }
.voice-dot.is-quiet { opacity: .25; }
.note-star { position: absolute; top: 50%; left: 95%; color: #e3b252; font-size: 25px; line-height: 1; transform: translate(-50%, -50%); text-shadow: 0 2px 0 #fff; }
.note-star.is-caught { color: #64a981; }
.game-caption { min-height: 25px; margin: 9px 0 0; color: #557078; font-size: 16px; font-weight: 800; }
.note-card[data-pitch="match"] .voice-dot { background: #62a97d; box-shadow: 0 0 0 6px #b9e4c777; }
.note-card[data-pitch="match"] .star-target { border-color: #83ba8b; background: #ddf2e3; }
.reward-shelf { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 18px; color: #526f68; font-size: 14px; font-weight: 800; }
.star-count { padding: 6px 12px; border-radius: 14px; background: #fff3cf; color: #947029; font-size: 18px; white-space: nowrap; }
.lesson-card:has(.note-card[data-pitch="match"]) .singing-friend > span { transform: rotate(7deg) scale(1.08); }
.singing-friend > span { transition: transform .2s ease; }
@media (max-width: 480px) {
  .lesson-card:has(.is-scored) .singing-friend { width: 88px; height: 88px; margin: 18px auto 6px; }
  .lesson-card:has(.is-scored) .singing-friend > span { font-size: 68px; }
  .reward-shelf { gap: 8px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .star-target, .voice-dot, .singing-friend > span { transition: none; }
}

.restart-button { display: block; min-height: 48px; margin: 0 auto; padding: 10px 18px; border: 0; border-radius: 16px; background: transparent; color: #526f73; font-size: 16px; font-weight: 800; }
.restart-button:hover { background: #edf5ef; }

.song-picker { max-width: calc(100% - 42px); min-height: 48px; padding: 8px 28px 8px 10px; border: 1px solid #d1e3d9; border-radius: 14px; background: #f4faf6; color: #28575d; font: 900 clamp(14px, 3.6vw, 20px)/1.3 Nunito, ui-rounded, "Segoe UI", sans-serif; cursor: pointer; }
.song-picker:disabled { opacity: .65; cursor: wait; }
.song-picker option { font-size: 16px; font-weight: 600; }

.practice-tracker { margin-top: 18px; padding-top: 20px; border-top: 1px solid #e2ece4; }
.score-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.score-pair > div { padding: 12px 8px; border-radius: 18px; background: #f0f7f0; }
.score-pair > div:last-child { background: #fff7de; }
.score-label { display: block; margin-bottom: 4px; color: #557078; font-size: 13px; font-weight: 800; }
.score-pair strong { display: block; color: #28575d; font-size: 20px; font-weight: 900; }
.session-summary { margin: 12px 0 3px; color: #557078; font-size: 13px; }
.practice-history > summary { width: fit-content; min-height: 44px; margin: auto; padding: 12px; color: #526f73; font-size: 14px; font-weight: 800; }
.practice-history table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.practice-history th, .practice-history td { padding: 10px 6px; border-bottom: 1px solid #e6eee7; }
.practice-history tbody th { font-weight: 700; }
.practice-history td, .practice-history thead th:not(:first-child) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.practice-history p { color: #5e7478; font-size: 12px; line-height: 1.5; text-align: left; }
