/* ============ Twistory: оформление сайта ============
   Идея: у сюжета две ветки. Фиолетовая — ответ А, коралловая — ответ Б.
   Эти два цвета повторяются в логотипе, кнопках выбора, обложках и живом фоне. */

@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

:root {
  --aur1: rgba(162,31,58,.14); --aur2: rgba(201,148,31,.12); --aur3: rgba(122,29,51,.08);
  --ease: cubic-bezier(.22,1,.36,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
  --dock-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --aur1: rgba(194,51,77,.24); --aur2: rgba(217,164,65,.16); --aur3: rgba(120,30,60,.18); }
}
:root[data-theme="dark"] { --aur1: rgba(194,51,77,.24); --aur2: rgba(217,164,65,.16); --aur3: rgba(120,30,60,.18); }

html { scroll-behavior: smooth; }
body { background: var(--bg); position: relative; overflow-x: clip; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* живой фон: три медленных пятна и лёгкое зерно */
body::before {
  content: ""; position: fixed; inset: -25vmax; z-index: -2; pointer-events: none;
  background:
    radial-gradient(38vmax 38vmax at 12% 8%, var(--aur1), transparent 62%),
    radial-gradient(34vmax 34vmax at 88% 18%, var(--aur2), transparent 62%),
    radial-gradient(44vmax 44vmax at 58% 98%, var(--aur3), transparent 62%);
  animation: drift 30s ease-in-out infinite alternate;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}
@keyframes drift { from { transform: translate3d(-2vmax,-1vmax,0) scale(1); } to { transform: translate3d(3vmax,2vmax,0) scale(1.12); } }

a { color: var(--accent); }
h1, h2, h3 { text-wrap: balance; }

/* ---------- навигация: плавающая «таблетка» ---------- */
.dock { position: fixed; z-index: 30; top: 14px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 24px); }
.dock-in {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 14px; border-radius: 99px;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 8px 30px -12px rgba(30,5,15,.35);
}
.logo { display: inline-flex; align-items: center; gap: 8px; font: 700 17px/1 var(--f-display); color: var(--ink); text-decoration: none; letter-spacing: -.03em; padding: 8px 10px 8px 0; }
.logo svg { flex: none; transition: transform .6s var(--spring); }
.logo:hover svg { transform: rotate(-12deg) scale(1.12); }
.logo b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font: inherit; }
.nav { position: relative; display: flex; align-items: center; gap: 2px; }
.nav a, .nav button.navbtn {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; background: none; border: 0; color: var(--muted);
  text-decoration: none; font: 600 14px var(--f-body); padding: 9px 14px; border-radius: 99px; min-height: 40px; cursor: pointer;
  transition: color .25s;
}
.nav a:hover, .nav button.navbtn:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav .ico { width: 18px; height: 18px; flex: none; }
.nav-pill { position: absolute; z-index: 0; top: 0; left: 0; border-radius: 99px; background: var(--accent-soft); border: 1px solid var(--line); opacity: 0; transition: transform .45s var(--spring), width .45s var(--spring), opacity .2s; }
.iconb.burger { display: none; }
.tool-d { display: contents; }
.nav-extra { display: none; }
.nav-pill.on { opacity: 1; }
.dock-tools { display: flex; align-items: center; gap: 4px; padding-left: 6px; border-left: 1px solid var(--line); margin-left: 4px; }
.dock-tools select { font: 600 13px var(--f-body); background: transparent; color: var(--ink); border: 0; padding: 8px 4px; cursor: pointer; border-radius: 10px; }
.dock-tools select option { color: #111; }
.iconb { background: none; border: 0; color: var(--ink); width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .2s, transform .5s var(--spring); }
.iconb:hover { background: var(--accent-soft); }
.iconb:active { transform: rotate(40deg) scale(.9); }
.cta2 { background: var(--grad) !important; color: #fff !important; box-shadow: var(--glow); }
.cta2:hover { filter: brightness(1.08); }

@media (max-width: 760px) {
  .dock { top: 0; left: 0; right: 0; transform: none; width: auto; max-width: none; }
  .dock-in { border-radius: 0; border-width: 0 0 1px; padding: 8px 12px; justify-content: space-between; backdrop-filter: none; -webkit-backdrop-filter: none; background: color-mix(in srgb, var(--bg) 97%, transparent); box-shadow: none; }
  .dock-in .nav { display: none; position: fixed; z-index: 31; left: 12px; right: 12px; top: 58px; flex-direction: column; align-items: stretch; gap: 2px; padding: 8px; border-radius: 20px; max-height: calc(100vh - 80px); overflow-y: auto;
    background: var(--surface); border: 1px solid var(--line); box-shadow: 0 18px 50px -12px rgba(10,5,40,.55); }
  .dock.menu-open .nav, #top.menu-open .nav { display: flex; }
  .nav a, .nav button.navbtn { flex-direction: row; gap: 12px; font-size: 16px; padding: 12px 14px; min-height: 48px; justify-content: flex-start; border-radius: 14px; }
  .nav a[aria-current="page"] { background: var(--accent-soft); }
  .nav-pill { display: none; }
  .nav .ico { width: 22px; height: 22px; }
  .nav-rules { display: flex !important; }
  .iconb.burger { display: inline-flex; }
  .tool-d { display: none; }
  .nav-extra { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
  .nav .ne-theme svg { width: 22px; height: 22px; flex: none; }
  .ne-row { display: flex; align-items: center; gap: 8px; }
  .nav .iconb.ne-theme { width: auto; flex: 1; border-radius: 14px; height: 48px; gap: 12px; justify-content: flex-start; padding: 0 14px; font: 600 16px var(--f-body); color: var(--muted); }
  .nav-extra select { height: 48px; padding: 0 12px; border-radius: 14px; background: var(--accent-soft); color: var(--ink); border: 0; }
  .dock-tools { border: 0; margin: 0; padding: 0; }
  body.immersive { padding-bottom: 0; }
}

/* ---------- страницы ---------- */
.page { max-width: 1100px; margin: 0 auto; padding-block: 100px 56px; min-height: 70vh; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.page.narrow { max-width: 480px; }
.page.mid { max-width: 780px; }
.page.home { max-width: none; padding-block: 0 24px; gap: 0; margin-inline: -16px; }
body.immersive .dock, body.immersive .foot { display: none; }
body.immersive .page { max-width: none; padding: 0; min-height: 100%; }
.foot { max-width: 1100px; margin: 0 auto; padding: 22px 0 36px; color: var(--muted); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); }
.foot .logo { font-size: 14px; padding: 0; }
@media (max-width: 760px) { .page { padding-block: 76px 40px; } .foot { padding-bottom: 28px; } }

/* ---------- кнопки ---------- */
.btn { position: relative; overflow: hidden; background: var(--grad); color: #fff; border: 0; border-radius: 14px; padding: 13px 20px; font-weight: 700; min-height: 48px; box-shadow: var(--glow); transition: transform .25s var(--spring), filter .2s, box-shadow .3s; }
.btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-120%); }
.btn:hover::after { transform: translateX(120%); transition: transform .8s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost::after { display: none; }
.btn.ghost:hover { border-color: var(--accent); }
.btn.danger { background: var(--bad); color: #fff; box-shadow: none; }
.btn.inline { width: auto; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn.big { padding: 16px 26px; font-size: 16px; border-radius: 16px; min-height: 54px; }
a.btn { text-decoration: none; }
.sbtn { background: var(--grad); color: #fff; border: 0; border-radius: 12px; padding: 9px 16px; min-height: 40px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; transition: transform .25s var(--spring), filter .2s; }
.sbtn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.sbtn:active { transform: scale(.96); }
.sbtn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.sbtn.bad { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.pubbtn { background: var(--grad); color: #fff; box-shadow: var(--glow); }

/* ---------- главная ---------- */
.hero { position: relative; padding: 112px 16px 40px; overflow: hidden; }
.hero-in { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: minmax(0,1.08fr) minmax(0,.92fr); gap: 32px; align-items: center; }
.hero-copy { position: relative; z-index: 2; }
.hero h1 { font: 700 clamp(36px, 6.4vw, 70px)/1.02 var(--f-display); letter-spacing: -.04em; margin: 0 0 20px; }
.hero h1 .ln { display: block; overflow: hidden; padding-bottom: .08em; }
.hero h1 .ln > span { display: block; transform: translateY(105%); animation: rise .9s var(--ease) forwards; animation-delay: calc(.1s + var(--i) * .12s); }
@keyframes rise { to { transform: none; } }
.hero p.lead { font-size: clamp(16px, 2vw, 19px); color: var(--muted); max-width: 46ch; margin: 0 0 28px; opacity: 0; animation: fadein .8s .55s var(--ease) forwards; }
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; opacity: 0; animation: fadein .8s .75s var(--ease) forwards; }
.hero .proof { margin-top: 26px; color: var(--muted); font-size: 14px; display: flex; gap: 10px; align-items: center; opacity: 0; animation: fadein .8s .95s var(--ease) forwards; }
.hero .proof i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: ping 2s infinite; }
@keyframes fadein { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 10px transparent; } }

.paths { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .9; }
.paths path { fill: none; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 6 14; animation: flow 6s linear infinite; }
.paths .a { stroke: var(--accent); }
.paths .b { stroke: var(--accent2); animation-duration: 8s; }
@keyframes flow { to { stroke-dashoffset: -200; } }

/* телефон с живой историей */
.stage { position: relative; display: flex; justify-content: center; min-height: 650px; perspective: 1200px; }
.phone {
  position: relative; z-index: 2; width: min(310px, 82vw); height: 640px; border-radius: 42px; padding: 9px;
  background: linear-gradient(160deg, var(--surface2), var(--surface)); border: 1px solid var(--line);
  box-shadow: 0 40px 90px -30px rgba(60,5,20,.6), 0 0 0 1px rgba(255,255,255,.04) inset, var(--glow);
  transform: rotateY(var(--rx, -8deg)) rotateX(var(--ry, 4deg)); transition: transform .25s ease-out;
  opacity: 0; animation: phone-in 1.1s .2s var(--ease) forwards;
}
@keyframes phone-in { from { opacity: 0; translate: 0 50px; scale: .94; } to { opacity: 1; translate: 0 0; scale: 1; } }
.screen { height: 100%; border-radius: 34px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; position: relative; }
.screen::before { content: ""; position: absolute; top: 8px; left: 50%; width: 76px; height: 20px; border-radius: 99px; background: #000; transform: translateX(-50%); opacity: .85; z-index: 3; }
.dm-top { display: flex; gap: 10px; align-items: center; padding: 8px 14px 10px 8px; border-bottom: 1px solid var(--line); background: var(--surface); }
.dm-ava { position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; color: var(--accent-ink); font: 700 14px var(--f-display); }
.dm-top strong { display: block; font-size: 14px; line-height: 1.1; }
.dm-top span { font-size: 11px; color: var(--ok); }
.dm-chat { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 14px 12px; overflow: hidden; }
.dm-b { max-width: 82%; padding: 9px 13px; border-radius: 18px 18px 18px 5px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; line-height: 1.35; animation: bpop .45s var(--spring) both; }
.dm-b.me { align-self: flex-end; border-radius: 18px 18px 5px 18px; color: var(--accent-ink); border-color: transparent; }
.dm-b.me.a { background: var(--accent); } .dm-b.me.b { background: linear-gradient(135deg, var(--accent2), #d9703c); color: #fff; }
.dm-b.n { align-self: center; background: none; border: 0; color: var(--muted); font-size: 12px; text-align: center; padding: 2px 8px; }
.dm-b small { display: block; font: 600 11px var(--f-body); color: var(--accent3); margin-bottom: 2px; }
.dm-typing { align-self: flex-start; display: flex; gap: 4px; padding: 13px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 18px 5px; }
.dm-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.dm-typing i:nth-child(2) { animation-delay: .15s; } .dm-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bpop { from { opacity: 0; transform: translateY(14px) scale(.85); } to { opacity: 1; transform: none; } }
.dm-choices { padding: 10px 12px 18px; display: flex; flex-direction: column; gap: 8px; min-height: 124px; justify-content: flex-end; border-top: 1px solid var(--line); background: var(--surface); }
.dm-fork { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.dm-opt { text-align: left; display: flex; gap: 10px; align-items: center; border-radius: 14px; padding: 10px 12px; border: 1.5px solid var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); color: var(--ink); font: 600 13px var(--f-body); cursor: pointer; animation: slidein .5s var(--spring) both; animation-delay: calc(var(--k) * .09s); transition: transform .25s var(--spring), background .2s; }
.dm-opt:hover { transform: translateX(4px); background: color-mix(in srgb, var(--c) 22%, transparent); }
.dm-opt b { width: 22px; height: 22px; border-radius: 7px; background: var(--c); color: #fff; display: grid; place-items: center; font: 700 12px var(--f-mono); flex: none; }
.dm-opt.picked { transform: scale(1.03); background: var(--c); color: #fff; }
.dm-opt.gone { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
@keyframes slidein { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }
.dm-rewind { align-self: center; font: 600 11px var(--f-mono); color: var(--accent3); animation: bpop .4s var(--spring) both; }

.dm-status { display: flex; align-items: center; justify-content: space-between; padding: 11px 22px 4px; font: 700 11px var(--f-body); color: var(--ink); background: var(--surface); position: relative; z-index: 2; }
.dm-status b { font-weight: 700; }
.dm-sig { margin-left: auto; margin-right: 8px; display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.dm-sig i { width: 3px; background: var(--ink); border-radius: 1px; } .dm-sig i:nth-child(1) { height: 4px; } .dm-sig i:nth-child(2) { height: 6px; } .dm-sig i:nth-child(3) { height: 8px; } .dm-sig i:nth-child(4) { height: 10px; opacity: .35; }
.dm-bat { width: 20px; height: 10px; border: 1.5px solid var(--ink); border-radius: 3px; position: relative; }
.dm-bat::before { content: ""; position: absolute; inset: 1px; right: 4px; background: var(--ink); border-radius: 1px; }
.dm-bat::after { content: ""; position: absolute; right: -4px; top: 2px; width: 2px; height: 4px; background: var(--ink); border-radius: 0 1px 1px 0; }
.dm-back { font: 400 30px/1 var(--f-body); color: var(--accent); width: 18px; text-align: center; margin-top: -4px; }
.dm-on { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid var(--surface); }
.dm-nm { min-width: 0; flex: 1; }
.dm-ch { font: 600 10px var(--f-mono); letter-spacing: .04em; padding: 4px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.dm-pin { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: color-mix(in srgb, var(--surface) 70%, var(--bg)); border-bottom: 1px solid var(--line); }
.dm-cov { flex: none; width: 28px; height: 36px; border-radius: 6px; background: var(--grad); box-shadow: 0 4px 10px -4px #0008; position: relative; }
.dm-cov::after { content: ""; position: absolute; left: 5px; right: 5px; top: 22px; height: 2px; border-radius: 2px; background: #fff9; box-shadow: 0 5px 0 #fff6; }
.dm-ptx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dm-ptx strong { font: 700 12px var(--f-display); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-bar { display: block; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.dm-bar i { display: block; height: 100%; border-radius: 4px; background: var(--grad); animation: barin 1.4s 1.2s var(--ease) both; }
@keyframes barin { from { width: 0 !important; } }
.dm-pin > em { font: 700 11px var(--f-mono); font-style: normal; color: var(--accent); }
.dm-t { display: block; text-align: right; font: 500 9.5px var(--f-body); font-style: normal; opacity: .55; margin-top: 3px; }
.dm-b.n.stat { color: var(--accent); font: 600 11px var(--f-mono); background: var(--accent-soft); border-radius: 99px; padding: 4px 12px; }
.dm-choices::after { content: ""; align-self: center; flex: none; width: 96px; height: 4px; border-radius: 4px; background: var(--ink); opacity: .3; margin-top: 4px; }
.dm-choices { padding-bottom: 10px; }
.dm-opt b { color: var(--accent-ink); }
.dm-opt:nth-child(2) b, .dm-opt.picked { color: #fff; }
.dm-opt:first-child.picked { color: var(--accent-ink); }
.chip-float.c4 { top: 40px; right: -6px; animation-delay: -1.2s; } .chip-float.c5 { bottom: 140px; left: -36px; animation-delay: -3.3s; }
.stage .chip-float i { background: var(--accent); } .stage .chip-float.c2 i, .stage .chip-float.c5 i { background: var(--accent2); }
.chip-float { position: absolute; z-index: 3; padding: 8px 14px; border-radius: 99px; font: 600 12px var(--f-body); background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: floaty 7s ease-in-out infinite; white-space: nowrap; box-shadow: 0 10px 30px -10px rgba(30,5,15,.4); }
.chip-float.c1 { top: 70px; left: -4px; } .chip-float.c2 { top: 300px; left: -26px; animation-delay: -2.5s; } .chip-float.c3 { bottom: 70px; left: 6px; animation-delay: -4.5s; }
.chip-float i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--c); }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-14px) rotate(1.5deg); } }

@media (max-width: 900px) {
  .hero { padding-top: 84px; }
  .hero-in { grid-template-columns: 1fr; }
  .stage { min-height: 600px; margin-top: 6px; }
  .chip-float.c1 { left: 0; } .chip-float.c2 { left: 0; } .chip-float.c5 { right: 0; } .chip-float.c4 { right: 0; top: 20px; }
}

/* лента жанров */
.ribbon { overflow: hidden; padding: 18px 0; border-block: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 55%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ribbon-track { display: flex; gap: 12px; width: max-content; animation: marquee 46s linear infinite; }
.ribbon:hover .ribbon-track { animation-play-state: paused; }
.ribbon a { display: inline-flex; align-items: center; gap: 10px; padding: 10px 20px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font: 700 15px var(--f-display); letter-spacing: -.02em; white-space: nowrap; transition: transform .3s var(--spring), border-color .2s, background .2s; }
.ribbon a i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 14px var(--c); }
.ribbon a:hover { transform: translateY(-3px) rotate(-1.5deg); border-color: var(--c); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* секции главной */
.sec-in { max-width: 1100px; margin: 0 auto; padding: 84px 16px 0; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.sec-head h2 { font: 700 clamp(26px, 4vw, 42px)/1.05 var(--f-display); letter-spacing: -.035em; margin: 0; max-width: 18ch; }
.sec-head p { margin: 0; color: var(--muted); max-width: 44ch; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: st; }
.step { position: relative; padding: 22px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; overflow: hidden; transition: transform .4s var(--ease), border-color .3s; }
.step:hover { transform: translateY(-6px); border-color: var(--accent); }
.step::before { counter-increment: st; content: counter(st); position: absolute; right: 18px; top: 8px; font: 700 76px/1 var(--f-display); color: var(--accent-soft); letter-spacing: -.05em; pointer-events: none; }
.step h3 { margin: 0; font: 700 19px/1.2 var(--f-display); letter-spacing: -.02em; position: relative; }
.step p { margin: 0; color: var(--muted); position: relative; }
.viz { height: 150px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; justify-content: flex-end; gap: 7px; overflow: hidden; position: relative; }
.viz .vb { height: 22px; border-radius: 12px 12px 12px 4px; background: var(--surface2); width: 62%; animation: vcycle 6s infinite; animation-delay: calc(var(--d) * 1s); opacity: 0; }
.viz .vb.r { align-self: flex-end; border-radius: 12px 12px 4px 12px; background: var(--accent); width: 46%; }
.viz .vb.w { width: 74%; }
@keyframes vcycle { 0%, 8% { opacity: 0; transform: translateY(10px) scale(.9); } 14%, 78% { opacity: 1; transform: none; } 92%, 100% { opacity: 0; } }
.viz.two { justify-content: center; }
.viz .vo { height: 38px; border-radius: 12px; border: 1.5px solid var(--c); display: flex; align-items: center; gap: 10px; padding: 0 10px; font: 600 13px var(--f-body); color: var(--ink); animation: vpick 5s infinite; animation-delay: calc(var(--d) * 1s); }
.viz .vo b { width: 20px; height: 20px; border-radius: 6px; background: var(--c); color: #fff; display: grid; place-items: center; font: 700 11px var(--f-mono); }
@keyframes vpick { 0%, 35% { background: transparent; transform: none; } 45%, 70% { background: color-mix(in srgb, var(--c) 28%, transparent); transform: translateX(6px); } 85%, 100% { background: transparent; transform: none; } }
.viz.ed { gap: 9px; justify-content: flex-start; }
.viz .ln { height: 12px; border-radius: 6px; background: var(--surface2); transform-origin: left; animation: type 5s infinite; animation-delay: calc(var(--d) * 1s); }
.viz .ln.hl { background: color-mix(in srgb, var(--accent) 55%, var(--surface2)); }
.viz .caret { display: inline-block; width: 2px; height: 14px; background: var(--accent2); animation: blink2 .9s steps(1) infinite; }
@keyframes type { 0% { transform: scaleX(0); } 30%, 90% { transform: scaleX(var(--w, 1)); } 100% { transform: scaleX(0); } }
@keyframes blink2 { 50% { opacity: 0; } }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* карточки историй с генеративной обложкой */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.scard { position: relative; display: flex; flex-direction: column; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; text-decoration: none; color: var(--ink); isolation: isolate; transition: transform .45s var(--ease), border-color .3s, box-shadow .4s; }
.scard::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity .3s; background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.14), transparent 45%); }
.scard:hover { transform: translateY(-8px); border-color: color-mix(in srgb, var(--c1, var(--accent)) 60%, var(--line)); box-shadow: 0 30px 60px -28px color-mix(in srgb, var(--c1, var(--accent)) 70%, transparent); }
.scard:hover::after { opacity: 1; }
.cover { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--c1), var(--c2)); overflow: hidden; }
.cover svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .8s var(--ease); }
.scard:hover .cover svg { transform: scale(1.07) rotate(-1deg); }
.cover svg path { fill: none; stroke: rgba(255,255,255,.78); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 1.6s var(--ease) forwards; animation-delay: calc(var(--k, 0) * .08s); }
.cover svg circle { fill: #fff; opacity: 0; animation: fadein .5s 1.2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.cover .gtag { position: absolute; left: 12px; bottom: 10px; z-index: 2; padding: 4px 10px; border-radius: 99px; background: rgba(10,6,30,.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #fff; font: 600 12px var(--f-body); }
.cover .age { position: absolute; right: 12px; top: 10px; z-index: 2; padding: 3px 8px; border-radius: 8px; background: #fff; color: #c0233a; font: 800 12px var(--f-mono); }
.sbody { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.sbody h2 { font: 700 19px/1.2 var(--f-display); letter-spacing: -.025em; margin: 0; }
.sbody .blurb { margin: 0; color: var(--muted); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sbody .meta { margin-top: auto; padding-top: 6px; font: 500 12px var(--f-mono); color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font: 600 11.5px var(--f-body); padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); background: transparent; }
.badge.on { background: var(--grad); border-color: transparent; color: #fff; }

/* для авторов */
.writers { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 36px; align-items: center; }
.writers ul { list-style: none; padding: 0; margin: 18px 0 26px; display: flex; flex-direction: column; gap: 12px; }
.writers li { display: flex; gap: 12px; align-items: flex-start; }
.writers li svg { flex: none; margin-top: 3px; color: var(--ok); }
.mock { position: relative; padding: 18px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--glow); display: flex; flex-direction: column; gap: 10px; transform: rotate(1.5deg); transition: transform .6s var(--ease); }
.mock:hover { transform: rotate(0deg) translateY(-6px); }
.mock .mk { border-radius: 14px; border: 1px solid var(--line); padding: 10px 12px; background: var(--bg); display: flex; flex-direction: column; gap: 6px; }
.mock .mk .lbl { font: 600 11px var(--f-body); color: var(--muted); }
.mock .mk.me { margin-left: 18%; border-color: var(--accent); }
.mock .fork { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mock .fork > div { border-radius: 14px; padding: 10px 12px; border: 1.5px solid var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); display: flex; flex-direction: column; gap: 6px; animation: vglow 4s infinite; animation-delay: calc(var(--d) * 1s); }
@keyframes vglow { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); } }
.mock .fork b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--c); color: #fff; font: 700 11px var(--f-mono); }
.mock .bar2 { height: 9px; border-radius: 5px; background: var(--surface2); }
@media (max-width: 860px) { .writers { grid-template-columns: 1fr; } }

.final { margin: 84px 16px 0; }
.final-in { max-width: 1100px; margin: 0 auto; position: relative; border-radius: 32px; padding: 3px; background: conic-gradient(from var(--ang), var(--accent), var(--accent2), var(--accent3), var(--accent)); animation: spin 6s linear infinite; }
@keyframes spin { to { --ang: 360deg; } }
.final-box { border-radius: 29px; padding: clamp(32px, 6vw, 64px); background: var(--bg2); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.final-box h2 { font: 700 clamp(26px, 4.4vw, 46px)/1.05 var(--f-display); letter-spacing: -.035em; margin: 0; max-width: 20ch; }
.final-box p { margin: 0; color: var(--muted); max-width: 46ch; }

/* появление при прокрутке */
.rv { opacity: 0; transform: translateY(28px) scale(.98); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.rv.shown { opacity: 1; transform: none; }

/* ---------- каталог ---------- */
.intro { padding-block: 6px 4px; }
.intro h1 { font: 700 clamp(28px, 5vw, 46px)/1.05 var(--f-display); margin: 0 0 10px; letter-spacing: -.035em; }
.intro p { margin: 0; color: var(--muted); max-width: 60ch; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); position: sticky; top: 74px; z-index: 8; }
.filters .in { flex: 1 1 220px; }
.filters select.in { flex: 0 1 auto; }
.in, .filters select { font: inherit; font-size: 15px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; min-height: 42px; min-width: 0; max-width: 100%; transition: border-color .2s, box-shadow .2s; }
.in:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.gchips { display: flex; flex-wrap: wrap; gap: 8px; }
.sc { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 99px; padding: 7px 14px; font: 600 14px var(--f-body); min-height: 36px; cursor: pointer; transition: transform .3s var(--spring), background .2s, border-color .2s; }
.sc:hover { transform: translateY(-2px); border-color: var(--accent); }
.sc[aria-current="true"] { background: var(--grad); color: #fff; border-color: transparent; }
.sc.add { border-style: dashed; color: var(--accent); }
.sc small { opacity: .7; margin-left: 6px; font-family: var(--f-mono); }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.skel { border-radius: 24px; height: 300px; background: linear-gradient(100deg, var(--surface) 30%, var(--surface2) 50%, var(--surface) 70%); background-size: 300% 100%; animation: shimmer 1.4s infinite; border: 1px solid var(--line); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- формы ---------- */
.authwrap { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 32px; align-items: center; max-width: 920px; margin: 0 auto; width: 100%; }
.authside { position: relative; min-height: 420px; border-radius: 28px; overflow: hidden; background: linear-gradient(150deg, var(--accent), #b8452e 55%, var(--accent2)); padding: 28px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
.authside h2 { font: 700 26px/1.1 var(--f-display); letter-spacing: -.03em; margin: 0; }
.authside p { margin: 0; opacity: .9; }
.authside .fb { position: absolute; padding: 9px 14px; border-radius: 18px 18px 18px 5px; background: rgba(255,255,255,.18); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.3); font-size: 14px; animation: floaty 6s ease-in-out infinite; }
.authside .fb.r { border-radius: 18px 18px 5px 18px; background: rgba(255,255,255,.9); color: #2a1a6a; }
.formcard { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.formcard h1 { font: 700 28px/1.1 var(--f-display); letter-spacing: -.03em; margin: 0; }
.fld > .in { width: 100%; }
@media (max-width: 820px) { .authwrap { grid-template-columns: 1fr; } .authside { display: none; } }

/* ---------- страница истории и канала ---------- */
.sp { display: flex; flex-direction: column; gap: 16px; }

.sp h1, .chdr h1 { font: 700 clamp(26px, 4.6vw, 40px)/1.08 var(--f-display); letter-spacing: -.035em; margin: 0; }
.blurbfull { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 17px; line-height: 1.6; margin: 0; }
.row2 { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chdr { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ava { width: 72px; height: 72px; border-radius: 22px; flex: none; }
.gate { background: var(--surface); border: 1px solid var(--warn); border-radius: 24px; padding: 26px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- кабинет и общие блоки ---------- */
.wh { font: 700 clamp(22px, 3.6vw, 30px)/1.12 var(--f-display); letter-spacing: -.03em; margin: 0; }
.item { display: flex; flex-direction: column; gap: 10px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; min-width: 0; transition: border-color .25s, transform .35s var(--ease); }
.item:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.item h2 { font: 700 19px/1.2 var(--f-display); letter-spacing: -.02em; margin: 0; }
.ltabs { display: flex; gap: 4px; padding: 5px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 4px; overflow-x: auto; scrollbar-width: none; position: relative; }
.ltabs .tab { flex: 1; border: 0; border-radius: 12px; padding: 10px 12px; font: 600 14px var(--f-body); color: var(--muted); background: transparent; transition: color .2s, background .3s; white-space: nowrap; }
.ltabs .tab[aria-selected="true"] { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.cnt { background: color-mix(in srgb, currentColor 18%, transparent); color: inherit; }
.list { display: flex; flex-direction: column; gap: 12px; }
.err { color: var(--bad); font-size: 14px; margin: 0; }
.okmsg { color: var(--ok); font-size: 14px; margin: 0; }
.box.left { text-align: left; }
.overlay { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeo .25s both; }
.overlay .box { animation: bpop .4s var(--spring) both; border-radius: 24px; }
@keyframes fadeo { from { opacity: 0; } }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.stat b { display: block; font: 700 26px var(--f-display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font: 500 12px var(--f-mono); color: var(--muted); }
.rule h2 { font: 700 20px var(--f-display); margin: 26px 0 6px; letter-spacing: -.02em; }
.rule { max-width: 70ch; }
.rule ul { padding-left: 20px; margin: 6px 0; }
.toast { background: var(--ink); color: var(--bg); animation: bpop .4s var(--spring) both; }

/* ---------- читалка: цвета веток ---------- */
.bar, .edtop { background: var(--glass); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); }
.bubble { border-radius: 20px 20px 20px 6px; }
.msg { animation: bpop .45s var(--spring) both; }
.msg.me .bubble { background: var(--accent); color: var(--accent-ink); border-radius: 20px 20px 6px 20px; box-shadow: 0 8px 22px -10px var(--accent); }
.narr, .shot, .chap { animation: fadein .5s var(--ease) both; }
.chap { font-weight: 700; }
.panel { background: var(--glass); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); }
.opt { --c: var(--accent); border-radius: 16px; border: 1.5px solid var(--c); background: color-mix(in srgb, var(--c) 8%, var(--surface)); font-weight: 600; padding-left: 14px; flex-direction: row; align-items: center; gap: 12px; animation: slidein .5s var(--spring) both; animation-delay: calc(var(--k, 0) * .08s); transition: transform .3s var(--spring), background .2s; }
.opt .lt { width: 24px; height: 24px; border-radius: 8px; background: var(--c); color: #fff; display: grid; place-items: center; font: 700 12px var(--f-mono); flex: none; }
.opt .tx { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.opt:hover { transform: translateX(5px); background: color-mix(in srgb, var(--c) 20%, var(--surface)); }
.opt.k1 { --c: var(--accent2); } .opt.k2 { --c: var(--accent3); } .opt.k3 { --c: var(--ok); } .opt.k4 { --c: #4cc2ff; }
.opt.picked { background: var(--c); color: #fff; transform: scale(1.02); }
.opt.picked .lt { background: #fff; color: var(--c); }
.opt.gone { opacity: 0; transform: translateY(10px); transition: opacity .22s, transform .22s; }
.typing i { background: var(--accent); }
.endmark { border-image: var(--grad) 1; color: var(--accent); }

/* ---------- появление страницы ---------- */
main.enter { animation: pgin .55s var(--ease) both; }
@keyframes pgin { from { opacity: 0; transform: translateY(16px); } }

/* логотип и иконки */
.logo .a { stroke: var(--accent); } .logo .b { stroke: var(--accent2); }
.logo .dot { fill: var(--ink); }
.nav-pill { height: 0; width: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .rv { opacity: 1; transform: none; }
  .hero h1 .ln > span, .hero p.lead, .hero .cta-row, .hero .proof, .phone { opacity: 1; transform: none; translate: none; scale: none; }
  .cover svg path { stroke-dashoffset: 0; } .cover svg circle { opacity: 1; }
}
[hidden] { display: none !important; }
.writers > *, .writers li span { min-width: 0; }
.writers li span { flex: 1; overflow-wrap: anywhere; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; text-decoration: none; font-weight: 700; transition: top .2s; }
.skip:focus { top: 12px; }
@media (max-width: 760px) { .paths { opacity: .35; } }
.page.home > * { width: 100%; box-sizing: border-box; }
.writers li .ico { width: 22px; height: 22px; }
.writers > div:first-child { background: none; border: 0; padding: 0; }
.page.home > .final { width: calc(100% - 32px); }

/* ---------- аватарки, свои обложки ---------- */
.ava { --s: 40px; --hue: 262; width: var(--s); height: var(--s); border-radius: 50%; flex: none; overflow: hidden; display: inline-grid; place-items: center; background: var(--surface2); border: 1px solid var(--line); }
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava.ph { background: linear-gradient(135deg, hsl(var(--hue) 85% 62%), hsl(calc(var(--hue) + 50) 85% 58%)); color: #fff; border: 0; font: 700 calc(var(--s) * .42)/1 var(--f-display); }
.cover .cimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.scard:hover .cover .cimg { transform: scale(1.06); }
.cover:has(.cimg)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(10,6,30,.45)); pointer-events: none; }
.sbody .meta { display: flex; align-items: center; gap: 8px; }
.byline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chdr { align-items: center; }
.chinfo { flex: 1 1 220px; min-width: 0; }
.chdr > .ava { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.chtop { display: flex; gap: 16px; align-items: center; }
.avabox { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.avactl { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.coverpick { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.coverpick .cover { width: 220px; border-radius: 16px; border: 1px solid var(--line); flex: none; }

/* ---------- топы ---------- */
.toplist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); grid-auto-flow: column; grid-template-rows: repeat(5, auto); gap: 12px 20px; counter-reset: tp; }
.toprow { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 8px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: transform .35s var(--spring), border-color .25s, box-shadow .3s; min-width: 0; }
.toprow:hover { transform: translateX(6px); border-color: var(--c1); box-shadow: 0 14px 34px -18px var(--c1); }
.toprank { width: 40px; flex: none; text-align: center; font: 700 30px/1 var(--f-display); letter-spacing: -.05em; background: linear-gradient(160deg, var(--c1), var(--c2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topth { width: 56px; height: 56px; border-radius: 14px; flex: none; background: linear-gradient(135deg, var(--c1), var(--c2)); overflow: hidden; }
.topth img { width: 100%; height: 100%; object-fit: cover; display: block; }
.toptx { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.toptx strong { font: 700 16px/1.2 var(--f-display); letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toptx small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topviews { font: 600 12px var(--f-mono); color: var(--muted); white-space: nowrap; }
.authors { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.acard { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 12px 16px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: transform .4s var(--spring), border-color .25s, box-shadow .3s; min-width: 0; }
.acard:hover { transform: translateY(-6px) rotate(-.6deg); border-color: var(--accent); box-shadow: var(--glow); }
.acard strong { font: 700 16px/1.15 var(--f-display); letter-spacing: -.02em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acard small { color: var(--muted); font-size: 12.5px; }
.arank { position: absolute; top: 10px; left: 12px; font: 700 13px var(--f-mono); color: var(--muted); }
.acard.podium .ava { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent3); }
.acard.podium:nth-child(1) .arank { color: var(--accent3); }
@media (max-width: 860px) {
  .toplist { grid-template-columns: minmax(0,1fr); grid-auto-flow: row; grid-template-rows: none; }
  .authors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- реакции, комментарии, посты ---------- */
.react { display: flex; gap: 8px; align-items: center; }
.rbtn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; min-height: 38px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font: 600 14px var(--f-body); cursor: pointer; transition: transform .25s var(--spring), background .2s, border-color .2s; }
.rbtn:hover { transform: translateY(-2px); border-color: var(--accent); }
.rbtn:active { transform: scale(.92); }
.rbtn .ic { font-size: 12px; transition: transform .35s var(--spring); }
.rbtn[aria-pressed="true"] { background: var(--grad); color: #fff; border-color: transparent; }
.rbtn.down[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.rbtn[aria-pressed="true"] .ic { transform: scale(1.35); }
.cm { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.cm-h { margin: 0; font: 700 20px var(--f-display); letter-spacing: -.02em; }
.cm-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cm-form textarea { width: 100%; height: 72px; resize: vertical; }
.cm-list { display: flex; flex-direction: column; gap: 10px; }
.cm-item { padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); animation: fadein .4s var(--ease) both; }
.cm-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cm-name { font-weight: 700; color: var(--ink); text-decoration: none; }
.cm-date { color: var(--muted); font-size: 12.5px; margin-left: auto; }
.cm-tag { font: 700 10.5px var(--f-mono); text-transform: uppercase; letter-spacing: .06em; padding: 2px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.cm-tag.mod { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.cm-text { margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cm-act .rbtn { min-height: 32px; padding: 4px 11px; }
.lnk { background: none; border: 0; color: var(--muted); font: 600 13px var(--f-body); cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.lnk:hover { color: var(--ink); background: var(--accent-soft); }
.lnk.bad:hover { color: var(--bad); }
.post { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); animation: fadein .5s var(--ease) both; }
.post-from { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.post-date { color: var(--muted); font-size: 12.5px; font-family: var(--f-mono); }
.post-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.55; }
.post-img { max-width: 100%; max-height: 420px; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); align-self: flex-start; }
.post-story { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; padding: 8px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--ink); text-decoration: none; transition: transform .3s var(--spring); }
.post-story:hover { transform: translateX(5px); }
.post-story span { color: var(--accent); font-weight: 800; }
.composer { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.composer textarea { width: 100%; height: 96px; resize: vertical; }
.composer .crow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.composer img { max-height: 120px; border-radius: 12px; border: 1px solid var(--line); }
.posts { display: flex; flex-direction: column; gap: 14px; }
.segs { display: inline-flex; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); gap: 2px; align-self: flex-start; }
.segs a { padding: 8px 18px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 700; transition: background .25s, color .25s; }
.segs a[aria-current="true"] { background: var(--grad); color: #fff; }
.bell { position: relative; }
.bell .badge-n { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--accent2); color: #fff; font: 700 10.5px/17px var(--f-mono); text-align: center; animation: bpop .4s var(--spring); }
.nfy { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.nfy.unread { border-color: var(--accent); background: var(--accent-soft); }
.nfy i { font-style: normal; font-size: 18px; }
.nfy small { display: block; color: var(--muted); }
.gpick { display: flex; flex-wrap: wrap; gap: 6px; }
.gpick .sc { font-size: 13px; padding: 5px 12px; min-height: 32px; }
.heroava { width: 36px; height: 36px; border-radius: 50%; border: 1.5px dashed var(--line); background: var(--surface); color: var(--muted); cursor: pointer; overflow: hidden; padding: 0; flex: none; font-size: 16px; }
.heroava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.authors.wide { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.acard .about { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* талисман Твисти */
.mascot-sit { position: absolute; z-index: 1; right: -150px; bottom: 60px; width: 440px; max-width: none; height: auto; pointer-events: none; transform: scaleX(-1); filter: drop-shadow(0 18px 40px rgba(0,0,0,.35)); -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 98%); mask-image: linear-gradient(to bottom, #000 62%, transparent 98%); animation: mascot-in 1s .8s var(--ease) both; }
@keyframes mascot-in { from { opacity: 0; translate: 40px 0; } to { opacity: 1; translate: 0 0; } }
.mascot-say { position: absolute; z-index: 4; right: -40px; top: 238px; max-width: 200px; display: flex; align-items: center; gap: 8px; max-width: 230px; padding: 8px 14px 8px 8px; border-radius: 18px 18px 18px 4px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font: 600 12px/1.3 var(--f-body); box-shadow: 0 10px 30px -10px rgba(30,5,15,.4); animation: floaty 7s ease-in-out infinite -2s; }
.mascot-say img { width: 34px; height: 32px; border-radius: 10px; object-fit: cover; flex: none; }
.final { margin-top: calc(min(540px, 70vw) * .4 + 48px); }
.final-in .mascot-lie { position: absolute; z-index: 2; right: 5%; bottom: calc(100% - 4px); width: min(540px, 70vw); height: auto; pointer-events: none; filter: drop-shadow(0 -6px 30px rgba(0,0,0,.25)); }
.mascot-404 { display: block; width: 120px; height: auto; border-radius: 24px; margin: 20px 0 10px; border: 1px solid var(--line); }
@media (max-width: 1180px) { .mascot-sit { right: -120px; } .mascot-say { right: -20px; } }
@media (max-width: 900px) { .stage { padding-bottom: 150px; min-height: 0; } .mascot-sit { right: 6px; bottom: -22px; width: 330px; -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%); mask-image: linear-gradient(to bottom, #000 70%, transparent 100%); } .mascot-say { top: auto; bottom: 34px; right: auto; left: 10px; max-width: 46%; } .chip-float.c2, .chip-float.c4, .chip-float.c5 { display: none; } }

@media (min-width: 901px) { .stage { justify-content: flex-start; padding-left: 70px; } .chip-float.c1 { left: 20px; } .chip-float.c2 { left: 6px; } .chip-float.c5 { left: -10px; } }

/* Твисти: поддержка, реакции в читалке, пустые состояния */
.tw-hi { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.tw-hi img { width: 64px; height: 60px; border-radius: 18px; object-fit: cover; border: 1px solid var(--line); flex: none; }
.tw-bubble { position: relative; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--surface2); border: 1px solid var(--line); font-size: 14px; line-height: 1.35; }
.empty.tw { display: flex; align-items: center; gap: 14px; text-align: left; }
.empty.tw img { width: 56px; height: 52px; border-radius: 14px; object-fit: cover; flex: none; border: 1px solid var(--line); }
.tw-react { position: fixed; z-index: 20; left: max(12px, calc(50% - 256px)); bottom: 96px; display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 18px 18px 18px 4px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 30px -10px rgba(30,5,15,.5); font: 600 13px var(--f-body); pointer-events: none; animation: tw-pop 2.6s var(--spring) both; }
.tw-react img { width: 44px; height: 41px; border-radius: 12px; object-fit: cover; }
@keyframes tw-pop { 0% { opacity: 0; transform: translateY(16px) scale(.85); } 12%, 82% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-6px); } }
.tw-toggle { padding: 4px 6px; } .tw-toggle img { display: block; width: 22px; height: 20px; border-radius: 6px; object-fit: cover; }
.tw-toggle[aria-pressed="false"] img { filter: grayscale(1); opacity: .45; }
@media (prefers-reduced-motion: reduce) { .tw-react { animation: none; } }

/* телефоны: поля ≥16px, чтобы iOS не приближал страницу при вводе */
@media (hover: none) and (pointer: coarse), (max-width: 760px) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), textarea, select { font-size: 16px !important; }
}
