@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;1,500&display=swap');

:root {
  color-scheme: dark;
  --night: #080809;
  --ink: #faf7f8;
  --muted: #c6c0c9;
  --accent: #e6d4f9;
  --on-accent: #241831;
  background: var(--night);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); font: 16px/1.5 system-ui, sans-serif; }

.phone {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.in-telegram .phone { min-height: var(--tg-viewport-stable-height, 100svh); }
.in-telegram .telegram { display: none; }

.telegram {
  display: grid;
  place-items: center;
  min-height: 46px;
  border-bottom: 1px solid #ffffff10;
  background: #0d0d0f;
  font-size: 13px;
}

.night {
  position: relative;
  isolation: isolate;
  flex: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(12px, 2.4vh, 24px);
  padding: max(22px, env(safe-area-inset-top)) 18px max(34px, env(safe-area-inset-bottom));
  text-align: center;
  background: radial-gradient(ellipse at 50% 37%, #17151c 0%, #0d0c10 42%, var(--night) 76%);
}

.night::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 17%, #fff7 0 1px, transparent 1.7px),
    radial-gradient(circle at 33% 8%, #fff4 0 .6px, transparent 1.4px),
    radial-gradient(circle at 76% 11%, #fff5 0 .7px, transparent 1.4px),
    radial-gradient(circle at 87% 24%, #fff5 0 .7px, transparent 1.4px),
    radial-gradient(circle at 7% 41%, #fff4 0 .6px, transparent 1.4px),
    radial-gradient(circle at 93% 53%, #fff6 0 .8px, transparent 1.5px),
    radial-gradient(circle at 12% 71%, #fff5 0 .7px, transparent 1.4px),
    radial-gradient(circle at 22% 90%, #fff5 0 .7px, transparent 1.4px),
    radial-gradient(circle at 68% 87%, #fff4 0 .6px, transparent 1.4px),
    radial-gradient(circle at 87% 78%, #fff5 0 .8px, transparent 1.6px);
}

.dedication, h1, .lead, .feedback { margin: 0; }
.dedication {
  font-size: clamp(12px, 3.2vw, 15px);
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.sky {
  position: relative;
  width: min(100%, 460px);
  aspect-ratio: 2.08;
}

.sky::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 35% 58% at 50% 52%, #ffc85d24, #ffc85d07 51%, transparent 78%);
}

.moon {
  position: absolute;
  top: 51%;
  left: 50%;
  width: 28%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-8deg);
  background: linear-gradient(155deg, #fff0a9 4%, #ffdb75 50%, #f9bd4c 100%);
  -webkit-mask-image: radial-gradient(circle at 73% 29%, transparent 49%, #000 50%);
  mask-image: radial-gradient(circle at 73% 29%, transparent 49%, #000 50%);
}

.star {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  color: #fff;
  font: var(--size, 16px)/1 system-ui, sans-serif;
  text-shadow: 0 0 12px #ffffff80;
}

.star.point {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 5px #fff8;
}

.line {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: 1px;
  transform: rotate(var(--r));
  transform-origin: left center;
  background: #ffffff50;
}

.message { display: grid; justify-items: center; gap: clamp(11px, 1.9vh, 19px); }
h1 {
  font: 500 clamp(46px, 12.6vw, 78px)/.99 'Playfair Display', Georgia, serif;
  letter-spacing: -.055em;
}
h1 em { display: block; }
.lead {
  max-width: 34ch;
  color: var(--muted);
  font-size: clamp(15px, 3.6vw, 18px);
  text-wrap: balance;
}

.actions { width: min(100%, 316px); display: grid; justify-items: center; gap: 9px; }
.play {
  width: 100%;
  min-height: clamp(54px, 12vw, 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(165deg, #f0e4fb, var(--accent));
  color: var(--on-accent);
  box-shadow: 0 6px 24px #c6a4ff20, inset 0 1px #fffd;
  font: 600 clamp(15px, 3.7vw, 17px)/1.2 system-ui, sans-serif;
  cursor: pointer;
}
.play:hover { filter: brightness(1.05); }
.play:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }
.play-mark {
  display: grid;
  place-items: center;
  flex: 0 0 29px;
  height: 29px;
  border-radius: 50%;
  background: #39264c13;
}
.play-mark::after {
  content: '';
  margin-left: 2px;
  border-block: 5px solid transparent;
  border-left: 8px solid currentColor;
}
.play[data-playing="true"] .play-mark::after {
  width: 8px;
  height: 10px;
  margin-left: 0;
  border: solid currentColor;
  border-width: 0 3px;
}
.voice-position { width: 100%; }
.wave {
  --played: 0%;
  position: relative;
  height: 44px;
  padding: 0 9px;
  border-radius: 12px;
  background: #ffffff08;
}
.wave-bars {
  position: absolute;
  inset: 9px 10px;
  display: flex;
  align-items: center;
  gap: 2px;
  pointer-events: none;
}
.wave-bars > span {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 2px;
  background: currentColor;
}
.wave-base { color: #797080; }
.wave-played {
  color: var(--accent);
  clip-path: inset(0 calc(100% - var(--played)) 0 0);
}
.seek {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  inset: 0 4px;
  width: calc(100% - 8px);
  height: 100%;
  margin: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}
.seek::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 44px;
  background: transparent;
}
.seek::-moz-range-thumb { width: 12px; height: 44px; border: 0; background: transparent; }
.seek:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.voice-times {
  display: flex;
  justify-content: space-between;
  padding: 3px 2px 0;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.feedback { min-height: 1.5em; color: var(--muted); font-size: 13px; }

@media (max-height: 570px) {
  .night { gap: 10px; padding-block: 15px 12px; }
  .sky { width: min(100%, 280px); }
  h1 { font-size: clamp(40px, 11vw, 58px); }
  .message { gap: 9px; }
  .actions { gap: 5px; }
}
