﻿/* Prologue page: side-view stage, caption, player controls and scene timeline. */
body[data-page='story'] main { max-width: 1400px; }
.prologue-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin: -8px 0 8px; padding: 0 4px; }
.prologue-title h1 { font-size: clamp(22px, 4.6vw, 30px); }
.prologue-title h1 em { font-style: normal; color: var(--green); }
.prologue-title p { color: var(--muted); font-size: 15px; }

.stage { background: var(--paper); border: 2px solid var(--line); border-radius: 16px; box-shadow: 6px 6px 0 var(--shadow); overflow: hidden; }
.hud { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px; background: #f4f8e8; border-bottom: 2px solid #dbe4cb; }
#day-label { font: 16px Jua, sans-serif; color: var(--green-dark); }
#day-label::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 8px; background: #8db55a; box-shadow: 2px 2px 0 #cfdfb6; }
.stage { position: relative; }
.sound-menu summary { display: flex; align-items: center; min-height: 40px; padding: 4px 14px; border: 2px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--green-dark); font-size: 15px; white-space: nowrap; cursor: pointer; list-style: none; }
.sound-menu summary::-webkit-details-marker { display: none; }
.sound-menu summary::after { content: '▾'; margin-left: 6px; font-size: 12px; }
.sound-menu[open] summary { background: var(--leaf); border-color: var(--green); }
.sound-panel { position: absolute; right: 8px; top: 54px; z-index: 6; display: grid; gap: 10px; width: min(300px, calc(100% - 16px)); padding: 14px; background: var(--paper); border: 2px solid var(--line); border-radius: 14px; box-shadow: 4px 4px 0 var(--shadow); }
.volume { display: grid; grid-template-columns: minmax(0, 1fr) 44px auto 44px; align-items: center; gap: 8px; }
.volume-name { font: 16px Jua, sans-serif; color: var(--green-dark); }
.volume button { width: 44px; height: 44px; border: 2px solid var(--line); border-radius: 12px; background: #f6f8ec; color: var(--green-dark); font-size: 22px; line-height: 1; }
.volume button:hover:not(:disabled) { background: var(--leaf); border-color: var(--green); }
.volume button:disabled { opacity: .35; cursor: default; }
.meter { display: flex; align-items: flex-end; gap: 3px; height: 26px; }
.meter i { width: 7px; background: #dfe6cf; border-radius: 2px; }
.meter i:nth-child(1) { height: 30%; } .meter i:nth-child(2) { height: 47%; } .meter i:nth-child(3) { height: 64%; } .meter i:nth-child(4) { height: 82%; } .meter i:nth-child(5) { height: 100%; }
.meter i.on { background: #7fae4c; }
#sound-toggle { min-height: 44px; padding: 4px 12px; border: 2px solid var(--line); border-radius: 10px; background: #f6f8ec; color: var(--green-dark); font-size: 15px; white-space: nowrap; }
#sound-toggle[aria-pressed='false'] { color: var(--muted); background: #eef1e4; }
#sound-toggle:disabled { opacity: .55; cursor: default; }

/* The canvas fills this box; its drawing width follows the box shape, so any aspect ratio works. */
.screen { scroll-margin: var(--header-clearance) 0 12px; position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 72svh; background: #bfe6f3; overflow: hidden; }
.screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.loading, .overlay { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.loading { background: #e5edda; color: #5d7840; z-index: 4; }
.overlay { z-index: 3; padding: 12px; background: #f7fbe8cc; align-content: center; gap: 12px; }
.overlay h2 { font-size: clamp(22px, 5vw, 32px); }
.overlay p { color: #4f5f45; font-size: 15px; }
#start-overlay { background: linear-gradient(#f7fbe800 20%, #f7fbe8d9 70%); align-content: end; padding-bottom: 6%; }
#start-overlay .button { font-size: 22px; min-height: 56px; padding: 8px 30px; }
.place-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: min(100%, 720px); margin: 0; padding: 0; list-style: none; }
.place-links a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 84px; padding: 8px 4px; background: var(--paper); border: 2px solid var(--line); border-radius: 14px; box-shadow: 0 4px 0 var(--shadow); font: 17px Jua, sans-serif; line-height: 1.25; }
.place-links a:hover { background: var(--leaf); border-color: var(--green); }
.place-links a span { font-size: 28px; }

.progress { height: 6px; background: #e3ead3; }
.progress div { height: 100%; width: 0; background: #8db55a; }

.story { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 24px; align-items: center; padding: 16px 20px; }
.caption { min-height: 104px; }
.caption #kicker { color: var(--green); font-size: 14px; }
.caption h2 { font-size: clamp(21px, 4.4vw, 27px); margin: 2px 0 6px; }
.caption #text { color: #4f5f45; font-size: 16px; max-width: 680px; }
.player { display: grid; grid-template-columns: repeat(3, auto); gap: 8px; align-items: center; justify-content: center; }
.player button { min-width: 48px; min-height: 48px; padding: 6px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--green-dark); font-size: 15px; white-space: nowrap; }
.player button:hover:not(:disabled) { background: var(--leaf); }
.player button:disabled { opacity: .35; cursor: default; }
.player #play { grid-column: 1 / -1; background: var(--green); border-color: var(--green-dark); color: #fffef0; box-shadow: 0 4px 0 var(--green-dark); font: 19px Jua, sans-serif; min-height: 52px; }
.player #play:hover:not(:disabled) { background: var(--green-dark); }

.timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 12px 20px 14px; border-top: 2px solid #e5eadb; list-style: none; }
.timeline button { width: 100%; min-height: 48px; padding: 4px 2px; border: 2px solid #dfe6cf; border-radius: 12px; background: #f6f8ec; color: var(--muted); font-size: 14px; line-height: 1.3; }
.timeline button span { font: 12px sans-serif; margin-right: 5px; opacity: .8; }
.timeline button.current { background: var(--leaf); border-color: #9cb777; color: var(--green-dark); font-weight: bold; box-shadow: 0 3px 0 #b7c99c; }
.access-note { text-align: center; font-size: 13px; color: var(--muted); padding: 0 14px 12px; }

@media (max-width: 760px) {
  .prologue-title { margin-bottom: 6px; }
  .prologue-title p { display: none; }
  .screen { scroll-margin-bottom: calc(var(--nav-height) + 12px); }
  .story { grid-template-columns: minmax(0, 1fr); padding: 12px 14px; gap: 10px; }
  .caption { min-height: 150px; }
  .caption #text { font-size: 15px; }
  .player { grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); }
  .player #play { grid-column: auto; font-size: 17px; padding: 6px 4px; }
  .player button { padding: 6px 2px; font-size: 14px; }
  .timeline { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 10px 12px 12px; }
  .timeline button span { display: block; margin: 0; }
  .place-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: min(100%, 340px); }
  .place-links a { min-height: 68px; font-size: 16px; }
  .place-links a span { font-size: 22px; }
  .overlay { gap: 8px; }
  .overlay p { font-size: 14px; }
}
/* Portrait phones get a taller scene so Hodduck stays large; the view simply shows less of the path at once. */
@media (max-width: 760px) and (orientation: portrait) {
  .screen { aspect-ratio: 4 / 5; max-height: 58svh; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .screen { max-height: 74svh; }
  .caption { min-height: 0; }
}

