/* Earworms (js/earworms.js; screen 42 of "Alive Jam mockups"): a song's moment, its line, YouTube's player from the
   moment, Spotify and Apple Music, Did you hear it?, Report a mistake, and the tally after answering. The same round
   sits in a lesson's card (.is-compact). */

.ew,
.ew-round {
  --ew-soft: #C9C5CE;
  --ew-mute: #A6A3AC;
  --ew-line2: rgba(241, 237, 228, .3);
  --ew-yes: #9EDA97;
  --ew-no: #EB603A;
  --ew-unsure: #A6A3AC;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.ew-lede,
.ew-line,
.ew-head,
.ew-grew p {
  margin: 0;
  color: var(--ew-soft);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ew-fine {
  margin: 0;
  color: var(--ew-mute);
  font-size: 12.5px;
  line-height: 1.45;
}

.ew-k {
  color: var(--ew-mute);
  font-size: 12.5px;
}

.ew-bar-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.ew-selwrap {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.ew-sel {
  min-height: 44px;
  max-width: 100%;
  padding: 0 12px;
  border: 1px solid var(--ew-line2);
  border-radius: var(--r-pill);
  background: var(--panel);
  color: var(--starlight);
  font: inherit;
  font-size: 14px;
}

.ew-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--ew-line2);
  border-radius: 16px;
  background: radial-gradient(120% 90% at 85% 0%, #24364A 0%, #0A0C13 70%);
}

.ew-song {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.ew-label {
  margin: 0;
  color: var(--starlight);
  font-size: 14px;
  font-weight: 500;
}

.ew-player {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #1B2333, #0A0C13);
}

.ew-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ew-player.is-search {
  aspect-ratio: auto;
  min-height: 120px;
  gap: 6px;
  padding: 16px;
  text-align: center;
}

.ew-playbtn {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(241, 237, 228, .92);
  color: var(--space);
}

.ew-playbtn .ew-ic path {
  fill: currentColor;
}

.ew-from {
  position: absolute;
  left: 10px;
  bottom: 8px;
  color: var(--ew-soft);
  font-size: 12px;
}

.ew-player.is-search .ew-from {
  position: static;
}

.ew-find {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--ew-line2);
  border-radius: var(--r-pill);
  color: var(--starlight);
  font-size: 14px;
  text-decoration: none;
}

.ew-srcs,
.ew-chips,
.ew-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ew-src {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--ew-line2);
  border-radius: var(--r-pill);
  color: var(--starlight);
  font-size: 13.5px;
  text-decoration: none;
}

.ew-ic {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ew-ask {
  display: grid;
  gap: 8px;
}

.ew-q {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 18px;
  text-align: center;
}

.ew-answers {
  display: grid;
  gap: 8px;
}

.ew-ans {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--ew-line2);
  border-radius: var(--r-pill);
  color: var(--starlight);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

.ew-ans.is-main,
.ew-ans[aria-pressed='true'] {
  border-color: var(--starlight);
  background: var(--starlight);
  color: var(--space);
  font-weight: 600;
}

.ew-answers.is-answered .ew-ans:not([aria-pressed='true']) {
  border-color: var(--ew-line2);
  background: transparent;
  color: var(--starlight);
  font-weight: 500;
}

.ew-ans:disabled {
  opacity: .5;
}

.ew-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  color: var(--ew-soft);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ew-form {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.ew-rh {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.ew-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--ew-line2);
  border-radius: var(--r-pill);
  color: var(--ew-soft);
  font-size: 13px;
}

.ew-chip[aria-pressed='true'] {
  border-color: var(--starlight);
  color: var(--starlight);
  background: var(--lift);
}

.ew-words {
  width: 100%;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid var(--ew-line2);
  border-radius: 12px;
  background: var(--space);
  color: var(--starlight);
  font: inherit;
  font-size: 14px;
  resize: vertical;
}

.ew-after {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px dashed var(--ew-line2);
  border-radius: 16px;
}

.ew-head {
  color: var(--starlight);
  font-size: 14.5px;
}

.ew-head:focus {
  outline: none;
}

.ew-head strong {
  font-weight: 600;
}

.ew-tally {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ew-bar {
  display: flex;
  flex: 1;
  min-width: 60px;
  height: 6px;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--line);
}

.ew-bar .is-yes {
  background: var(--ew-yes);
}

.ew-bar .is-unsure {
  background: var(--ew-unsure);
}

.ew-bar .is-no {
  background: var(--ew-no);
}

.ew-count {
  color: var(--ew-mute);
  font-size: 12.5px;
  text-align: right;
}

.ew-grew {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ew-leaf {
  flex: none;
}

.ew-round.is-compact .ew-card {
  padding: 12px;
}

@media (min-width: 640px) {
  .ew-answers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.ln-ew { margin-top: 4px; }
.ln-ew:empty { display: none; }
.ln-ew { text-align: left; }

.ew-round.is-compact .ew-player {
  width: 100%;
  max-width: 480px;
}
