/* Etude — 스타일 (공통 바탕·버튼·이전 버튼 등은 /games/common/ui.css)
   Beat와 같은 밤하늘 바탕과 4색(로즈·앰버·민트·아이리스)을 쓰되, 악기마다 한 색을 맡김
   피아노=아이리스, 기타=앰버, 바이올린=로즈, 플룻=민트
   글꼴: Unbounded(워드마크·숫자) + Pretendard(본문) + Noto Music(음자리표·변화표) */
:root { --music: "Noto Music", "Segoe UI Symbol", "Apple Symbols", serif; }
body[data-inst="piano"] { --accent: var(--l3); }
body[data-inst="guitar"] { --accent: var(--l1); }
body[data-inst="violin"] { --accent: var(--l0); }
body[data-inst="flute"] { --accent: var(--l2); }


#home, #library { --col-half: 380px; }

/* ---------- 버튼 ---------- */
.btn:focus-visible, .mode:focus-visible, .song:focus-visible, .inst:focus-visible, .seg button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, .link:focus-visible, .heat button:focus-visible, .key:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn-solid:disabled { opacity: .4; cursor: default; }
.back { margin: -10px 0 8px -16px; }


/* ---------- 홈 ---------- */
.home-inner { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 760px; width: 100%; }
.instruments { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; width: 100%; margin-bottom: 26px; }
@media (max-width: 680px) { .instruments { grid-template-columns: repeat(2, 1fr); } }
.inst {
  --c: var(--l2);
  position: relative; overflow: hidden; text-align: left; cursor: pointer;
  border-radius: 22px; padding: 18px 16px 16px; min-height: 172px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 16%, transparent), rgba(246,242,255,0.03) 60%);
  border: 1.5px solid var(--faint);
  transition: border-color .2s, transform .2s cubic-bezier(.2,.8,.2,1);
}
.inst:hover { border-color: color-mix(in srgb, var(--c) 60%, transparent); transform: translateY(-3px); }
.inst svg { width: 56px; height: 56px; color: var(--c); filter: drop-shadow(0 0 14px color-mix(in srgb, var(--c) 45%, transparent)); }
.inst b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.inst small { display: block; font: 500 11px/1.2 var(--display); color: var(--mute); letter-spacing: .04em; margin-top: 2px; }
.inst .prog { font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; }
.inst .prog b { display: inline; font-size: 13px; color: var(--c); font-weight: 700; }
.tools { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }


/* ---------- 패널 ---------- */

/* ---------- 곡 목록 ---------- */
.page { width: 100%; max-width: 760px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .back { flex-basis: 100%; margin: 0 0 4px -16px; justify-content: flex-start; align-self: flex-start; }
.lib-title { display: flex; align-items: center; gap: 14px; flex: 1 1 240px; min-width: 0; }
.lib-title h2 { margin: 0; font: 800 32px/1.1 var(--ui); letter-spacing: -0.02em; }
.lib-icon svg { width: 52px; height: 52px; color: var(--accent); filter: drop-shadow(0 0 14px color-mix(in srgb, var(--accent) 45%, transparent)); }
.lvl-group { margin: 0 0 22px; }
.lvl-name { margin: 0 0 10px; font: 700 12px/1 var(--display); letter-spacing: .08em; color: var(--mute); text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.lvl-name::after { content: ""; flex: 1; height: 1px; background: var(--faint); }
.songs { display: grid; gap: 8px; }
.song {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px;
  text-align: left; cursor: pointer; width: 100%;
  border-radius: var(--r-md); padding: 15px 18px;
  background: rgba(246,242,255,0.045); border: 1.5px solid transparent;
  transition: border-color .15s, background-color .15s;
}
.song:hover { border-color: var(--line); background: rgba(246,242,255,0.07); }
.song-name { min-width: 0; }
.song-name b { display: block; font-size: 17px; font-weight: 700; word-break: keep-all; overflow-wrap: anywhere; }
.song-name span { display: block; font-size: 13.5px; color: var(--mute); margin-top: 2px; }
.song-len { font: 500 12px var(--display); color: var(--mute); font-variant-numeric: tabular-nums; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); margin-left: 6px; vertical-align: 2px; }
.star-row { display: inline-flex; gap: 2px; }
.star-row svg { width: 16px; height: 16px; }
.empty { color: var(--mute); padding: 18px; border: 1.5px dashed var(--line); border-radius: var(--r-md); text-align: center; }

/* ---------- 준비 ---------- */
.overview { display: block; width: 100%; height: 64px; margin: 18px 0 20px; }
.art { margin: 18px 0 22px; }
.art svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 10px 24px rgba(5, 3, 20, 0.45)); }
#rdHelp:empty { display: none; }
/* 선택된 방식: 이름 뒤에 ▶ (한 번 더 누르면 시작) */
.mode[aria-checked="true"] b::after { content: '\25B6\FE0E'; font-size: .72em; margin-left: 5px; position: relative; top: -1px; }

.result-panel > .back { align-self: flex-start; justify-self: start; margin-right: auto; display: flex; }
#rdHelp { margin: -4px 0 14px; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
@media (pointer: coarse) { .keys-guide { display: none; } }
.keys-guide { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--mute); }
.kbd { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; margin: 0 4px 0 8px; border-radius: 6px; border: 1px solid var(--line); font: 600 11px var(--display); color: var(--ink); }

/* ---------- 플레이 ---------- */
/* 100dvh: 브라우저 주소창/아래 도구막대가 숨었다 나타나도 화면을 꽉 채움 (svh 만 쓰면 숨었을 때 아래가 비었음) */
#play { padding: 0; display: flex; flex-direction: column; height: 100vh; height: 100svh; height: 100dvh; min-height: 0; align-items: stretch; justify-content: stretch;
  background: linear-gradient(180deg, var(--abyss), #140F38 55%, var(--abyss)); }
.hud { padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); flex: none; }
.hud-progress { position: relative; height: 3px; border-radius: 3px; background: var(--faint); overflow: hidden; }
.hud-progress i { position: absolute; top: 0; bottom: 0; background: rgba(246,242,255,0.25); }
.hud-row { display: flex; align-items: center; gap: 18px; margin-top: 10px; }
.hud-stat { text-align: right; line-height: 1.1; }
#play.listen .hud-stat { display: none; }   /* 미리듣기에는 콤보·정확도가 없음 (위 줄 높이는 같아 악보 자리는 그대로) */
/* 연주 중엔 페이지가 끌려 움직이지 않게 (도구막대가 들락날락하며 화면이 출렁이는 것 방지) */
body[data-screen="play"] { overflow: hidden; overscroll-behavior: none; }
/* 아래 건반(악기 그림) 숨기기 — 그만큼 악보가 넓어짐 */
#play.no-helper .dock-helper { display: none !important; }
.dock-label.waiting { color: var(--accent); animation: waitPulse 1.4s ease-in-out infinite; }
@keyframes waitPulse { 50% { opacity: .55; } }
/* 폰 가로: 위에는 '‹ 이전'·제목만, 오른쪽 세로 칸에 설정·콤보·점수(정확도)·지금·들리는 소리·일시정지 */
@media (orientation: landscape) and (max-height: 500px) {
  #play { display: grid; grid-template-columns: auto 1fr 150px; grid-template-rows: auto auto auto auto auto auto 1fr auto;
    grid-template-areas: "prog prog gear" "back title gear" "stage stage combo" "stage stage score" "stage stage now" "stage stage meter" "stage stage ." "stage stage pp"; }
  #play::before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 150px; border-left: 1px solid var(--faint); background: rgba(12,9,38,0.6); pointer-events: none; }
  #play .hud, #play .hud-row, #play .dock { display: contents; }
  #play .hud-progress { grid-area: prog; margin: max(4px, env(safe-area-inset-top)) 12px 0 max(16px, env(safe-area-inset-left)); }
  #play .btn.hud-back { grid-area: back; margin: 2px 0 0 max(0px, env(safe-area-inset-left)); padding: 5px 12px 5px 14px; align-self: center; }
  #play .hud-title { grid-area: title; align-self: center; margin: 2px 12px 0 0; }
  #play .hud-btn { grid-area: gear; justify-self: end; align-self: start; width: 36px; height: 36px; margin: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 0 0; position: relative; }
  #play .hud-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; margin: 0 max(14px, env(safe-area-inset-right)) 0 14px; position: relative; }
  #play .hud-stat:nth-of-type(1) { grid-area: combo; margin-top: 10px; }
  #play .hud-stat:nth-of-type(2) { grid-area: score; margin-top: 8px; }
  #play .hud-num { font-size: 18px; }
  #play .stage-wrap { grid-area: stage; min-height: 0; }
  #play .dock-now, #play .dock-meter { flex-direction: column; align-items: flex-start; gap: 4px; margin: 0 max(14px, env(safe-area-inset-right)) 0 14px; position: relative; }
  #play .dock-now { grid-area: now; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--faint); }
  /* '지금'과 '들리는 소리' 사이는 넉넉히, 가는 선으로 나눔 */
  #play .dock-meter { grid-area: meter; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--faint); }
  #play .dock-note { font-size: 28px; } #play .dock-note.long { font-size: 16px; white-space: normal; line-height: 1.2; }
  #play .dock-heard { font-size: 20px; }
  #play .dock-meter .cents { width: 100%; margin: 6px 0 2px; }
  #play .dock-helper { display: none; }
  #play .dock .playpause { grid-area: pp; position: relative; top: auto; right: auto; justify-self: center; align-self: end; width: 52px; height: 52px;
    margin: 8px max(0px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) 0; }
}
.stage-wrap.is-paused canvas { opacity: .45; transition: opacity .2s; }
.stage-wrap.is-paused::after { content: '일시정지'; position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font: 700 22px var(--display); color: var(--ink); pointer-events: none; }
.stage-wrap { position: relative; flex: 1; min-height: 180px; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.toast { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); padding: 8px 16px; border-radius: 999px; background: rgba(12,9,38,0.75); border: 1px solid var(--line); font-size: 14px; font-weight: 600; opacity: 0; transition: opacity .25s; pointer-events: none; white-space: nowrap; }
.toast.on { opacity: 1; }

.dock {
  flex: none; display: grid; grid-template-columns: 180px 1fr 200px auto; gap: 14px; align-items: stretch;
  padding: 12px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(12,9,38,0), rgba(12,9,38,0.85) 30%);
  border-top: 1px solid var(--faint);
}
.dock-now, .dock-meter { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; }
.dock-label { font-size: 11.5px; color: var(--mute); letter-spacing: .02em; }
.dock-note { font: 800 40px/1.05 var(--ui); letter-spacing: -0.02em; color: var(--accent); }
.dock-hint { font-size: 13.5px; color: var(--ink); line-height: 1.35; word-break: keep-all; min-height: 2.7em; }
.dock-heard { font: 700 22px/1.2 var(--ui); }
.dock-cents { font: 500 12px var(--display); color: var(--mute); font-variant-numeric: tabular-nums; min-height: 1.2em; }
.cents { position: relative; height: 8px; border-radius: 8px; background: linear-gradient(90deg, rgba(255,111,145,.35), rgba(255,181,71,.25) 30%, rgba(62,230,200,.55) 44% 56%, rgba(255,181,71,.25) 70%, rgba(255,111,145,.35)); margin: 6px 0 4px; }
.cents i { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--ink); opacity: .5; }
.cents b { position: absolute; top: -4px; width: 6px; height: 16px; border-radius: 3px; background: var(--ink); left: 50%; transform: translateX(-50%); transition: left .08s linear, opacity .2s; opacity: 0; }
.dock-meter .link { align-self: flex-start; margin-top: 4px; font-size: 13px; }
.dock-helper { min-width: 0; display: flex; align-items: center; justify-content: center; min-height: 128px; }
.dock-helper svg { max-width: 100%; height: auto; display: block; }
.helper-pair { display: flex; gap: 18px; align-items: flex-end; justify-content: center; }
.helper-pair figure { margin: 0; text-align: center; }
.helper-pair figcaption { font: 700 15px var(--display); margin-top: 2px; }
.helper-pair .next { opacity: .45; }
.helper-pair .next figcaption { font-size: 12px; }

/* 화면 건반 */
.keys { position: relative; width: 100%; height: 118px; user-select: none; -webkit-user-select: none; touch-action: none; }
.key { position: absolute; top: 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; font: 600 10px var(--display); cursor: pointer; transition: background-color .08s; }
.key.w { height: 100%; background: linear-gradient(180deg, #E9E4FF, #F6F2FF 70%); color: #6b62a8; border-radius: 0 0 8px 8px; border: 1px solid #2a2160; }
.key.b { height: 60%; background: linear-gradient(180deg, #2a2160, #140F38); color: transparent; border-radius: 0 0 6px 6px; z-index: 2; border: 1px solid #0C0926; }
.key.w.target { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 55%, #fff), color-mix(in srgb, var(--accent) 30%, #fff)); box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 70%, transparent); color: var(--abyss); }
.key.b.target { background: var(--accent); box-shadow: 0 0 22px var(--accent); }
.key.next { box-shadow: inset 0 -5px 0 color-mix(in srgb, var(--accent) 55%, transparent); }
.key.heard::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 22px; height: 6px; border-radius: 6px; background: var(--l1); box-shadow: 0 0 10px var(--l1); }
.key.b.heard::after { bottom: 10px; }
.key.down { filter: brightness(.82); }
.chord-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; touch-action: none; }
.chord-btns button { font: 700 18px var(--display); min-width: 64px; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(246,242,255,0.05); cursor: pointer; }
.chord-btns button.target { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.chord-btns button.down { background: var(--ink); color: var(--abyss); }

@media (max-width: 760px) {
  /* 폰: 위 줄은 지금 · 들리는 소리 · 재생/일시정지, 아래에 장식 건반(2옥타브)을 화면 맨 아래까지 */
  .dock { position: relative; grid-template-columns: 1fr 1fr; grid-template-areas: "now meter" "helper helper"; gap: 8px 12px; padding-bottom: env(safe-area-inset-bottom); }
  .dock-now { grid-area: now; } .dock-meter { grid-area: meter; } .dock-helper { grid-area: helper; min-height: 0; margin: 0 calc(-1 * max(16px, env(safe-area-inset-left))); }
  /* 재생/일시정지: '들리는 소리' 줄 오른쪽 위 빈자리에 겹쳐 둠 (글자 칸은 그대로) */
  .dock .playpause { position: absolute; top: -10px; right: max(16px, env(safe-area-inset-right)); z-index: 5; }
  .keys { height: 64px; }
  .key.w { border-radius: 0 0 5px 5px; }
  .dock-note { font-size: 30px; }
  /* 설명 글이 1~3줄로 바뀌며 독(건반)이 오르내리지 않게 항상 두 줄 높이로 고정 */
  .dock-hint { font-size: 12.5px; height: 2.7em; min-height: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
  .hud-row { gap: 12px; }
  .hud-num { font-size: 18px; }
  .keys { height: 100px; }
}
.hud-line { display: none; }
/* 폰 세로: 콤보·정확도(·점수)는 제목 아래 한 줄로 — 위 줄은 ‹ 이전 · 제목 · 설정만 */
@media (max-width: 760px) and (orientation: portrait) {
  /* 콤보·정확도·점수는 제목과 섞이지 않게 위 줄 아래 따로 한 줄 (미리듣기는 비워 두되 자리는 같게 — 악보 위치가 같도록) */
  .hud-row { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "back title gear" "line line line"; column-gap: 10px; row-gap: 0; align-items: center; }
  .hud-row .hud-back { grid-area: back; }
  .hud-row .hud-title { grid-area: title; }
  .hud-row .hud-btn { grid-area: gear; }
  .hud-row .hud-stat { display: none; }
  .hud-row .hud-btn { width: 36px; height: 36px; }
  #play .hud { padding-bottom: 14px; }   /* 콤보 줄과 악보 사이 */
  .hud-line { display: flex; gap: 18px; grid-area: line; margin: -8px 0 0; height: 18px; align-items: center; font: 500 12px var(--ui); color: var(--mute); white-space: nowrap; overflow: hidden; }
  /* 건반을 숨기면 건반 줄과 그 위 간격까지 없앰 */
  #play.no-helper .dock { grid-template-areas: "now meter"; }
  .hud-line b { font: 700 14px var(--display); color: var(--ink); font-variant-numeric: tabular-nums; margin-left: 3px; }
}

/* ---------- 일시정지 ---------- */

/* ---------- 결과 ---------- */
.result-panel { text-align: center; }
.stars { display: flex; justify-content: center; gap: 10px; margin: 12px 0 6px; }
.stars svg { width: clamp(54px, 15vw, 76px); height: auto; animation: starIn .6s cubic-bezier(.2,.9,.25,1.3) both; }
.stars svg { filter: drop-shadow(0 0 10px rgba(255,181,71,.45)); }
.stars svg:nth-child(2) { animation-delay: .12s; transform: translateY(-10px); }
.stars svg:nth-child(3) { animation-delay: .24s; }
@keyframes starIn { from { transform: scale(.3) rotate(-30deg); opacity: 0; } to { opacity: 1; } }
.rs-acc-big { margin: 0; font: 900 clamp(54px, 15vw, 84px)/1 var(--display); letter-spacing: -0.04em;
  background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; }
.badges { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 6px; min-height: 26px; }
.badge { font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: rgba(246,242,255,0.1); }
.badge.fc { background: color-mix(in srgb, var(--l2) 25%, transparent); color: var(--l2); }
.badge.best { background: color-mix(in srgb, var(--l0) 25%, transparent); color: var(--l0); }
.badge.mode { background: color-mix(in srgb, var(--l3) 25%, transparent); color: #c3b8ff; }
.rs-score { margin: 0 0 22px; color: var(--mute); font-variant-numeric: tabular-nums; }
.judges { list-style: none; margin: 0 auto 22px; padding: 0; display: grid; gap: 8px; max-width: 380px; text-align: left; }
.judges li { display: grid; grid-template-columns: 70px 1fr 40px; gap: 12px; align-items: center; font-size: 15px; }
.judges b { font: 700 13px var(--display); color: var(--c); }
.judges i { height: 6px; border-radius: 6px; background: var(--faint); overflow: hidden; display: block; }
.judges i span { display: block; height: 100%; background: var(--c); border-radius: 6px; }
.judges em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0 0 22px; text-align: left; }
.insight { padding: 12px 14px; border-radius: 14px; background: rgba(246,242,255,0.05); }
.insight span { display: block; font-size: 12.5px; color: var(--mute); }
.insight b { display: block; font-size: 16px; font-weight: 700; margin-top: 2px; word-break: keep-all; }
.mini-title { margin: 0 0 8px; font-size: 13px; color: var(--mute); text-align: left; }
.bars-map { margin-bottom: 24px; }
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 4px; }
.heat button { height: 34px; border-radius: 8px; border: 0; cursor: pointer; font: 600 10px var(--display); color: rgba(12,9,38,.8); background: var(--c, var(--faint)); }
.heat button.none { background: var(--faint); color: var(--mute); cursor: default; }
.rs-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rs-actions .btn-solid { grid-column: 1 / -1; }
.rs-actions .rs-cta { grid-column: 1 / -1; order: 99; }
.rs-actions .btn-quiet { grid-column: 1 / -1; }

/* ---------- 마이크 설정 ---------- */
.steps { list-style: none; margin: 22px 0 24px; padding: 0; display: grid; gap: 12px; }
.step { padding: 16px; border-radius: var(--r-md); background: rgba(246,242,255,0.045); border: 1px solid var(--faint); display: grid; gap: 10px; }
.step-head { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.step-head b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--display); background: var(--faint); }
.step-head em { margin-left: auto; font-style: normal; font-size: 13px; font-weight: 600; color: var(--l2); }
.step-head em.bad { color: var(--l0); }
.step-text { margin: 0; font-size: 14px; color: var(--mute); word-break: keep-all; }
.step .btn { justify-self: start; }
.row-l { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.level { position: relative; height: 12px; border-radius: 12px; background: var(--faint); overflow: hidden; }
.level span { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--spectrum); transition: width .06s linear; }
.level i { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); }
.test-note { display: flex; align-items: baseline; gap: 10px; font: 800 36px/1 var(--ui); color: var(--accent); min-height: 40px; }
.test-note small { font: 500 13px var(--display); color: var(--mute); }

/* ---------- 튜너 ---------- */
.tn-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.gauge { display: block; width: 100%; height: 220px; margin: 14px 0 0; }
.tn-read { text-align: center; margin-top: -54px; position: relative; }
.tn-note { display: block; font: 800 64px/1 var(--ui); letter-spacing: -0.03em; }
.tn-cents { display: block; margin-top: 6px; color: var(--mute); font-variant-numeric: tabular-nums; }
.strings { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 24px 0 18px; }
.strings button { min-width: 58px; padding: 12px 10px; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(246,242,255,0.04); cursor: pointer; text-align: center; }
.strings button b { display: block; font: 700 18px var(--display); }
.strings button span { display: block; font-size: 11.5px; color: var(--mute); }
.strings button.near { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.strings button.tuned { border-color: var(--l2); }
.tn-foot { display: flex; justify-content: center; align-items: center; gap: 12px; }

/* ---------- 곡 추가 ---------- */
.file-drop { display: grid; gap: 4px; place-items: center; text-align: center; margin: 18px 0; padding: 22px 16px; border-radius: var(--r-md); border: 1.5px dashed var(--line); cursor: pointer; transition: border-color .15s, background-color .15s; }
.file-drop:hover, .file-drop.dragging { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.file-drop b { font-size: 16px; }
.file-drop span { font-size: 13px; color: var(--mute); word-break: keep-all; }
.fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--mute); min-width: 0; margin-bottom: 12px; }
.fields .field { margin: 0; }
.field-wide { grid-column: 1 / -1; }
.field small { color: var(--mute); opacity: .8; }
.field input, .field select, .field textarea { width: 100%; }
textarea { font: 500 14px/1.65 ui-monospace, "SF Mono", Consolas, monospace; resize: vertical; }
@media (max-width: 520px) { .fields { grid-template-columns: 1fr 1fr; } }
.status { margin: 0 0 12px; font-size: 14px; min-height: 1.4em; word-break: keep-all; }
.status.ok { color: var(--l2); }
.status.err { color: var(--l0); }
.help { font-size: 13.5px; color: var(--mute); margin-bottom: 20px; }
.help summary { cursor: pointer; color: var(--ink); font-weight: 600; }
.help ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; word-break: keep-all; }
.help code { font: 13px ui-monospace, Consolas, monospace; background: rgba(12,9,38,0.6); padding: 1px 6px; border-radius: 5px; color: var(--ink); }
.ed-actions { display: grid; gap: 8px; }

@media (max-width: 420px) {
  .song { grid-template-columns: 1fr auto; }
  .song-len { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* 양손 곡: 연습할 손 */
.hands-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 14px 0 0; }
.hands-row[hidden] { display: none; }
.hands-row .set-name { font-weight: 700; }
.hands-note { color: var(--mute); font-size: 13px; }

.field[hidden] { display: none; }
.dock-note.long { font-size: 20px; line-height: 1.15; }
/* 폰 세로: 음 글자(E5 / E4 + C3 G3) 크기가 바뀌어도 독 높이는 그대로 */
@media (max-width: 760px) and (orientation: portrait) {
  .dock-note, .dock-note.long { height: 32px; line-height: 32px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* 폰 가로: 악보 자리를 넓히려고 위 줄과 아래 도우미를 얇게 */
@media (orientation: landscape) and (max-height: 500px) {
  .hud { padding-top: max(4px, env(safe-area-inset-top)); }
  .hud-row { margin-top: 4px; }
  .stage-wrap { min-height: 0; }
  .dock { grid-template-columns: 120px 1fr 140px; grid-template-areas: none; gap: 10px; padding-top: 6px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .dock-now { grid-area: auto; } .dock-meter { grid-area: auto; } .dock-helper { grid-area: auto; min-height: 0; }
  .dock-note { font-size: 24px; } .dock-note.long { font-size: 15px; }
  .dock-hint { display: none; }
  .dock-heard { font-size: 16px; }
  .dock-label { font-size: 10.5px; }
  /* 가로에서는 건반·악기 그림을 숨기고 '지금 / 들리는 소리'만 한 줄로 — 악보 두 줄 자리 */
  .dock-helper { display: none; }
  .dock { grid-template-columns: 1fr 1fr; align-items: center; padding-top: 4px; }
  .dock-now, .dock-meter { flex-direction: row; align-items: center; gap: 10px; }
  .dock-note { font-size: 20px; } .dock-note.long { font-size: 14px; }
  .dock-meter .cents { width: 110px; flex: none; margin: 0; }
  .dock-cents { min-height: 0; }
  .dock-meter .link { margin-top: 0; }
}

/* 재생/일시정지는 악보 위에 떠 있지 않고 아래 도우미 줄에 */
.dock .playpause { width: 56px; height: 56px; }
@media (min-width: 761px) { .dock .playpause { position: relative; right: auto; bottom: auto; top: auto; align-self: center; justify-self: end; } }
.dock .playpause .pp-pause span { height: 19px; width: 5px; }
.dock .playpause .pp-play { border-left-width: 19px; border-top-width: 11px; border-bottom-width: 11px; margin-left: 5px; }
@media (orientation: landscape) and (max-height: 500px) {
  .dock { grid-template-columns: 1fr 1fr auto; grid-template-areas: none; }
  .dock .playpause { grid-area: auto; width: 44px; height: 44px; }
  .dock .playpause .pp-pause span { height: 15px; width: 4px; }
  .dock .playpause .pp-play { border-left-width: 15px; border-top-width: 9px; border-bottom-width: 9px; margin-left: 4px; }
}

/* '지금'과 '들리는 소리' 칸의 위쪽 맞춤 */
.dock-now, .dock-meter { justify-content: flex-start; align-self: start; }
@media (orientation: landscape) and (max-height: 500px) { .dock-now, .dock-meter { align-self: center; } }
