:root {
  color-scheme: dark;
  --night: #060e19;
  --ink: #f6f1e6;
  --muted: #b7c4cc;
  --gold: #efd7a3;
  --line: rgba(194, 220, 230, .22);
  --serif: "Songti SC", "Noto Serif CJK SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--night);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
button, input, textarea { font: inherit; }
button, a, label.file-picker { -webkit-tap-highlight-color: transparent; }
button, .file-picker { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible, .file-picker:focus-within { outline: 2px solid #b6edff; outline-offset: 4px; }
button:disabled { cursor: wait; opacity: .65; }
button, .file-picker { transition: background .2s ease, color .2s ease, border-color .2s ease; }
.mast {
  height: 74px; display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center;
  padding: 0 clamp(24px, 5.3vw, 112px); position: relative; z-index: 3;
  border-bottom: 1px solid #a3c9dc25; background: #080f19;
}
.brand { display: inline-flex; gap: 12px; align-items: center; justify-self: start; min-height: 44px; font: 600 20px var(--serif); letter-spacing: .09em; white-space: nowrap; }
.seal {
  display: grid; place-content: center; width: 28px; height: 34px; border: 1px solid #e08c77;
  color: #ffc4a5; background: #8b3432; border-radius: 3px; font: 600 12px/.95 var(--serif);
  text-align: center; letter-spacing: 0; box-shadow: inset 0 0 0 2px #8b3432, inset 0 0 0 3px #ffd2aa60;
}
.mast-note { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 13px; letter-spacing: .17em; white-space: nowrap; }
.mast-note span, .eyebrow > span { width: 4px; height: 4px; background: var(--gold); transform: rotate(45deg); }
.mast-music { justify-self: end; white-space: nowrap; }
.outline, .gold, .text-action, .icon-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 0 15px; border: 1px solid transparent; color: var(--ink);
  background: transparent; border-radius: 4px; font-size: 14px; line-height: 1.3;
}
.outline, .icon-button { border-color: var(--line); background: #101c29aa; }
.outline:hover, .icon-button:hover { color: #fff; background: #23384a; border-color: #98bcc9; }
.gold { font-weight: 650; background: var(--gold); color: #211a11; border-color: var(--gold); }
.gold:hover { background: #fff0c7; border-color: #fff0c7; }
.text-action { padding-inline: 4px; text-underline-offset: 5px; text-decoration: underline; text-decoration-color: #a2bdc288; }
.text-action:hover { color: var(--gold); }
.icon-button { width: 44px; padding: 0; flex: none; font-size: 21px; }
.experience {
  position: relative; isolation: isolate; min-height: max(660px, calc(100svh - 74px));
  overflow: hidden; display: grid; grid-template-columns: 40% minmax(0, 1fr);
  grid-template-rows: 1fr auto; padding: 0 clamp(24px, 5.3vw, 112px);
  background: radial-gradient(ellipse at 72% 43%, #173a54 0%, #102639 22%, #0a1626 47%, #050d17 82%);
}
.experience::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none; inset: 0;
  background: radial-gradient(ellipse at 51% 62%, #247c8e45, transparent 42%),
              radial-gradient(ellipse at 89% 20%, #42558066, transparent 38%),
              radial-gradient(ellipse at 63% 32%, #1466884d, transparent 35%),
              linear-gradient(90deg, #060e19cc, transparent 50%);
}
.universe { position: absolute; z-index: -1; inset: 0 0 74px 26%; cursor: grab; touch-action: pan-y; }
.universe.dragging { cursor: grabbing; }
#sky { display: block; width: 100%; height: 100%; }
.still-tree { position: absolute; inset: 0; background: url("/christmas-tree/tree-still.webp") center / contain no-repeat; pointer-events: none; }
.intro { grid-column: 1; align-self: center; position: relative; z-index: 1; pointer-events: none; padding: 26px 0 48px; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 23px; font: 500 14px/1.4 Georgia, serif; letter-spacing: .17em; color: var(--gold); }
h1, h2 { font-family: var(--serif); }
h1 { margin: 0 0 24px -.035em; font-size: clamp(56px, 6vw, 108px); line-height: 1.13; font-weight: 600; letter-spacing: -.05em; white-space: nowrap; text-shadow: 0 3px 26px #08121ba0; }
h1 span { color: var(--gold); }
.lede { margin: 0; max-width: 385px; line-height: 1.9; font-size: 16px; color: #c5d2d8; }
.nfc-note { margin-top: 8px; color: var(--gold); text-wrap: balance; }
.intro-actions { display: flex; gap: 19px; flex-wrap: wrap; align-items: center; margin-top: 31px; pointer-events: auto; width: fit-content; }
.intro-actions .gold { min-height: 49px; padding-inline: 17px; }
.orbit-label { position: absolute; z-index: 1; right: clamp(24px, 5.3vw, 112px); top: 24px; display: flex; align-items: center; gap: 9px; font-size: 13px; letter-spacing: .14em; color: #b3d0df; pointer-events: none; }
.orbit-label span { width: 17px; height: 1px; background: #aaccd5; }
.hotspots { position: absolute; z-index: 1; pointer-events: none; inset: 0 0 74px 26%; }
.hotspot {
  position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center;
  width: 44px; height: 44px; background: transparent; border: 0; padding: 0; pointer-events: auto;
  border-radius: 50%; touch-action: manipulation; color: #e2faff;
}
.hotspot::before, .hotspot::after { content: ""; position: absolute; inset: 12px; border: 1px solid #a8d8e899; border-radius: inherit; background: #19304489; box-shadow: 0 0 13px #a9e7fd90; }
.hotspot::after { inset: 18px; background: #e2faff; border-color: #fff; }
.hotspot.is-filled::before, .hotspot.is-sample:is(:first-child, :nth-child(7))::before { border-color: #ffdda2ce; }
.hotspot.is-sample::before { border-color: #c9e5edb3; }
.hotspot.is-filled::after, .hotspot.is-sample:is(:first-child, :nth-child(7))::after { background: #ffd898; border-color: #fff5d9; box-shadow: 0 0 13px #ffcf81; }
.hotspot.is-private-empty { display: none; }
.hotspot:hover::before, .hotspot:focus-visible::before, .hotspot.is-active::before { inset: 6px; border-color: var(--gold); background: #9c804552; }
.hint { position: absolute; bottom: 88px; left: 26%; right: 0; text-align: center; margin: 0; color: #c1d1dc; font-size: 13px; pointer-events: none; letter-spacing: .055em; }
.hint span { color: var(--gold); margin-right: 5px; }
.controls {
  grid-area: 2 / 1 / 3 / -1; align-self: end; z-index: 2; min-height: 74px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  border-top: 1px solid var(--line);
}
.scene-icp {
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.scene-icp a { text-decoration: underline; text-underline-offset: .2em; }
.now-playing, .scene-controls { display: flex; align-items: center; gap: 9px; min-width: 0; }
.now-playing > span { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.control-label, .count { color: #b5c4cf; font-size: 13px; }
.now-playing strong { font-size: 14px; font-weight: 540; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.play { border-radius: 50%; color: var(--gold); font-size: 15px; }
.scatter { padding-inline: 15px; }
.scatter[aria-pressed="true"] { color: var(--gold); border-color: #d0b177a0; }
.reset { min-width: 44px; padding: 0; font-size: 23px; }
.count { justify-self: end; white-space: nowrap; }
.count strong { color: var(--gold); font: 500 17px Georgia, serif; margin-left: 9px; }
.notice { position: absolute; z-index: 5; bottom: 79px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 40px); margin: 0; padding: 10px 16px; color: var(--ink); background: #17293c; border: 1px solid var(--line); border-radius: 5px; font-size: 14px; }
dialog { color: var(--ink); background: #101d2a; border: 1px solid #b0c9d253; border-radius: 12px; padding: 26px; width: min(508px, calc(100% - 32px)); max-height: calc(100% - 32px); box-shadow: 0 20px 70px #02070cb0; }
dialog[open] { animation: arrive .32s ease both; }
dialog::backdrop { background: #02070c8d; backdrop-filter: blur(5px); }
#branch-dialog[open] { animation: branch-arrive .42s cubic-bezier(.17, .78, .28, 1) both; }
@keyframes branch-arrive {
  from { opacity: 0; transform: translate(var(--branch-x, 0px), var(--branch-y, 10px)) scale(.76); }
  to { opacity: 1; transform: none; }
}
@keyframes arrive { from { opacity: 0; transform: translateY(11px) scale(.98); } to { opacity: 1; transform: none; } }
/* The card travels independently of the dialog so its first point is the selected branch. */
.branch-sparks { position: fixed; z-index: 5; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#branch-dialog.has-photo[open] { animation: none; }
#branch-dialog.waiting-photo[open] { background: transparent; border-color: transparent; box-shadow: none; }
#branch-dialog.waiting-photo::backdrop { background: #02070c18; backdrop-filter: none; }
#branch-dialog.waiting-photo .dialog-top,
#branch-dialog.waiting-photo #branch-read { opacity: 0; pointer-events: none; }
#branch-dialog.revealing[open] { overflow: visible; animation: reveal-shell 1.26s ease both; }
#branch-dialog.revealing::backdrop { animation: reveal-backdrop 1.26s ease both; }
#branch-dialog.revealing .dialog-top,
#branch-dialog.revealing .memory-message,
#branch-dialog.revealing .read-actions { animation: reveal-copy 1.26s ease both; }
@keyframes reveal-shell {
  0%, 43% { background: transparent; border-color: transparent; box-shadow: none; }
  100% { background: #101d2a; border-color: #b0c9d253; box-shadow: 0 20px 70px #02070cb0; }
}
@keyframes reveal-backdrop {
  0%, 22% { background: #02070c18; backdrop-filter: blur(0); }
  100% { background: #02070c8d; backdrop-filter: blur(5px); }
}
@keyframes reveal-copy {
  0%, 58% { opacity: 0; }
  100% { opacity: 1; }
}
.dialog-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.dialog-top .eyebrow { margin-bottom: 7px; font: 500 13px var(--sans); letter-spacing: .13em; }
.dialog-top h2 { font-size: 29px; font-weight: 600; line-height: 1.2; margin: 0; }
.dialog-top .icon-button { font-size: 24px; font-weight: 350; }
.dialog-description { color: var(--muted); font-size: 14px; margin: 7px 0 0; }
.memory-photo { position: relative; aspect-ratio: 1.52; max-height: min(319px, 43svh); padding: 9px 9px 20px; background: #ede4d2; box-shadow: 0 7px 14px #03090f6b; }
.memory-photo img { display: block; width: 100%; height: 100%; object-fit: contain; background: #171d22; }
.memory-photo:has(#sample-label:not([hidden])) img { object-fit: cover; }
.memory-photo span { position: absolute; bottom: 3px; right: 10px; color: #594e3f; font-size: 12px; }
.memory-message { margin: 21px 0; color: #e6ebea; font: 500 19px/1.8 var(--serif); white-space: pre-wrap; overflow-wrap: anywhere; }
.read-actions, .dialog-footer { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.field { display: grid; gap: 9px; font-size: 15px; }
textarea { width: 100%; background: #0a1420; color: var(--ink); padding: 12px; border: 1px solid var(--line); border-radius: 5px; resize: vertical; line-height: 1.6; font-size: 16px; }
textarea::placeholder { color: #a9b9c2; }
.attachment { display: flex; gap: 8px; align-items: center; margin-top: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.attachment > div { flex: 1; min-width: 0; }
.attachment strong, .attachment div span { display: block; }
.attachment strong { font-size: 15px; margin-bottom: 4px; }
.attachment div span, .dialog-footer small { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.file-picker { position: relative; overflow: hidden; white-space: nowrap; }
.file-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.edit-photo { display: block; min-height: 60px; max-width: 100%; max-height: 180px; margin-top: 12px; border-radius: 4px; }
.form-status { min-height: 20px; margin: 10px 0; color: #ffbca9; font-size: 14px; }
.dialog-footer small { margin-right: auto; }
.branch-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#branches-dialog { width: min(600px, calc(100% - 32px)); }
.branch-list button { justify-content: flex-start; text-align: left; gap: 11px; min-width: 0; min-height: 58px; padding: 5px 9px; }
.branch-list button img { width: 62px; height: 45px; object-fit: cover; border-radius: 3px; background: #213140; }
.branch-list button span { display: grid; gap: 4px; }
.branch-list button strong { font-weight: 600; white-space: nowrap; }
.branch-list small { color: var(--muted); font-size: 12px; }
.track-options { display: grid; gap: 8px; }
.track-options label { cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 0 12px; min-height: 46px; border: 1px solid var(--line); border-radius: 4px; }
.track-options label:has(:checked) { border-color: var(--gold); background: #efd7a31d; }
.track-options input { accent-color: var(--gold); }
.no-script { position: fixed; bottom: 10px; padding: 10px; background: #141d2a; }
@media (max-height: 760px) and (min-width: 761px) {
  .experience { min-height: max(610px, calc(100svh - 74px)); }
}
@media (max-width: 760px) {
  .mast { height: 60px; grid-template-columns: 1fr auto; padding-inline: 17px; }
  .brand { font-size: 18px; gap: 9px; }
  .seal { width: 23px; height: 29px; font-size: 11px; }
  .mast-note, .orbit-label { display: none; }
  .mast-music { padding-inline: 10px; }
  .experience { display: flex; flex-direction: column; min-height: max(690px, calc(100svh - 60px)); padding: 0 17px; background: radial-gradient(ellipse at 50% 60%, #1a405b, #0c1b2d 45%, #060e19 85%); }
  .experience::before { background: radial-gradient(ellipse at 50% 57%, #25748330, transparent 60%); }
  .intro { align-self: stretch; text-align: left; padding: 24px 0 0; }
  .eyebrow { margin-bottom: 12px; font-size: 12px; }
  h1 { font-size: clamp(36px, 7.5vw, 57px); margin: 0 0 10px; }
  h1 br, .lede br { display: none; }
  .lede { font-size: 14px; max-width: 400px; line-height: 1.65; }
  .intro-actions { margin-top: 11px; gap: 12px; }
  .intro-actions .gold { min-height: 44px; }
  .universe, .hotspots { inset: 235px 0 79px; }
  .hint { left: 0; bottom: 82px; font-size: 13px; }
  .controls { margin-top: auto; min-height: 70px; gap: 7px; }
  .control-label { font-size: 12px; }
  .count { font-size: 0; }
  .count strong { font-size: 15px; margin: 0; }
  .scatter { padding-inline: 8px; gap: 4px; }
  .now-playing, .scene-controls { gap: 5px; }
}
@media (max-width: 460px) {
  .branch-list button { padding-inline: 6px; gap: 7px; }
  .branch-list button img { width: 43px; height: 38px; }
}
@media (max-width: 360px) {
  .experience { min-height: 680px; }
  .intro h1 { font-size: 33px; }
  .now-playing strong { font-size: 12px; }
  dialog { padding: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.gift-access {
  min-height: calc(100svh - 74px);
  display: grid;
  align-content: center;
  justify-items: start;
  padding: clamp(28px, 8vw, 100px);
  background: radial-gradient(ellipse at 72% 32%, #19354d, var(--night) 65%);
}
.gift-access h1 { margin-bottom: 12px; font-size: clamp(32px, 6vw, 58px); }
.gift-access p { margin: 0 0 18px; color: var(--muted); }
.gift-access form, .gift-publish-panel form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.gift-access form label, .gift-publish-panel form label,
.gift-publish-panel form p { flex-basis: 100%; }
.gift-access input, .gift-publish-panel input {
  width: 9em;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #101c29;
  color: var(--ink);
}
.gift-publish-panel { width: fit-content; max-width: 100%; margin-top: 18px; pointer-events: auto; }
.gift-publish-panel p { margin: 8px 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.gift-publish-panel p:empty { display: none; }
.gift-publish-panel summary { cursor: pointer; display: flex; align-items: center; gap: 6px; min-height: 44px; color: var(--gold); font-size: 14px; }
.gift-publish-panel summary::before { content: '›'; }
.gift-publish-panel details[open] summary::before { transform: rotate(90deg); }
