/* ============================================================
   LOCAL GAME STYLES: Audiation – Hum The Interval
   Builds on top of ../../shared/global.css
   ============================================================ */

/* ─── Game title ─── */
.gameMainTitle {
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  color: var(--text-main);
  margin: 0;
  padding: 0 12px;
  line-height: 1.25;
}

.modalGameTitle {
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.2;
}

.modalGameSubtitle {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-muted);
}

/* ─── Controls panel ─── */
.controlsPanel {
  background: var(--bg-surface);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

body.light-theme .controlsPanel {
  border-color: rgba(0, 0, 0, 0.06);
}

.actionsGrid {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.actionsGrid .icon-btn {
  flex: 1;
  height: 52px;
  padding: 0;
  font-size: 20px;
}

.mainActionRow {
  display: flex;
  gap: 10px;
}

.mainActionRow #beginBtn { flex: 2; }
.mainActionRow #pauseBtn { flex: 1; }

/* Begin button – active game state (red) */
#beginBtn.game-active {
  background: var(--danger) !important;
  border-color: var(--danger-shadow) !important;
  box-shadow: 0 4px 0 var(--danger-shadow) !important;
  animation: none !important;
}
#beginBtn.game-active:active:not(:disabled) {
  box-shadow: 0 0 0 transparent !important;
  transform: translateY(4px);
}

/* Pause button – always orange */
.pause-btn {
  background: var(--next-orange);
  color: #fff;
  border: 2px solid var(--next-shadow);
  box-shadow: 0 4px 0 var(--next-shadow);
  font-size: 15px;
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── Score bar ─── */
.scoreBar {
  background: var(--bg-surface);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  box-shadow: var(--shadow-soft);
}

body.light-theme .scoreBar {
  border-color: rgba(0, 0, 0, 0.06);
}

.score-correct {
  font-size: 17px;
  font-weight: 900;
  color: #22c55e;
}

.score-incorrect {
  font-size: 17px;
  font-weight: 900;
  color: var(--danger);
}

.score-divider {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
}

.score-total-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ─── Game display panel ─── */
.gameDisplayPanel {
  background: var(--bg-surface);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  height: 130px;
  overflow: hidden;
}

body.light-theme .gameDisplayPanel {
  border-color: rgba(0, 0, 0, 0.06);
}

.gameTextWrap {
  text-align: center;
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.idleHint {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.5;
}

.idleHint strong {
  color: var(--text-main);
  font-weight: 800;
}

.mainPhaseText {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
  width: 100%;
}

/* Interval name shown large during AUDIATE phase */
.intervalDisplay {
  font-size: 28px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1.1;
  letter-spacing: -0.5px;
  width: 100%;
}

.intervalDirectionTag {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-muted);
  width: 100%;
}

.countdownNum {
  font-size: 68px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.feedbackText {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  padding: 0 4px;
  width: 100%;
}

/* Feedback states */
.feedbackText.perfect  { color: #22c55e; }
.feedbackText.good     { color: var(--accent); }
.feedbackText.okay     { color: var(--next-orange); }
.feedbackText.miss     { color: var(--danger); }
.feedbackText.no-voice { color: var(--text-muted); }

/* ─── Result panel ─── */
.resultPanel {
  background: var(--bg-surface);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.light-theme .resultPanel {
  border-color: rgba(0, 0, 0, 0.06);
}

/* Correctness banner */
.resultBadge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.3px;
}

.resultBadge.correct-badge {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 2px solid rgba(34, 197, 94, 0.3);
}

.resultBadge.incorrect-badge {
  background: rgba(239, 68, 68, 0.13);
  color: var(--danger);
  border: 2px solid rgba(239, 68, 68, 0.3);
}

.resultBadge.no-voice-badge {
  background: rgba(203, 213, 225, 0.1);
  color: var(--text-muted);
  border: 2px solid rgba(203, 213, 225, 0.2);
}

/* Interval reveal label below badge */
.resultIntervalLabel {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.4;
}

.resultIntervalLabel strong {
  color: var(--text-main);
  font-size: 18px;
}

/* Piano keyboard */
#keyboardCanvas {
  width: 100%;
  height: 120px;
  display: block;
  border-radius: 8px;
  background: var(--bg-elevated);
  cursor: default;
}

/* Keyboard legend */
.keyboardLegend {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-dot.blue  { background: #3b82f6; }
.legend-dot.green { background: #22c55e; }
.legend-dot.red   { background: var(--danger); }

/* Wait phase row (Repeat Note / Continue) */
.waitRow {
  display: flex;
  gap: 10px;
}

.wait-btn {
  flex: 1;
  height: 54px;
  font-size: 16px;
  font-weight: 800;
}

/* Hear buttons row – fills full width */
.hearRow {
  display: flex;
  gap: 8px;
}

.hear-btn {
  flex: 1;
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
  font-size: 14px;
  height: 50px;
}

body.light-theme .hear-btn {
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 0 #cbd5e1;
}

.hear-btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 0 0 transparent !important;
}

.hear-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none !important;
}

/* Next button */
#nextBtn {
  font-size: 18px;
  height: 56px;
}

/* ─── Tuner section ─── */
.tunerSection {
  background: var(--bg-surface);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px 16px 12px;
  box-shadow: var(--shadow-soft);
  transition: opacity 0.5s ease;
}

body.light-theme .tunerSection {
  border-color: rgba(0, 0, 0, 0.06);
}

.tunerSection.inactive {
  opacity: 0.25;
  pointer-events: none;
}

.tunerHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  padding: 0 2px;
}

.tunerTitle {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.tunerTargetLabel {
  font-size: 14px;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: 0.2px;
  min-height: 20px;
}

.tunerSection.inactive .tunerTargetLabel {
  color: var(--text-muted);
}

#tunerCanvas {
  width: 100%;
  height: 200px;
  display: block;
  border-radius: 8px;
}

.tunerCentsLabel {
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-muted);
  margin-top: 6px;
  min-height: 22px;
  letter-spacing: 0.1px;
  transition: color 0.2s;
}

/* ─── Modal extras ─── */
.secondary-btn {
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}

body.light-theme .secondary-btn {
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 0 #cbd5e1;
}

.secondary-btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 0 0 transparent;
}

/* ─── Settings / form elements ─── */
.settingsGrid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.inlineControl {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.settingsLabel {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.settingsHint {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 2px;
  margin-bottom: 4px;
}

input:not([type='checkbox']):not([type='radio']),
select {
  width: 100%;
  height: 50px;
  background: var(--bg-base);
  border: 2px solid var(--bg-elevated);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 0 16px;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  outline: none;
  -webkit-appearance: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:focus,
select:focus { border-color: var(--accent); }
select       { cursor: pointer; }
.compactSelect { cursor: pointer; }
