@import url('/static/css/fonts.css');

/* ================= токены ================= */
:root {
  --bg:        #06070c;
  --bg-2:      #0c0e18;
  --panel:     #11131f;
  --panel-2:   #171a2a;
  --line:      #262b42;
  --ink:       #f2f3ff;
  --ink-dim:   #9aa0c0;
  --ink-dimmer:#6a7196;

  --acid:      #c6ff2e;
  --magenta:   #ff2ea6;
  --cyan:      #2ee6ff;
  --orange:    #ff7a1a;
  --yellow:    #ffd426;
  --green:     #00e07a;

  --r:   14px;
  --r-s: 10px;
  --shadow-hard:    5px 5px 0 rgba(0,0,0,.9);
  --shadow-hard-sm: 3px 3px 0 rgba(0,0,0,.9);
  --shadow-acid:    0 0 0 2px var(--acid), 6px 6px 0 rgba(0,0,0,.85);
  --font-display: 'Unbounded', 'Arial Black', system-ui, sans-serif;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* фон: жёсткий halftone-паттерн вместо мыльного свечения — комикс, а не заставка ИИ */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.09) 1.6px, transparent 1.6px);
  background-size: 15px 15px;
  mask-image: radial-gradient(140vw 90vh at 50% -8%, #000 30%, transparent 78%);
  z-index: -2;
  pointer-events: none;
}
body::after {
  content: '';
  position: fixed; inset: 0;
  background:
    repeating-linear-gradient(-8deg, rgba(198,255,46,.05) 0 3px, transparent 3px 46px);
  z-index: -1;
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }

.chk {
  display: inline-block; width: 1.35em; height: 1.35em;
  vertical-align: -0.3em; object-fit: contain;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.wrap--wide { max-width: 1440px; }

/* ================= типографика ================= */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin: 0;
  text-transform: uppercase;
}
h1 { font-size: clamp(34px, 6.4vw, 76px); }
h2 { font-size: clamp(24px, 3.4vw, 40px); }
h3 { font-size: clamp(17px, 2vw, 22px); }
p  { margin: 0 0 14px; }

.muted   { color: var(--ink-dim); }
.dimmer  { color: var(--ink-dimmer); }
.small   { font-size: 13px; }
.mono    { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }

.grad {
  background: linear-gradient(96deg, var(--acid), var(--cyan) 42%, var(--magenta));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ================= шапка ================= */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(6,7,12,.94), rgba(6,7,12,.72));
  border-bottom: 1px solid var(--line);
}
.topbar__in {
  display: flex; align-items: center; gap: 18px;
  height: 66px;
}
.logo {
  font-family: var(--font-display); font-weight: 900;
  font-size: 25px; letter-spacing: -.04em; text-transform: uppercase;
  position: relative; white-space: nowrap;
}
.logo b { font-weight: 900; }
.logo::after {
  content: 'BURMALDA';
  position: absolute; left: 0; top: 0;
  color: var(--magenta); mix-blend-mode: screen;
  clip-path: inset(0 0 55% 0);
  opacity: 0; pointer-events: none;
}
.logo:hover::after { animation: glitch .5s steps(2) infinite; opacity: .9; }
@keyframes glitch {
  0%   { transform: translate(0,0); }
  25%  { transform: translate(-3px,1px); }
  50%  { transform: translate(2px,-2px); clip-path: inset(45% 0 20% 0); }
  75%  { transform: translate(-2px,2px); }
  100% { transform: translate(0,0); }
}

.nav { display: flex; gap: 4px; margin-left: 6px; flex-wrap: wrap; }
.nav a {
  padding: 8px 13px; border-radius: 999px;
  font-weight: 800; font-size: 13.5px; letter-spacing: .02em;
  color: var(--ink-dim); border: 1px solid transparent;
  transition: .15s;
}
.nav a:hover { color: var(--ink); background: var(--panel-2); }
.nav a.on {
  color: #06070c; background: var(--acid);
  box-shadow: var(--shadow-hard-sm);
}
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar__right .btn { white-space: nowrap; }
.nav a.only-mobile { display: none; }

.burger {
  display: none; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--ink); border-radius: 10px; padding: 9px 12px; font-size: 17px; cursor: pointer;
}

/* ================= кнопки ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  letter-spacing: .04em; text-transform: uppercase;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  transition: transform .12s, box-shadow .15s, background .15s, border-color .15s;
}
.btn:hover { transform: translate(-2px, -2px); border-color: #3b4269; box-shadow: var(--shadow-hard-sm); }
.btn:active { transform: translate(0, 0); box-shadow: none; }
.btn--primary {
  background: linear-gradient(96deg, var(--acid), #8bff6a);
  color: #05060a; border-color: transparent;
  box-shadow: var(--shadow-hard);
}
.btn--pink {
  background: linear-gradient(96deg, var(--magenta), var(--orange));
  color: #fff; border-color: transparent;
  box-shadow: var(--shadow-hard);
}
.btn--cyan { background: var(--cyan); color: #05060a; border-color: transparent; }
.btn--ghost { background: transparent; }
.btn--danger { background: transparent; border-color: #5a2036; color: #ff7ab0; }
.btn--danger:hover { background: rgba(255,46,166,.12); }
.btn--sm { padding: 7px 12px; font-size: 11.5px; border-radius: 9px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ================= общие блоки ================= */
.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px;
}

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 700;
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--ink-dim);
}
.tag--news    { color: var(--cyan);    border-color: rgba(46,230,255,.4);  background: rgba(46,230,255,.1); }
.tag--music   { color: var(--magenta); border-color: rgba(255,46,166,.4);  background: rgba(255,46,166,.1); }
.tag--video   { color: var(--orange);  border-color: rgba(255,122,26,.5); background: rgba(255,122,26,.14); }
.tag--footage { color: var(--acid);    border-color: rgba(198,255,46,.4);  background: rgba(198,255,46,.1); }
.tag--pending { color: var(--yellow);  border-color: rgba(255,212,38,.4);  background: rgba(255,212,38,.1); }
.tag--approved{ color: var(--green);   border-color: rgba(0,224,122,.4);   background: rgba(0,224,122,.1); }
.tag--rejected{ color: #ff5c7a;        border-color: rgba(255,92,122,.4);  background: rgba(255,92,122,.1); }
.tag--admin   { color: #05060a; background: var(--acid); border-color: transparent; }

.section-head {
  display: flex; align-items: flex-end; gap: 16px;
  margin: 46px 0 20px; flex-wrap: wrap;
}
.section-head .muted { margin: 0; }
.section-head__link { margin-left: auto; }

.grid { display: grid; gap: 18px; }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }

/* ================= карточка поста ================= */
.post-card { display: flex; flex-direction: column; height: 100%; }
.post-card:hover { transform: translate(-4px, -4px) rotate(-0.4deg); border-color: var(--ink-dimmer); box-shadow: var(--shadow-hard); }
.post-card__media {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: repeating-linear-gradient(45deg, #10131f, #10131f 12px, #141828 12px, #141828 24px);
}
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.post-card:hover .post-card__media img { transform: scale(1.04); }
.post-card__media img { transition: transform .3s; }
.post-card__badge {
  position: absolute; left: 10px; top: 10px; z-index: 2;
}
.post-card__dur {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0,0,0,.72); border-radius: 6px;
  padding: 2px 7px; font-size: 11.5px; font-weight: 700;
}
.post-card__body { padding: 14px 15px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card__title {
  font-family: var(--font-display); font-weight: 700; font-size: 15.5px;
  line-height: 1.25; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card__meta {
  margin-top: auto; display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--ink-dimmer);
}
.post-card__meta a:hover { color: var(--acid); }

.chroma-note {
  position: absolute; inset: auto 0 0 0; height: 4px;
  background: linear-gradient(90deg, #00ff5f, #00e07a);
}

/* пустой раздел */
.empty {
  border: 1px dashed var(--line); border-radius: var(--r);
  padding: 54px 22px; text-align: center; color: var(--ink-dimmer);
  font-family: var(--font-display); font-weight: 700; letter-spacing: .05em;
}

/* ================= главная ================= */
.hero { padding: 52px 0 10px; position: relative; }
.hero__kicker {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px;
  font-family: var(--font-display); font-size: 11.5px; letter-spacing: .18em;
  color: var(--acid); border: 1px solid rgba(198,255,46,.35);
  background: rgba(198,255,46,.07); padding: 6px 12px; border-radius: 999px;
}
.hero h1 { margin-bottom: 18px; }
.hero__lead { font-size: clamp(15px, 1.6vw, 19px); color: var(--ink-dim); max-width: 620px; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero__stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px; margin-top: 40px;
}
.stat {
  border: 1px solid var(--line); border-radius: var(--r-s); padding: 14px 16px;
  background: rgba(255,255,255,.02);
}
.stat b { display: block; font-family: var(--font-display); font-size: 26px; line-height: 1.1; }
.stat span { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dimmer); }

.sect-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 34px; }
.sect-link {
  display: block; padding: 18px; border-radius: var(--r);
  border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel), var(--bg-2));
  transition: .16s;
}
.sect-link:hover { transform: translate(-3px, -3px); border-color: var(--acid); box-shadow: var(--shadow-hard); }
.sect-link b { display: block; font-family: var(--font-display); font-size: 19px; margin: 8px 0 4px; }
.sect-link span { font-size: 13px; color: var(--ink-dimmer); }
.sect-link em { font-style: normal; font-size: 26px; }

/* топ-лист */
.toplist { display: flex; flex-direction: column; }
.toprow {
  display: flex; align-items: center; gap: 14px; padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}
.toprow:last-child { border-bottom: 0; }
.toprow__n {
  font-family: var(--font-display); font-size: 22px; width: 38px; flex: none;
  color: var(--ink-dimmer);
}
.toprow:hover .toprow__n { color: var(--acid); }
.toprow__t { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toprow__c { margin-left: auto; flex: none; color: var(--ink-dim); font-size: 13px; }

/* ================= страница поста ================= */
.post-head { margin: 30px 0 18px; }
.post-head h1 { font-size: clamp(26px, 4vw, 44px); margin: 12px 0; }
.post-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--ink-dim); font-size: 13.5px; }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; align-items: start; }
.post-body { white-space: pre-wrap; font-size: 16.5px; line-height: 1.7; }

.player-shell {
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  background: #000;
}
.player-shell video { width: 100%; height: auto; display: block; background: #000; }
.player-shell--audio { padding: 26px; background: linear-gradient(135deg, #101c14, #0b1224); }
.audio-visual {
  display: flex; align-items: flex-end; gap: 4px; height: 90px; margin-bottom: 18px;
}
.audio-visual i {
  flex: 1; background: linear-gradient(180deg, var(--magenta), var(--orange));
  border-radius: 3px; height: 20%; animation: eq 1.1s ease-in-out infinite alternate;
}
.audio-visual i:nth-child(even) { background: linear-gradient(180deg, var(--cyan), var(--orange)); }
@keyframes eq { from { height: 12%; } to { height: 92%; } }
.audio-visual.paused i { animation-play-state: paused; }
audio { width: 100%; }

.chroma-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--line); border-top: 0;
  background: var(--panel);
  font-size: 13px;
}
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { accent-color: var(--acid); width: 17px; height: 17px; }
.chroma-stage { position: relative; background: #000; }
.chroma-stage canvas { width: 100%; height: auto; display: block; }
#chroma-controls { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 200px; }
.chroma-stage--checker {
  background-image:
    linear-gradient(45deg, #1b1f30 25%, transparent 25%),
    linear-gradient(-45deg, #1b1f30 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1b1f30 75%),
    linear-gradient(-45deg, transparent 75%, #1b1f30 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}

.side-box { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 16px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--ink-dimmer); }
.kv b { font-weight: 800; }

.like-btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  padding: 13px 20px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(255,212,38,.4); background: rgba(255,212,38,.1); color: var(--yellow);
  transition: .14s;
}
.like-btn:hover { transform: translateY(-2px) rotate(-1deg); background: rgba(255,212,38,.18); }
.like-btn.on { background: var(--yellow); color: #17130a; border-color: transparent; box-shadow: var(--shadow-hard-sm); }

/* комментарии */
.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ava {
  width: 40px; height: 40px; flex: none; border-radius: 11px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 900; font-size: 16px; color: #05060a;
}
.ava--lg { width: 76px; height: 76px; font-size: 30px; border-radius: 18px; }
.comment__head { display: flex; align-items: center; gap: 9px; font-size: 13px; margin-bottom: 3px; }
.comment__body { white-space: pre-wrap; word-break: break-word; }

/* ================= формы ================= */
.field { margin-bottom: 16px; }
.field label {
  display: block; margin-bottom: 7px;
  font-family: var(--font-display); font-size: 11.5px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-dim);
}
.input, textarea, select {
  width: 100%; padding: 12px 14px; border-radius: 11px;
  background: #0a0c15; border: 1px solid var(--line); color: var(--ink);
  font-family: var(--font); font-size: 15px; outline: none; transition: .15s;
}
.input:focus, textarea:focus, select:focus {
  border-color: var(--acid); box-shadow: 0 0 0 3px rgba(198,255,46,.12);
}
textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.hint { font-size: 12.5px; color: var(--ink-dimmer); margin-top: 6px; }

.filedrop {
  border: 2px dashed var(--line); border-radius: var(--r);
  padding: 30px 20px; text-align: center; cursor: pointer;
  background: rgba(255,255,255,.02); transition: .15s;
}
.filedrop:hover, .filedrop.hot { border-color: var(--acid); background: rgba(198,255,46,.06); }
.filedrop input { display: none; }
.filedrop__icon { font-size: 34px; }
.filedrop__name { font-weight: 800; color: var(--acid); margin-top: 8px; word-break: break-all; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs a, .tabs button {
  padding: 9px 15px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel);
  font-family: var(--font-display); font-size: 12px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-dim);
}
.tabs a.on, .tabs button.on { background: var(--acid); color: #05060a; border-color: transparent; }

.alert {
  padding: 13px 16px; border-radius: 11px; margin-bottom: 18px;
  border: 1px solid rgba(255,92,122,.4); background: rgba(255,92,122,.1); color: #ff9fb4;
  font-size: 14.5px;
}
.alert--ok { border-color: rgba(0,224,122,.4); background: rgba(0,224,122,.09); color: #6cffb9; }
.alert--warn { border-color: rgba(255,212,38,.4); background: rgba(255,212,38,.09); color: #ffe27a; }

.flash-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 90; max-width: 340px; }
.flash-wrap .alert { box-shadow: var(--shadow-hard); }

/* ================= таблицы (админка) ================= */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table.tbl { width: 100%; border-collapse: collapse; min-width: 720px; }
table.tbl th, table.tbl td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
table.tbl th {
  font-family: var(--font-display); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-dimmer); background: rgba(255,255,255,.02);
}
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr:hover td { background: rgba(255,255,255,.02); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.mod-item { display: grid; grid-template-columns: 200px minmax(0,1fr) 220px; gap: 18px; align-items: start; padding: 18px; }
.mod-item + .mod-item { border-top: 1px solid var(--line); }
.mod-item__prev {
  border-radius: var(--r-s); overflow: hidden; border: 1px solid var(--line);
  aspect-ratio: 16/9; background: #0a0c15; display: grid; place-items: center;
}
.mod-item__prev img { width: 100%; height: 100%; object-fit: cover; }
.mod-actions { display: flex; flex-direction: column; gap: 8px; }

/* ================= профиль ================= */
.profile-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin: 34px 0 26px; }
.profile-head h1 { font-size: clamp(28px, 4vw, 46px); }

/* ================= подвал ================= */
.footer {
  margin-top: 70px; border-top: 1px solid var(--line);
  padding: 34px 0 46px; color: var(--ink-dimmer); font-size: 13.5px;
}
.footer__in { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.footer a:hover { color: var(--acid); }

/* пагинация */
.pager { display: flex; gap: 8px; justify-content: center; margin: 34px 0; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 40px; padding: 9px 12px; text-align: center; border-radius: 10px;
  border: 1px solid var(--line); font-weight: 800; font-size: 14px;
}
.pager .on { background: var(--acid); color: #05060a; border-color: transparent; }

/* ================= адаптив ================= */
@media (max-width: 900px) {
  .post-layout { grid-template-columns: 1fr; }
  .side-box { position: static; }
  .mod-item { grid-template-columns: 1fr; }
  .nav {
    display: none; position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; padding: 12px; gap: 6px;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
  .burger { display: block; order: 3; }
  .topbar__in { position: relative; }
}
@media (max-width: 560px) {
  .hero { padding-top: 34px; }
  .btn { padding: 10px 15px; }
  .topbar__right .btn span { display: none; }
  .topbar__right .auth-btn { display: none; }   /* уходят в бургер */
  .nav a.only-mobile { display: block; }
}

/* ============================================================= */
/* ================= PJAX-навигация ============================= */
/* ============================================================= */
#pjax-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 200;
  background: linear-gradient(90deg, var(--acid), var(--cyan), var(--magenta));
  box-shadow: 0 0 10px var(--magenta);
  opacity: 0; transition: width .35s ease, opacity .3s;
  pointer-events: none;
}
body.pjax-busy #pjax-bar { width: 82%; opacity: 1; }

/* ============================================================= */
/* ================= BURMALDAFM — глобальный плеер ============== */
/* ============================================================= */
body.fm-on { padding-bottom: 96px; }
@media (max-width: 720px) { body.fm-on { padding-bottom: 132px; } }

.fm {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  --fm-accent: var(--magenta);
  /* светлая тема плеера */
  --fm-surface:    #ffffff;
  --fm-surface-2:  #f3f4fb;
  --fm-line:       #e2e4f2;
  --fm-ink:        #1a1c30;
  --fm-ink-dim:    #5b6088;
  --fm-ink-dimmer: #9297bd;
  --fm-track:      #e6e8f4;
  font-family: var(--font);
  animation: fm-rise .5s cubic-bezier(.2,.9,.25,1.4) both;
}
@keyframes fm-rise { from { transform: translateY(120%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.fm.fm--down { animation: fm-drop .35s cubic-bezier(.4,0,.6,1) both; }
@keyframes fm-drop { to { transform: translateY(130%); opacity: 0; } }

/* цветное сияние, бегущее по краю плеера */
.fm__aura {
  position: absolute; left: 0; right: 0; top: -2px; height: 3px;
  background: linear-gradient(90deg, var(--acid), var(--cyan), var(--magenta), var(--orange), var(--acid));
  background-size: 300% 100%;
  animation: fm-aura 6s linear infinite;
  box-shadow: 0 0 18px rgba(255,46,166,.45);
}
@keyframes fm-aura { to { background-position: 300% 0; } }

.fm__bar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px max(20px, calc((100vw - var(--maxw)) / 2 + 20px));
  background: linear-gradient(180deg, var(--fm-surface), var(--fm-surface-2));
  backdrop-filter: blur(20px) saturate(1.2);
  border-top: 1px solid var(--fm-line);
  box-shadow: 0 -12px 40px rgba(20,22,44,.18);
  color: var(--fm-ink);
}

/* ---- крутящийся диск-обложка ---- */
.fm__cover {
  position: relative; flex: none; width: 54px; height: 54px;
  border: 0; background: none; cursor: pointer; padding: 0;
}
.fm__disc {
  display: block; width: 54px; height: 54px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #ffffff 0 30%, #e9ebf6 31% 60%, #d7dbee 61%);
  border: 1px solid var(--fm-line);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.7), 0 4px 12px rgba(20,22,44,.18);
  overflow: hidden; display: grid; place-items: center;
  transition: box-shadow .3s, transform .16s;
}
.fm__disc-img { width: 66%; height: 66%; object-fit: contain; border-radius: 50%; }
.fm.is-playing .fm__disc { animation: fm-spin 3.6s linear infinite; box-shadow: inset 0 0 0 4px rgba(255,255,255,.7), 0 0 20px var(--fm-accent); }
@keyframes fm-spin { to { transform: rotate(360deg); } }
.fm__cover:hover .fm__disc { transform: scale(1.06); }
.fm__pin {
  position: absolute; right: -3px; top: -3px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--fm-accent);
  box-shadow: 0 0 10px var(--fm-accent); opacity: 0; transition: .2s;
}
.fm.is-playing .fm__pin { opacity: 1; animation: fm-pulse 1.4s ease-in-out infinite; }
@keyframes fm-pulse { 50% { transform: scale(1.4); opacity: .5; } }

/* ---- сейчас играет ---- */
.fm__now { min-width: 0; width: clamp(150px, 22vw, 260px); flex: none; }
.fm__badge {
  font-family: var(--font-display); font-size: 10px; letter-spacing: .12em;
  color: var(--fm-ink-dim); display: flex; align-items: center; gap: 7px; margin-bottom: 2px;
}
.fm__live { color: var(--fm-accent); font-size: 9px; letter-spacing: .1em; }
.fm.is-playing .fm__live { animation: fm-blink 1.3s steps(2) infinite; }
@keyframes fm-blink { 50% { opacity: .25; } }
.fm__marquee { overflow: hidden; white-space: nowrap; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.fm__title-txt {
  display: inline-block; font-family: var(--font-display); font-weight: 700;
  font-size: 15px; letter-spacing: -.01em; color: var(--fm-ink);
}
.fm__title-txt.fm--scroll { animation: fm-marq 12s linear infinite; padding-right: 40px; }
.fm__title-txt.fm--scroll::after { content: attr(data-t); padding-left: 40px; }
@keyframes fm-marq { to { transform: translateX(-50%); } }
.fm__author { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fm-ink-dim); }
.fm__author:hover { color: var(--fm-accent); }

/* ---- эквалайзер ---- */
.fm__eq { display: flex; align-items: flex-end; gap: 3px; height: 34px; width: 52px; flex: none; }
.fm__eq i {
  flex: 1; border-radius: 3px 3px 1px 1px; height: 14%;
  background: linear-gradient(180deg, var(--cyan), var(--magenta));
  transform-origin: bottom;
}
.fm__eq i:nth-child(even) { background: linear-gradient(180deg, var(--acid), var(--orange)); }
.fm.is-playing .fm__eq i { animation: fm-eq 900ms ease-in-out infinite alternate; }
.fm__eq i:nth-child(1){ animation-delay: -.2s; } .fm__eq i:nth-child(2){ animation-delay: -.5s; }
.fm__eq i:nth-child(3){ animation-delay: -.1s; } .fm__eq i:nth-child(4){ animation-delay: -.7s; }
.fm__eq i:nth-child(5){ animation-delay: -.35s;} .fm__eq i:nth-child(6){ animation-delay: -.6s; }
.fm__eq i:nth-child(7){ animation-delay: -.15s;}
@keyframes fm-eq { from { height: 12%; } to { height: 100%; } }

/* ---- контролы ---- */
.fm__controls { display: flex; align-items: center; gap: 6px; flex: none; }
.fm__ctl {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 50%; cursor: pointer; font-size: 15px; color: var(--fm-ink);
  border: 1px solid var(--fm-line); background: var(--fm-surface-2);
  transition: transform .14s, box-shadow .15s, background .15s, color .15s, border-color .15s;
}
.fm__ctl:hover { transform: translateY(-2px); color: var(--fm-accent); border-color: var(--fm-accent); }
.fm__ctl:active { transform: scale(.9); }
.fm__ctl--sm { width: 34px; height: 34px; font-size: 13px; }
.fm__ctl--play {
  position: relative; width: 50px; height: 50px; padding: 0; font-size: 0; color: #05060a;
  background: linear-gradient(135deg, var(--acid), #8bff6a); border: 0;
  box-shadow: 0 4px 14px rgba(20,22,44,.22);
  transition: transform .14s, box-shadow .18s, background .2s;
}
.fm__ctl--play::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(198,255,46,.22); transition: box-shadow .18s;
}
.fm__ctl--play:hover { transform: translateY(-2px) scale(1.05); }
.fm__ctl--play:hover::after { box-shadow: 0 0 0 7px rgba(198,255,46,.28); }
.fm.is-playing .fm__ctl--play { background: linear-gradient(135deg, var(--magenta), var(--orange)); }
.fm.is-playing .fm__ctl--play::after { box-shadow: 0 0 0 4px rgba(255,46,166,.24); }
/* иконку play/pause рисуем сами — гарантированно по центру */
.fm__play-ico { font-size: 0; }
.fm__ctl--play::before {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 0; height: 0; transform: translate(-38%, -50%);
  border-style: solid; border-width: 8px 0 8px 14px;
  border-color: transparent transparent transparent #05060a;
}
.fm.is-playing .fm__ctl--play::before {
  width: 14px; height: 15px; transform: translate(-50%, -50%);
  border: 0; background:
    linear-gradient(#05060a, #05060a) left / 4.5px 100% no-repeat,
    linear-gradient(#05060a, #05060a) right / 4.5px 100% no-repeat;
}

/* ---- прогресс + громкость ---- */
.fm__progress { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 120px; }
.fm__time { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--fm-ink-dim); flex: none; min-width: 34px; }
.fm__time--dur { text-align: right; }
.fm__vol { display: flex; align-items: center; gap: 8px; flex: none; width: 130px; }
.fm__vol-range { width: 82px; }

.fm__range {
  -webkit-appearance: none; appearance: none; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--acid), var(--magenta)) 0/var(--p, 0%) 100% no-repeat, var(--fm-track);
  cursor: pointer; outline: none;
}
.fm__seek { flex: 1; }
.fm__range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2px solid var(--fm-accent); box-shadow: 0 1px 4px rgba(20,22,44,.3), 0 0 6px var(--fm-accent);
  transition: transform .12s;
}
.fm__range:hover::-webkit-slider-thumb { transform: scale(1.25); }
.fm__range::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  border: 2px solid var(--fm-accent); box-shadow: 0 1px 4px rgba(20,22,44,.3), 0 0 6px var(--fm-accent);
}
.fm__range::-moz-range-progress { background: linear-gradient(90deg, var(--acid), var(--magenta)); height: 6px; border-radius: 999px; }

.fm__list-btn, .fm__hide { margin-left: 2px; }
.fm__ctl.on { background: var(--fm-accent); color: #fff; border-color: transparent; }

/* ---- панель плейлиста ---- */
.fm__panel {
  max-height: 46vh; overflow-y: auto;
  color: var(--fm-ink);
  background: linear-gradient(180deg, var(--fm-surface), var(--fm-surface-2));
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--fm-line);
  padding: 14px max(20px, calc((100vw - var(--maxw)) / 2 + 20px)) 6px;
  animation: fm-panel .28s cubic-bezier(.2,.9,.3,1.2) both;
}
@keyframes fm-panel { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.fm__panel-head { display: flex; align-items: center; margin-bottom: 8px; }
.fm__panel-title { font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .06em; color: var(--fm-ink); }
.fm__x {
  margin-left: auto; width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  background: var(--fm-surface-2); border: 1px solid var(--fm-line); color: var(--fm-ink-dim); font-size: 13px;
  transition: .15s;
}
.fm__x:hover { color: var(--fm-accent); border-color: var(--fm-accent); }
.fm__list { list-style: none; margin: 0; padding: 0; counter-reset: fm; }
.fm__row {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px;
  cursor: pointer; transition: background .14s; counter-increment: fm;
}
.fm__row:hover { background: rgba(20,22,44,.05); }
.fm__row::before {
  content: counter(fm, decimal-leading-zero); font-family: ui-monospace, Menlo, monospace;
  font-size: 12px; color: var(--fm-ink-dimmer); width: 24px; flex: none;
}
.fm__row-title { font-weight: 700; color: var(--fm-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.fm__row-author { color: var(--fm-ink-dimmer); font-size: 12.5px; flex: none; }
.fm__row-dur { color: var(--fm-ink-dimmer); font-size: 12px; font-family: ui-monospace, Menlo, monospace; flex: none; min-width: 34px; text-align: right; }
.fm__row.is-current { background: color-mix(in srgb, var(--fm-accent) 12%, transparent); }
.fm__row.is-current::before { content: '▶'; color: var(--fm-accent); }
.fm__row.is-current .fm__row-title { color: var(--fm-accent); }

/* мини-бары-эквалайзер у текущего трека в списке */
.fm__row-eq { display: none; gap: 2px; align-items: flex-end; height: 14px; width: 18px; flex: none; }
.fm__row.is-current .fm__row-eq { display: flex; }
.fm__row-eq i { flex: 1; background: var(--fm-accent); border-radius: 2px; height: 30%; }
.fm.is-playing .fm__row.is-current .fm__row-eq i { animation: fm-eq 700ms ease-in-out infinite alternate; }
.fm__row-eq i:nth-child(2){ animation-delay: -.35s; } .fm__row-eq i:nth-child(3){ animation-delay: -.15s; }

/* ---- кнопка вернуть плеер ---- */
.fm-reopen {
  position: fixed; right: 18px; bottom: 18px; z-index: 79;
  display: flex; align-items: center; gap: 8px; padding: 10px 18px 10px 11px;
  border-radius: 999px; cursor: pointer; color: #05060a;
  background: linear-gradient(96deg, var(--acid), var(--cyan) 55%, var(--magenta));
  background-size: 220% 100%;
  border: 0; box-shadow: 0 8px 22px rgba(20,22,44,.28);
  font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .04em;
  overflow: hidden;
  animation: fm-pop .45s cubic-bezier(.2,.9,.25,1.5) both, fm-float 3.2s ease-in-out .5s infinite, fm-hue 7s linear infinite;
}
@keyframes fm-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fm-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes fm-hue { to { background-position: 220% 0; } }
/* пульсирующее кольцо-«волна» */
.fm-reopen::after {
  content: ''; position: absolute; inset: 0; border-radius: 999px;
  box-shadow: 0 0 0 0 rgba(255,46,166,.5); animation: fm-ring 2.4s ease-out infinite;
}
@keyframes fm-ring { 0% { box-shadow: 0 0 0 0 rgba(255,46,166,.5); } 70%,100% { box-shadow: 0 0 0 16px rgba(255,46,166,0); } }
/* блик, пробегающий по кнопке */
.fm-reopen::before {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.75), transparent);
  transform: skewX(-18deg); animation: fm-shine 3.4s ease-in-out 1s infinite;
}
@keyframes fm-shine { 0% { left: -60%; } 55%,100% { left: 130%; } }
.fm-reopen:hover { animation-play-state: paused; transform: translateY(-3px) scale(1.06); box-shadow: 0 12px 26px rgba(20,22,44,.34); }
.fm-reopen img { width: 26px; height: 26px; position: relative; z-index: 1; animation: fm-wiggle 2.6s ease-in-out infinite; }
.fm-reopen span { position: relative; z-index: 1; }
@keyframes fm-wiggle { 0%,92%,100% { transform: rotate(0); } 96% { transform: rotate(-12deg); } 98% { transform: rotate(12deg); } }

/* ---- адаптив плеера ---- */
@media (max-width: 900px) {
  .fm__vol { display: none; }
}
@media (max-width: 720px) {
  .fm__bar { flex-wrap: wrap; gap: 10px 14px; padding: 10px 16px; }
  .fm__eq, .fm__hide { display: none; }
  .fm__now { order: 1; width: auto; flex: 1; }
  .fm__cover { order: 0; }
  .fm__list-btn { order: 2; }
  .fm__controls { order: 4; }
  .fm__progress { order: 5; width: 100%; flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
