/* В нашу гавань заходили корабли — стили сайта. Три темы через CSS-переменные. */

:root, .theme-warm {
  --bg: #F4ECDD; --card: #FFF8EE; --ink: #3B2A20; --muted: #6B5446; --muted2: #8A7564;
  --line: #E2D3BC; --line2: #C9B497; --row: #F7EEDF; --hl: #F6E3C2;
  --head-bg: #3B2A20; --head-ink: #F4ECDD; --head-muted: #D9C6AC; --head-line: #5A4335;
  --accent: #E9B872; --on-accent: #3B2A20; --link: #7A3B1E; --link-h: #4E2410;
  --pill: #7A3B1E; --on-pill: #FFF8EE;
  --font: 'PT Sans', system-ui, sans-serif; --font-head: Lora, Georgia, serif;
  --r: 14px; --r-s: 8px;
  --logo-paper: #F4ECDD; --logo-line: #3B2A20; --logo-cat: #A39A94; --logo-guitar: #E9B872;
}
.theme-sea {
  --bg: #EEF4FA; --card: #FFFFFF; --ink: #0F2D4D; --muted: #3E5F80; --muted2: #566F88;
  --line: #D3E0EE; --line2: #B7CBE0; --row: #F4F8FC; --hl: #DCEBFA;
  --head-bg: #0F2D4D; --head-ink: #EEF4FA; --head-muted: #BFD3E8; --head-line: #2B4B6E;
  --accent: #F2B441; --on-accent: #0F2D4D; --link: #1D63A6; --link-h: #0F2D4D;
  --pill: #1D63A6; --on-pill: #FFFFFF;
  --font: Rubik, system-ui, sans-serif; --font-head: Rubik, system-ui, sans-serif;
  --r: 4px; --r-s: 4px;
  --logo-paper: #FFFFFF; --logo-line: #0F2D4D; --logo-cat: #A8B3BE; --logo-guitar: #F2B441;
}
.theme-min {
  --bg: #F7F7F5; --card: #FFFFFF; --ink: #111111; --muted: #5C5C5C; --muted2: #6B6B6B;
  --line: #E5E5E5; --line2: #D6D6D6; --row: #FAFAFA; --hl: #EAF0FC;
  --head-bg: #FFFFFF; --head-ink: #111111; --head-muted: #5C5C5C; --head-line: #E5E5E5;
  --accent: #1F5FD1; --on-accent: #FFFFFF; --link: #1F5FD1; --link-h: #123E8C;
  --pill: #111111; --on-pill: #FFFFFF;
  --font: Inter, system-ui, sans-serif; --font-head: Inter, system-ui, sans-serif;
  --r: 10px; --r-s: 6px;
  --logo-paper: #FFFFFF; --logo-line: #111111; --logo-cat: #A6A6A6; --logo-guitar: #1F5FD1;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--font); }
a { color: var(--link); }
a:hover { color: var(--link-h); }
img { max-width: 100%; height: auto; }
svg { flex: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--card); padding: 8px 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- Шапка --- */
.site-head { background: var(--head-bg); color: var(--head-ink); border-bottom: 1px solid var(--head-line); }
.head-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--head-ink); text-decoration: none; margin-right: auto; }
.brand:hover { color: var(--head-ink); }
.brand .logo-cat { display: block; width: 103px; height: 58px; }
.brand-text { display: flex; flex-direction: column; }
.brand-1 { font-family: var(--font-head); font-weight: 700; font-size: 26px; line-height: 1.1; }
.brand-2 { font-size: 14px; color: var(--accent); }
.theme-min .brand-2 { color: var(--muted); }
.search { display: flex; gap: 6px; flex: 1 1 260px; max-width: 380px; }
.search input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: var(--r-s); border: 1px solid var(--line2); background: var(--card); color: var(--ink); font: inherit; font-size: 16px; }
.search button, .burger { display: flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; border: 0; border-radius: var(--r-s); background: var(--accent); color: var(--on-accent); }
.search svg, .burger svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.themes { display: flex; align-items: center; gap: 6px; }
.themes-l { font-size: 13px; color: var(--head-muted); }
.sw { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid var(--head-line); position: relative; }
.sw::after { content: ''; position: absolute; inset: -9px; }
.sw[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.sw-warm { background: linear-gradient(135deg, #3B2A20 50%, #E9B872 50%); }
.sw-sea { background: linear-gradient(135deg, #0F2D4D 50%, #F2B441 50%); }
.sw-min { background: linear-gradient(135deg, #FFFFFF 50%, #1F5FD1 50%); }
.burger { display: none; }

.nav-main { border-top: 1px solid var(--head-line); }
.nav-main ul, .nav-sub ul, .side-menu ul { list-style: none; margin: 0; padding: 0; }
.nav-main ul { display: flex; flex-wrap: wrap; }
.nav-main a { display: block; padding: 13px 14px; color: var(--head-ink); text-decoration: none; }
.nav-main a:hover { background: var(--head-line); color: var(--head-ink); }
.nav-main a.on { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.theme-min .nav-main a.on { background: none; color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }

.nav-sub { padding: 16px 0 0; }
.nav-sub ul { display: flex; flex-wrap: wrap; gap: 8px; }
.nav-sub a { display: block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line2); text-decoration: none; color: var(--ink); font-size: 15px; }
.nav-sub a.on { background: var(--pill); border-color: var(--pill); color: var(--on-pill); }

/* --- Основная часть --- */
.layout { display: flex; flex-wrap: wrap; gap: 28px; padding-top: 24px; padding-bottom: 32px; align-items: flex-start; }
.main-col { flex: 999 1 600px; min-width: 0; }
.side { flex: 1 1 260px; display: flex; flex-direction: column; gap: 16px; }
.side-menu { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; }
.side-menu li { margin: 0; }
.side-menu a { display: block; padding: 9px 12px; border-radius: var(--r-s); text-decoration: none; color: var(--ink); }
.side-menu a:hover { background: var(--row); }
.side-menu li[style*="background"] a, .side-menu a.on { background: var(--hl) !important; font-weight: 700; }
.side-menu li { background: none !important; width: auto !important; height: auto !important; }
.side-mail a { display: inline-block; padding: 10px 14px; border: 1px solid var(--line2); border-radius: var(--r-s); text-decoration: none; }

/* Контент, который выдаёт движок: старые классы приведены к новому виду */
#content, #content2, #content3, #content4 { text-align: left !important; width: auto !important; float: none !important; margin: 0; }
.main-col table { max-width: 100%; border-collapse: collapse; }
.main-col [style*="width"] { max-width: 100%; }
.main-col center { text-align: left; }
.stat { margin: 0 0 16px; }
.stat p, .text1 { font-size: 17px; }
.main-col pre { white-space: pre; font-family: 'PT Mono', 'Courier New', ui-monospace, monospace; font-size: 16px; line-height: 1.6; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; overflow-x: auto; }
.text4, .text5 { font-family: var(--font-head); font-size: 26px; font-weight: 700; display: block; margin: 8px 0 12px; }
.text2, .text3 { font-weight: 700; }
.text2 a, .text3 a, .text4 a, .text5 a { background: none !important; border: 0 !important; padding: 0 !important; color: var(--link) !important; }
.table2, .table3 { display: table; width: 100%; font-style: normal; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.table2 td, .table3 td, .table2 th, .table3 th { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-style: normal; }
.table2 tr td a, .table3 a { font-style: normal; font-size: inherit; color: var(--link); }
.tr3, .tr4 { background: transparent; }
.tr4 { background: var(--row); }
.td1 { color: var(--link); }
.td2, .td3 { font-family: var(--font); font-size: 16px; text-indent: 0; text-align: left; }
.mp31, .mp32 { font-size: 14px; color: var(--muted); }
.mp31 a { color: var(--muted); font-weight: 400; }
.zagdat { width: auto; background: var(--hl); border: 0; border-radius: var(--r-s); color: var(--ink); font: 700 15px var(--font); padding: 6px 10px; }
.ul1 { padding: 0; }
.li1 { width: auto; height: auto; background: none; text-align: left; }
.li1 a { width: auto; height: auto; font: inherit; text-align: left; color: var(--link); }
.song1, .song2, .song3 { float: none; width: auto; padding: 0; margin: 0 0 8px; text-align: left; }

/* Постраничная навигация */
.navigation { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 16px 0; }
.navigation a, .navigation span { min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; margin: 0 !important; border-radius: var(--r-s); border: 1px solid var(--line2) !important; background: var(--card) !important; color: var(--ink) !important; font-size: 15px !important; text-decoration: none; }
.navigation span.current { background: var(--pill) !important; border-color: var(--pill) !important; color: var(--on-pill) !important; }

/* --- Список записей и плеер --- */
.sortbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 12px; font-size: 15px; }
.sortbar span { color: var(--muted); margin-right: 4px; }
.sortbar a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line2); text-decoration: none; color: var(--ink); }
.sortbar a.on { background: var(--pill); border-color: var(--pill); color: var(--on-pill); }
.tracks td { vertical-align: middle; }
.tracks .td2 { color: var(--muted2); width: 36px; text-align: right; }
.tracks .link2 { font-weight: 700; text-decoration: none; color: var(--ink); }
.tracks .td-time { white-space: nowrap; }
.tracks tr.playing { background: var(--hl); }
.play { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line2); background: var(--bg); color: var(--link); display: inline-flex; align-items: center; justify-content: center; }
.play svg { width: 16px; height: 16px; fill: currentColor; }
.play[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.dl { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px; text-decoration: none; white-space: nowrap; font-size: 14px; }
.dl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--head-bg); color: var(--head-ink); border-top: 1px solid var(--head-line); box-shadow: 0 -4px 20px rgba(0,0,0,.15); }
.player-in { max-width: 1200px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 14px; }
.player-btns { display: flex; align-items: center; gap: 6px; }
.pbtn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: none; color: var(--head-ink); display: flex; align-items: center; justify-content: center; }
.pbtn svg { width: 18px; height: 18px; fill: currentColor; }
.pbtn-main { width: 50px; height: 50px; background: var(--accent); color: var(--on-accent); }
.player .i-play { display: none; }
.player.is-paused .i-play { display: block; }
.player.is-paused .i-pause { display: none; }
.player-info { flex: 1; min-width: 0; }
.player-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--head-muted); }
.player-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#p-seek { width: 100%; accent-color: var(--accent); margin: 4px 0 0; }
.has-player body { padding-bottom: 96px; }

/* --- Поиск --- */
.search-big { max-width: 640px; margin: 0 0 20px; }
.sr-h { font-size: 20px; margin: 22px 0 8px; }
.sr-list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.sr-list li { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.sr-list li:last-child { border-bottom: 0; }
.sr-list a { font-weight: 700; text-decoration: none; }
.sr-ext { margin-top: 24px; color: var(--muted); }

/* --- Формы, реклама, подвал --- */
.form { display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.form input, .form textarea { font: inherit; font-weight: 400; padding: 10px 12px; border-radius: var(--r-s); border: 1px solid var(--line2); background: var(--card); color: var(--ink); }
.form .hp { position: absolute; left: -9999px; }
.btn { align-self: flex-start; padding: 12px 22px; border: 0; border-radius: var(--r-s); background: var(--pill); color: var(--on-pill); font-weight: 700; }
.note { padding: 10px 14px; border-radius: var(--r-s); }
.note.ok { background: #E3F4E6; color: #1E5B2A; }
.note.err { background: #FBE6E4; color: #8A1F14; }
.ad { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; text-align: center; overflow: hidden; }
.ad-wide { max-width: 1200px; margin: 0 auto 24px; }
.links { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font-size: 14px; }
.links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ad-label { display: block; font-size: 12px; color: var(--muted2); margin-bottom: 6px; }
.site-foot { background: var(--head-bg); color: var(--head-muted); font-size: 14px; padding: 20px 0; }
.theme-min .site-foot { border-top: 1px solid var(--line); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 10px; }
.foot-nav a { color: var(--head-ink); text-decoration: none; padding: 6px 0; }
.foot-small { font-size: 12px; }

/* --- Телефон --- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: 0 14px; }
  .head-row { padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .brand { gap: 8px; }
  .brand .logo-cat { width: 62px; height: 35px; }
  .sw { width: 26px; height: 26px; }
  .brand-1 { font-size: 17px; }
  .brand-2 { font-size: 12px; }
  .burger { display: flex; }
  .search { order: 5; flex-basis: 100%; max-width: none; }
  .themes { order: 4; }
  .themes-l { display: none; }
  .nav-main { display: none; }
  .menu-open .nav-main { display: block; }
  .nav-main ul { flex-direction: column; }
  .nav-main a { padding: 14px; border-bottom: 1px solid var(--head-line); }
  .nav-sub ul { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .nav-sub a { white-space: nowrap; }
  .layout { padding-top: 16px; gap: 20px; }
  .text4, .text5 { font-size: 22px; }
  /* записи карточками */
  .tracks, .tracks tbody { display: block; border: 0; background: none; }
  .tracks tr.trk { display: grid; grid-template-columns: 44px 1fr auto; grid-template-areas: "play info dl" "play info time"; column-gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin-bottom: 8px; }
  .tracks tr.trk.playing { background: var(--hl); }
  .tracks tr.trk td { display: block; padding: 0; border: 0; }
  .tracks .td-play { grid-area: play; }
  .tracks .td2 { display: none !important; }
  .tracks tr.trk td.td3:not(.td-time):not(.td-size) { grid-area: info; min-width: 0; }
  .tracks .td-time { grid-area: time; text-align: right; }
  .tracks .td-size { grid-area: dl; text-align: right; }
  .tracks .dl span { display: none; }
  .table2, .table2 tbody, .table2 tr, .table2 td, .table2 th { display: block; width: auto !important; }
  .table2 tr { border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .table2 td, .table2 th { border: 0; padding: 2px 0; }
  .table2 td + td { font-size: 14px; color: var(--muted); }
  .table2 td + td a { color: var(--muted); }
  .main-col pre { padding: 12px; font-size: 13.5px; }
  .player-in { padding: 8px 12px; gap: 8px; }
  .player .pbtn[data-act="prev"] { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
