.board-wrap {
  position: relative;
  width: min(92vw, 480px);
  margin: 0 auto;
  min-height: 460px;
}

.pitch-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 24px 0;
}

.tones {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tone-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: clamp(110px, 30vw, 140px);
  height: clamp(110px, 30vw, 140px);
  background: linear-gradient(135deg, #ffaa6e, #ee8033);
  border-radius: 20px;
  color: #fff;
  user-select: none;
  box-shadow: 0 8px 24px rgba(255, 170, 110, 0.25);
  transition: transform 0.1s, box-shadow 0.15s;
}

.tone-card.playing {
  animation: pulse 0.7s ease;
  background: linear-gradient(135deg, #6c8eff, #4a6cf7);
  box-shadow: 0 8px 28px rgba(108, 142, 255, 0.5);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

.tone-label {
  font-size: 0.85rem;
  opacity: 0.9;
  letter-spacing: 0.05em;
}

.tone-icon {
  font-size: clamp(40px, 12vw, 56px);
  line-height: 1;
}

.tone-divider {
  font-size: 1.2rem;
  color: var(--text-dim);
  font-weight: 700;
}

.prompt {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  min-height: 1.6em;
}

.prompt.correct { color: #2ed573; }
.prompt.wrong { color: #ff6b6b; }

.choice-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 380px;
}

.choice-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px;
  background: var(--bg-elev);
  border: 2px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s, border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.choice-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.choice-btn:not(:disabled):hover {
  border-color: var(--accent);
}

.choice-btn:not(:disabled):active {
  transform: scale(0.96);
}

.choice-btn.same:not(:disabled) {
  border-color: rgba(46, 213, 115, 0.4);
}

.choice-btn.diff:not(:disabled) {
  border-color: rgba(255, 107, 107, 0.4);
}

.choice-btn.flash-correct {
  background: rgba(46, 213, 115, 0.2);
  border-color: #2ed573;
}

.choice-btn.flash-wrong {
  background: rgba(255, 107, 107, 0.2);
  border-color: #ff6b6b;
  animation: shake 0.35s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-8px); }
  75%      { transform: translateX(8px); }
}

.choice-icon {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.replay-btn {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.replay-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.replay-btn:not(:disabled):hover {
  color: var(--text);
  border-color: var(--accent);
}

.stat-value.warn { color: #ff6b6b; }
#status-label.playing { color: #2ed573; }

/* ===== 시작 오버레이 ===== */

.pitch-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 41, 0.78);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  z-index: 5;
  transition: opacity 0.2s;
}

.pitch-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-content {
  text-align: center;
  padding: 24px;
}

.overlay-icon { font-size: 3.5rem; margin-bottom: 12px; }
.overlay-content h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.overlay-content p { color: var(--text-dim); margin-bottom: 18px; }

.hint {
  text-align: center;
  margin-top: 20px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ===== 결과 모달 ===== */

.result-modal {
  position: fixed; inset: 0;
  background: rgba(15, 23, 41, 0.85);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 50;
  animation: fadeIn 0.25s ease;
}

.result-modal.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.result-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px 28px;
  max-width: 420px; width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-emoji { font-size: 4rem; margin-bottom: 8px; }
.result-card h2 { font-size: 1.5rem; margin-bottom: 8px; }
.result-msg { color: var(--text-dim); margin-bottom: 24px; }

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.result-stats > div {
  background: rgba(255,255,255,0.05);
  padding: 14px;
  border-radius: 12px;
}

.result-stats span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-stats strong {
  font-size: 1.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.result-rank {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 8px 0 4px;
  color: var(--accent);
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.result-actions .btn {
  padding: 12px 16px;
  text-align: center;
  font-size: 0.95rem;
}
