/*!
 * What Song Is It? — look.
 *
 * Prodigies paper, like the other Compose-Tool games: the notation is the hero,
 * so the page around it stays quiet and the four answers are the only bright
 * things besides the staff.
 */

:root {
  --paper: #f5f5f3;
  --paper-light: #fbfbf9;
  --ink: #1f1d1a;
  --ink-soft: #4a463f;
  --ink-faded: #8a8478;
  --rule: #d8d4cb;
  --teal: #009999;
  --teal-edge: #00706f;
  --green: #6abb4a;
  --green-edge: #4f9636;
  --red: #e72829;
  --gold: #ffd25b;
  --navy: #1b233e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Nunito', 'Avenir Next Rounded', 'Trebuchet MS', sans-serif;
}

.ws-screen {
  max-width: 760px;
  margin: 0 auto;
  padding: 22px 18px 46px;
}
@media (min-width: 901px) { .ws-screen { padding: 30px 24px 56px; } }

.ws-eyebrow {
  margin: 0 0 6px;
  font-size: 10px; font-weight: 900; letter-spacing: 2.2px;
  text-transform: uppercase; color: var(--teal);
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════════════════
   TITLE
   ══════════════════════════════════════════════════════════════════════════ */

.ws-title { text-align: center; }

.ws-logo {
  margin: 0 0 8px;
  font-size: clamp(32px, 8.5vw, 48px); font-weight: 900; line-height: 0.96;
  color: var(--navy); letter-spacing: -1px;
}
.ws-logo span { display: block; color: var(--teal); }

.ws-tag { margin: 0 0 20px; font-size: 15px; font-weight: 700; color: var(--ink-soft); }

/* A row of songbook icons, overlapped like a hand of cards. */
.ws-peek {
  display: flex; justify-content: center; align-items: center;
  margin: 0 0 22px;
}
.ws-peek img {
  width: clamp(46px, 11vw, 68px); height: auto;
  border-radius: 12px;
  margin-left: -10px;
  box-shadow: 0 3px 8px rgba(31, 29, 26, 0.16);
  background: #fff;
}
.ws-peek img:first-child { margin-left: 0; }
.ws-peek img:nth-child(even) { transform: rotate(-4deg); }
.ws-peek img:nth-child(odd) { transform: rotate(3deg); }

.ws-play-btn {
  border: none; border-radius: 999px;
  padding: 14px 36px;
  background: var(--green); box-shadow: 0 5px 0 var(--green-edge);
  color: #fff; font: inherit; font-size: 19px; font-weight: 900; cursor: pointer;
}
.ws-play-btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--green-edge); }
.ws-play-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--green-edge); }

.ws-ghost-btn {
  border: 2px solid var(--rule); border-radius: 999px;
  padding: 11px 22px; background: #fff;
  font: inherit; font-size: 14px; font-weight: 900; color: var(--ink-soft); cursor: pointer;
}
.ws-ghost-btn:hover { border-color: var(--ink-faded); color: var(--ink); }

.ws-bests { display: flex; justify-content: center; gap: 22px; margin: 22px 0 12px; }
.ws-bests div { display: grid; gap: 1px; }
.ws-bests dt {
  font-size: 9px; font-weight: 900; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--ink-faded);
}
.ws-bests dd { margin: 0; font-size: 19px; font-weight: 900; color: var(--navy); }

.ws-note {
  margin: 0 auto; max-width: 46ch;
  font-size: 11.5px; font-weight: 700; color: var(--ink-faded); line-height: 1.5;
}
.ws-warn { margin: 0; font-size: 14px; font-weight: 800; color: var(--red); }

/* ══════════════════════════════════════════════════════════════════════════
   PLAY
   ══════════════════════════════════════════════════════════════════════════ */

.ws-hud {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
}
.ws-quit, .ws-progress {
  border: none; background: none; padding: 0;
  font: inherit; font-size: 11px; font-weight: 900;
  letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-faded);
  cursor: pointer;
}
.ws-quit:hover { color: var(--ink); }
.ws-score {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px; font-weight: 700; color: var(--navy);
}

/* One dot per question: filled as you go, so a child can see the end coming. */
.ws-dots { display: flex; gap: 5px; justify-content: center; margin-bottom: 14px; }
.ws-dots i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--rule);
  transition: background 0.2s, transform 0.2s;
}
.ws-dots i.got { background: var(--green); }
.ws-dots i.missed { background: var(--red); }
.ws-dots i.now { background: var(--teal); transform: scale(1.35); }

/* ── The staff: the question ── */
.ws-staffcard {
  position: relative;
  background: #fff;
  border: 2px solid var(--rule); border-radius: 20px;
  padding: 14px 16px 16px;
  margin-bottom: 16px;
}
.ws-staff { min-height: 92px; }
.ws-staff svg { display: block; width: 100%; height: auto; max-height: 40vh; }

.ws-listen {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 12px auto 0;
  border: none; border-radius: 999px;
  padding: 11px 22px;
  background: var(--teal); box-shadow: 0 4px 0 var(--teal-edge);
  color: #fff; font: inherit; font-size: 15px; font-weight: 900; cursor: pointer;
}
.ws-staffcard { display: grid; justify-items: center; }
.ws-staffcard .ws-staff { width: 100%; }
.ws-listen svg { width: 16px; height: 16px; fill: currentColor; }
.ws-listen:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--teal-edge); }
.ws-listen:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--teal-edge); }
/* While the melody plays the button pulses, so a child with the sound off can
   still tell something is happening. */
.ws-listen.is-playing { animation: ws-pulse 0.9s ease-in-out infinite; }
@keyframes ws-pulse {
  0%, 100% { box-shadow: 0 4px 0 var(--teal-edge), 0 0 0 0 rgba(0, 153, 153, 0.35); }
  50% { box-shadow: 0 4px 0 var(--teal-edge), 0 0 0 12px rgba(0, 153, 153, 0); }
}

/* ── The four answers ──────────────────────────────────────────────────────
   Two by two, so every card is a big target and the art does the reading for a
   child who cannot yet read the title. */
.ws-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (min-width: 720px) { .ws-choices { grid-template-columns: repeat(4, 1fr); } }

.ws-choice {
  display: grid; justify-items: center; gap: 7px;
  padding: 11px 9px 13px;
  border: 2px solid var(--rule); border-radius: 16px;
  background: #fff;
  font: inherit; cursor: pointer;
  transition: transform 0.14s, border-color 0.14s, background 0.14s;
  -webkit-tap-highlight-color: transparent;
}
.ws-choice:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--teal); }
.ws-choice:disabled { cursor: default; }
.ws-choice-art {
  width: clamp(52px, 16vw, 78px); height: auto;
  border-radius: 12px;
  display: block;
}
.ws-choice-name {
  font-size: 12.5px; font-weight: 900; line-height: 1.2; color: var(--ink);
  text-align: center;
}

.ws-choice.is-right {
  border-color: var(--green); background: #f0faec;
  animation: ws-pop 0.32s ease-out;
}
.ws-choice.is-wrong { border-color: var(--red); background: #fdeeee; opacity: 0.85; }
@keyframes ws-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
/* A disabled wrong answer must still be readable — never fade it to grey. */
.ws-choice:disabled:not(.is-right):not(.is-wrong) { opacity: 0.5; }

.ws-feedback {
  margin: 14px 0 0; min-height: 26px;
  text-align: center; font-size: 15px; font-weight: 800;
}
.ws-feedback.is-right { color: #2e7d32; }
.ws-feedback.is-wrong { color: var(--red); }

/* ══════════════════════════════════════════════════════════════════════════
   RESULTS
   ══════════════════════════════════════════════════════════════════════════ */

.ws-results { text-align: center; }
.ws-result-head {
  margin: 0 0 6px;
  font-size: clamp(30px, 8vw, 42px); font-weight: 900; color: var(--navy);
}
.ws-stars i { font-style: normal; color: var(--rule); font-size: 15px; }
.ws-stars i.on { color: var(--gold); }
.ws-stars.big i { font-size: 34px; }
.ws-result-score {
  margin: 8px 0 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px; font-weight: 700; color: var(--ink-soft);
}

.ws-missed {
  background: var(--paper-light);
  border: 2px solid var(--rule); border-radius: 18px;
  padding: 14px 16px; margin: 0 0 20px;
}
.ws-missed-head {
  margin: 0 0 10px;
  font-size: 10px; font-weight: 900; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--ink-faded);
}
.ws-missed-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.ws-missed-song { display: grid; justify-items: center; gap: 4px; width: 86px; }
.ws-missed-song img { width: 54px; height: auto; border-radius: 10px; }
.ws-missed-song b { font-size: 11px; font-weight: 800; line-height: 1.2; }

.ws-perfect { margin: 0 0 20px; font-size: 15px; font-weight: 800; color: #2e7d32; }

.ws-result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  .ws-listen.is-playing, .ws-choice.is-right { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
