/* assets/styles/pages/learn/learn-scale.css */
/* Lesson 11: scale as ordered ascent/descent on a real five-line staff. */

.learn-scale-card {
  direction: rtl;
  width: min(100%, 860px);
  margin: 22px auto;
  padding: 22px 18px;
  border-radius: 28px;
  border: 1px solid rgba(255,224,138,.25);
  background:
    radial-gradient(circle at 18% 12%, rgba(255,224,138,.11), transparent 14rem),
    linear-gradient(135deg, rgba(255,224,138,.06), transparent 48%),
    rgba(9,9,11,.30);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 18px 42px rgba(0,0,0,.20);
}

.learn-scale-title {
  margin: 0 0 16px;
  color: rgba(255,255,255,.84);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.7;
  text-align: center;
}

.learn-scale-map {
  display: grid;
  gap: 14px;
}

.learn-scale-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.035);
}

.learn-scale-row-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255,255,255,.72);
  line-height: 1.55;
}

.learn-scale-row-heading strong {
  color: #fff3bd;
  font-size: 1rem;
  font-weight: 900;
  white-space: nowrap;
}

.learn-scale-row-heading span {
  font-size: .92rem;
  text-align: end;
}

.learn-scale-staff-board {
  --staff-line: rgba(255,224,138,.58);
  --note-fill: #fff3bd;
  direction: ltr;
  position: relative;
  min-height: 196px;
  border-radius: 22px;
  border: 1px solid rgba(255,224,138,.18);
  background:
    radial-gradient(circle at 20% 18%, rgba(255,224,138,.08), transparent 12rem),
    rgba(255,255,255,.024);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.learn-scale-staff-lines {
  position: absolute;
  left: 8%;
  right: 5%;
  top: 31%;
  height: 45%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.learn-scale-staff-lines span {
  height: 2px;
  border-radius: 999px;
  background: var(--staff-line);
  box-shadow: 0 0 8px rgba(255,224,138,.10);
}

.learn-scale-clef {
  position: absolute;
  left: 2.7%;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,243,189,.72);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(3.1rem, 8vw, 5rem);
  line-height: 1;
  z-index: 1;
  pointer-events: none;
}

.learn-scale-path-line {
  position: absolute;
  left: 8.5%;
  right: 5.5%;
  top: 58%;
  height: 2px;
  background: linear-gradient(90deg, rgba(124,214,255,.12), rgba(255,224,138,.42), rgba(255,143,177,.12));
  transform-origin: center;
  z-index: 0;
  pointer-events: none;
}

.learn-scale-staff-board[data-mode='ascending'] .learn-scale-path-line {
  transform: rotate(-17deg);
}

.learn-scale-staff-board[data-mode='descending'] .learn-scale-path-line {
  transform: rotate(17deg);
}

.learn-scale-staff-note {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 44px;
}

.learn-scale-notehead {
  position: relative;
  width: 30px;
  height: 21px;
  border-radius: 50%;
  background: var(--note-fill);
  box-shadow: 0 0 18px rgba(255,224,138,.28), 0 6px 12px rgba(0,0,0,.18);
  transform: rotate(-12deg);
}

.learn-scale-notehead::after {
  content: '';
  position: absolute;
  right: 2px;
  top: -46px;
  width: 4px;
  height: 50px;
  border-radius: 999px;
  background: var(--note-fill);
  transform: rotate(12deg);
  transform-origin: bottom center;
}

.learn-scale-ledger {
  display: none;
  position: absolute;
  top: 50%;
  width: 44px;
  height: 2px;
  border-radius: 999px;
  background: var(--staff-line);
  transform: translateY(-50%);
  z-index: -1;
}

.learn-scale-staff-note.has-ledger .learn-scale-ledger {
  display: block;
}

.learn-scale-staff-label {
  margin-top: 3px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,224,138,.18);
  background: rgba(9,9,11,.70);
  color: #fff3bd;
  font-size: .78rem;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}

.learn-scale-staff-note small {
  min-height: 1em;
  color: rgba(255,255,255,.58);
  font-size: .62rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.learn-scale-staff-note.is-lower-do .learn-scale-staff-label,
.learn-scale-staff-note.is-upper-do .learn-scale-staff-label {
  border-color: rgba(126,207,160,.28);
  background: rgba(126,207,160,.12);
  color: #bfffd5;
}

.learn-scale-hint {
  margin: 16px 4px 0;
  color: rgba(255,255,255,.76);
  font-size: .96rem;
  line-height: 1.8;
  text-align: center;
}

.learn-scale-choice-line {
  direction: rtl;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.035);
  color: rgba(255,255,255,.82);
  font-weight: 800;
  line-height: 1.7;
}

@media (max-width: 720px) {
  .learn-scale-card {
    margin: 20px -4px;
    padding: 18px 12px;
    border-radius: 22px;
  }

  .learn-scale-row {
    padding: 12px 10px;
  }

  .learn-scale-row-heading {
    display: grid;
    gap: 4px;
  }

  .learn-scale-row-heading span {
    text-align: start;
  }

  .learn-scale-staff-board {
    min-height: 178px;
    border-radius: 18px;
  }

  .learn-scale-staff-lines {
    left: 10%;
    right: 4%;
    top: 32%;
    height: 43%;
  }

  .learn-scale-clef {
    left: 1.6%;
    font-size: 3rem;
  }

  .learn-scale-notehead {
    width: 24px;
    height: 17px;
  }

  .learn-scale-notehead::after {
    top: -36px;
    height: 40px;
    width: 3px;
  }

  .learn-scale-staff-note {
    min-width: 36px;
  }

  .learn-scale-staff-label {
    padding: 2px 4px;
    font-size: .66rem;
  }

  .learn-scale-staff-note small {
    display: none;
  }
}

@media (max-width: 420px) {
  .learn-scale-staff-board {
    min-height: 166px;
  }

  .learn-scale-staff-label {
    font-size: .58rem;
  }
}
