@font-face {
  font-family: DreamSong;
  src: url('/dream-song-ui/assets/dream-serif.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --ink: #f3f0ff;
  --muted: #b9bdd9;
  --line: #c8c0f52e;
  --accent: #b8ecd9;
  --blue: var(--accent);
  --paper: #080d20;
  --white: #080d20;
  --sky-hue: 0deg;
  --sky-saturation: 0.8;
  font-family:
    -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei',
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  accent-color: var(--accent);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100svh;
  isolation: isolate;
}
body[data-family='bright'] {
  --accent: #f4dca2;
  --sky-hue: 315deg;
  --sky-saturation: 1.1;
  --orbit-speed: 26s;
}
body[data-family='warm'] {
  --accent: #f0c9b8;
  --sky-hue: 42deg;
  --sky-saturation: 0.65;
  --orbit-speed: 85s;
}
body[data-family='melancholic'] {
  --accent: #b4caff;
  --sky-hue: 18deg;
  --sky-saturation: 0.65;
  --orbit-speed: 90s;
}
body[data-family='dark'] {
  --accent: #dfb2e5;
  --sky-hue: 65deg;
  --sky-saturation: 0.85;
  --orbit-speed: 54s;
}
body[data-family='jazz'] {
  --accent: #a9ebd7;
  --sky-hue: 320deg;
  --sky-saturation: 0.9;
  --orbit-speed: 44s;
}
body[data-family='dreamy'] {
  --orbit-speed: 70s;
}
.dream-sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
  background: #080d20;
}
.dream-sky::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/dream-song-ui/assets/dream-sky.png') center center/cover no-repeat;
  filter: hue-rotate(var(--sky-hue)) saturate(var(--sky-saturation));
  opacity: 0.82;
  transition: filter 1.2s ease-out;
  background-position: 57% center;
}
.dream-sky::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    #080d20f2,
    #080d2060 30%,
    #080d2090 70%,
    #080d2055
  );
}
body[data-screen='result'] .dream-sky::after {
  background:
    linear-gradient(90deg, #080d2090, #080d2070),
    linear-gradient(0deg, #080d20, transparent 50%);
}
button,
a,
input {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}
button:disabled {
  cursor: wait;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
audio:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
button:focus:not(:focus-visible),
h1:focus {
  outline: 0;
}
[hidden] {
  display: none !important;
}
::selection {
  background: #b8ecd9;
  color: #080d20;
}
::-webkit-scrollbar {
  width: 7px;
}
::-webkit-scrollbar-thumb {
  background: #8f94b961;
  border-radius: 7px;
}
a {
  color: var(--accent);
  text-underline-offset: 5px;
}
h1,
h2,
p {
  margin: 0;
}
h1,
h2 {
  font-family: DreamSong, 'Songti SC', serif;
  font-weight: 400;
  text-wrap: balance;
}
h1 {
  font-size: clamp(36px, 3.3vw, 50px);
  line-height: 1.6;
  letter-spacing: 0.04em;
}
p {
  line-height: 1.9;
}
svg {
  display: block;
}
summary {
  cursor: pointer;
}
.masthead {
  max-width: 840px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
  padding: 0 24px;
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  gap: 12px;
}
.brand-name {
  font-family: DreamSong, 'Songti SC', serif;
  line-height: 1.5;
  font-size: 21px;
  letter-spacing: 0.12em;
}
.brand-credit {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.12em;
  display: none;
}
.edition {
  display: flex;
  align-items: center;
  gap: 9px;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-size: 11px;
}
.edition-star {
  height: 4px;
  width: 4px;
  border-radius: 50%;
  background: var(--accent);
}
#app {
  max-width: 840px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: calc(100svh - 84px);
}
.journey {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  align-items: stretch;
}
.stage {
  min-width: 0;
  order: 2;
  padding: 12px 0 28px;
  max-width: none;
}
.stepbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 11px;
  min-height: 36px;
}
.step-count {
  display: flex;
  align-items: center;
  gap: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}
.text-button {
  min-height: 44px;
  padding: 8px 0;
  color: var(--accent);
  text-underline-offset: 6px;
}
.text-button:hover {
  text-decoration: underline;
}
.text-button:disabled {
  visibility: hidden;
}
.lead {
  color: var(--muted);
  max-width: 48ch;
  font-size: 13px;
  margin-top: 14px;
  line-height: 1.9;
}
.options {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 28px;
  gap: 12px;
}
.option {
  width: 100%;
  display: flex;
  align-items: center;
  border: 1px solid #c8c0f53d;
  border-radius: 12px;
  text-align: left;
  line-height: 1.8;
  background: #0c142a99;
  transition:
    background 0.2s ease-out,
    border-color 0.2s ease-out,
    transform 0.2s ease-out;
  min-height: 63px;
  padding: 15px 18px;
  gap: 16px;
  font-size: 15px;
}
.option:hover {
  background: #25394abf;
  border-color: var(--accent);
  transform: translateY(-2px);
}
.marker {
  flex: 0 0 22px;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.option.selected {
  background: #24483fbd;
  border-color: var(--accent);
}
.option.selected .marker {
  font-weight: 700;
}
.question-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin-top: 20px;
  gap: 12px;
}
.quiet {
  color: var(--muted);
  line-height: 1.8;
  font-size: 11px;
}
.primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  min-height: 52px;
  padding: 14px 25px;
  border-radius: 12px;
  background: var(--accent);
  color: #0c1925;
  font-size: 15px;
  font-weight: 600;
  transition:
    background 0.15s ease-out,
    transform 0.15s ease-out;
}
.primary:hover {
  background: #e1f9ee;
  transform: translateY(-1px);
}
.arrow {
  width: 20px;
  height: 20px;
}
.next {
  min-height: 44px;
  padding: 10px 18px;
  font-size: 13px;
  white-space: nowrap;
}
.mobile-stars {
  display: flex;
  width: 150px;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.route {
  min-width: 0;
  position: relative;
  color: #d8dcf4;
  order: 1;
  align-self: auto;
  padding: 0;
  max-width: none;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.wait-stage {
  padding-bottom: 90px;
  padding-top: 38px;
  min-height: 460px;
}
.wait-stage h1 {
  max-width: 12em;
  font-size: 30px;
}
.phase-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 18px;
  margin: 28px 0;
  color: var(--muted);
  font-size: 13px;
}
.phase-list li::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 16px;
}
.phase-list .done,
.phase-list .current {
  color: var(--accent);
}
.waiting-foot {
  display: flex;
  flex-wrap: wrap;
  margin-top: 24px;
  gap: 10px;
  align-items: flex-start;
  flex-direction: column;
}
.boot {
  padding: 80px 0;
}
.boot p {
  margin-top: 20px;
  color: var(--muted);
}
.boot button {
  margin-top: 32px;
}
.notice {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 20;
  max-width: calc(100vw - 32px);
  width: 580px;
  background: #28304c;
  color: var(--ink);
  border-radius: 12px;
  box-shadow: 0 12px 36px #0006;
  line-height: 1.8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  gap: 12px;
  padding: 12px 16px;
}
.notice button {
  min-height: 44px;
  white-space: nowrap;
  color: var(--accent);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.mobile-stars::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--line);
}
.mobile-stars i {
  position: relative;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #9195b3;
}
.mobile-stars i.lit {
  background: var(--accent);
}
.mobile-stars i.here {
  outline: 1px solid var(--accent);
  outline-offset: 5px;
}
.stage h1 {
  font-size: 30px;
  line-height: 1.6;
  letter-spacing: 0.035em;
}
.boot h1 {
  font-size: 30px;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.dream-waiting {
  display: grid;
  place-items: center;
  min-height: calc(100svh - 84px);
}
.dream-waiting .wait-stage {
  max-width: 900px;
  width: 100%;
  padding: 0 0 35px;
  text-align: center;
  padding-bottom: 24px;
}
.dream-waiting h1 {
  max-width: none;
  font-size: 25px;
  line-height: 1.65;
  letter-spacing: 0.04em;
}
.dream-waiting .lead {
  margin: 14px auto 0;
  font-size: 12px;
  margin-top: 16px;
  max-width: 27em;
}
.dream-orb {
  position: relative;
  isolation: isolate;
  contain: layout paint;
  height: 300px;
  margin: 0 auto 12px;
  width: calc(100% + 32px);
  max-width: none;
  left: -16px;
}
.dream-orb canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.energy-particles {
  z-index: 0;
}
.crystal-surface {
  z-index: 2;
}
.orb-fallback {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 28% 20%, #e1fbff8c, transparent 18%),
    radial-gradient(ellipse at 55% 65%, #a9fae466, transparent 50%),
    url('/dream-song-ui/assets/dream-sky.png') 50% 45%/400% 300%;
  box-shadow:
    inset 0 1px 6px #c4f8fcb3,
    inset -12px -14px 28px #090d3280,
    0 14px 60px #8bdac426;
  opacity: 0.85;
  width: 165px;
}
.dream-orb[data-renderer='fallback'] .orb-fallback {
  display: block;
}
.dream-orb[data-renderer='fallback'] .crystal-surface {
  display: none;
}
.dream-waiting .phase-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin: 28px auto 0;
  gap: 12px 18px;
  margin-top: 25px;
  font-size: 11px;
}
.dream-waiting .phase-list li::before {
  margin-right: 9px;
}
.dream-waiting .waiting-foot {
  justify-content: center;
  align-items: center;
  gap: 3px;
  margin-top: 20px;
}
.dream-waiting .waiting-foot .text-button {
  font-size: 12px;
}
.dream-waiting .waiting-foot .quiet {
  font-size: 11px;
}
.orb-toggle {
  color: var(--muted);
}
.orb-toggle:disabled {
  visibility: visible;
  cursor: default;
  opacity: 1;
}
.dream-waiting .wait-failed {
  max-width: 600px;
  text-align: left;
  padding: 60px 0;
}
.wait-failed .lead {
  margin-left: 0;
}
.dream-waiting .wait-failed .phase-list,
.dream-waiting .wait-failed .waiting-foot {
  justify-content: flex-start;
}
.dream-waiting .waiting-foot .orb-toggle {
  margin-top: 4px;
  font-size: 11px;
}
.dream-waiting .wait-failed .waiting-foot {
  align-items: flex-start;
}
.dream-waiting .wait-failed .phase-list {
  flex-direction: column;
}
.preview-note {
  margin-top: 26px;
}

body[data-experience='gathering'] .masthead {
  display: none;
}
body[data-experience='gathering'] #app {
  max-width: none;
  min-height: 100svh;
  padding: 0;
  margin: 0;
}
body[data-experience='gathering'] .dream-waiting {
  min-height: 100svh;
}
body[data-experience='gathering'] .wait-crystal {
  height: 100svh;
  width: 100%;
  max-width: none;
  padding: 0;
  display: grid;
  place-items: center;
}
.orb-control {
  display: block;
  padding: 0;
  width: min(100%, 1000px);
  line-height: 0;
  cursor: default;
}
.orb-control:disabled {
  opacity: 1;
  cursor: default;
}
.orb-control:focus-visible {
  outline: 1px solid #b8ecd954;
  outline-offset: -22px;
  border-radius: 50%;
}
.orb-control .dream-orb {
  width: 100%;
  max-width: none;
  left: 0;
  margin: 0;
  height: min(80svh, 450px);
}
.orb-control .orb-fallback {
  width: 55vw;
  max-width: 247px;
}

/* One mobile-first journey on every screen, with the sky still edge to edge. */
body[data-experience='gathering'] #app {
  max-width: 840px;
  margin-inline: auto;
}
body[data-experience='gathering'] .wait-crystal {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 16px
    max(40px, env(safe-area-inset-bottom));
}
.orb-control {
  width: min(100%, 640px);
  cursor: pointer;
  touch-action: manipulation;
}
.orb-control .dream-orb {
  height: min(62svh, 450px);
}
.orb-touch-aura {
  position: absolute;
  pointer-events: none;
  left: 50%;
  top: 50%;
  width: var(--orb-diameter);
  aspect-ratio: 1;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%);
}
.waiting-controls {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  gap: 4px;
}
.waiting-controls button {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--muted);
}
.waiting-controls button:hover,
.waiting-controls button:focus-visible {
  color: var(--ink);
}
.waiting-status {
  margin: 8px 0 0;
  color: var(--ink);
  font-family: DreamSong, 'Songti SC', serif;
  font-size: 18px;
  line-height: 1.9;
  letter-spacing: 0.14em;
  text-align: center;
  animation: dream-wait-breathe 4s ease-in-out infinite;
  animation-play-state: paused;
}
.waiting-dots {
  display: inline-flex;
  width: 1.6em;
  letter-spacing: 0;
}
.waiting-dots i {
  flex: 1;
  font-style: normal;
  animation: dream-wait-dot 1.8s ease-in-out infinite;
  animation-play-state: paused;
}
.waiting-dots i:nth-child(2) {
  animation-delay: 0.3s;
}
.waiting-dots i:nth-child(3) {
  animation-delay: 0.6s;
}
.waiting-status[data-motion='running'],
.waiting-status[data-motion='running'] i {
  animation-play-state: running;
}
@keyframes dream-wait-breathe {
  0%,
  100% {
    opacity: 0.78;
  }
  50% {
    opacity: 1;
  }
}
@keyframes dream-wait-dot {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}
