:root {
  color-scheme: dark;
  --ink: #f8f3ff;
  --muted: #a7a6c2;
  --line: rgba(227, 220, 255, 0.18);
  --glass: rgba(14, 15, 36, 0.58);
  --violet: #b9a3ff;
  --rose: #ff7fb5;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #07091a;
}

body {
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input {
  font: inherit;
}

.stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 560px;
  isolation: isolate;
  background:
    radial-gradient(circle at 58% 39%, rgba(170, 42, 111, 0.1), transparent 32%),
    radial-gradient(circle at 60% 66%, rgba(105, 72, 91, 0.08), transparent 30%),
    linear-gradient(145deg, #09070d 0%, #050506 58%, #0c0710 100%);
}

.stage::before {
  position: absolute;
  inset: 18px;
  z-index: 2;
  border: 0;
  content: "";
  pointer-events: none;
}

#bouquet {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: none;
}

.intro {
  display: none;
  position: absolute;
  top: clamp(48px, 8vh, 98px);
  left: clamp(42px, 7vw, 118px);
  z-index: 3;
  width: min(300px, 28vw);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Iowan Old Style", serif;
  font-size: clamp(34px, 3.6vw, 52px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.03em;
  text-shadow: 0 0 45px rgba(187, 164, 255, 0.12);
}

.hint {
  margin: 20px 0 0 3px;
  color: #9e9db6;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: 0.12em;
}

.blessing {
  position: absolute;
  top: clamp(38px, 6vh, 72px);
  left: clamp(28px, 5vw, 80px);
  z-index: 3;
  width: min(330px, 34vw);
  pointer-events: none;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.88);
}

.blessing-kicker {
  margin: 0 0 13px;
  color: rgba(255, 173, 205, 0.72);
  font-family: "Courier New", monospace;
  font-size: 9px;
  letter-spacing: 0.28em;
}

.blessing h2 {
  margin: 0;
  color: rgba(255, 239, 246, 0.92);
  font-family: "Songti SC", "STSong", "Iowan Old Style", serif;
  font-size: clamp(22px, 2.2vw, 34px);
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: 0.08em;
}

.wish-text {
  margin: 13px 0 0 2px;
  color: rgba(218, 205, 218, 0.66);
  font-size: 11px;
  letter-spacing: 0.12em;
  transition: opacity 320ms ease, transform 320ms ease;
}

.wish-text.is-changing {
  opacity: 0;
  transform: translateY(-6px);
}

.controls {
  position: absolute;
  bottom: clamp(42px, 7vh, 80px);
  left: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 12px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transform: translateX(-50%);
  opacity: 0.18;
  transition: opacity 220ms ease, transform 220ms ease;
}

.controls:hover,
.controls:focus-within {
  opacity: 1;
}

.bloom-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 17px;
  border: 0;
  border-radius: 999px;
  color: #171429;
  background: linear-gradient(115deg, #f7dded, #c9c0ff);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.bloom-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(187, 164, 255, 0.24);
}

.bloom-button:active {
  transform: translateY(0) scale(0.97);
}

.button-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #765cba;
  box-shadow: 0 0 10px #765cba;
}

.wind-control,
.density-control {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #bbb9d0;
  font-size: 11px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.wind-control {
  cursor: pointer;
}

.wind-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle {
  position: relative;
  width: 28px;
  height: 15px;
  border: 1px solid rgba(225, 221, 255, 0.3);
  border-radius: 99px;
  transition: background 180ms ease;
}

.toggle::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #aaa7c1;
  content: "";
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.wind-control input:checked + .toggle {
  background: rgba(185, 163, 255, 0.15);
}

.wind-control input:checked + .toggle::after {
  transform: translateX(13px);
  background: var(--violet);
  box-shadow: 0 0 10px rgba(185, 163, 255, 0.75);
}

.density-control {
  padding-right: 4px;
}

.density-control input {
  width: 74px;
  height: 2px;
  accent-color: var(--rose);
  cursor: pointer;
}

.density-control output {
  width: 30px;
  color: #77758f;
  font-family: "Courier New", monospace;
  font-size: 9px;
}

.signature {
  display: none;
  position: absolute;
  right: clamp(38px, 4vw, 76px);
  bottom: clamp(42px, 6vh, 70px);
  z-index: 3;
  margin: 0;
  color: rgba(226, 219, 255, 0.47);
  font-family: "Iowan Old Style", serif;
  font-size: 22px;
  font-style: italic;
  pointer-events: none;
}

.signature span {
  margin-left: 8px;
  font-family: "Courier New", monospace;
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

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

:focus-visible {
  outline: 2px solid #e9ccff;
  outline-offset: 4px;
}

@media (max-width: 760px) {
  .stage::before {
    inset: 10px;
  }

  .intro {
    top: 38px;
    left: 30px;
    width: 190px;
  }

  .eyebrow {
    margin-bottom: 16px;
    font-size: 8px;
  }

  h1 {
    font-size: clamp(36px, 11vw, 48px);
  }

  .hint {
    margin-top: 20px;
    font-size: 10px;
  }

  .blessing {
    top: 26px;
    left: 24px;
    width: calc(100% - 48px);
  }

  .blessing-kicker {
    margin-bottom: 9px;
    font-size: 8px;
  }

  .blessing h2 {
    font-size: clamp(20px, 6.4vw, 27px);
  }

  .wish-text {
    margin-top: 9px;
    font-size: 9px;
  }

  .controls {
    right: auto;
    bottom: 28px;
    left: 50%;
    width: calc(100% - 52px);
    justify-content: space-between;
    gap: 10px;
  }

  .density-control output,
  .density-control > span,
  .signature {
    display: none;
  }

  .density-control input {
    width: 58px;
  }
}

@media (max-width: 430px) {
  .controls {
    padding-right: 14px;
  }

  .density-control {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bloom-button,
  .toggle,
  .toggle::after {
    transition: none;
  }

  .controls {
    transition: none;
  }

  .wish-text {
    transition: none;
  }
}
