@font-face { font-family: "DMX Serif"; src: url("../assets/dmx-serif.woff2") format("woff2"); font-weight: 600; font-display: swap; }
:root { --ink: #203a3a; --muted: #61716c; --paper: #f5f3ed; --line: #314c4228; --blue: #1b65a7; --serif: "DMX Serif", "Songti SC", SimSun, Georgia, serif; --sans: "PingFang SC", "Microsoft YaHei", Arial, sans-serif; }
:root {
  --gutter: clamp(16px, 2.6vw, 40px);
  --left: max(var(--gutter), calc(env(safe-area-inset-left) + 8px));
  --right: max(var(--gutter), calc(env(safe-area-inset-right) + 8px));
  --header-top: max(24px, env(safe-area-inset-top));
  --menu-top: calc(var(--header-top) + 56px);
  --control-bottom: max(40px, calc(env(safe-area-inset-bottom) + 30px));
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #e8ece4; color: var(--ink); font-family: var(--sans); }
button, select, input { font: inherit; color: inherit; }
button, a, select, summary { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .5; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #1b65a7; outline-offset: 5px; }
#garden { position: relative; width: 100%; height: 100%; height: 100dvh; isolation: isolate; overflow: hidden; }
.garden-poster, #scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.garden-poster { object-position: 58% center; }
#scene { touch-action: none; cursor: grab; outline-offset: -5px; }
#scene:active { cursor: grabbing; }
.paper-grain { position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: .15; background: url('../assets/paper.svg'); }
.garden-header { position: absolute; z-index: 10; inset: 0 0 auto; padding: var(--header-top) var(--right) 20px var(--left); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: linear-gradient(#f5f3ede6, #f5f3ed00); pointer-events: none; }
.garden-header a, .garden-header button { pointer-events: auto; }
.back { display: flex; align-items: center; gap: 14px; font-size: 12px; letter-spacing: 2px; min-height: 44px; }
.back > span:first-child { font-size: 20px; }
.header-mark { font-family: var(--serif); font-size: 19px; letter-spacing: 5px; }
.header-mark i { font: normal 8px var(--sans); letter-spacing: 2px; margin-left: 14px; color: var(--muted); }
.header-controls { display: flex; gap: 8px; align-items: center; }
.header-controls button { background: #f5f3ede0; border: 1px solid #ffffff90; border-radius: 3px; min-width: 44px; min-height: 44px; padding: 8px 13px; font-size: 11px; }
.header-controls button:hover { background: #fff; }
.entrance { position: absolute; z-index: 3; left: max(10%, var(--left)); top: 50%; transform: translateY(-46%); max-width: 590px; }
.eyebrow { font-size: 9px; letter-spacing: 3px; font-weight: 500; }
.title-row { display: flex; gap: 22px; align-items: flex-start; }
.title-row h1 { font: 600 clamp(68px, 8vw, 128px)/1.25 var(--serif); letter-spacing: 14px; margin: 20px 0 25px; white-space: pre-line; }
.seal { font: 14px/1.4 var(--serif); color: #366d85; border: 1px solid #366d85; padding: 7px 5px 7px 7px; margin-top: 40px; letter-spacing: 2px; transform: rotate(-5deg); }
.invitation { font: 22px var(--serif); letter-spacing: 4px; margin: 10px 0 22px; }
.entrance-description { font-size: 13px; line-height: 2; color: #546966; white-space: pre-line; }
.enter-actions { display: flex; align-items: center; gap: 22px; margin-top: 35px; }
.primary { border: 1px solid #294e4a; background: #294e4a; color: #fff; padding: 16px 22px; min-height: 52px; display: inline-flex; gap: 38px; justify-content: space-between; font-size: 12px; letter-spacing: 2px; border-radius: 2px; }
.primary:hover { background: #193b38; }
.quiet { min-height: 48px; border: 0; border-bottom: 1px solid #4f6c674f; background: transparent; padding: 10px 3px; font-size: 12px; }
.entrance-note { margin-top: 60px; color: #627972; font-size: 10px; letter-spacing: 4px; }
.load-status { min-height: 20px; max-width: 380px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.edition { position: absolute; bottom: max(28px, env(safe-area-inset-bottom)); right: var(--right); font-size: 9px; letter-spacing: 3px; color: #49635c; }
.garden-menu { position: absolute; top: var(--menu-top); right: var(--right); z-index: 15; width: min(320px, calc(100% - var(--left) - var(--right))); max-height: calc(100dvh - var(--menu-top) - max(12px, env(safe-area-inset-bottom))); overflow-y: auto; overscroll-behavior: contain; scroll-padding-block: 58px 12px; background: var(--paper); box-shadow: 0 10px 42px #17312a25; border: 1px solid #ffffffb5; padding: 0 20px 18px; border-radius: 4px; }
.menu-heading { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; min-height: 54px; font-size: 11px; letter-spacing: 2px; border-bottom: 1px solid var(--line); background: var(--paper); }
.menu-heading button { background: none; border: 0; width: 44px; height: 44px; font-size: 25px; }
#places { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-block: 13px 18px; }
#places button { text-align: left; border: 0; border-radius: 2px; background: transparent; min-height: 48px; padding: 10px; font-size: 12px; }
#places button span { color: #8b9b92; font-size: 9px; display: block; margin-bottom: 3px; }
#places button:hover, #places button[aria-current="location"] { background: #e4e9df; }
.preferences { border-top: 1px solid var(--line); padding-top: 12px; }
.preferences label { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; font-size: 11px; }
.preferences select { background: #fff8; border: 1px solid var(--line); padding: 8px; max-width: 155px; font-size: 11px; border-radius: 2px; }
.preferences select#perspective { width: 155px; }
.preferences input[type="range"] { width: 140px; accent-color: #496e5b; }
.preferences input[type="checkbox"] { width: 20px; height: 20px; accent-color: #496e5b; }
.preference-note { font-size: 10px; line-height: 1.7; color: var(--muted); margin: 0 0 12px; }
.help { border-top: 1px solid var(--line); padding-top: 12px; font-size: 11px; }
.help summary { cursor: pointer; min-height: 30px; }
.help p { line-height: 1.8; color: var(--muted); white-space: pre-line; }
.garden-hud { position: absolute; z-index: 4; inset: 0; pointer-events: none; }
.place-caption { position: absolute; left: var(--left); bottom: var(--control-bottom); max-width: min(380px, calc(100% - var(--left) - var(--right))); padding: 9px 16px; border-left: 2px solid #527063; background: #f5f3ede8; opacity: 0; transition: opacity .35s ease; }
.place-caption.at-place { opacity: 1; }
.place-caption h2 { font: 600 24px/1.3 var(--serif); letter-spacing: 3px; margin: 2px 0 5px; }
.place-caption .eyebrow { margin: 0; color: var(--muted); font-size: 9px; letter-spacing: 2px; }
.place-caption > p:last-child { font: 13px/1.5 var(--serif); letter-spacing: 1px; margin: 0; }
.move-pad { position: absolute; left: var(--left); bottom: var(--control-bottom); display: grid; grid-template: 44px 30px 44px / 44px 30px 44px; place-items: center; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.move-pad button { width: 44px; height: 44px; border: 1px solid #ffffffa0; border-radius: 50%; padding: 0; color: #284c43; background: #f5f3eddc; font-size: 20px; line-height: 1; touch-action: none; -webkit-touch-callout: none; }
.move-pad button[aria-pressed="true"] { background: #365b53; color: #fff; border-color: #365b53; }
.move-pad [data-direction="forward"] { grid-area: 1 / 2; }
.move-pad [data-direction="left"] { grid-area: 2 / 1; }
.move-pad [data-direction="right"] { grid-area: 2 / 3; }
.move-pad [data-direction="back"] { grid-area: 3 / 2; }
.move-pad-center { grid-area: 2 / 2; display: grid; place-items: center; color: #668078; font-size: 24px; pointer-events: none; }
.action-bar { position: absolute; right: var(--right); bottom: var(--control-bottom); display: flex; gap: 8px; pointer-events: auto; }
.action-bar button { background: #f8f7f0ea; border: 1px solid #fff9; padding: 12px 17px; min-height: 44px; font-size: 12px; border-radius: 3px; }
#action { background: #284f49; color: #fff; border-color: #284f49; }
.gesture-hint { position: absolute; left: 50%; bottom: max(8px, env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 3px 9px; margin: 0; border-radius: 2px; font-size: 11px; line-height: 1.4; color: #354e46; background: #f5f3edd9; white-space: nowrap; }
body[data-move-pad="true"] .place-caption { top: var(--menu-top); bottom: auto; }
body[data-move-pad="true"] .action-bar { flex-direction: column; align-items: stretch; width: min(145px, calc(100% - var(--left) - var(--right) - 131px)); gap: 5px; }
body[data-move-pad="true"] .action-bar button { padding: 8px 10px; }
.toast { position: absolute; z-index: 20; top: 99px; left: 50%; transform: translateX(-50%); max-width: min(440px, calc(100% - 40px)); padding: 12px 18px; background: #f5f3edf5; box-shadow: 0 5px 20px #203c2912; border-radius: 3px; font-size: 12px; line-height: 1.7; text-align: center; }
.fallback { position: absolute; top: min(30%, 220px); left: max(10%, var(--left)); z-index: 4; max-width: 430px; max-height: calc(100dvh - min(30vh, 220px) - 24px); overflow-y: auto; background: #f5f3edea; padding: 24px; border: 1px solid #fff8; }
.fallback h2 { font: 600 27px/1.5 var(--serif); }
.fallback > p { font-size: 12px; line-height: 1.9; }
.fallback-actions { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 22px; }
.skip { position: absolute; z-index: 30; top: -100px; left: var(--left); background: var(--paper); padding: 12px; }
.skip:focus { top: var(--header-top); }
.noscript { font-size: 12px; max-width: 380px; line-height: 1.8; }
body[data-running="true"] .edition { display: none; }
body[data-running="true"] .garden-poster { visibility: hidden; }
html[lang="en"] .title-row h1 { font-size: clamp(48px, 5.5vw, 82px); line-height: 1.14; letter-spacing: -2px; }
html[lang="en"] .invitation { font-size: 18px; letter-spacing: .3px; }
@media (max-width: 760px) {
  :root { --header-top: max(12px, env(safe-area-inset-top)); }
  .garden-header { padding-bottom: 12px; gap: 10px; }
  .header-mark { display: none; }
  .header-controls { gap: 5px; }
  .header-controls button { font-size: 11px; padding: 7px 10px; }
  .back { gap: 8px; letter-spacing: 1px; }
  .entrance { left: max(8%, var(--left)); right: max(8%, var(--right)); top: 45%; transform: translateY(-40%); }
  .entrance::before { content: ''; position: absolute; inset: -30px -24px; background: radial-gradient(ellipse at left, #f0f0e8e6, #f0f0e800 75%); z-index: -1; }
  .title-row h1 { font-size: 86px; margin-block: 16px 22px; }
  .invitation { font-size: 18px; letter-spacing: 2px; }
  .entrance-note { margin-top: 32px; font-size: 9px; letter-spacing: 3px; }
  .entrance-description { font-size: 12px; }
  .enter-actions { gap: 20px; margin-top: 25px; }
  .primary { padding: 14px 17px; gap: 25px; }
  .edition { font-size: 8px; letter-spacing: 2px; }
  .place-caption { top: var(--menu-top); bottom: auto; padding: 7px 12px; }
  .place-caption h2 { font-size: 19px; letter-spacing: 1px; }
  .place-caption > p:last-child { max-width: 235px; font-size: 12px; }
  .action-bar { flex-wrap: wrap; justify-content: flex-end; }
  .action-bar button { padding: 10px 12px; }
  .gesture-hint { font-size: 10px; }
  .fallback { left: max(6%, var(--left)); right: max(6%, var(--right)); max-width: none; top: 30%; padding: 22px; }
  html[lang="en"] .title-row h1 { font-size: 52px; }
}
@media (max-width: 380px) {
  :root { --gutter: 12px; }
  .back { gap: 6px; font-size: 11px; letter-spacing: .3px; }
  .back > span:first-child { font-size: 18px; }
  .header-controls { gap: 4px; }
  .header-controls button { padding-inline: 7px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  :root { --control-bottom: max(14px, calc(env(safe-area-inset-bottom) + 6px)); }
  .fallback { top: 86px; max-height: calc(100dvh - 100px); }
  .entrance { top: 58%; }
  .title-row h1 { font-size: 55px; margin: 4px 0; }
  html[lang="en"] .title-row h1 { font-size: 38px; }
  .entrance-note, .entrance-description, .seal { display: none; }
  .enter-actions { margin-top: 14px; }
  .invitation { margin-bottom: 10px; font-size: 16px; }
  .place-caption { top: var(--menu-top); bottom: auto; padding: 4px 10px; }
  .place-caption h2 { font-size: 17px; letter-spacing: 1px; margin: 0; }
  .place-caption > p:last-child { display: none; }
  .gesture-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

.change-view { animation: reveal-view .35s ease-out; }
@keyframes reveal-view { from { opacity: .2; } to { opacity: 1; } }
