/* /style.css
   Intervals game styling aligned to the shared Ear Training Lab template.
*/
:root{
  --page-bg:#ffffff;
  --text:#111;
  --pulseRGBA: rgba(77,163,255,0.28);
  --refNoteFadeOut: 0.26s;
  --firstNote:#4da3ff;
  --secondNote:#34c759;
  --nextOrange:#ff8a1f;
  --nextPulseRGBA: rgba(255,138,31,0.35);
  --text-max: 1000px;
  --analysis-max: 700px;
  --answers-max:700px;
  --scaleBlue:#4da3ff;
  --scaleBlueRGBA: rgba(77,163,255,0.22);
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:Arial,Helvetica,sans-serif;
  background:var(--page-bg);
  color:var(--text);
}

.app{
  max-width:1260px;
  margin:8px auto;
  padding:16px;
}

.hero{text-align:center;margin:0px 0 12px}

.app-titleWrap{
  display:flex;
  justify-content:center;
  align-items:center;
  margin:14px 0 6px;
}
.app-titleImg{
  height:auto;
  max-width: 100%;
  display:block;
  user-select:none;
  -webkit-user-drag:none;
  padding-bottom: 10px;
}
.app-titleImgWide{ width: 100%; max-width: 700px; }
.app-titleImgWrapped{ width:min(220px, 55vw); }
.titleModeWide .app-titleImgWide{ display:block; }
.titleModeWide .app-titleImgWrapped{ display:none; }
.titleModeWrapped .app-titleImgWide{ display:none; }
.titleModeWrapped .app-titleImgWrapped{ display:block; }

.controlsPanel{
  background:#fff;
  border:1px solid rgba(0,0,0,.0);
  border-radius:16px;
  padding:0px;
}
.controlsPanelActions{margin-top:8px}

.hidden{display:none}

select{
  height:38px;
  width:auto;
  padding:0 10px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.2);
  background:#fff;
  cursor:pointer;
  font-weight:700;
  text-align: center;
}
.compactSelect{max-width:none; justify-content: center;}
.inlineControlRowAuto{min-width:unset;width:auto;}
.compactSelectAuto{ width:auto; max-width:none; inline-size:auto; justify-content: center;}

button{
  height:38px;
  padding:0 14px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.2);
  background:#fff;
  cursor:pointer;
  font-weight:800;
  white-space:nowrap;
}
button:active{transform:translateY(1px)}

button:disabled{
  opacity: .90;
  cursor: not-allowed;
  transform: none;
  background: #ebebeb;
  border-color: #9c9c9c;
  color:#989898
}

.primary{
  background:rgb(71, 101, 166);
  color:#fff;
  border-color:rgba(0,0,0,.2);
}

@keyframes ringPulse{
  0%   { box-shadow:0 0 0 0 rgba(0,0,0,0); }
  55%  { box-shadow:0 0 0 12px var(--ringColor, var(--pulseRGBA)); }
  100% { box-shadow:0 0 0 0 rgba(0,0,0,0); }
}
.pulse{
  --ringColor: var(--pulseRGBA);
  animation: ringPulse 1.15s ease-in-out infinite;
  animation-delay: var(--pulseSyncDelay, 0s);
}

.actionsRow{
  display:flex;
  align-items:flex-end;
  gap:10px;
  flex-wrap:wrap;
}
.actionsRow > *{ flex: 0 1 auto; max-width: 100%; }
.actionsCentered{justify-content:center}

.actionsStack{
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:center;
}

.inlineControl{ display:flex; flex-direction:column; gap:6px; }
.settingsLabel{ font-weight: 900; opacity: .78; font-size: 12px; letter-spacing: .2px; text-align:center; }

.answerGrid{
  display:flex;
  align-items:stretch;
  justify-content:center;
  gap:8px;
  padding: 2px;
  width: 100%;
  max-width: var(--answers-max);
  margin: 0 auto;
  flex-wrap: wrap;
}

.noteBtn{
  height:auto;
  min-height:36px;
  padding:8px 8px;
  width: auto;
  max-width: none;
  flex: 0 1 auto;
  min-width: 55px;
  line-height:1.05;
  text-align:center;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:2px;
  user-select:none;
}

.noteBtn.correct{ background:#1f9d55; color:#fff; border-color:rgba(0,0,0,.18); }
.noteBtn.incorrect{ background:#d13b3b; color:#fff; border-color:rgba(0,0,0,.18); }
.noteBtn.correct:disabled, .noteBtn.incorrect:disabled{ opacity: 1; }
.noteBtn.chosen{ box-shadow: 0 0 0 6px var(--scaleBlueRGBA); border-color: rgba(0,0,0,.25); }

/* In the Answer buttons, .note receives the Roman numeral (larger), .deg gets the chord names (smaller) */
.noteBtn .note{ font-size:13px; font-weight:900; line-height:1.05; }
.noteBtn .deg{ font-size:12px; font-weight:900; opacity:.78; letter-spacing:.2px; }

.nextReady{
  --ringColor: var(--nextPulseRGBA);
  background: var(--nextOrange);
  color:#fff;
  border-color: rgba(0,0,0,.15);
  animation: ringPulse 1.15s ease-in-out infinite;
  animation-delay: var(--pulseSyncDelay, 0s);
}

.analysis{
  align-items: center;
  max-width: var(--analysis-max);
  margin: 10px auto 0;
  background:#fff;
  border:1px solid rgba(0,0,0,.0);
  border-radius:16px;
  padding:0px;
}
.analysisGrid{display:grid;gap:10px;margin:0 auto;justify-items:center}
.analysisCard{
  align-items: center;
  border:1px solid rgba(0,0,0,.2);
  border-radius:14px;
  padding:12px;
  background:#f9f9f9;
}
.analysisLabel{
  align-items: center;
  font-size:12px;
  opacity:.75;
  margin-bottom:8px;
  font-weight:900;
  letter-spacing:.2px;
  text-align:center;
}

.scoreCardNarrow{ padding:10px; justify-self:center; }
.scoreGrid{ display:grid; gap:8px 10px; }
.scoreGridVertical{ grid-template-columns: 1fr; gap:8px; max-width: 420px; margin: 0 auto; }
.scoreItem{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:10px;
  padding:8px 10px;
  border:1px solid rgba(0,0,0,.2);
  border-radius:12px;
  background:#fff;
}
.scoreK{ font-size:12px; opacity:.75; font-weight:800; letter-spacing:.2px; }
.scoreV{ font-weight:900; font-variant-numeric:tabular-nums; }

.mount{ overflow:hidden; }
.mount svg{ display:auto; margin:0 auto; height:128px; }
.miniMountInCard{ height: 128px; min-height: 100px; display:flex; align-items:center; justify-content:center; }

.hero, .controlsPanel, .endnotes{
  max-width: var(--text-max);
  margin-left: auto;
  margin-right: auto;
}

.modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding-top: 100px;
  padding-left:10px;
  padding-right: 10px;
  z-index:50;
  overflow:auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.modal.hidden{display:none}
.modalCard{
  width:min(720px,100%);
  background:white;
  border-radius:18px;
  border:1px solid rgba(0,0,0,.1);
  padding:14px;
  box-shadow:0 12px 30px rgba(0,0,0,.25);
  max-height: calc(100dvh - 36px);
  overflow:auto;
  display:flex;
  flex-direction:column;
  align-items:center;
}
.modalTitle{font-size:18px;font-weight:900;margin:0 0 8px;text-align:center}
.modalBody{
  font-size:14px;
  line-height:1.45;
  opacity:.95;
  white-space:pre-wrap;
  text-align:center;
  display:flex;
  flex-direction:column;
  align-items:center;
  width:100%;
}
.modalBody > *{ width:100%; }
.modalBody p{ margin:0 0 10px; }
.modalBody ul{ list-style-position: inside; padding-left:0; text-align:center; }
.modalBody li{ margin:6px 0; }
.modalActions{margin-top:10px;display:flex;justify-content:center;gap:10px;flex-wrap:wrap}

@media (max-width:420px){ button{padding:0 12px;} }

.settingsGrid{ display:grid; grid-template-columns: 1fr; gap: 10px; justify-items: center; }

.statusPanel{ max-width: var(--text-max); margin: 8px auto 0; background:#fff; border:1px solid rgba(0,0,0,0); border-radius:16px; padding: 0; }
.statusRow{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; padding: 10px 10px 6px; }
.scaleMiniWrap{ width: min(780px, 100%); }
.statusText{ width:100%; text-align:center; }
.phaseTitle{ font-weight:900; font-size:16px; }

#beginBtn.isRestart{ background:#fff; color: var(--text); }
.confirmPrimary{ background:#1f9d55; color:#fff; border-color: rgba(0,0,0,.18); }

.feedbackLine{
  max-width: var(--text-max);
  margin: 12px auto 0;
  text-align:center;
  font-size:14px;
  line-height:1.4;
  opacity: .92;
}

.scoreMeta{ text-align:center; font-size:12px; font-weight:900; opacity:.75; margin: 2px 0 10px; }
.scoreActions{ margin-top: 10px; display: grid; justify-content:center; align-items:center; gap:10px; flex-wrap:wrap; }
#playerNameInput{ height:38px; padding:0 10px; border-radius:12px; border:1px solid rgba(0,0,0,.2); background:#fff; font-weight:800; width:min(240px, 70vw); }
#playerNameInput::placeholder{ opacity:.6; font-weight:800; }
#downloadScorecardBtn{ height:38px; }