/* The note order, elemental colours, and orientation follow the CM01 wheel. */
.reader-page.music-map-page .reader-hero {
  max-width: calc(660px + 185px + clamp(28px, 4vw, 60px));
  padding-right: 0;
}

.reader-page.music-map-page .reader-grid {
  grid-template-columns: minmax(0, 660px) minmax(150px, 185px);
}

.reader-page.music-map-page .reader-article,
.reader-page.music-map-page .reader-route {
  grid-column: auto;
  grid-row: auto;
}

.reader-prose .music-map-player {
  background: radial-gradient(ellipse at 50% 43%, #252043 0%, #11132d 47%, #0a1024 84%);
  border: 1px solid #bcaa8830;
  border-radius: 0.85rem;
  margin: 2rem auto 1.65rem;
  padding: clamp(0.35rem, 2vw, 1rem);
  box-sizing: border-box;
  color: #e7e2db;
  font: 400 0.9rem/1.5 var(--font-main, system-ui, sans-serif);
}

.music-map-wheel {
  position: relative;
  inline-size: min(100%, 33rem);
  aspect-ratio: 1;
  margin-inline: auto;
}

.music-map-wheel .music-map-dial {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.music-map-spoke {
  stroke: #b9c9ed28;
  stroke-width: 1;
}

.music-map-spoke.is-selected {
  stroke: color-mix(in srgb, var(--tone) 65%, transparent);
  stroke-width: 1.8;
}

.music-map-wheel button {
  position: absolute;
  box-sizing: border-box;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.08rem;
  margin: 0;
  padding: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  font-family: inherit;
  color: #f3eddf;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 140ms, border-color 140ms, box-shadow 140ms;
}

.music-map-wheel button:focus-visible {
  outline: 2px solid #fff3d4;
  outline-offset: 3px;
  z-index: 1;
}

.music-map-wheel .music-map-note {
  top: var(--y);
  left: var(--x);
  inline-size: max-content;
  min-inline-size: clamp(45px, 13%, 64px);
  min-block-size: clamp(45px, 13%, 64px);
  padding: 0.2rem 0.15rem;
  border: 1px solid #aeb8db66;
  border-color: color-mix(in srgb, var(--tone) 50%, #181d36);
  background: #11182f;
  background: color-mix(in srgb, var(--tone) 8%, #0e152b);
  font-size: clamp(0.65rem, 2.9vw, 0.875rem);
  font-weight: 720;
  line-height: 1.12;
  font-variant-numeric: lining-nums;
  white-space: nowrap;
}

.music-map-elemental {
  color: color-mix(in srgb, var(--tone) 48%, #f6f1e7);
}

.music-map-note small {
  color: #c9d2e7;
  font-size: 0.65rem;
  font-weight: 650;
}

@media (hover: hover) {
  .music-map-note:hover {
    border-color: var(--tone);
    background-color: color-mix(in srgb, var(--tone) 22%, #0e152b);
  }

  .music-map-play:hover:enabled {
    background-color: #36324e;
  }
}

.music-map-note[aria-pressed="true"] {
  border-color: var(--tone);
  background-color: color-mix(in srgb, var(--tone) 27%, #10172c);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 55%, transparent),
    0 0 15px color-mix(in srgb, var(--tone) 28%, transparent);
}

.music-map-note.is-sounding {
  color: #fff;
  background-color: color-mix(in srgb, var(--tone) 43%, #141a32);
  box-shadow: 0 0 0 2px var(--tone), 0 0 24px color-mix(in srgb, var(--tone) 62%, transparent);
}

.music-map-play {
  top: 50%;
  left: 50%;
  inline-size: clamp(78px, 24%, 122px);
  aspect-ratio: 1;
  border: 1px solid #e6c691c2;
  background: #24233e;
  box-shadow: 0 0 0 5px #f0c6870b, inset 0 0 28px #e6bd8210;
  font-size: clamp(0.76rem, 2.9vw, 0.93rem);
  line-height: 1.15;
  font-weight: 700;
}

.music-map-play svg {
  width: 1.4rem;
  height: 1.4rem;
  margin-bottom: 0.18rem;
  color: #ffd99f;
}

.music-map-play [data-stop-icon],
.music-map-player.is-playing [data-start-icon] { display: none; }
.music-map-player.is-playing [data-stop-icon] { display: block; }

.music-map-player.is-playing .music-map-play {
  background: #3a3047;
  box-shadow: 0 0 0 5px #f0c6871e, 0 0 22px #ffc87838;
}

.music-map-play:disabled {
  opacity: 0.6;
  cursor: default;
}

.music-map-play [data-play-label] {
  max-inline-size: 8ch;
  overflow-wrap: normal;
  text-align: center;
}

.music-map-player .music-map-anchors {
  position: absolute;
  top: 65%;
  left: 0;
  right: 0;
  margin: 0;
  color: #bec9e2;
  font-size: clamp(0.7rem, 2.6vw, 0.87rem);
  letter-spacing: 0.035em;
  text-align: center;
  pointer-events: none;
}

.music-map-selection {
  border-top: 1px solid #bcaa8830;
  margin-inline: clamp(0.4rem, 2vw, 0.85rem);
  padding-block: 0.85rem 0.2rem;
}

.music-map-selection-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  color: #d3d9e8;
  font-weight: 650;
}

.music-map-selection-header .music-map-count {
  color: #f2cd96;
  font-variant-numeric: tabular-nums;
}

.music-map-player .music-map-selection ol {
  margin: 0.55rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  list-style: none;
}

.music-map-player .music-map-selection li {
  margin: 0;
  border: 1px solid #aab8dd38;
  border-radius: 0.38rem;
  padding: 0.21rem 0.5rem;
  color: #c9d2e7;
}

.music-map-selection li strong {
  margin-inline-end: 0.15rem;
  color: #fff0d6;
}

.music-map-player .music-map-selection p {
  margin: 0.55rem 0 0;
}

.music-map-player [data-player-status]:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.music-map-player [data-player-status] { color: #ffe0af; }
.music-map-player .music-map-selection [hidden] { display: none; }

@media (max-width: 950px) {
  .reader-page.music-map-page .reader-hero { max-width: 660px; }

  .reader-page.music-map-page .reader-grid {
    grid-template-columns: minmax(0, 660px);
  }

  .reader-page.music-map-page .reader-route { width: 100%; }
}

@media (max-width: 420px) {
  .reader-prose .music-map-player { padding: 0.25rem; }
  .music-map-wheel .music-map-anchors { top: 66.5%; }
}

@media (prefers-reduced-motion: reduce) {
  .music-map-wheel button { transition: none; }
}
