/* ---------- тема ---------- */
:root {
  --ink: #33281f;
  --muted: #7d6e63;
  --rose: #e0436a;
  --rose-2: #f58aa3;
  --leaf: #5f9a6a;
  --paper: #fff9f0;
  --paper-2: #fff0e2;
  --line: #eedfcc;
  --shadow: 0 22px 50px rgba(40, 30, 90, .25), 0 4px 12px rgba(40, 30, 90, .12);
  --hand: "Caveat", "Segoe Print", cursive;
  --ui: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --fg-h: clamp(170px, 27vh, 360px);
  --daisy: min(70vw, 36vh, 400px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: #5a78c6; color: var(--ink); font: 16px/1.45 var(--ui); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.hidden { display: none !important; }

/* ---------- живой фон ---------- */
#scene { position: fixed; inset: 0; overflow: hidden; z-index: 0; }
.plate img { position: absolute; inset: -3%; width: 106%; height: 106%; object-fit: cover; object-position: 50% 100%;
  transform: translate3d(var(--px0, 0), var(--py0, 0), 0); transition: filter 1.2s ease; }
.clouds { position: absolute; inset: 0; transform: translate3d(var(--px1, 0), var(--py1, 0), 0); }
.cloud { position: absolute; left: 0; will-change: transform; animation: drift linear infinite; }
@keyframes drift { from { transform: translateX(var(--from)); } to { transform: translateX(var(--to)); } }

.couple { position: absolute; left: 9%; bottom: calc(var(--fg-h) * .78); height: clamp(64px, 10.5vh, 120px);
  transform: translate3d(var(--px2, 0), 0, 0); transition: opacity .8s; }
.couple img { height: 100%; display: block; transform-origin: 50% 100%; animation: breathe 4.5s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform: scale(1, 1); } 50% { transform: scale(1.01, 1.025); } }
@media (min-aspect-ratio: 1/1) { .couple { left: 12%; bottom: calc(var(--fg-h) * .82); } }
.heart { position: absolute; left: 44%; top: 4%; font-size: 15px; color: #ff7c9c; pointer-events: none; text-shadow: 0 1px 2px rgba(120,20,60,.25);
  animation: heartUp 3.2s ease-out forwards; }
@keyframes heartUp {
  0% { transform: translate(0, 0) scale(.3); opacity: 0; }
  15% { opacity: 1; transform: translate(-3px, -8px) scale(1); }
  50% { transform: translate(6px, -34px) scale(1); }
  100% { transform: translate(-4px, -70px) scale(.8); opacity: 0; }
}

.butterflies { position: absolute; inset: 0; pointer-events: none; }
.bfly { position: absolute; left: 0; top: 0; width: 38px; will-change: transform; filter: drop-shadow(0 6px 4px rgba(40,30,80,.18)); }

#fgLayer { position: fixed; left: 0; right: 0; bottom: 0; height: 0; z-index: 15; pointer-events: none; transform: translate3d(var(--px3, 0), 0, 0); }
#fgLayer img { position: absolute; bottom: -8px; left: 50%; width: max(118vw, calc(var(--fg-h) * 4.58)); height: auto; translate: -50% 0;
  transform-origin: 50% 100%; animation: sway 7s ease-in-out infinite; }
@keyframes sway { 0%,100% { transform: skewX(-1.2deg); } 50% { transform: skewX(1.2deg); } }
body.questing #fgLayer { z-index: 5; }
body.questing #fgLayer img { width: max(118vw, calc(var(--fg-h) * 3.4)); }

#fx, #fxBack { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }
#fxBack { z-index: 20; }

body.questing .plate img { filter: saturate(.92) brightness(1.03) blur(2px); }
body.questing .couple { opacity: 0; }

.sound { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 50; width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.75); color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 14px rgba(30,30,80,.18);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: transform .15s; }
.sound:active { transform: scale(.92); }
.sound .cross { display: none; }
.sound.off .wave { display: none; }
.sound.off .cross { display: inline; }

/* ---------- A: ромашка ---------- */
.screen { position: relative; width: 100%; overflow-x: clip; min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(var(--fg-h) * .62); }
.intro-head { position: relative; z-index: 12; max-width: 100%; text-align: center; color: #fffaf0; text-shadow: 0 2px 12px rgba(40, 30, 90, .35); }
.kicker { font-size: 12px; letter-spacing: .24em; font-weight: 800; opacity: .85; animation: fadeDown 1s .1s both; }
.kicker span { opacity: .7; }
h1 { margin: 2px 0 0; line-height: 0; }
.title-img { width: var(--title-w, min(76vw, 470px)); height: auto; filter: drop-shadow(0 8px 14px rgba(60, 30, 90, .25));
  animation: titleIn 1.4s .2s cubic-bezier(.2,1.3,.35,1) both, floaty 6s 1.6s ease-in-out infinite; }
@keyframes titleIn { from { opacity: 0; transform: translateY(-18px) scale(.9) rotate(-2deg); filter: blur(6px); } }
@keyframes floaty { 0%,100% { translate: 0 0; } 50% { translate: 0 -4px; } }
.sub { margin: 4px auto 0; max-width: 330px; font-weight: 700; font-size: 15px; line-height: 1.4; opacity: .95; animation: fadeDown 1s .7s both; }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-10px); } }

.daisy-stage { position: relative; z-index: 12; flex: 1; width: 100%; display: grid; place-items: center; min-height: calc(var(--daisy) + 10px); }
.daisy { position: relative; width: var(--daisy); height: var(--daisy); transform-origin: 50% calc(50% + 70vh); will-change: transform;
  animation: grow 1.6s .5s cubic-bezier(.2,1.25,.35,1) both; }
@keyframes grow { from { transform: translateY(40vh) scale(.6); opacity: 0; } }
.stem { position: absolute; left: 50%; top: 50%; width: calc(var(--daisy) * .14); height: 70vh; translate: -50% 0; object-fit: fill; filter: drop-shadow(0 4px 6px rgba(20,50,30,.2)); }
.petals { position: absolute; inset: 0; }
.petal { position: absolute; left: 50%; top: 50%; width: calc(var(--daisy) * .2); height: calc(var(--daisy) * .45);
  margin-left: calc(var(--daisy) * -.1); margin-top: calc(var(--daisy) * -.45);
  transform-origin: 50% 100%; transform: rotate(var(--a)) translateY(calc(var(--daisy) * -.06)); cursor: pointer; outline: none; }
.petal img { width: 100%; height: 100%; display: block; object-fit: fill; transform-origin: 50% 100%; transition: transform .25s cubic-bezier(.3,1.6,.5,1);
  filter: drop-shadow(0 3px 3px rgba(60, 40, 90, .18)); pointer-events: none; }
.petal:hover img, .petal:focus-visible img { transform: scale(1.06, 1.05); }
.petal.tug img { transform: translateY(-6%) scale(.96, 1.1); transition: transform .14s ease-out; }
.petal.gone { visibility: hidden; pointer-events: none; }
.petal.tease img { animation: tease 1.8s ease-in-out infinite; }
@keyframes tease { 0%,100% { transform: rotate(0) scale(1); } 30% { transform: rotate(-4deg) scale(1.05); } 60% { transform: rotate(4deg) scale(1.05); } }
.core { position: absolute; left: 50%; top: 50%; width: calc(var(--daisy) * .36); translate: -50% -50%; pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(120, 60, 10, .3)); }

.intro-foot { position: relative; z-index: 16; text-align: center; margin-top: 8px; padding: 8px 18px 9px; border-radius: 22px;
  background: rgba(255, 248, 236, .8); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 6px 18px rgba(40,30,90,.15);
  animation: fadeDown .8s 1.6s both; transition: transform .3s; }
.intro-foot.bump { animation: bump .45s cubic-bezier(.3,1.8,.5,1); }
@keyframes bump { 40% { transform: scale(1.08); } }
.counter { font-family: var(--hand); font-size: 32px; font-weight: 700; line-height: 1; color: var(--muted); }
.counter:empty { display: none; }
.counter b { color: var(--rose); font-weight: 700; }
.hint { font-size: 14px; font-weight: 800; color: var(--ink); opacity: .8; }

/* ---------- карточка лепестка ---------- */
.sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(30, 25, 70, .35); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .35s; padding: 0 0 env(safe-area-inset-bottom); }
.sheet.show { opacity: 1; pointer-events: auto; }
@media (min-width: 720px) { .sheet { align-items: center; } }
.sheet-card { width: min(100%, 430px); max-height: 100dvh; overflow-y: auto; background: var(--paper); border-radius: 28px 28px 0 0; padding: 20px 20px 22px;
  box-shadow: var(--shadow); transform: translateY(60px); transition: transform .5s cubic-bezier(.2,1.2,.3,1); position: relative; }
@media (min-width: 720px) { .sheet-card { border-radius: 28px; } }
.sheet.show .sheet-card { transform: none; }

.polaroid { background: #fff; padding: 10px 10px 40px; border-radius: 6px; box-shadow: 0 12px 26px rgba(50,40,60,.18);
  rotate: var(--r, -2deg); margin: 6px auto 0; width: min(100%, 320px); position: relative; animation: drop .7s .1s cubic-bezier(.2,1.3,.4,1) both; }
.polaroid img { width: 100%; aspect-ratio: 1 / 1.08; object-fit: cover; display: block; border-radius: 3px; background: #eee; }
.polaroid .cap { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-family: var(--hand); font-weight: 700; font-size: 28px; color: var(--ink); }
.polaroid::before { content: ""; position: absolute; top: -11px; left: 50%; width: 90px; height: 24px; translate: -50% 0; rotate: 3deg;
  background: rgba(255, 228, 150, .8); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
@keyframes drop { from { opacity: 0; transform: translateY(-40px) rotate(8deg) scale(.9); } }
.petal-no { text-align: center; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; font-weight: 800; color: var(--muted); margin-top: 16px; }
.word { font-family: var(--hand); font-weight: 700; font-size: 52px; line-height: 1; text-align: center; margin: 2px 0 4px; animation: wordIn .6s .35s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes wordIn { from { opacity: 0; transform: scale(.6) rotate(-4deg); } }
.word.yes { color: var(--rose); }
.word.no { color: var(--muted); }
.word.final { font-size: 76px; }
.phrase { text-align: center; font-size: 18px; margin: 0 0 18px; font-weight: 700; animation: fadeDown .6s .5s both; }

.btn { display: block; width: 100%; border: 0; border-radius: 16px; padding: 16px 18px; background: var(--ink); color: #fff;
  font-weight: 800; font-size: 16px; cursor: pointer; transition: transform .15s, box-shadow .2s; box-shadow: 0 6px 16px rgba(40,30,20,.18); }
.btn:active { transform: scale(.97); }
.btn.rose { background: linear-gradient(180deg, var(--rose-2), var(--rose)); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: none; border: 2px solid var(--line); }
.btn.link { display: inline-flex; width: auto; padding: 11px 16px; font-size: 15px; background: #fff; color: var(--ink); border: 2px solid var(--line); box-shadow: none; text-decoration: none; gap: 8px; align-items: center; }
.btn.shine { position: relative; overflow: hidden; }
.btn.shine::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  translate: -100% 0; animation: shine 2.6s 1s ease-in-out infinite; }
@keyframes shine { 40%, 100% { translate: 100% 0; } }

/* переход */
.bloom { position: fixed; z-index: 35; border-radius: 50%; pointer-events: none; translate: -50% -50%;
  background: radial-gradient(circle, #fff6cf 0%, #ffd965 40%, #f4b62d 75%, #e39a1a 100%); transition: scale 1.4s cubic-bezier(.75,0,.25,1); }
.rays { position: fixed; z-index: 34; pointer-events: none; translate: -50% -50%; border-radius: 50%;
  background: repeating-conic-gradient(rgba(255,240,200,.6) 0 7deg, rgba(255,255,255,0) 7deg 20deg);
  mask: radial-gradient(circle, #000 20%, transparent 70%); -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%);
  animation: spin 7s linear infinite; opacity: 0; transition: opacity .5s, scale 1.6s cubic-bezier(.3,0,.2,1); }
@keyframes spin { to { rotate: 360deg; } }
.veil { position: fixed; inset: 0; z-index: 36; background: #fff4dc; opacity: 0; pointer-events: none; transition: opacity .8s ease; }

/* ---------- B: квест ---------- */
.q-head, .step-box, .credit { position: relative; z-index: 12; }
.q-head { width: min(100%, 470px); display: flex; align-items: center; gap: 12px; margin: 2px 0 14px; color: #fffaf0; text-shadow: 0 2px 10px rgba(40,30,90,.35); padding-right: 50px; }
.q-head svg { width: 60px; height: 60px; flex: none; overflow: visible; filter: drop-shadow(0 4px 8px rgba(30,40,80,.25)); }
.q-text { flex: 1; min-width: 0; }
.q-title { font-family: var(--hand); font-weight: 700; font-size: 28px; line-height: 1; }
.q-sub { font-size: 13px; font-weight: 700; opacity: .85; margin-top: 4px; }
.q-count { font-family: var(--hand); font-weight: 700; font-size: 28px; padding: 2px 12px; border-radius: 999px; background: rgba(255,255,255,.7); color: var(--ink); text-shadow: none; }
.q-count.bump { animation: bump .45s cubic-bezier(.3,1.8,.5,1); }
.mini-petal { opacity: .25; transform-box: view-box; transform-origin: 0 0; transition: opacity .4s; }
.mini-petal.on { opacity: 1; animation: regrow .9s cubic-bezier(.2,1.7,.4,1); }
@keyframes regrow { from { transform: rotate(var(--r)) scale(.1); } to { transform: rotate(var(--r)) scale(1); } }

.step-box { width: min(100%, 470px); }
.step { background: var(--paper); border-radius: 28px; padding: 20px 18px 22px; box-shadow: var(--shadow); animation: rise .7s cubic-bezier(.2,1.2,.3,1) both; position: relative; }
@keyframes rise { from { opacity: 0; transform: translateY(30px) scale(.96); } }
.step.leave { animation: leave .35s ease-in both; }
@keyframes leave { to { opacity: 0; transform: translateY(-18px) scale(.97); } }
.step .n { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.step h2 { font-family: var(--hand); font-weight: 700; font-size: 34px; line-height: 1.05; margin: 6px 0 16px; }
.opts { display: grid; gap: 10px; }
.opt { text-align: left; border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 14px 16px; font-size: 17px; font-weight: 700;
  cursor: pointer; transition: transform .15s, border-color .2s, background .2s, opacity .3s; word-break: break-word; animation: rise .5s both; }
.opt:nth-child(2) { animation-delay: .08s; } .opt:nth-child(3) { animation-delay: .16s; }
.opt:active { transform: scale(.98); }
.opt.wrong { animation: shake .45s; border-color: #efb3bd; opacity: .45; pointer-events: none; }
.opt.right { border-color: var(--leaf); background: #eef6ea; }
@keyframes shake { 20%,60% { transform: translateX(-7px); } 40%,80% { transform: translateX(7px); } }
.msg { min-height: 22px; color: var(--muted); font-size: 15px; font-weight: 700; margin-top: 12px; text-align: center; }

.gift { border-radius: 22px; padding: 18px 18px 20px; margin-top: 16px; background: linear-gradient(165deg, #fff3dc, #ffe4ec); animation: giftIn .8s cubic-bezier(.2,1.4,.4,1) both; position: relative; overflow: hidden; }
@keyframes giftIn { from { opacity: 0; transform: scale(.85) translateY(20px); } }
.gift .tag { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--rose); font-weight: 800; }
.gift h3 { font-family: var(--hand); font-weight: 700; font-size: 38px; line-height: 1; margin: 4px 0 10px; }
.gift p { margin: 0 0 12px; font-size: 16px; }
.gift .small { font-size: 14px; color: var(--muted); }
.gift-art { display: block; width: min(78%, 300px); margin: 0 auto 8px; filter: drop-shadow(0 10px 14px rgba(80,40,60,.18)); animation: artIn .9s .15s cubic-bezier(.2,1.5,.4,1) both, floaty 5s 1s ease-in-out infinite; }
@keyframes artIn { from { opacity: 0; transform: scale(.5) rotate(-8deg); } }
.gift .row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.gap { height: 6px; }

/* письмо */
.env-wrap { position: relative; height: 230px; display: grid; place-items: center; transition: height .6s ease; }
.envelope { position: relative; width: min(92%, 300px); aspect-ratio: 1.55; cursor: pointer; perspective: 800px; transition: transform .6s ease, opacity .5s ease; }
.envelope:not(.open) { animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%,78%,100% { rotate: 0deg; } 84% { rotate: -3deg; } 90% { rotate: 3deg; } 95% { rotate: -1.5deg; } }
.env-back { position: absolute; inset: 0; background: #e9a991; border-radius: 10px; box-shadow: 0 14px 26px rgba(80,40,30,.22); }
.env-letter { position: absolute; left: 6%; right: 6%; top: 6%; height: 88%; z-index: 2; background: #fffdf7; border-radius: 6px; padding: 12% 10% 0;
  background-image: repeating-linear-gradient(transparent 0 13px, rgba(120,150,200,.25) 13px 14px); background-clip: content-box;
  transition: transform .8s cubic-bezier(.3,1.25,.4,1); }
.env-pocket { position: absolute; inset: 0; z-index: 3; border-radius: 10px; pointer-events: none;
  background: linear-gradient(180deg, #f6c6b2, #efb39c); clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%); }
.env-flap { position: absolute; left: 0; right: 0; top: 0; height: 62%; z-index: 4; transform-origin: 50% 0; transform-style: preserve-3d; }
.env-flap i { position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 50% 100%); background: linear-gradient(180deg, #f2b8a2, #e7a088); border-radius: 10px 10px 0 0; }
/* после переворота видна изнанка клапана: тот же треугольник, вершиной вверх, светлее */
.envelope.open .env-flap i { animation: flapInside .7s .2s steps(1, end) forwards; }
@keyframes flapInside { 50%, 100% { background: linear-gradient(0deg, #fadbcd, #f4c6b3); } }
.env-seal { position: absolute; left: 50%; top: 58%; translate: -50% -50%; width: 50px; height: 50px; z-index: 5; transition: transform .35s cubic-bezier(.5,-.6,.6,1), opacity .3s; }
.envelope.open .env-seal { transform: scale(1.5); opacity: 0; }
.envelope.open .env-flap { animation: flapOpen .7s .2s ease-in-out forwards; }
@keyframes flapOpen { 0% { transform: rotateX(0); z-index: 4; } 49% { z-index: 4; } 50% { z-index: 1; } 100% { transform: rotateX(180deg); z-index: 1; } }
.envelope.open .env-letter { transform: translateY(-62%); transition-delay: .85s; }
.envelope.out { transform: translateY(40px) scale(.9); opacity: 0; }
.letter { font-family: var(--hand); font-size: 25px; line-height: 1.32; background: #fffdf7; border-radius: 14px; padding: 18px 18px 14px; border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(80,50,30,.12); background-image: repeating-linear-gradient(transparent 0 32px, rgba(120,150,200,.2) 32px 33px); background-position: 0 14px;
  transform-origin: 50% 0; animation: unfold .8s cubic-bezier(.2,1.2,.3,1) both; }
@keyframes unfold { from { opacity: 0; transform: translateY(-30px) scaleY(.4) scaleX(.85); } }
.letter p { margin: 0 0 10px; opacity: 0; transform: translateY(8px); animation: line .7s ease forwards; }
@keyframes line { to { opacity: 1; transform: none; } }
.letter .sign { text-align: right; font-weight: 700; font-size: 28px; }

/* пазл */
.pz-wrap { position: relative; width: 100%; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: #efe3d2; touch-action: none; user-select: none; -webkit-user-select: none; }
.pz-ghost { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .16; filter: grayscale(.5); transition: opacity .35s, filter .35s; }
.pz-ghost.peek { opacity: 1; filter: none; }
.pz-grid { position: absolute; inset: 0; transition: opacity .25s; }
.tile { position: absolute; width: calc(100% / 3); height: calc(100% / 3); padding: 2px; transition: left .3s cubic-bezier(.3,1.3,.5,1), top .3s cubic-bezier(.3,1.3,.5,1), padding .4s; cursor: grab; touch-action: none; }
.tile i { display: block; width: 100%; height: 100%; border-radius: 10px; background-size: 300% 300%; box-shadow: 0 3px 8px rgba(40,30,20,.25); transition: box-shadow .3s, border-radius .4s, transform .15s; }
.tile.sel i { box-shadow: 0 0 0 3px var(--rose), 0 8px 18px rgba(40,30,20,.3); transform: scale(.94); }
.tile.drag { z-index: 5; transition: none; cursor: grabbing; }
.tile.drag i { box-shadow: 0 18px 32px rgba(40,30,20,.38); transform: scale(1.07); }
.tile.ok { cursor: default; }
.tile.ok i { box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 2px 5px rgba(40,30,20,.15); }
.tile.snap i { animation: snap .4s cubic-bezier(.3,1.8,.5,1); }
@keyframes snap { 40% { transform: scale(1.08); } }
.pz-wrap.done .tile { padding: 0; }
.pz-wrap.done .tile i { border-radius: 0; box-shadow: none; }
.pz-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
.pz-count { font-weight: 800; color: var(--muted); font-size: 14px; }
.peek-btn { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 800; font-size: 14px; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; }
.pz-cap { font-family: var(--hand); font-weight: 700; font-size: 30px; text-align: center; margin-top: 10px; color: var(--rose); animation: wordIn .6s cubic-bezier(.2,1.6,.4,1) both; }

/* скретч */
.scratch { position: relative; border-radius: 18px; overflow: hidden; touch-action: none; }
.scratch canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; transition: opacity .7s; }
.cert { text-align: center; padding: 18px 16px 16px; border-radius: 18px; border: 2px solid #ecd2bf;
  background: repeating-linear-gradient(45deg, rgba(224,67,106,.05) 0 8px, transparent 8px 16px), #fffaf3; }
.cert img { width: 62%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 6px 16px rgba(60,40,30,.18); }
.cert .lbl { letter-spacing: .3em; font-size: 12px; text-transform: uppercase; color: var(--rose); font-weight: 800; margin-top: 10px; }
.cert .ttl { font-family: var(--hand); font-weight: 700; font-size: 38px; line-height: 1; margin: 6px 0 2px; }
.cert .brand { letter-spacing: .28em; font-size: 13px; font-weight: 800; }
.cert .fine { font-size: 12px; color: var(--muted); margin-top: 8px; }
.reveal-btn { margin: 10px auto 0; display: block; border: 0; background: none; color: var(--muted); text-decoration: underline; font-weight: 700; cursor: pointer; opacity: 0; transition: opacity .5s; }
.reveal-btn.show { opacity: 1; }

/* финал */
.finale { text-align: center; }
.finale .big { font-family: var(--hand); font-weight: 700; font-size: clamp(56px, 16vw, 80px); line-height: 1; color: var(--rose); margin: 6px 0 8px; animation: wordIn .9s .2s cubic-bezier(.2,1.6,.4,1) both; }
.finale p { font-size: 17px; margin: 0 0 16px; }
.shelf { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 18px 0; }
.shelf div { background: #fff; border-radius: 14px; padding: 10px 2px 8px; font-size: 24px; box-shadow: 0 4px 12px rgba(80,50,30,.08); animation: rise .5s both; }
.shelf small { display: block; font-size: 10px; font-weight: 800; color: var(--muted); margin-top: 4px; line-height: 1.15; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 18px; }
.duo .polaroid { padding: 7px 7px 30px; }
.duo .polaroid .cap { font-size: 20px; bottom: 3px; }
.credit { margin: 18px 0 0; padding: 8px 16px; border-radius: 999px; background: rgba(255,255,255,.8); font-family: var(--hand); font-size: 22px; color: var(--muted); text-align: center; }

/* режим для скриншотов */
body.still *, body.still *::before, body.still *::after { animation-delay: -60s !important; }

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

/* правки по скриншотам */
@media (max-width: 480px) {
  .q-title { font-size: 25px; }
  .q-sub { font-size: 12px; }
  .q-head { gap: 10px; padding-right: 48px; }
  .q-head svg { width: 50px; height: 50px; }
  .q-count { font-size: 24px; padding: 2px 10px; }
}
.env-wrap { height: 320px; align-items: end; padding-bottom: 14px; }

/* короткие экраны (ноутбук с открытым браузером) */
body.short .sub { font-size: 13px; margin-top: 0; }
body.short .sub br { display: none; }
body.short .intro-foot { padding: 5px 16px 6px; margin-top: 4px; }
body.short .counter { font-size: 26px; }
/* карточка лепестка всегда влезает в экран целиком */
.sheet-card { overscroll-behavior: contain; }
.sheet-card .polaroid { width: min(100%, 320px, calc((100dvh - 300px) / 1.08)); }
.sheet-card .polaroid img { aspect-ratio: 1 / 1.08; }
@media (max-height: 640px) {
  .sheet-card { padding: 14px 18px 16px; }
  .sheet-card .polaroid { padding: 8px 8px 32px; }
  .sheet-card .polaroid .cap { font-size: 22px; }
  .petal-no { margin-top: 10px; }
  .word { font-size: 42px; } .word.final { font-size: 58px; }
  .phrase { font-size: 16px; margin-bottom: 12px; }
  .btn { padding: 13px 16px; }
}
body.locked { overflow: hidden; }
