:root {
  --pink: #ff3fa4;
  --pink-2: #ff8fd0;
  --hot: #e01f86;
  --deep: #a3125f;
  --gold: #ffd36b;
  --plum: #2a0c22;
  --ink: #3a0b28;
  --paper: #fff3fa;
  --pw: min(400px, 44vw);
  --ph: min(600px, 84dvh);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.65, 0, .35, 1);
  color-scheme: dark;
}
@media (max-width: 760px) {
  :root { --pw: min(440px, 92vw); --ph: min(680px, 80dvh); }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Rubik', system-ui, sans-serif;
  color: #fff;
  background: var(--plum);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
button { font: inherit; }
[hidden] { display: none !important; }

/* ---------- фон-сцена ---------- */
.bg { position: fixed; inset: 0; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 45% at 50% 38%, rgba(255, 120, 200, .22), transparent 70%),
    radial-gradient(ellipse 50% 40% at 85% 95%, rgba(40, 90, 50, .45), transparent 70%),
    radial-gradient(ellipse 45% 35% at 10% 90%, rgba(40, 80, 45, .35), transparent 70%),
    radial-gradient(ellipse at 50% 20%, #4d1a3c 0%, #2a0c22 55%, #14050f 100%);
}
.lights { position: absolute; left: -2%; right: -2%; top: 0; height: 90px;
  background:
    radial-gradient(circle at 50% 60%, #fff6d6 0 3px, rgba(255, 210, 120, .75) 4px, rgba(255, 190, 90, .18) 11px, transparent 18px) 0 0 / 64px 70px repeat-x,
    radial-gradient(circle at 50% 30%, rgba(255, 220, 140, .6) 0 2px, transparent 12px) 32px 18px / 64px 70px repeat-x;
  filter: drop-shadow(0 0 8px rgba(255, 200, 100, .6));
  animation: twinkle 3.2s ease-in-out infinite alternate;
}
.lights::after { content: ''; position: absolute; inset: 12px 0 auto; height: 2px; background: rgba(60, 30, 10, .6); }
@keyframes twinkle { from { opacity: .75 } to { opacity: 1 } }
.curtain { position: absolute; top: 0; bottom: 0; width: 11vw; min-width: 40px;
  background:
    linear-gradient(90deg, rgba(0,0,0,.55), transparent 30%, transparent 70%, rgba(0,0,0,.5)),
    repeating-linear-gradient(90deg, #3d0b23 0 14px, #6d1a40 22px, #4a0f2c 30px, #2b0718 40px);
  box-shadow: 0 0 40px rgba(0,0,0,.7);
}
.curtain.left { left: 0; border-bottom-right-radius: 70% 18%; }
.curtain.right { right: 0; border-bottom-left-radius: 70% 18%; }
.spot { position: absolute; left: 50%; top: -20%; width: 120vmax; height: 140vh; transform: translateX(-50%);
  background: radial-gradient(ellipse 30% 60% at 50% 0%, rgba(255, 190, 230, .13), transparent 70%); pointer-events: none; }
@media (max-width: 760px) { .curtain { width: 6vw; } }

#glitter { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 8; }

/* ---------- блестящий текст ---------- */
.glam {
  font-family: 'Lobster', cursive;
  font-weight: 400;
  background: linear-gradient(100deg, #ff4fb0 0%, #fff0fa 18%, #ff2d8a 36%, #ffd1ec 52%, #ff4fb0 70%, #fff6c9 85%, #ff4fb0 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(120, 0, 60, .55)) drop-shadow(0 0 14px rgba(255, 80, 170, .45));
  animation: shimmer 4s linear infinite;
  margin: 0;
  line-height: 1.1;
}
@keyframes shimmer { to { background-position: -250% 0; } }

/* ---------- сцена ---------- */
.stage { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; perspective: 2200px; }
.stage.no-anim, .stage.no-anim * { transition: none !important; }

/* коробка */
.giftbox { position: absolute; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center; padding: 16px; max-width: 560px; cursor: pointer; outline: none;
  transition: transform .9s var(--ease), opacity .7s ease; }
.box-caption h1 { font-size: clamp(34px, 7vw, 56px); }
.box-caption p { margin: 10px auto 0; max-width: 420px; font-size: clamp(15px, 2.4vw, 18px); line-height: 1.4; color: #ffe3f2; }
.giftbox .small { margin: 0; font-size: 13px; color: rgba(255, 220, 240, .65); max-width: 360px; }
.hint { margin: 0; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; font-size: 13px; color: var(--gold);
  animation: hint 1.6s ease-in-out infinite; }
@keyframes hint { 50% { opacity: .45; transform: translateY(2px); } }

.box { position: relative; width: 230px; height: 220px; margin-top: 10px; animation: wiggle 3.6s ease-in-out infinite; }
.giftbox:hover .box { animation-duration: 1.2s; }
@keyframes wiggle {
  0%, 70%, 100% { transform: rotate(0); }
  74% { transform: rotate(-5deg) scale(1.03); } 78% { transform: rotate(5deg) scale(1.03); }
  82% { transform: rotate(-4deg); } 86% { transform: rotate(3deg); } 90% { transform: rotate(0); }
}
.box-body { position: absolute; left: 10px; right: 10px; bottom: 0; height: 160px; border-radius: 6px 6px 12px 12px;
  background:
    linear-gradient(90deg, transparent 42%, var(--gold) 42% 58%, transparent 58%),
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.85) 0 1px, transparent 1.6px) 0 0 / 9px 9px,
    radial-gradient(circle at 70% 70%, rgba(255,255,255,.6) 0 1px, transparent 1.6px) 0 0 / 11px 11px,
    linear-gradient(160deg, #ff5cb8, #e0217f 55%, #a3125f);
  box-shadow: inset 0 -18px 30px rgba(80, 0, 40, .45), 0 24px 40px rgba(0,0,0,.5); }
.box-body .label { position: absolute; left: 14px; bottom: 14px; padding: 4px 8px; background: #f4e7c9; color: #4b2a12;
  font-size: 10px; font-weight: 800; transform: rotate(-4deg); border-radius: 2px; box-shadow: 0 2px 4px rgba(0,0,0,.3); letter-spacing: .03em; }
.lid { position: absolute; left: 0; right: 0; top: 4px; height: 58px; border-radius: 8px; z-index: 2;
  background:
    linear-gradient(90deg, transparent 42%, var(--gold) 42% 58%, transparent 58%),
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.85) 0 1px, transparent 1.6px) 0 0 / 9px 9px,
    linear-gradient(170deg, #ff7cc8, #ff2d8a 60%, #c2186f);
  box-shadow: 0 8px 14px rgba(60, 0, 30, .45);
  transition: transform 1s var(--ease), opacity 1s ease; }
.bow { position: absolute; left: 50%; top: -34px; width: 0; height: 0; }
.bow i { position: absolute; top: 0; width: 56px; height: 40px; border: 10px solid var(--gold); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; }
.bow i:first-child { right: 4px; transform: rotate(-18deg); }
.bow i:last-child { left: 4px; transform: rotate(18deg); }
.bow b { position: absolute; left: -12px; top: 14px; width: 24px; height: 22px; background: var(--gold); border-radius: 8px; box-shadow: 0 2px 0 #c99a2e; }

.stage:not(.st-box) .giftbox { pointer-events: none; }
.giftbox.opening .box { animation: shake .45s linear; }
@keyframes shake { 20% { transform: rotate(-8deg) } 40% { transform: rotate(8deg) } 60% { transform: rotate(-6deg) } 80% { transform: rotate(5deg) } }
.st-rise .lid, .st-closed .lid, .st-open .lid { transform: translate(-46vw, -70vh) rotate(-120deg); opacity: 0; }
.st-rise .box-caption, .st-rise .hint, .st-rise .small { opacity: 0; transition: opacity .3s; }
.st-closed .giftbox, .st-open .giftbox { transform: translateY(80vh) rotate(10deg); opacity: 0; }

/* открытка-книжка */
.book { position: relative; z-index: 2; width: var(--pw); height: var(--ph); transform-style: preserve-3d;
  transition: transform 1.1s var(--ease), opacity .5s ease; }
.st-box .book { transform: translateY(8vh) scale(.28); opacity: 0; pointer-events: none; }
.st-rise .book { transform: translateY(-14vh) scale(.5) rotate(-6deg); opacity: 1; }
.st-closed .book { transform: none; cursor: pointer; }
.st-closed .book:hover { transform: rotate(-1.5deg) scale(1.015); }
.st-open .book { transform: translateX(calc(var(--pw) / 2)); }

.page, .cover-front, .cover-back { position: absolute; inset: 0; border-radius: 6px 18px 18px 6px; overflow: hidden; }
.page { background:
    radial-gradient(circle at 20% 20%, rgba(255, 80, 170, .1) 0 2px, transparent 3px) 0 0 / 22px 22px,
    linear-gradient(165deg, #fff8fc, #ffe4f2);
  color: var(--ink);
  box-shadow: 0 30px 60px rgba(0,0,0,.55), inset 8px 0 18px rgba(160, 30, 100, .12); }
.page::before { content: ''; position: absolute; inset: 10px; border: 2px dashed rgba(224, 31, 134, .25); border-radius: 4px 12px 12px 4px; pointer-events: none; }
.page-content { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;padding: 34px 28px 28px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 14px; user-select: text;
  transition: opacity .25s ease, transform .25s ease; }
.page-content.leaving { opacity: 0; transform: translateX(-24px) rotate(-1deg); }
.page-content.entering { opacity: 0; transform: translateX(24px) rotate(1deg); }

.cover { position: absolute; inset: 0; transform-origin: left center; transform-style: preserve-3d;
  transition: transform 1.3s var(--ease), opacity .4s ease; transform: translateZ(1px); }
.st-open .cover { transform: rotateY(-178deg); }
.cover-front, .cover-back { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cover-front { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; padding: 18px 18px 22px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.95) 0 1px, transparent 1.8px) 0 0 / 8px 8px,
    radial-gradient(circle at 70% 60%, rgba(255,220,240,.7) 0 1px, transparent 1.6px) 3px 4px / 11px 11px,
    linear-gradient(150deg, #ff6cc0, #e0217f 45%, #ff4fae 70%, #b3146a);
  box-shadow: 0 30px 60px rgba(0,0,0,.6), inset -6px 0 14px rgba(255,255,255,.2), inset 6px 0 10px rgba(80,0,40,.4); }
.cover-front::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.45) 45%, transparent 60%) -200% 0 / 250% 100% no-repeat;
  animation: sheen 3.5s ease-in-out infinite; mix-blend-mode: soft-light; }
@keyframes sheen { 60%, 100% { background-position: 200% 0; } }
.cover-photo { position: absolute; inset: 16px 16px 30%; border-radius: 10px; overflow: hidden; border: 4px solid #fff0f8;
  box-shadow: 0 0 0 3px var(--gold), 0 10px 24px rgba(80,0,40,.5); transform: rotate(-2deg); background: #3a1430; }
.cover-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; display: block; }
.cover-title { position: relative; margin: 0; font-family: 'Lobster', cursive; font-weight: 400; font-size: clamp(30px, 4.6vw, 44px); text-align: center; line-height: 1.05;
  color: #fff; text-shadow: 0 3px 0 var(--deep), 0 0 18px rgba(255, 255, 255, .6), 0 0 30px rgba(255, 60, 170, .8); white-space: pre-line; }
.cover-front .hint { color: #fff7c9; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.cover-back { transform: rotateY(180deg); padding: 34px 28px; color: var(--ink); text-align: left;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 80, 170, .12) 0 2px, transparent 3px) 0 0 / 18px 18px,
    linear-gradient(200deg, #ffe0f0, #ffd0e8);
  box-shadow: 0 30px 60px rgba(0,0,0,.45), inset -10px 0 20px rgba(160,30,100,.15);
  border-radius: 18px 6px 6px 18px; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.cover-back h2 { font-family: 'Lobster', cursive; font-weight: 400; color: var(--hot); font-size: 30px; margin: 0; }
.cover-back ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; line-height: 1.35; font-size: 15px; }
.cover-back .side { font-size: 13px; color: #8a3a66; border-top: 2px dashed rgba(224,31,134,.3); padding-top: 10px; line-height: 1.4; }

@media (max-width: 760px) {
  .st-open .book { transform: none; }
  .st-open .cover { opacity: 0; pointer-events: none; transition: transform 1.2s var(--ease), opacity .35s ease .75s; }
  .page-content { padding: 30px 20px 22px; }
}

/* ---------- содержимое страницы ---------- */
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--hot);
  background: rgba(255, 63, 164, .12); padding: 5px 12px; border-radius: 99px; }
.q { font-family: 'Rubik', sans-serif; font-weight: 900; font-size: clamp(22px, 3.4vw, 30px); line-height: 1.15; margin: 0; color: var(--ink); }
.sub { margin: 0; color: #8a3a66; font-size: 15px; line-height: 1.4; }
.answers { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; align-items: center; min-height: 70px; margin-top: 6px; }
.options { display: grid; gap: 10px; width: 100%; margin-top: 4px; }
.result { font-size: 17px; line-height: 1.45; color: var(--ink); animation: popIn .45s var(--ease-pop); }
.result b, .result strong { color: var(--hot); }
.mock { min-height: 1.4em; margin: 0; font-weight: 600; color: #c0186f; font-size: 15px; }
.mock.show { animation: popIn .35s var(--ease-pop); }
@keyframes popIn { from { opacity: 0; transform: scale(.85) translateY(6px); } }

.btn { --s: 1; scale: var(--s); border: 0; cursor: pointer; border-radius: 99px; padding: 13px 26px; font-weight: 800; font-size: 17px;
  transition: transform .15s ease, box-shadow .2s, scale .25s var(--ease-pop), opacity .2s; touch-action: manipulation;
  max-width: 100%; line-height: 1.2; }
.btn:active { transform: translateY(1px) scale(.97); }
.btn.yes { color: #fff; background: linear-gradient(135deg, #ff5cb8, #e0217f); box-shadow: 0 6px 0 var(--deep), 0 10px 24px rgba(224, 31, 134, .45); }
.btn.yes:hover { transform: translateY(-2px); }
.btn.no { color: var(--ink); background: #fff; box-shadow: 0 4px 0 #e2b6cc, 0 8px 18px rgba(0,0,0,.15); border: 2px solid #f1c3dc; }
.btn.no.fleeing { position: fixed; z-index: 60; margin: 0; transition: left .24s var(--ease-pop), top .24s var(--ease-pop), scale .25s var(--ease-pop); white-space: nowrap; }
.btn.next { margin-top: 4px; }
.btn.ghost { background: transparent; color: var(--hot); box-shadow: none; border: 2px solid rgba(224, 31, 134, .35); }
.btn.poof { animation: poof .35s ease forwards; }
@keyframes poof { to { opacity: 0; scale: 1.8; filter: blur(6px); } }

.opt { display: block; width: 100%; text-align: left; border: 2px solid #f6c6e0; background: #fff; color: var(--ink); border-radius: 14px;
  padding: 12px 16px; font-weight: 600; font-size: 16px; cursor: pointer; transition: transform .15s, background .2s, border-color .2s; }
.opt:hover:not(:disabled) { transform: translateX(4px); border-color: var(--pink); }
.opt.wrong { background: #ffe9ef; border-color: #ffb3c7; color: #b56a85; text-decoration: line-through; animation: nope .4s; cursor: not-allowed; }
.opt.right { background: linear-gradient(135deg, #ff5cb8, #e0217f); border-color: transparent; color: #fff; animation: yay .5s var(--ease-pop); }
.opt:disabled:not(.wrong):not(.right) { opacity: .5; }
@keyframes nope { 20%, 60% { transform: translateX(-8px) } 40%, 80% { transform: translateX(8px) } }
@keyframes yay { 50% { transform: scale(1.06) } }

textarea { width: 100%; min-height: 150px; resize: vertical; border: 2px solid #f6c6e0; border-radius: 14px; padding: 12px 14px;
  font: inherit; font-size: 16px; color: var(--ink); background: #fff; outline: none; user-select: text; }
textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255, 63, 164, .15); }

/* скретч-карта */
.scratch { position: relative; width: 100%; max-width: 330px; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden;
  box-shadow: 0 10px 24px rgba(160, 30, 100, .3); touch-action: none; }
.scratch-under { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px;
  background: linear-gradient(135deg, #fff6c9, #ffd36b); color: #5a2a00; }
.scratch-under .lbl { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; opacity: .7; }
.scratch-under .code { font-size: clamp(20px, 4vw, 28px); font-weight: 900; letter-spacing: .04em; word-break: break-all; user-select: all; }
.scratch:not(.done) .code { user-select: none; }
.scratch canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; transition: opacity .6s ease; }
.scratch.done canvas { opacity: 0; pointer-events: none; }
.gift-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.letter { text-align: left; width: 100%; font-size: 16px; line-height: 1.55; }
.letter p { margin: 0 0 12px; }
.letter .sign { text-align: right; font-family: 'Lobster', cursive; font-size: 24px; color: var(--hot); margin-top: 8px; }
.letter .ps { font-size: 14px; color: #8a3a66; }
.page-title { font-family: 'Lobster', cursive; font-weight: 400; color: var(--hot); font-size: clamp(30px, 4.6vw, 40px); margin: 0; line-height: 1.1; }

/* ---------- фото-стикеры ---------- */
.photos { position: fixed; inset: 0; pointer-events: none; }
.photos.back { z-index: 3; }
.photos.front { z-index: 6; }
.photo { position: absolute; transform: translate(-50%, -50%); }
.photo-inner { rotate: var(--rot, 0deg); }
.photo img { display: block; width: 100%; height: auto; transform: scaleX(var(--flip, 1)); filter: drop-shadow(0 8px 14px rgba(0,0,0,.45)); pointer-events: none; }
.photo.in .photo-inner { animation: photoPop .7s var(--ease-pop) both, bob 4s ease-in-out .7s infinite; animation-delay: var(--d, 0ms), calc(var(--d, 0ms) + 700ms); }
.photo.waiting { visibility: hidden; }
.photo.out .photo-inner { animation: photoOut .35s ease forwards; }
@keyframes photoPop { from { scale: 0; rotate: calc(var(--rot, 0deg) - 35deg); opacity: 0; } }
@keyframes photoOut { to { scale: 0; opacity: 0; rotate: calc(var(--rot, 0deg) + 30deg); } }
@keyframes bob { 50% { translate: 0 -6px; } }

/* ---------- HUD ---------- */
.hud { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 14px; pointer-events: none; }
.progress { flex: 1; height: 6px; border-radius: 9px; background: rgba(255,255,255,.12); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--gold)); border-radius: inherit; transition: width .6s var(--ease); box-shadow: 0 0 10px var(--pink); }
.hud-btn { pointer-events: auto; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); backdrop-filter: blur(6px);
  cursor: pointer; font-size: 19px; transition: transform .15s; }
.hud-btn:hover { transform: scale(1.08); }

.toast { position: fixed; z-index: 70; left: 50%; top: 66px; translate: -50% -20px; opacity: 0; pointer-events: none; max-width: min(92vw, 460px);
  padding: 12px 18px; border-radius: 16px; text-align: center; font-weight: 700; font-size: 16px; line-height: 1.35;
  background: rgba(40, 6, 28, .92); color: #fff; border: 2px solid var(--pink); box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 20px rgba(255, 63, 164, .4);
  transition: opacity .25s, translate .3s var(--ease-pop); }
.toast.show { opacity: 1; translate: -50% 0; }

/* ---------- вход ---------- */
.gate { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at 50% 30%, rgba(77, 26, 60, .85), rgba(20, 5, 15, .96)); transition: opacity .6s ease; }
.gate.fade { opacity: 0; pointer-events: none; }
.gate-card { width: min(440px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 30px 24px; border-radius: 24px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 140, 200, .3);
  box-shadow: 0 20px 60px rgba(0,0,0,.5), inset 0 0 40px rgba(255, 63, 164, .08); backdrop-filter: blur(8px); }
.gate-card h1 { font-size: clamp(32px, 7vw, 44px); }
.gate-card p { margin: 0; color: #ffe3f2; line-height: 1.4; }
.gate-card .small { font-size: 13px; }
.gate-card .muted { color: rgba(255, 220, 240, .6); }
.gate-emoji { font-size: 46px; }
.gate-emoji.spin { animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gate-card input { width: 100%; font: inherit; font-size: 18px; padding: 14px 16px; border-radius: 14px; border: 2px solid rgba(255, 140, 200, .5);
  background: rgba(0,0,0,.25); color: #fff; outline: none; text-align: center; user-select: text; }
.gate-card input:focus { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255, 63, 164, .2); }
.gate-card.shake { animation: nope .4s; }
.gate-error { min-height: 1.4em; color: #ffb3d6 !important; font-weight: 600; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.countdown div { background: rgba(0,0,0,.25); border-radius: 14px; padding: 10px 4px; border: 1px solid rgba(255, 140, 200, .25); }
.countdown b { display: block; font-size: clamp(26px, 6vw, 36px); font-weight: 900; color: #fff; }
.countdown span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--pink-2); }
.loadbar { width: 100%; height: 10px; border-radius: 9px; background: rgba(255,255,255,.12); overflow: hidden; }
.loadbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--gold)); transition: width .2s; }

/* ---------- редактор (только dev) ---------- */
body.editing .photos { pointer-events: auto; }
body.editing .photos .photo { cursor: move; outline: 1px dashed rgba(255,255,255,.35); }
body.editing .photos .photo.on-correct { outline: 2px dashed var(--gold); }
body.editing .photos .photo.on-correct::after { content: 'после ответа'; position: absolute; top: -18px; left: 0; font-size: 11px; color: var(--gold); background: rgba(0,0,0,.6); padding: 1px 5px; border-radius: 4px; }
body.editing .photos .photo.sel { outline: 3px solid var(--pink); z-index: 999 !important; }
body.editing .photos.front { pointer-events: none; }
body.editing .photos.front .photo { pointer-events: auto; }
.editor { position: fixed; z-index: 100; left: 10px; bottom: 10px; width: 300px; max-height: calc(100vh - 80px); overflow: auto;
  background: rgba(20, 4, 16, .94); border: 1px solid var(--pink); border-radius: 14px; padding: 12px; font-size: 13px; color: #fff;
  box-shadow: 0 10px 40px rgba(0,0,0,.6); user-select: none; }
.editor h3 { margin: 0 0 8px; font-size: 14px; color: var(--pink-2); }
.editor .row { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.editor select, .editor button { font: inherit; font-size: 12px; background: #3a0f2c; color: #fff; border: 1px solid #7a2a5a; border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.editor select { flex: 1; min-width: 0; }
.editor button:hover { border-color: var(--pink); }
.editor button.primary { background: var(--hot); border-color: var(--hot); font-weight: 700; }
.editor .help { color: rgba(255,255,255,.6); line-height: 1.5; font-size: 11.5px; margin: 6px 0 0; }
.editor .status { color: var(--gold); min-height: 1.2em; margin: 4px 0 0; }
.editor .collapsed-only { display: none; }
.editor.collapsed > :not(.head) { display: none; }
.editor .head { display: flex; justify-content: space-between; align-items: center; }
.devtag { position: fixed; right: 10px; bottom: 10px; z-index: 100; font: 12px/1 monospace; background: rgba(0,0,0,.6); padding: 6px 8px; border-radius: 6px; color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  .box, .glam, .lights, .hint, .cover-front::after { animation: none !important; }
}
