﻿:root {
  color-scheme: dark;
  --page: #02040e;
  --ink: #f8f1dc;
  --muted: #9aa8b8;
  --line: rgba(232, 222, 193, 0.14);
  --line-strong: rgba(232, 222, 193, 0.26);
  --panel-strong: rgba(7, 10, 18, 0.9);
  --gold: #d9bf76;
  --gold-bright: #ffe38f;
  --green: #80c7b0;
  --danger: #f08d7d;
  --shadow: 0 26px 90px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
  -webkit-user-drag: none;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    sans-serif;
  background:
    linear-gradient(145deg, #02030b 0%, #060a18 48%, #020714 100%);
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
}

button,
input,
textarea {
  font: inherit;
}

input,
textarea,
[contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: 24px 24px 122px;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
}

.tree-scene {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(100vh - 146px);
  overflow: hidden;
  border: 1px solid rgba(255, 190, 238, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.42), transparent 28%, transparent 70%, rgba(0, 0, 0, 0.34)),
    linear-gradient(145deg, #01030c 0%, #070b1a 52%, #020b17 100%);
  box-shadow: 0 28px 110px rgba(23, 6, 54, 0.58);
  transition:
    background 420ms ease,
    border-color 420ms ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.tree-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 235, 190, 0.06), transparent 18%, transparent 72%, rgba(18, 58, 90, 0.12)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 48%, transparent 0 46%, rgba(0, 0, 0, 0.54) 100%);
  mix-blend-mode: soft-light;
  opacity: 0.55;
  pointer-events: none;
  transition: background 420ms ease;
}

.tree-scene::after {
  content: "";
  position: absolute;
  inset: auto -8% -24% -8%;
  height: 48%;
  background:
    linear-gradient(180deg, transparent 0 38%, rgba(7, 10, 20, 0.18) 66%, rgba(0, 0, 0, 0.58)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.52), transparent 25%, transparent 72%, rgba(0, 0, 0, 0.42));
  filter: blur(18px);
  opacity: 0.38;
  transform: perspective(900px) rotateX(64deg);
  pointer-events: none;
}

.tree-scene[data-scene="sakura"] {
  border-color: rgba(255, 198, 218, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 214, 231, 0.14), transparent 38%),
    radial-gradient(circle at 18% 18%, rgba(255, 159, 201, 0.22), transparent 30%),
    linear-gradient(145deg, rgba(28, 13, 28, 0.92), rgba(51, 27, 42, 0.88));
}

.tree-scene[data-scene="sakura"]::before {
  background:
    radial-gradient(circle at 56% 38%, rgba(255, 184, 208, 0.2), transparent 34%),
    radial-gradient(circle at 50% 66%, rgba(183, 255, 240, 0.12), transparent 48%);
}

.tree-scene[data-scene="castle"] {
  color-scheme: light;
  border-color: rgba(255, 240, 184, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 246, 209, 0.26), transparent 36%),
    radial-gradient(circle at 22% 24%, rgba(255, 240, 184, 0.34), transparent 28%),
    linear-gradient(145deg, rgba(106, 170, 201, 0.88), rgba(37, 73, 104, 0.9));
}

.tree-scene[data-scene="castle"]::before {
  background:
    radial-gradient(ellipse at 48% 72%, rgba(255, 255, 255, 0.28), transparent 42%),
    radial-gradient(circle at 72% 26%, rgba(217, 247, 255, 0.26), transparent 28%);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 236, 196, 0.22) 0 0.8px, transparent 1.6px),
    linear-gradient(rgba(124, 174, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 159, 232, 0.018) 1px, transparent 1px);
  background-size: 118px 118px, 64px 64px, 64px 64px;
  mask-image: radial-gradient(circle at 50% 42%, black 0 48%, transparent 78%);
  opacity: 0.18;
  pointer-events: none;
}

.light-field,
.spark-layer,
.dandelion-layer,
.wish-ritual-layer,
.public-wish-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.light-field {
  z-index: 1;
}

.spark-layer,
.dandelion-layer {
  z-index: 4;
}

.wish-ritual-layer {
  z-index: 8;
}

.wish-ritual-layer[hidden] {
  display: none !important;
}

.public-wish-layer {
  z-index: 6;
}

.light-ray {
  position: absolute;
  width: 32%;
  height: 140%;
  top: -24%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(125, 195, 255, 0.08), rgba(255, 205, 164, 0.05), transparent);
  filter: blur(22px);
  mix-blend-mode: screen;
  opacity: 0.1;
  transform-origin: center;
  animation: rayDrift 13s ease-in-out infinite alternate;
}

.ray-one {
  left: 12%;
  transform: rotate(18deg);
}

.ray-two {
  left: 44%;
  width: 24%;
  animation-delay: -4s;
  transform: rotate(-12deg);
}

.ray-three {
  right: 4%;
  width: 28%;
  animation-delay: -8s;
  transform: rotate(23deg);
}

.spark {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: rgba(245, 220, 151, 0.9);
  box-shadow: 0 0 16px rgba(240, 215, 142, 0.68), 0 0 34px rgba(255, 172, 221, 0.18);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.35);
  animation: sparkPulse var(--duration) ease-in-out var(--delay) forwards;
}

.star-spark::before,
.star-spark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 680%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 244, 214, 0.84), transparent);
  transform: translate(-50%, -50%);
}

.star-spark::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.wish-ritual-core,
.wish-ritual-stream,
.wish-ritual-dust,
.wish-ritual-beam,
.wish-ritual-label {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}

.wish-ritual-beam {
  width: var(--distance);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 241, 190, 0.88), rgba(255, 150, 232, 0.68), transparent);
  filter: blur(0.2px) drop-shadow(0 0 12px rgba(255, 206, 142, 0.42));
  opacity: 0;
  transform: translate(var(--start-x), var(--start-y)) rotate(var(--angle)) scaleX(0);
  transform-origin: 0 50%;
  animation: wishRitualBeam 3550ms cubic-bezier(0.2, 0.74, 0.18, 1) 160ms forwards;
}

.wish-ritual-core {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  box-shadow:
    0 0 24px rgba(255, 237, 172, 0.78),
    0 0 62px rgba(255, 137, 226, 0.46),
    0 0 100px rgba(143, 213, 255, 0.22);
  opacity: 0;
  transform: translate(var(--start-x), var(--start-y)) translate(-50%, -50%) scale(0.28);
  animation: wishRitualCore 3720ms cubic-bezier(0.2, 0.78, 0.14, 1) forwards;
}

.wish-ritual-seed-inner,
.wish-ritual-seed-ring,
.wish-ritual-seed-tail {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  pointer-events: none;
}

.wish-ritual-seed-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, #fffef2 0 14%, #ffe7a5 28%, #ff91de 52%, rgba(133, 210, 255, 0.38) 72%, transparent 86%);
  box-shadow:
    inset -7px -10px 16px rgba(78, 31, 105, 0.24),
    0 0 18px rgba(255, 244, 199, 0.82),
    0 0 42px rgba(255, 121, 218, 0.42);
  transform: translate(-50%, -50%);
}

.wish-ritual-seed-inner::before,
.wish-ritual-seed-inner::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 260%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 248, 220, 0.92), transparent);
  transform: translate(-50%, -50%);
}

.wish-ritual-seed-inner::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.wish-ritual-seed-ring {
  width: 78px;
  height: 22px;
  border: 1px solid rgba(255, 230, 167, 0.82);
  border-left-color: rgba(166, 214, 255, 0.22);
  border-right-color: rgba(255, 143, 222, 0.46);
  border-radius: 50%;
  filter: drop-shadow(0 0 10px rgba(255, 218, 151, 0.35));
  transform: translate(-50%, -50%) rotate(-16deg);
  animation: wishRitualRing 980ms ease-in-out infinite alternate;
}

.wish-ritual-seed-tail {
  width: 320px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 156, 232, 0.16), rgba(255, 239, 190, 0.78));
  filter: blur(2px) drop-shadow(0 0 16px rgba(255, 174, 232, 0.34));
  transform: translate(-98%, -50%) rotate(180deg);
  transform-origin: 100% 50%;
}

.wish-ritual-stream {
  width: 160px;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 244, 205, 0.92), rgba(255, 151, 232, 0.44), transparent);
  filter: drop-shadow(0 0 8px rgba(255, 222, 152, 0.4));
  opacity: 0;
  transform: translate(var(--start-x), var(--start-y)) rotate(var(--angle)) translate(var(--drift-x), var(--drift-y)) scaleX(0.25);
  animation: wishRitualStream var(--duration) cubic-bezier(0.2, 0.74, 0.22, 1) var(--delay) forwards;
}

.wish-ritual-dust {
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: rgba(255, 240, 182, 0.92);
  box-shadow:
    0 0 12px rgba(255, 229, 160, 0.62),
    0 0 24px rgba(255, 153, 232, 0.28);
  opacity: 0;
  transform: translate(var(--start-x), var(--start-y)) translate(-50%, -50%) scale(0.4);
  animation: wishRitualDust var(--duration) cubic-bezier(0.2, 0.74, 0.22, 1) var(--delay) forwards;
}

.wish-ritual-label {
  z-index: 2;
  padding: 8px 12px;
  border: 1px solid rgba(255, 231, 170, 0.24);
  border-radius: 8px;
  background: rgba(9, 12, 24, 0.58);
  color: rgba(255, 241, 205, 0.92);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  white-space: nowrap;
  opacity: 0;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28), 0 0 28px rgba(255, 185, 230, 0.14);
  transform: translate(var(--target-x), var(--target-y)) translate(-50%, -210%) scale(0.94);
  animation: wishRitualLabel 3600ms ease forwards;
}

.dandelion {
  position: absolute;
  left: var(--start-x);
  top: var(--start-y);
  width: var(--size);
  height: var(--size);
  opacity: 0;
  filter: drop-shadow(0 0 10px rgba(245, 238, 205, 0.38));
  transform: translate3d(0, 0, 0) rotate(0deg);
  animation: dandelionFly var(--duration) cubic-bezier(0.34, 0, 0.22, 1) var(--delay) forwards;
}

.dandelion::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: rgba(255, 250, 226, 0.9);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(240, 215, 142, 0.34);
}

.dandelion i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 48%;
  background: linear-gradient(rgba(255, 250, 226, 0.9), transparent);
  transform: translateX(-50%) rotate(var(--angle));
  transform-origin: 50% 100%;
}

.dandelion-flower {
  filter: drop-shadow(0 0 16px rgba(230, 244, 255, 0.42)) drop-shadow(0 0 28px rgba(255, 192, 229, 0.18));
}

.dandelion-flower::before {
  width: 18%;
  height: 18%;
  background: rgba(255, 250, 226, 0.94);
  box-shadow: 0 0 12px rgba(255, 247, 222, 0.42), 0 0 28px rgba(168, 210, 255, 0.18);
}

.dandelion-flower i {
  height: 55%;
  background: linear-gradient(rgba(255, 255, 255, 0.95), rgba(220, 238, 255, 0.5) 42%, transparent);
}

.scene-header {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 32px 0;
  text-shadow: 0 18px 42px rgba(0, 0, 0, 0.44);
}

.scene-header > div:first-child,
.capacity {
  pointer-events: none;
}

.scene-tools {
  display: grid;
  justify-items: end;
  gap: 14px;
}

.scene-switcher {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(72px, auto));
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(226, 213, 177, 0.18);
  border-radius: 8px;
  background: rgba(8, 12, 11, 0.56);
  backdrop-filter: blur(18px);
}

.scene-button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: rgba(246, 241, 228, 0.72);
  font-size: 12px;
  font-weight: 760;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.scene-button:hover,
.scene-button.is-active {
  border-color: rgba(240, 215, 142, 0.34);
  background: rgba(240, 215, 142, 0.12);
  color: #fff2c7;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(217, 191, 118, 0.22);
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(34px, 5.6vw, 76px);
  line-height: 0.95;
  font-weight: 820;
  color: rgba(255, 248, 230, 0.96);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.04),
    0 20px 52px rgba(0, 0, 0, 0.58);
}

h2 {
  font-size: 22px;
  line-height: 1.2;
}

.capacity {
  display: inline-grid;
  justify-items: end;
  min-width: 112px;
  color: var(--muted);
  font-weight: 720;
}

.capacity span {
  color: var(--gold-bright);
  font-size: clamp(36px, 5vw, 58px);
  line-height: 0.9;
  text-shadow:
    0 0 22px rgba(255, 227, 143, 0.18),
    0 16px 34px rgba(0, 0, 0, 0.46);
}

.capacity small {
  margin-top: 5px;
  font-size: 13px;
}

.tree-stage {
  position: relative;
  z-index: 2;
  min-height: 650px;
}

.tree-canvas {
  position: absolute;
  inset: -68px 0 -18px;
  cursor: grab;
  touch-action: none;
}

.tree-canvas:active {
  cursor: grabbing;
}

.tree-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.scene-hint {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 5;
  padding: 9px 12px;
  border: 1px solid rgba(232, 222, 193, 0.14);
  border-radius: 8px;
  background: rgba(7, 10, 16, 0.62);
  color: rgba(248, 241, 220, 0.68);
  font-size: 12px;
  transform: translateX(-50%);
  backdrop-filter: blur(18px) saturate(108%);
  pointer-events: none;
}

.empty-state {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: min(330px, calc(100% - 48px));
  padding: 13px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(10, 16, 14, 0.58);
  color: #d9cfad;
  font-size: 14px;
  text-align: center;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(18px);
  pointer-events: none;
}

.bottom-dock {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, 1fr));
  gap: 10px;
  width: min(360px, calc(100% - 32px));
  padding: 8px;
  border: 1px solid rgba(232, 222, 193, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(19, 24, 31, 0.72), rgba(7, 10, 15, 0.84)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 24%, transparent 72%, rgba(255, 255, 255, 0.035));
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(255, 255, 255, 0.035);
  transform: translateX(-50%);
  backdrop-filter: blur(24px) saturate(112%);
}

.bottom-dock[hidden],
body.is-sheet-open .bottom-dock {
  display: none !important;
}

.dock-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(248, 241, 220, 0.86);
  font-weight: 780;
  text-decoration: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.dock-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 227, 143, 0.2), rgba(118, 190, 226, 0.1));
  opacity: 0;
  transition: opacity 160ms ease;
}

.dock-button span {
  position: relative;
}

.dock-button:hover,
.dock-button.is-active {
  border-color: rgba(240, 215, 142, 0.38);
  background: rgba(255, 227, 143, 0.075);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  transform: translateY(-1px);
}

.dock-button:hover::before,
.dock-button.is-active::before {
  opacity: 1;
}

.dock-icon {
  position: relative;
  width: 19px;
  height: 19px;
  border: 1px solid currentColor;
  opacity: 0.9;
}

.dock-icon-wish {
  border-radius: 50%;
  box-shadow: inset 0 0 0 5px rgba(240, 215, 142, 0.18);
}

.dock-icon-search {
  border-radius: 50%;
}

.dock-icon-search::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 14px;
  width: 8px;
  height: 1px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}

.action-sheet {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: grid;
  align-items: end;
  padding: 24px;
  background: linear-gradient(180deg, transparent 0 38%, rgba(2, 4, 3, 0.42) 100%);
}

.sheet-frame {
  width: min(760px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), transparent 44%),
    var(--panel-strong);
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(26px);
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.close-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(226, 213, 177, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #eadcb5;
  font-size: 24px;
  line-height: 1;
}

.sheet-panel,
.wish-form,
.lookup-form,
.form-field {
  display: grid;
  gap: 10px;
}

label {
  color: #d8ccb0;
  font-size: 13px;
  font-weight: 740;
}

textarea,
input {
  width: 100%;
  border: 1px solid rgba(226, 213, 177, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

textarea {
  min-height: 132px;
  resize: vertical;
  padding: 14px;
  line-height: 1.6;
}

input {
  min-height: 48px;
  padding: 0 14px;
}

.public-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 58px;
  margin-top: 2px;
  padding: 10px 12px;
  border: 1px solid rgba(226, 213, 177, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.public-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  width: 48px;
  height: 28px;
  border: 1px solid rgba(226, 213, 177, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.toggle-track::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e8dcc0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
  transition: transform 160ms ease;
}

.public-toggle input:checked + .toggle-track {
  border-color: rgba(240, 215, 142, 0.58);
  background: rgba(240, 215, 142, 0.28);
}

.public-toggle input:checked + .toggle-track::after {
  transform: translateX(20px);
  background: #fff2ba;
}

.toggle-copy {
  display: grid;
  gap: 2px;
}

.toggle-copy strong {
  color: #f5e9c8;
  font-size: 13px;
}

.toggle-copy small {
  color: var(--muted);
  font-size: 12px;
}

textarea::placeholder,
input::placeholder {
  color: rgba(246, 241, 228, 0.42);
}

textarea:focus,
input:focus {
  border-color: rgba(240, 215, 142, 0.58);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(240, 215, 142, 0.1);
}

.form-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.primary-button,
.secondary-button,
.ghost-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  overflow: hidden;
  border-radius: 8px;
  font-weight: 820;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.primary-button {
  margin-top: 6px;
  border: 1px solid rgba(240, 215, 142, 0.56);
  background:
    linear-gradient(135deg, rgba(240, 215, 142, 0.95), rgba(111, 179, 143, 0.9)),
    #d7bd7a;
  color: #08100d;
  box-shadow: 0 18px 42px rgba(240, 215, 142, 0.18);
}

.secondary-button {
  border: 1px solid rgba(240, 215, 142, 0.34);
  background: rgba(240, 215, 142, 0.1);
  color: #f2e7c7;
}

a.ghost-button {
  text-decoration: none;
}

.ghost-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(226, 213, 177, 0.22);
  background: rgba(255, 255, 255, 0.05);
  color: #eadcb5;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.result-card,
.detail-card {
  margin-top: 14px;
  border-top: 1px solid rgba(226, 213, 177, 0.14);
  padding-top: 14px;
}

.result-copy {
  margin: 0 0 12px;
  color: rgba(246, 241, 228, 0.74);
  font-size: 13px;
  line-height: 1.6;
}

.guid-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

code {
  overflow-wrap: anywhere;
  color: #f2dfaa;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.guid-box code {
  display: block;
  border: 1px solid rgba(226, 213, 177, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 11px 12px;
}

.memorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-items: start;
  justify-items: center;
  overflow: auto;
  padding: clamp(18px, 4vh, 46px) 18px 32px;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 220, 166, 0.18), transparent 22%),
    rgba(3, 5, 12, 0.74);
  backdrop-filter: blur(18px);
}

.memorial-overlay[hidden] {
  display: none !important;
}

.memorial-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(640px, calc(100vw - 28px));
  min-height: min(92vh, 820px);
  padding: 10px 12px 24px;
}

.memorial-close {
  position: sticky;
  top: 0;
  justify-self: end;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 235, 196, 0.26);
  border-radius: 8px;
  background: rgba(10, 12, 24, 0.72);
  color: #fff0c8;
  font-size: 26px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.envelope-scene {
  position: relative;
  display: grid;
  place-items: center;
  width: min(360px, 82vw);
  height: 170px;
  margin-top: -10px;
  perspective: 900px;
}

.envelope {
  position: relative;
  width: 270px;
  height: 170px;
  transform-style: preserve-3d;
  filter: drop-shadow(0 28px 38px rgba(0, 0, 0, 0.34));
}

.envelope-back,
.envelope-front,
.envelope-flap,
.envelope-letter {
  position: absolute;
  inset: 0;
  border-radius: 8px;
}

.envelope-back {
  background: linear-gradient(145deg, #5a275f, #22194b);
  border: 1px solid rgba(255, 222, 183, 0.24);
}

.envelope-front {
  clip-path: polygon(0 35%, 50% 74%, 100% 35%, 100% 100%, 0 100%);
  background: linear-gradient(160deg, rgba(255, 203, 226, 0.7), rgba(73, 42, 112, 0.9));
  border: 1px solid rgba(255, 232, 204, 0.28);
}

.envelope-flap {
  clip-path: polygon(0 0, 50% 62%, 100% 0);
  background: linear-gradient(180deg, #8c447b, #3e225b);
  transform-origin: 50% 0;
  z-index: 2;
}

.envelope-letter {
  inset: 22px 30px 34px;
  background:
    radial-gradient(circle at 72% 28%, rgba(255, 238, 186, 0.36), transparent 26%),
    linear-gradient(180deg, #fff4df, #f3d8ec);
  transform: translateY(32px) scale(0.9);
  opacity: 0;
  z-index: 1;
}

.memorial-overlay.is-opening .envelope-flap {
  animation: envelopeOpen 980ms cubic-bezier(0.22, 0.82, 0.2, 1) forwards;
}

.memorial-overlay.is-opening .envelope-letter {
  animation: letterRise 1300ms cubic-bezier(0.22, 0.82, 0.2, 1) 260ms forwards;
}

.memorial-overlay.is-card-ready .envelope-scene {
  animation: envelopeFade 420ms ease forwards;
}

.memorial-preview {
  display: block;
  width: min(560px, calc(100vw - 40px));
  max-height: min(74vh, 760px);
  object-fit: contain;
  border: 1px solid rgba(255, 229, 191, 0.22);
  border-radius: 8px;
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.46),
    0 0 80px rgba(255, 177, 224, 0.16);
  opacity: 0;
  transform: translateY(-24px) scale(0.94);
}

.memorial-overlay.is-card-ready .memorial-preview {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    opacity 520ms ease,
    transform 620ms cubic-bezier(0.22, 0.82, 0.2, 1);
}

.memorial-actions {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.memorial-overlay .memorial-actions {
  opacity: 0;
  transform: translateY(-8px);
}

.memorial-overlay.is-card-ready .memorial-actions {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 420ms ease 120ms,
    transform 420ms ease 120ms;
}

@keyframes envelopeOpen {
  0% {
    transform: rotateX(0deg);
  }

  100% {
    transform: rotateX(178deg) translateY(-2px);
  }
}

@keyframes letterRise {
  0% {
    opacity: 0;
    transform: translateY(32px) scale(0.9);
  }

  52% {
    opacity: 1;
    transform: translateY(-42px) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-128px) scale(1.08);
  }
}

@keyframes envelopeFade {
  100% {
    height: 0;
    margin-top: -28px;
    opacity: 0;
    transform: translateY(-34px) scale(0.78);
  }
}

.detail-topline {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.detail-author {
  color: #e9d49b;
}

.wish-text {
  margin: 0;
  color: #f4eedc;
  font-size: 15px;
  line-height: 1.72;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  margin-top: 14px;
}

.detail-actions .secondary-button {
  min-height: 42px;
  padding-inline: 18px;
  font-size: 14px;
}

.fulfilled-hint {
  color: rgba(246, 215, 151, 0.86);
  font-size: 13px;
  line-height: 1.5;
}

.status-message {
  min-height: 21px;
  margin: 12px 2px 0;
  color: #dcca99;
  font-size: 13px;
  line-height: 1.5;
}

.status-message.is-error {
  color: var(--danger);
}

.public-wish {
  position: absolute;
  left: 0;
  top: 0;
  width: min(314px, 70vw);
  padding: 9px 11px 9px 34px;
  border: 1px solid rgba(210, 226, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(3, 6, 16, 0.92), rgba(8, 13, 27, 0.8)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 48%),
    linear-gradient(90deg, rgba(var(--public-glow, 255, 190, 110), 0.065), transparent 34%);
  color: var(--public-text, rgba(235, 206, 158, 0.9));
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.5),
    0 0 14px rgba(var(--public-glow, 255, 190, 110), calc(var(--orbital-glow, 0.2) * 0.1)),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px) saturate(116%);
  -webkit-backdrop-filter: blur(18px) saturate(116%);
  opacity: 0;
  transform: translate3d(-999px, -999px, 0);
  transition:
    opacity 220ms ease,
    filter 220ms ease;
  will-change: transform, opacity;
}

.public-wish::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 50%;
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--public-spark, rgba(232, 177, 98, 0.78)), rgba(var(--public-glow, 255, 190, 110), 0.16));
  filter: drop-shadow(0 0 8px rgba(var(--public-glow, 255, 190, 110), var(--orbital-glow, 0.22)));
  opacity: 0.75;
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.public-wish b {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
  background: var(--public-spark, rgba(232, 177, 98, 0.88));
  box-shadow:
    0 0 12px rgba(var(--public-glow, 255, 190, 110), 0.48),
    0 0 24px rgba(var(--public-glow, 255, 190, 110), calc(var(--orbital-glow, 0.24) * 0.54));
  transform: translateY(-50%);
}

.public-wish p {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--public-text, rgba(235, 206, 158, 0.9));
  font-size: 14px;
  font-weight: 720;
  line-height: 1.42;
  letter-spacing: 0;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.78),
    0 10px 22px rgba(0, 0, 0, 0.5);
}

.public-wish span {
  display: block;
  margin-top: 4px;
  color: var(--public-meta, rgba(220, 174, 104, 0.84));
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.62);
}

.tree-scene[data-scene="sakura"] .public-wish {
  color: var(--public-text, rgba(228, 184, 220, 0.9));
}

.tree-scene[data-scene="castle"] .public-wish {
  color: var(--public-text, rgba(184, 210, 244, 0.9));
}

.petal {
  border-radius: 72% 28% 68% 32%;
  background: rgba(255, 190, 214, 0.7);
  box-shadow: 0 0 18px rgba(255, 170, 204, 0.28);
}

.petal::before,
.petal i {
  display: none;
}

@keyframes rayDrift {
  0% {
    opacity: 0.26;
    translate: -16px 0;
  }

  100% {
    opacity: 0.24;
    translate: 24px 0;
  }
}

@keyframes sparkPulse {
  0%,
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.34);
  }

  28% {
    opacity: 0.54;
    transform: translate(calc(-50% + var(--drift-mid-x)), calc(-50% + var(--drift-mid-y))) scale(0.86);
  }

  62% {
    opacity: 0.38;
    transform: translate(calc(-50% + var(--drift-x)), calc(-50% + var(--drift-y))) scale(1.08);
  }
}

@keyframes wishRitualBeam {
  0% {
    opacity: 0;
    transform: translate(var(--start-x), var(--start-y)) rotate(var(--angle)) scaleX(0);
  }

  28% {
    opacity: 0.92;
  }

  72% {
    opacity: 0.7;
    transform: translate(var(--start-x), var(--start-y)) rotate(var(--angle)) scaleX(1);
  }

  100% {
    opacity: 0;
    transform: translate(var(--start-x), var(--start-y)) rotate(var(--angle)) scaleX(1);
  }
}

@keyframes wishRitualCore {
  0% {
    opacity: 0;
    transform: translate(var(--start-x), var(--start-y)) translate(-50%, -50%) scale(0.16) rotate(-10deg);
  }

  18% {
    opacity: 1;
    transform: translate(var(--start-x), var(--start-y)) translate(-50%, -50%) scale(1.08) rotate(0deg);
  }

  34% {
    opacity: 1;
    transform: translate(var(--start-x), var(--start-y)) translate(-50%, -50%) scale(0.92) rotate(10deg);
  }

  82% {
    opacity: 1;
    transform: translate(var(--target-x), var(--target-y)) translate(-50%, -50%) scale(1.05) rotate(28deg);
  }

  100% {
    opacity: 0;
    transform: translate(var(--target-x), var(--target-y)) translate(-50%, -50%) scale(2.9) rotate(42deg);
  }
}

@keyframes wishRitualRing {
  from {
    transform: translate(-50%, -50%) rotate(-16deg) scaleX(0.92);
    opacity: 0.72;
  }

  to {
    transform: translate(-50%, -50%) rotate(-28deg) scaleX(1.08);
    opacity: 1;
  }
}

@keyframes wishRitualStream {
  0% {
    opacity: 0;
    transform: translate(var(--start-x), var(--start-y)) rotate(var(--angle)) translate(var(--drift-x), var(--drift-y)) scaleX(0.12);
  }

  20% {
    opacity: 0.72;
  }

  76% {
    opacity: 0.62;
    transform: translate(var(--target-x), var(--target-y)) rotate(var(--angle)) translate(0, 0) scaleX(1);
  }

  100% {
    opacity: 0;
    transform: translate(var(--target-x), var(--target-y)) rotate(var(--angle)) translate(0, 0) scaleX(0.18);
  }
}

@keyframes wishRitualDust {
  0% {
    opacity: 0;
    transform: translate(var(--start-x), var(--start-y)) translate(-50%, -50%) scale(0.2);
  }

  18% {
    opacity: 0.88;
  }

  74% {
    opacity: 0.72;
    transform: translate(var(--target-x), var(--target-y)) translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(var(--target-x), var(--target-y)) translate(-50%, -50%) scale(0.1);
  }
}

@keyframes wishRitualLabel {
  0% {
    opacity: 0;
    transform: translate(var(--target-x), var(--target-y)) translate(-50%, -240%) scale(0.9);
  }

  24%,
  70% {
    opacity: 1;
    transform: translate(var(--target-x), var(--target-y)) translate(-50%, -210%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(var(--target-x), var(--target-y)) translate(-50%, -185%) scale(0.96);
  }
}

@keyframes dandelionFly {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(0.72);
  }

  9% {
    opacity: var(--opacity);
  }

  34% {
    opacity: var(--opacity);
    transform: translate3d(var(--mid-x), var(--mid-y), 0) rotate(var(--spin-mid)) scale(0.94);
  }

  68% {
    opacity: var(--opacity);
    transform: translate3d(var(--late-x), var(--late-y), 0) rotate(var(--spin-late)) scale(1.03);
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--move-x), var(--move-y), 0) rotate(var(--spin)) scale(1.12);
  }
}

@keyframes publicWishFlow {
  0% {
    opacity: 0;
    transform: translate3d(0, 20px, 0) scale(var(--scale));
  }

  10%,
  82% {
    opacity: 0.86;
  }

  100% {
    opacity: 0;
    transform: translate3d(calc(100vw + 720px), -18px, 0) scale(var(--scale));
  }
}

@media (max-width: 760px) {
  .app-shell {
    min-height: 100svh;
    padding: 0;
    overflow: hidden;
  }

  .tree-scene {
    min-height: 100svh;
    height: 100svh;
    border: 0;
    border-radius: 0;
  }

  .scene-header {
    align-items: flex-start;
    gap: 12px;
    padding: max(14px, env(safe-area-inset-top)) 14px 0;
  }

  .eyebrow {
    margin-bottom: 4px;
    font-size: 11px;
  }

  h1 {
    font-size: clamp(28px, 10vw, 42px);
  }

  .scene-tools {
    gap: 8px;
  }

  .scene-switcher {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(252px, 61vw);
    gap: 4px;
    padding: 4px;
  }

  .scene-button {
    min-height: 30px;
    padding: 0 6px;
    font-size: 11px;
    white-space: nowrap;
  }

  .capacity {
    min-width: 74px;
  }

  .capacity span {
    font-size: 34px;
  }

  .capacity small {
    font-size: 12px;
  }

  .tree-stage {
    min-height: 0;
  }

  .tree-canvas {
    inset: -42px -22vw -20px;
  }

  .scene-hint {
    bottom: calc(86px + env(safe-area-inset-bottom));
    font-size: 11px;
  }

  .empty-state {
    top: 54%;
    width: min(300px, calc(100% - 40px));
    font-size: 13px;
  }

  .bottom-dock {
    bottom: max(12px, env(safe-area-inset-bottom));
    width: min(330px, calc(100% - 24px));
    padding: 6px;
  }

  .dock-button {
    min-height: 48px;
  }

  .action-sheet {
    z-index: 24;
    align-items: end;
    padding: 20px 10px calc(16px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(2, 4, 3, 0.08) 0 18%, rgba(2, 4, 3, 0.62) 100%);
  }

  .sheet-frame {
    max-height: min(72svh, 620px);
    overflow-y: auto;
    padding: 16px;
  }

  textarea {
    min-height: 116px;
  }

  .public-wish {
    width: min(276px, 72vw);
    padding: 8px 10px 8px 31px;
  }

  .public-wish p {
    font-size: 13px;
    line-height: 1.38;
  }

  .public-wish span {
    font-size: 10px;
  }

  .public-like {
    min-height: 20px;
    margin-top: 5px;
    padding: 1px 8px;
    font-size: 10px;
  }
}

@media (max-width: 430px) {
  .bottom-dock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dock-button {
    min-height: 50px;
  }

  h1 {
    font-size: 34px;
  }

  .capacity {
    min-width: 82px;
  }

  .capacity span {
    font-size: 34px;
  }

  .scene-header {
    gap: 10px;
  }

  .scene-switcher {
    width: min(218px, 58vw);
  }

  .scene-button {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.scene-chip {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(226, 213, 177, 0.22);
  border-radius: 8px;
  background: rgba(9, 14, 18, 0.58);
  color: #f2dfaa;
  font-size: 13px;
  font-weight: 780;
  backdrop-filter: blur(14px);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.scene-chip:hover {
  border-color: rgba(240, 215, 142, 0.48);
  background: rgba(240, 215, 142, 0.12);
  transform: translateY(-1px);
}

.ranking-panel {
  position: absolute;
  right: 32px;
  top: 118px;
  z-index: 12;
  width: min(360px, calc(100% - 64px));
  max-height: min(560px, calc(100% - 160px));
  overflow: auto;
  border: 1px solid rgba(232, 222, 193, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(11, 15, 24, 0.86), rgba(5, 8, 15, 0.76)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 45%);
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 14px;
  backdrop-filter: blur(22px) saturate(1.12);
}

.ranking-panel[hidden],
.about-overlay[hidden] {
  display: none !important;
}

.ranking-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #fff5d6;
}

.ranking-head strong {
  font-size: 18px;
}

.ranking-head span {
  color: rgba(240, 215, 142, 0.82);
  font-size: 12px;
}

.ranking-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ranking-list li {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 78px;
  overflow: hidden;
  border: 1px solid rgba(226, 213, 177, 0.14);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 28%, rgba(255, 242, 191, 0.1), transparent 34px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(75, 96, 140, 0.035));
  padding: 12px 12px 12px 13px;
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: rankingFloat 5.8s ease-in-out infinite;
  animation-delay: var(--rank-delay, 0ms);
}

.ranking-list strong {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 232, 168, 0.28);
  border-radius: 50%;
  background: rgba(255, 227, 156, 0.08);
  color: #f8d77d;
  font-size: 17px;
  line-height: 1.2;
  box-shadow:
    0 0 18px rgba(248, 215, 125, 0.2),
    inset 0 0 14px rgba(255, 230, 170, 0.08);
}

.ranking-list li > div {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.ranking-list p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 6px;
  color: rgba(255, 250, 238, 0.94);
  font-size: 13px;
  line-height: 1.48;
}

.ranking-list span,
.ranking-empty {
  color: rgba(240, 215, 142, 0.8);
  font-size: 12px;
}

.ranking-item::before,
.ranking-item::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.ranking-item::before {
  inset: -1px;
  z-index: -1;
  opacity: 0.62;
  background:
    radial-gradient(circle at var(--rank-x, 78%) 22%, var(--rank-glow, rgba(255, 226, 160, 0.18)), transparent 42px),
    linear-gradient(120deg, transparent 12%, rgba(255, 255, 255, 0.16), transparent 38%);
  transform: translateX(-58%);
  animation: rankingSheen 6.8s ease-in-out infinite;
  animation-delay: var(--rank-delay, 0ms);
}

.ranking-item::after {
  right: 12px;
  bottom: 10px;
  width: 76px;
  height: 28px;
  border-top: 1px solid var(--rank-line, rgba(255, 228, 168, 0.32));
  border-radius: 50%;
  opacity: 0.58;
  transform: rotate(-8deg);
  animation: rankingOrbit 7.2s linear infinite;
}

.ranking-ornament,
.ranking-trail {
  position: absolute;
  pointer-events: none;
}

.ranking-ornament {
  z-index: 1;
  right: 17px;
  top: 14px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--rank-star, #f8d77d);
  box-shadow:
    0 0 14px var(--rank-star, #f8d77d),
    0 0 36px var(--rank-glow, rgba(255, 226, 160, 0.36));
  animation: rankingPulse 2.9s ease-in-out infinite;
  animation-delay: var(--rank-delay, 0ms);
}

.ranking-ornament::before,
.ranking-ornament::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 1px solid var(--rank-line, rgba(255, 232, 168, 0.42));
  border-radius: 50%;
  opacity: 0.78;
}

.ranking-ornament::after {
  inset: -15px -7px;
  transform: rotate(-22deg);
  opacity: 0.48;
}

.ranking-trail {
  left: 74px;
  right: 18px;
  bottom: 11px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rank-line, rgba(255, 232, 168, 0.34)), transparent);
  opacity: 0.72;
  animation: rankingTrail 4.6s ease-in-out infinite;
  animation-delay: var(--rank-delay, 0ms);
}

.ranking-prime {
  --rank-star: #ffe79b;
  --rank-glow: rgba(255, 215, 132, 0.38);
  --rank-line: rgba(255, 229, 156, 0.62);
  border-color: rgba(255, 224, 145, 0.42) !important;
  background:
    radial-gradient(circle at 14% 24%, rgba(255, 233, 159, 0.22), transparent 58px),
    radial-gradient(circle at 86% 16%, rgba(255, 195, 239, 0.16), transparent 64px),
    linear-gradient(135deg, rgba(42, 33, 44, 0.72), rgba(19, 22, 42, 0.78));
  box-shadow:
    0 18px 52px rgba(0, 0, 0, 0.34),
    0 0 44px rgba(255, 204, 120, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.ranking-nebula {
  --rank-star: #caa8ff;
  --rank-glow: rgba(190, 138, 255, 0.3);
  --rank-line: rgba(199, 177, 255, 0.44);
  background:
    radial-gradient(circle at 17% 28%, rgba(191, 149, 255, 0.16), transparent 50px),
    radial-gradient(circle at 84% 78%, rgba(125, 204, 255, 0.1), transparent 60px),
    linear-gradient(135deg, rgba(21, 18, 48, 0.7), rgba(11, 18, 37, 0.74));
}

.ranking-stardust {
  --rank-star: #93d8ff;
  --rank-glow: rgba(147, 216, 255, 0.22);
  --rank-line: rgba(156, 220, 255, 0.34);
  background:
    radial-gradient(circle at 18% 24%, rgba(147, 216, 255, 0.1), transparent 46px),
    linear-gradient(135deg, rgba(16, 24, 42, 0.66), rgba(11, 13, 29, 0.72));
}

.ranking-rank-1 {
  min-height: 94px;
}

.ranking-rank-1 strong {
  width: 40px;
  height: 40px;
  color: #fff3bd;
  font-size: 18px;
  box-shadow:
    0 0 20px rgba(255, 229, 145, 0.42),
    0 0 46px rgba(255, 175, 230, 0.2),
    inset 0 0 18px rgba(255, 236, 174, 0.14);
}

.ranking-rank-1 .ranking-ornament {
  width: 24px;
  height: 24px;
  right: 18px;
  top: 16px;
}

@keyframes rankingFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

@keyframes rankingSheen {
  0%,
  45% {
    transform: translateX(-70%);
    opacity: 0;
  }

  62% {
    opacity: 0.64;
  }

  100% {
    transform: translateX(58%);
    opacity: 0;
  }
}

@keyframes rankingPulse {
  0%,
  100% {
    opacity: 0.76;
    transform: scale(0.92);
  }

  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes rankingOrbit {
  to {
    transform: rotate(352deg);
  }
}

@keyframes rankingTrail {
  0%,
  100% {
    opacity: 0.26;
    transform: scaleX(0.62);
  }

  50% {
    opacity: 0.8;
    transform: scaleX(1);
  }
}

.public-wish {
  pointer-events: auto;
}

.public-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  margin-top: 6px;
  padding: 2px 9px;
  border: 1px solid rgba(218, 230, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(245, 238, 220, 0.78);
  font-size: 11px;
  font-weight: 800;
  text-shadow: none;
  pointer-events: auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.public-like::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--public-spark, rgba(232, 177, 98, 0.82));
  box-shadow:
    0 0 8px rgba(var(--public-glow, 255, 190, 110), 0.46),
    0 0 16px rgba(var(--public-glow, 255, 190, 110), 0.2);
}

.public-like:hover:not(:disabled) {
  border-color: rgba(var(--public-glow, 255, 190, 110), 0.4);
  background: rgba(var(--public-glow, 255, 190, 110), 0.13);
  color: var(--public-text, rgba(235, 206, 158, 0.9));
}

.public-like:disabled {
  opacity: 0.62;
  cursor: default;
}

.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 4, 12, 0.68);
  backdrop-filter: blur(18px);
}

.about-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(82svh, 760px);
  overflow: auto;
  border: 1px solid rgba(226, 213, 177, 0.24);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(20, 27, 34, 0.96), rgba(9, 13, 18, 0.94));
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.46);
  padding: 28px;
}

.about-card h2 {
  margin: 0 52px 16px 0;
  color: #fff4d8;
  font-size: clamp(24px, 4vw, 34px);
}

.about-card p:not(.eyebrow) {
  margin: 0 0 14px;
  color: rgba(246, 241, 228, 0.82);
  font-size: 15px;
  line-height: 1.78;
}

.about-card .close-button {
  position: absolute;
  right: 20px;
  top: 20px;
}

@media (max-width: 760px) {
  .scene-tools {
    grid-template-columns: repeat(2, auto);
    align-items: start;
  }

  .scene-tools .capacity {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .scene-chip {
    min-height: 30px;
    padding: 0 9px;
    font-size: 12px;
  }

  .ranking-panel {
    right: 10px;
    left: 10px;
    top: 112px;
    width: auto;
    max-height: 48svh;
  }

  .ranking-list li {
    grid-template-columns: 38px minmax(0, 1fr);
    min-height: 70px;
    padding: 10px;
  }

  .ranking-list strong {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .ranking-ornament {
    right: 12px;
    top: 12px;
    width: 14px;
    height: 14px;
  }

  .about-card {
    padding: 22px 18px;
  }
}

.bottom-dock {
  grid-template-columns: repeat(4, minmax(104px, 1fr));
  width: min(700px, calc(100% - 32px));
}

.dock-icon-info {
  border-radius: 50%;
}

.dock-icon-info::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 7px;
  width: 2px;
  height: 8px;
  background: currentColor;
  border-radius: 2px;
}

.dock-icon-info::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
}

.dock-icon-story {
  border-radius: 3px;
  box-shadow: inset 5px 0 0 rgba(240, 215, 142, 0.18);
}

.dock-icon-story::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  bottom: 3px;
  width: 1px;
  background: currentColor;
  opacity: 0.72;
}

.dock-icon-story::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 5px;
  width: 6px;
  height: 1px;
  background: currentColor;
  box-shadow: 0 4px 0 currentColor, 0 8px 0 currentColor;
  opacity: 0.72;
}

.ranking-toggle {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 230, 170, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 231, 170, 0.1), rgba(255, 231, 170, 0.045)),
    rgba(10, 12, 16, 0.74);
  color: rgba(255, 238, 190, 0.92);
  font-size: 12px;
  font-weight: 780;
}

.ranking-panel.is-collapsed {
  width: auto;
  min-width: 0;
  padding: 7px;
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(20, 24, 29, 0.72), rgba(8, 10, 14, 0.8)),
    rgba(0, 0, 0, 0.38);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ranking-panel.is-collapsed .ranking-head {
  margin: 0;
}

.ranking-panel.is-collapsed .ranking-head div,
.ranking-panel.is-collapsed .ranking-list {
  display: none;
}

.ranking-panel.is-collapsed .ranking-toggle {
  writing-mode: vertical-rl;
  min-width: 34px;
  min-height: 78px;
  padding: 8px 5px;
  letter-spacing: 0;
}

@media (max-width: 760px) {
  .bottom-dock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(390px, calc(100% - 24px));
  }

  .ranking-panel.is-collapsed {
    left: auto;
    right: 10px;
    width: auto;
  }
}

/* Full-viewport galaxy surface */
html,
body {
  width: 100%;
  min-height: 100%;
  overflow: hidden;
}

.app-shell {
  min-height: 100svh;
  padding: 0;
  overflow: hidden;
}

.tree-scene {
  position: fixed;
  inset: 0;
  min-height: 100svh;
  width: 100vw;
  height: 100svh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.tree-stage {
  min-height: 0;
}

.tree-canvas {
  inset: -64px -9vw -40px;
}

.ranking-panel {
  top: 112px;
  right: 24px;
}

@media (max-width: 760px) {
  .tree-canvas {
    inset: -54px -28vw -28px;
  }
}

/* Make the galaxy a full-browser canvas, with UI floating above it. */
.tree-scene {
  display: block;
}

.tree-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.tree-canvas {
  inset: -64px -9vw -40px;
}

.scene-header {
  position: relative;
  z-index: 9;
}

.scene-hint {
  bottom: calc(92px + env(safe-area-inset-bottom));
}

@media (max-width: 760px) {
  .tree-canvas {
    inset: -54px -30vw -28px;
  }

  .scene-hint {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 761px) {
  .scene-header {
    position: absolute;
    inset: 0;
    z-index: 14;
    display: block;
    padding: 0;
    pointer-events: none;
  }

  .scene-header > div:first-child {
    position: absolute;
    left: 60px;
    bottom: 58px;
    width: min(360px, calc(42vw - 48px));
    padding-left: 22px;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
  }

  .scene-header .eyebrow {
    margin: 0 0 8px;
    color: rgba(217, 191, 118, 0.92);
    font-size: 12px;
    font-weight: 700;
    text-shadow: none;
  }

  .scene-header h1 {
    font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
    font-size: clamp(30px, 3.2vw, 46px);
    line-height: 1;
    font-weight: 500;
    color: rgba(255, 238, 190, 0.94);
    text-shadow: 0 18px 42px rgba(0, 0, 0, 0.7);
  }

  .scene-tools {
    position: absolute;
    top: 22px;
    right: 30px;
  }

  .capacity {
    min-width: 92px;
  }

  .capacity span {
    font-size: clamp(54px, 4.8vw, 78px);
    font-weight: 760;
  }

  .capacity small {
    color: rgba(210, 220, 230, 0.72);
    font-size: 13px;
    font-weight: 700;
  }
}

.site-record {
  position: fixed;
  left: 50%;
  bottom: max(3px, env(safe-area-inset-bottom));
  z-index: 18;
  width: max-content;
  max-width: calc(100vw - 24px);
  font-size: 0;
  line-height: 1;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.site-record a {
  display: block;
  pointer-events: auto;
  color: rgba(248, 241, 220, 0.46);
  font-size: 10px;
  line-height: 1;
  text-decoration: none;
  text-shadow: 0 8px 22px rgba(0, 0, 0, 0.72);
  white-space: nowrap;
  transition: color 160ms ease;
}

.site-record a:hover {
  color: rgba(255, 238, 190, 0.82);
}

@media (max-width: 760px) {
  .site-record {
    bottom: calc(2px + env(safe-area-inset-bottom));
  }

  .site-record a {
    font-size: 9px;
  }
}
