:root {
    color-scheme: dark light;
    --bg-base: #0b1116;
    --bg-sheen: #16242e;
    --bg-glow: #284044;
}
body {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    margin: 0;
    padding: 24px;
    line-height: 1.4;
    width: 100%;
    max-width: 1600px;
    height: 100dvh;
    margin-inline: auto;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    color: #eef3f2;
    background-color: var(--bg-base);
    isolation: isolate;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        radial-gradient(900px 420px at 15% -10%, rgba(78, 128, 98, 0.35), transparent 70%),
        radial-gradient(700px 380px at 85% 0%, rgba(82, 98, 145, 0.28), transparent 70%),
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.06)),
        linear-gradient(120deg, var(--bg-base), var(--bg-sheen));
    background-repeat: no-repeat;
}
header { margin-bottom: 16px; }
.page-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 6px;
}
.back-link {
    position: fixed;
    top: 16px;
    left: 16px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(127,127,127,0.35);
    background: rgba(10, 18, 22, 0.6);
    color: inherit;
    text-decoration: none;
    font-size: 1.1rem;
    z-index: 10;
}
.back-link svg {
    width: 18px;
    height: 18px;
}
.back-link:hover {
    border-color: rgba(216, 240, 255, 0.5);
}
.nav-button.scroll-top {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    line-height: 1;
    z-index: 10;
}
.nav-button.scroll-top[hidden] {
    display: none;
}
.page-title { margin: 0; }
.environment-badge {
    padding: 2px 8px;
    border: 1px solid rgba(255, 196, 92, 0.55);
    border-radius: 999px;
    color: #ffd890;
    background: rgba(112, 72, 12, 0.32);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.5;
    text-transform: uppercase;
}
.environment-badge[hidden] { display: none; }
.meta { opacity: 0.8; font-size: 0.95rem; }
.layout {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(340px, 1fr);
    gap: clamp(16px, 2vw, 28px);
}
.card {
    box-sizing: border-box;
    border: 1px solid rgba(127,127,127,0.35);
    border-radius: 12px;
    padding: 16px;
    background: rgba(7, 11, 13, 0.45);
    backdrop-filter: blur(6px);
}
.player-pane {
    position: sticky;
    top: 24px;
    align-self: start;
    min-width: 0;
}
.title { font-size: 1.2rem; margin: 0 0 8px 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.title-row {
    justify-content: center;
    text-align: center;
    line-height: 1.2;
}
#trackTitleInline {
    width: 100%;
    text-align: center;
}
.action-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}
.nav-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 12px;
    margin: 2px 0;
}
.nav-date {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    opacity: 0.95;
}
.nav-button.nav-action {
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-decoration: none;
}
.nav-button {
    border: 1px solid rgba(127,127,127,0.35);
    background: rgba(10, 18, 22, 0.6);
    color: inherit;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
}
.nav-button:hover {
    border-color: rgba(216, 240, 255, 0.5);
}
.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
a { color: #d8f0ff; }
.meta a { color: inherit; }
.iframe-wrap {
    margin-top: 12px;
    aspect-ratio: 16 / 9;
    width: 100%;
    background: rgba(127,127,127,0.15);
    border-radius: 12px;
    overflow: hidden;
}
iframe { width: 100%; height: 100%; border: 0; }
.notice { margin: 0 0 8px 0; }
.error { color: #b00020; }
.archives {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.archive-toolbar {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(127,127,127,0.25);
}
.archives h2 {
    margin: 0;
    font-size: 1.05rem;
}
.archive-search-row {
    display: flex;
    align-items: center;
    flex: 1 1 280px;
}
.archive-search-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}
.archive-search {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    border: 1px solid rgba(127,127,127,0.35);
    border-radius: 999px;
    padding: 7px 42px 7px 16px;
    background: rgba(10, 18, 22, 0.6);
    color: inherit;
    font: inherit;
}
.archive-search:focus {
    outline: none;
    border-color: rgba(216, 240, 255, 0.55);
}
.archive-search::-webkit-search-cancel-button {
    appearance: none;
}
.archive-search-clear {
    box-sizing: border-box;
    position: absolute;
    top: 50%;
    right: 3px;
    width: 28px;
    height: 28px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 1.25rem;
    opacity: 0.7;
}
.archive-search-clear:hover {
    opacity: 1;
}
.archive-results {
    display: inline-block;
    min-width: 12ch;
    font-weight: 400;
    white-space: nowrap;
}
.archive-list {
    min-height: 0;
    flex: 1 1 auto;
    list-style: none;
    padding: 0 8px 0 0;
    margin: 0;
    display: grid;
    align-content: start;
    gap: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(216, 240, 255, 0.28) transparent;
}
.archive-list::-webkit-scrollbar {
    width: 8px;
}
.archive-list::-webkit-scrollbar-track {
    background: transparent;
}
.archive-list::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(216, 240, 255, 0.28);
    background-clip: padding-box;
}
.archive-list::-webkit-scrollbar-thumb:hover {
    background-color: rgba(216, 240, 255, 0.45);
}
.archive-link {
    display: grid;
    gap: 2px;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(127,127,127,0.2);
    background: rgba(10, 18, 22, 0.4);
}
.archive-link:hover { border-color: rgba(216, 240, 255, 0.5); }
.archive-link.is-active {
    border-color: rgba(216, 240, 255, 0.8);
    background: rgba(22, 36, 46, 0.6);
}
.archive-date {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
    font-weight: 600;
    opacity: 0.85;
}
.archive-title {
    min-width: 0;
    overflow-wrap: anywhere;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

@media (pointer: coarse) {
    .card {
        backdrop-filter: none;
    }
}

@media (max-width: 600px) {
    .archive-search-row {
        flex-basis: 100%;
    }
}

@media (max-width: 900px) {
    body {
        height: auto;
        min-height: 100dvh;
        display: block;
    }
    .layout {
        display: block;
    }
    .player-pane {
        position: static;
    }
    .archives {
        margin-top: 16px;
        overflow: visible;
    }
    .archive-list {
        padding-right: 0;
        overflow: visible;
    }
}
