* { margin: 0; padding: 0; box-sizing: border-box; }
button { touch-action: manipulation; }

:root {
    --bg: #1a1a2e;
    --surface: #16213e;
    --accent: #e94560;
    --accent-green: #4ecca3;
    --text: #eee;
    --text-dim: #888;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro', sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100dvh;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    padding: 16px;
    gap: 16px;
    max-width: 480px;
    margin: 0 auto;
}

header {
    text-align: center;
    font-size: 14px;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}
header button {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
}
header button:active { color: var(--text); }

#track-info { text-align: center; flex-shrink: 0; }
#artist { font-size: 14px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
#title { font-size: 22px; font-weight: 600; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#waveform-container {
    position: relative;
    background: var(--surface);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    touch-action: none;
}

#waveform { width: 100%; height: 80px; display: block; }

#playhead {
    position: absolute;
    top: 8px; bottom: 8px;
    width: 2px;
    background: var(--accent);
    left: 12px;
    pointer-events: none;
    transition: left 0.1s linear;
}

#time-display {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

#controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
}

#controls button {
    background: none; border: none; color: var(--text);
    font-size: 24px; cursor: pointer; padding: 12px;
    border-radius: 50%; transition: background 0.15s;
}
#controls button:active { background: rgba(255,255,255,0.1); }
#btn-play { width: 64px; height: 64px; background: var(--surface) !important; border-radius: 50%; font-size: 28px; }

#actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    margin-top: auto;
    padding-bottom: 16px;
}

.action-btn {
    width: 72px; height: 72px; border-radius: 50%;
    border: 2px solid; background: none; font-size: 32px;
    cursor: pointer; transition: transform 0.15s, background 0.15s;
}
.action-btn:active { transform: scale(0.9); }
.action-btn.skip { border-color: var(--accent); color: var(--accent); }
.action-btn.skip:active { background: rgba(233, 69, 96, 0.2); }
.action-btn.keep { border-color: var(--accent-green); color: var(--accent-green); }
.action-btn.keep:active { background: rgba(78, 204, 163, 0.2); }
.action-btn.prev {
    width: 56px; height: 56px; font-size: 24px;
    border-color: var(--text-dim); color: var(--text-dim);
}
.action-btn.prev:active { background: rgba(255,255,255,0.08); }
.action-btn.prev:disabled { opacity: 0.35; cursor: default; }
.action-btn.prev:disabled:active { transform: none; background: none; }

.hidden { display: none !important; }

#empty-state { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 18px; }
#error-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(233, 69, 96, 0.15);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text);
    flex-shrink: 0;
}
#error-banner #error-message {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#error-banner button {
    background: var(--surface);
    border: 1px solid var(--text-dim);
    color: var(--text);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
}
#error-banner #btn-dismiss {
    width: 28px;
    padding: 6px 0;
}
