:root{
  --page-bg:#ffffff;
  --text:#111;

  /* Begin button pulse */
  --pulseRGBA: rgba(77,163,255,0.28);

  /* Next button color (controls both fill + glow) */
  --nextBtnColor: #ff7a18;

  /* Answer button colors (editable) */
  --minorBtnColor: #5b5a5f;
  --majorBtnColor: #1f9d55;

  --text-max: 1000px;
  --analysis-max: 700px;

  /* Chord diagram colors */
  --chordTone:  #4da3ff;
}

*{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}

/* Title image */
.titlePicture{
  justify-content: center;
  align-items: center;
  display:block;
  margin: 10px auto 8px;
  max-width: 980px;
  padding-bottom: 10px;
}
.titleGraphic{
  align-content: center;
  display:block;
  width:70%;
  height:auto;
  margin: 0 auto;
}

.app-subtitle{
  margin:14px auto 14px;
  max-width:1020px;
  font-size:16px;
  font-weight:400;
  opacity:.75;
  line-height:1.3;
}

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

.hidden{display:none !important}

select{
  height:38px;
  width:100%;
  padding:0 10px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.2);
  background:#fff;
  cursor:pointer;
  font-weight:700;
}
.compactSelect{max-width:240px}

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:.45;cursor:not-allowed;transform:none}

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

/* Begin pulse */
@keyframes beginPulse{
  0%   { box-shadow:0 0 0 0 rgba(0,0,0,0); }
  55%  { box-shadow:0 0 0 12px var(--pulseRGBA); }
  100% { box-shadow:0 0 0 0 rgba(0,0,0,0); }
}
.pulse{ animation:beginPulse 1.25s ease-in-out infinite; }

/* Answer buttons pulse (when enabled to answer) */
@supports (color: rgb(from white r g b / 0.5)) {
  :root{
    --minorPulseRGBA: rgb(from var(--minorBtnColor) r g b / 0.30);
    --majorPulseRGBA: rgb(from var(--majorBtnColor) r g b / 0.30);
  }
}
@supports not (color: rgb(from white r g b / 0.5)) {
  :root{
    --minorPulseRGBA: rgba(111,91,211,0.30);
    --majorPulseRGBA: rgba(31,157,85,0.30);
  }
}

@keyframes minorAnswerPulse{
  0%   { box-shadow:0 0 0 0 rgba(0,0,0,0); }
  55%  { box-shadow:0 0 0 12px var(--minorPulseRGBA); }
  100% { box-shadow:0 0 0 0 rgba(0,0,0,0); }
}
@keyframes majorAnswerPulse{
  0%   { box-shadow:0 0 0 0 rgba(0,0,0,0); }
  55%  { box-shadow:0 0 0 12px var(--majorPulseRGBA); }
  100% { box-shadow:0 0 0 0 rgba(0,0,0,0); }
}

button.answerPulseMinor{ animation: minorAnswerPulse 1.1s ease-in-out infinite; }
button.answerPulseMajor{ animation: majorAnswerPulse 1.1s ease-in-out infinite; }

/* Next pulse (color controlled by --nextBtnColor) */
@supports (color: rgb(from white r g b / 0.5)) {
  :root{ --nextPulseRGBA: rgb(from var(--nextBtnColor) r g b / 0.28); }
}
@supports not (color: rgb(from white r g b / 0.5)) {
  :root{ --nextPulseRGBA: rgba(255,122,24,0.28); }
}

#nextBtn.nextStyled{
  background: var(--nextBtnColor);
  color:#fff;
  border-color: rgba(0,0,0,.2);
}

@keyframes nextPulse{
  0%   { box-shadow:0 0 0 0 rgba(0,0,0,0); }
  55%  { box-shadow:0 0 0 12px var(--nextPulseRGBA); }
  100% { box-shadow:0 0 0 0 rgba(0,0,0,0); }
}
#nextBtn.nextPulse{
  animation: nextPulse 1.25s ease-in-out infinite;
}

.actionsRow{padding: 2px;display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}
.actionsCentered{justify-content:center}

.inlineControl{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.inlineControlRow{min-width:160px}
.inlineLabel{
  font-size:12px;
  font-weight:800;
  opacity:.75;
}

.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}

.feedbackGridPitch{
  grid-template-columns: 1.25fr 0.75fr;
  align-items:stretch;
}

.analysisCard{
  align-items: center;
  border:1px solid rgba(0,0,0,.2);
  border-radius:14px;
  padding:12px;
  background:#f9f9f9;
}

.fixedFeedbackCard{
  min-height: 240px;
}

.analysisLabel{
  align-items: center;
  font-size:12px;
  opacity:.75;
  margin-bottom:8px;
  font-weight:900;
  letter-spacing:.2px;
  text-align:center;
}

.analysisBody{font-size:14px;line-height:1.45;word-break:break-word}
.scoreBody{font-variant-numeric:tabular-nums}

.feedbackStack{
  align-items: center;
  display:flex;
  align-items: center;
  flex-direction:column;
  gap:8px;
}

.scoreCardNarrow{
  padding:10px;
}

.scoreGrid{
  display:grid;
  gap:8px 10px;
}
.scoreGridVertical{
  grid-template-columns: 1fr;
  gap:8px;
}
.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;
}

#feedbackOut{ text-align: center; }

/* Legend + diagram */
.miniLegend{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:800;
  opacity:.75;
  user-select:none;
}
.miniLegendInCard{ margin: 0; }

.legendDot{
  width:10px;height:10px;border-radius:999px;display:inline-block;margin:0 6px 0 0;
  border:1px solid rgba(0,0,0,.2);
}
.legendTone{background:var(--chordTone)}

.mount{
  overflow:hidden;
}
.mount svg{display:block;margin:0 auto;width:100%;height:auto;}

.miniMountInCard{
  height: 128px;
  min-height: 128px;
  display:flex;
  align-items:center;
  justify-content:center;
}

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

/* Modal (default: dark overlay) */
.modal{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.55);
  z-index: 1000;
}
.modal.hidden{ display:none; }

.modalCard{
  text-align: center;
  width: min(700px, calc(100vw - 32px));
  border-radius: 16px;
  background: #fff;
  color: #2b2b2b;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.modalHeader{
  padding: 0px;
  text-align: center;
  display:flex;
  align-items:center;
  justify-content: center;
  gap: 0px;
  margin-bottom: 0px;
}

.modalBody{
  padding: 0px;
  text-align: center;
  line-height: 1.5;
}

.modalFooter{
  padding: 0px;
  text-align: center;
  display:flex;
  justify-content: center;
  margin-top: 0px;
}

.iconBtn{
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
}

/* Info popup: NO background darkening */
#infoModal.modal{
  background: transparent;
}

/* Info popup: remove big gap between title and first text */
#infoModal .modalHeader h2{
  margin: 0;
}
#infoModal .modalBody > :first-child{
  margin-top: 0;
}
#infoModal .modalBody > :last-child{
  margin-bottom: 0;
}

@media (max-width:980px){
  .compactSelect{max-width:100%}
  .inlineControlRow{min-width:unset;width:100%}
}

@media (max-width:820px){
  .feedbackGridPitch{ grid-template-columns: 1fr; }
  .fixedFeedbackCard{ min-height: 260px; }
}

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

.answerBtn{
  width: min(110px, 100%);
}

.refRow{ margin-top: 6px; }
.refBtn{
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.2);
  background: #fff;
  font-weight: 800;
}

/* Answer button fills (separate colors) */
#minorBtn{ background: var(--minorBtnColor); color:#fff; border-color: rgba(0,0,0,.2); }
#majorBtn{ background: var(--majorBtnColor); color:#fff; border-color: rgba(0,0,0,.2); }

/* Compare panel (shown only after answering) */
.comparePanel{
  width:100%;
  max-width: 560px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
}
.compareSubtitle{
  font-size:12px;
  font-weight:900;
  opacity:.75;
  letter-spacing:.2px;
  text-align:center;
  margin-top: 2px;
}
.compareRow{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:center;
}
.compareBtn{
  height:34px;
  padding:0 12px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.2);
  background:#fff;
  cursor:pointer;
  font-weight:800;
}
@media (max-width:420px){
  .compareBtn{ width: 100%; }
}