/* 발성 연습 · 음역 테스트 (디자인 B 추가 화면)
   B의 토큰(--surface, --accent-*, --ok …)과 무대 클래스(stage-root, hud, dock …)를 그대로 쓰고, 여기에는 새 부품만 둔다.
   무대는 B 연습 화면처럼 밝은 테마에서도 어둡다(.stage-root가 어두운 토큰을 다시 정한다). */

/* ============ 무대 화면에서는 위 메뉴·미니 플레이어·아래 탭을 숨긴다 ============ */
body[data-route="exercise-session"] .topnav,
body[data-route="exercise-session"] .mini,
body[data-route="exercise-session"] .tabbar,
body[data-route="range-test"] .topnav,
body[data-route="range-test"] .mini,
body[data-route="range-test"] .tabbar {
  display: none;
}

/* ============ 연습 고르기 ============ */
.ex-setup {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}
.ex-set {
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: start;
  min-width: 0;
}
.ex-set-stack {
  display: grid;
  gap: 22px;
  align-content: start;
  min-width: 0;
}
.ex-set-label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-3);
}
.ex-set-value {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.016em;
  line-height: 1.3;
}
.ex-set-note {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.5;
}
.ex-test-link {
  font-size: 14px;
}
.ex-ear-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
}
.ex-ear-note .icon {
  margin-top: 2px;
  color: var(--accent-ink);
}
.ex-groups {
  display: grid;
  gap: 36px;
}
.ex-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.ex-card {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.ex-card:hover {
  background: var(--surface-2);
  border-color: var(--line-2);
}
.ex-card:has(.stretch:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.ex-card-shape {
  display: grid;
  place-items: center;
  width: 104px;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface-2);
}
.ex-shape {
  display: block;
  width: 100%;
  height: auto;
}
.ex-shape-bar {
  fill: var(--accent-1);
}
.ex-shape-line {
  fill: none;
  stroke: var(--accent-1);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ex-card-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.ex-card-title {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.012em;
}
.ex-card-title a {
  color: inherit;
  text-decoration: none;
}
.ex-card-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
}
.ex-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-3);
}
.ex-card-meta li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ex-card-go {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  transition: transform var(--t-fast);
}

/* ============ 무대(연습 · 음역 테스트) ============ */
.ex-stage {
  --ex-piano-fill: rgba(255, 255, 255, 0.05);
  --ex-piano-line: rgba(255, 255, 255, 0.42);
  --ex-piano-past: rgba(255, 255, 255, 0.14);
  --ex-key-line: rgba(255, 255, 255, 0.5);
  --ex-ground-rgb: var(--s-ground-rgb);
  --ex-hit-rgb: var(--s-hit-rgb);
}
/* 시작 전·준비 중·오류·끝에는 안내 띠를 숨겨 겹침 안내 카드가 넓게 보이게 한다(카드가 같은 내용을 말한다) */
.ex-stage.phase-ready .hud,
.ex-stage.phase-starting .hud,
.ex-stage.phase-micError .hud,
.ex-stage.phase-done .hud {
  display: none;
}
.ex-stage .hud-voice.ex-goal .hud-voice-hint {
  font-weight: 650;
  color: var(--text-2);
}
.ex-stage .score-box {
  min-width: 104px;
}
.ex-stage .score-num.ex-note-num {
  font-size: 18px;
  line-height: 1.7;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.ex-cue {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 4;
  max-width: calc(100% - 32px);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(20, 25, 32, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  pointer-events: none;
}
.ex-legend {
  position: absolute;
  right: 16px;
  bottom: 12px;
  z-index: 3;
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-3);
  pointer-events: none;
}
.ex-lg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ex-lg i {
  display: inline-block;
  width: 18px;
  height: 8px;
  border-radius: 4px;
}
.ex-lg-piano i {
  background: var(--ex-piano-fill);
  box-shadow: inset 0 0 0 1.5px var(--ex-piano-line);
}
.ex-lg-sing i {
  background: var(--accent-1);
}
.ex-lg-voice i {
  height: 3px;
  border-radius: 2px;
  background: var(--s-voice);
}
.ex-pops {
  max-width: min(320px, calc(100% - 36px));
}
.ex-pop-hint {
  max-width: 260px;
  margin-top: 2px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-2);
  text-align: right;
}
.ex-pop.is-text .phrase-pop-num {
  font-size: 18px;
  line-height: 1.35;
}
.ex-stage .t-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.ex-stage .t-btn:disabled:hover {
  background: transparent;
  color: var(--text-2);
}
.ex-tempo-value {
  min-width: 54px;
  font-size: 15px;
}
.ex-volume .pop-slider {
  width: 180px;
  margin: 10px 0 4px;
}
.ex-volume .set-label {
  display: inline-flex;
  gap: 6px;
}

/* 겹침 안내 안 */
.ex-ready-mode {
  display: grid;
  gap: 8px;
  justify-items: start;
}
.ex-start-note {
  font-size: 14px;
  color: var(--text-2);
}
.ex-start-note strong {
  color: var(--text);
}
.ex-sum-score {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.ex-sum-num {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.ex-sum-unit {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-2);
}
.ex-sum-word {
  margin-left: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-ink);
}
.ex-sum-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ex-sum-stats > div {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  min-width: 0;
}
.ex-sum-stats dt {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
}
.ex-sum-stats dd {
  font-size: 16px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.ex-sum-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-2);
}
.ex-sum-tip .icon {
  margin-top: 2px;
  color: var(--accent-ink);
}
.ex-chart {
  display: grid;
  gap: 8px;
  margin: 0;
}
.ex-chart-plot {
  position: relative;
  height: 84px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.ex-bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}
.ex-bar {
  flex: 1 1 0;
  min-width: 2px;
  max-width: 28px;
  height: var(--h);
  border-radius: 4px 4px 0 0;
  background: rgba(255, 255, 255, 0.2);
}
.ex-bar.is-pass {
  background: var(--ok);
}
.ex-chart-pass {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 60%;
  z-index: 1;
  border-top: 1px dashed rgba(255, 255, 255, 0.32);
  pointer-events: none;
}
.ex-chart-pass span {
  position: absolute;
  right: 0;
  bottom: 3px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(20, 25, 32, 0.9);
  font-size: 11px;
  color: var(--text-3);
}
.ex-chart-cap {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}
.ex-chart-axis {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.ex-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.ex-chart-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.ex-chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
}
.ex-chart-legend i.is-pass {
  background: var(--ok);
}
.ex-result {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ex-result-box {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-width: 0;
}
.ex-result-label {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
}
.ex-result-note {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.ex-result-ev {
  font-size: 12.5px;
  color: var(--text-2);
}
.ex-compare {
  display: grid;
  gap: 4px;
  padding-left: 18px;
  list-style: disc;
  font-size: 14px;
  color: var(--text-2);
}

/* ============ 좁은 화면 ============ */
@media (max-width: 960px) {
  .ex-setup {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }
}
@media (max-width: 760px) {
  .ex-cards {
    grid-template-columns: minmax(0, 1fr);
  }
  .ex-card {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }
  .ex-card-shape {
    width: 80px;
  }
  .ex-card-go {
    display: none;
  }
  .ex-legend {
    display: none;
  }
  .ex-cue {
    top: 10px;
    font-size: 13px;
    padding: 6px 12px;
  }
  .ex-pops {
    top: auto;
    right: 10px;
    bottom: 10px;
  }
  .ex-pop-hint {
    max-width: 220px;
  }
  .ex-volume .pop-slider {
    width: 100%;
  }
  .ex-sum-num {
    font-size: 46px;
  }
  .ex-sum-stats {
    grid-template-columns: minmax(0, 1fr);
  }
  .ex-sum-stats > div {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
  }
}
