:root { color-scheme: dark; font-family: system-ui, sans-serif; --ink: rgb(0 0 0 / .3); }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #000; }
button, select, input { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid white; outline-offset: -3px; }
[hidden] { display: none !important; }
#disco-app { position: relative; width: 100%; height: 100%; height: 100dvh; isolation: isolate; background: #ff0000; }
.color-stage { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; }
.topbar { position: absolute; top: env(safe-area-inset-top, 0px); left: env(safe-area-inset-left, 0px); right: env(safe-area-inset-right, 0px); display: flex; align-items: center; justify-content: space-between; padding: 5px 8px; pointer-events: none; }
.topbar button, .topbar a { pointer-events: auto; }
.top-actions { display: flex; align-items: center; }
.icon-button, .tempo-button, .source-button, .track-name { display: inline-flex; justify-content: center; align-items: center; flex-shrink: 0; min-width: 44px; min-height: 48px; padding: 8px; border: 0; background: transparent; color: var(--ink); text-decoration: none; touch-action: manipulation; }
.icon-button { width: 48px; font-size: 28px; }
.source-button { font: 13px system-ui, sans-serif; gap: 6px; max-width: 45vw; }
.icon-button img { filter: brightness(0); opacity: .3; }
.bottom-ui { position: absolute; inset-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px); bottom: env(safe-area-inset-bottom, 0px); display: flex; flex-direction: column; align-items: flex-end; }
.controls-panel { display: flex; align-items: center; justify-content: flex-end; width: 100%; direction: ltr; }
#palette-button { width: 46px; margin-right: 2px; }
#torch-button { margin-right: 4px; }
#tempo { display: inline-flex; width: 56px; justify-content: center; color: var(--ink); font: 23px system-ui, sans-serif; }
.tempo-button { width: 48px; padding: 0; font: 24px system-ui, sans-serif; user-select: none; touch-action: none; }
.player-controls { display: flex; align-items: center; justify-content: flex-end; max-width: 100%; }
.player-controls .icon-button { font-size: 20px; }
.track-name { max-width: min(42vw, 280px); display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
[data-ui] { transition: opacity .4s; }
.ui-hidden [data-ui] { opacity: 0; pointer-events: none; }
.ui-hidden [data-ui] * { pointer-events: none; }
.start-panel { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(310px, calc(100% - 40px)); padding: 24px; text-align: center; color: #fff; background: #101014e8; border: 1px solid #ffffff30; border-radius: 18px; }
.start-panel h1 { margin: 0; font: 32px system-ui, sans-serif; letter-spacing: 5px; }
.start-panel p { margin: 12px 0 20px; color: #d2d2d8; font-size: 14px; }
.start-panel button { display: block; width: 100%; padding: 13px 8px; margin-top: 8px; border-radius: 9px; border: 1px solid #ffffff40; background: #ffffff0a; color: white; }
.start-panel button:hover { background: #ffffff20; }
.start-panel button:disabled { opacity: .5; cursor: wait; }
.toast { position: absolute; bottom: calc(env(safe-area-inset-bottom, 0px) + 104px); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); pointer-events: none; padding: 12px 18px; border-radius: 12px; color: white; background: #141418eb; font-size: 14px; text-align: center; opacity: 0; transition: opacity .2s; z-index: 5; }
.toast.visible { opacity: 1; }
dialog { width: min(430px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 20px; border: 1px solid #ffffff35; border-radius: 16px; background: #17171bed; color: white; overflow: auto; }
dialog::backdrop { background: transparent; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dialog-heading h2 { margin: 0; font-size: 19px; font-weight: 600; }
.close-button { width: 40px; height: 40px; border: 0; color: #ccc; background: transparent; font-size: 28px; }
.palettes { display: flex; gap: 14px; }
.swatch-grid { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.swatch { position: relative; height: clamp(26px, 5dvh, 46px); min-height: 26px; border-radius: 5px; border: 2px solid #ffffff1a; background: var(--swatch); }
.swatch[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 1px #fff; }
.swatch[aria-pressed="true"]::after { content: '✓'; position: absolute; right: 5px; top: 0; color: white; font-size: 19px; text-shadow: 0 1px 3px #000, 0 0 3px #000; }
.switch-row, .setting-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; min-height: 44px; font-size: 14px; }
.switch-row input { width: 20px; height: 20px; accent-color: #a9a7ff; flex-shrink: 0; }
.setting-row select { max-width: 55%; padding: 5px; color: white; background: #29292f; border: 1px solid #555; border-radius: 6px; }
.brightness-row input { width: 42%; accent-color: #aaa8ff; }
.dialog-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.done-button, .text-button { min-height: 42px; padding: 8px 18px; color: white; border: 1px solid #ffffff50; border-radius: 8px; background: #ffffff0a; }
.text-button { border-color: transparent; }
fieldset { border: 0; padding: 0 0 14px; margin: 0 0 10px; border-bottom: 1px solid #ffffff20; }
legend { color: #aaa; font-size: 12px; }
.settings-note { color: #aaa; font-size: 12px; line-height: 1.5; }
.settings-dialog .done-button { display: block; margin-inline-start: auto; }
@media (min-width: 700px) { .controls-panel { padding: 0 4px 4px; } }
@media (max-height: 500px) { dialog { padding: 12px 18px; } .dialog-heading { margin-bottom: 8px; } .swatch-grid { grid-template-columns: repeat(7, 1fr); gap: 6px; } .swatch { height: 28px; } .start-panel { padding: 15px 24px; } .start-panel button { padding: 8px; } .start-panel p { margin: 6px 0 10px; } }
@media (prefers-reduced-motion: reduce) { [data-ui], .toast { transition: none; } }
.dark-color .icon-button img { filter: brightness(0) invert(1); }
button:disabled { cursor: default; opacity: .45; }
@media (max-height: 500px) {
  .palette-dialog { width: min(760px, calc(100% - 24px)); padding: 8px 16px; }
  .palette-dialog .palettes { flex-direction: row; }
  .palette-dialog .switch-row, .palette-dialog .setting-row { min-height: 30px; }
  .palette-dialog .dialog-heading { margin-bottom: 4px; }
  .palette-dialog .dialog-footer { margin-top: 4px; }
}
body[data-light-mode="flash"], body[data-light-mode="flare"], body[data-light-mode="flash"] #disco-app, body[data-light-mode="flare"] #disco-app { background: #000; --ink: rgb(255 255 255 / .3); }
.range-label { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; font-size: 15px; }
.range-label output { white-space: nowrap; font-variant-numeric: tabular-nums; color: #ddd; }
.wide-range { width: 100%; min-height: 40px; margin: 4px 0; accent-color: #b8b6ff; }
.range-endpoints { display: flex; justify-content: space-between; color: #aaa; font-size: 12px; }
.fade-preview { height: 12px; position: relative; margin-top: 16px; border-radius: 4px; background: linear-gradient(to right, #fff, #0a0a0a); }
.fade-preview i { position: absolute; width: 2px; height: 24px; top: -6px; background: #ffcf70; }
#flash-background { width: 72px; height: 32px; padding: 0; border: 1px solid #777; border-radius: 4px; background: transparent; }
@media (max-height: 500px) { .effect-dialog .range-label { margin-top: 6px; } .effect-dialog .switch-row { min-height: 32px; } .effect-dialog .wide-range { min-height: 28px; } }
