/* Compact scene controls; loaded after style.css. */
.story-chapter {
  position: absolute;
  top: 116px;
  left: 6%;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #f1f1eb;
  font: 500 12px/1.4 var(--body);
}
.story-chapter-context { display: flex; align-items: center; gap: 14px; }
.story-chapter-number { color: #c6ccc1; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.story-chapter-name { color: var(--flavor); }
.story-chapter-buttons { display: flex; align-items: center; gap: 2px; }
.story-chapter-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: 400 23px/1 Arial, sans-serif;
  transition: color 150ms ease;
  touch-action: manipulation;
}
.story-chapter-button:disabled { color: #f1f1eb42; cursor: default; }
.story-chapter-button:not(:disabled):hover { color: var(--flavor); }
.story-notes { margin-top: 9px; max-width: min(360px, 100%); }
.story-notes-toggle {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--flavor);
  font: 500 12px/1.4 var(--body);
  touch-action: manipulation;
}
.story-notes-toggle:hover { color: var(--text); }
.story-notes-symbol { display: block; font: 400 20px/1 Arial, sans-serif; transition: transform 150ms ease; }
.story-notes-toggle[aria-expanded="true"] .story-notes-symbol { transform: rotate(45deg); }
.story-notes-panel {
  max-height: min(142px, var(--story-notes-available, 142px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding-right: 12px;
  outline-offset: 4px;
}
.story-notes-character { display: block; color: var(--flavor); font-size: 11px; line-height: 1.5; }
.story-notes-panel .story-notes-copy {
  max-width: 38ch;
  margin: 5px 0 0;
  color: #e0e3da;
  font-size: 13px;
  line-height: 1.6;
}
.story-collection-actions { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px 24px; margin-top: 20px; }
.story-choose-flavor, .story-about {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: 46px;
  border: 0;
  font: 500 13px/1.5 var(--body);
  touch-action: manipulation;
}
.story-choose-flavor { padding: 12px 20px; border-radius: 3px; background: var(--text); color: var(--surface); }
.story-choose-flavor:hover { background: var(--flavor); }
.story-choose-flavor span { font: 400 20px/1 Arial, sans-serif; }
.story-about { padding: 10px 0; background: transparent; color: var(--text); text-decoration: underline; text-underline-offset: 5px; text-decoration-color: #f1f1eb66; }
.story-about:hover { text-decoration-color: currentColor; }
.stage[data-flavor="all"] .flavor-story.story-enhanced { bottom: 4svh; }

@media (max-width: 767px), (max-aspect-ratio: 4/5) {
  .story-chapter { top: 103px; left: 7%; right: auto; gap: 7px; flex-direction: column; align-items: flex-start; }
  .story-chapter-context { gap: 5px; flex-direction: column; align-items: flex-start; }
  .story-chapter-name { max-width: 8ch; font-size: 11px; }
  .story-chapter-buttons { gap: 0; flex-direction: column; margin-left: -12px; }
  .stage[data-flavor="all"] .story-chapter { top: 88px; right: 7%; flex-direction: row; align-items: center; justify-content: space-between; }
  .stage[data-flavor="all"] .story-chapter-name { max-width: none; }
  .stage[data-flavor="all"] .story-chapter-buttons { flex-direction: row; margin-left: 0; }
  .flavor-story.story-enhanced { top: 61svh; }
  .flavor-story.story-enhanced > #flavor-description { margin-top: 14px; }
  .story-notes { margin-top: 3px; max-width: 100%; }
  .story-notes-panel .story-notes-copy { max-width: 36ch; font-size: 12px; line-height: 1.6; }
  .story-notes-character { font-size: 10px; }
  .story-collection-actions { gap: 8px 20px; margin-top: 18px; }
  .story-choose-flavor, .story-about { font-size: 12px; }
  .story-choose-flavor { padding: 11px 16px; gap: 16px; }
  .stage[data-flavor="all"] .flavor-story.story-enhanced { top: 59svh; bottom: auto; }
}

/* Short phones reveal the longer copy in the description's existing space. */
@media (max-height: 740px) and (max-width: 767px), (max-height: 740px) and (max-aspect-ratio: 4/5) {
  .flavor-story.story-enhanced { top: 59svh; }
  .flavor-story.story-enhanced h1 { font-size: clamp(32px, 10vw, 42px); }
  .flavor-story.story-enhanced > #flavor-description { margin-top: 10px; font-size: 13px; line-height: 1.6; }
  .flavor-story.story-enhanced[data-notes-open="true"] > #flavor-description { display: none; }
  .stage[data-flavor="all"] .flavor-story.story-enhanced { top: auto; bottom: 64px; }
  .stage[data-flavor="all"] .flavor-story.story-enhanced h1 { font-size: clamp(28px, 8.5vw, 36px); }
  .story-collection-actions { flex-wrap: nowrap; gap: 16px; margin-top: 12px; }
  .story-choose-flavor, .story-about { min-height: 44px; font-size: 11px; }
  .story-choose-flavor { gap: 12px; padding: 10px 12px; white-space: nowrap; }
}

@media (max-height: 620px) and (max-width: 767px), (max-height: 620px) and (max-aspect-ratio: 4/5) {
  .story-notes-character { display: none; }
  .story-notes-panel .story-notes-copy { margin-top: 0; }
}

@media (max-height: 700px) and (min-aspect-ratio: 4/5) {
  .story-chapter { top: 92px; }
  .flavor-story.story-enhanced { top: 25svh; }
  .flavor-story.story-enhanced h1 { font-size: min(8vw, 18svh); }
  .flavor-story.story-enhanced > #flavor-description { margin-top: 18px; }
  .story-notes { margin-top: 2px; }
}

@media (max-height: 500px) and (min-aspect-ratio: 4/5) {
  .story-chapter { left: auto; right: 6%; top: auto; bottom: 16px; flex-direction: row; align-items: center; }
  .story-chapter-context { flex-direction: row; align-items: center; }
  .story-chapter-name { max-width: none; }
  .story-chapter-buttons { flex-direction: row; margin-left: 0; }
  .flavor-story.story-enhanced { top: 26svh; }
  .flavor-story.story-enhanced h1 { font-size: min(7vw, 16svh); }
  .flavor-story.story-enhanced[data-notes-open="true"] > #flavor-description { display: none; }
  .stage[data-flavor="all"] .flavor-story.story-enhanced { top: auto; bottom: 8svh; }
  .stage[data-flavor="all"] .flavor-story.story-enhanced h1 { font-size: min(4.5vw, 8svh); line-height: 1.05; }
  .stage[data-flavor="all"] .flavor-story.story-enhanced h1 span { max-width: none; white-space: nowrap; }
  .stage[data-flavor="all"] .flavor-story.story-enhanced > #flavor-description { max-width: none; margin: 8px auto 0; font-size: 12px; line-height: 1.4; }
  .story-collection-actions { margin-top: 8px; }
}

/* The lineup already names the collection; replay stays in the empty lower margin. */
.stage[data-flavor="all"] .story-chapter { top: auto; left: auto; right: 6%; bottom: 14px; flex-direction: row; }
.stage[data-flavor="all"] .story-chapter-buttons { flex-direction: row; margin-left: 0; }
.stage[data-flavor="all"] .story-chapter-context { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 767px), (max-aspect-ratio: 4/5) {
  .stage[data-flavor="all"] .story-chapter { right: 7%; bottom: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .story-chapter-button, .story-notes-symbol { transition: none; }
}
