/* The stage stays in view while the page moves through the five scenes. */
body:not(.gate-open):not(.modal-open):not(.author-works-open) { overflow-x: clip; }
.lyric-world {
  --world-progress: 0%;
  width: min(1220px, calc(100% - clamp(24px, 8vw, 96px)));
  min-height: 255svh;
  margin: 20px auto 0;
  color: var(--ink, #f0dfbd);
  scroll-margin-top: 88px;
  transition-property: none;
}
.lyric-world__sticky { position: sticky; top: clamp(56px, 8svh, 88px); }
.lyric-world__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 38px;
  margin: 0 0 4px;
  color: var(--muted, #b6a183);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: .08em;
}
.lyric-world__heading h2 { margin: 0; color: var(--ink); font-size: clamp(18px, 2.2vw, 28px); font-weight: 400; letter-spacing: .06em; }
.lyric-world__heading p { display: flex; align-items: center; gap: 12px; margin: 0; }
#lyricWorldSeason { color: var(--ink); white-space: nowrap; }
.lyric-world__stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: clamp(340px, 68svh, 660px);
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}
.lyric-world__stage:active { cursor: grabbing; }
.lyric-world__stage:focus-visible { outline: 1px solid var(--focus, #d5b478); outline-offset: 4px; }
.lyric-world__fallback,
.lyric-world__stage > canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  transition: opacity .55s ease;
}
.lyric-world__fallback {
  z-index: 0;
  object-fit: cover;
  object-position: 50% 50%;
  opacity: .42;
  -webkit-mask-image: radial-gradient(ellipse at 50% 52%, #000 12%, #000b 43%, transparent 76%);
  mask-image: radial-gradient(ellipse at 50% 52%, #000 12%, #000b 43%, transparent 76%);
  pointer-events: none;
  -webkit-user-drag: none;
}
.lyric-world__stage > canvas {
  z-index: 1;
  opacity: 0;
  mask-image: linear-gradient(transparent, #000 14%, #000 88%, transparent), linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-composite: intersect;
}
.lyric-world.is-ready .lyric-world__stage > canvas { opacity: 1; }
.lyric-world.is-ready[data-phase='moon'] .lyric-world__stage > canvas {
  mask-image: linear-gradient(transparent, #000 8%, #000 94%, transparent), linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
:root:not([data-theme='light']) .lyric-world.is-ready[data-phase='moon'] .lyric-world__stage::before {
  position: absolute;
  inset: 0;
  content: '';
  background: radial-gradient(ellipse at 53% 28%, #283943 0%, #172831 35%, #132128 58%, transparent 90%);
  mask-image: linear-gradient(transparent, #000 12%, #000 78%, transparent), linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-composite: intersect;
  pointer-events: none;
}
.lyric-world.is-ready .lyric-world__fallback { opacity: 0; }
.lyric-world.is-fallback .lyric-world__stage > canvas,
.lyric-world[data-mode='fallback'] .lyric-world__stage > canvas { opacity: 0; }
.lyric-world.is-fallback .lyric-world__fallback,
.lyric-world[data-mode='fallback'] .lyric-world__fallback { opacity: .42; }
.lyric-world__hint {
  position: absolute;
  z-index: 2;
  right: 16px;
  bottom: 12px;
  left: 16px;
  color: var(--muted, #b6a183);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
  opacity: .78;
  pointer-events: none;
}
.lyric-world__steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: min(420px, 90%); margin: 4px auto 0; padding: 10px 0 0; list-style: none; background: linear-gradient(90deg, var(--focus) var(--world-progress), var(--line) var(--world-progress)) top / 100% 1px no-repeat; text-align: center; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.lyric-world__steps [aria-current='step'] { color: var(--ink); }
.lyric-world.is-fallback { min-height: 0; }
.lyric-world.is-fallback .lyric-world__sticky { position: static; }
.lyric-world.is-fallback .lyric-world__steps, .lyric-world.is-fallback .lyric-world__hint, .lyric-world.is-fallback #lyricWorldSeason { display: none; }
@media (max-width: 740px) {
  .lyric-world { width: calc(100% - 24px); min-height: 250svh; margin-top: 0; }
  .lyric-world__heading { gap: 10px; padding: 0 4px; }
  .lyric-world__stage { height: clamp(260px, 63svh, 460px); }
  .lyric-world__hint { right: 8px; bottom: 10px; left: 8px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .lyric-world__fallback, .lyric-world__stage > canvas { transition: none; }
}
body.motion-reduced .lyric-world__fallback,
body.motion-reduced .lyric-world__stage > canvas { transition: none; }

.scene-editor__toggle { display: none; }
.lyric-world.is-ready .scene-editor__toggle { display: inline-block; }
.scene-editor__toggle,
.scene-editor__actions button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}
.scene-editor__toggle:hover,
.scene-editor__actions button:hover { border-color: var(--focus); }
.scene-editor__toggle[aria-expanded='true'] { background: var(--surface-raised); border-color: var(--focus); }
.scene-editor__toggle:focus-visible,
.scene-editor :is(button, input, select):focus-visible { outline: 1px solid var(--focus); outline-offset: 3px; }
.is-scene-editing .scene-editor-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(246px, 26vw, 300px);
  align-items: start;
  gap: clamp(10px, 2vw, 28px);
}
.is-scene-editing :is(.lyric-world__hint, .lyric-world__steps) { display: none; }
.scene-editor[hidden] { display: none; }
.scene-editor {
  max-height: clamp(340px, 68svh, 660px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--muted) transparent;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.55;
}
.scene-editor__scene,
.scene-editor__field { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 10px; }
.scene-editor__scene { margin-bottom: 15px; font-size: 13px; }
.scene-editor select {
  width: 100%;
  min-height: 36px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  background: var(--surface-raised);
  font: inherit;
}
.scene-editor fieldset { min-width: 0; margin: 0 0 12px; padding: 6px 0 0; border: 0; border-top: 1px solid var(--line); }
.scene-editor legend { padding-right: 8px; color: var(--muted); }
.scene-editor__field { min-height: 30px; }
.scene-editor__field--range { grid-template-columns: 4.1em minmax(0, 1fr) 3.2em; }
.scene-editor input[type='range'] { width: 100%; min-height: 24px; margin: 0; accent-color: var(--focus); cursor: pointer; }
.scene-editor output { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.scene-editor__actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.scene-editor__actions button { flex: 1; padding-inline: 5px; }
.scene-editor__status { min-height: 1.55em; margin: 8px 0 0; color: var(--muted); }
@media (max-width: 740px) {
  .lyric-world__heading:has(.scene-editor__toggle) p { gap: 6px; }
  .scene-editor__toggle { min-height: 44px; padding-inline: 7px; }
  .is-scene-editing .scene-editor-workspace { display: block; }
  .is-scene-editing .lyric-world__stage { height: clamp(140px, 29svh, 290px); }
  .scene-editor { max-height: 39svh; padding: 12px; }
  .scene-editor select,
  .scene-editor__actions button { min-height: 44px; }
}
