:root{
  --bg0:#070a14;
  --bg1:#0b1020;
  --card: rgba(15,23,48,.58);
  --card2: rgba(15,23,48,.35);
  --line: rgba(35,48,86,.85);

  --text:#e9eeff;
  --muted:#a8b3d7;

  --p1:#7c5cff;
  --p2:#30d6ff;

  --radius: 18px;
  --shadow: 0 16px 50px rgba(0,0,0,.45);
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font: 14px/1.55 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 14% 10%, rgba(124,92,255,.22), transparent 62%),
    radial-gradient(1100px 700px at 86% 14%, rgba(48,214,255,.15), transparent 64%),
    radial-gradient(900px 700px at 55% 90%, rgba(124,92,255,.10), transparent 66%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
  background-attachment: fixed; /* цельный фон */
}

.bg-glow{
  position: fixed;
  inset: 0;
  pointer-events:none;
  /* мягкая вуаль + noise, чтобы не было “кусков” */
  background:
    radial-gradient(1200px 800px at 50% -15%, rgba(255,255,255,.035), transparent 60%),
    radial-gradient(900px 650px at 10% 70%, rgba(124,92,255,.06), transparent 65%),
    radial-gradient(900px 650px at 90% 45%, rgba(48,214,255,.05), transparent 65%),
    repeating-linear-gradient(0deg,
      rgba(255,255,255,.010) 0px,
      rgba(255,255,255,.010) 1px,
      rgba(0,0,0,.010) 2px,
      rgba(0,0,0,.010) 3px
    );
  mix-blend-mode: overlay;
  opacity: .95;
}

a{color:inherit}
code{color:#cfe1ff}

.container{
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: linear-gradient(to bottom, rgba(7,10,20,.78), rgba(7,10,20,.35));
  border-bottom: 1px solid rgba(35,48,86,.55);
}

.topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 14px 0;
}

.brand{display:flex; gap:12px; align-items:center}
.brand__logo{
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display:grid;
  place-items:center;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(124,92,255,.95), rgba(48,214,255,.75));
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
}
.brand__title{font-weight:900; letter-spacing:.2px}
.brand__sub{color: var(--muted); font-size:12px; margin-top:2px}

.nav{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.nav__link{
  text-decoration:none;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid transparent;
  color: rgba(168,179,215,.9);
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
.nav__link:hover{
  color: var(--text);
  border-color: rgba(35,48,86,.9);
  background: rgba(15,23,48,.35);
  transform: translateY(-1px);
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border-radius: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(124,92,255,.35);
  background: rgba(15,23,48,.25);
  color: var(--text);
  text-decoration:none;
  cursor:pointer;
  user-select:none;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.btn:hover{ transform: translateY(-1px); border-color: rgba(124,92,255,.55); }
.btn:active{ transform: translateY(0px); }

.btn--sm{ padding: 10px 14px; border-radius: 14px; font-size: 13px; }

.btn--primary{
  border-color: rgba(124,92,255,.75);
  background: linear-gradient(135deg, rgba(124,92,255,.85), rgba(48,214,255,.28));
  box-shadow: 0 12px 34px rgba(124,92,255,.18);
}
.btn--primary:hover{ box-shadow: 0 16px 44px rgba(124,92,255,.25); }

.btn--ghost{
  border-color: rgba(35,48,86,.95);
  background: rgba(15,23,48,.20);
}

/* Hero */
.hero{ padding: 22px 0 10px; }
.hero__card{
  background: linear-gradient(180deg, rgba(15,23,48,.72), rgba(15,23,48,.35));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  overflow:hidden;
  position:relative;
}
.hero__card:before{
  content:"";
  position:absolute;
  inset:-2px;
  background: radial-gradient(600px 240px at 22% 20%, rgba(124,92,255,.18), transparent 60%),
              radial-gradient(600px 240px at 78% 25%, rgba(48,214,255,.12), transparent 60%);
  filter: blur(18px);
  opacity:.55;
  pointer-events:none;
}
.hero__title{margin:0 0 6px; font-size:28px; letter-spacing:.2px; position:relative}
.hero__desc{margin:0 0 14px; color:var(--muted); max-width: 76ch; position:relative}
.hero__actions{display:flex; gap:10px; flex-wrap:wrap; position:relative}
.hero__meta{display:flex; gap:10px; margin-top:14px; flex-wrap:wrap; position:relative}

.pill{
  font-size:12px;
  color: rgba(168,179,215,.95);
  border: 1px solid rgba(35,48,86,.9);
  background: rgba(15,23,48,.30);
  padding: 8px 10px;
  border-radius: 999px;
}

/* Section */
.section{ padding: 12px 0 22px; }
.section__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin: 10px 0 12px;
  flex-wrap:wrap;
}
.section__title{margin:0; font-size:18px}

/* Right tools */
.righttools{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
}

/* Sort dropdown */
.sort{ position:relative; }
.sort__select{
  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;
  padding: 10px 38px 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(35,48,86,.95);
  background: linear-gradient(180deg, rgba(15,23,48,.52), rgba(15,23,48,.22));
  color: var(--text);
  outline:none;
  font-size: 13px;
  box-shadow: 0 10px 26px rgba(0,0,0,.18);
  cursor:pointer;
  transition: box-shadow .12s ease, border-color .12s ease, transform .12s ease;
}
.sort__select:hover{
  transform: translateY(-1px);
  border-color: rgba(124,92,255,.45);
}
.sort:after{
  content:"▾";
  position:absolute;
  right:12px;
  top:50%;
  transform: translateY(-50%);
  color: rgba(168,179,215,.85);
  pointer-events:none;
}

/* Search */
.search{ display:flex; justify-content:flex-end; }
.searchbox{
  width: min(460px, 100%);
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(35,48,86,.95);
  background: linear-gradient(180deg, rgba(15,23,48,.52), rgba(15,23,48,.22));
  box-shadow: 0 10px 26px rgba(0,0,0,.18);
  transition: box-shadow .12s ease, border-color .12s ease;
}
.searchbox:focus-within{
  border-color: rgba(124,92,255,.6);
  box-shadow: 0 0 0 4px rgba(124,92,255,.16), 0 14px 34px rgba(0,0,0,.26);
}
.searchbox__icon{
  opacity:.85;
  color: rgba(168,179,215,.9);
  font-weight:900;
  width: 20px;
  text-align:center;
}
.searchbox__input{
  border:0;
  outline:none;
  background:transparent;
  color: var(--text);
  width:100%;
  font-size: 14px;
}
.searchbox__input::placeholder{ color: rgba(168,179,215,.70); }
.searchbox__clear{
  border:0;
  background: transparent;
  color: rgba(168,179,215,.8);
  cursor:pointer;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.searchbox__clear:hover{
  background: rgba(15,23,48,.30);
  border-color: rgba(35,48,86,.9);
  color: var(--text);
}

/* Grid & cards */
.grid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 980px){ .grid{grid-template-columns: 1fr;} }

.card{
  background: linear-gradient(180deg, rgba(15,23,48,.62), rgba(15,23,48,.32));
  border: 1px solid rgba(35,48,86,.85);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0,0,0,.32);
}
.card__body{padding: 14px}

.song__title{
  font-weight: 900;
  font-size: 15px;
  margin-bottom: 12px;
  letter-spacing: .2px;
}

.song__actions{display:flex; gap:10px; flex-wrap:wrap}

/* Embed */
.embed{
  border-radius: 16px;
  border: 1px solid rgba(35,48,86,.85);
  background: rgba(15,23,48,.20);
  padding: 10px;
  overflow:hidden;
  margin-bottom: 12px;
}
.embed iframe{
  display:block;
  max-width: 100%;
}

/* Empty */
.empty{
  border: 1px dashed rgba(35,48,86,.95);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--muted);
  background: rgba(15,23,48,.20);
}

/* Footer */
.footer{padding: 14px 0 26px; color:var(--muted)}
.footer__line{height:1px; background: rgba(35,48,86,.55); margin-bottom: 12px}

/* справа: сортировка + поиск */
.righttools{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  width:100%;
}
@media (max-width: 860px){
  .righttools{justify-content:flex-start}
}

/* ===== ADMIN FORMS: фикс белых инпутов + красивый фокус ===== */
input.search__input,
textarea.search__input{
  background: linear-gradient(180deg, rgba(15,23,48,.58), rgba(15,23,48,.26)) !important;
  color: var(--text) !important;
  border: 1px solid rgba(35,48,86,.95) !important;
  border-radius: 14px !important;
  padding: 11px 12px !important;
  outline: none !important;
  box-shadow: 0 10px 26px rgba(0,0,0,.12) !important;
}

input.search__input::placeholder,
textarea.search__input::placeholder{
  color: rgba(168,179,215,.72) !important;
}

/* focus как на поиске */
input.search__input:focus,
textarea.search__input:focus{
  border-color: rgba(124,92,255,.6) !important;
  box-shadow:
    0 0 0 4px rgba(124,92,255,.14),
    0 14px 34px rgba(0,0,0,.22) !important;
}

/* textarea аккуратнее */
textarea.search__input{
  resize: vertical;
  min-height: 140px;
}

/* ===== Chrome autofill (жёлтые поля) ===== */
input.search__input:-webkit-autofill,
input.search__input:-webkit-autofill:hover,
input.search__input:-webkit-autofill:focus,
textarea.search__input:-webkit-autofill{
  -webkit-text-fill-color: var(--text) !important;
  transition: background-color 99999s ease-in-out 0s;
  box-shadow: 0 0 0px 1000px rgba(15,23,48,.55) inset !important;
  border: 1px solid rgba(35,48,86,.95) !important;
}

/* ===== ADMIN cards чуть “дороже” выглядят ===== */
.adminmeta{
  border: 1px solid rgba(35,48,86,.85);
  background: rgba(15,23,48,.22);
  border-radius: 14px;
  padding: 10px;
  color: rgba(168,179,215,.95);
  font-size: 12px;
}
.adminmeta__line{ display:flex; gap:8px; align-items:flex-start; }
.adminmeta__k{ opacity:.75; min-width:52px; }
.adminmeta__v{ word-break: break-all; }

/* кнопка удалить — чуть контрастнее */
.btn--danger{
  border-color: rgba(255,120,120,.35);
  background: rgba(255,120,120,.08);
}
.btn--danger:hover{
  border-color: rgba(255,120,120,.55);
}

/* Lazy embed placeholder */
.embed--lazy{
  padding: 10px;
}

.embed__placeholder{
  border-radius: 14px;
  border: 1px solid rgba(35,48,86,.75);
  background: rgba(15,23,48,.18);
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:8px;
  padding: 14px;
}

.embed__title{
  font-weight: 900;
  letter-spacing:.2px;
}

.embed__hint{
  color: rgba(168,179,215,.85);
  font-size: 12px;
}

.embed__btn{
  align-self:flex-start;
  margin-top: 6px;
}

/* ===== Sort dropdown like screenshot ===== */
.sortdd{
  position: relative;
}

.sortdd__btn{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 14px;
  border-radius: 18px;
  border: 1px solid rgba(35,48,86,.95);
  background: rgba(15,23,48,.28);
  color: var(--text);
  cursor:pointer;
  box-shadow: 0 10px 26px rgba(0,0,0,.18);
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.sortdd__btn:hover{
  transform: translateY(-1px);
  border-color: rgba(124,92,255,.35);
  background: rgba(15,23,48,.34);
}
.sortdd__btn:active{ transform: translateY(0px); }

.sortdd__label{
  font-size: 13px;
  font-weight: 700;
  color: rgba(233,238,255,.95);
  white-space: nowrap;
}

.sortdd__chev{
  margin-left: 2px;
  color: rgba(168,179,215,.9);
  font-size: 12px;
  line-height: 1;
}

.sortdd__menu{
  position:absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(35,48,86,.95);
  background: rgba(11,16,32,.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  display:none;
  z-index: 40;
}

.sortdd.is-open .sortdd__menu{ display:block; }

.sortdd__item{
  width:100%;
  text-align:left;
  border:0;
  background: transparent;
  color: rgba(233,238,255,.92);
  padding: 10px 12px;
  border-radius: 10px;
  cursor:pointer;
  font-size: 13px;
  transition: background .12s ease, color .12s ease;
}

.sortdd__item:hover{
  background: rgba(124,92,255,.18);
}

.sortdd__item.is-active{
  background: rgba(48,214,255,.22);
  color: rgba(233,238,255,1);
}

.sortdd__item.is-disabled{
  color: rgba(168,179,215,.45);
  cursor:not-allowed;
}
.sortdd__item.is-disabled:hover{
  background: transparent;
}
/* ===== Mobile performance mode ===== */
@media (max-width: 820px){

  /* сетка в 1 колонку */
  .grid{ grid-template-columns: 1fr !important; gap: 10px; }

  /* меньше тяжёлых теней */
  .card{
    box-shadow: 0 8px 18px rgba(0,0,0,.22) !important;
  }

  /* отключаем blur где возможно */
  .topbar{
    backdrop-filter: none !important;
  }
  .bg-glow{
    mix-blend-mode: normal !important;
    opacity: .55 !important;
  }

  /* чуть компактнее */
  .card__body{ padding: 12px !important; }
  .hero__title{ font-size: 22px !important; }
  .hero__card{ padding: 14px !important; }

  /* кнопки/поля меньше */
  .btn{ padding: 10px 14px !important; border-radius: 14px !important; }
  .searchbox{ width: 100% !important; }
  .righttools{ justify-content: flex-start !important; }

  /* placeholder плеера аккуратнее */
  .embed__placeholder{ padding: 12px !important; }
}
