:root {
    --bg: #050706;
    --panel: #080c09;
    --text: #d7e0da;
    --muted: #68766d;
    --line: #1b2920;
    --green: #86ff92;
    --wash: rgba(134, 255, 146, 0.07);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: "Azeret Mono", "Courier New", monospace;
    font-size: 12px;
}

button { font: inherit; }

button { color: inherit; }

button:focus-visible {
    outline: 1px solid var(--green);
    outline-offset: 3px;
}

.page-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 20px 0 24px;
}

.archive-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 10px;
}

.player-panel,
.reel-panel {
    min-width: 0;
    border: 1px solid var(--line);
    background: var(--panel);
}

.screen-frame {
    position: relative;
    display: grid;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #020403;
    isolation: isolate;
}

.ascii-stage {
    display: grid;
    min-width: 0;
    place-items: center;
    overflow: hidden;
}

#ascii-canvas {
    display: block;
    width: 100%;
    height: 100%;
    filter: contrast(1.04) saturate(0.9);
}

.scanlines {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0.1;
    background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(0, 0, 0, 0.45) 4px);
}

.reel-panel {
    display: flex;
    flex-direction: column;
}

.reel-heading-row {
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 11px;
    border-bottom: 1px solid var(--line);
}

.reel-heading-row h1 {
    margin: 0;
    color: var(--muted);
    font-size: 9px;
    font-weight: 400;
}

.reel-list { flex: 1; }

.reel-item {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 0 11px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    color: var(--muted);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.reel-item::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 1px;
    background: transparent;
}

.reel-item:hover { background: rgba(255, 255, 255, 0.018); }

.reel-item.is-active {
    color: var(--green);
    background: var(--wash);
}

.reel-item.is-active::before { background: var(--green); }

.reel-title {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 9px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.is-active .reel-title { color: var(--green); }

@media (max-width: 800px) {
    .page-shell { width: min(100% - 24px, 720px); }

    .archive-layout { grid-template-columns: 1fr; }
}
