:root {
  color-scheme: dark;
  --ink: #f5eff2;
  --muted: rgba(233, 224, 237, .48);
  --line: rgba(238, 220, 235, .16);
  --rose: #e8a0ae;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #090b17; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

#app {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 42%, #1c1930 0%, #101222 42%, #090b17 78%),
    #090b17;
  user-select: none;
  -webkit-user-select: none;
}

#webgl { position: absolute; width: 100%; height: 100%; inset: 0; display: block; z-index: 1; outline: none; }
.vignette {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(2, 4, 12, .28) 100%);
}
.ambient { position: absolute; z-index: 0; border-radius: 50%; filter: blur(80px); opacity: .12; pointer-events: none; }
.ambient-one { width: 46vw; height: 46vw; min-width: 280px; min-height: 280px; left: -16vw; top: 8%; background: #a44c73; }
.ambient-two { width: 42vw; height: 42vw; min-width: 260px; min-height: 260px; right: -14vw; bottom: 2%; background: #414c9b; }

.topbar {
  position: absolute; z-index: 4;
  top: 0; left: 0; right: 0;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: max(25px, env(safe-area-inset-top)) 34px 0;
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 24px; height: 24px; fill: var(--rose); opacity: .9; }
.brand-title { display: block; font-size: 13px; font-weight: 500; letter-spacing: .18em; }
.brand-sub { display: block; margin-top: 6px; font-size: 7px; letter-spacing: .24em; color: var(--muted); }
.edition { padding-top: 3px; font-size: 8px; letter-spacing: .22em; color: var(--muted); }
.edition span { color: rgba(245, 239, 242, .82); font-size: 10px; margin-right: 5px; }

.intro {
  position: absolute; z-index: 3; left: 0; right: 0; top: 16%;
  text-align: center; pointer-events: none;
  opacity: 0; transform: translateY(8px);
  transition: opacity 1s ease, transform 1s ease;
}
.intro.visible { opacity: 1; transform: translateY(0); }
.intro.away { opacity: 0; transform: translateY(-8px); }
.intro p { margin: 0; color: rgba(239, 228, 237, .54); font-size: 11px; font-weight: 400; letter-spacing: .28em; }

.bottom-ui {
  position: absolute; z-index: 5;
  left: 0; right: 0; bottom: max(22px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  pointer-events: none;
}
.timeline { display: flex; align-items: center; justify-content: center; gap: 12px; }
.step { display: flex; align-items: center; gap: 6px; color: rgba(233, 224, 237, .26); font-size: 9px; letter-spacing: .12em; transition: color .5s ease; white-space: nowrap; }
.step-no { font-size: 7px; font-variant-numeric: tabular-nums; opacity: .7; }
.step.active { color: rgba(245, 232, 239, .9); }
.step.done { color: rgba(232, 160, 174, .52); }
.step-line { width: 26px; height: 1px; background: var(--line); }
.replay {
  pointer-events: auto;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 15px;
  border: 1px solid rgba(237, 218, 232, .16); border-radius: 99px;
  background: rgba(20, 20, 36, .34); color: rgba(244, 234, 241, .68);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font: inherit; font-size: 10px; letter-spacing: .12em;
  cursor: pointer; opacity: 0; transform: translateY(8px);
  transition: opacity .6s ease, transform .6s ease, background .25s ease, border-color .25s ease;
  pointer-events: none;
}
.replay.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.replay:hover { background: rgba(59, 43, 62, .52); border-color: rgba(232, 160, 174, .34); }
.replay:active { transform: scale(.96); }
.replay svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.loader {
  position: absolute; inset: 0; z-index: 10;
  display: grid; place-items: center;
  background: #0b0d19;
  transition: opacity .8s ease, visibility .8s;
}
.loader.finished { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-card { display: flex; flex-direction: column; align-items: center; width: 210px; text-align: center; }
.loader-heart { width: 34px; height: 34px; fill: var(--rose); margin-bottom: 23px; animation: breathe 1.8s ease-in-out infinite; }
.loader-card p { margin: 0 0 9px; font-size: 13px; letter-spacing: .2em; }
.loader-card > span { color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.loader-track { width: 126px; height: 1px; margin-top: 25px; background: rgba(255,255,255,.1); overflow: hidden; }
.loader-track span { display: block; width: 8%; height: 100%; background: var(--rose); transition: width .35s ease; }
@keyframes breathe { 0%,100% { transform: scale(.92); opacity: .55; } 50% { transform: scale(1.07); opacity: 1; } }

.error { position: absolute; z-index: 12; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #0b0d19; }
.error[hidden] { display: none; }
.error p { font-size: 14px; letter-spacing: .08em; }
.error span { color: var(--muted); font-size: 11px; }

@media (max-width: 640px) {
  .topbar { padding: max(20px, env(safe-area-inset-top)) 20px 0; }
  .brand { gap: 9px; }
  .brand-mark { width: 20px; height: 20px; }
  .brand-title { font-size: 11px; }
  .brand-sub { font-size: 6px; letter-spacing: .18em; }
  .edition { font-size: 6px; letter-spacing: .12em; }
  .edition span { font-size: 8px; }
  .intro { top: 14%; }
  .intro p { font-size: 9px; letter-spacing: .2em; }
  .timeline { gap: 7px; }
  .step { font-size: 8px; gap: 4px; letter-spacing: .06em; }
  .step-line { width: 12px; }
  .bottom-ui { gap: 13px; bottom: max(17px, env(safe-area-inset-bottom)); }
}

@media (max-height: 520px) {
  .intro { display: none; }
  .topbar { padding-top: 15px; }
  .bottom-ui { bottom: 12px; gap: 8px; }
  .replay { height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
