/* Канон DRAZZE: чёрный / тёмно-фиолетовый мир, свечение, серебро, Onest капсом.
   Три облика (body[data-skin]): cinema — кинотеатр, свет фона в цвет постера; neon — неон DRAZZE;
   glass — премиальное стекло с двойной рамкой. Общая разметка, отличаются только переменные и акценты. */
:root {
  --amb: 124, 58, 237;               /* цвет выбранного постера (r, g, b) — ставит app.js */
  --bg: #07050d;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.075);
  --hair: rgba(255, 255, 255, 0.08);
  --line: rgba(156, 76, 226, 0.28);
  --violet: #9c4ce2;
  --violet-deep: #4c1d8f;
  --violet-mid: #7c3aed;
  --accent: #b27bff;
  --accent-soft: rgba(156, 76, 226, 0.18);
  --grad: linear-gradient(135deg, #7c3aed, #9c4ce2);
  --glow: rgba(156, 76, 226, 0.9);
  --gold: #ffc44d;
  --text: #f4f1fa;
  --hint: #9a93ad;
  --danger: #ff6b8a;
  --radius: 24px;
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --amb-strength: 0.55;
}
body[data-skin="cinema"] {
  --bg: #08070b;
  --accent: rgb(var(--amb));
  --accent-soft: rgba(var(--amb), 0.18);
  --line: rgba(var(--amb), 0.32);
  --grad: linear-gradient(135deg, color-mix(in srgb, rgb(var(--amb)) 82%, #000), color-mix(in srgb, rgb(var(--amb)) 52%, #000));
  --glow: rgba(var(--amb), 0.75);
  --amb-strength: 0.85;
}
body[data-skin="neon"] {
  --bg: #06020e;
  --accent: #e879f9;
  --accent-soft: rgba(232, 121, 249, 0.16);
  --line: rgba(232, 121, 249, 0.35);
  --grad: linear-gradient(120deg, #7c3aed 0%, #c026d3 50%, #22d3ee 100%);
  --glow: rgba(217, 70, 239, 0.95);
  --amb-strength: 0.4;
}
body[data-skin="glass"] {
  --bg: #0b0a10;
  --accent: #cfc8ff;
  --accent-soft: rgba(207, 200, 255, 0.12);
  --line: rgba(255, 255, 255, 0.12);
  --grad: linear-gradient(180deg, #ffffff, #c9c9d6);
  --glow: rgba(180, 160, 255, 0.55);
  --amb-strength: 0.5;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* без увеличения пальцами и двойным касанием — экран не «разъезжается» */
html { background: var(--bg); touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, a, input { touch-action: manipulation; }
body {
  margin: 0; min-height: 100dvh; color: var(--text); font: 15px/1.5 var(--font); background: var(--bg);
  overflow-x: hidden;
}
main { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: 18px 16px 56px; }

/* ---------- фон: размытый постер + цветные пятна ---------- */
#ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
#ambient .glowA, #ambient .glowB {
  position: absolute; border-radius: 50%; filter: blur(70px); transition: background 1.2s var(--spring);
}
#ambient .glowA {
  width: 130vw; height: 70vh; left: -15vw; top: -30vh;
  background: radial-gradient(circle, rgba(var(--amb), var(--amb-strength)), transparent 65%);
}
#ambient .glowB {
  width: 90vw; height: 60vh; right: -40vw; bottom: -25vh;
  background: radial-gradient(circle, rgba(76, 29, 143, 0.5), transparent 70%);
}
#ambient .poster-bg {
  position: absolute; left: -10%; right: -10%; top: -6%; height: 62vh; background-size: cover; background-position: center 20%;
  filter: blur(38px) saturate(1.5); opacity: 0; transform: scale(1.15); transition: opacity 0.9s var(--spring);
  -webkit-mask-image: linear-gradient(180deg, #000 10%, transparent 95%); mask-image: linear-gradient(180deg, #000 10%, transparent 95%);
}
#ambient .poster-bg.on { opacity: 0.55; }
body[data-skin="neon"] #ambient .poster-bg.on { opacity: 0.25; }
body[data-skin="neon"] #ambient .glowA { background: radial-gradient(circle, rgba(192, 38, 211, 0.5), rgba(124, 58, 237, 0.25) 40%, transparent 68%); }
body[data-skin="neon"] .player { background: linear-gradient(160deg, rgba(192, 38, 211, 0.2), rgba(34, 211, 238, 0.05) 70%); border-color: rgba(232, 121, 249, 0.3); }
body[data-skin="neon"] .card { background: linear-gradient(180deg, rgba(168, 85, 247, 0.14), rgba(255, 255, 255, 0.02)); }
body[data-skin="neon"] #ambient .glowB { background: radial-gradient(circle, rgba(34, 211, 238, 0.28), transparent 70%); }
body[data-skin="neon"] #ambient::after { /* неоновая сетка-пол */
  content: ""; position: absolute; left: -50%; right: -50%; bottom: -10vh; height: 45vh;
  background-image: linear-gradient(rgba(232, 121, 249, 0.18) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(232, 121, 249, 0.18) 1px, transparent 1px);
  background-size: 44px 44px; transform: perspective(300px) rotateX(62deg); transform-origin: bottom;
  -webkit-mask-image: linear-gradient(0deg, #000, transparent 85%); mask-image: linear-gradient(0deg, #000, transparent 85%);
}
/* зерно плёнки */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 2; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- появление ---------- */
.rise { animation: rise 0.7s var(--spring) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } }

/* ---------- шапка ---------- */
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.wordmark { font-weight: 800; font-size: 12px; letter-spacing: 0.55em; color: #e4e2ee; }
body[data-skin="neon"] .wordmark {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 8px rgba(217, 70, 239, 0.7));
}
.hello { font-size: 13px; color: var(--hint); }
.title {
  margin: 6px 0 16px; font-weight: 900; font-size: 38px; line-height: 0.95; text-transform: uppercase; letter-spacing: 0.01em;
  background: linear-gradient(180deg, #fff 30%, var(--accent) 120%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
body[data-skin="neon"] .title {
  background: linear-gradient(90deg, #fff, #f0abfc, #67e8f9, #fff); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; animation: sheen 6s linear infinite;
  filter: drop-shadow(0 0 18px rgba(217, 70, 239, 0.55));
}
body[data-skin="glass"] .title { background: linear-gradient(180deg, #fff, #a9a6b8); -webkit-background-clip: text; background-clip: text; }
@keyframes sheen { to { background-position: 300% 0; } }

h2 {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.2em; color: var(--hint); margin: 28px 0 12px;
}
h2::before { content: ""; width: 14px; height: 2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 10px var(--glow); }

/* ---------- карточка игрока: уровень, огонёк, цифры ---------- */
.player {
  position: relative; border-radius: var(--radius); padding: 16px; margin-bottom: 8px; overflow: hidden;
  background: linear-gradient(160deg, rgba(var(--amb), 0.2), rgba(255, 255, 255, 0.03) 60%);
  border: 1px solid var(--hair); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.player-head { display: flex; align-items: center; gap: 12px; }
.ava {
  position: relative; flex-shrink: 0; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  font-size: 22px; font-weight: 900; color: #fff; background: var(--grad);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent), 0 0 24px var(--glow);
}
.ava .lvl-ico {
  position: absolute; right: -6px; bottom: -6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; background: #15101f; border: 1.5px solid var(--accent);
}
.who-box { flex: 1; min-width: 0; }
.who-box .nm { font-weight: 800; font-size: 17px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-box .lv { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; }
.fire {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 58px; height: 58px;
  border-radius: 18px; background: rgba(255, 140, 50, 0.1); border: 1px solid rgba(255, 160, 60, 0.35);
}
.fire .f { font-size: 22px; line-height: 1; animation: flick 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
.fire b { font-size: 13px; line-height: 1.3; color: #ffb35c; }
.fire.off { filter: grayscale(1); opacity: 0.55; }
.fire.off .f { animation: none; }
@keyframes flick { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.12) rotate(3deg); } }
.xp { margin: 14px 0 4px; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.xp i {
  display: block; height: 100%; width: max(6%, var(--p, 0%)); border-radius: inherit; background: var(--grad);
  box-shadow: 0 0 12px var(--glow); transform-origin: left; animation: grow 1.1s var(--spring) both 0.2s;
}
@keyframes grow { from { transform: scaleX(0); } }
.xp-cap { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--hint); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.stat { border-radius: 16px; padding: 10px 10px 8px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--hair); }
.stat b { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 10.5px; color: var(--hint); text-transform: uppercase; letter-spacing: 0.08em; }
.stat.accent b { color: var(--accent); text-shadow: 0 0 14px var(--glow); }
.badges {
  display: flex; gap: 6px; margin: 12px -14px 0; padding: 0 14px; overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 24px), transparent);
}
.badges::-webkit-scrollbar { display: none; }
.badge-pill { flex-shrink: 0; white-space: nowrap; }
body[data-skin="glass"] .ava { color: #17112a; }
.badge-pill {
  font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 99px; background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--hair); color: var(--text);
}
.badge-pill.locked { opacity: 0.35; filter: grayscale(1); }

/* ---------- просмотры в профиле: всего, столбики по дням, лучший ролик ---------- */
.vbox { margin-top: 14px; padding: 12px; border-radius: 18px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--hair); }
.vbox-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.vbox-cap { display: block; font-size: 10.5px; color: var(--hint); text-transform: uppercase; letter-spacing: 0.08em; }
.vbox-total { font-size: 26px; font-weight: 900; line-height: 1.15; font-variant-numeric: tabular-nums; }
.vbox-week { text-align: right; }
.vbox-week b { display: block; color: var(--accent); font-weight: 800; font-size: 15px; }
.vbox-week span { font-size: 11px; color: var(--hint); }
.vbox-empty { margin: 10px 0 0; font-size: 12.5px; color: var(--hint); }
.vc { display: flex; align-items: flex-end; gap: 2px; height: 64px; margin-top: 12px; border-bottom: 1px solid var(--hair); }
.vc-bar {
  flex: 1; height: 100%; padding: 0; background: none; border-radius: 0; display: flex; align-items: flex-end; cursor: pointer;
}
.vc-bar::before {
  content: ""; display: block; width: 100%; height: var(--h); border-radius: 4px 4px 0 0; background: var(--accent);
  opacity: 0.7; transform-origin: bottom; animation: rise-bar 0.8s var(--spring) both;
}
.vc-bar.zero::before { background: rgba(255, 255, 255, 0.12); opacity: 1; }
.vc-bar.on::before { opacity: 1; box-shadow: 0 0 12px var(--glow); }
@keyframes rise-bar { from { transform: scaleY(0); } }
.vc-axis { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 10.5px; color: var(--hint); }
.vc-tip { color: var(--text); font-weight: 700; text-align: center; }
.best {
  display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 10px; border-radius: 14px;
  background: rgba(255, 196, 77, 0.08); border: 1px solid rgba(255, 196, 77, 0.3);
}
.best-ico { font-size: 20px; }
.best-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.best-t small { font-size: 10.5px; color: var(--hint); text-transform: uppercase; letter-spacing: 0.08em; }
.best-t span { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.best b { color: var(--gold); font-weight: 800; white-space: nowrap; }
.pod .block b.bv { font-size: 16px; }

/* ---------- плашки разделов ---------- */
.cats {
  display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px 8px; padding: 4px 16px 10px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 9px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--text);
  background: var(--panel); border: 1px solid var(--hair);
  transition: background 0.4s var(--spring), transform 0.4s var(--spring), box-shadow 0.4s var(--spring);
}
.cat:active { transform: scale(0.95); }
.cat span { font-size: 12px; font-weight: 700; color: var(--hint); background: rgba(255, 255, 255, 0.07); border-radius: 999px; padding: 1px 7px; }
.cat.on { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 24px -8px var(--glow); }
body[data-skin="glass"] .cat.on { color: #17112a; }
.cat.on span { color: inherit; background: rgba(255, 255, 255, 0.25); }

/* ---------- постеры фильмов ---------- */
.poster {
  flex-shrink: 0; width: 124px; padding: 0; border: 0; background: none; color: var(--text); scroll-snap-align: center;
  font: inherit; text-align: left; cursor: pointer; transition: transform 0.5s var(--spring);
}
.poster:active { transform: scale(0.95); }
.poster .pic {
  position: relative; aspect-ratio: 2 / 3; border-radius: 16px; overflow: hidden; background: var(--panel);
  border: 1px solid var(--hair); transform: translateZ(0);
  transition: transform 0.5s var(--spring), box-shadow 0.5s var(--spring), border-color 0.3s;
}
.poster .pic::after { /* блик */
  content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255, 255, 255, 0.18), transparent 35%);
  pointer-events: none;
}
.poster .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster .ph {
  height: 100%; display: grid; place-items: center; font-size: 40px; font-weight: 900; color: rgba(255, 255, 255, 0.7);
  background: linear-gradient(145deg, var(--violet-deep), #120c1f);
}
.poster .count {
  position: absolute; top: 7px; right: 7px; z-index: 1; font-size: 11px; font-weight: 800; color: #fff;
  background: rgba(7, 5, 13, 0.72); border-radius: 999px; padding: 2px 8px; border: 1px solid rgba(255, 255, 255, 0.12);
}
.poster .name {
  margin-top: 8px; font-size: 13px; font-weight: 700; line-height: 1.25; color: var(--hint);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color 0.3s;
}
.poster.on .pic { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 16px 32px -12px var(--glow), 0 0 0 2px var(--accent); }
.poster.on .name { color: var(--text); }
body[data-skin="neon"] .poster.on .pic { box-shadow: 0 0 0 2px #e879f9, 0 0 28px rgba(217, 70, 239, 0.8), 0 0 60px rgba(34, 211, 238, 0.25); }
/* «Все фильмы»: 2 постера — пополам, 3–4 — сеткой 2×2 (у трёх первый на всю высоту слева) */
.collage { display: grid; gap: 2px; width: 100%; height: 100%; background: var(--panel); }
.collage img { min-height: 0; }
.collage.n2 { grid-template-columns: 1fr 1fr; }
.collage.n3, .collage.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.collage.n3 img:first-child { grid-row: span 2; }

/* ---------- серии: плитки как в онлайн-кинотеатре ---------- */
.parts { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.parts .season { font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 8px; letter-spacing: 0.02em; }
.ep-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ep {
  position: relative; aspect-ratio: 1 / 1.05; border-radius: 16px; padding: 8px; text-align: left; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; color: var(--text);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)); border: 1px solid var(--hair);
  transition: transform 0.4s var(--spring), box-shadow 0.4s var(--spring), background 0.4s var(--spring);
}
.ep:active { transform: scale(0.94); }
.ep .n { font-size: 26px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.ep .s { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--hint); }
.ep .fr {
  position: absolute; top: 7px; right: 7px; font-size: 10.5px; font-weight: 800; padding: 1px 6px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.1); color: var(--text);
}
.ep.on { background: var(--grad); border-color: transparent; box-shadow: 0 10px 26px -10px var(--glow); color: #fff; }
body[data-skin="glass"] .ep.on { color: #17112a; }
body[data-skin="glass"] .ep.on .fr, body[data-skin="glass"] .cat.on span { background: rgba(23, 17, 42, 0.12); }
.ep.on .s { color: inherit; opacity: 0.8; }
.ep.on .fr { background: rgba(255, 255, 255, 0.28); color: inherit; }
.ep.mine { border-color: rgba(255, 196, 77, 0.65); }
.ep.mine::after { content: "🔒"; position: absolute; left: 7px; top: 6px; font-size: 11px; }
.ep.mine .n { margin-top: 10px; }
.ep.wide { aspect-ratio: auto; min-height: 64px; grid-column: span 2; }

/* ---------- главная карточка «Взять» ---------- */
.card {
  position: relative; border-radius: var(--radius); padding: 14px; margin-bottom: 14px;
  background: linear-gradient(180deg, rgba(var(--amb), 0.12), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--hair); box-shadow: 0 24px 60px -30px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
body[data-skin="neon"] .card { border-color: rgba(232, 121, 249, 0.3); box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.08), 0 24px 70px -30px rgba(217, 70, 239, 0.9); }
/* двойная рамка (стекло): внешний «лоток» + внутренняя «пластина» */
body[data-skin="glass"] .card, body[data-skin="glass"] .player {
  padding: 6px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.09); box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.9);
}
body[data-skin="glass"] .card > .core, body[data-skin="glass"] .player > .core {
  border-radius: calc(var(--radius) - 6px); padding: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.feature { padding: 0; overflow: hidden; }
body[data-skin="glass"] .feature { padding: 6px; }
.feature .core { position: relative; overflow: hidden; border-radius: inherit; }
.feature .bd {
  position: absolute; inset: -20%; background-size: cover; background-position: center;
  filter: blur(26px) saturate(1.4) brightness(0.55); transform: scale(1.1);
}
.feature .bd::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 20%, rgba(8, 6, 12, 0.85) 90%); }
.feature .row { position: relative; display: flex; gap: 14px; padding: 16px 16px 0; align-items: flex-end; }
.feature .fposter {
  flex-shrink: 0; width: 112px; aspect-ratio: 2 / 3; border-radius: 14px; object-fit: cover; display: block;
  box-shadow: 0 20px 40px -14px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.15);
  animation: pop 0.8s var(--bounce) both;
}
@keyframes pop { from { opacity: 0; transform: scale(0.85) rotate(-3deg); } }
.feature .info { flex: 1; min-width: 0; padding-bottom: 4px; }
.eyebrow {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); color: #fff; margin-bottom: 8px;
}
.feature h3 { margin: 0 0 4px; font-size: 22px; line-height: 1.1; font-weight: 900; text-transform: uppercase; overflow-wrap: anywhere; }
.feature .meta { font-size: 13px; color: rgba(255, 255, 255, 0.72); }
.feature .meta b { color: #fff; }
.feature .bottom { position: relative; padding: 14px 16px 16px; }
.feature .bottom p { margin: 0 0 12px; color: rgba(255, 255, 255, 0.72); font-size: 13.5px; }
.hero-part { margin: 2px 0 6px; font-size: 14px; font-weight: 800; color: var(--accent); }

.hero { text-align: center; padding: 26px 18px 20px; }
.hero h3 { margin: 0 0 6px; font-size: 20px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.02em; }
.hero p { margin: 0 0 18px; color: var(--hint); }

/* ---------- карточка взятой нарезки ---------- */
.media {
  position: relative; display: flex; justify-content: center; border-radius: 18px; overflow: hidden;
  margin-bottom: 16px; background: radial-gradient(circle at 50% 40%, rgba(var(--amb), 0.45), #0b0716 70%);
}
.media .blur { position: absolute; inset: -10%; background-size: cover; background-position: center; filter: blur(24px) brightness(0.6); }
.media img.fr { position: relative; display: block; height: 46vh; max-height: 460px; aspect-ratio: 9 / 16; object-fit: cover; box-shadow: 0 0 60px rgba(0, 0, 0, 0.6); }
.media video.fr { position: relative; display: block; height: 46vh; max-height: 460px; aspect-ratio: 9 / 16; background: #000; }
.media.can-play { cursor: pointer; }
.media.can-play:active .play { transform: scale(0.92); }
.media.playing .play, .media.playing .timer, .media.playing::after { display: none; }
.play { transition: transform 0.3s var(--spring); }
.media .ph { height: 34vh; aspect-ratio: 9 / 16; display: grid; place-items: center; }
.media::after { content: ""; position: absolute; inset: auto 0 0 0; height: 30%; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); pointer-events: none; }
.play {
  position: absolute; z-index: 1; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: 22px; color: #fff; pointer-events: none;
}
.badge {
  position: absolute; z-index: 1; left: 10px; top: 10px; background: rgba(7, 5, 13, 0.72); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700;
}
.badge.cat-badge { left: auto; right: 10px; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer {
  position: absolute; z-index: 1; left: 10px; bottom: 10px; right: 10px; display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 800; color: #ffd27a;
}
.timer .bar { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.timer .bar i { display: block; height: 100%; width: var(--p); background: linear-gradient(90deg, #ffc44d, #ff7a59); }

.step { position: relative; display: flex; gap: 12px; margin-top: 18px; }
.step:first-of-type { margin-top: 0; }
.num {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 900; color: #fff; background: var(--grad); box-shadow: 0 0 0 4px var(--accent-soft), 0 0 16px -2px var(--glow);
  transition: transform 0.5s var(--bounce);
}
body[data-skin="glass"] .num { color: #17112a; }
.step.done .num { background: linear-gradient(145deg, #7ff0b2, #2fbf71); color: #06210f; box-shadow: 0 0 0 4px rgba(47, 191, 113, 0.18); transform: scale(1.08); }
.body { flex: 1; min-width: 0; }
.label { font-weight: 800; margin: 3px 0 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.desc {
  white-space: pre-wrap; word-break: break-word; margin: 0; padding: 12px 14px; font: inherit; font-size: 14px;
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--hair); border-radius: 14px; max-height: 210px; overflow: auto;
}

/* ---------- кнопки ---------- */
button { font: inherit; border: 0; cursor: pointer; color: inherit; }
button:disabled { opacity: 0.55; cursor: default; }
.btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 15px 16px; border-radius: 999px; font-weight: 800; font-size: 15.5px; color: #fff; background: var(--grad);
  box-shadow: 0 12px 30px -10px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.3); overflow: hidden;
  transition: transform 0.35s var(--spring), filter 0.35s var(--spring);
}
.btn::before { /* пробегающий блик */
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent); animation: shine 3.6s var(--spring) infinite;
}
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.btn .ic {
  width: 30px; height: 30px; margin-right: -8px; border-radius: 50%; display: grid; place-items: center; font-size: 15px;
  background: rgba(255, 255, 255, 0.2); transition: transform 0.35s var(--spring);
}
.btn:active:not(:disabled) { transform: scale(0.97); filter: brightness(1.12); }
.btn:active:not(:disabled) .ic { transform: translate(3px, -1px) scale(1.06); }
body[data-skin="glass"] .btn { color: #17112a; box-shadow: 0 12px 30px -14px rgba(255, 255, 255, 0.55), inset 0 1px 0 #fff; }
body[data-skin="glass"] .btn .ic { background: rgba(23, 17, 42, 0.1); }
body[data-skin="glass"] .btn.ghost { color: var(--accent); box-shadow: none; }
body[data-skin="glass"] .btn.danger { color: var(--danger); box-shadow: none; }
.btn.ghost { background: transparent; border: 1px solid var(--line); box-shadow: none; color: var(--accent); }
.btn.ghost::before, .btn.danger::before { display: none; }
.btn.silver { background: linear-gradient(180deg, #ffffff, #c9c9d6); color: #1a0d33; box-shadow: 0 12px 30px -14px rgba(255, 255, 255, 0.6); }
.chip-btn {
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 700; transition: transform 0.3s var(--spring);
}
.chip-btn:active { transform: scale(0.94); }
.chip-btn.ok { background: rgba(47, 191, 113, 0.18); border-color: rgba(47, 191, 113, 0.5); color: #8af0bb; }
.btn.danger {
  margin-top: 16px; background: transparent; border: 1px solid rgba(255, 107, 138, 0.4); color: var(--danger); box-shadow: none; font-weight: 700;
}
/* обязательное правило про ссылку и «Опубликовал» */
.rule {
  margin: 0 0 10px; padding: 12px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.45;
  background: rgba(255, 196, 77, 0.09); border: 1px solid rgba(255, 196, 77, 0.5); color: #ffe6b3;
}
.rule b { display: block; margin-bottom: 3px; color: var(--gold); font-size: 14px; letter-spacing: 0.02em; }
.lock-note {
  margin: 0 0 14px; font-size: 13px; color: #ffe6b3; background: rgba(255, 196, 77, 0.1);
  border: 1px solid rgba(255, 196, 77, 0.3); border-radius: 12px; padding: 8px 12px; text-align: left;
}
.hint { font-size: 13px; color: var(--hint); margin: 8px 0 0; }

input {
  /* 16px: при меньшем шрифте iPhone сам приближает страницу, когда нажимаешь на поле */
  width: 100%; font: inherit; font-size: 16px; color: var(--text); background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 14px; padding: 13px 14px; margin-bottom: 8px; outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}
input::placeholder { color: #6d6680; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---------- лемур ---------- */
.mascot { position: relative; height: 260px; aspect-ratio: 312 / 560; margin: -6px auto 12px; }
/* Видео на чёрном фоне: lighten оставляет от чёрного цвет карточки под ним — рамки и круга нет.
   Важно: у .mascot и её родителей не должно быть filter/opacity/isolation, иначе наложение не сработает. */
.mascot video, .mascot img {
  position: relative; display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; mix-blend-mode: lighten;
}
.mascot::before {
  content: ""; position: absolute; left: 15%; right: 15%; bottom: -6px; height: 18px;
  background: radial-gradient(ellipse at center, var(--glow), transparent 70%); animation: glow 1.4s ease-in-out infinite alternate;
}
.mascot.small { height: 70%; margin: 0; }
@keyframes glow { from { opacity: 0.55; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mascot::before { animation: none; } }

.center { text-align: center; padding: 60px 12px; }
.center h1 { font-size: 22px; font-weight: 900; text-transform: uppercase; margin: 0 0 8px; }
.center p { color: var(--hint); margin: 0; }

/* ---------- история ---------- */
.hist { list-style: none; padding: 0; margin: 0; }
.hist li {
  display: flex; flex-direction: column; gap: 8px; background: var(--panel); border: 1px solid var(--hair);
  border-radius: 18px; padding: 12px 14px; margin-bottom: 8px; font-size: 14px;
}
.hist-top { display: flex; gap: 10px; align-items: center; min-width: 0; }
.hist .id { font-weight: 900; color: var(--accent); }
.hist .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--hint); }
.hist .link { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.hist .plat { font-weight: 700; color: var(--text); background: var(--accent-soft); border-radius: 8px; padding: 2px 8px; }
.hist .views { color: var(--text); font-weight: 700; margin-left: auto; }
.hist .views.muted { color: var(--hint); font-weight: 400; }
.hist a { color: #fff; text-decoration: none; flex-shrink: 0; font-weight: 700; font-size: 13px; background: rgba(255, 255, 255, 0.1); border-radius: 999px; padding: 3px 10px; }
.hist .views small { display: block; text-align: right; font-size: 10.5px; font-weight: 500; color: var(--hint); }
.hist .sum { flex-shrink: 0; font-weight: 800; font-size: 13px; color: var(--accent); }
.hist .plat { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px 2px 2px; border-radius: 999px; }
.pico {
  width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0;
  font-size: 10px; font-weight: 900; color: #fff; line-height: 1; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.views-form { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.views-form input { width: 120px; padding: 7px 10px; margin: 0; }
.more-link { align-self: flex-start; background: none; color: var(--accent); font-size: 13px; font-weight: 600; padding: 2px 0; }
.add-link input { margin-bottom: 6px; }
.add-link .btn { padding: 11px; font-size: 14px; }
.views-banner {
  display: block; width: 100%; margin: 12px 0 0; padding: 12px 14px; border-radius: 16px; text-align: left;
  font-weight: 700; font-size: 14px; color: #ffe6b3; background: rgba(255, 196, 77, 0.1); border: 1px solid rgba(255, 196, 77, 0.5);
}

/* ---------- шапка: рейтинг и «назад» ---------- */
.rating-btn, .back {
  display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--hair);
  color: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 700; transition: transform 0.3s var(--spring);
}
.rating-btn:active, .back:active { transform: scale(0.94); }
.muted-p { color: var(--hint); margin: -6px 0 18px; }

/* ---------- рейтинг: пьедестал + список ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; margin: 26px 0 18px; }
.pod { text-align: center; min-width: 0; }
.pod .ava { margin: 0 auto 8px; width: 56px; height: 56px; font-size: 22px; }
.pod.p1 .ava { width: 72px; height: 72px; font-size: 28px; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px #ffd36b, 0 0 34px rgba(255, 196, 77, 0.7); }
.pod .crown { font-size: 26px; display: block; margin-bottom: -4px; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(4deg); } }
.pod .pn { font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .pv { font-size: 12px; color: var(--hint); }
.pod .block {
  margin-top: 8px; border-radius: 16px 16px 6px 6px; display: grid; place-items: center; font-size: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)); border: 1px solid var(--hair);
  animation: up 0.9s var(--bounce) both;
}
.pod.p1 .block { height: 110px; background: linear-gradient(180deg, rgba(255, 196, 77, 0.35), rgba(255, 196, 77, 0.04)); border-color: rgba(255, 196, 77, 0.5); animation-delay: 0.25s; }
.pod.p2 .block { height: 80px; background: linear-gradient(180deg, rgba(220, 220, 235, 0.3), rgba(255, 255, 255, 0.03)); animation-delay: 0.1s; }
.pod.p3 .block { height: 62px; background: linear-gradient(180deg, rgba(214, 140, 90, 0.32), rgba(255, 255, 255, 0.03)); animation-delay: 0.4s; }
.pod .block b { display: block; font-size: 22px; font-weight: 900; line-height: 1; }
.pod .block small { font-size: 10px; color: var(--hint); text-transform: uppercase; letter-spacing: 0.1em; }
@keyframes up { from { transform: scaleY(0); transform-origin: bottom; opacity: 0; } }
.pod.me .pn { color: var(--gold); }
.rating { list-style: none; padding: 0; margin: 0; }
.rating li {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; margin-bottom: 8px; border-radius: 18px;
  background: var(--panel); border: 1px solid var(--hair); font-size: 15px;
}
.rating li.me { border-color: var(--gold); background: rgba(255, 196, 77, 0.08); }
.rating .place { width: 26px; text-align: center; font-size: 15px; font-weight: 900; color: var(--hint); }
.rating .ava { width: 36px; height: 36px; font-size: 15px; box-shadow: none; }
.rating .who { flex: 1; min-width: 0; font-weight: 700; }
.rating .who small { display: block; font-size: 11.5px; color: var(--hint); font-weight: 500; }
.rating b { font-size: 18px; color: var(--accent); }

/* ---------- скелетон загрузки ---------- */
.sk { border-radius: var(--radius); margin-bottom: 12px; background: linear-gradient(90deg, var(--panel), rgba(255, 255, 255, 0.1), var(--panel)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.sk-row { display: flex; gap: 10px; overflow: hidden; margin-bottom: 12px; }
.sk-row .sk { flex-shrink: 0; width: 124px; aspect-ratio: 2 / 3; border-radius: 16px; margin: 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; max-width: 90vw;
  background: rgba(20, 14, 32, 0.92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); animation: toastIn 0.45s var(--bounce);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px) scale(0.95); } }

/* ---------- праздник после «Опубликовал» ---------- */
#confetti { position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 30; pointer-events: none; }
.party {
  position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; padding: 24px;
  /* непрозрачный почти чёрный фон: чёрный фон видео лемура на нём не виден (lighten внутри анимации не работает) */
  background: #000;
  animation: fade 0.35s var(--spring);
}
.party.out { opacity: 0; transition: opacity 0.4s var(--spring); }
@keyframes fade { from { opacity: 0; } }
.party .box { text-align: center; max-width: 320px; animation: pop 0.7s var(--bounce) both; }
/* лемур в празднике — на чёрном, чтобы lighten давал чистый фон */
.party .mascot { height: 240px; animation: jump 0.9s var(--bounce) 0.15s both; }
@keyframes jump { 0% { transform: translateY(40px) scale(0.8); } 60% { transform: translateY(-14px) scale(1.04); } 100% { transform: none; } }
.party h1 {
  margin: 0 0 6px; font-size: 32px; font-weight: 900; text-transform: uppercase; line-height: 1;
  background: linear-gradient(90deg, #fff, #ffd36b, #fff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.party p { margin: 0 0 16px; color: rgba(255, 255, 255, 0.75); }
.party .plus { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 18px; }
.party .plus span { font-weight: 800; font-size: 13px; padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.15); }

/* ---------- переключатель вариантов (только для просмотра вариантов) ---------- */
.skin-switch {
  position: fixed; z-index: 15; left: 50%; top: 8px; transform: translateX(-50%); display: flex; gap: 4px; padding: 4px;
  border-radius: 99px; background: rgba(0, 0, 0, 0.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.12);
}
.skin-switch button { padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; color: #ccc; background: none; }
.skin-switch button.on { background: #fff; color: #111; }
