/* 절대음감 테스트 전용 */
.pp-card {
  margin-top: 22px;
  text-align: center;
  padding: 24px 18px;
  scroll-margin-top: 80px;
}
#result {
  scroll-margin-top: 80px;
}
.pp-kicker {
  display: inline-block;
  margin: 0 0 14px;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  background: var(--brand-soft);
  color: var(--brand);
}
.pp-checks {
  list-style: none;
  margin: 0 auto 6px;
  padding: 0;
  max-width: 28em;
  display: grid;
  gap: 8px;
  text-align: left;
}
.pp-checks li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 0.95rem;
  line-height: 1.55;
}
.pp-checks li > span:first-child {
  flex: none;
  font-size: 1.15rem;
  line-height: 1.35;
}
.pp-main {
  min-width: min(100%, 280px);
}
.pp-card .btn,
.pp-card .chip,
.pp-key {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.pp-title {
  font-size: clamp(1.25rem, 5vw, 1.55rem);
  font-weight: 800;
  margin: 6px 0;
}
.pp-sub {
  color: var(--muted);
  margin: 0 auto;
  max-width: 28em;
}

/* 진행 */
.pp-top {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  max-width: 560px;
  margin: 0 auto;
}
.pp-status {
  margin: 10px auto 16px;
  min-height: 2.9em;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 14px;
  font-weight: 800;
  font-size: clamp(0.98rem, 4vw, 1.12rem);
  line-height: 1.4;
  background: var(--surface-2);
  max-width: 560px;
}
.pp-status[data-tone='ok'] {
  background: color-mix(in srgb, var(--go) 16%, transparent);
  color: var(--go);
}
.pp-status[data-tone='near'] {
  background: color-mix(in srgb, var(--early) 16%, transparent);
  color: var(--early);
}
.pp-status[data-tone='bad'] {
  background: color-mix(in srgb, var(--wait) 14%, transparent);
  color: var(--wait);
}

/* 건반: 14칸 격자. 흰 건반은 2칸 · 위아래 두 줄, 검은 건반은 경계에 걸쳐 윗줄만. */
.pp-keys {
  --kh: clamp(170px, 46vw, 230px);
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  grid-template-rows: calc(var(--kh) * 0.6) calc(var(--kh) * 0.4);
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 8px 10px;
  border-radius: 16px;
  background: #1f2430;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25);
}
.pp-key {
  appearance: none;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
  padding: 0 0 8px;
  min-width: 0;
  transition: background 0.12s ease, transform 0.06s ease;
}
.pp-key b {
  font-weight: 800;
  line-height: 1.1;
}
.pp-key small {
  font-size: 0.72em;
  opacity: 0.7;
}
.pp-key.white {
  grid-row: 1 / span 2;
  z-index: 1;
  margin: 0 1.5px;
  border: 0;
  border-radius: 0 0 9px 9px;
  background: linear-gradient(#fff, #f1f2f5);
  color: #1d2230;
  font-size: clamp(0.88rem, 3.6vw, 1.02rem);
  box-shadow: inset 0 -5px 0 #d5d8df;
}
.pp-key.black {
  grid-row: 1;
  z-index: 2;
  justify-self: center;
  width: 68%;
  border: 0;
  border-radius: 0 0 7px 7px;
  background: linear-gradient(#3a3f4c, #151821);
  color: #f4f5f8;
  font-size: clamp(0.66rem, 2.7vw, 0.82rem);
  padding-bottom: 6px;
  box-shadow: inset 0 -4px 0 #000;
}
.pp-keys[data-on='true'] .pp-key.white:hover {
  background: linear-gradient(#fff, #e6ebff);
}
.pp-keys[data-on='true'] .pp-key.black:hover {
  background: linear-gradient(#4a5163, #20242f);
}
.pp-keys[data-on='true'] .pp-key:active {
  transform: translateY(2px);
}
.pp-keys[data-on='false'] .pp-key {
  cursor: default;
}
.pp-key:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: -3px;
}
/* 정답 · 고른 오답 표시(색 + 글자 표시를 함께) */
.pp-key.is-answer {
  background: #17a35c !important;
  color: #fff !important;
  box-shadow: inset 0 -5px 0 #0e7a43;
}
.pp-key.is-wrong {
  background: #d8404d !important;
  color: #fff !important;
  box-shadow: inset 0 -5px 0 #a02531;
}
.pp-key.is-answer b::after {
  content: ' ✓';
}
.pp-key.is-wrong b::after {
  content: ' ✗';
}
.pp-key.black.is-answer b::after,
.pp-key.black.is-wrong b::after {
  content: '';
}
.pp-key.black.is-answer small::after {
  content: ' ✓';
}
.pp-key.black.is-wrong small::after {
  content: ' ✗';
}

.pp-tools {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 8px;
}
.pp-tools .linkish {
  font-size: 0.92rem;
  min-height: 40px;
}
.pp-tools .linkish:disabled {
  opacity: 0.5;
  cursor: default;
}
.pp-card .timebar {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.pp-card .timebar span {
  background: var(--brand);
  transform: scaleX(0);
  transition: transform 0.4s ease;
}
.pp-card .tries {
  min-height: 1.6em;
}
.pp-card .tries li:not(.best) {
  border-color: color-mix(in srgb, var(--wait) 50%, var(--line));
}

/* 결과: 문제별 돌아보기 */
.pp-review {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 44%), 1fr));
  gap: 6px;
  text-align: left;
}
.pp-review li {
  font-size: clamp(0.74rem, 3.1vw, 0.86rem);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border-left: 4px solid var(--line);
}
.pp-review li.ok {
  border-left-color: var(--go);
}
.pp-review li.near {
  border-left-color: var(--early);
}
.pp-review li.bad {
  border-left-color: var(--wait);
}
