/* Music Portal "modern" theme - one small file, no framework. Mobile first, light + dark. */
:root {
    --bg: #f5f6fa; --card: #fff; --line: #e7e8ef; --text: #12131a; --mu: #6b7080;
    --ac: #4f46e5; --ac2: #db2777; --acs: #eef0ff; --ok: #059669; --bad: #dc2626;
    --r: 14px; --sh: 0 1px 2px rgba(16, 24, 40, .05);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}
/* dark colours: set by the head script as <html data-theme="dark"> (Auto = 7 pm - 6 am, or the visitor's choice).
   Without JavaScript the phone's own dark setting is used. */
:root[data-theme="dark"] { --bg: #0d0f15; --card: #161922; --line: #262a36; --text: #eceef5; --mu: #9aa0b3; --ac: #8b85ff; --ac2: #f472b6; --acs: #1e2040; --sh: none; color-scheme: dark; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) { --bg: #0d0f15; --card: #161922; --line: #262a36; --text: #eceef5; --mu: #9aa0b3; --ac: #8b85ff; --ac2: #f472b6; --acs: #1e2040; --sh: none; color-scheme: dark; }
}
body, .top, .box, .card, .dl-box, .hero-item, .foot, .drawer { transition: background-color .25s, color .25s, border-color .25s; }

/* theme switch: header button + 3-way choice in the menu */
.thm .i-sun, .thm .i-moon, .thm .i-auto { display: none; }
[data-mode="light"] .thm .i-sun, [data-mode="dark"] .thm .i-moon, [data-mode="auto"] .thm .i-auto { display: block; }
.thm-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin: 4px 0 6px; }
.thm-pick button { border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px !important; border-radius: 9px !important; font-size: .78rem; font-weight: 700; color: var(--mu) !important; justify-content: center; }
.thm-pick button[aria-pressed="true"] { background: var(--card) !important; color: var(--ac) !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.thm-note { font-size: .74rem; color: var(--mu); padding: 0 10px 6px; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 15px/1.5 var(--font); background: var(--bg); color: var(--text); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; background: var(--line); }
a { color: var(--ac); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.45rem; } h2, .h3 { font-size: 1.15rem; } h3 { font-size: 1.02rem; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
.i { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.2em; }
.mu { color: var(--mu); } .sm { font-size: .85rem; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 14px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--card); padding: 8px; }
[hidden] { display: none !important; }

/* header */
.top { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--card) 92%, transparent); border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: saturate(160%) blur(8px); backdrop-filter: saturate(160%) blur(8px); }
@supports not (background: color-mix(in srgb, red, blue)) { .top { background: var(--card); } }
.bar { display: flex; align-items: center; gap: 8px; height: 56px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.08rem; color: var(--text); min-width: 0; }
.logo:hover { text-decoration: none; }
.logo .ln { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.lg { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--ac), var(--ac2)); flex: none; }
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav a { padding: 7px 10px; border-radius: 9px; color: var(--text); font-weight: 600; font-size: .92rem; white-space: nowrap; }
.nav a:hover { background: var(--acs); text-decoration: none; }
.ib { width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; display: grid; place-items: center; cursor: pointer; flex: none; color: var(--text); }
.ib:hover { background: var(--acs); }
.search { display: flex; align-items: center; margin-left: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; height: 40px; min-width: 0; }
.search input { border: 0; background: transparent; padding: 0 12px; min-width: 0; flex: 1; height: 100%; outline: 0; width: 220px; }
.search select { border: 0; border-left: 1px solid var(--line); background: transparent; height: 100%; padding: 0 6px; font-size: .85rem; color: var(--mu); }
.search button { border: 0; background: var(--ac); color: #fff; height: 100%; padding: 0 14px; cursor: pointer; }
.search.big { height: 48px; margin: 0 0 16px; } .search.big input { width: auto; }
.me { position: relative; } .me summary { list-style: none; cursor: pointer; } .me summary::-webkit-details-marker { display: none; }
.me summary img { border-radius: 50%; width: 34px; height: 34px; object-fit: cover; }
.me .menu { position: absolute; right: 0; top: 44px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px; min-width: 190px; box-shadow: 0 10px 30px rgba(0, 0, 0, .15); }
.me .menu a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; color: var(--text); }
.me .menu a:hover { background: var(--acs); text-decoration: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-top: 2px; padding-bottom: 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips a { flex: none; padding: 6px 13px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); color: var(--text); font-size: .87rem; font-weight: 600; white-space: nowrap; }
.chips a:hover { border-color: var(--ac); color: var(--ac); text-decoration: none; }
.only-d { display: none !important; }
@media (max-width: 899.98px) {
    .search { display: none; position: absolute; left: 10px; right: 10px; top: 8px; z-index: 5; background: var(--card); }
    .search input { width: auto; }
    .top.searching .search { display: flex; }
    [data-toggle-search] { margin-left: auto; }
}
@media (min-width: 900px) { .only-m { display: none !important; } .only-d { display: inline-flex !important; } nav.only-d { display: flex !important; } }

/* drawer */
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(86vw, 320px); background: var(--card); z-index: 60; transform: translateX(-102%); transition: transform .2s ease; overflow-y: auto; padding: 10px 12px 24px; }
.drawer .dh { display: flex; justify-content: space-between; align-items: center; padding: 4px 2px 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.drawer nav a, .drawer nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 10px; border-radius: 10px; color: var(--text); font-weight: 600; border: 0; background: none; text-align: left; cursor: pointer; }
.drawer nav a:hover, .drawer nav button:hover { background: var(--acs); text-decoration: none; }
.drawer .dl { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mu); padding: 14px 10px 4px; font-weight: 700; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s; }
body.nav-open .drawer { transform: none; } body.nav-open .scrim { opacity: 1; pointer-events: auto; } body.nav-open { overflow: hidden; }

/* page */
.page { padding: 14px 0 8px; }
.page.narrow { max-width: 760px; margin: 0 auto; }
.hero { padding: 6px 0 4px; } .hero h1 span, .page-h h1 span, .hero-item h1 span { color: var(--mu); font-weight: 600; font-size: .7em; display: block; }
.page-h { margin: 6px 0 14px; } .page-h h1 { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; } .page-h h1 .i { color: var(--ac); margin-top: .15em; }
.cols { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.main, .side { min-width: 0; }
@media (min-width: 992px) { .cols { grid-template-columns: minmax(0, 1fr) 320px; } .side { position: sticky; top: 120px; align-self: start; } }
section { margin-bottom: 22px; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--sh); margin-bottom: 16px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sec-h h2, .sec-h h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.sec-h h2 .i, .sec-h h3 .i { color: var(--ac); }
.more { font-size: .86rem; font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; }
.empty { padding: 30px 10px; text-align: center; color: var(--mu); background: var(--card); border: 1px dashed var(--line); border-radius: var(--r); }

/* cards */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 992px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; gap: 4px; color: var(--text); min-width: 0; }
.card:hover { text-decoration: none; } .card:hover .t { color: var(--ac); }
.cover { position: relative; border-radius: 12px; overflow: hidden; background: var(--line); display: block; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover.sq { aspect-ratio: 1; } .cover.poster { aspect-ratio: 2/3; } .cover.round { aspect-ratio: 1; border-radius: 50%; }
.cover .play { position: absolute; right: 6px; bottom: 6px; width: 30px; height: 30px; padding: 7px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; opacity: .9; }
.card .t { font-weight: 600; font-size: .9rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .m { font-size: .78rem; color: var(--mu); display: flex; align-items: center; gap: 4px; }
.card.artist { text-align: center; } .card.artist .cover { width: 86%; margin: 0 auto; }

/* rows */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li + li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; padding: 9px 2px; color: var(--text); min-width: 0; }
.row:hover { text-decoration: none; } .row:hover .t { color: var(--ac); }
.row img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; }
.row img.poster { width: 44px; height: 62px; } .row img.round { border-radius: 50%; width: 46px; height: 46px; }
.rt { min-width: 0; display: flex; flex-direction: column; }
.rt .t { font-weight: 600; font-size: .93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt .m { font-size: .78rem; color: var(--mu); display: flex; gap: 4px; align-items: center; }

/* item hero (song / album / profile) */
.hero-item { display: grid; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 14px; box-shadow: var(--sh); }
.hi-cover { width: min(64vw, 240px); margin: 0 auto; border-radius: 14px; overflow: hidden; background: var(--line); }
.hi-cover img { width: 100%; height: 100%; object-fit: cover; }
.hi-cover.sq { aspect-ratio: 1; } .hi-cover.poster { aspect-ratio: 2/3; width: min(52vw, 200px); } .hi-cover.round { aspect-ratio: 1; border-radius: 50%; width: 140px; }
@media (min-width: 700px) { .hero-item { grid-template-columns: auto 1fr; align-items: start; padding: 18px; } .hi-cover { margin: 0; width: 230px; } .hi-cover.poster { width: 180px; } }
.hero-item h1 { font-size: 1.35rem; }
.facts { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 2px; }
@media (min-width: 560px) { .facts { grid-template-columns: 1fr 1fr; column-gap: 18px; } }
.facts li { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); min-width: 0; font-size: .92rem; }
.facts li .i { color: var(--ac); align-self: center; }
.facts b { color: var(--mu); font-weight: 600; min-width: 74px; }
.facts span, .facts li > a { min-width: 0; overflow-wrap: anywhere; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; }
.dl-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 26px; display: grid; gap: 12px; box-shadow: var(--sh); }
.rates { display: flex; flex-wrap: wrap; gap: 8px; }
.owner { align-items: center; border-top: 1px dashed var(--line); padding-top: 10px; }
.player audio { width: 100%; height: 44px; margin: 4px 0 6px; }
.player h2 { display: flex; gap: 8px; align-items: center; }
.tagrow { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 18px; }
.tagrow a { padding: 4px 11px; border-radius: 99px; background: var(--acs); font-size: .85rem; font-weight: 600; }
.tags-text { color: var(--mu); font-size: .82rem; margin: 6px 0 0; }
.prose { overflow-wrap: anywhere; } .prose h1 { font-size: 1.35rem; } .prose img { height: auto; }

/* buttons + forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent;
    background: var(--ac); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { filter: brightness(1.07); }
.btn.big { min-height: 54px; font-size: 1.05rem; background: linear-gradient(135deg, var(--ac), var(--ac2)); }
.btn.block { width: 100%; }
.btn.ghost { background: var(--card); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ac); color: var(--ac); filter: none; }
.btn.alt { background: #1877f2; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: .88rem; }
.btn.danger:hover { color: var(--bad); border-color: var(--bad); }
.btn.fav.on { color: var(--ac2); border-color: var(--ac2); } .btn.fav.on .i { fill: currentColor; }
.stack { display: grid; gap: 12px; }
.stack label { display: grid; gap: 5px; font-weight: 600; font-size: .9rem; }
.stack input:not([type=file]), .stack select, .stack textarea { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
.stack input:focus, .stack select:focus, .stack textarea:focus { outline: 2px solid var(--ac); outline-offset: 1px; }
.bar-wrap { display: flex; align-items: center; gap: 10px; } .prog { flex: 1; height: 8px; background: var(--line); border-radius: 9px; overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: var(--ac); transition: width .2s; }
.msg { padding: 10px 12px; border-radius: 10px; background: var(--acs); margin: 0; } .msg.err { background: color-mix(in srgb, var(--bad) 14%, transparent); }

/* dialogs */
.dlg { border: 0; border-radius: 16px; padding: 0; width: min(94vw, 440px); background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.dlg::backdrop { background: rgba(0, 0, 0, .5); }
.dlg-h { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); margin: 0; }
.dlg-h h3 { margin: 0; } .dlg-b { padding: 16px; }
.share-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-list a, .share-list button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-weight: 600; cursor: pointer; }

/* breadcrumb + pagination from the core */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0 0 12px; padding: 0; font-size: .84rem; color: var(--mu); }
.breadcrumb-item + .breadcrumb-item::before { content: "/"; margin-right: 4px; color: var(--line); }
.breadcrumb i, .pagination i { display: none; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; list-style: none; padding: 0; margin: 18px 0; }
.page-link { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-weight: 700; }
.page-item.active .page-link { background: var(--ac); border-color: var(--ac); color: #fff; }
.az { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.az a { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: .9rem; padding: 0 8px; }
.az a.on { background: var(--ac); color: #fff; border-color: var(--ac); }

/* ads: labelled, spaced from buttons, collapse when empty */
.ad { margin: 18px auto; text-align: center; overflow: hidden; clear: both; max-width: 100%; }
.ad::before { content: "Advertisement"; display: block; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--mu); margin-bottom: 4px; }
.ad.in-grid { grid-column: 1 / -1; margin: 6px 0; }
.ad-li { border-top: 0 !important; } .top-ad { margin-top: 12px; }

/* footer */
.foot { margin-top: 30px; background: var(--card); border-top: 1px solid var(--line); padding: 26px 0 14px; }
.fg { display: grid; gap: 22px; }
@media (min-width: 760px) { .fg { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mu); }
.foot nav a { display: block; padding: 4px 0; color: var(--text); }
.copy { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 12px; font-size: .85rem; color: var(--mu); }

/* 404 */
.nf { min-height: 100vh; display: grid; place-items: center; padding: 16px; text-align: center; }
.nf .box { max-width: 460px; width: 100%; } .nf-code { font-size: 4rem; font-weight: 900; background: linear-gradient(135deg, var(--ac), var(--ac2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nf .search { margin: 14px 0; display: flex; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
