/* ==========================================================================
   НейроКлас — минималистичный тёмный дизайн
   ========================================================================== */
:root {
  --bg: #08080d;
  --panel: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.09);
  --text: #f4f4f7;
  --muted: #9a9aa8;
  --accent: #8b5cf6;
  --accent2: #ec4899;
  --radius: 18px;
  --font-d: "Unbounded", "Inter", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Фоновые светящиеся пятна ----------
   Рисуются радиальными градиентами БЕЗ filter:blur — огромное размытие
   (blur 90px) на некоторых GPU/браузерах оставляет видимый шов-линию
   по центру экрана на всю высоту страницы. */
.bg-orbs {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(640px 640px at 8% -10%, rgba(76, 29, 149, .55), transparent 70%),
    radial-gradient(560px 560px at 108% 112%, rgba(157, 23, 77, .45), transparent 70%),
    radial-gradient(440px 440px at 58% 44%, rgba(14, 116, 144, .30), transparent 70%);
}

/* ---------- Дискретная кнопка Admin ---------- */
.admin-link {
  position: fixed; top: 18px; right: 22px; z-index: 50;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: #5a5a66; text-decoration: none;
  padding: 6px 13px; border-radius: 999px; border: 1px solid transparent;
  transition: color .25s, border-color .25s, background .25s;
}
.admin-link:hover { color: #9a9aa8; border-color: #2a2a33; background: rgba(255, 255, 255, .03); }

/* ---------- Главная (заглушка) ---------- */
.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 24px;
}
.hero-title {
  font-family: var(--font-d); font-weight: 800;
  font-size: clamp(3.2rem, 13vw, 8.6rem); line-height: 1; letter-spacing: -.02em;
  color: #c4b5fd; /* запасной цвет, если background-clip:text не поддержан */
  animation: rise 1s cubic-bezier(.22, 1, .36, 1) both;
}
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .hero-title {
    background: linear-gradient(120deg, #c4b5fd 0%, #f0abfc 45%, #fda4af 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
}
.hero-sub {
  margin-top: 20px; color: var(--muted);
  font-size: clamp(.78rem, 2.4vw, 1rem); letter-spacing: .34em; text-transform: uppercase;
  opacity: 0; animation: rise 1s .3s cubic-bezier(.22, 1, .36, 1) both;
}
.back-btn { margin-top: 26px; opacity: 0; animation: rise 1s .5s cubic-bezier(.22, 1, .36, 1) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Страница трека ---------- */
/* margin:auto вместо align-items:center — иначе на телефоне верх карточки
   обрезается и его невозможно долистать (баг flexbox-центрирования) */
.track { min-height: 100vh; display: flex; justify-content: center; padding: 90px 20px 60px; }
.track-card { width: 100%; max-width: 400px; text-align: center; margin: auto; animation: rise .7s cubic-bezier(.22, 1, .36, 1) both; }

.art {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 26px 90px -24px rgba(139, 92, 246, .5);
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.art-placeholder {
  width: 100%; aspect-ratio: 1; border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, .09);
  background: linear-gradient(135deg, rgba(139, 92, 246, .25), rgba(236, 72, 153, .2));
  display: flex; align-items: center; justify-content: center;
}
.ph-note { font-size: 5rem; opacity: .85; }

.track-title { font-family: var(--font-d); font-weight: 700; font-size: clamp(1.55rem, 6vw, 2.25rem); margin-top: 26px; line-height: 1.15; }
.track-artists {
  margin-top: 12px; font-size: .98rem; font-weight: 600;
  color: #c4b5fd; /* запасной цвет для старых браузеров */
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
}
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .track-artists {
    background: linear-gradient(120deg, #c4b5fd, #f0abfc);
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
}
.artist-sep { color: #5a5a66; -webkit-text-fill-color: #5a5a66; font-weight: 400; }
.track-label { margin: 16px 0 24px; color: var(--muted); font-size: .78rem; letter-spacing: .26em; text-transform: uppercase; }

.links { display: flex; flex-direction: column; gap: 12px; }
.listen-btn {
  display: flex; align-items: center; gap: 14px; padding: 11px 16px;
  border-radius: 16px; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--border);
  transition: transform .2s, background .2s, border-color .2s, box-shadow .2s;
  animation: rise .6s cubic-bezier(.22, 1, .36, 1) both;
}
.listen-btn:hover {
  transform: translateY(-2px); background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .2);
  box-shadow: 0 10px 34px -12px rgba(0, 0, 0, .6);
}

.chip {
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.chip img { width: 24px; height: 24px; }

.listen-text { flex: 1; text-align: left; font-weight: 600; font-size: .98rem; }
.listen-arrow { color: var(--muted); font-size: 1.1rem; transition: transform .2s; }
.listen-btn:hover .listen-arrow { transform: translate(3px, -3px); }

/* Цвета платформ */
.chip-youtube    { background: #ff0033; }
.chip-spotify    { background: #1db954; }
.chip-vk         { background: #0077ff; }
.chip-apple      { background: #fa243c; }
.chip-deezer     { background: linear-gradient(135deg, #a238ff, #feaa2d); }
.chip-kion       { background: linear-gradient(135deg, #6d28d9, #a855f7); }
.chip-yandex     { background: linear-gradient(135deg, #fc3f1d, #ff7043); }
.chip-tiktok     { background: #111; }
.chip-soundcloud { background: linear-gradient(135deg, #ff5500, #ff884d); }
.chip-bandcamp   { background: linear-gradient(135deg, #1da0c3, #4cc2e0); }
.chip-zvuk       { background: linear-gradient(135deg, #0f0f0f, #333); }
.chip-boom       { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.chip-rutube     { background: linear-gradient(135deg, #0a6fe0, #1d9bf0); }
.chip-shazam     { background: linear-gradient(135deg, #0088ff, #66ccff); }

/* ---------- Админка ---------- */
.admin { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 92px 20px 70px; }

.admin-card {
  width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 12px;
  background: rgba(255, 255, 255, .045); border: 1px solid var(--border); border-radius: 24px;
  padding: 30px;
  animation: rise .6s cubic-bezier(.22, 1, .36, 1) both;
}
.admin-card h1 { font-family: var(--font-d); font-size: 1.3rem; font-weight: 700; margin-bottom: 2px; }
.hint { color: var(--muted); font-size: .86rem; }

label {
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-top: 10px;
}

input[type="text"], input[type="password"], input[type="file"] {
  width: 100%; padding: 13px 15px; border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, .13);
  background: rgba(0, 0, 0, .35); color: var(--text);
  font-size: .95rem; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input[type="file"] { padding: 11px; color: var(--muted); }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 92, 246, .18); }

.btn {
  padding: 13px 20px; border: none; border-radius: 13px; cursor: pointer;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  color: #fff; font-weight: 600; font-size: .95rem; font-family: inherit;
  transition: filter .2s, transform .15s;
}
.btn:hover { filter: brightness(1.14); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; border: 1px dashed rgba(255, 255, 255, .22); color: var(--muted); }
.btn.ghost:hover { color: var(--text); border-color: rgba(255, 255, 255, .4); filter: none; }

.logout { text-align: center; margin-top: 4px; font-size: .82rem; color: var(--muted); text-decoration: none; }
.logout:hover { color: var(--text); }

/* Строка ссылки в форме: поле + всегда видимый выбор платформы */
.link-row {
  display: flex; flex-direction: column; gap: 9px;
  padding: 12px; border: 1px solid var(--border); border-radius: 15px;
  background: rgba(0, 0, 0, .18);
}
.link-row-main { display: flex; align-items: center; gap: 8px; }
.link-row-main input[type="text"] { flex: 1; min-width: 0; }
.link-row-pick { display: flex; align-items: center; gap: 8px; }
.link-row-pick .platform-select { flex: 1; min-width: 0; }
.link-row.warn input[type="text"] { border-color: rgba(239, 68, 68, .55); }
.link-row.warn .chip { border-color: rgba(239, 68, 68, .55); }
.row-platform { color: var(--muted); font-size: .72rem; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.chip.chip-empty { background: rgba(255, 255, 255, .07); border: 1px dashed rgba(255, 255, 255, .18); color: var(--muted); font-size: .9rem; }
.row-del {
  flex: none; width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .12); background: transparent;
  color: var(--muted); font-size: 1.15rem; line-height: 1;
  transition: color .2s, border-color .2s, background .2s;
}
.row-del:hover { color: #fca5a5; border-color: rgba(239, 68, 68, .5); background: rgba(239, 68, 68, .08); }

/* Сообщения */
.flash { border-radius: 12px; padding: 11px 14px; font-size: .88rem; }
.flash.ok    { background: rgba(34, 197, 94, .12); border: 1px solid rgba(34, 197, 94, .3); color: #86efac; }
.flash.error { background: rgba(239, 68, 68, .12); border: 1px solid rgba(239, 68, 68, .3); color: #fca5a5; }

/* ---------- Админка: список страниц ---------- */
.hidden { display: none !important; }

.msg-wide { width: 100%; max-width: 520px; margin-bottom: 14px; word-break: break-word; }

.admin-head {
  width: 100%; max-width: 520px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; margin-bottom: 16px;
  animation: rise .5s cubic-bezier(.22, 1, .36, 1) both;
}
.admin-title { font-family: var(--font-d); font-size: 1.5rem; font-weight: 800; }
#toggle-create { padding: 12px 18px; white-space: nowrap; }

.tracks { width: 100%; max-width: 520px; margin-top: 28px; }
.tracks-h {
  font-family: var(--font-d); font-size: .95rem; font-weight: 600;
  margin-bottom: 14px; color: var(--muted);
}
.count {
  display: inline-block; min-width: 22px; padding: 2px 8px; margin-left: 6px;
  border-radius: 999px; background: rgba(139, 92, 246, .18); color: #c4b5fd;
  font-size: .72rem; text-align: center;
}
.tracks-list { display: flex; flex-direction: column; gap: 8px; }
.track-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  transition: border-color .2s, background .2s;
}
.track-row:hover { border-color: rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06); }

.mini-art {
  width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: none;
  border: 1px solid rgba(255, 255, 255, .1);
}
.mini-art-empty {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(139, 92, 246, .3), rgba(236, 72, 153, .25));
  color: rgba(255, 255, 255, .8); font-size: 1.3rem;
}

.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.row-title-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row-link {
  font-weight: 600; font-size: .93rem; color: var(--text); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-link:hover { color: #c4b5fd; }
.row-meta {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  color: var(--muted); font-size: .74rem;
}
.row-artists { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.row-slug { color: #6b6b78; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plat-icons { display: flex; gap: 4px; margin-left: auto; }
.plat-icons img { width: 16px; height: 16px; border-radius: 4px; }

.cat-badge {
  flex: none; padding: 3px 9px; border-radius: 999px;
  font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700;
}
.cat-badge.track { background: rgba(139, 92, 246, .16); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, .35); }
.cat-badge.album { background: rgba(236, 72, 153, .16); color: #f9a8d4; border: 1px solid rgba(236, 72, 153, .35); }
.cat-badge.big { font-size: .68rem; padding: 5px 13px; margin-bottom: 18px; display: inline-block; }

.icon-btn {
  flex: none; width: 38px; height: 38px; border-radius: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .12); background: transparent;
  color: var(--muted); text-decoration: none;
  transition: color .2s, border-color .2s, background .2s, transform .15s;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover {
  color: #c4b5fd; border-color: rgba(139, 92, 246, .5);
  background: rgba(139, 92, 246, .1); transform: translateY(-1px);
}
.copy-btn:hover { color: #86efac; border-color: rgba(34, 197, 94, .45); background: rgba(34, 197, 94, .08); }
.copy-btn.copied { color: #86efac; border-color: rgba(34, 197, 94, .5); background: rgba(34, 197, 94, .12); }

/* Исполнители */
.artist-row { display: flex; align-items: center; gap: 8px; }
.artist-row input[type="text"] { flex: 1; }

/* Мини-обложка в форме */
.thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); }

/* Выпадающий список платформ */
.platform-select, .select {
  padding: 11px 12px; border-radius: 12px; font-size: .9rem; color: var(--text);
  border: 1px solid rgba(255, 255, 255, .13); background: rgba(0, 0, 0, .5);
  outline: none; cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  max-width: 170px;
}
.platform-select:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 92, 246, .18); }
.platform-select option, .select option { background: #15151d; color: var(--text); }
.link-row .platform-select { height: 38px; font-size: .85rem; padding: 0 10px; }

/* Кнопка удаления страницы */
.danger-card { margin-top: 16px; align-items: center; }
.del-btn {
  width: 100%; padding: 13px 20px; border-radius: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  border: 1px solid rgba(239, 68, 68, .4); background: rgba(239, 68, 68, .08);
  color: #f87171; font-weight: 600; font-size: .95rem; font-family: inherit;
  transition: background .2s, border-color .2s, color .2s;
}
.del-btn svg { width: 18px; height: 18px; }
.del-btn:hover { background: rgba(239, 68, 68, .18); border-color: rgba(239, 68, 68, .65); color: #fca5a5; }

/* ---------- Подвал ---------- */
.foot {
  position: fixed; bottom: 16px; left: 0; right: 0; text-align: center;
  font-size: .7rem; letter-spacing: .22em; text-transform: uppercase;
  color: #3f3f4c; pointer-events: none;
}

/* ---------- Мобильные ---------- */
@media (max-width: 480px) {
  .admin-card { padding: 22px; }
  .track { padding: 76px 16px 56px; }
  .admin-head { flex-wrap: wrap; }
}
