/* Audio Visualizer: a dark, retro hardware-style player. Colour themes
   are set with [data-theme] on <html>; the canvas reads --accent. */
:root {
    --bg: #0b0d10;
    --panel: #16191e;
    --panel-hi: #23272e;
    --edge: #000000;
    --text: #d8dde4;
    --muted: #8a929d;
    --accent: #a6ff4d;
    --on-accent: #0b0d10;
    --font-ui: Tahoma, Verdana, 'Segoe UI', sans-serif;
    --font-mono: Consolas, 'Lucida Console', 'Courier New', monospace;
}

[data-theme="cyan"]    { --accent: #4de1ff; }
[data-theme="magenta"] { --accent: #ff6ad5; }
[data-theme="amber"]   { --accent: #ffb347; }

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

html,
body {
    height: 100%;
}

body {
    margin: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    background: radial-gradient(ellipse at 50% 0%, #1c2128 0%, var(--bg) 60%);
    color: var(--text);
    font: 14px/1.5 var(--font-ui);
}

.player {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: min(900px, 100%);
    height: min(640px, calc(100vh - 32px));
    padding: 18px;
    background: linear-gradient(180deg, var(--panel-hi), var(--panel));
    border: 1px solid var(--edge);
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 20px 50px rgba(0, 0, 0, 0.6);
}

.player-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.title {
    margin: 0;
    font: bold 18px var(--font-mono);
    letter-spacing: 0.06em;
    color: var(--accent);
    text-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent);
}

.title .ext {
    color: var(--muted);
    text-shadow: none;
}

.themes {
    display: flex;
    gap: 8px;
}

.swatch {
    width: 18px;
    height: 18px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
}

.swatch[data-theme="lime"]    { background: #a6ff4d; }
.swatch[data-theme="cyan"]    { background: #4de1ff; }
.swatch[data-theme="magenta"] { background: #ff6ad5; }
.swatch[data-theme="amber"]   { background: #ffb347; }

.swatch[aria-pressed="true"] {
    border-color: var(--text);
}

.swatch:focus-visible,
.btn:focus-visible,
.file:focus-within,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.screen {
    position: relative;
    flex: 1;
    min-height: 180px;
    background: radial-gradient(ellipse at 50% 120%, #15191f 0%, #07090c 70%);
    border: 2px solid var(--edge);
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 4px 18px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.screen canvas {
    position: absolute;
    inset: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
}

.idle,
.drop-hint {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 16px;
    text-align: center;
    font: 13px var(--font-mono);
}

.idle {
    color: rgba(255, 255, 255, 0.55);
}

.idle[hidden] {
    display: none;
}

.drop-hint {
    color: var(--accent);
    font-size: 18px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px dashed var(--accent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.screen.dragging .drop-hint {
    opacity: 1;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.btn {
    position: relative;
    padding: 6px 14px;
    font: 13px var(--font-ui);
    color: var(--text);
    background: linear-gradient(180deg, #2c3139, #1d2127);
    border: 1px solid var(--edge);
    border-radius: 3px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.btn:hover {
    border-color: var(--accent);
}

.btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.btn.primary {
    color: var(--on-accent);
    background: var(--accent);
    font-weight: bold;
}

.file input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.mode {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    font-size: 13px;
    color: var(--muted);
}

.mode select {
    padding: 4px 6px;
    font: 13px var(--font-ui);
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--edge);
}

.status {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 10px;
    font: 12px var(--font-mono);
    color: var(--muted);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--edge);
}

.note {
    margin: -6px 0 0;
    font-size: 12px;
    color: var(--muted);
}

/* Fullscreen: just the screen, edge to edge */
.screen:fullscreen {
    border: 0;
    border-radius: 0;
}

@media (max-width: 560px) {
    .player {
        height: auto;
        min-height: calc(100vh - 32px);
    }

    .mode {
        margin-left: 0;
    }
}
