/* ---------- Шапка ---------- */
#head { position: fixed; inset: 0 0 auto; z-index: 50; height: calc(var(--head) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--pad) 0;
  display: flex; align-items: center; justify-content: space-between; transition: transform .5s var(--ease), background .4s, backdrop-filter .4s; }
#head.scrolled { background: linear-gradient(var(--bg), color-mix(in srgb, var(--bg) 0%, transparent)); }
#head.hide { transform: translateY(-110%); }
.logo img { height: 26px; width: auto; }
[data-theme="light"] .logo img, [data-theme="light"] .gl-logo, [data-theme="light"] .gw-logo, [data-theme="light"] .foot-brand img,
[data-theme="light"] .thanks-logo, [data-theme="light"] .cab-logo, [data-theme="light"] .op-ava img { filter: invert(1); }
.head-r { display: flex; align-items: center; gap: 6px; }
#progress { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); opacity: .5; }
html[dir="rtl"] #progress { transform-origin: 100% 50%; }

/* ---------- Кнопки (нажатие как в Master DEN: сжатие, вспышка-кольцо, лучи, звук) ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 54px; padding: 0 30px; border-radius: 40px;
  font-size: var(--t-xs); font-weight: 500; letter-spacing: .26em; text-transform: uppercase; white-space: nowrap; overflow: visible;
  transition: transform .2s var(--ease), box-shadow .35s, background .35s, color .35s, border-color .35s, opacity .3s; isolation: isolate; }
html[lang="ja"] .btn, html[lang="ar"] .btn { letter-spacing: .06em; }
.btn.primary, .btn.solid { background: var(--solid); color: var(--on-solid); }
.btn.primary:hover { box-shadow: 0 0 34px color-mix(in srgb, var(--ink) 35%, transparent); }
.btn.ghost { border: 1px solid var(--line2); color: var(--ink); background: color-mix(in srgb, var(--bg) 30%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.sm { height: 42px; padding: 0 20px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .3; pointer-events: none; }
.is-down { transform: scale(.97) !important; }
.btn.flash::after, .tile.flash::after, .glass.flash::after, .asm.flash::after, li.flash::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; animation: ptflash 1s var(--ease) forwards; }
@keyframes ptflash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ink) 85%, transparent); } 100% { box-shadow: 0 0 0 26px transparent; } }
/* подсветка важных кнопок — мягкая пульсация, как goGlow в Master DEN */
.hl { animation: goGlow 2.8s ease-in-out infinite; }
@keyframes goGlow { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 34px 4px color-mix(in srgb, var(--glow) 55%, transparent), 0 0 0 1px color-mix(in srgb, var(--ink) 30%, transparent); } }
.hl::before { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; overflow: hidden;
  background: linear-gradient(110deg, transparent 30%, color-mix(in srgb, var(--on-solid) 22%, transparent) 50%, transparent 70%) -200% 0 / 250% 100% no-repeat; animation: sheen 3.6s ease-in-out infinite; }
.btn.primary.hl::before { background-image: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%); mix-blend-mode: overlay; }
@keyframes sheen { 0%, 55% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
/* вспышка с лучами в точке нажатия */
.burst { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 3; }
.burst::before, .burst::after { content: ""; position: absolute; left: 0; top: 0; width: 90px; height: 90px; border-radius: 50%; transform: translate(-50%, -50%) scale(0); }
.burst::before { background: radial-gradient(circle, color-mix(in srgb, var(--ink) 45%, transparent), transparent 65%); animation: burst 1s var(--ease) forwards; }
.burst::after { background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--ink) 80%, transparent) 0 2deg, transparent 2deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 26%, #000 28%, #000 44%, transparent 70%); mask: radial-gradient(circle, transparent 26%, #000 28%, #000 44%, transparent 70%); animation: rays 1s var(--ease) forwards; }
@keyframes burst { 0% { transform: translate(-50%, -50%) scale(.1); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; } }
@keyframes rays { 0% { transform: translate(-50%, -50%) scale(.2) rotate(0); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.6) rotate(25deg); opacity: 0; } }
.btn, .chip, .swatch, .icon-btn, .tile, .tab, .press, .choice, .lang-opt, .chapter, .hk-dot, .seg button { position: relative; }
.tile, .press, .choice, .lang-opt, .chapter, .reel { overflow: visible; }

.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--ink); transition: background .3s, transform .2s var(--ease), color .3s; }
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.lang-btn { font-size: var(--t-xs); letter-spacing: .18em; width: auto; padding: 0 10px; border-radius: 20px; }
.burger { gap: 0; }
.burger i { display: block; width: 22px; height: 1.4px; background: currentColor; border-radius: 2px; grid-area: 1 / 1; transition: transform .3s; }
.burger i:first-child { transform: translateY(-4px); } .burger i:last-child { transform: translateY(4px); width: 16px; justify-self: end; }
/* кнопка музыки: эквалайзер */
#soundBtn .eq-ic { display: none; gap: 2px; align-items: end; height: 16px; }
#soundBtn .eq-ic i { width: 2px; height: 5px; background: currentColor; border-radius: 1px; animation: eq 1s ease-in-out infinite; }
#soundBtn .eq-ic i:nth-child(2) { animation-delay: -.3s; } #soundBtn .eq-ic i:nth-child(3) { animation-delay: -.6s; } #soundBtn .eq-ic i:nth-child(4) { animation-delay: -.15s; }
body.sound-on #soundBtn .eq-ic { display: flex; } body.sound-on #soundBtn .ic-off { display: none; }
#soundBtn.ducked .eq-ic i { animation-play-state: paused; opacity: .4; }
#soundBtn .ic-off { fill: none; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }

.chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--line2);
  font-size: var(--t-xs); letter-spacing: .14em; text-transform: uppercase; color: var(--ink2); transition: all .3s var(--ease); background: color-mix(in srgb, var(--bg) 25%, transparent); }
.chip svg { width: 16px; height: 16px; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.sel { background: var(--solid); color: var(--on-solid); border-color: var(--solid); }
.chip.col i { width: 12px; height: 12px; border-radius: 50%; background: var(--sw); box-shadow: 0 0 0 1px var(--line2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.center { justify-content: center; }

.glass { position: relative; background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); }

/* сегменты */
.seg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.seg > span { width: 100%; font-size: var(--t-xs); color: var(--muted); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 2px; }
.seg button { flex: 1; min-width: 0; height: 40px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line); font-size: var(--t-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--ink2); transition: all .3s; }
.seg button.sel { border-color: var(--ink); color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); box-shadow: 0 0 22px color-mix(in srgb, var(--glow) 30%, transparent); }

/* вкладки с бегущей «пилюлей» */
.tabs { position: relative; display: inline-flex; padding: 4px; border-radius: 30px; border: 1px solid var(--line2); margin-top: 28px; background: color-mix(in srgb, var(--bg) 40%, transparent); backdrop-filter: blur(10px); }
.tabs .pill { position: absolute; top: 4px; bottom: 4px; left: 4px; border-radius: 26px; background: var(--solid); transition: transform .55s var(--ease), width .55s var(--ease); }
.tab { position: relative; z-index: 1; height: 42px; padding: 0 22px; border-radius: 26px; font-size: var(--t-xs); letter-spacing: .2em; text-transform: uppercase; color: var(--ink2); transition: color .4s; }
.tab.sel { color: var(--on-solid); }
.tabs.small .tab { padding: 0 16px; height: 38px; letter-spacing: .12em; }

/* поля */
.f { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.f > span, .f-l { font-size: var(--t-xs); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.f-l { display: block; margin: 6px 0 8px; }
.f input, .f select, .f textarea { width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 45%, transparent); transition: border-color .3s, box-shadow .3s; }
.f select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
html[dir="rtl"] .f select { background-position: 20px 50%, 15px 50%; }
.f select option { background: var(--bg2); color: var(--ink); }
.f input:focus, .f select:focus, .f textarea:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 8%, transparent); }
.f.err input, .consent.err { border-color: #e5484d; animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2.phone { grid-template-columns: 96px 1fr; }
.range input { padding: 0; min-height: 30px; border: 0; background: none; accent-color: var(--ink); }
.range output { font-size: var(--t-sm); }
fieldset { border: 0; } legend { font-size: var(--t-xs); letter-spacing: .26em; text-transform: uppercase; color: var(--ink); margin-bottom: 14px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: var(--t-sm); color: var(--ink2); margin: 10px 0 18px; padding: 10px; border: 1px solid transparent; border-radius: 12px; }
.consent input { width: 18px; height: 18px; accent-color: var(--ink); margin-top: 3px; flex: none; }

/* ---------- Цветовые кнопки ---------- */
.swatches { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); transition: color .3s; }
.swatch i { width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--sw) 60%, #fff), var(--sw) 55%, color-mix(in srgb, var(--sw) 70%, #000));
  box-shadow: 0 0 0 1px var(--line2), inset 0 -4px 8px rgba(0,0,0,.35); transition: transform .4s var(--ease), box-shadow .4s; }
.swatch:hover i { transform: translateY(-3px); }
.swatch.sel { color: var(--ink); }
.swatch.sel i { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--ink), 0 0 26px 4px color-mix(in srgb, var(--gl) 70%, transparent); transform: scale(1.08); }
.swatches.sm { gap: 10px; margin-top: 14px; } .swatches.sm .swatch i { width: 30px; height: 30px; }

/* ---------- Вращающийся мундштук ---------- */
.spin { position: relative; height: 100%; aspect-ratio: 108 / 1200; perspective: 900px; transition: filter .3s, transform .3s; margin: 0 auto; touch-action: pan-y; cursor: grab; }
.spin-stage { position: absolute; inset: 0; transform-style: preserve-3d; }
.spin-plane { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; backface-visibility: visible; will-change: transform, opacity; user-select: none; -webkit-user-drag: none; }
.spin-stage { filter: drop-shadow(0 0 12px color-mix(in srgb, var(--mp-glow) 60%, transparent)); }
.spin-sheen { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat;
  background: linear-gradient(90deg, transparent calc(var(--sx, 0%) - 18%), rgba(255,255,255,.55) var(--sx, 0%), transparent calc(var(--sx, 0%) + 18%)); opacity: .75; }
.spin.swap { filter: brightness(1.6) blur(3px); transform: scale(.97); }
.plinth { position: absolute; left: 50%; bottom: -4%; width: min(280px, 70%); height: 40px; transform: translateX(-50%); pointer-events: none; }
.plinth i { position: absolute; left: 50%; top: 50%; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); transform: translate(-50%, -50%) rotateX(72deg); animation: plinth 4s ease-in-out infinite; }
.plinth i:nth-child(1) { width: 40%; height: 120px; } .plinth i:nth-child(2) { width: 70%; height: 200px; animation-delay: -1.3s; opacity: .6; } .plinth i:nth-child(3) { width: 100%; height: 280px; animation-delay: -2.6s; opacity: .3; }
.plinth::after { content: ""; position: absolute; left: 20%; right: 20%; top: 30%; height: 18px; border-radius: 50%; background: radial-gradient(color-mix(in srgb, var(--glow) 60%, transparent), transparent 70%); filter: blur(6px); }
@keyframes plinth { 0%, 100% { opacity: .2; transform: translate(-50%, -50%) rotateX(72deg) scale(.9); } 50% { opacity: .8; transform: translate(-50%, -50%) rotateX(72deg) scale(1.05); } }

/* ---------- Выбор (музыка) — карточки как в Master DEN ---------- */
.choice-list { display: grid; gap: 12px; width: 100%; max-width: 420px; margin: 28px auto 0; }
.choice { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: var(--r); background: var(--glass); border: 1px solid var(--line); text-align: start; transition: border-color .3s, box-shadow .4s, transform .2s; backdrop-filter: blur(12px); }
.choice:hover { border-color: var(--line2); }
.choice.sel, .choice.was { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), 0 0 30px color-mix(in srgb, var(--ink) 20%, transparent); }
.choice.was:not(.sel) { box-shadow: none; }
.choice-ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--ink) 8%, transparent); flex: none; }
.choice-ic.eq { display: flex; gap: 3px; align-items: center; justify-content: center; }
.choice-ic.eq i { width: 3px; height: 6px; border-radius: 2px; background: var(--ink); animation: eq 1s ease-in-out infinite; }
.choice-ic.eq i:nth-child(2) { animation-delay: -.3s; } .choice-ic.eq i:nth-child(3) { animation-delay: -.6s; } .choice-ic.eq i:nth-child(4) { animation-delay: -.15s; }
.choice-txt { display: flex; flex-direction: column; gap: 2px; } .choice-txt b { font-weight: 500; font-size: var(--t-md); } .choice-txt small { color: var(--muted); }

/* ---------- Мелочи ---------- */
.online, .dot-on { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pdot 2s infinite; }
@keyframes pdot { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.6); } 70% { box-shadow: 0 0 0 9px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
#chatFab { position: fixed; z-index: 40; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; background: var(--solid); color: var(--on-solid); box-shadow: var(--shadow); animation: goGlow 3.2s ease-in-out infinite; transition: transform .3s var(--ease); }
html[dir="rtl"] #chatFab { right: auto; left: max(18px, env(safe-area-inset-left)); }
#chatFab svg { width: 24px; height: 24px; } #chatFab .online { position: absolute; top: 6px; right: 6px; border: 2px solid var(--solid); width: 13px; height: 13px; }
#toast { position: fixed; left: 50%; bottom: 96px; z-index: 300; transform: translate(-50%, 20px); opacity: 0; padding: 12px 22px; border-radius: 30px; background: var(--solid); color: var(--on-solid); font-size: var(--t-sm); pointer-events: none; transition: all .4s var(--ease); max-width: 90vw; text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; align-items: center; }
.cta-row.center { justify-content: center; }
.n { font-size: var(--t-xs); letter-spacing: .1em; color: var(--muted); font-variant-numeric: tabular-nums; }
