:root{
    --bg: #1f1f1f;
    --bg-deep: #141414;
    --text: #f3efe6;
    --muted: #a59f94;
    --accent: #e0a040;
    --accent-dark: #b97d22;
    --wine: #7a1f2b;
    --track: #3a3a3a;
}

*{
    box-sizing: border-box;
}

html, body{
    height: 100%;
    margin: 0;
}

body{
    background: radial-gradient(circle at 50% 20%, #3a1a1f 0%, var(--bg) 55%, var(--bg-deep) 100%) fixed;
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

.player{
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding:
        calc(24px + env(safe-area-inset-top))
        calc(24px + env(safe-area-inset-right))
        calc(24px + env(safe-area-inset-bottom))
        calc(24px + env(safe-area-inset-left));
    text-align: center;
}

.logo{
    width: min(80vw, 46vh, 360px);
    height: auto;
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.5));
}

.now-playing{
    width: min(100%, 420px);
    /* Room for a two-line song plus one artist line, so the controls
       below stay put when the title changes. */
    height: calc(1.1rem * 1.3 * 2 + 0.95rem * 1.3 + 4px);
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    -webkit-user-select: text;
    user-select: text;
}

.now-playing[hidden]{
    display: none;
}

.np-song,
.np-artist{
    margin: 0;
    line-height: 1.3;
    overflow: hidden;
}

.np-song{
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.np-artist{
    font-size: 0.95rem;
    color: var(--muted);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.np-artist:empty{
    display: none;
}

.status{
    margin: 12px 0 4px;
    min-height: 1.4em;
    color: var(--accent);
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status.error{
    color: #ff7a7a;
}

.play{
    width: 96px;
    height: 96px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(160deg, var(--accent), var(--accent-dark));
    color: var(--bg-deep);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(224, 160, 64, 0.35);
    transition: transform 0.1s ease;
}

.play:active{
    transform: scale(0.94);
}

.play:focus-visible{
    outline: 3px solid var(--text);
    outline-offset: 4px;
}

.icon{
    width: 48px;
    height: 48px;
    fill: currentColor;
}

.icon-pause{
    display: none;
}

.play.playing .icon-play{
    display: none;
}

.play.playing .icon-pause{
    display: block;
}

.volume{
    width: min(100%, 340px);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

.volume[hidden]{
    display: none;
}

.volume-icon{
    width: 24px;
    height: 24px;
    flex: none;
    fill: var(--muted);
}

.volume input{
    flex: 1;
    height: 44px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.volume input::-webkit-slider-runnable-track{
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--accent) var(--fill, 80%), var(--track) var(--fill, 80%));
}

.volume input::-webkit-slider-thumb{
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    margin-top: -9px;
    border-radius: 50%;
    background: var(--text);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.volume input::-moz-range-track{
    height: 6px;
    border-radius: 3px;
    background: var(--track);
}

.volume input::-moz-range-progress{
    height: 6px;
    border-radius: 3px;
    background: var(--accent);
}

.volume input::-moz-range-thumb{
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: var(--text);
}

.volume-note{
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}
