:root {
  --text: #fff1f0;
  --text-soft: #f6d5dc;
  --accent: #ffc9d2;
  --gold: #f5c98b;
  --cream: #ffe3d8;
  --wine: #6a1238;
  --surface: #641541;
  --line: #d98bab;
  --serif: Georgia, "Noto Serif", "Times New Roman", serif;
  --bear-size: clamp(190px, 40vh, 350px);
  --bear-size: clamp(190px, 40svh, 350px);
  --px: 0;
  --look-x: 0;
  --look-y: 0;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: #3a0c2b; }

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* Фон */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(#2c0924 0%, #6d1745 46%, #b83a6b 74%, #e27a98 100%);
}

.moon {
  position: absolute;
  top: 78px;
  right: 9%;
  width: 52px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffe0d6;
  box-shadow: 0 0 0 16px rgb(255 185 196 / 14%), 0 0 60px 20px rgb(255 185 196 / 25%);
  animation: moon 6s ease-in-out infinite alternate;
}

.shooting-star {
  position: absolute;
  top: 50px;
  left: 60%;
  width: 70px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #fff, transparent);
  opacity: 0;
  animation: shooting 12s ease-in 4s infinite;
}

/* Звездопад, если выбрали прогулку под звёздами. */
.starfall { display: none; }
.with-starfall .starfall { display: block; }

.starfall i {
  position: absolute;
  top: calc(var(--n) * 7%);
  left: calc(25% + var(--n) * 11%);
  width: 80px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #fff6d5, transparent);
  opacity: 0;
  animation: starfall 3.2s ease-in calc(var(--n) * .43s) infinite;
}

.starfall i:nth-child(1) { --n: 1; }
.starfall i:nth-child(2) { --n: 5; }
.starfall i:nth-child(3) { --n: 3; }
.starfall i:nth-child(4) { --n: 7; }
.starfall i:nth-child(5) { --n: 2; }
.starfall i:nth-child(6) { --n: 6; }
.starfall i:nth-child(7) { --n: 4; }

.city { position: absolute; inset: 0; width: 100%; height: 100%; }
.layer { transition: transform .5s ease-out; }
.far { transform: translateX(calc(var(--px) * -8px)); }
.near { transform: translateX(calc(var(--px) * -20px)); }
.window { animation: window 8s steps(1) infinite; }
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flame 1.3s ease-in-out infinite alternate; }

.garland { position: absolute; top: 0; left: 0; width: 100%; height: 70px; overflow: visible; }
.bulb { filter: drop-shadow(0 0 5px #ffb85c); animation: bulb 2.4s ease-in-out infinite alternate; }

.petal {
  position: absolute;
  top: -24px;
  width: var(--size);
  height: calc(var(--size) * 1.25);
  border-radius: 80% 10% 80% 30%;
  background: linear-gradient(135deg, #ff9db3, #cf2c5f);
  opacity: .8;
  animation: petal linear infinite;
}

/* Экраны */
main {
  flex: 1;
  width: 100%;
  max-width: 560px;
  padding: 72px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.screen {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Части экрана появляются по очереди. */
.screen > * { animation: appear .6s cubic-bezier(.2, .8, .3, 1) backwards; }
.screen > :nth-child(2) { animation-delay: .1s; }
.screen > :nth-child(3) { animation-delay: .2s; }
.screen > :nth-child(4) { animation-delay: .3s; }
.screen > :nth-child(5) { animation-delay: .4s; }

.panel {
  padding: 18px 14px;
  border: 1px solid rgb(255 201 210 / 28%);
  border-radius: 24px;
  background: rgb(58 12 44 / 84%);
  box-shadow: 0 18px 50px rgb(28 4 20 / 45%);
}

h1 {
  max-width: 100%;
  margin: 0;
  font: 400 clamp(2rem, 8vw, 3.2rem)/1.15 var(--serif);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

h1:focus { outline: none; }
.panel h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); }
.word { display: inline-block; max-width: 100%; animation: word .7s ease-out calc(.25s + var(--i) * .16s) backwards; }

.intro { max-width: 30ch; margin: 0 0 14px; color: var(--accent); font-size: 1rem; line-height: 1.4; }
.text { max-width: 34ch; margin: 14px 0 18px; color: var(--text-soft); font-size: 1.05rem; line-height: 1.5; }

.progress { display: flex; align-items: center; margin-bottom: 10px; }
.progress i { color: #b5678a; font-size: 18px; font-style: normal; line-height: 1; transition: color .4s; }
.progress b { width: 34px; height: 2px; margin: 0 7px; background: #b5678a; transition: background-color .4s; }
.progress .done { color: var(--cream); background-color: var(--cream); }
.progress i.done { background: none; }
.progress .current { animation: heartbeat 1.4s ease-in-out infinite; }

/* Конверт */
.envelope {
  position: relative;
  width: min(250px, 78vw);
  aspect-ratio: 5 / 3.3;
  margin: 56px 0 14px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #d9a9a4;
  box-shadow: 0 18px 40px rgb(28 4 20 / 50%);
  cursor: pointer;
  perspective: 700px;
}

.envelope:not(.open) { animation: envelope 2.6s ease-in-out .8s infinite; }
.envelope:focus-visible { outline: 3px solid #fff; outline-offset: 6px; }
.envelope span { position: absolute; display: block; }

.envelope-paper {
  inset: 7% 6% 6%;
  z-index: 2;
  padding-top: 6%;
  border-radius: 8px;
  background: #fffaf5;
  color: #d3265b;
  font-size: 2.2rem;
  transition: transform .7s cubic-bezier(.2, .9, .3, 1) .4s;
}

.envelope-pocket {
  inset: 0;
  z-index: 3;
  border-radius: 12px;
  background: linear-gradient(160deg, #ffeadf, #f2c9bf);
  clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
}

.envelope-flap {
  inset: 0 0 38%;
  z-index: 4;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(#fff0e7, #eebcb4);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top;
  transition: transform .5s ease-in, z-index 0s .25s;
}

.envelope-seal {
  top: 60%;
  left: 50%;
  z-index: 5;
  width: 50px;
  height: 50px;
  margin: -25px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ef4f7d, #a81445);
  box-shadow: 0 4px 10px rgb(90 10 50 / 45%);
  color: var(--cream);
  font-size: 24px;
  line-height: 50px;
  transition: transform .3s, opacity .3s;
}

.envelope:hover .envelope-seal { transform: scale(1.12); }
.envelope.open .envelope-seal { transform: scale(1.8); opacity: 0; }
.envelope.open .envelope-flap { z-index: 1; transform: rotateX(180deg); }
.envelope.open .envelope-paper { transform: translateY(-52%); }

/* Письмо выезжает поверх заголовка, поэтому текст в это время исчезает. */
[data-screen="letter"] :is(h1, .text) { transition: opacity .3s; }
[data-screen="letter"]:has(.open) :is(h1, .text) { opacity: 0; }

/* Кнопки */
.answers { margin-top: 26px; display: flex; flex-direction: column; align-items: center; gap: 12px; }

.button {
  min-height: 50px;
  max-width: calc(100vw - 32px);
  padding: 12px 28px;
  border: 1px solid transparent;
  border-radius: 16px;
  font: inherit;
  font-size: 1.06rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
a.button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

.primary {
  position: relative;
  overflow: hidden;
  background: var(--cream);
  color: var(--wine);
  box-shadow: 0 8px 28px rgb(255 200 200 / 25%);
  transition: transform .2s;
}

/* Блик, который пробегает по кнопке. */
.primary::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgb(255 255 255 / 85%), transparent);
  animation: shine 4.5s ease-in-out infinite;
  pointer-events: none;
}

.primary:hover { transform: translateY(-2px) scale(1.03); }
.primary:active { transform: scale(.97); }
.glowing { animation: glowing 2s ease-in-out infinite; }
.secondary { background: var(--surface); border-color: var(--line); color: var(--text); }

.no-slot { position: relative; z-index: 5; }
#no { position: relative; transition: transform .32s cubic-bezier(.2, 1.3, .4, 1), opacity .2s; }
#no.away { opacity: 0; transform: scale(.4); pointer-events: none; }
/* Когда кнопка уменьшилась, по ней всё равно можно попасть. */
#no.small::after { content: ""; position: absolute; inset: -10px -24px; }
#yes { transition: transform .2s, scale .35s cubic-bezier(.2, 1.3, .4, 1); }

/* Без анимации: иначе копии отсчитывали бы место не от края экрана. */
.screen > .no-clones { position: relative; z-index: 4; animation: none; }
.no-clone { position: fixed; animation: clone .35s cubic-bezier(.2, 1.4, .4, 1) backwards; }

.kiss {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 132px;
  margin-left: -66px;
  filter: drop-shadow(0 6px 12px rgb(28 4 20 / 45%));
  opacity: 0;
  transform: scale(.3) rotate(-18deg);
  transition: opacity .2s, transform .4s cubic-bezier(.2, 1.5, .4, 1);
  pointer-events: none;
}

.kiss.show { opacity: 1; transform: rotate(-5deg); }
.kiss-heart { transform-box: fill-box; transform-origin: center; }
.kiss.show .kiss-heart { animation: heartbeat .7s ease-in-out infinite; }

/* Кнопка музыки */
.sound {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  right: 10px;
  z-index: 7;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--cream);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.sound:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.sound[aria-pressed="true"] { animation: glowing 2s ease-in-out infinite; }
.sound[aria-pressed="false"]::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 9px;
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--cream);
  transform: rotate(-45deg);
}

/* Выбор */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.group { width: 100%; min-width: 0; max-width: 460px; margin: 12px 0 0; padding: 0; border: 0; }
.group legend { width: 100%; margin-bottom: 8px; padding: 0; color: var(--accent); font-weight: 600; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.times { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.activities { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.custom { margin-top: 8px; }

.option { position: relative; display: block; cursor: pointer; }

.option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}

.option-face {
  height: 100%;
  min-height: 44px;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #a75a80;
  border-radius: 13px;
  background: var(--surface);
  font-weight: 600;
  line-height: 1.2;
  transition: background-color .2s, color .2s, transform .2s;
}

.option-face small { font-size: .75rem; font-weight: 400; }
.option:hover input:enabled + .option-face { transform: translateY(-2px); border-color: var(--cream); }
.option input:checked + .option-face { background: var(--cream); border-color: var(--cream); color: var(--wine); animation: pop .35s ease-out; }
.option input:focus-visible + .option-face { outline: 3px solid #fff; outline-offset: 2px; }
.option input:disabled { cursor: not-allowed; }
.option input:disabled + .option-face { opacity: .45; text-decoration: line-through; }
.custom .option-face { border-style: dashed; }

.activities .option-face {
  min-height: 58px;
  padding: 6px 24px 6px 8px;
  flex-direction: row;
  justify-content: flex-start;
  gap: 8px;
  font-size: .95rem;
  text-align: left;
  overflow-wrap: anywhere;
}

/* Фон выбранной карточки тёмный, чтобы была видна жёлтая звезда. */
.activities .option input:checked + .option-face {
  background: #93285d;
  box-shadow: 0 0 0 1px var(--cream);
  color: var(--text);
}

.activities .option input:checked + .option-face::after {
  content: "♥";
  position: absolute;
  top: 5px;
  right: 8px;
  color: var(--cream);
}

.emoji { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; font-size: 30px; line-height: 1; }
.emoji img { width: 100%; height: 100%; }
.emoji > span { display: none; }
.emoji.no-image img { display: none; }
.emoji.no-image > span { display: inline; }
.option input:checked + .option-face .emoji { animation: wiggle .6s ease-in-out; }

.field {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff5f1;
  color: #4a0f30;
  color-scheme: light;
  font: inherit;
  font-size: 1rem;
  resize: none;
}

.field:focus-visible { outline: 3px solid #ff9db3; outline-offset: 1px; }
.hint { min-height: 1.4em; margin: 8px 0; color: #ffd9c2; font-weight: 600; line-height: 1.4; }
.nav { display: flex; justify-content: center; gap: 10px; }

/* Финал и отправка */
.final-head { max-width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
.final-head h1 { font-size: clamp(1.35rem, 5.6vw, 2.2rem); }

.ticket {
  position: relative;
  width: min(100%, 380px);
  margin: 14px 0 16px;
  padding: 4px 22px;
  border-radius: 16px;
  background: linear-gradient(150deg, #fff6ef, #ffdcd2);
  color: #4a0f30;
  box-shadow: 0 10px 30px rgb(28 4 20 / 40%);
}

.screen > .ticket { animation: ticket .9s cubic-bezier(.2, 1.1, .3, 1) .25s backwards; }
.ticket::before, .ticket::after {
  content: "";
  position: absolute;
  top: calc(50% - 9px);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3f0f30;
}
.ticket::before { left: -9px; }
.ticket::after { right: -9px; }
.ticket p { margin: 0; padding: 10px 0; font: 400 1.15rem/1.35 var(--serif); overflow-wrap: anywhere; }
.ticket p + p { border-top: 2px dashed #d99aa5; }
.ticket small { display: block; color: #8f2450; font: 600 .78rem/1.4 "Segoe UI", system-ui, sans-serif; }

.countdown-box { width: min(100%, 380px); margin-bottom: 16px; }
.countdown-box p { margin: 0 0 8px; color: var(--accent); font-weight: 600; }
.countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.countdown span { padding: 7px 2px; border: 1px solid #a75a80; border-radius: 13px; background: var(--surface); }
.countdown strong { display: block; font: 400 1.5rem/1.15 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.countdown small { color: var(--text-soft); font-size: .72rem; }

.calendar { width: 100%; margin-bottom: 10px; }
.calendar summary { width: min(100%, 270px); margin: 0 auto; list-style: none; }
.calendar summary::-webkit-details-marker { display: none; }
.calendar-links { padding: 4px 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 18px; }
.calendar-links a { padding: 10px 4px; color: var(--cream); }
.calendar-links a:focus-visible { outline: 3px solid #fff; }

[data-reply] { width: 100%; }
.reply { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.reply .button { width: min(100%, 270px); }
.reply-note { max-width: 40ch; margin: 2px 0 0; color: var(--text-soft); font-size: .92rem; line-height: 1.4; }
.reply .field { max-width: 380px; margin: 0; }
.reply .hint { margin: 0 0 4px; }

/* Мишка */
.bear-box { position: relative; flex: none; width: var(--bear-size); height: var(--bear-size); }

.bear-button {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 40%;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

.bear-button:focus-visible { outline: 3px solid #fff; }
.bear { display: block; width: 100%; height: 100%; overflow: visible; }
.bear g { transform-box: view-box; }

.bubble {
  position: absolute;
  bottom: 88%;
  left: 50%;
  z-index: 6;
  width: max-content;
  max-width: min(270px, 88vw);
  margin: 0;
  padding: 9px 15px;
  border-radius: 16px;
  background: #fffaf5;
  box-shadow: 0 8px 24px rgb(28 4 20 / 40%);
  color: #4a0f30;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 10px) scale(.85);
  transition: opacity .25s, transform .3s cubic-bezier(.2, 1.4, .4, 1);
  pointer-events: none;
}

.bubble.show { opacity: 1; transform: translate(-50%, 0); }

.torso { transform-origin: 160px 300px; animation: breathe 3.2s ease-in-out infinite; }
.wave { transform-origin: 212px 232px; animation: wave 3.4s ease-in-out infinite; }
.scarf-tail { transform-origin: 200px 205px; animation: scarf 2.6s ease-in-out infinite alternate; }
.head { transform-origin: 160px 195px; transform: rotate(calc(var(--look-x) * 3deg)); transition: transform .4s; }
.face { transform: translate(calc(var(--look-x) * 7px), calc(var(--look-y) * 5px)); transition: transform .25s ease-out; }
.eyes-open { transform-origin: 160px 134px; animation: blink 4.5s infinite; }
.ear { transition: transform .35s; }
.ear-left { transform-origin: 104px 88px; }
.ear-right { transform-origin: 216px 88px; animation: ear 6s ease-in-out infinite; }
.blush { opacity: .6; transition: opacity .3s; }
body[data-current="letter"] .bear-letter, .has-prop .bear-letter, .prop { display: none; }
.prop.show { display: inline; animation: prop .5s cubic-bezier(.2, 1.5, .4, 1); }
.steam { animation: steam 1.8s ease-in-out infinite alternate; }
.star-glow { animation: star 1.4s ease-in-out infinite alternate; }

.mouth { fill: none; stroke: #33213f; stroke-width: 3.5; }
.mouth-happy { fill: #e0567a; }
.mouth-sad, .mouth-happy, .eyes-happy, .sad-only { display: none; }

.bear[data-mood="sad"] .mouth-idle,
.bear:is([data-mood="happy"], [data-mood="love"]) :is(.mouth-idle, .eyes-open) { display: none; }
.bear[data-mood="sad"] :is(.mouth-sad, .sad-only),
.bear:is([data-mood="happy"], [data-mood="love"]) :is(.mouth-happy, .eyes-happy) { display: inline; }

.bear[data-mood="sad"] .head { transform: translateY(5px) rotate(-4deg); }
.bear[data-mood="sad"] .ear-left { transform: translate(-5px, 12px); }
.bear[data-mood="sad"] .ear-right { transform: translate(5px, 12px); animation: none; }
.bear[data-mood="sad"] .wave { animation-play-state: paused; }
.bear[data-mood="sad"] .tear { animation: tear 1.2s ease-in infinite; }
.bear:is([data-mood="happy"], [data-mood="love"]) .blush { opacity: 1; }
.bear[data-mood="happy"] .bear-all { animation: jump .65s ease-in-out 4; }
.bear[data-mood="happy"] .wave { animation-duration: 1s; }
.bear[data-mood="love"] .head { animation: cuddle .8s ease-in-out 2; }

.particles { position: fixed; inset: 0; z-index: 10; overflow: hidden; pointer-events: none; }

.particle {
  position: absolute;
  color: var(--color);
  font-size: var(--size);
  line-height: 1;
  animation: burst 1.4s cubic-bezier(.15, .7, .4, 1) both;
}

.particle-petal {
  width: var(--size);
  height: calc(var(--size) * 1.2);
  border-radius: 80% 10% 80% 30%;
  background: var(--color);
}

.credits {
  position: relative;
  padding: 4px 16px max(8px, env(safe-area-inset-bottom));
  color: #f3cfd8;
  font-size: .72rem;
  text-align: center;
}

.credits a { color: inherit; }

.credits summary {
  width: 32px;
  margin: 0 auto;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 26px;
  list-style: none;
  opacity: .6;
  cursor: pointer;
}

.credits summary::-webkit-details-marker { display: none; }
.credits summary:is(:hover, :focus-visible), .credits [open] summary { opacity: 1; }
.credits summary:focus-visible { outline: 2px solid #fff; }

/* На экранах с панелью мишка сидит на её верхнем краю: так видно, что у него в лапе. */
body:is([data-current="when"], [data-current="activity"], [data-current="final"], [data-current="decline"]) {
  --bear-size: clamp(120px, 20vh, 180px);
}

.progress { order: -2; margin: 58px 0 0; }
body:is([data-current="when"], [data-current="activity"], [data-current="final"], [data-current="decline"]) .bear-box {
  order: -1;
  z-index: 2;
  margin-bottom: -10px;
}
body:is([data-current="when"], [data-current="activity"], [data-current="final"], [data-current="decline"]) main {
  flex: none;
  padding-top: 0;
}
.credits { margin-top: auto; }
body[data-current="decline"] .bear-box { margin-top: 58px; }

@keyframes appear { from { opacity: 0; transform: translateY(18px); } }
@keyframes word { from { opacity: 0; filter: blur(6px); transform: translateY(14px); } }
@keyframes moon { to { box-shadow: 0 0 0 22px rgb(255 185 196 / 9%), 0 0 80px 30px rgb(255 185 196 / 32%); } }
@keyframes shooting {
  0% { opacity: 0; transform: rotate(-10deg) translateX(0); }
  2% { opacity: 1; }
  8%, 100% { opacity: 0; transform: rotate(-10deg) translateX(-220px); }
}
@keyframes window { 0%, 100% { opacity: .75; } 45% { opacity: .12; } 80% { opacity: .75; } }
@keyframes flame { from { transform: scale(.9, .88) rotate(-3deg); } to { transform: scale(1.05, 1.15) rotate(3deg); } }
@keyframes bulb { from { opacity: .45; } to { opacity: 1; } }
@keyframes petal {
  from { transform: translate(0, -5vh) rotate(0) rotateY(0); }
  50% { transform: translate(var(--sway), 52vh) rotate(200deg) rotateY(180deg); }
  to { transform: translate(0, 110vh) rotate(400deg) rotateY(360deg); }
}
@keyframes heartbeat { 0%, 50%, 100% { transform: scale(1); } 20% { transform: scale(1.35); } }
@keyframes envelope {
  0%, 60%, 100% { transform: none; }
  68%, 84% { transform: rotate(-2.5deg) translateY(-4px); }
  76%, 92% { transform: rotate(2.5deg) translateY(-4px); }
}
@keyframes shine { 0%, 65% { left: -60%; } 90%, 100% { left: 130%; } }
@keyframes glowing { 50% { box-shadow: 0 8px 40px 6px rgb(255 200 200 / 50%); } }
@keyframes starfall {
  0% { opacity: 0; transform: rotate(-32deg) translateX(0); }
  8% { opacity: 1; }
  35%, 100% { opacity: 0; transform: rotate(-32deg) translateX(-300px); }
}
@keyframes prop { from { opacity: 0; transform: translateY(16px) scale(.3) rotate(-20deg); } }
@keyframes steam { from { opacity: .3; transform: translateY(3px); } to { opacity: 1; transform: translateY(-3px); } }
@keyframes star { to { filter: drop-shadow(0 0 7px #ffd45e); } }
@keyframes clone { from { opacity: 0; transform: scale(.2); } }
@keyframes pop { 40% { transform: scale(1.08); } }
@keyframes wiggle { 25% { transform: rotate(-14deg) scale(1.15); } 75% { transform: rotate(14deg) scale(1.15); } }
@keyframes ticket { from { opacity: 0; transform: perspective(700px) rotateX(-75deg) scale(.8); } }
@keyframes breathe { 50% { transform: scale(1.015, 1.025); } }
@keyframes wave {
  0%, 50%, 100% { transform: rotate(0); }
  60%, 80% { transform: rotate(-22deg); }
  70%, 90% { transform: rotate(6deg); }
}
@keyframes scarf { from { transform: rotate(-3deg); } to { transform: rotate(6deg); } }
@keyframes ear { 0%, 88%, 94%, 100% { transform: rotate(0); } 91%, 97% { transform: rotate(9deg); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.08); } }
@keyframes tear { from { transform: translateY(0); } to { transform: translateY(16px); opacity: 0; } }
@keyframes jump { 50% { transform: translateY(-22px); } }
@keyframes cuddle { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes burst {
  from { opacity: 1; transform: translate(-50%, -50%) scale(.3); }
  60% { opacity: 1; }
  to { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y) + 30px)) rotate(var(--turn)); }
}

@media (max-width: 480px) {
  /* Эмодзи над названием, чтобы длинные слова не разрывались. */
  .activities .option-face {
    padding: 7px 4px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    font-size: .88rem;
    text-align: center;
  }
  .activities .emoji { width: 34px; height: 34px; font-size: 27px; }

  /* На телефоне луна мешала бы тексту. */
  .moon { top: 62px; right: 18px; width: 30px; }
  body:not([data-current="question"]) .moon { display: none; }
}

@media (max-height: 620px) {
  :root { --bear-size: 180px; }
  main { padding-top: 58px; }
  .answers { margin-top: 16px; }
  .envelope { width: 190px; margin-top: 50px; }
  .moon { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .petal, .shooting-star, .with-starfall .starfall, .primary::after { display: none; }
  .emoji img { display: none; }
  .emoji > span { display: inline; }
}
