:root {
    color-scheme: dark;
    --bg: #08090d;
    --panel: #12141d;
    --panel-soft: #191c28;
    --text: #f5f7fb;
    --muted: #9aa3b2;
    --brand: #1ed760;
    --brand-dark: #16a64a;
    --danger: #ff5c7a;
    --line: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(30, 215, 96, 0.18), transparent 32rem),
        linear-gradient(135deg, #08090d 0%, #11131c 55%, #08090d 100%);
    color: var(--text);
    font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
}

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

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 34px;
}

.brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: 180px;
    height: auto;
    border-radius: 0;
}

.nav {
    display: flex;
    gap: 14px;
    color: var(--muted);
}

.nav-link {
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    text-decoration: underline;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 24px;
    align-items: start;
}

.panel,
.track-card,
.table-wrap {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(18, 20, 29, 0.88);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.panel {
    padding: 24px;
}

.headline {
    display: grid;
    gap: 10px;
    margin: 0 0 12px;
    max-width: 680px;
    font-size: clamp(30px, 4.2vw, 52px);
    line-height: 1.04;
}

.headline-sub {
    color: var(--brand);
    font-size: 0.72em;
    line-height: 1.12;
}

.muted {
    color: var(--muted);
}

.user-pill {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
}

.user-pill code {
    overflow: hidden;
    color: var(--text);
    text-overflow: ellipsis;
}

.player {
    display: grid;
    gap: 18px;
}

.player-tabs {
    display: flex;
    gap: 8px;
}

.player-tab {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
}

.player-tab.active {
    background: var(--brand);
    color: #021006;
}

.track-card {
    min-height: 0;
    padding: 16px;
    background: linear-gradient(160deg, rgba(30, 215, 96, 0.18), rgba(18, 20, 29, 0.92) 58%);
}

.blind-player {
    display: grid;
    min-height: 72px;
    place-items: center;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    color: var(--muted);
    font-size: 17px;
    text-align: center;
}

.track-title {
    margin: 0;
    font-size: 30px;
}

.track-artist {
    margin: 6px 0 22px;
    color: var(--muted);
    font-size: 18px;
}

audio {
    width: 100%;
    margin-top: 12px;
}

.actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
}

button,
.button,
input[type="submit"] {
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    background: var(--panel-soft);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
}

button.primary,
.button.primary,
input[type="submit"] {
    background: var(--brand);
    color: #021006;
}

.play-toggle {
    min-width: 104px;
    text-align: center;
}

.next-action {
    min-width: 132px;
    padding-inline: 12px;
}

button.like-action {
    min-width: 112px;
    padding: 10px 16px;
    background: #fff;
    color: #11131c;
    font-size: 17px;
}

button.like-action .heart {
    color: var(--danger);
    font-size: 20px;
    line-height: 1;
}

button.like-action.liked {
    background: var(--danger);
    color: #fff;
}

button.like-action.liked .heart {
    color: #fff;
}

button.danger {
    background: #2a2f3f;
    color: var(--text);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.message {
    min-height: 24px;
    color: var(--muted);
}

body.modal-open {
    overflow: hidden;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(2, 3, 7, 0.72);
    backdrop-filter: blur(12px);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-window {
    width: min(1040px, 100%);
    max-height: min(88vh, 920px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
    background: rgba(12, 14, 21, 0.98);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.58);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.modal-head h1 {
    margin: 0;
}

.modal-close {
    display: inline-grid;
    width: 40px;
    height: 40px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 26px;
    line-height: 1;
}

.profile-id-block {
    margin-bottom: 18px;
}

.compact-stats,
.modal-grid {
    margin-top: 18px;
}

.modal-panel {
    box-shadow: none;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.stat-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.04);
}

.stat-box span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.stat-box strong {
    display: block;
    margin-top: 4px;
    font-size: 24px;
    line-height: 1.1;
}

form {
    display: grid;
    gap: 12px;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
}

input,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #0d0f16;
    color: var(--text);
    font: inherit;
}

.track-list {
    display: grid;
    gap: 10px;
    align-items: start;
}

.track-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.track-row strong {
    font-size: 15px;
    line-height: 1.25;
}

.track-row .muted {
    font-size: 14px;
    line-height: 1.25;
}

.track-row audio {
    height: 38px;
    margin-top: 4px;
}

.table-wrap {
    overflow-x: auto;
    margin-bottom: 26px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.admin-login {
    max-width: 420px;
    margin: 12vh auto 0;
}

@media (max-width: 820px) {
    .hero,
    .grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}
