:root {
  --bg: #0f1115;
  --bg2: #171a21;
  --card: #1c2029;
  --line: #2a2f3b;
  --text: #e8eaf0;
  --muted: #8d94a5;
  --accent: #ff3d6e;
  --accent2: #ffb03b;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
code { background: var(--bg2); padding: .1em .35em; border-radius: 4px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 18px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }

/* Header */
.site-header { background: var(--bg2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-row { display: flex; align-items: center; gap: 22px; height: 64px; }
.logo { font-weight: 800; font-size: 1.25rem; white-space: nowrap; }
.logo-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; margin-right: 4px; }
.main-nav { display: flex; gap: 4px; align-items: center; }
.main-nav > a, .dropdown > a { padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; display: block; }
.main-nav > a:hover, .main-nav > a.active, .dropdown:hover > a { color: var(--text); background: var(--card); }
.nav-admin { color: var(--accent2) !important; }
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 210px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.dropdown:hover .dropdown-menu, .dropdown:focus-within .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: 8px 12px; border-radius: 6px; }
.dropdown-menu a:hover { background: var(--bg2); }
.search { margin-left: auto; }
.search input { width: 260px; }
.menu-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.5rem; cursor: pointer; }

input[type=text], input[type=url], input[type=search], input[type=password], input[type=number], textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px 14px; font: inherit;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }

/* Buttons and chips */
.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 10px 18px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn:hover { color: #fff; filter: brightness(1.1); }
.btn.small { padding: 6px 12px; font-size: .875rem; border-radius: 8px; }
.btn.ghost { background: var(--card); border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: #c62828; }
.btn.fb { background: #1877f2; } .btn.x { background: #000; border: 1px solid #333; } .btn.viber { background: #7360f2; }
.chip, .tag { display: inline-block; font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); margin: 2px 4px 2px 0; color: var(--muted); cursor: pointer; font-family: inherit; }
.chip-genre { color: var(--accent2); border-color: rgba(255,176,59,.35); }
.tag { color: #7fb4ff; }
.chip:hover, .tag:hover { border-color: var(--accent); color: var(--text); }

/* Headings */
.page-title { font-size: 1.6rem; margin: 26px 0 10px; }
.section-title { font-size: 1.3rem; margin: 30px 0 14px; padding-left: 12px; border-left: 4px solid var(--accent); }
.genre-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.genre-row a { padding: 7px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: .9rem; }
.genre-row a:hover { border-color: var(--accent); }

/* Song cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; transition: transform .15s; }
.card:hover { transform: translateY(-3px); }
.thumb { position: relative; display: block; aspect-ratio: 4/3; overflow: hidden; background: #000; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.play { position: absolute; inset: 0; margin: auto; width: 50px; height: 50px; border-radius: 50%; background: rgba(255,61,110,.92); display: grid; place-items: center; color: #fff; opacity: 0; transition: opacity .15s; }
.card:hover .play { opacity: 1; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { font-size: .98rem; margin: 0; line-height: 1.35; }
.card-genres { margin: 0; }
.card .listen { align-self: flex-start; margin-top: auto; }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin: 24px 0; }
.pagination a, .pagination span { min-width: 40px; text-align: center; padding: 8px 12px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); }
.pagination .current { background: var(--accent); border-color: var(--accent); font-weight: 700; }

/* Song page */
.crumbs { font-size: .875rem; color: var(--muted); margin: 18px 0 4px; }
.song-head h1 { font-size: 2rem; margin: 6px 0; line-height: 1.2; }
.song-sub { color: var(--muted); margin: 0 0 6px; }
.song-artists { margin: 0 0 14px; }
.artist-link { font-weight: 700; color: var(--accent2); margin-right: 8px; }
.listen-label { font-size: 1.1rem; margin: 18px 0 8px; }
.player { max-width: 960px; position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: #000; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player.lite { cursor: pointer; }
.player.lite img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: filter .2s; }
.player.lite:hover img { filter: brightness(.8); }
.player-btn { position: absolute; inset: 0; margin: auto; width: 84px; height: 60px; border: 0; border-radius: 16px; background: rgba(255,0,0,.9); color: #fff; font-size: 1.8rem; cursor: pointer; display: grid; place-items: center; box-shadow: 0 6px 24px rgba(0,0,0,.45); transition: transform .15s, background .15s; }
.player.lite:hover .player-btn { transform: scale(1.08); background: #f00; }
.player-btn span { margin-left: 4px; }
.player-noscript { position: absolute; bottom: 12px; left: 12px; background: rgba(0,0,0,.7); padding: 6px 12px; border-radius: 8px; }
.listen-on, .share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0; }
.listen-on > span, .share > span { color: var(--muted); margin-right: 4px; }
.share { padding: 14px 16px; background: var(--bg2); border-radius: var(--radius); }
.prose { font-size: 1.05rem; max-width: 820px; }
.song .listen-on, .song .share { max-width: 960px; }
.prose a { color: var(--accent2); text-decoration: underline; }

/* Taxonomy and lists */
.term-head { margin: 10px 0 18px; }
.term-head h1 { margin: 4px 0; font-size: 1.9rem; }
.term-label { text-transform: uppercase; font-size: .75rem; letter-spacing: .08em; color: var(--accent); font-weight: 700; }
.letters a { display: inline-block; padding: 4px 9px; margin: 2px; background: var(--card); border-radius: 6px; font-weight: 700; }
.letter-group h2 { color: var(--accent); margin: 24px 0 8px; }
.term-columns { columns: 4 200px; list-style: none; padding: 0; margin: 0; }
.term-columns li { padding: 3px 0; break-inside: avoid; }
.cloud { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.cloud a { color: #7fb4ff; }

/* Search */
.big-search { display: flex; gap: 10px; margin: 6px 0 10px; max-width: 760px; }
.big-search input { font-size: 1.1rem; padding: 14px 16px; }
.yt-results { display: grid; gap: 14px; }
.yt-item { display: grid; grid-template-columns: 240px 1fr; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.yt-item.playing { grid-template-columns: 1fr; }
.yt-media { aspect-ratio: 16/9; background: #000; position: relative; }
.yt-media img { width: 100%; height: 100%; object-fit: cover; }
.yt-media iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-info { padding: 12px 14px 12px 0; }
.yt-item.playing .yt-info { padding: 0 16px 14px; }
.yt-info h3 { margin: 0 0 4px; font-size: 1.02rem; }
.yt-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Empty / alerts */
.empty { color: var(--muted); padding: 30px 0; text-align: center; }
.hero-empty { padding: 60px 20px; background: var(--bg2); border-radius: var(--radius); margin: 30px 0; }
.hero-empty a { color: var(--accent); text-decoration: underline; }
.alert { padding: 12px 16px; border-radius: 10px; margin: 12px 0; }
.alert.ok { background: rgba(46,160,67,.15); border: 1px solid rgba(46,160,67,.5); }
.alert.err { background: rgba(229,57,53,.15); border: 1px solid rgba(229,57,53,.5); }
.alert.warn { background: rgba(255,176,59,.12); border: 1px solid rgba(255,176,59,.5); }
.alert a { text-decoration: underline; }

/* Admin */
.panel { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 14px 0; }
.panel.row, .row { display: flex; gap: 10px; align-items: center; }
.panel label, .edit-form label { display: block; font-weight: 600; margin: 0 0 14px; }
.panel label input, .panel label textarea { margin-top: 6px; font-weight: 400; }
.panel label small { color: var(--muted); font-weight: 400; }
.label-row { display: flex; }
.edit-form label.big input { font-size: 1.05rem; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pick { margin: -8px 0 16px; }
.preview { display: flex; gap: 14px; align-items: center; background: var(--bg); border-radius: 10px; padding: 10px; margin: 0 0 16px; }
.preview img { width: 160px; border-radius: 8px; }
.preview p { margin: 2px 0; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.login { max-width: 420px; margin: 60px auto; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stats { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); }
.stats strong { color: var(--text); font-size: 1.2rem; }
.admin-search { max-width: 360px; margin: 10px 0; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table img { border-radius: 6px; }
form.inline { display: inline; }
.term-edit summary { cursor: pointer; }
.term-edit form { margin-top: 14px; }

.site-footer { margin-top: 60px; border-top: 1px solid var(--line); padding: 26px 0; background: var(--bg2); font-size: .9rem; }
.site-footer p { margin: 4px 0; }

/* Mobile */
@media (max-width: 860px) {
  .header-row { flex-wrap: wrap; height: auto; padding: 10px 18px; gap: 10px; }
  .menu-toggle { display: block; margin-left: auto; }
  .main-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; }
  .nav-open .main-nav { display: flex; }
  .dropdown-menu { position: static; display: block; box-shadow: none; border: 0; padding-left: 14px; background: none; }
  .search { width: 100%; margin: 0; } .search input { width: 100%; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .song-head h1 { font-size: 1.5rem; }
  .cols { grid-template-columns: 1fr; }
  .yt-item { grid-template-columns: 1fr; } .yt-info { padding: 0 14px 14px; }
  .admin-table td:nth-child(4), .admin-table th:nth-child(4), .admin-table td:nth-child(5), .admin-table th:nth-child(5) { display: none; }
}

/* Плейлист „Още от изпълнителя“ */
.player #yt-frame, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.playlist { max-width: 960px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px 12px; margin: 24px 0; }
.playlist-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.playlist-head .section-title { margin: 16px 0 10px; }
.playlist-controls { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.autoplay { color: var(--muted); font-size: .9rem; display: flex; gap: 6px; align-items: center; cursor: pointer; }
.autoplay input { accent-color: var(--accent); }
.playlist-items { list-style: none; margin: 0; padding: 0; max-height: 440px; overflow-y: auto; counter-reset: pl; }
.pl-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; counter-increment: pl; }
.pl-item::before { content: counter(pl); width: 22px; text-align: right; color: var(--muted); font-size: .85rem; flex: none; }
.pl-item:hover { background: var(--card); }
.pl-item.current { background: var(--card); box-shadow: inset 3px 0 0 var(--accent); }
.pl-play { position: relative; flex: none; width: 112px; aspect-ratio: 16/9; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: #000; cursor: pointer; }
.pl-play img { width: 100%; height: 100%; object-fit: cover; }
.pl-icon { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.2rem; background: rgba(0,0,0,.35); opacity: 0; transition: opacity .15s; }
.pl-item:hover .pl-icon, .pl-item.playing .pl-icon { opacity: 1; }
.pl-item.playing .pl-icon { background: rgba(255,61,110,.55); }
.pl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pl-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-item.current .pl-title { color: var(--accent); }
.pl-sub { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-link { color: var(--muted); padding: 6px 10px; border-radius: 6px; flex: none; }
.pl-link:hover { background: var(--bg); }
@media (max-width: 860px) { .pl-play { width: 88px; } .playlist { padding: 4px 10px 10px; } }

/* SEO блок в админа */
.seo-box { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 0 0 16px; }
.seo-box summary { cursor: pointer; font-weight: 700; }
.seo-box[open] summary { margin-bottom: 14px; }
.serp { background: #fff; color: #202124; border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; font-family: Arial, sans-serif; max-width: 640px; }
.serp-url { font-size: 13px; color: #4d5156; }
.serp-title { font-size: 20px; color: #1a0dab; line-height: 1.3; margin: 4px 0; }
.serp-desc { font-size: 14px; color: #4d5156; line-height: 1.5; }
