* {
  box-sizing: border-box;
}
html {
  color-scheme: light;
  background: #f7f0e4;
  color: #25423d;
  font:
    16px/1.47 "Trebuchet MS",
    Verdana,
    sans-serif;
}
body {
  margin: 0;
}
button,
input {
  font: inherit;
}
button {
  border: 1px solid #c4c5af;
  border-radius: 24px;
  padding: 9px 17px;
  background: #fffbf2;
  color: #294741;
  cursor: pointer;
  min-height: 44px;
  font-weight: 650;
  line-height: 1.24;
}
button:hover {
  border-color: #638779;
  background: #e8ecdf;
}
button:focus-visible,
input:focus-visible {
  outline: 3px solid #a55e30;
  outline-offset: 3px;
}
button:disabled {
  cursor: default;
  opacity: 0.58;
}
button.primary {
  background: #26534a;
  color: #fff8e4;
  border-color: #26534a;
  padding-inline: 24px;
}
button.primary:hover {
  background: #153e36;
}
button[aria-pressed="true"] {
  background: #d1e5d4;
  border-color: #56856f;
}
button span {
  margin-left: 6px;
}
[hidden] {
  display: none !important;
}
header {
  height: 61px;
  background: #213f39;
  color: #fff4d7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 max(3vw, calc((100vw - 1340px) / 2));
  gap: 10px;
}
.brand {
  font:
    600 26px/1.1 Georgia,
    serif;
  white-space: nowrap;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sun {
  font: 30px Georgia;
  color: #e5be7a;
  width: 37px;
  height: 37px;
  border: 1px solid #8e967b;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
nav {
  display: flex;
  gap: 6px;
}
nav button {
  border: 0;
  color: #fff4d7;
  background: transparent;
  font-size: 14px;
}
nav button:hover {
  background: #365b4f;
  border: 0;
}
main {
  max-width: 1440px;
  margin: auto;
}
.cover {
  display: grid;
  grid-template-columns: 1.18fr 1fr;
  margin: clamp(20px, 7vh, 85px) 5%;
  background: #fff8eb;
  border: 1px solid #d8ceba;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 16px 38px #54351d14;
}
.coverArt {
  background: #d7b18c url(media/cover.webp) 44% 50% / cover;
  min-height: min(65vh, 590px);
}
.coverCopy {
  align-self: center;
  padding: clamp(25px, 5vw, 80px);
}
h1,
h2 {
  font:
    normal 43px/1.03 Georgia,
    "Times New Roman",
    serif;
  letter-spacing: -1.2px;
  margin: 7px 0 11px;
}
.cover h1,
.end h1 {
  font-size: clamp(46px, 6vw, 80px);
}
p {
  margin: 0;
  max-width: 70ch;
}
.lead {
  font-size: 20px;
  color: #536158;
  margin: 16px 0 25px;
}
.note {
  font-size: 14px;
  color: #596b60;
  margin-top: 22px;
}
.eyebrow,
.rail {
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1.8px;
  color: #706348;
  text-transform: uppercase;
}
.rail {
  padding: 3px max(3vw, 20px);
  height: 41px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ede6d7;
  border-bottom: 1px solid #d7ceb9;
}
.rail button {
  background: transparent;
  border: 0;
  font-size: 14px;
  min-height: 36px;
  padding: 7px 9px;
  text-transform: none;
}
.rail span {
  margin: 0;
}
#stage {
  position: relative;
  width: 100%;
  height: clamp(300px, 55svh, 650px);
  overflow: hidden;
  background: #e2cbb2;
  isolation: isolate;
}
#back,
#paper,
#live,
#fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#back {
  max-width: none;
}
canvas,
#fx {
  width: 100%;
  height: 100%;
}
#loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #ece2cf;
  color: #475347;
  font:
    24px Georgia,
    serif;
}
.spread {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.83fr);
  align-items: center;
  gap: 4%;
  padding: 19px 4% 15px;
}
.tale h1 {
  font-size: clamp(31px, 3.2vw, 49px);
}
.tale > p {
  color: #4c594f;
  font-size: 16px;
}
.play {
  background: #fff9ef;
  border: 1px solid #d8cdb9;
  border-radius: 15px;
  padding: 12px 16px;
  min-width: 0;
}
.playhead {
  display: flex;
  align-items: center;
  gap: 10px;
}
.playhead .eyebrow {
  font-size: 9px;
  letter-spacing: 1.6px;
}
.playhead strong {
  display: block;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 600;
}
.playhead > span,
.bigstamp,
.miniIcon {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  flex: none;
  background: #ebdfc7;
  width: 40px;
  height: 40px;
}
.playhead svg,
.miniIcon svg {
  width: 82%;
  height: 82%;
}
#actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
#actions button {
  font-size: 14px;
  padding: 7px 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 43px;
  border-color: #abbaa7;
  background: #edf1e4;
}
#actions button svg {
  width: 26px;
  height: 26px;
}
.textbutton {
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 14px;
  padding: 7px 2px;
}
footer {
  margin: 0 4%;
  border-top: 1px solid #d5cbb9;
  padding: 9px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stepnav {
  display: flex;
  gap: 6px;
}
#calm {
  background: transparent;
  border: 0;
  font-size: 14px;
}
#calm[aria-pressed="true"] {
  background: #d5e6d4;
}
.end {
  text-align: center;
  padding: 10vh 5%;
}
.end p {
  margin: 12px auto 22px;
}
.bigstamp {
  width: 96px;
  height: 96px;
  margin-bottom: 20px;
}
.bigstamp svg {
  width: 77%;
}
dialog {
  padding: 24px 25px 26px;
  border: 1px solid #cbbfa8;
  border-radius: 19px;
  background: #fff8eb;
  color: #25423d;
  width: min(490px, calc(100vw - 24px));
  max-height: calc(100svh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 20px 70px #13372a40;
}
dialog::backdrop {
  background: #1d302c88;
}
.modalbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px;
}
.modalbar .eyebrow {
  font-size: 9px;
}
#close {
  font-size: 24px;
  min-width: 44px;
  padding: 0;
}
h2 {
  font-size: 34px;
  margin: 7px 0 15px;
}
dialog p {
  margin: 8px 0 13px;
}
.dialogactions,
.avatars {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.inputs label {
  display: block;
  font-size: 14px;
  margin-top: 8px;
}
.inputs input {
  width: 100%;
  min-width: 0;
  border: 1px solid #b9bda8;
  background: #fffef9;
  color: #28443b;
  border-radius: 7px;
  padding: 9px 11px;
  min-height: 43px;
}
.inputs p {
  font-size: 14px;
}
.error {
  background: #fae6d8;
  border-left: 3px solid #ac6652;
  padding: 9px;
  color: #723f31;
  overflow-wrap: anywhere;
}
.save {
  margin-top: 14px;
}
.readout {
  margin: 16px 0;
  background: #f2ecdd;
  border-radius: 10px;
  padding: 10px 13px;
}
.readout dt {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}
.readout dd {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0 0 6px;
  font-size: 17px;
}
.chapters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.chapters button {
  border-radius: 12px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  padding: 6px;
}
.miniIcon {
  height: 32px;
  width: 32px;
}
.neutral {
  background: #e7e7dc;
}
.featureIcon {
  display: block;
  width: 84px;
}
.fxIcon {
  position: absolute;
  width: clamp(45px, 6vw, 86px);
  left: 49%;
  top: 32%;
  filter: drop-shadow(0 4px 5px #4c3b3020);
  transform: translate(-50%, -50%);
}
.bubbleFx {
  animation: float 2.3s ease-in-out infinite alternate;
}
.skyFx {
  top: 15%;
}
.travelFx {
  position: absolute;
  bottom: 9%;
  left: 3%;
  width: clamp(85px, 14vw, 190px);
  animation: ride 3.2s ease-in-out both;
}
.travelLabel {
  position: absolute;
  left: 4%;
  bottom: 3%;
  color: #23433c;
  background: #fff5dc;
  padding: 3px 10px;
  border-radius: 16px;
  font-size: 13px;
}
.bubbleText {
  position: absolute;
  left: 4%;
  top: 8%;
  max-width: 32%;
  background: #fff5e5;
  border-radius: 12px 12px 12px 2px;
  padding: 7px 11px;
  font-size: 14px;
  font-weight: 600;
}
.calm * {
  animation-duration: 0s !important;
  transition-duration: 0s !important;
}
.calm .travelFx {
  left: 50%;
}
@keyframes float {
  to {
    translate: 4px -13px;
  }
}
@keyframes ride {
  from {
    left: 3%;
  }
  to {
    left: 75%;
  }
}
@media (max-width: 700px) {
  header {
    height: auto;
    min-height: 52px;
    flex-wrap: wrap;
    padding: 5px 12px;
    gap: 0;
  }
  .brand {
    font-size: 21px;
    gap: 6px;
  }
  .sun {
    width: 29px;
    height: 29px;
    font-size: 24px;
  }
  nav {
    gap: 0;
  }
  nav button {
    padding: 5px 7px;
    font-size: 12px;
  }
  .playing header {
    display: block;
  }
  .playing header .brand {
    float: left;
    min-height: 34px;
  }
  .playing nav {
    clear: both;
    justify-content: space-between;
    border-top: 1px solid #ffffff29;
  }
  .playing nav button {
    min-height: 36px;
  }
  .cover {
    display: flex;
    flex-direction: column;
    margin: 16px;
  }
  .coverArt {
    min-height: 0;
    height: 34svh;
    background-position: 50% 57%;
  }
  .coverCopy {
    padding: 24px;
  }
  .lead {
    font-size: 17px;
    margin: 12px 0 18px;
  }
  .rail {
    height: 38px;
    padding: 1px 14px;
    font-size: 10px;
  }
  #stage {
    height: clamp(248px, 36svh, 370px);
  }
  .spread {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 15px 16px 12px;
  }
  .tale h1 {
    font-size: 33px;
    margin: 4px 0 6px;
  }
  .tale > p {
    font-size: 15px;
    line-height: 1.4;
  }
  .eyebrow {
    font-size: 9px;
  }
  .play {
    padding: 9px 11px;
  }
  .playhead strong {
    font-size: 15px;
  }
  #actions button {
    min-height: 44px;
    font-size: 14px;
    padding: 6px 12px;
  }
  footer {
    margin: 0 16px;
    padding-bottom: 14px;
  }
  dialog {
    padding: 14px 17px 19px;
  }
  .fxIcon {
    width: 45px;
  }
  .bubbleText {
    top: 3%;
    max-width: 49%;
    font-size: 12px;
  }
  .stepnav .primary {
    padding: 8px 16px;
  }
}
@media (max-height: 560px) and (min-width: 701px) {
  #stage {
    height: 300px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bubbleFx,
  .travelFx {
    animation: none;
  }
  .travelFx {
    left: 54%;
  }
}

.bubbleText { left:auto; right:4%; border-radius:12px 12px 2px 12px; }
.pawDetail { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
/* Wide screens open like a real spread. Keep the whole vertical camera gate;
   do not crop tall adults merely to fill a panoramic strip. */
@media (min-width: 850px) {
  body.playing {
    background: linear-gradient(#efe6d5, #f8f2e8 53%);
  }
  #book {
    margin: clamp(20px, 5vh, 54px) 3.6%;
    display: grid;
    grid-template-columns: minmax(0, 2.18fr) minmax(260px, 1fr);
    grid-template-rows: 44px auto 66px;
    border: 1px solid #cfc3aa;
    border-radius: 16px;
    overflow: hidden;
    background: #fff9ee;
    box-shadow: 0 15px 32px #65523616;
  }
  .rail {
    grid-column: 1/-1;
    height: auto;
    padding: 0 22px;
  }
  .spread {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding: 21px 23px;
    gap: 24px;
    background: linear-gradient(90deg, #ede4d2 0, #fff9ee 13px);
  }
  #stage {
    height: 100%;
    min-height: clamp(410px, 59svh, 650px);
  }
  .tale h1 {
    font-size: clamp(29px, 3.4vw, 50px);
  }
  .tale > p {
    font-size: 16px;
  }
  .play {
    padding: 12px;
    background: #f7efdf;
  }
  .playhead {
    align-items: flex-start;
  }
  .rail .eyebrow {
    font-size: 11px;
  }
  footer {
    grid-column: 1/-1;
    margin: 0;
    padding: 8px 20px;
    border-top: 1px solid #d4c8b4;
    background: #fcf6eb;
  }
  .breadcrumbs {
    display: flex;
    gap: 5px;
  }
  .breadcrumbs button {
    border-radius: 50%;
    min-height: 30px;
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 11px;
    border-color: #c9c6b4;
    background: transparent;
  }
  .breadcrumbs button[aria-current="page"] {
    background: #315b50;
    color: white;
    border-color: #315b50;
  }
  .breadcrumbs button.visited {
    border-color: #719784;
  }
}
@media (max-width: 849px) {
  .breadcrumbs {
    display: none;
  }
}
@media (max-width: 700px) {
  #calm {
    padding: 7px 2px;
    white-space: nowrap;
    font-size: 13px;
  }
  .stepnav {
    flex: none;
  }
  .stepnav button {
    white-space: nowrap;
  }
  .stepnav #prev {
    padding-inline: 11px;
  }
}

#stage .hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#stage .hot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 43px;
  min-height: 43px;
  padding: 4px;
  border: 2px solid #fff1cb;
  border-radius: 50%;
  background: #365e54df;
  box-shadow: 0 2px 10px #2f44334a;
  pointer-events: auto;
}
#stage .hot svg {
  display: block;
  width: 30px;
  height: 30px;
  margin: auto;
}
#stage .hot:focus-visible {
  outline-color: #382e18;
}
#stage .hot:hover {
  background: #30584a;
}
#stage[data-ready="false"] .hotspots {
  display: none;
}
.routeMap {
  position: absolute;
  inset: 0;
  background: #d8d5bb url(travel/piha.webp) center center/100% 100% no-repeat;
}
.routeVehicle {
  position: absolute;
  left: 3%;
  bottom: 16%;
  width: 26%;
  height: auto;
  filter: drop-shadow(1px 4px 2px #44382d45);
  animation: journeyRide 3.7s ease-in-out both;
}
.routeVehicle.train {
  bottom: 9%;
}
.routeMap .travelLabel {
  left: 3%;
  bottom: 3%;
}
.calm .routeVehicle {
  animation: none;
  left: 65%;
}
@keyframes journeyRide {
  from {
    left: 2%;
  }
  to {
    left: 65%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .routeVehicle {
    animation: none;
    left: 65%;
  }
}
@media (min-width: 701px) and (max-width: 849px) {
  #stage {
    min-height: 50vw;
  }
}
@media (min-width: 850px) {
  #stage {
    aspect-ratio: 1.89;
    height: auto;
  }
}
@media (max-width: 700px) {
  #stage .hot {
    min-height: 44px;
    width: 44px;
  }
  .routeMap {
    background-size: auto 100%;
  }
  .routeVehicle {
    width: 31%;
  }
  .routeVehicle.train {
    bottom: 7%;
  }
}
