:root {
  --display: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --ui-ink: #402634;
  --ui-muted: #664a59;
  --page: #fff6ee;
  --surface: #fffaf5;
  --edge: #513446;
  --highlight: #f4b1cb;
  --shadow: #d88fae;
  --radius: 24px;
}

body {
  background: var(--page);
  color: var(--ui-ink);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}
#sky { display: none; }
.shell { width: min(1180px, calc(100% - 64px)); }
.top { height: 74px; border-color: color-mix(in srgb, var(--edge), transparent 70%); }
.brand { font-size: 18px; gap: 9px; }
.logo {
  width: 34px;
  height: 34px;
  color: var(--ui-ink);
  background: var(--highlight);
  border: 1.5px solid var(--edge);
  box-shadow: 2px 2px var(--edge);
}
#badges { gap: 10px; }
.badge, .outline {
  background: var(--surface);
  border: 1.5px solid var(--edge);
  color: var(--ui-ink);
}
.badge {
  border-radius: 45% 54% 49% 53%;
  filter: grayscale(.75);
  opacity: .63;
}
.badge.live, .badge.done {
  background: var(--highlight);
  box-shadow: 0 3px var(--edge);
  filter: none;
}
.outline:not(:disabled):hover, .badge:not(:disabled):hover {
  border-color: var(--edge);
  background: var(--highlight);
}
.primary {
  background: var(--highlight);
  border: 1.5px solid var(--edge);
  box-shadow: 3px 4px var(--edge);
  color: var(--ui-ink);
  padding-inline: 22px;
}
.primary:hover { background: var(--highlight); transform: translateY(-2px); }
.primary:active { transform: translateY(2px); box-shadow: 1px 2px var(--edge); }
button:focus-visible, input:focus-visible { outline-color: var(--edge); }
footer { border-color: color-mix(in srgb, var(--edge), transparent 70%); color: var(--ui-muted); }

.hero {
  min-height: 0;
  margin-top: 29px;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  align-items: stretch;
  border: 2px solid var(--edge);
  border-radius: 31px 27px 30px 25px;
  box-shadow: 6px 7px var(--shadow);
  background: var(--surface);
}
.hero::after { content: none; }
.hero-copy {
  max-width: none;
  padding: clamp(30px, 5.1vw, 72px);
  align-self: center;
}
.eyebrow {
  color: var(--ui-ink);
  letter-spacing: .1em;
  font-size: 13px;
}
.hero .eyebrow {
  display: inline-block;
  padding: 5px 14px;
  background: #fae7a6;
  border: 1px solid var(--edge);
  border-radius: 22px;
  transform: rotate(-3deg);
}
.hero h1 {
  font: 800 clamp(50px, 7.2vw, 102px)/.99 var(--display);
  letter-spacing: -.08em;
  margin: 25px 0 19px;
  white-space: nowrap;
}
.hero h1 span { color: #b63c65; }
.hero p, .scene-head p { color: var(--ui-muted); }
.hero .controls { margin-top: 24px; }
.hero input { background: var(--surface); border-color: var(--edge); color: var(--ui-ink); }
#introStatus:not(:empty) { margin-top: 10px; }
.cover-illustration {
  min-height: 450px;
  background: #f9e4ef;
  overflow: hidden;
  border-left: 2px solid var(--edge);
  position: relative;
}
.cover-illustration img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.ticket {
  grid-template-columns: 136px 1fr 1fr minmax(130px,.5fr);
  margin-top: 23px;
  background: #faeab5;
  border: 1.5px solid var(--edge);
  border-radius: 17px 20px 18px 15px;
  box-shadow: 3px 4px #dabc79;
  color: #49342c;
}
.ticket div { padding: 12px 20px; align-content: center; }
.ticket-title {
  font: 800 25px/.95 var(--display);
  background: #f4d473;
  border-right: 1px dashed var(--edge);
}
.ticket small { color: #624837; }
.ticket .stub {
  background: #f7dc8e;
  border-color: var(--edge);
  display: block;
  text-align: left;
}

[data-theme="campus"] {
  --page: #fcecf2; --surface: #fff5de; --ui-ink: #412831;
  --ui-muted: #694a53; --edge: #513540; --highlight: #f9adbf; --shadow: #eab0bd;
}
[data-theme="naples"] {
  --page: #e9d3b1; --surface: #f6e4c4; --ui-ink: #412b22;
  --ui-muted: #604535; --edge: #6b483b; --highlight: #eec08b; --shadow: #bb977c;
}
[data-theme="farm"] {
  --page: #e1edb4; --surface: #fff0ba; --ui-ink: #452c1b;
  --ui-muted: #5b4627; --edge: #593c27; --highlight: #fcd277; --shadow: #a0a95c;
  --radius: 4px;
}
[data-theme="travel"] {
  --page: #e3efeb; --surface: #f2f8e8; --ui-ink: #1d4247;
  --ui-muted: #35535a; --edge: #3c6163; --highlight: #a8d8ca; --shadow: #94bdb7;
}
[data-theme="crystal"], [data-theme="stars"], [data-theme="finale"] {
  --page: #1e1631; --surface: #312440; --ui-ink: #fff2f5;
  --ui-muted: #eed3e6; --edge: #e0b4e0; --highlight: #734575; --shadow: #563b68;
}
[data-theme="crystal"] { --page: #080d1d; --surface: #29223d; --highlight: #615179; }
#auroraHandoff {
  position:fixed;
  inset:0;
  width:100%;
  height:100dvh;
  max-width:none;
  max-height:none;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  overflow:hidden;
  background:#050714;
}
#auroraHandoff::backdrop { background:transparent; }
#auroraHandoff canvas { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.transition-cursor-glow { z-index:5; pointer-events:none; mix-blend-mode:screen; }
#auroraHandoff, #starHandoff { touch-action:none; }
#auroraHandoff .aurora-mesh,.globe .aurora-mesh { mix-blend-mode:screen; }
.globe > canvas { pointer-events:none; }
.globe > canvas:first-child { z-index:2; }
.globe > .crystal-sky { z-index:0; }
.globe > .aurora-mesh { z-index:1; }
.globe #flakes { position:absolute; inset:0; z-index:3; pointer-events:none; }
.globe #flakes button { pointer-events:auto; }
.globe { touch-action:none; }
.globe .ice-flake {
  width:clamp(43px,7cqw,64px);
  height:clamp(43px,7cqw,64px);
  color:#dff9ff;
  border:0;
  background:transparent;
  text-shadow:1px 2px 1px #2787a9,-1px -1px #fff,0 0 9px #87ddf8,0 0 17px #5aa7d7;
  font:clamp(33px,5.3cqw,54px)/1 "Segoe UI Symbol",serif;
  animation:ice-arrival .76s ease-out both;
}
.globe .ice-flake:is(:hover,:focus-visible) { color:white;filter:brightness(1.18); }
@keyframes ice-arrival {
  from { opacity:0;translate:-50% calc(-50% - 44px);rotate:-28deg; }
  to { opacity:1;translate:-50% -50%;rotate:0deg; }
}
.crystal-key-mount {
  position:absolute;
  z-index:4;
  left:calc(50% + min(24.3cqw,25.9cqh));
  top:calc(42% + min(28cqw,29.8cqh));
  translate:0 -50%;
  width:clamp(42px,10cqw,65px);
  height:44px;
}
.crystal-key {
  width:100%;
  height:100%;
  border:0;
  background:none;
  padding:0;
}
.crystal-key:disabled { opacity:.78; }
.crystal-key::before {
  content:"";position:absolute;left:0;top:calc(50% - 5px);width:61%;height:10px;
  border-radius:48% 20% 20% 48%;
  background:linear-gradient(180deg,#5c391e 0%,#e1b16c 26%,#936033 52%,#5b361e 78%,#bf8e56);
  box-shadow:0 2px 3px #0b0706a0;
}
.crystal-key span {
  position:absolute;left:45%;top:calc(50% - 14px);width:47%;height:28px;
}
.crystal-key span::before,.crystal-key span::after {
  content:"";position:absolute;right:0;width:63%;height:38%;
  border:3px solid #b77a42;border-top-color:#eac383;border-bottom-color:#654024;
  border-radius:55% 64% 58% 50%;
  box-shadow:inset 0 1px 1px #241609,0 1px 2px #231407;
}
.crystal-key span::before { top:0;transform:rotate(-24deg); }
.crystal-key span::after { bottom:0;transform:rotate(24deg); }
.crystal-key-hint {
  position:absolute;left:64%;bottom:calc(100% - 4px);translate:-50% 0;
  padding:4px 9px;border:1px solid #c5945d88;border-radius:7px;
  background:#261b16;color:#fff0d2;font-size:12px;line-height:1.25;
  white-space:nowrap;opacity:0;visibility:hidden;pointer-events:none;
  transition:opacity .18s ease;
}
.crystal-key-mount:hover .crystal-key-hint,.crystal-key-mount:focus-within .crystal-key-hint {
  opacity:1;visibility:visible;
}
[data-theme="crystal"] #sceneDialog .scene-head h1 {
  font-family:"Songti SC","STSong","SimSun","Noto Serif CJK SC",serif;
  font-weight:400;letter-spacing:.105em;
}
@media (prefers-reduced-motion:reduce) {
  .globe .ice-flake { animation:none; }
}
[data-theme="stars"] { --page: #191639; --highlight: #574983; }
[data-theme="stars"] #sky, [data-theme="finale"] #sky { display: block; }
.scene-head {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 29%);
  align-items: end;
  gap: 20px;
  padding-bottom: 13px;
}
.scene-head h1 {
  font-family: var(--display);
  margin: 7px 0 0;
  font-weight: 700;
  letter-spacing: .015em;
}
.scene-head p { margin: 0; font-size: .98rem; }
.stage {
  border: 2px solid var(--edge);
  border-radius: var(--radius);
  height: clamp(380px, 48vw, 552px);
  box-shadow: 4px 5px var(--shadow);
}
.lawn .person {
  width: clamp(66px, 13vw, 135px);
  height: clamp(76px, 14vw, 145px);
  filter: drop-shadow(0 4px 1px #402c3140);
}
.lawn .person[aria-pressed="true"] { filter: drop-shadow(0 0 6px #fff0b5); }
.testimony { border: 2px solid #513540; box-shadow: 2px 3px #513540; }
.status { color: var(--ui-muted); }
.scene .controls { margin-top: 17px; }
.cellar .hand { background: #ffebbc; color: #4f3024; border: 2px solid #6b483b; }
.farm-stage { box-shadow: inset 0 0 0 4px #b47a41, 4px 5px var(--shadow); }
.farm-stage > canvas { image-rendering: pixelated; }
.farm-rose-shower {
  position:fixed;
  inset:0;
  z-index:8;
  width:100%;
  height:100%;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  overflow:hidden;
  pointer-events:none;
}
.farm-rose-shower span {
  position:absolute;
  top:-24px;
  left:var(--x);
  width:var(--size);
  aspect-ratio:7/6;
  background:linear-gradient(135deg,#ffd5d6 0 26%,var(--petal) 26% 76%,#9f355b 76%);
  clip-path:polygon(0 0,43% 0,43% 16%,83% 16%,83% 33%,100% 33%,100% 67%,83% 67%,83% 83%,57% 83%,57% 100%,29% 100%,29% 83%,14% 83%,14% 67%,0 67%);
  animation:farm-petal-fall var(--fall) var(--delay) linear both;
}
@keyframes farm-petal-fall {
  0% { transform:translate3d(0,0,0) rotate(-22deg); }
  33% { transform:translate3d(calc(var(--drift) * .35),36dvh,0) rotate(55deg); }
  67% { transform:translate3d(var(--drift),73dvh,0) rotate(-40deg); }
  100% { transform:translate3d(calc(var(--drift) * .7),calc(100dvh + 50px),0) rotate(85deg); }
}
@media (prefers-reduced-motion:reduce){
  .farm-rose-shower span { top:var(--y); animation:none; }
}
.farm-heading {
  height:1.12em;
  width:auto;
  max-width:100%;
  object-fit:contain;
  object-position:left center;
  image-rendering:pixelated;
}
.farm-meter {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--surface);
  border: 3px solid var(--edge);
  box-shadow: inset 0 0 0 2px #d8a46d, 3px 3px #482f24;
  padding: 5px 10px;
  color: var(--ui-ink);
  font-weight: 800;
}
.plots {
  inset: 44% 24% 9%;
  padding: clamp(5px, 1.3vw, 14px);
  gap: clamp(5px, 1.25vw, 13px);
  border: 4px solid #6f4629;
  border-bottom-width: 6px;
  background: #527b34bd;
}
.plot {
  border-width: 3px;
  border-color: #d79c54;
  background: repeating-linear-gradient(#97592e 0 8px,#ad6a37 9px 15px);
  font-weight: 800;
}
.plot:hover { border-color: #fff0a8; }
.plot small { font-size: .75rem; }
.farm-tools .outline, [data-theme="farm"] .primary {
  border-radius: 4px;
  border-width: 2px;
  box-shadow: inset 0 0 0 2px #dba86c, 2px 3px var(--edge);
  font-weight: 800;
}
.farm-tools .tool[aria-pressed="true"] { background: #f4b15c; box-shadow: inset 0 0 0 2px #a7483c, 2px 3px var(--edge); }
.farm-stage .plot {
  position:relative;
  min-height:0;
  background:#8a502e url("assets/farm-soil.png") center / cover;
  border-color:#d59a58;
  image-rendering:pixelated;
}
.farm-plant {
  position:absolute;
  inset:2px;
  background-position:center;
  background-size:cover;
  pointer-events:none;
}
.plot[data-phase="1"] .farm-plant { background-image:url("assets/farm-planted.png"); }
.plot[data-phase="2"] .farm-plant {
  background-image:url("assets/farm-ripe.png");
  animation:farm-sprout .52s both;
}
.plot[data-phase="3"] .farm-plant { background-image:url("assets/farm-sprout.png"); }
@keyframes farm-sprout {
  0%, 55% { background-image:url("assets/farm-sprout.png"); }
  56%, 100% { background-image:url("assets/farm-ripe.png"); }
}
.plot.ready::after {
  content:"";
  position:absolute;
  inset:2px;
  --corner:#ffe385 0 2px,transparent 2px;
  background:
    linear-gradient(90deg,var(--corner)) top left / 9px 9px,
    linear-gradient(var(--corner)) top left / 9px 9px,
    linear-gradient(270deg,var(--corner)) top right / 9px 9px,
    linear-gradient(var(--corner)) top right / 9px 9px,
    linear-gradient(90deg,var(--corner)) bottom left / 9px 9px,
    linear-gradient(0deg,var(--corner)) bottom left / 9px 9px,
    linear-gradient(270deg,var(--corner)) bottom right / 9px 9px,
    linear-gradient(0deg,var(--corner)) bottom right / 9px 9px;
  background-repeat:no-repeat;
  pointer-events:none;
}
.farm-plot-hint {
  display:none;
  position:absolute;
  z-index:2;
  top:-5px;
  left:50%;
  translate:-50% -100%;
  padding:3px 6px;
  border:2px solid #604023;
  background:#fff1c5;
  color:#49301c;
  font-size:clamp(11px,1.3vw,15px);
  line-height:1.25;
  text-shadow:none;
  white-space:nowrap;
  pointer-events:none;
}
.plot.ready:is(:hover,:focus-visible) .farm-plot-hint { display:block; }
@media (hover:none) {
  .plot.ready[data-phase="1"] .farm-plot-hint { display:block; }
}
.farm-tools .tool.outline {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  min-height:44px;
  background:#edb679;
  color:#4b2915;
  padding:3px clamp(6px,1.25vw,14px);
  font-size:clamp(12px,2.8vw,16px);
}
.farm-tools .tool img {
  width:clamp(23px,5vw,40px);
  aspect-ratio:1;
  object-fit:contain;
  image-rendering:pixelated;
  mix-blend-mode:multiply;
}
.farm-tools .tool[aria-pressed="true"] {
  background:#ffd277;
  box-shadow:inset 0 0 0 2px #ffeb91,2px 3px var(--edge);
  border-color:#8e5125;
}
.farm-neighbor {
  position:absolute;
  z-index:3;
  left:26%;
  bottom:57%;
  width:clamp(38px,7vw,65px);
  min-height:44px;
  translate:-50% 0;
  display:grid;
  place-items:end center;
  padding:0;
  border:0;
  background:none;
}
.farm-neighbor canvas {
  width:100%;
  height:auto;
  image-rendering:pixelated;
  filter:drop-shadow(2px 2px #39401a80);
}
.farm-speech {
  position:absolute;
  bottom:calc(100% + 2px);
  left:50%;
  translate:-38% 0;
  width:max-content;
  max-width:min(37vw,16rem);
  padding:5px 8px;
  border:2px solid #684628;
  background:#fff2cc;
  color:#402817;
  box-shadow:2px 2px #68462880;
  font:bold clamp(11px,1.4vw,15px)/1.35 "Microsoft YaHei",sans-serif;
  pointer-events:none;
}
.farm-speech:empty { visibility:hidden; }
.farm-speech::after {
  content:"";
  position:absolute;
  top:100%;
  left:36%;
  border:5px solid transparent;
  border-top-color:#684628;
}
@media (max-height:560px) {
  .farm-speech {
    bottom:50%;
    left:100%;
    translate:0 50%;
  }
  .farm-speech::after { display:none; }
}
@media (prefers-reduced-motion:reduce){
  .plot[data-phase="2"] .farm-plant { animation:none; }
}
.reward {
  border: 1.5px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: 3px 4px var(--shadow);
  background: var(--surface);
}
.reward h2, .letter h2 { font-family: var(--display); font-weight: 800; }
.reward.campus { background: #f7c7d4; color: #4d293a; }
.reward.book { background: #d0a783; }
.reward.farm { background: #f3cd8f; border-width: 2px; }
.reward.travel { background: #d1e8df; }
.reward .slot, dialog .slot {
  background: repeating-linear-gradient(135deg,#eadedf 0 8px,#f6e9e8 8px 16px);
  color: #634957;
}
dialog { background: var(--surface); border: 2px solid var(--edge); color: var(--ui-ink); }
.album-nav button[aria-pressed="true"] { background: var(--highlight); color: var(--ui-ink); }
.letter { border: 1px solid #ad7880; }
.cake-button.holding { color: #30203b; }
.pin { background: #173e48; color: #fff6da; }

@media (max-width: 740px) {
  .shell { width: calc(100% - 30px); }
  .top { height: auto; }
  .hero { grid-template-columns: 1fr; margin-top: 16px; }
  .cover-illustration {
    grid-row: 1;
    min-height: 0;
    aspect-ratio: 1.5;
    border-left: 0;
    border-bottom: 2px solid var(--edge);
  }
  .hero-copy { padding: 23px 20px 27px; }
  .hero h1 { font-size: clamp(41px, 11vw, 66px); margin: 15px 0; }
  .hero .controls { margin-top: 18px; }
  .ticket { grid-template-columns: .85fr 1fr 1fr; }
  .ticket div { padding: 9px 10px; }
  .ticket .stub { grid-column: 1 / -1; border-left: 0; border-top: 1px dashed var(--edge); display: flex; gap: 12px; align-items: center; }
  .ticket-title { font-size: 22px; }
  .ticket strong { font-size: 14px; }
  .scene-head { grid-template-columns: 1fr; gap: 7px; }
  .scene-head h1 { font-size: clamp(31px, 8vw, 48px); }
  .stage { height: clamp(325px, 85vw, 450px); }
  .plots { inset-inline: 12%; }
}
@media (max-width: 370px) {
  #badges { gap: 5px; }
  .badge { width: 37px; }
  .farm-tools { gap: 5px; }
  .farm-tools .outline { padding-inline: 9px; }
}
/* Approved cover and first level */
[data-theme="cover"] { --page:#fcf3e9; --ui-ink:#80553e; --ui-muted:#80553e; }
[data-theme="cover"] .shell, .top { background: #fcf3e9 url(assets/crayon-paper.png) repeat; }
.top {
  min-height: 62px;
  height: auto;
  padding: 7px clamp(6px, 2vw, 22px);
  gap: clamp(4px, 1.5vw, 16px);
  color: #754931;
  border-color: #e9cbbd;
}
.top .brand { white-space: nowrap; }
.top .logo { background: none; border: 0; box-shadow: none; color: #bd7932; }
.top #badges { justify-content: center; margin-inline: auto; gap: clamp(3px, .85vw, 10px); }
.top .badge {
  width: clamp(32px, 5.2vw, 54px);
  height: clamp(32px, 5.2vw, 54px);
  min-height: 0;
  background-position: center;
  background-size: cover;
  border: 0;
  border-radius: 50%;
  box-shadow: none;
}
.top .badge:disabled { opacity: .66; }
.top .badge.live, .top .badge.done { opacity: 1; box-shadow: inset 0 0 0 2px #cf9e70; }
.top .outline { background-color: #fff4e6; color: #754931; border: 1px solid #e5c3ad; white-space: nowrap; }
#hint { background: #fcf3e9 url(assets/crayon-bulb.png) center/contain no-repeat; width: 44px; padding: 0; color: transparent; }
[data-theme="cover"] footer { display:none; }
[data-theme="cover"] .hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  margin: 0;
  padding: clamp(14px, 4vh, 55px) 8px 16px;
  gap: clamp(8px, 2vh, 24px);
  border-radius: 0;
}
.hero-copy { text-align:center; padding:0; }
.hero h1 { margin:0 auto 8px; }
.hero h1 img { width:min(550px, 80vw); max-height: 12svh; object-fit:contain; }
[data-theme="cover"] .cover-illustration { width: min(100%, 790px); min-height: 0; height: min(49svh, 545px); aspect-ratio:auto; background:none; border:0; }
.cover-illustration img { object-fit:contain; }
[data-theme="cover"] #launch { margin:0; justify-content:center; }
[data-theme="cover"] .primary { background:#ffe198; border-color:#f0cf85; box-shadow:0 4px 12px #9a683b36; color:#775035; }
#sceneDialog {
  width:min(1150px, calc(100% - 20px));
  max-width:none;
  max-height:calc(100dvh - 16px);
  margin:auto;
  padding:0 0 6px;
  border:0;
  border-radius:22px;
  background:var(--page);
}
#sceneDialog .shell { width:calc(100% - 22px); }
#sceneDialog footer { display:none; }
#sceneDialog .scene { padding-top:10px; }
#sceneDialog .scene-head { margin-bottom:10px; padding:8px 12px; }
#sceneDialog .scene-head h1 { font-size:clamp(23px, 5.5vw, 51px); }
#sceneDialog .scene-head p { font-size:clamp(13px, 1.8vw, 17px); }
[data-theme="campus"] .scene-head { grid-template-columns:1fr; gap:4px; border:2px solid var(--edge); border-radius:15px; }
#sceneDialog .stage { height:min(54dvh, calc(100dvh - 260px), 520px); min-height:160px; box-shadow:none; }
#sceneDialog .scene .controls { margin-top:8px; }
#sceneDialog .status { margin-top:4px; font-size:.86rem; min-height:0; }
#sceneDialog .status:empty { display:none; }
#reward { text-align:center; margin-top:5px; }
#reward:empty { display:none; }
.lawn .person { width:clamp(42px, 13%, 122px); height:clamp(48px, 32%, 153px); transition:translate .22s ease; }
.lawn .person[aria-pressed="true"] { z-index:2; }
.lawn .person b { bottom:-1%; width:24px; height:24px; line-height:1; }
.speech { position:absolute; bottom:91%; left:50%; transform:translateX(-50%); z-index:1; max-width:70vw; width:max-content; padding:4px 8px; border:2px solid #513540; border-radius:12px; background:#fff7df; color:#412831; font-size:clamp(11px, 2vw, 17px); font-weight:700; pointer-events:none; }
.speech:not([hidden])::after { content:""; position:absolute; bottom:-6px; left:calc(50% - 4px); width:8px; height:8px; transform:rotate(45deg); border:solid #513540; border-width:0 2px 2px 0; background:#fff7df; }
.lawn .person:first-of-type .speech { left:70%; }
.lawn .person:nth-of-type(4) .speech { left:25%; }
.lawn .speech {
  max-width:min(25vw, 190px);
  white-space:normal;
  line-height:1.25;
  text-align:center;
  overflow-wrap:anywhere;
}
@media(max-width:690px) {
  .lawn .speech {
    max-width:27vw;
    padding:2px 4px;
    font-size:clamp(10px, 2.6vw, 13px);
    border-width:1px;
  }
}
#contentDialog[open] { display:flex; flex-direction:column; max-height:calc(100dvh - 20px); padding:8px 12px 12px; }
.dialog-close { align-self:flex-end; flex:none; width:44px; height:44px; border-radius:50%; border:1px solid var(--edge); background:var(--surface); font-size:24px; }
#dialogContent { overflow:auto; min-height:0; overscroll-behavior:contain; }
#dialogContent > .reward, #dialogContent > #reward, #dialogContent .letter { margin:0; box-shadow:none; }
#dialogActions { flex:none; }
#dialogActions .controls { margin:8px 0 0; }
.hint-note { padding:4px 10px 14px; }
.hint-note h2 { margin-bottom:6px; }

@media(max-width:690px) {
  .top #badges { width:100%; order:3; justify-content:space-between; }
  .top #hint { margin-left:auto; order:1; }
  .top #sound { order:2; }
  #sceneDialog { width:calc(100% - 10px); max-height:calc(100dvh - 8px); }
  #sceneDialog .shell { width:calc(100% - 14px); }
  #sceneDialog .stage { height:min(43dvh, calc(100dvh - 290px), 370px); }
  #sceneDialog .scene-head { padding:5px 8px; }
  #sceneDialog .scene-head h1 { margin-top:3px; }
  #sceneDialog .scene .controls button { min-height:42px; padding-block:5px; }
}
@media(max-height:570px) {
  #sceneDialog .stage { height:42dvh; min-height:140px; }
  #sceneDialog .scene-head .eyebrow { font-size:11px; }
}

/* Keep the entire picnic illustration at its original proportions. */
[data-theme="campus"] #sceneDialog {
  --picnic-height: clamp(140px, calc(100dvh - 330px), 580px);
  width: min(100% - 12px, calc(var(--picnic-height) * 1.5 + 22px));
}
[data-theme="campus"] #sceneDialog .lawn {
  height:auto;
  min-height:0;
  aspect-ratio:3 / 2;
}
[data-theme="campus"] #sceneDialog .scene-head h1 {
  font-size:clamp(23px, 4.6vw, 40px);
  margin-top:4px;
}
[data-theme="campus"] #sceneDialog .scene-head p {
  line-height:1.45;
}
[data-theme="campus"] #sceneDialog .top {
  gap:6px;
  padding-inline:6px;
  min-height:52px;
}
[data-theme="campus"] #sceneDialog .badge { width:38px; height:38px; }
[data-theme="campus"] #sceneDialog #badges { gap:5px; }
[data-theme="campus"] #sceneDialog #sound { padding-inline:9px; }
[data-theme="campus"] #sceneDialog .top .brand { font-size:15px; gap:4px; }
[data-theme="campus"] #sceneDialog .top #hint { flex-shrink:0; }
@media(max-width:690px) {
  [data-theme="campus"] #sceneDialog {
    --picnic-height: clamp(155px, calc(100dvh - 290px), 580px);
  }
}
/* The viewport is the stage. Keep controls outside the artwork's layout box. */
html, body { min-height:100%; }
body { margin:0; }
body:has(#sceneDialog[open]) { overflow:hidden; }

body[data-theme] > .shell, #sceneDialog .shell {
  width:100%;
  min-height:100dvh;
  display:flex;
  flex-direction:column;
  padding-top:env(safe-area-inset-top, 0px);
  padding-right:env(safe-area-inset-right, 0px);
  padding-bottom:env(safe-area-inset-bottom, 0px);
  padding-left:env(safe-area-inset-left, 0px);
}
#sceneDialog, [data-theme="campus"] #sceneDialog {
  position:fixed;
  inset:0;
  width:100%;
  height:100dvh;
  max-width:none;
  max-height:none;
  margin:0;
  padding:0;
  border-radius:0;
  overflow:auto;
  overscroll-behavior:contain;
}
#app {
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
}
.top, [data-theme="campus"] #sceneDialog .top {
  flex:none;
  padding-inline:clamp(10px, 3vw, 44px);
}
#sceneDialog .scene {
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:clamp(5px, 1.1dvh, 12px);
  padding:clamp(6px, 1.2dvh, 14px) clamp(8px, 2.3vw, 32px);
}
#sceneDialog .scene-head {
  flex:none;
  margin:0;
  display:grid;
  grid-template-columns:minmax(0, .85fr) minmax(0, 1fr);
  gap:6px 24px;
  align-items:center;
}
#sceneDialog .scene-head h1 { font-size:clamp(22px, 3.1vw, 40px); line-height:1.18; }
#sceneDialog .scene-head p { font-size:clamp(13px, 1.55vw, 17px); line-height:1.45; }
#mechanism { display:flex; flex:1; flex-direction:column; min-width:0; }
.stage-frame {
  flex:1 1 0;
  min-height:135px;
  display:grid;
  position:relative;
  isolation:isolate;
  place-items:stretch;
  border-radius:var(--radius);
  overflow:hidden;
  container-type:size;
}
#sceneDialog .stage {
  width:100%;
  height:100%;
  min-height:0;
}
[data-theme="campus"] #sceneDialog .stage-frame {
  place-items:center;
  background:#a0bd80;
}
[data-theme="campus"] #sceneDialog .lawn {
  width:min(100%, 150cqh);
  height:auto;
  aspect-ratio:3 / 2;
  max-height:100%;
  min-height:0;
  background:#9cb87b;
}
#sceneDialog .scene .controls { margin:clamp(5px, 1dvh, 10px) 0 0; flex:none; }
#sceneDialog .status, #reward { flex:none; margin:0; }
#sceneDialog .status:not(:empty) { padding-inline:4px; text-align:center; }
#mechanism > button { align-self:center; margin-top:7px; }
.album-nav { margin:auto; justify-content:center; }
.passport { color:#fff8e8; }
[data-theme="cover"] .hero {
  flex:1;
  min-width:0;
  padding:clamp(10px, 3vw, 38px);
  display:grid;
  grid-template:1fr 1fr / minmax(0, 4fr) minmax(0, 6fr);
  align-items:stretch;
  gap:clamp(9px, 2.2vw, 28px);
}
[data-theme="cover"] .hero-copy { align-self:end; }
[data-theme="cover"] .hero h1 img { width:min(100%, 560px); max-height:none; margin-inline:auto; }
[data-theme="cover"] .cover-illustration {
  grid-area:1 / 2 / 3 / 3;
  width:100%;
  height:auto;
  min-height:150px;
}
[data-theme="cover"] .cover-illustration img { object-fit:contain; }
[data-theme="cover"] #launch { align-self:start; }
@media (orientation:portrait) {
  [data-theme="cover"] .hero { grid-template:auto minmax(150px, 1fr) auto / minmax(0, 1fr); align-items:stretch; }
  [data-theme="cover"] .hero-copy { grid-area:1 / 1; }
  [data-theme="cover"] .cover-illustration { grid-area:2 / 1; }
  [data-theme="cover"] #launch { grid-area:3 / 1; }
}
@media(max-width:690px) {
  #sceneDialog .scene-head { grid-template-columns:minmax(0, 1fr); padding:6px 8px; }
  .top, [data-theme="campus"] #sceneDialog .top { gap:3px 8px; }
  #sceneDialog .top .badge, .top .badge { width:clamp(35px, 10vw, 44px); height:clamp(35px, 10vw, 44px); }
  #sceneDialog .scene .controls { gap:6px; }
  #sceneDialog .scene .controls button { padding-inline:10px; }
}
@media(max-height:480px) and (orientation:landscape) {
  .top, [data-theme="campus"] #sceneDialog .top { flex-wrap:nowrap; min-height:43px; padding-block:3px; gap:4px; }
  .top #badges { order:0; width:auto; justify-content:center; }
  #sceneDialog .top .badge, .top .badge { width:30px; height:30px; }
  .top .outline { min-height:34px; }
  .stage-frame { min-height:110px; }
  #sceneDialog .scene-head { grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); }
  #sceneDialog .scene-head h1 { font-size:clamp(18px, 3vw, 28px); }
  #sceneDialog .scene-head p { font-size:12px; }
  #sceneDialog .scene .controls button { min-height:36px; padding-block:3px; }
}

@media (min-width:900px) and (orientation:landscape) {
  [data-theme="cover"] .hero {
    grid-template:1fr 1fr / minmax(280px, 39%) minmax(0, 1fr);
    position:relative;
    background:#fcf3e9 url(assets/pony-cover-wide.png) center / cover no-repeat;
    gap:14px 0;
  }
  [data-theme="cover"] .cover-illustration img { opacity:0; }
  [data-theme="cover"] .hero-copy,
  [data-theme="cover"] #launch { z-index:1; padding-inline:clamp(12px, 2vw, 34px); }
  [data-theme="cover"] .hero-copy p { font-size:clamp(14px, 1.3vw, 20px); }

  body:not([data-theme="album"]) #sceneDialog .scene {
    display:grid;
    grid-template-columns:clamp(210px, 23vw, 360px) minmax(0, 1fr);
    grid-template-rows:1fr auto auto auto auto 1fr;
    gap:12px clamp(18px, 2.4vw, 42px);
    padding:clamp(14px, 2.7vh, 34px) clamp(16px, 3vw, 52px);
  }
  body:not([data-theme="album"]) #mechanism { display:contents; }
  body:not([data-theme="album"]) #mechanism > div:empty { display:none; }
  #sceneDialog .stage-frame { grid-column:2; grid-row:1 / -1; min-height:0; }
  #sceneDialog .scene-head {
    grid-column:1;
    grid-row:2;
    grid-template-columns:minmax(0, 1fr);
    gap:12px;
    align-self:start;
    padding:12px 0 6px;
    border:0;
    border-radius:0;
  }
  #sceneDialog .scene-head h1 { font-size:clamp(26px, 3.05vw, 48px); }
  #sceneDialog .scene-head p { line-height:1.65; }
  #sceneDialog .scene-head:focus { outline:none; }
  #sceneDialog #mechanism > :is(.controls,button) { grid-column:1; grid-row:3; align-self:start; justify-self:start; margin:0; justify-content:flex-start; }
  #sceneDialog .status { grid-column:1; grid-row:4; text-align:left; }
  #sceneDialog #reward { grid-column:1; grid-row:5; text-align:left; }
  [data-theme="campus"] #sceneDialog .stage-frame { background:transparent; }
  [data-theme="campus"] #sceneDialog .lawn {
    width:min(100%, 177.7778cqh);
    aspect-ratio:16 / 9;
  }
}
/* The takeoff stays above both the cover and the newly opened level. */
#travelTransition {
  inset:0;
  position:fixed;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  width:100%;
  height:100dvh;
  max-width:none;
  max-height:none;
  overflow:hidden;
  background:#95bc67 url("assets/farm.png") center / cover no-repeat;
}
#travelTransition::backdrop { background:transparent; }
.travel-takeoff {
  position:absolute;
  top:63%;
  left:22%;
  width:clamp(76px,16vmin,180px);
  z-index:1;
  animation:travel-takeoff 1.29s cubic-bezier(.2,.38,.43,.95) both;
}
.travel-takeoff img { width:100%; image-rendering:pixelated; }
.travel-petal-trail { position:absolute; inset:0; }
.travel-petal-trail i {
  position:absolute;
  left:-10%;
  top:75%;
  width:11%;
  aspect-ratio:1.7;
  background:#f497ac;
  clip-path:polygon(0 42%,23% 10%,72% 0,100% 34%,84% 74%,44% 100%,12% 83%);
  animation:travel-petal-slip .88s .14s ease-out both;
  --trail-x:-28%;
  --trail-y:150%;
}
.travel-petal-trail i:nth-child(2) { top:94%; left:-21%; --trail-x:-150%; --trail-y:230%; background:#e5829f; }
.travel-petal-trail i:nth-child(3) { left:-37%; --trail-x:-190%; --trail-y:330%; background:#efacc1; }
.travel-petal-trail i:nth-child(4) { top:105%; left:-50%; --trail-x:-270%; --trail-y:400%; width:7%; }
.travel-petal-trail i:nth-child(5) { top:121%; left:-61%; --trail-x:-400%; --trail-y:500%; width:5%; }
.travel-cloud-wipe {
  position:absolute;
  z-index:2;
  inset:0;
  pointer-events:none;
}
.travel-cloud-wipe::before {
  content:"";
  position:absolute;
  inset:0;
  background:#fffcf7;
  animation:travel-mist-in 1.29s ease-in both;
}
.travel-cloud-wipe i {
  position:absolute;
  left:var(--left);
  top:var(--top);
  width:var(--width);
  aspect-ratio:705 / 336;
  background:url("assets/travel-clay-cloud.png") center / contain no-repeat;
  --left:-17%; --top:-18%; --width:77%; --enter-x:-26vw; --enter-y:-20dvh;
  --exit-x:-61vw; --exit-y:-33dvh; --cloud-start:.48s; --lift:-9deg; --spin:-14deg;
  animation:travel-cloud-in .76s var(--cloud-start) cubic-bezier(.23,.62,.54,1) both;
}
.travel-cloud-wipe i:nth-child(2) {
  --left:44%; --top:-8%; --width:77%; --enter-x:33vw; --enter-y:-22dvh;
  --exit-x:65vw; --exit-y:-37dvh; --cloud-start:.51s; --lift:8deg; --spin:15deg;
}
.travel-cloud-wipe i:nth-child(3) {
  --left:-19%; --top:43%; --width:85%; --enter-x:-24vw; --enter-y:26dvh;
  --exit-x:-73vw; --exit-y:25dvh; --cloud-start:.47s; --lift:6deg; --spin:-12deg;
}
.travel-cloud-wipe i:nth-child(4) {
  --left:39%; --top:40%; --width:88%; --enter-x:34vw; --enter-y:24dvh;
  --exit-x:74vw; --exit-y:34dvh; --cloud-start:.52s; --lift:-5deg; --spin:17deg;
}
.travel-cloud-wipe i:nth-child(5) {
  --left:12%; --top:12%; --width:76%; --enter-x:11vw; --enter-y:37dvh;
  --exit-x:18vw; --exit-y:-67dvh; --cloud-start:.57s; --lift:-3deg; --spin:11deg;
}
#travelTransition.travel-arriving { background:transparent; }
.travel-arriving .travel-takeoff { visibility:hidden; }
.travel-arriving .travel-cloud-wipe::before { animation:travel-mist-out .4s ease-out both; }
.travel-arriving .travel-cloud-wipe i { animation:travel-cloud-out 1s cubic-bezier(.26,.28,.5,1) both; }
@keyframes travel-takeoff {
  0% { transform:translate(-7vw,9dvh) rotate(2deg) scale(.92); }
  32% { transform:translate(8vw,3dvh) rotate(-12deg) scale(1); }
  67% { transform:translate(26vw,-16dvh) rotate(-21deg) scale(1.10); }
  100% { transform:translate(47vw,-42dvh) rotate(-6deg) scale(1.02); }
}
@keyframes travel-petal-slip {
  from { transform:translate(10%,0) rotate(0deg); opacity:0; }
  30% { opacity:1; }
  to { transform:translate(var(--trail-x),var(--trail-y)) rotate(100deg); opacity:0; }
}
@keyframes travel-cloud-in {
  from { transform:translate(var(--enter-x),var(--enter-y)) rotate(var(--lift)) scale(.68); opacity:0; }
  26% { opacity:1; }
  to { transform:translate(0,0) rotate(0) scale(1.19); opacity:1; }
}
@keyframes travel-cloud-out {
  from { transform:translate(0,0) scale(1.19); opacity:1; }
  49% { opacity:1; }
  to { transform:translate(var(--exit-x),var(--exit-y)) rotate(var(--spin)) scale(1.39); opacity:0; }
}
@keyframes travel-mist-in { 0%,72% {opacity:0} 100% {opacity:1} }
@keyframes travel-mist-out { from {opacity:1} to {opacity:0} }
@media (orientation:portrait) {
  .travel-takeoff { left:32%; top:69%; }
  .travel-cloud-wipe i { width:calc(var(--width) * 1.44); }
  @keyframes travel-takeoff {
    0% { transform:translate(-9vw,8dvh) rotate(-8deg) scale(.9); }
    38% { transform:translate(1vw,-2dvh) rotate(-25deg) scale(1.02); }
    70% { transform:translate(19vw,-22dvh) rotate(-29deg) scale(1.11); }
    100% { transform:translate(33vw,-46dvh) rotate(-12deg) scale(1.04); }
  }
}
@media (prefers-reduced-motion:reduce) {
  .travel-takeoff { animation:none; }
  .travel-cloud-wipe i { display:none; }
  .travel-cloud-wipe::before { animation:none; opacity:.6; }
  .travel-arriving .travel-cloud-wipe::before { animation:none; opacity:0; }
}

.travel-map.has-globe {
  border:0;
  background:radial-gradient(ellipse at 62% 34%,#e2f5ef,#b3deeb 65%,#9dcce0);
}
.travel-map.has-globe > .plane { display:none; }
.travel-map.has-globe > .travel-sphere {
  display:block;
  position:absolute;
  z-index:0;
  inset:0;
  pointer-events:none;
}
.travel-map.has-globe .passport {
  z-index:4;
  top:8px;
  right:10px;
  border-color:#ead7bb;
  background:#fff7e4;
  color:#694a31;
  font-weight:700;
}
.travel-map .pin {
  z-index:3;
  min-width:24px;
  min-height:24px;
  padding:0;
  border:0;
  background:transparent;
  box-shadow:none;
}
.travel-map:not(.has-globe) .pin::before {
  content:""; position:absolute; inset:35%;
  border-radius:50%; background:#ffdab1;
}
.travel-map .pin::after {
  content:attr(data-place);
  position:absolute;
  bottom:100%;
  left:50%;
  translate:-50% -4px;
  padding:3px 8px;
  border:1px solid #f0d9af;
  border-radius:999px;
  background:#fff7e7;
  color:#294856;
  font-size:13px;
  font-weight:700;
  white-space:nowrap;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}
@media (hover:hover) {
  .travel-map .pin:hover { z-index:4; }
  .travel-map .pin:hover::after { opacity:1; visibility:visible; }
}
.travel-map .pin:focus-visible::after { opacity:1; visibility:visible; }
.travel-map .pin:focus-visible { outline:2px solid #614b29; }
.travel-map:not(.has-globe) .pin.next-stop::before { box-shadow:0 0 0 3px #ffe798; }
.travel-destination {
  position:absolute;
  z-index:5;
  top:8px;
  left:10px;
  padding:6px 13px;
  border:1px solid #efd7a9;
  border-radius:12px;
  background:#fff7e4;
  color:#604027;
  font-weight:750;
  pointer-events:none;
}
.travel-map > .plane { font-size:23px; }
.travel-envelope {
  --envelope-ink:#66472f;
  position:relative;
  isolation:isolate;
  width:min(100%,440px);
  margin:0 auto;
  padding:4px 13px 40px;
  color:var(--envelope-ink);
}
.travel-envelope::before {
  content:"";
  z-index:-1;
  position:absolute;
  inset:19% 2px 3px;
  border:1px solid #bd9260;
  border-radius:7px 7px 12px 12px;
  background:linear-gradient(156deg,#d7aa77,#ba8856);
}
.travel-envelope-paper {
  position:relative;
  padding:clamp(9px,2vw,16px);
  border:1px solid #dec8a5;
  border-radius:7px 7px 3px 3px;
  background:radial-gradient(ellipse at 15% 3%,#fffdf2,#faecd1);
  box-shadow:0 3px 9px #77502e39;
  animation:travel-post-rise .54s .88s cubic-bezier(.22,.62,.36,1) both;
}
.travel-post-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding-bottom:9px;
}
.travel-post-header h2 {
  flex:1;
  font-family:"Songti SC","SimSun",serif;
  font-size:clamp(20px,4vw,30px);
  line-height:1.2;
}
.travel-post-stamp {
  flex:none;
  width:clamp(68px,16vw,84px);
  aspect-ratio:1;
  display:grid;
  align-content:center;
  justify-items:center;
  gap:1px;
  padding:5px;
  border:3px double #a95749;
  border-radius:50%;
  color:#884439;
  background:#b8674c13;
  transform:rotate(9deg);
  box-shadow:inset 0 0 0 2px #b4614933;
  font-size:clamp(9px,2.6vw,11px);
  line-height:1.15;
  white-space:nowrap;
}
.travel-post-stamp strong { font-size:clamp(13px,3.2vw,17px); }
.travel-post-stamp::after {
  content:"";
  position:absolute;
  top:45%;
  left:-15px;
  width:15px;
  height:13px;
  background:repeating-linear-gradient(0deg,transparent 0 3px,#a95749 3px 4px);
  opacity:.6;
}
.travel-envelope .card {
  padding:5px;
  border:1px solid #dac29f;
  border-radius:3px;
  background:#fffaf0;
  box-shadow:none;
}
.travel-envelope .card strong { display:none; }
.travel-envelope .card .slot { aspect-ratio:auto; height:clamp(105px,26dvh,215px); }
.travel-envelope .card .slot img { object-fit:contain; }
.travel-post-note { margin-top:9px; font-size:.92rem; }
.travel-envelope .video { max-height:24dvh; }
.travel-envelope-pocket {
  position:absolute;
  inset:auto 2px 3px;
  height:47px;
  border-radius:0 0 10px 10px;
  clip-path:polygon(0 15%,5% 8%,9% 18%,15% 4%,20% 15%,26% 6%,31% 17%,37% 4%,42% 16%,48% 7%,54% 19%,59% 7%,65% 16%,71% 4%,77% 16%,83% 7%,89% 17%,94% 5%,100% 15%,100% 100%,0 100%);
  background:
    linear-gradient(140deg,transparent 48%,#98714955 49% 51%,transparent 52%) left/50% 100% no-repeat,
    linear-gradient(220deg,transparent 48%,#98714955 49% 51%,transparent 52%) right/50% 100% no-repeat,
    linear-gradient(#f4d4a4,#dfb582);
  box-shadow:inset 0 -2px #ab8052;
  pointer-events:none;
}
.travel-envelope-opening {
  position:absolute;
  z-index:2;
  inset:4px 2px 3px;
  pointer-events:none;
}
.travel-envelope-cover,.travel-envelope-flap,.travel-envelope-tear {
  position:absolute;
  inset-inline:0;
}
.travel-envelope-cover {
  top:28%;
  bottom:0;
  border:1px solid #bd9260;
  border-top:0;
  border-radius:0 0 10px 10px;
  background:
    linear-gradient(142deg,transparent 49%,#a2714855 50% 51%,transparent 52%) left bottom/51% 82% no-repeat,
    linear-gradient(218deg,transparent 49%,#a2714855 50% 51%,transparent 52%) right bottom/51% 82% no-repeat,
    linear-gradient(150deg,#efd19e,#deb480);
  transform-origin:bottom;
  animation:travel-cover-fold .46s .89s cubic-bezier(.38,.16,.45,1) both;
}
.travel-envelope-flap {
  top:0;
  height:31%;
  border:1px solid #c39b69;
  border-radius:9px 9px 0 0;
  clip-path:polygon(0 0,100% 0,100% 94%,95% 88%,89% 96%,83% 86%,77% 95%,71% 88%,65% 97%,59% 89%,53% 100%,47% 89%,41% 96%,35% 87%,29% 97%,23% 88%,17% 94%,11% 87%,5% 96%,0 90%);
  background:
    linear-gradient(179deg,#fff5df72,transparent 21%),
    linear-gradient(158deg,#f9d9a6,#e2b887);
  transform-origin:18% 70%;
  animation:travel-flap-lift .47s .87s cubic-bezier(.24,.57,.47,1) both;
}
.travel-envelope-tear {
  top:27.3%;
  height:11px;
  background:linear-gradient(180deg,#ae754d 8%,#fff0c9 28% 67%,#b78158 83%);
  mask-image:linear-gradient(30deg,transparent 42%,#000 45% 71%,transparent 74%),linear-gradient(-30deg,transparent 42%,#000 45% 71%,transparent 74%);
  mask-size:14px 100%;
  mask-repeat:repeat-x;
  animation:travel-tear-cross 1.2s .08s linear both;
}
@keyframes travel-tear-cross {
  0% { clip-path:inset(0 100% 0 0); opacity:1; }
  22% { clip-path:inset(0 82% 0 0); }
  45% { clip-path:inset(0 54% 0 0); }
  70%,78% { clip-path:inset(0); opacity:1; transform:translateY(0); }
  100% { clip-path:inset(0); opacity:0; transform:translateY(15px) rotate(2deg); }
}
@keyframes travel-flap-lift {
  from { transform:translate(0,0) rotate(0); opacity:1; }
  42% { transform:translate(-3px,-13px) rotate(-5deg); opacity:1; }
  to { transform:translate(-14px,-49px) rotate(-12deg); opacity:0; visibility:hidden; }
}
@keyframes travel-cover-fold {
  from { transform:scaleY(1); opacity:1; }
  77% { transform:scaleY(.24); opacity:.95; }
  to { transform:scaleY(.18); opacity:0; visibility:hidden; }
}
@keyframes travel-post-rise {
  from { transform:translateY(25px); opacity:0; }
  to { transform:translateY(0); opacity:1; }
}
@media (prefers-reduced-motion:reduce) {
  .travel-envelope-paper { animation:none; }
  .travel-envelope-opening { display:none; }
}
[data-theme="travel"] #sceneDialog .status {
  display:block;
  min-height:1.65em;
  line-height:1.65;
}
[data-theme="travel"] #sceneDialog .scene-head:focus { outline:none; }
@media (min-width:900px) and (orientation:landscape) {
  [data-theme="travel"] #sceneDialog .stage-frame { grid-column:1 / -1; }
  [data-theme="travel"] #sceneDialog .scene-head,
  [data-theme="travel"] #sceneDialog .status,
  [data-theme="travel"] #sceneDialog #reward { z-index:2; }
  [data-theme="travel"] #sceneDialog .scene-head { margin-left:clamp(11px,2vw,30px); }
}
#ponyFlight {
  position:fixed;
  inset:0;
  margin:0;
  width:100%;
  height:100dvh;
  max-width:none;
  max-height:none;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  overflow:hidden;
}
#ponyFlight::backdrop { background:transparent; }
.flight-wash, .flight-flash { position:absolute; inset:0; opacity:0; }
.flight-wash {
  background:radial-gradient(ellipse at var(--flight-x) var(--flight-y), #fff6de, #f1e5f2 59%, #faf0e9);
}
.flight-flash { background:#fffaf2; z-index:2; }
.flight-pony, .flight-trail {
  position:absolute;
  left:var(--flight-x);
  top:var(--flight-y);
  opacity:0;
}
.flight-pony {
  width:var(--pony-size);
  max-width:none;
  translate:-50% -50%;
  z-index:1;
}
.flight-trail {
  width:clamp(130px, 46vw, 760px);
  height:clamp(12px, 4vw, 50px);
  translate:-100% -50%;
  border-radius:100%;
  transform-origin:right center;
  background:linear-gradient(90deg, #ffe0d000, #f2dcffb0 43%, #ffe0a9d9 68%, #fffdf7);
  box-shadow:0 0 26px #fff6d5b0;
}
#ponyFlight.leaving .flight-wash { animation:flight-wash 990ms both; }
#ponyFlight.leaving .flight-pony { animation:pony-takeoff 990ms cubic-bezier(.51,.08,.6,.95) both; }
#ponyFlight.leaving .flight-trail { animation:pony-trail 990ms cubic-bezier(.51,.08,.6,.95) both; }
#ponyFlight.leaving .flight-flash { animation:flight-flash 990ms ease-in both; }
#ponyFlight.arriving .flight-flash { animation:flight-arrive 320ms ease-out both; }
@keyframes flight-wash {
  0% { opacity:0; }
  25%,100% { opacity:1; }
}
@keyframes pony-takeoff {
  0% { opacity:0; transform:translate(0, 0) rotate(0); }
  17% { opacity:1; transform:translate(0, -4px) rotate(-3deg); }
  65% { opacity:1; transform:translate(16vw, -20vh) rotate(-13deg); }
  100% { opacity:1; transform:translate(48vw, -70vh) rotate(-20deg) scale(.72); }
}
@keyframes pony-trail {
  0%,16% { opacity:0; transform:translate(0, 0) rotate(-15deg) scaleX(.12); }
  65% { opacity:.9; transform:translate(16vw, -20vh) rotate(-30deg) scaleX(.84); }
  100% { opacity:.7; transform:translate(48vw, -70vh) rotate(-37deg); }
}
@keyframes flight-flash {
  0%,79% { opacity:0; }
  100% { opacity:1; }
}
@keyframes flight-arrive {
  from { opacity:1; }
  to { opacity:0; }
}
/* Campus album and the film handoff to the next universe. */
#campusGuess[hidden] { display:none; }
[data-theme="campus"] #reward:not(:empty) {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  justify-content:center;
}
@media(min-width:900px) and (orientation:landscape) {
  [data-theme="campus"] #reward:not(:empty) { justify-content:flex-start; }
}
.reward.campus .cards {
  grid-template-columns:repeat(auto-fit, minmax(min(100%, 116px), 1fr));
}
.reward.campus .card { transition:translate .25s ease, box-shadow .25s ease; }
.reward.campus .card:focus-visible { translate:0 -4px; }
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  .reward.campus .card:hover {
    translate:0 -5px;
    animation:polaroid-float 2.4s .24s ease-in-out infinite;
    box-shadow:0 9px 20px #772d4f42;
  }
}
@keyframes polaroid-float {
  0%,100% { translate:0 -5px; }
  50% { translate:0 -9px; }
}
@media(prefers-reduced-motion:reduce) {
  .reward.campus .card { transition:none; }
  .reward.campus .card:focus-visible { translate:none; }
}
#filmTransition {
  position:fixed;
  inset:0;
  margin:0;
  width:100%;
  height:100dvh;
  max-width:none;
  max-height:none;
  padding:0;
  border:0;
  border-radius:0;
  overflow:hidden;
  background:radial-gradient(ellipse, #fbefd5 18%, #e7ccac 68%, #ba9180);
  color:#482e31;
  animation:film-enter .28s ease-out both;
}
#filmTransition::backdrop { background:transparent; }
#filmTransition.film-exit { animation:film-leave .36s ease-in-out both; }
.film-scene {
  position:absolute;
  top:50%;
  left:50%;
  translate:-50% -50%;
  width:min(86vw, 720px);
  aspect-ratio:2.55;
}
.film-camera {
  position:absolute;
  width:46%;
  height:145%;
  inset:-27% auto auto -2%;
  object-fit:contain;
  z-index:1;
}
.film-strip {
  --perforations:repeating-linear-gradient(90deg, transparent 0 5px, #f9e9cc 5px 13px, transparent 13px 19px);
  position:absolute;
  top:61%;
  left:34%;
  width:0;
  height:32%;
  transform:translateY(-50%) rotate(4deg);
  transform-origin:left center;
  background:
    var(--perforations) left top 4px / auto 12% repeat-x,
    var(--perforations) left bottom 4px / auto 12% repeat-x,
    repeating-linear-gradient(90deg, #b78d80 0 49px, #3f292e 49px 56px) left center / auto 55% repeat-x,
    #3f292e;
  border-radius:2px;
  box-shadow:0 5px 8px #724f443d;
  animation:film-unroll 1.55s .21s cubic-bezier(.22,.45,.4,1) both;
}
.film-roll {
  position:absolute;
  right:0;
  top:50%;
  width:clamp(18px, 5vw, 41px);
  aspect-ratio:1;
  background:repeating-radial-gradient(circle, #bd9a81 0 3px, #523638 3px 6px);
  border:3px solid #503237;
  border-radius:50%;
  translate:35% -50%;
  box-shadow:0 2px 3px #462d2e66;
}
@keyframes film-enter {
  from { opacity:0; }
  to { opacity:1; }
}
@keyframes film-leave {
  from { opacity:1; }
  to { opacity:0; }
}
@keyframes film-unroll {
  0% { width:0; opacity:0; }
  12% { opacity:1; }
  100% { width:60%; opacity:1; }
}
/* Pixel farm handoff. The track itself anchors to the viewport center. */
#farmTransition {
  position:fixed;
  inset:0;
  margin:0;
  width:100%;
  height:100dvh;
  max-width:none;
  max-height:none;
  padding:0;
  border:0;
  border-radius:0;
  overflow:hidden;
  color:#432811;
  background:linear-gradient(#fce8af 49%,#eddf99 68%,#e5cf8c);
}
#farmTransition::backdrop { background:transparent; }
#farmTransition::before {
  content:"";
  position:absolute;
  inset:0 0 50%;
  background:url("assets/farm-transition-landscape.png") center bottom / cover no-repeat;
  mask-image:linear-gradient(#000 94%,transparent);
  image-rendering:pixelated;
}
#farmTransition.departing { animation:film-leave .22s ease-in both; }
.farm-loading {
  position:absolute;
  left:50%;
  top:50%;
  translate:-50% -50%;
  width:min(76vw,64rem);
}
.farm-loading-track {
  --farm-progress:0%;
  position:relative;
  height:clamp(18px,4.2vmin,42px);
  background:#492812;
  border:clamp(3px,0.65vmin,6px) solid #a96229;
  box-shadow:0 0 0 3px #492812, inset 0 2px #623817,0 6px #b18a4d;
}
.farm-loading-track::after {
  content:"";
  position:absolute;
  inset:0;
  background:repeating-linear-gradient(90deg,transparent 0 calc(10% - 2px),#492812 calc(10% - 2px) 10%);
  pointer-events:none;
}
.farm-loading-meter {
  height:100%;
  width:var(--farm-progress);
  background:linear-gradient(#ffe782 0 18%,#ffbf38 18% 80%,#e99621 80%);
}
.farm-loading-walker {
  position:absolute;
  left:var(--farm-progress);
  bottom:calc(100% + 8px);
  translate:-58% 0;
  width:clamp(44px,11vmin,132px);
  aspect-ratio:192/272;
  pointer-events:none;
}
.farm-loading-walker img { position:absolute; inset:0; width:100%; image-rendering:pixelated; }
.farm-loading-walker img + img { opacity:0; }
.walking .farm-loading-walker img:first-child { animation:farm-step .28s steps(1) infinite reverse; }
.walking .farm-loading-walker img + img { animation:farm-step .28s steps(1) infinite; }
@keyframes farm-step { from { opacity:0; } 50% { opacity:1; } to { opacity:1; } }
.farm-loading-value {
  position:absolute;
  top:calc(100% + 10px);
  left:50%;
  translate:-50% 0;
  font:bold clamp(21px,4.5vmin,42px)/1 monospace;
  letter-spacing:.04em;
  font-variant-numeric:tabular-nums;
}
.farm-loading-sparks {
  display:none;
  position:absolute;
  right:-10px;
  bottom:calc(100% + clamp(34px,10vmin,105px));
  width:6px;
  height:6px;
  background:#fff8c6;
  box-shadow:0 6px #ffc651,0 -6px #ffc651,6px 0 #ffc651,-6px 0 #ffc651,12px -13px #ffe398;
}
.arrived .farm-loading-sparks { display:block; }
@media (max-aspect-ratio:1/1) {
  #farmTransition::before {
    top:auto;
    height:50%;
    background-size:max(100%,38rem) auto;
    mask-image:linear-gradient(#000 96%,transparent);
  }
}
@media (prefers-reduced-motion:reduce) {
  #farmTransition.departing { animation:none; }
}
/* Old-town rope and directional controls */
.cellar { touch-action:none; }
.cellar-rope {
  position:absolute; left:50%; top:18%; width:4px;
  transform-origin:50% 0;
  background:repeating-linear-gradient(180deg,#d3a975 0 5px,#8f6544 5px 9px);
  border-radius:4px; box-shadow:1px 1px 2px #21120f99;
  pointer-events:none;
}
.cellar .hand {
  width:clamp(48px, 8%, 74px); height:auto; aspect-ratio:1;
  border:0; background:transparent; padding:0; touch-action:none;
  filter:drop-shadow(1px 3px 3px #2c1817aa);
  z-index:3;
}
.cellar .hand img { width:100%; height:100%; object-fit:contain; }
.cellar-doll, .cellar-spider, .cellar-book {
  position:absolute; transform:translate(-50%,-50%); pointer-events:none;
}
.cellar-doll { width:clamp(50px, 11%, 100px); z-index:2; filter:drop-shadow(1px 3px 3px #1c1010a0); }
.cellar-spider { width:clamp(35px, 7%, 58px); z-index:2; filter:drop-shadow(1px 2px 2px #1c1010a0); }
.cellar-book { left:14%; top:82%; width:clamp(52px, 10%, 84px); z-index:1; }
.cellar-book img { width:100%; }
.cellar-book span {
  position:absolute; left:14%; top:37%; width:70%;
  transform:rotate(-15deg); color:#fff2bf; font-size:clamp(9px, 1vw, 13px);
  text-align:center; line-height:1.1; font-weight:700; text-shadow:0 1px 2px #23363c;
}
.cellar-pad {
  display:grid; grid-template-columns:repeat(3,44px); grid-template-rows:repeat(2,44px);
  gap:5px; justify-content:center; margin:8px auto 0; flex:none;
}
.cellar-pad[hidden] { display:none; }
.direction {
  border:2px solid #916444; border-radius:12px; background:#f4d5a4;
  color:#583927; box-shadow:0 3px 0 #78503a; font-size:18px; line-height:1;
  touch-action:none; user-select:none;
}
.direction.up { grid-area:1 / 2; }
.direction.left { grid-area:2 / 1; }
.direction.down { grid-area:2 / 2; }
.direction.right { grid-area:2 / 3; }
.direction.pressed, .direction:active {
  background:#ffe69a; color:#694119; box-shadow:0 0 18px #ffd674, inset 0 0 8px #ffeba9;
  transform:translateY(2px);
}
@media(min-width:900px) and (orientation:landscape) {
  #sceneDialog #mechanism > .cellar-pad { grid-column:1; grid-row:3; justify-self:start; align-self:start; margin:0; }
}
@media(max-height:650px) {
  .cellar-pad { grid-template-columns:repeat(3,38px); grid-template-rows:repeat(2,38px); gap:3px; margin-top:4px; }
}
/* The old blue book opens into the memory album. */
.cellar-rope {
  width:2px;
  background:linear-gradient(90deg, #6e4c35a8, #d4b08c9c, #6e4c35a8);
  opacity:.75;
  box-shadow:none;
}
.cellar .hand.collision img {
  filter:brightness(.75) sepia(1) saturate(8) hue-rotate(315deg) drop-shadow(0 0 5px #ef3030);
}
.cellar-book { perspective:450px; }
.cellar-book.opening { z-index:5; animation:book-rise .8s ease-in-out both; }
.cellar-book.opening img { transform-origin:left center; animation:book-cover .8s ease-in-out both; }
.cellar-book.opening::before {
  content:"";
  position:absolute;
  inset:17% 8% 17% 17%;
  background:#f9e5bd;
  box-shadow:0 0 0 2px #b99560, 0 0 14px #ffdda2aa;
  border-radius:3px;
  transform:rotate(-13deg);
}
.book-spread blockquote {
  font-family:"STSong", "Songti SC", "SimSun", "Noto Serif CJK SC", serif;
  font-size:clamp(15px, 2vw, 20px);
  font-weight:400;
  line-height:1.8;
  letter-spacing:.015em;
  padding:clamp(12px, 2.2vw, 24px);
  word-break:normal;
}
.book-spread > .card {
  display:flex;
  align-items:center;
  padding:10px;
}
.book-spread > .card .slot { width:100%; }

/* Fixed album frames contain the whole print, including portrait panoramas. */
.slot.photo-frame {
  position:relative;
  display:block;
  width:100%;
  min-width:0;
  background:#fff;
}
.slot.photo-frame > img {
  position:absolute;
  inset:0;
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
  object-position:center;
}
#photoContent > .photo-frame {
  max-height:62dvh;
}
.campus-print {
  display:block;
  position:relative;
  width:100%;
  aspect-ratio:4/3;
  max-height:62dvh;
  perspective:1100px;
  border:0;
  padding:0;
  background:transparent;
  cursor:grab;
  touch-action:pan-y;
  user-select:none;
}
.campus-print:active { cursor:grabbing; }
.print-rotor {
  position:absolute;
  inset:0;
  transform-style:preserve-3d;
  transform:rotateY(calc(var(--turn,0deg) + var(--tilt,0deg)));
}
.print-rotor img {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:contain;
  background:white;
  backface-visibility:hidden;
  box-shadow:0 3px 9px #69483230;
  pointer-events:none;
}
.print-rotor img:last-child { transform:rotateY(180deg); }

/* On a book page and the final portrait, the print itself sizes the mount. */
.book-spread > .card:has(.photo-frame),
.reward.stars .card:has(.photo-frame) {
  width:fit-content;
  max-width:100%;
  min-width:0;
  place-self:center;
  background:#fff;
}
.book-spread .slot.photo-frame,
.reward.stars .slot.photo-frame {
  width:auto;
  aspect-ratio:auto;
}
.book-spread .photo-frame > img,
.reward.stars .photo-frame > img {
  position:static;
  width:auto;
  height:auto;
  max-width:100%;
  max-height:52dvh;
}
@keyframes book-rise {
  0% { scale:1; }
  55% { scale:1.55; filter:drop-shadow(0 0 12px #fce9b9); }
  100% { scale:1.75; opacity:0; }
}
@keyframes book-cover {
  0% { transform:rotate(0deg) rotateY(0); }
  100% { transform:rotate(-13deg) rotateY(-155deg); }
}
/* Blue Fairy: warm archival paper and printed Chinese serif typography. */
.reward.book {
  background:#d1ad8c;
}
.reward.book h2 {
  font-family:"Songti SC","STSong","SimSun","Noto Serif CJK SC",serif;
  font-weight:700;
  letter-spacing:.13em;
  color:#503a32;
  border-bottom:1px solid #896d5a;
  padding-bottom:.35em;
  margin-bottom:16px;
}
.reward.book .book-spread {
  background-color:#f2e1bf;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 3px, #906a3d09 4px, transparent 5px),
    radial-gradient(ellipse at 20% 18%, #fff5d766, transparent 60%);
  box-shadow:inset 0 0 28px #8b6b4845;
}
.reward.book .book-spread blockquote {
  color:#514039;
  font-family:"Songti SC","STSong","SimSun","Noto Serif CJK SC",serif;
  font-size:clamp(15px, 2vw, 19px);
  line-height:1.95;
  letter-spacing:.045em;
  text-shadow:.22px .22px #59443a80;
}

.hero .hero-copy h1.keke-heading {
  font:clamp(23px,4.1vw,48px)/1.4 "Birthday Hand",KaiTi,serif;
  color:#875e47;
  letter-spacing:.015em;
  white-space:nowrap;
}
.keke-heading span { color:#dfaa50; font-size:.46em; vertical-align:middle; margin-inline:.18em; }
