:root {
  --bg: #0B0E1A;
  --surface: #151932;
  --surface-hi: #1D2242;
  --line: #2A3060;
  --gold: #F2B84B;
  --magenta: #E23F84;
  --green: #4FCB8A;
  --text: #F5F3EC;
  --text-dim: #9BA0C0;
  --font-display: "Arial Black", Impact, "Segoe UI", sans-serif;
  --font-body: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); }
body { min-height: 100vh; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; }

/* Фон */
.bg-video { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; opacity: .35; }
.bg-overlay { position: fixed; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(11,14,26,.55), rgba(11,14,26,.92) 60%); }

/* Шапка */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 24px; background: rgba(11,14,26,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--text); }
.brand-word { font-family: var(--font-display); font-size: 22px; color: var(--gold); }
.brand-rodina { display: inline-flex; font-size: 22px; }
.brand-rodina span { display: inline-block; font-family: var(--font-display); animation: bounce 2.2s ease-in-out infinite; text-shadow: 0 0 14px currentColor; }
.brand-rodina span:nth-child(1) { color: hsl(0,78%,66%); }
.brand-rodina span:nth-child(2) { color: hsl(45,80%,62%); animation-delay: .1s; }
.brand-rodina span:nth-child(3) { color: hsl(95,65%,60%); animation-delay: .2s; }
.brand-rodina span:nth-child(4) { color: hsl(165,65%,58%); animation-delay: .3s; }
.brand-rodina span:nth-child(5) { color: hsl(215,75%,68%); animation-delay: .4s; }
.brand-rodina span:nth-child(6) { color: hsl(280,65%,70%); animation-delay: .5s; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .brand-rodina span { animation: none; } }

.search { flex: 1 1 260px; display: flex; gap: 8px; }
.search input { flex: 1; min-width: 0; padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); outline: none; }
.search input:focus { border-color: var(--gold); }
.account { display: flex; align-items: center; gap: 10px; }
.balance { padding: 8px 14px; border-radius: 999px; background: var(--surface-hi); border: 1px solid var(--line); white-space: nowrap; }
.balance b { color: var(--gold); }

.btn { padding: 10px 18px; border-radius: 999px; background: var(--surface-hi); border: 1px solid var(--line); white-space: nowrap; transition: transform .15s, border-color .15s; }
.btn:hover { transform: translateY(-1px); border-color: var(--gold); }
.btn-gold { background: var(--gold); color: #1a1405; border-color: var(--gold); font-weight: 700; }
.btn-magenta { background: var(--magenta); border-color: var(--magenta); font-weight: 700; }
.btn-wide { width: 100%; padding: 13px; }

/* Раскладка */
.layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 20px 24px 60px; }
.side { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 100px); overflow: auto; }
.side h3 { margin: 14px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); }
.genre-btn { text-align: left; padding: 9px 14px; border-radius: 10px; color: var(--text-dim); }
.genre-btn:hover { background: var(--surface); color: var(--text); }
.genre-btn.active { background: var(--surface-hi); color: var(--gold); font-weight: 700; }
.genre-btn .n { float: right; opacity: .6; font-size: 13px; }

.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.list-head h2 { margin: 0; font-family: var(--font-display); font-size: 24px; }
.muted { color: var(--text-dim); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card { position: relative; text-align: left; padding: 14px 44px 14px 16px; border-radius: 14px; background: rgba(21,25,50,.82);
  border: 1px solid var(--line); transition: transform .15s, border-color .15s; min-height: 84px; }
.card:hover { transform: translateY(-2px); border-color: var(--gold); }
.card .artist { font-weight: 700; overflow-wrap: break-word; }
.card .title { color: var(--text-dim); margin-top: 3px; overflow-wrap: break-word; }
.card .tag { display: inline-block; margin-top: 8px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: rgba(79,203,138,.15); color: var(--green); }
.card .fav, .card .add { position: absolute; right: 8px; width: 30px; height: 30px; border-radius: 50%; color: var(--text-dim); }
.card .fav { top: 8px; }
.card .add { bottom: 8px; font-size: 18px; }
.card .fav:hover, .card .add:hover { background: var(--surface-hi); color: var(--text); }
.card .fav.on { color: var(--magenta); }
.more { margin: 20px auto 0; display: block; }
.empty { padding: 40px; text-align: center; color: var(--text-dim); }

/* Плеер */
.player { position: fixed; inset: 0; z-index: 50; background: #000; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-ctrl { position: absolute; top: 16px; right: 16px; display: flex; gap: 10px; transition: opacity .3s; }
.player.idle .player-ctrl, .player.idle .player-title { opacity: 0; }
.player-ctrl button { width: 52px; height: 52px; border-radius: 50%; background: rgba(21,25,50,.8); border: 1px solid var(--line); font-size: 20px; }
.player-ctrl button:hover { border-color: var(--gold); }
.player-title { position: absolute; top: 24px; left: 24px; right: 260px; font-weight: 700; text-shadow: 0 2px 8px #000; transition: opacity .3s; }

/* Окна */
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(5,7,15,.75); backdrop-filter: blur(4px); }
.modal { position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 28px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.modal h2 { margin: 0 0 6px; font-family: var(--font-display); }
.modal p { color: var(--text-dim); margin: 6px 0 16px; line-height: 1.45; }
.modal .x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; font-size: 18px; color: var(--text-dim); }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 5px; }
.field input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); outline: none; }
.field input:focus { border-color: var(--gold); }
.err { color: #ff7a9c; min-height: 20px; font-size: 14px; margin: 4px 0 8px; }
.tabs { display: flex; gap: 6px; margin-bottom: 18px; background: var(--bg); padding: 4px; border-radius: 999px; }
.tabs button { flex: 1; padding: 9px; border-radius: 999px; color: var(--text-dim); }
.tabs button.active { background: var(--surface-hi); color: var(--text); font-weight: 700; }
.packs { display: grid; gap: 10px; }
.pack { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); text-align: left; }
.pack:hover { border-color: var(--gold); }
.pack b { font-size: 18px; }
.pack .price { font-family: var(--font-display); color: var(--gold); font-size: 20px; }
.pack .per { display: block; font-size: 13px; color: var(--text-dim); }
.check { display: flex; gap: 8px; align-items: center; color: var(--text-dim); font-size: 14px; margin: 12px 0 0; }
.small { font-size: 13px; color: var(--text-dim); text-align: center; margin-top: 14px; }
.small a { color: var(--text-dim); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; padding: 12px 20px; border-radius: 999px;
  background: var(--surface-hi); border: 1px solid var(--gold); box-shadow: 0 10px 30px rgba(0,0,0,.4); }

.foot { padding: 24px; text-align: center; color: var(--text-dim); font-size: 13px; border-top: 1px solid var(--line); }
.foot a { color: var(--text-dim); }

@media (max-width: 760px) {
  .top { padding: 12px 16px; gap: 10px; }
  .brand { flex: 1; }
  .search { order: 3; flex-basis: 100%; }
  .balance { padding: 7px 10px; }
  .btn { padding: 9px 14px; }
  .layout { grid-template-columns: 1fr; padding: 14px 16px 50px; }
  .side { position: static; flex-direction: row; overflow-x: auto; max-height: none; padding-bottom: 4px; }
  .side h3 { display: none; }
  .genre-btn { white-space: nowrap; }
  .genre-btn .n { display: none; }
  .grid { grid-template-columns: 1fr 1fr; }
  .player-title { right: 16px; top: 84px; }
}
@media (max-width: 420px) { .grid { grid-template-columns: 1fr; } }
