/* The site stylesheet styles the page shell. Every rule here is scoped to the player. */
.player { max-width: 900px; margin: 40px auto 0; padding: 22px; border: 1px solid #2c3a4c; border-radius: 14px; background: #141c28; color: #e7edf4; font: 15px/1.4 Inter, system-ui, sans-serif; }
/* The site sets a minimum height on main. The player card fits its content. */
.site-shell main.player { min-height: 0; }
.player p { margin: 0; }
.player header, .player .options, .player .actions, .player li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.player header { justify-content: space-between; }
.player .badge { color: #70efae; font-size: 12px; font-weight: 700; letter-spacing: 2px; }
.player .local, .player small, .player .metadata, .player .actions span { color: #a6b5c8; font-size: 13px; }
.player h1 { font-size: clamp(20px, 4vw, 30px); letter-spacing: normal; line-height: 1.2; margin: 24px 0 5px; overflow-wrap: anywhere; }
.player .metadata { margin: 0 0 22px; }
.player button, .player select, .player .file-button, .player .mode-select { border: 1px solid #41516a; border-radius: 7px; padding: 9px 12px; background: #202e41; color: inherit; font: inherit; cursor: pointer; }
.player button:hover, .player .file-button:hover, .player .mode-select:hover { border-color: #70efae; }
.player button:focus-visible, .player input:focus-visible, .player select:focus-visible, .player .file-button:focus-within, .player .mode-select:focus-within { outline: 2px solid #70efae; outline-offset: 3px; }
.player button:disabled { opacity: .4; cursor: default; }
.player button.primary, .player button.active { background: #70efae; color: #0a2015; border-color: #70efae; }
.player .player-icon { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.player .transport { display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: "time time time" "views play settings"; align-items: center; gap: 12px 10px; }
.player .transport output { grid-area: time; justify-self: center; font-size: 18px; }
.player .transport-views, .player .transport-buttons, .player .transport-settings { display: inline-flex; align-items: center; gap: 10px; }
.player .transport-views { grid-area: views; justify-self: start; }
.player .transport-buttons { grid-area: play; justify-self: center; }
.player .transport-settings { grid-area: settings; justify-self: end; }
.player .mode-select { position: relative; flex: none; gap: 2px; }
.player .mode-select .player-icon:last-of-type { width: 12px; }
.player .mode-select select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.player .actions { flex-wrap: nowrap; overflow-x: auto; gap: 4px; margin-bottom: 12px; padding: 2px; }
.player .actions button, .player .actions .file-button { flex: none; padding: 8px; }
.player .actions .subtune { flex: none; margin-left: 8px; font-size: 13px; }
.player [hidden] { display: none !important; }
.player .queue-hint { color: #a6b5c8; font-size: 12px; margin: 0; }
.player li.dragging { opacity: .5; }
.player li.drop-before { box-shadow: inset 0 2px #60bcff; }
.player li.drop-after { box-shadow: inset 0 -2px #60bcff; }
.player li.selected { outline: 1px solid #41516a; outline-offset: -1px; }
.player li[draggable="true"], .player li[draggable="true"] .track { cursor: grab; user-select: none; }
.player button[aria-pressed="true"] { color: #70efae; border-color: #70efae; }
.player output { font-variant-numeric: tabular-nums; }
.player label { display: inline-flex; align-items: center; gap: 6px; }
.player input[type="range"] { width: 100px; accent-color: #70efae; }
.player input[type="number"] { width: 74px; padding: 7px; border: 1px solid #41516a; border-radius: 5px; background: #0d1119; color: inherit; }
.player .options { margin-top: 15px; font-size: 13px; }
.player .queue { border-top: 1px solid #2c3a4c; border-bottom: 1px solid #2c3a4c; margin-top: 20px; padding: 16px 0; }
.player .file-button { position: relative; overflow: hidden; }
.player .file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.player ol { padding: 0; margin: 14px 0 0; list-style: none; max-height: 300px; overflow-y: auto; }
.player li { flex-wrap: nowrap; gap: 5px; border-radius: 7px; margin: 4px 0; }
.player li.current { background: #263d34; }
.player li.failed { color: #ffaaa2; }
.player li button.track { display: flex; gap: 12px; flex: 1; text-align: left; min-width: 0; background: transparent; border-color: transparent; }
.player li button.remove-track { flex: none; padding: 8px; margin-right: 4px; color: #ffaaa2; background: transparent; border-color: transparent; }
.player li button.remove-track:hover { border-color: #ffaaa2; }
.player .track span:last-child { overflow-wrap: anywhere; white-space: normal; }
.player .number { color: #a6b5c8; min-width: 18px; }
.player .empty { text-align: center; color: #a6b5c8; padding: 28px 8px; }
.player .voices { margin-top: 15px; }
.player canvas { display: block; width: 100%; height: 180px; border: 1px solid #2c3a4c; border-radius: 7px; }
/* Multi-SID tunes: three more scope rows for each extra chip. */
.player canvas.chips-2 { height: 300px; }
.player canvas.chips-3 { height: 420px; }
.player .voice-control { display: inline-flex; align-items: center; gap: 10px; }
.player footer { margin-top: 18px; font-size: 13px; }
.player footer p { overflow-wrap: anywhere; margin: 8px 0; }
.player small { display: block; font-size: 11px; margin: 4px 0; }
#blazor-error-ui { display: none; background: #6b2020; padding: 12px; }
@media (max-width: 520px) {
    .player { margin-top: 20px; padding: 14px; }
    .player .transport { grid-template-columns: 1fr 1fr; grid-template-areas: "time time" "play play" "views settings"; gap: 10px 6px; }
    .player .transport-views, .player .transport-buttons, .player .transport-settings, .player .actions { gap: 6px; }
    .player button { padding: 8px; }
    .player .local { display: none; }
}
