:root {
    --stage: #161b2e;
    --surface: #1f2640;
    --surface-raised: #283052;
    --line: #36406a;
    --ink: #eef1fa;
    --ink-muted: #9aa3c2;
    --pad-yellow: #f7c52b;
    --warn: #f0b04f;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

#app { height: 100%; }

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: var(--stage);
    color: var(--ink);
    font-family: system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

button, input, select { font: inherit; color: inherit; }

button, .file-button {
    padding: 4px 12px;
    background: var(--surface-raised);
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
}
button:hover, .file-button:hover { border-color: var(--ink-muted); }

.file-button:focus-within { outline: 2px solid var(--pad-yellow); outline-offset: 2px; }

:focus-visible { outline: 2px solid var(--pad-yellow); outline-offset: 2px; }

.viewer {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.bar .title { font-weight: 600; }
.bar .muted, .muted { color: var(--ink-muted); }

/* The file inputs are real but hidden; the labels are the buttons, so a click on one opens its picker. */
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.body {
    flex: 1;
    min-height: 0;
    display: flex;
}

.side {
    width: 340px;
    flex: none;
    overflow-y: auto;
    padding: 8px;
    background: var(--surface);
    border-right: 1px solid var(--line);
}

/* The chosen chart's notes: what it uses that the viewer doesn't show or hasn't proven against the
   game. Stuck to the panel's top (over its padding once scrolled), so they stay in sight while the
   list scrolls, and small, so they don't push the list far down. */
.chart-notes {
    position: sticky;
    top: -8px;
    z-index: 1;
    margin: 0 -8px 8px;
    padding: 6px 10px 6px 12px;
    background: var(--surface-raised);
    border-bottom: 1px solid var(--line);
    border-left: 3px solid var(--warn);
    font-size: 0.85rem;
    line-height: 1.3;
}
.chart-notes p { margin: 2px 0; }
.chart-notes .warning { color: var(--warn); }

.chart-list { list-style: none; margin: 0; padding: 0; }
.chart-list button {
    display: flex;
    gap: 8px;
    width: 100%;
    text-align: left;
    margin-bottom: 4px;
}
.chart-list button[aria-current=true] { border-color: var(--pad-yellow); }
.chart-list .meter { min-width: 2ch; font-weight: 600; text-align: right; }
.chart-list .desc { color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The chart's canvas fills the area; the transport sits under it. */
.canvas-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.field { flex: 1; min-height: 0; width: 100%; display: block; }

.transport {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--surface);
    border-top: 1px solid var(--line);
}
.transport .play { min-width: 6em; }
.transport .timeline { flex: 1; min-width: 120px; accent-color: var(--pad-yellow); }
.transport .clock { font-variant-numeric: tabular-nums; color: var(--ink-muted); white-space: nowrap; }
.transport .speed { display: flex; align-items: center; gap: 6px; }
.transport select, .transport .speed-value {
    padding: 3px 6px;
    background: var(--surface-raised);
    border: 1px solid var(--line);
    border-radius: 6px;
}
.transport .speed-value { width: 6em; }

.notice { margin: 8px 0; }
.notice.warning { color: var(--warn); }
.notice.error { color: #f0707a; }

#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    padding: 8px 16px;
    background: #5a1f27;
    z-index: 10;
}
#blazor-error-ui .dismiss { cursor: pointer; float: right; }
