@font-face {
  font-family: 'Montserrat';
  font-style: italic;
  font-weight: 100;
  font-display: swap;
  src: url('./lib/fonts/montserrat-100-italic.woff2') format('woff2');
}

/* the greeting on the poster: a card script, not a UI face */
@font-face {
  font-family: 'Poster Script';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('./lib/fonts/greatvibes-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url('./lib/fonts/cormorantgaramond-300-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('./lib/fonts/cormorantgaramond-300-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./lib/fonts/cormorantgaramond-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./lib/fonts/spacemono-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./lib/fonts/spacemono-700-normal.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  --ink: #06040b;
  --ink-soft: #0d0812;
  --rose: #ff6b90;
  --rose-deep: #c9306a;
  --pale: #ffe8f0;
  --gold: #fbc96b;
  --text: #fff4f8;
  --muted: rgba(255, 234, 242, 0.76);
  --muted-2: rgba(255, 234, 242, 0.52);
  --line: rgba(255, 214, 226, 0.24);
  --mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "Cormorant Garamond", "Songti SC", "Noto Serif SC", "STSong", Georgia, serif;
  --pad-x: clamp(20px, 4.4vw, 68px);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% 44%, #180a17 0%, #06040b 58%, #020106 100%);
  color: var(--text);
  font-family: var(--mono);
  text-rendering: optimizeLegibility;
}

body {
  min-width: 320px;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

canvas {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 46%,
    transparent 22%,
    rgba(2, 1, 6, 0.08) 56%,
    rgba(2, 1, 6, 0.78) 100%
  );
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.ui {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.ui button,
.ui input,
.ui a {
  pointer-events: auto;
  font-family: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- brand ---------- */

.brand {
  position: absolute;
  z-index: 3;
  top: clamp(24px, 4.6vw, 58px);
  left: var(--pad-x);
  max-width: min(64vw, 620px);
  user-select: none;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 clamp(12px, 1.8vw, 22px);
  font-size: clamp(9px, 0.8vw, 11px);
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--muted);
  white-space: nowrap;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 12px var(--rose);
  animation: pulse 3.4s ease-in-out infinite;
}

h1 {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(40px, 5.5vw, 88px);
  line-height: 0.86;
  letter-spacing: -0.012em;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
}

h1 span {
  background: linear-gradient(100deg, #fff7fa 6%, #ffd9e4 48%, #ff8aa8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 34px rgba(255, 107, 144, 0.22));
}

h1 .line {
  padding-left: 0.06em;
  letter-spacing: 0.005em;
}

.lead {
  margin: clamp(18px, 2.4vw, 28px) 0 0;
  font-size: clamp(12px, 1vw, 13.5px);
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.lead b {
  font-weight: 700;
  color: #ffffff;
}

.lead-soft {
  color: var(--muted-2);
}

.sep {
  display: inline-block;
  margin: 0 0.55em;
  color: var(--muted-2);
}

/* ---------- controls ---------- */

.controls {
  position: absolute;
  z-index: 4;
  top: clamp(24px, 4.6vw, 58px);
  right: var(--pad-x);
  display: flex;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 7, 15, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255, 242, 247, 0.94);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s, background 0.25s, transform 0.2s;
}

.pill:hover {
  border-color: rgba(255, 160, 185, 0.5);
  color: var(--text);
  background: rgba(30, 12, 24, 0.6);
}

.pill:active {
  transform: scale(0.97);
}

.pill[aria-pressed="true"] {
  border-color: rgba(255, 107, 144, 0.6);
  color: #ffe3eb;
  background: rgba(255, 107, 144, 0.12);
  box-shadow: 0 0 24px rgba(255, 107, 144, 0.18);
}

.pill-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--rose);
  transition: color 0.25s, filter 0.25s;
}

.pill-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

/* sound: four bars that lean as soon as sound is on */
.pill-icon--sound svg .eq-bar {
  stroke-width: 1.55;
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

.pill-icon--hand svg {
  stroke-width: 1.3;
}

.pill[aria-pressed="true"] .pill-icon {
  color: #ffd9e4;
}

.pill[aria-pressed="true"] .pill-icon--sound .eq-bar {
  animation: eq-bar 1.05s ease-in-out infinite;
}

.pill[aria-pressed="true"] .pill-icon--sound .eq-bar:nth-child(2) {
  animation-delay: 0.16s;
}

.pill[aria-pressed="true"] .pill-icon--sound .eq-bar:nth-child(3) {
  animation-delay: 0.32s;
}

.pill[aria-pressed="true"] .pill-icon--sound .eq-bar:nth-child(4) {
  animation-delay: 0.48s;
}

.pill[aria-pressed="true"] .pill-icon--hand {
  filter: drop-shadow(0 0 7px rgba(255, 107, 144, 0.75));
}

@keyframes eq-bar {
  0%,
  100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(0.55);
  }
}

.pill-text {
  padding-top: 1px;
  /* Chinese glyphs need an explicit CJK face: the mono stack has none, so
     they were landing on a medium weight and reading heavy */
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", var(--mono);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.12em;
}

/* ---------- hand panel ---------- */

.hand-panel {
  position: absolute;
  right: var(--pad-x);
  top: clamp(96px, 9vw, 120px);
  width: min(262px, calc(100vw - 40px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(10, 6, 13, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
}

.hand-panel.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.hand-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.hand-panel__title {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.icon-btn {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 238, 244, 0.85);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.hand-panel__stage {
  position: relative;
  overflow: hidden;
  border-radius: 9px;
  aspect-ratio: 4 / 3;
  background: #0a0510;
}

.hand-panel__stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  opacity: 0.55;
  filter: saturate(0.3) contrast(1.05);
}

#hand-video.is-live {
  opacity: 1;
  filter: saturate(1.05) contrast(1.02) brightness(0.82);
}

.hand-panel__status {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  padding: 5px 9px;
  border-radius: 10px;
  background: rgba(4, 2, 8, 0.86);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.06em;
  color: #ffffff;
  white-space: normal;
}

.hand-panel__status::before {
  content: "";
  display: inline-block;
  flex: none;
  width: 5px;
  height: 5px;
  margin-right: 7px;
  border-radius: 50%;
  background: #ff9ec4;
  box-shadow: 0 0 8px rgba(255, 158, 196, 0.8);
  vertical-align: middle;
  animation: status-breath 2.6s ease-in-out infinite;
}

.hand-panel__status.is-loading::before {
  background: #ffd0e0;
  box-shadow: 0 0 10px rgba(255, 208, 224, 0.9);
  animation-duration: 1s;
}

.hand-panel__status.is-live::before {
  background: var(--rose);
  box-shadow: 0 0 10px var(--rose);
  animation-duration: 1.5s;
}

.hand-panel__status.is-error::before {
  background: #c76b84;
  box-shadow: 0 0 8px rgba(199, 107, 132, 0.7);
  animation: none;
}

@keyframes status-breath {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.hand-panel__hint {
  margin: 10px 2px 0;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: rgba(255, 238, 244, 0.88);
}

.hand-panel__hint span {
  display: block;
  font-weight: 500;
  color: var(--muted-2);
}

.hand-panel__note {
  display: block;
  width: 100%;
  margin-top: 9px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 129, 160, 0.42);
  border-radius: 8px;
  background: rgba(255, 107, 144, 0.12);
  color: #ffe3eb;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.02em;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.hand-panel__note[hidden] {
  display: none;
}

.hand-panel__note:hover {
  background: rgba(255, 107, 144, 0.2);
  border-color: rgba(255, 129, 160, 0.7);
}

.hand-panel__enable {
  width: 100%;
  height: 32px;
  margin-top: 10px;
  border: 1px solid rgba(255, 107, 144, 0.55);
  border-radius: 8px;
  background: rgba(255, 107, 144, 0.18);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.hand-panel__enable:hover {
  background: rgba(255, 107, 144, 0.3);
  border-color: rgba(255, 140, 170, 0.8);
}

.hand-panel__enable[disabled] {
  opacity: 0.5;
  cursor: default;
}

/* ---------- footer / wish ---------- */

.stage-hint {
  position: absolute;
  left: var(--pad-x);
  bottom: clamp(150px, 17vh, 190px);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--muted-2);
  white-space: nowrap;
}

.wish-dock {
  position: absolute;
  left: 50%;
  bottom: max(clamp(22px, 3.6vw, 42px), env(safe-area-inset-bottom));
  width: min(560px, calc(100vw - 2 * var(--pad-x)));
  transform: translateX(-50%);
  text-align: center;
}

.wish-echo {
  min-height: 18px;
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(14px, 1.35vw, 18px);
  font-style: italic;
  letter-spacing: 0.02em;
  font-weight: 400;
  color: rgba(255, 226, 236, 1);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  text-shadow: 0 0 26px rgba(255, 107, 144, 0.35);
}

.wish-echo.is-visible {
  opacity: 1;
  transform: none;
}

.wish {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(11, 6, 14, 0.58);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.wish:focus-within {
  border-color: rgba(255, 130, 160, 0.55);
  background: rgba(16, 8, 18, 0.7);
  box-shadow: 0 0 0 1px rgba(255, 107, 144, 0.16), 0 18px 48px rgba(255, 80, 120, 0.12);
}

.wish.is-shaking {
  animation: shake 0.36s ease;
  border-color: rgba(255, 107, 144, 0.7);
}

.wish input {
  flex: 1;
  min-width: 0;
  padding: 14px 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  outline: none;
}

.wish input::placeholder {
  color: rgba(255, 236, 243, 0.62);
}

.wish button[type="submit"] {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 120, 205, 0.45);
  border-radius: 50%;
  background: linear-gradient(155deg, rgba(255, 107, 200, 0.26), rgba(177, 139, 255, 0.16));
  box-shadow: 0 0 14px rgba(255, 95, 200, 0.16), inset 0 0 10px rgba(177, 139, 255, 0.12);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.25s, background 0.25s;
}

.wish button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(255, 95, 200, 0.42), inset 0 0 12px rgba(177, 139, 255, 0.2);
  background: linear-gradient(155deg, rgba(255, 107, 200, 0.4), rgba(177, 139, 255, 0.24));
}

.wish button[type="submit"]:active {
  transform: scale(0.94);
}

.wish button[type="submit"]:disabled {
  opacity: 0.55;
  cursor: default;
}

.wish-foot {
  margin: 11px 0 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.wish-foot #wish-count {
  font-weight: 700;
  color: #ffe2ec;
  font-variant-numeric: tabular-nums;
}

.wish-foot-soft {
  color: var(--muted-2);
}

/* ---------- toast ---------- */

.toast {
  position: absolute;
  right: var(--pad-x);
  bottom: clamp(96px, 12vh, 132px);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(360px, calc(100vw - 2 * var(--pad-x)));
  padding: 9px 10px 9px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(10, 5, 12, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: #fff6f9;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.toast__action {
  padding: 6px 12px;
  border: 1px solid rgba(255, 107, 144, 0.4);
  border-radius: 999px;
  background: rgba(255, 107, 144, 0.12);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.toast__action[hidden] {
  display: none;
}

/* ---------- loading / fallback ---------- */

.loading {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  background: #06040b;
  transition: opacity 0.9s ease, visibility 0.9s;
}

.loading.is-done {
  opacity: 0;
  visibility: hidden;
}

.loading p {
  margin: 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.32em;
  color: var(--muted);
}

.loading__star {
  width: 46px;
  height: 46px;
  background: radial-gradient(circle, #fff 0%, #ffc2d3 26%, rgba(255, 107, 144, 0.4) 48%, transparent 70%);
  border-radius: 50%;
  animation: breathe 2.2s ease-in-out infinite;
}

.fallback {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  background: var(--ink);
  font-size: 12px;
  line-height: 1.8;
  color: var(--pale);
}

.fallback[hidden] {
  display: none;
}

.fallback__soft {
  color: var(--muted);
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(0.82);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(2px);
  }
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .brand {
    max-width: calc(100vw - 2 * var(--pad-x));
  }

  .lead {
    max-width: 30ch;
  }

  .lead-soft,
  .lead .sep,
  .stage-hint,
  .wish-foot-soft,
  .wish-foot .sep {
    display: none;
  }

  .controls {
    top: 150px;
    gap: 6px;
  }

  .pill {
    width: 32px;
    height: 32px;
    justify-content: center;
    padding: 0;
  }

  .pill-text {
    display: none;
  }

  .hand-panel {
    top: 192px;
    right: var(--pad-x);
  }

  .stage-hint {
    bottom: 132px;
  }

  .toast {
    left: var(--pad-x);
    right: var(--pad-x);
    bottom: 152px;
    max-width: none;
  }

  .wish-dock {
    width: calc(100vw - 2 * var(--pad-x));
  }

  .wish input {
    padding: 13px 0;
    font-size: 13px;
  }
}

@media (max-height: 620px) {
  .stage-hint,
  .lead,
  .wish-echo {
    display: none;
  }
}

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

/* screenshot / share-image mode: ?clean=1 hides the chrome */
body.is-clean .controls,
body.is-clean .hand-panel,
body.is-clean .stage-hint,
body.is-clean .wish-dock,
body.is-clean .toast {
  display: none;
}

/* the wand carries its own gradient stroke, so no shared stroke-width */
.wish button[type="submit"] svg.wand {
  overflow: visible;
  filter: drop-shadow(0 0 5px rgba(255, 95, 200, 0.55)) drop-shadow(0 0 11px rgba(177, 139, 255, 0.32));
  transition: filter 0.3s ease, transform 0.3s ease;
}

.wish button[type="submit"]:hover svg.wand {
  filter: drop-shadow(0 0 7px rgba(255, 95, 200, 0.8)) drop-shadow(0 0 16px rgba(177, 139, 255, 0.5));
  transform: rotate(-6deg) scale(1.04);
}

.wish button[type="submit"]:active svg.wand {
  transform: rotate(-10deg) scale(0.94);
}

/* the tip breathes so the wand reads as "magic", not just an icon */
.wish button[type="submit"] svg.wand path:nth-of-type(2) {
  animation: wand-glow 3.2s ease-in-out infinite;
}

@keyframes wand-glow {
  0%,
  100% {
    opacity: 0.9;
  }
  50% {
    opacity: 1;
  }
}

/* ---------- lyric roll (right rail, hollow type) ---------- */

.lyrics {
  position: absolute;
  z-index: 1;
  right: var(--pad-x);
  top: 48%;
  width: min(27vw, 360px);
  height: calc(var(--line-h, 30px) * var(--lines, 4));
  transform: translateY(-50%);
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s ease;
  mask-image: linear-gradient(180deg, transparent 0%, #000 13%, #000 87%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 13%, #000 87%, transparent 100%);
}

.lyrics.is-visible {
  opacity: 1;
}

.lyrics.is-suppressed {
  opacity: 0;
}

.lyrics__inner {
  will-change: transform;
}

.lyric {
  margin: 0;
  height: var(--line-h, 30px);
  line-height: var(--line-h, 30px);
  overflow: hidden;
  text-align: right;
  font-family: 'Montserrat', var(--mono);
  font-style: italic;
  font-size: clamp(13px, 1.08vw, 17px);
  font-weight: 100;
  letter-spacing: 0.005em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 0.5px rgba(255, 230, 241, 0.72);
  opacity: 0.6;
}

/* the line being sung */
.lyric.is-active {
  -webkit-text-stroke: 0.65px rgba(255, 246, 250, 1);
}

@media (max-width: 900px) {
  .lyrics {
    width: min(78vw, 300px);
    top: 45%;
    right: var(--pad-x);
    height: calc(var(--line-h, 24px) * var(--lines, 4));
  }

  /* the tree fills the width here, so a soft dark halo keeps the hollow
     type legible without painting a background */
  .lyric {
    font-size: clamp(12px, 3.1vw, 15px);
    filter: drop-shadow(0 0 4px rgba(4, 2, 10, 0.9));
  }
}

@media (prefers-reduced-motion: reduce) {
  .lyrics {
    transition: none;
  }
}

/* ---------- wish card (floats over an ornament) ---------- */

.wish-card {
  position: absolute;
  z-index: 6;
  width: min(272px, 66vw);
  padding: 14px 16px 12px;
  border: 1px solid rgba(255, 214, 226, 0.26);
  border-radius: 16px;
  background: rgba(11, 6, 15, 0.84);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 107, 144, 0.12);
  opacity: 0;
  transform: translate(-50%, calc(-100% - 10px)) scale(0.97);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.wish-card.is-below {
  transform: translate(-50%, 10px) scale(0.97);
}

.wish-card.is-visible {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 10px)) scale(1);
}

.wish-card.is-visible.is-below {
  transform: translate(-50%, 10px) scale(1);
}

.wish-card__text {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  line-height: 1.5;
  color: #fff6f9;
}

.wish-card__meta {
  margin: 8px 0 0;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted-2);
}

.wish-card[hidden] {
  display: none;
}

/* ---------- micro links + share / clear card ---------- */

.ghost {
  padding: 0;
  border: 0;
  background: none;
  color: rgba(255, 234, 242, 0.62);
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  border-bottom: 1px dotted rgba(255, 234, 242, 0.35);
  transition: color 0.2s, border-color 0.2s;
}

.ghost:hover {
  color: #fff;
  border-bottom-color: rgba(255, 234, 242, 0.8);
}

.share-card {
  position: absolute;
  left: 50%;
  bottom: clamp(118px, 14vh, 150px);
  z-index: 8;
  width: min(320px, calc(100vw - 2 * var(--pad-x)));
  padding: 16px 18px 14px;
  border: 1px solid rgba(255, 214, 226, 0.3);
  border-radius: 16px;
  background: rgba(11, 6, 15, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 30px rgba(255, 107, 144, 0.1);
  transform: translate(-50%, 10px);
  opacity: 0;
  transition: opacity 0.26s ease, transform 0.26s ease;
}

.share-card.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.share-card[hidden] {
  display: none;
}

.share-card__title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 300;
  letter-spacing: 0.01em;
  color: #fff6f9;
}

.share-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 214, 226, 0.26);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-family: "PingFang SC", "Hiragino Sans GB", var(--mono);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.04em;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.share-card input:focus {
  border-color: rgba(255, 130, 170, 0.65);
  background: rgba(255, 255, 255, 0.07);
}

.share-card input::placeholder {
  color: rgba(255, 236, 243, 0.4);
}

.share-card__hint {
  margin: 10px 0 14px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: 0.03em;
  color: var(--muted-2);
}

.share-card__hint b {
  font-weight: 700;
  color: #ffe2ec;
}

.share-card__row {
  display: flex;
  gap: 8px;
}

.share-card__primary,
.share-card__danger,
.share-card__ghost {
  flex: 1;
  height: 34px;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.share-card__primary {
  border: 1px solid rgba(255, 107, 144, 0.55);
  background: rgba(255, 107, 144, 0.18);
  color: #fff;
}

.share-card__primary:hover {
  background: rgba(255, 107, 144, 0.3);
}

.share-card__danger {
  border: 1px solid rgba(210, 92, 120, 0.6);
  background: rgba(210, 92, 120, 0.16);
  color: #ffe3e9;
}

.share-card__danger:hover {
  background: rgba(210, 92, 120, 0.3);
}

.share-card__ghost {
  border: 1px solid rgba(255, 214, 226, 0.22);
  background: transparent;
  color: var(--muted);
}

.share-card__ghost:hover {
  border-color: rgba(255, 214, 226, 0.45);
  color: #fff;
}

.share-card__foot {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 214, 226, 0.14);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255, 236, 243, 0.52);
}

.egg-card {
  width: min(370px, calc(100vw - 2 * var(--pad-x)));
  padding: 22px 22px 18px;
  border: 1px solid transparent;
  border-radius: 20px;
  font-family: "思源黑体", "Source Han Sans SC", "Noto Sans SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(120% 80% at 16% -12%, rgba(255, 132, 170, 0.20), rgba(255, 132, 170, 0) 58%),
    radial-gradient(95% 75% at 104% 112%, rgba(247, 200, 120, 0.12), rgba(247, 200, 120, 0) 62%),
    linear-gradient(168deg, #22091d 0%, #130613 56%, #08040c 100%);
  box-shadow:
    0 22px 64px rgba(0, 0, 0, 0.62),
    0 0 42px rgba(255, 120, 160, 0.18),
    inset 0 1px 0 rgba(255, 226, 236, 0.12),
    inset 0 0 50px rgba(255, 120, 160, 0.08);
  transform: translate(-50%, 12px) scale(0.97);
}

.egg-card.is-visible {
  transform: translate(-50%, 0) scale(1);
}

/* the rim: one gradient hairline, lit from the top left */
.egg-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(
    150deg,
    rgba(255, 214, 226, 0.9),
    rgba(247, 215, 142, 0.5) 38%,
    rgba(255, 120, 160, 0.22) 62%,
    rgba(255, 214, 226, 0.72)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  filter: drop-shadow(0 0 7px rgba(255, 150, 185, 0.5));
}

/* soft bloom that hangs outside the card, like light bleeding off paper */
.egg-card__glow {
  position: absolute;
  inset: -10px;
  border-radius: 26px;
  pointer-events: none;
  background:
    radial-gradient(60% 55% at 12% 0%, rgba(255, 138, 174, 0.28), rgba(255, 138, 174, 0) 70%),
    radial-gradient(60% 55% at 92% 100%, rgba(247, 205, 130, 0.20), rgba(247, 205, 130, 0) 70%);
  filter: blur(12px);
  opacity: 0.85;
}

/* the particle edge: motes are laid out in JS along the rounded rim */
.egg-card__motes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 0 3px rgba(255, 158, 190, 0.75));
}

.egg-card__motes circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: mote-pulse 3.6s ease-in-out infinite;
}

@keyframes mote-pulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

.egg-card__grain {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

.egg-card__title {
  margin-bottom: 8px;
  font-family: inherit;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.egg-card__emoji {
  display: inline-block;
  margin-left: 4px;
}

.egg-card__sub {
  margin: 0 0 16px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.01em;
  color: rgba(255, 236, 243, 0.54);
  text-wrap: pretty;
}

@media (max-width: 420px) {
  .egg-card__emoji {
  display: inline-block;
  margin-left: 4px;
}

.egg-card__sub {
    font-size: 10.5px;
    line-height: 1.75;
  }
}

.egg-card__list {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.egg-card__list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: rgba(255, 236, 243, 0.62);
}

.egg-card__list b {
  min-width: 44px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #ffe2ec;
}

/* a handful of ice crystals drifting with the snowfall */
.frost {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.frost__crystal {
  position: absolute;
  top: 0;
  will-change: transform;
  animation: frost-fall var(--fall) linear infinite;
  animation-delay: var(--delay);
  opacity: 0;
}

.frost__crystal svg {
  display: block;
  mix-blend-mode: screen;
  width: 100%;
  height: 100%;
  animation: frost-spin var(--spin) linear infinite;
  filter: drop-shadow(0 0 6px rgba(210, 226, 255, 0.45));
}

@keyframes frost-fall {
  0% {
    transform: translate3d(0, -30vh, 0);
    opacity: 0;
  }
  8% {
    opacity: var(--alpha);
  }
  88% {
    opacity: var(--alpha);
  }
  100% {
    transform: translate3d(var(--drift), 118vh, 0);
    opacity: 0;
  }
}

@keyframes frost-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(var(--turn));
  }
}

@media (prefers-reduced-motion: reduce) {
  .frost__crystal,
  .frost__crystal svg {
    animation: none;
    opacity: var(--alpha);
  }
}
