:root {
    --bg-void: #0b0c0d;
    --bg-hard: #1d2021;
    --bg-soft: #282828;
    --bg-elevated: #32302f;
    --bg-hover: #3c3836;
    --panel: rgba(29, 32, 33, 0.72);
    --fg: #ebdbb2;
    --fg-dim: #d4be98;
    --fg-muted: #a89984;
    --fg-faint: #7c6f64;
    --red: #ea6962;
    --orange: #e78a4e;
    --yellow: #d8a657;
    --green: #a9b665;
    --aqua: #89b482;
    --blue: #7daea3;
    --purple: #d3869b;
    --glow-aqua: 0 0 10px rgba(137, 180, 130, 0.55), 0 0 28px rgba(137, 180, 130, 0.22);
    --glow-orange: 0 0 10px rgba(231, 138, 78, 0.55), 0 0 28px rgba(231, 138, 78, 0.22);
    --glow-red: 0 0 10px rgba(234, 105, 98, 0.5), 0 0 26px rgba(234, 105, 98, 0.2);
    --glow-purple: 0 0 10px rgba(211, 134, 155, 0.45), 0 0 24px rgba(211, 134, 155, 0.18);
    --glow-blue: 0 0 10px rgba(125, 174, 163, 0.4), 0 0 22px rgba(125, 174, 163, 0.16);
    --radius-xl: 22px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --font-sans: "Outfit", "Segoe UI", system-ui, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--fg);
    font-family: var(--font-sans);
    background-color: var(--bg-void);
    color-scheme: dark;
    overflow-x: hidden;
}

.atmosphere {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(ellipse 90% 55% at 50% -8%, rgba(137, 180, 130, 0.22), transparent 58%),
        radial-gradient(ellipse 45% 40% at 92% 72%, rgba(231, 138, 78, 0.2), transparent 52%),
        radial-gradient(ellipse 42% 38% at 6% 78%, rgba(211, 134, 155, 0.18), transparent 50%),
        radial-gradient(ellipse 40% 30% at 50% 100%, rgba(125, 174, 163, 0.16), transparent 55%),
        linear-gradient(180deg, #171a18 0%, #101213 38%, #0b0c0d 100%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(64px);
    opacity: 0.95;
    animation: drift 18s ease-in-out infinite;
}

.orb-a {
    width: 48vw;
    height: 48vw;
    left: -10%;
    top: -14%;
    background: rgba(137, 180, 130, 0.42);
}

.orb-b {
    width: 40vw;
    height: 40vw;
    right: -12%;
    top: 16%;
    background: rgba(211, 134, 155, 0.34);
    animation-delay: -6s;
}

.orb-c {
    width: 52vw;
    height: 52vw;
    left: 26%;
    bottom: -22%;
    background: rgba(231, 138, 78, 0.28);
    animation-delay: -12s;
}

.horizon {
    position: absolute;
    left: -10%;
    right: -10%;
    bottom: 31%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--aqua) 25%, var(--yellow) 50%, var(--orange) 70%, var(--purple) 88%, transparent 100%);
    box-shadow:
        0 0 16px rgba(137, 180, 130, 0.7),
        0 0 40px rgba(231, 138, 78, 0.35);
    opacity: 0.7;
}

.grid {
    position: absolute;
    inset: 46% 0 0;
    background-image:
        linear-gradient(rgba(137, 180, 130, 0.28) 1px, transparent 1px),
        linear-gradient(90deg, rgba(137, 180, 130, 0.16) 1px, transparent 1px);
    background-size: 52px 52px;
    transform: perspective(460px) rotateX(62deg) scale(1.55);
    transform-origin: center top;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 82%);
}

.noise {
    position: absolute;
    inset: 0;
    opacity: 0.09;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(4%, 6%, 0) scale(1.08); }
}

#ineedtohold {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

#container {
    width: min(520px, 100%);
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px 20px 16px;
    background: var(--panel);
    border: 1px solid rgba(137, 180, 130, 0.22);
    border-radius: var(--radius-xl);
    box-shadow:
        0 0 0 1px rgba(251, 241, 199, 0.04) inset,
        0 0 28px rgba(137, 180, 130, 0.28),
        0 0 80px rgba(211, 134, 155, 0.1),
        0 24px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    contain: layout paint;
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: var(--aqua);
    box-shadow: var(--glow-aqua);
    transform: rotate(45deg);
    animation: pulse 2.8s ease-in-out infinite;
}

.brand-text h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg);
    text-shadow: 0 0 18px rgba(137, 180, 130, 0.35);
}

.tagline {
    margin: 2px 0 0;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fg-muted);
}

pre.date {
    margin: 0;
    padding: 6px 10px;
    height: auto;
    color: var(--fg-muted);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    border: 1px solid rgba(216, 166, 87, 0.25);
    border-radius: 999px;
    background: rgba(40, 40, 40, 0.55);
    box-shadow: 0 0 12px rgba(216, 166, 87, 0.08);
    white-space: nowrap;
}

@keyframes pulse {
    0%, 100% { box-shadow: var(--glow-aqua); opacity: 1; }
    50% { box-shadow: 0 0 18px rgba(137, 180, 130, 0.85); opacity: 0.75; }
}

.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.toggle-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-muted);
}

.toggle-input {
    -webkit-appearance: none;
    appearance: none;
    width: 36px;
    height: 18px;
    margin: 0;
    border: none;
    border-radius: 999px;
    background: var(--bg-hover);
    box-shadow: inset 0 0 0 1px rgba(137, 180, 130, 0.2);
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.toggle-input::before {
    content: "";
    display: block;
    width: 14px;
    height: 14px;
    margin: 2px 0 0 2px;
    border-radius: 50%;
    background: var(--fg);
    transition: transform 0.2s ease;
}

.toggle-input:checked {
    background: var(--aqua);
    box-shadow: var(--glow-aqua);
}

.toggle-input:focus-visible {
    box-shadow: var(--glow-aqua);
}

.toggle-input:checked::before {
    transform: translateX(18px);
}

.clickable {
    cursor: pointer;
}

.station-browser {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.all-stations {
    margin: 0 0 10px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--aqua);
    text-shadow: 0 0 12px rgba(137, 180, 130, 0.45);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.all-stations::after {
    content: "▴";
    font-size: 0.9rem;
    color: var(--yellow);
    text-shadow: 0 0 10px rgba(216, 166, 87, 0.5);
}

.all-stations[data-status="hidden"]::after {
    content: "▾";
}

#all-stations {
    max-height: 46vh;
    overflow: hidden;
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.45s ease;
}

#all-stations.hidden {
    grid-template-rows: 0fr;
}

.all-stations-inner {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: #504945 transparent;
}

.all-stations-inner::-webkit-scrollbar {
    width: 8px;
}

.all-stations-inner::-webkit-scrollbar-track {
    background: transparent;
}

.all-stations-inner::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(137, 180, 130, 0.25);
}

div.station-group {
    padding: 0;
}

span.station-group {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 10px 0 6px;
    padding: 9px 14px;
    border: 1px solid rgba(125, 174, 163, 0.28);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, rgba(50, 48, 47, 0.9), rgba(40, 40, 40, 0.8));
    color: var(--fg);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

span.station-group::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: var(--glow-blue);
}

span.station-group[data-status="visible"] {
    border-color: rgba(211, 134, 155, 0.45);
    box-shadow: var(--glow-purple);
}

span.station-group[data-status="visible"]::before {
    background: var(--purple);
    box-shadow: var(--glow-purple);
}

.station-group {
    overflow: hidden;
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.3s ease;
}

.station-group.hidden {
    grid-template-rows: 0fr;
}

.station-group-inner {
    min-height: 0;
    overflow: hidden;
    padding: 2px 0 8px;
}

span.station-group.clickable:hover {
    background: var(--bg-hover);
    border-color: rgba(211, 134, 155, 0.65);
    box-shadow: var(--glow-purple);
}

span.station-subgroup {
    display: block;
    width: 100%;
    margin: 10px 0 6px;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    font-style: normal;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg-muted);
    text-align: center;
}

button.station {
    display: block;
    width: 100%;
    margin: 6px 0;
    padding: 11px 16px;
    border: 1px solid rgba(137, 180, 130, 0.28);
    border-radius: var(--radius-sm);
    color: var(--fg);
    background: rgba(40, 40, 40, 0.85);
    font-family: var(--font-sans);
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

button.station:hover {
    transform: translateY(-1px);
    border-color: var(--aqua);
    background: rgba(137, 180, 130, 0.12);
    box-shadow: var(--glow-aqua);
}

.station.active {
    color: #1d2021;
    background: var(--orange);
    border-color: var(--orange);
    font-weight: 700;
    box-shadow: var(--glow-orange);
}

form.stop-form {
    margin: 12px 0 0;
}

button.stop {
    width: 100%;
    margin: 0;
    color: var(--red);
    background: rgba(234, 105, 98, 0.08);
    border-color: rgba(234, 105, 98, 0.45);
}

button.stop:hover {
    color: #1d2021;
    background: var(--red);
    border-color: var(--red);
    box-shadow: var(--glow-red);
}

button.stop:after {
    display: none;
}

pre {
    width: 100%;
    display: block;
    margin: 0 auto;
    text-align: center;
    font-family: var(--font-mono);
    color: var(--fg-dim);
}

#container > pre:empty {
    display: none;
}

.status-line,
#station-info {
    margin-top: 4px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: rgba(40, 40, 40, 0.65);
    border: 1px solid rgba(216, 166, 87, 0.2);
    color: var(--yellow);
    text-shadow: 0 0 10px rgba(216, 166, 87, 0.28);
    font-size: 0.82rem;
}

#nowplaying {
    overflow: hidden;
    text-transform: capitalize;
    color: var(--purple);
    text-shadow: 0 0 12px rgba(211, 134, 155, 0.35);
    font-size: 0.8rem;
}

.player-dock {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(137, 180, 130, 0.18);
}

.player-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.player-dock.is-idle #audio-control {
    display: none;
}

body.waveform-off #osc,
.player-dock.is-idle #osc {
    display: none;
}

#audio-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    margin: 0;
}

.audio-control {
    height: 28px;
    width: 28px;
    display: inline-block;
    margin: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 0 6px rgba(137, 180, 130, 0.55));
    transition: transform 0.15s ease, filter 0.15s ease;
}

.audio-control:hover {
    transform: scale(1.12);
    filter: drop-shadow(0 0 10px rgba(137, 180, 130, 0.9));
}

#play {
    background-image: url(../images/play.svg);
}

#pause {
    background-image: url(../images/pause.svg);
}

#mute {
    background-image: url(../images/muted.svg);
}

#unmute {
    background-image: url(../images/unmuted.svg);
}

#volume-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    width: min(180px, 42%);
    margin: 0;
    border: none;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--aqua), var(--blue));
    box-shadow: var(--glow-aqua);
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--fg);
    box-shadow: 0 0 10px rgba(235, 219, 178, 0.55);
    cursor: pointer;
}

#volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: none;
    border-radius: 50%;
    background: var(--fg);
    box-shadow: 0 0 10px rgba(235, 219, 178, 0.55);
    cursor: pointer;
}

img {
    display: block;
    margin-top: 12px;
    margin-left: auto;
    margin-right: auto;
    width: 25%;
}

#osc {
    display: block;
    width: 100%;
    height: 78px;
    margin: 0;
    border: 1px solid rgba(137, 180, 130, 0.28);
    border-radius: var(--radius-md);
    background: rgba(12, 13, 14, 0.7);
    box-shadow: inset 0 0 24px rgba(137, 180, 130, 0.08), var(--glow-aqua);
}

pre.footer {
    padding: 4px 0 0;
    height: auto;
    margin: 0;
    color: var(--fg-faint);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
}

pre.footer:hover {
    color: var(--aqua);
    text-shadow: 0 0 10px rgba(137, 180, 130, 0.45);
}

@media (max-width: 600px) {
    #ineedtohold {
        align-items: stretch;
        padding: 12px;
    }

    #container {
        max-height: none;
        min-height: 0;
        border-radius: 16px;
    }

    #all-stations {
        max-height: 52vh;
    }

    pre.date {
        display: none;
    }
}
