/* «Кукольный дом» — общие стили живого оформления (демо 27.11.2026). Главная и /pomoch/. Пара к doll.js */
:root {
  --violet: #8b5cf6; --violet2: #c4b5fd; --pink: #ec4899; --green: #4ade80;
  --neon-gold: 0 0 6px rgba(255,223,126,.9), 0 0 18px rgba(245,197,66,.65), 0 0 42px rgba(245,197,66,.35);
  --neon-violet: 0 0 6px rgba(196,181,253,.9), 0 0 20px rgba(139,92,246,.7), 0 0 46px rgba(139,92,246,.4);
}

/* ---------- бегущая строка, как на стриме ---------- */
.ticker { position: relative; height: 34px; overflow: hidden; border-top: 1px solid rgba(245,197,66,.35); border-bottom: 1px solid rgba(245,197,66,.35);
  background: linear-gradient(90deg, rgba(139,92,246,.30), rgba(236,72,153,.22) 50%, rgba(245,197,66,.22)); display: flex; align-items: center;
  -webkit-mask-image: linear-gradient(90deg, #000 94%, transparent); mask-image: linear-gradient(90deg, #000 94%, transparent); }
.ticker::before { content: "LIVE"; position: absolute; left: 10px; z-index: 2; font: 800 11px Unbounded, sans-serif; letter-spacing: 1px; color: #fff; background: #ef4444; padding: 3px 8px 3px 18px; border-radius: 6px; box-shadow: 0 0 12px rgba(239,68,68,.7); }
.ticker::after { content: ""; position: absolute; left: 17px; z-index: 3; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: tkDot 1.2s ease-in-out infinite; }
@keyframes tkDot { 50% { opacity: .2; } }
.tk-track { display: flex; width: max-content; animation: tkRun var(--dur, 40s) linear infinite; padding-left: 70px; }
.ticker:hover .tk-track { animation-play-state: paused; }
.tk-set { display: flex; flex: none; }
.tk-set span { flex: none; white-space: nowrap; font: 700 13.5px Manrope, system-ui, sans-serif; color: #fff6d8; padding: 0 22px; position: relative; }
.tk-set span::after { content: "✦"; position: absolute; right: -6px; color: var(--gold, #f5c542); text-shadow: var(--neon-gold); }
@keyframes tkRun { to { transform: translateX(-50%); } }

/* ---------- наклейки-стикеры ---------- */
.stk { position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 4px; font: 800 12px Unbounded, sans-serif; letter-spacing: .5px; text-transform: uppercase;
  padding: 6px 11px; border-radius: 10px; color: #1a1300; background: linear-gradient(180deg, #ffe9a0, #f5c542); border: 2.5px solid #fff;
  box-shadow: 0 6px 14px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.15); transform: rotate(var(--r, -6deg)); white-space: nowrap; pointer-events: none; }
.stk-hot { background: linear-gradient(180deg, #ff8a4c, #ef4444); color: #fff; --r: 7deg; animation: stkPulse 2.2s ease-in-out infinite; }
.stk-new { background: linear-gradient(180deg, #6ee7b7, #22c55e); color: #052e16; --r: -8deg; }
.stk-soon { background: linear-gradient(180deg, #ddd6fe, #a78bfa); color: #1e1038; --r: 5deg; }
.stk-pink { background: linear-gradient(180deg, #fbcfe8, #ec4899); color: #fff; --r: 4deg; }
.stk[hidden] { display: none !important; }
@keyframes stkPulse { 0%,100% { transform: rotate(var(--r)) scale(1); } 50% { transform: rotate(var(--r)) scale(1.08); } }

/* ---------- неон ---------- */
.neon { color: #fff8dc; text-shadow: var(--neon-gold); }
.neon-v { color: #f3eaff; text-shadow: var(--neon-violet); }
.glow { border: 1.5px solid rgba(245,197,66,.45) !important; box-shadow: 0 0 0 1px rgba(245,197,66,.08), 0 0 26px rgba(245,197,66,.16), inset 0 0 30px rgba(139,92,246,.10); }
.glow-v { border: 1.5px solid rgba(167,139,250,.55) !important; box-shadow: 0 0 26px rgba(139,92,246,.25), inset 0 0 30px rgba(139,92,246,.10); }

/* ---------- дом «строится на глазах» ---------- */
.dh { display: grid; gap: 16px; }
.dh-scene { position: relative; border-radius: 22px; overflow: visible; }
.dh-svg { width: 100%; height: auto; display: block; border-radius: 20px; box-shadow: 0 0 0 1.5px rgba(245,197,66,.45), 0 0 30px rgba(139,92,246,.35), 0 18px 40px rgba(0,0,0,.45); }
.dh-stage { top: -12px; left: 14px; --r: -4deg; }
.dh-prev { top: -12px; right: 14px; }
.dh-svg .hp { transition: opacity .3s; }
.dh-svg .hp.ghost * { fill: none !important; stroke: rgba(255,223,126,.5) !important; stroke-width: 1.4px !important; stroke-dasharray: 5 4; }
.dh-svg .hp.ghost .no-ghost, .dh-svg .hp.ghost .no-ghost * { display: none; }
.dh-svg .hp.ghost.fam { opacity: .55; }
.dh-svg .hp.drop { animation: dhDrop .75s cubic-bezier(.34,1.5,.64,1) both; animation-delay: calc(var(--i, 0) * .17s); }
@keyframes dhDrop { from { transform: translateY(-110px); opacity: 0; } 60% { opacity: 1; } }
.dh-svg .smoke circle { animation: smoke 3.2s ease-in infinite; transform-box: fill-box; transform-origin: center; }
.dh-svg .smoke circle:nth-child(2) { animation-delay: -1.1s; } .dh-svg .smoke circle:nth-child(3) { animation-delay: -2.2s; }
@keyframes smoke { 0% { transform: translateY(18px) scale(.4); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateY(-14px) scale(1.15); opacity: 0; } }
.dh-svg .lit { animation: lit 3s ease-in-out infinite; } @keyframes lit { 50% { opacity: .82; } }
.dh-svg .stars circle { animation: twinkle 2.6s ease-in-out infinite; } .dh-svg .stars circle:nth-child(2n) { animation-delay: -1.3s; } .dh-svg .stars circle:nth-child(3n) { animation-delay: -.7s; }
@keyframes twinkle { 50% { opacity: .25; } }
.dh-svg .hook { animation: swing 2.8s ease-in-out infinite; transform-origin: 300px 58px; }
@keyframes swing { 0%,100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
.dh-svg .hp.on .warm { animation: kidWave 1.1s ease-in-out infinite; transform-box: view-box; }
@keyframes kidWave { 0%,100% { transform: rotate(-10deg); } 50% { transform: rotate(14deg); } }
.dh-svg .hp.on .hearts { animation: heart 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes heart { 0% { transform: translateY(8px) scale(.6); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(-26px) scale(1.15); opacity: 0; } }

/* полоска опыта (XP) */
.xp { display: grid; gap: 10px; }
.xp-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lvl { font: 800 13px Unbounded, sans-serif; color: #1a1300; background: linear-gradient(180deg, #ffe9a0, #f5c542); padding: 6px 10px; border-radius: 10px; box-shadow: 0 0 16px rgba(245,197,66,.55); }
.lvl b { font-size: 16px; }
.xp-title { font: 800 clamp(15px, 2.4vw, 18px)/1.3 Unbounded, sans-serif; color: #fff8dc; text-shadow: 0 0 14px rgba(245,197,66,.45); }
.xp-bar { position: relative; height: 26px; border-radius: 999px; background: #120d22; border: 2px solid rgba(167,139,250,.55); overflow: hidden; box-shadow: inset 0 2px 8px rgba(0,0,0,.6), 0 0 18px rgba(139,92,246,.3); }
.xp-bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px; transition: width 1.4s cubic-bezier(.2,.9,.3,1);
  background: repeating-linear-gradient(-45deg, rgba(255,255,255,.18) 0 10px, transparent 10px 20px), linear-gradient(90deg, #22c55e, #4ade80 40%, #f5c542);
  background-size: 28px 28px, 100% 100%; animation: xpRun 1s linear infinite; box-shadow: 0 0 14px rgba(74,222,128,.7); }
@keyframes xpRun { to { background-position: 28px 0, 0 0; } }
.xp-num { position: absolute; inset: 0; display: grid; place-items: center; font: 800 12.5px Manrope, system-ui, sans-serif; color: #fff; text-shadow: 0 1px 2px #000, 0 0 6px #000; letter-spacing: .4px; }
.xp-mini .xp-bar { height: 12px; }
.dh-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; color: var(--muted, #a59fc2); font-weight: 700; }
.dh-sum b { font: 800 clamp(24px, 4.4vw, 34px)/1.1 Unbounded, sans-serif; color: var(--green); text-shadow: 0 0 18px rgba(74,222,128,.55); }
.dh-sum em { margin-left: auto; font-style: normal; font-weight: 800; color: #ffdf7e; font-size: 14px; padding: 3px 10px; border-radius: 999px; background: rgba(245,197,66,.12); border: 1px solid rgba(245,197,66,.4); }
.dh-next { color: #f3f0ff; font-weight: 700; font-size: 15px; }
.dh-note { color: var(--muted, #a59fc2); font-size: 13px; font-weight: 600; }
.dh-play { justify-self: start; cursor: pointer; font: inherit; font-weight: 700; border: 1.5px dashed rgba(245,197,66,.6) !important; color: #ffdf7e !important; }
.dh-play:disabled { opacity: .55; cursor: default; }
.dh.previewing .dh-sum, .dh.previewing .dh-next, .dh.previewing .dh-note, .dh.previewing .xp-num { opacity: .35; }

/* ---------- достижения ---------- */
.badges-box { margin-top: 18px; }
.bd-h { display: block; font: 800 14px Unbounded, sans-serif; margin-bottom: 10px; color: #ffdf7e; }
.bd-h small { font: 700 12px Manrope, sans-serif; color: var(--muted, #a59fc2); margin-left: 6px; }
.bd-row { display: flex; flex-wrap: wrap; gap: 10px; }
.bd { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: #161224; border: 1.5px dashed rgba(165,159,194,.4); color: var(--muted, #a59fc2); font-size: 13px; font-weight: 700; filter: grayscale(1); opacity: .75; }
.bd i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 16px; background: #221c38; }
.bd.on { filter: none; opacity: 1; color: #fff8dc; border: 1.5px solid rgba(245,197,66,.7); background: linear-gradient(180deg, rgba(245,197,66,.18), rgba(139,92,246,.14)); box-shadow: 0 0 16px rgba(245,197,66,.3); }
.bd.on i { background: linear-gradient(180deg, #ffe9a0, #f5c542); box-shadow: 0 0 10px rgba(245,197,66,.7); }

/* ---------- конфетти и сообщение ---------- */
.dh-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 10050; }
.dh-toast { position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%); z-index: 10060; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px;
  background: linear-gradient(180deg, #ffe9a0, #f5c542); color: #1a1300; font: 800 14px Manrope, system-ui, sans-serif; box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 24px rgba(245,197,66,.5); animation: toastIn .35s cubic-bezier(.34,1.5,.64,1); text-align: center; }
.dh-toast.out { opacity: 0; transform: translate(-50%, 10px); transition: .5s; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px) scale(.9); } }

/* ---------- анимации при прокрутке ---------- */
.rv { opacity: 0; transform: translateY(38px) scale(.98); transition: opacity .7s ease, transform .8s cubic-bezier(.2,.9,.3,1.2); transition-delay: var(--d, 0s); }
.rv.in { opacity: 1; transform: none; }
.rv-l { transform: translateX(-46px) rotate(-2deg); } .rv-r { transform: translateX(46px) rotate(2deg); }
.rv-pop { transform: scale(.85); }

/* ---------- 3D-наклон ---------- */
.tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s cubic-bezier(.2,.9,.3,1), box-shadow .3s; transform-style: preserve-3d; will-change: transform; position: relative; }
.tilt.tilting { transition: transform .08s linear, box-shadow .3s; }
.tilt::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(320px circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.13), transparent 60%); }
.tilt.tilting::after { opacity: 1; }
.rv.in.tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }

@media (prefers-reduced-motion: reduce) {
  .tk-track { animation: none; } .ticker { overflow-x: auto; -webkit-mask-image: none; mask-image: none; } .ticker::after { animation: none; }
  .stk-hot, .xp-bar i, .dh-svg .smoke circle, .dh-svg .lit, .dh-svg .stars circle, .dh-svg .hook, .dh-svg .hp.on .warm, .dh-svg .hp.on .hearts { animation: none !important; }
  .dh-svg .smoke circle { opacity: .7; }
  .rv { opacity: 1; transform: none; transition: none; }
  .xp-bar i { transition: none; }
}
