/* 노엘 노엘 연습실 — 큰 글씨, 넓은 버튼, 절제된 남회색 */
:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --ink: #1b2a3d;
  --sub: #55637a;
  --line: #d5dbe5;
  --navy: #1f3a5f;
  --navy-soft: #e4eaf3;
  --ok: #1a7f5e;
  --ok-soft: #dff3ea;
  --warn: #b26a00;
  --warn-soft: #fbefd9;
  --risk: #c2332b;
  --gold: #d99a16;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 19px; line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
body.big { font-size: 22px; }
#app { max-width: 1120px; margin: 0 auto; padding: 0 16px 56px;
  padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.boot { padding: 60px 0; text-align: center; color: var(--sub); }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 1.45em; }
h2 { font-size: 1.2em; }
h3 { font-size: 1.05em; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #f2b631; outline-offset: 2px; }

.top { display: flex; align-items: center; gap: 12px; padding: 16px 0 12px; flex-wrap: wrap; }
.top .grow { flex: 1; min-width: 0; }
.top .title-sub { color: var(--sub); font-size: 0.85em; }
.back { min-height: 52px; padding: 0 16px; border: 2px solid var(--line); background: var(--card); border-radius: 12px; font-weight: 600; white-space: nowrap; }

.btn { min-height: 56px; padding: 0 20px; border-radius: 14px; border: 2px solid var(--navy); background: var(--navy); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.btn.ghost { background: var(--card); color: var(--navy); }
.btn.quiet { background: var(--card); color: var(--ink); border-color: var(--line); font-weight: 600; }
.btn.small { min-height: 48px; padding: 0 14px; font-size: 0.92em; }
.btn[disabled] { opacity: 0.45; cursor: default; }
.btn.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.card h2 { margin-bottom: 10px; }
.hint { color: var(--sub); font-size: 0.92em; }
.note { background: var(--navy-soft); border-radius: 12px; padding: 12px 14px; font-size: 0.95em; }
.note.warn { background: var(--warn-soft); }

/* 홈 */
.today { display: flex; gap: 12px; flex-wrap: wrap; }
.today .stat { flex: 1; min-width: 130px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.today .stat b { display: block; font-size: 1.6em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.today .stat span { color: var(--sub); font-size: 0.88em; }
.parts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.parts button { min-height: 72px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-weight: 700; font-size: 1.05em; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
.parts button small { font-weight: 500; color: var(--sub); font-size: 0.72em; }
.parts button.on { border-color: var(--navy); background: var(--navy); color: #fff; }
.parts button.on small { color: #cfd9e8; }
@media (max-width: 560px) { .parts { grid-template-columns: repeat(2, 1fr); } }
.songs { display: flex; flex-direction: column; gap: 10px; }
.song { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; min-height: 78px; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.song:hover { border-color: var(--navy); }
.song .num { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--navy-soft); color: var(--navy); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.song .meta { flex: 1; min-width: 0; }
.song .meta b { display: block; font-size: 1.08em; }
.song .meta span { color: var(--sub); font-size: 0.86em; }
.song .stars { font-size: 1.25em; letter-spacing: 2px; color: var(--gold); white-space: nowrap; }
.song .stars i { font-style: normal; color: #cfd5df; }
.weak-tag { display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 999px; background: #fbe3e1; color: var(--risk); font-size: 0.8em; font-weight: 700; }

/* 곡 화면 */
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tabs button { min-height: 60px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-weight: 700; line-height: 1.2; padding: 4px; }
.tabs button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.scorebox { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; position: relative; }
.scorebox canvas { display: block; width: 100%; }
.scorebox .where { position: absolute; left: 10px; top: 8px; background: rgba(31,58,95,0.92); color: #fff; border-radius: 999px; padding: 2px 12px; font-size: 0.82em; font-weight: 700; font-variant-numeric: tabular-nums; }
.scorebox .restmsg { position: absolute; right: 10px; top: 8px; background: var(--warn-soft); color: var(--warn); border-radius: 999px; padding: 2px 12px; font-size: 0.82em; font-weight: 700; }
.transport { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.playbtn { white-space: nowrap; font-size: 0.92em; width: 92px; height: 92px; border-radius: 50%; border: none; background: var(--navy); color: #fff; font-size: 1.05em; font-weight: 800; }
.playbtn[disabled] { opacity: 0.5; font-size: 0.9em; }
.playbtn.playing { background: var(--ink); }
.seek { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.seek input[type=range] { width: 100%; height: 36px; accent-color: var(--navy); }
.seek .lab { display: flex; justify-content: space-between; color: var(--sub); font-size: 0.86em; font-variant-numeric: tabular-nums; }
.jump { display: flex; flex-direction: column; gap: 6px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 48px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); font-weight: 600; font-size: 0.94em; }
.chip.on { border-color: var(--navy); background: var(--navy-soft); color: var(--navy); }
.chip.on::before { content: "✓ "; }
.grp { display: flex; flex-direction: column; gap: 6px; }
.grp > label, .grp > .lab { font-weight: 700; font-size: 0.92em; color: var(--sub); }
.live { min-height: 92px; border-radius: 16px; padding: 14px 18px; display: flex; align-items: center; gap: 16px; background: var(--navy-soft); }
.live .big { font-size: 1.5em; font-weight: 800; line-height: 1.2; }
.live .arrow { font-size: 2.4em; line-height: 1; width: 56px; text-align: center; }
.live.ok { background: var(--ok-soft); color: var(--ok); }
.live.off { background: var(--warn-soft); color: var(--warn); }
.tappad { width: 100%; min-height: 150px; border-radius: 22px; border: 3px solid var(--navy); background: var(--card); font-size: 1.5em; font-weight: 800; color: var(--navy); touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.tappad:active, .tappad.hit { background: var(--navy); color: #fff; }
.result { border: 2px solid var(--navy); }
.result .pct { font-size: 2.6em; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.result .starsbig { font-size: 1.8em; color: var(--gold); letter-spacing: 4px; }
.result .starsbig i { font-style: normal; color: #cfd5df; }
.mlist { display: flex; gap: 8px; flex-wrap: wrap; }
.mlist button { min-height: 48px; padding: 0 14px; border-radius: 12px; border: 2px solid #f0c9c6; background: #fff6f5; font-weight: 700; color: var(--risk); }
.quizimg { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.quizimg canvas { display: block; width: 100%; }
.answers { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.answers.three { grid-template-columns: repeat(3, 1fr); }
.answers button { min-height: 64px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-weight: 800; font-size: 1.1em; }
.answers button.right { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.answers button.wrong { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
@media (max-width: 560px) { .answers { grid-template-columns: repeat(4, 1fr); } .tabs { grid-template-columns: repeat(2, 1fr); } .transport { grid-template-columns: auto 1fr; } .jump { grid-column: 1 / -1; flex-direction: row; } .jump .btn { flex: 1; } }

/* 설명 */
.lesson svg { width: 100%; height: auto; display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.lesson p { margin-top: 10px; }
.lesson ul { margin: 8px 0 0; padding-left: 1.2em; }
.lesson li { margin: 4px 0; }
table.log { width: 100%; border-collapse: collapse; font-size: 0.92em; }
table.log th, table.log td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.log td.n { font-variant-numeric: tabular-nums; text-align: right; }
.field { min-height: 56px; width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 0 14px; font: inherit; background: #fff; color: var(--ink); }
.meter { height: 18px; border-radius: 9px; background: var(--navy-soft); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--ok); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 600; z-index: 50; max-width: 92vw; text-align: center; }
@media (prefers-reduced-motion: no-preference) { .tappad { transition: background 0.08s; } }

@media (max-width: 560px) {
  .top .grow { order: 3; flex-basis: 100%; }
  .top .back { flex: 1; }
}
