/* ── CUB SOFTWARE Radio Page ──────────────────────────────────────────────── */
:root {
    --radio-accent:   #a50f12;
    --radio-dim:      rgba(165, 15, 18, 0.14);
    --radio-surface:  #16181c;
    --radio-surface2: #1e2228;
    --radio-border:   rgba(255,255,255,0.07);
    --radio-muted:    #8b8fa8;
    --radio-danger:   #d10a10;
    --radio-radius:   12px;
}

/* ── Page shell ──────────────────────────────────────────────────────────── */
.radio-page { display: flex; flex-direction: column; min-height: calc(100vh - 64px); }

/* ── Hero banner ─────────────────────────────────────────────────────────── */
.radio-hero {
    text-align: center;
    padding: 3rem 1.5rem 2.5rem;
    background: linear-gradient(180deg, rgba(165, 15, 18,0.10) 0%, transparent 100%);
    border-bottom: 1px solid var(--radio-border);
}

.radio-hero-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    font-weight: 900;
    letter-spacing: 0.05em;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.5rem;
}

.radio-hero-sub { color: var(--radio-muted); font-size: 0.95rem; }

/* ── Live dot ────────────────────────────────────────────────────────────── */
.live-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--radio-muted);
    display: inline-block;
    flex-shrink: 0;
    transition: background 0.3s;
}
.live-dot.live {
    background: var(--radio-danger);
    box-shadow: 0 0 8px var(--radio-danger);
    animation: rd-pulse 1.5s ease-in-out infinite;
}
@keyframes rd-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.radio-layout {
    display: grid;
    /* minmax(0, 1fr), not bare 1fr — a bare fr track won't shrink below its
       content's intrinsic min-width (the volume slider, song title, etc.),
       which let the whole layout balloon past the viewport on narrow screens. */
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 1.25rem;
    width: 100%;
    max-width: 1080px;
    margin: 2rem auto;
    padding: 0 1.5rem 3rem;
    flex: 1;
    /* .radio-layout is itself a flex item of .radio-page — cross-axis
       stretch alone didn't reliably cap it to the viewport, so width:100%
       plus min-width:0 (for the same min-content floor one level up from
       the grid-track fix above) is the reliable combination. */
    min-width: 0;
    box-sizing: border-box;
}

/* Grid items carry their own implicit min-width:auto independent of the
   track's minmax(0, 1fr) — the track fix alone isn't enough, the items
   placed in it need the same override. */
.radio-main, .radio-side {
    min-width: 0;
}
@media (max-width: 800px) {
    .radio-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.radio-card {
    background: var(--radio-surface);
    border: 1px solid var(--radio-border);
    border-radius: var(--radio-radius);
    padding: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--radio-border);
}
.card-header h2 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--radio-muted);
    margin: 0;
}

/* ── Player card ─────────────────────────────────────────────────────────── */
.player-card { margin-bottom: 1.25rem; }

.now-playing-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    color: var(--radio-accent);
    margin-bottom: 0.85rem;
}

.np-title  { font-size: 1.4rem; font-weight: 700; color: #fff; line-height: 1.3; margin-bottom: 0.2rem; }
.np-artist { font-size: 0.95rem; color: var(--radio-muted); margin-bottom: 0.4rem; }
.np-meta   { font-size: 0.78rem; color: var(--radio-muted); }

.progress-bar-wrap {
    height: 4px;
    background: var(--radio-surface2);
    border-radius: 2px;
    overflow: hidden;
    margin: 1.25rem 0;
}
.progress-bar {
    height: 100%;
    background: var(--radio-accent);
    border-radius: 2px;
    transition: width 1s linear;
    width: 0%;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.play-btn {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--radio-accent);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s, background 0.15s;
}
.play-btn:hover  { background: #7a0b0e; transform: scale(1.07); }
.play-btn:active { transform: scale(0.95); }

.volume-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    color: var(--radio-muted);
}
.volume-wrap input[type=range] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--radio-surface2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.volume-wrap input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--radio-accent);
    cursor: pointer;
}

.stream-info {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--radio-border);
    font-size: 0.78rem;
}
.stream-link  { color: var(--radio-accent); text-decoration: none; }
.stream-link:hover { text-decoration: underline; }
.stream-hint  { color: var(--radio-muted); }

/* ── Queue card ──────────────────────────────────────────────────────────── */
.queue-count {
    font-size: 0.72rem;
    color: var(--radio-muted);
    background: var(--radio-surface2);
    padding: 2px 8px;
    border-radius: 99px;
}

.queue-add-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--radio-muted);
    background: var(--radio-dim);
    border: 1px solid rgba(165, 15, 18,0.25);
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}
.queue-add-hint strong { color: #dde; }
.queue-add-hint svg   { flex-shrink: 0; fill: var(--radio-accent); }
.discord-join-link { color: var(--radio-accent); text-decoration: none; font-weight: 600; margin-left: auto; white-space: nowrap; }
.discord-join-link:hover { text-decoration: underline; }

.queue-list { display: flex; flex-direction: column; gap: 0.35rem; max-height: 420px; overflow-y: auto; }

.queue-empty, .history-empty {
    text-align: center;
    color: var(--radio-muted);
    font-size: 0.85rem;
    padding: 1.5rem 0;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.7rem;
    background: var(--radio-surface2);
    border-radius: 8px;
    border: 1px solid var(--radio-border);
}
.queue-item.downloading { border-color: rgba(165, 15, 18,0.35); }

.queue-pos  { font-size: 0.72rem; color: var(--radio-muted); font-family: 'JetBrains Mono', monospace; min-width: 1.4rem; text-align: right; }
.queue-info { flex: 1; min-width: 0; }
.queue-title  { font-size: 0.88rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-artist { font-size: 0.72rem; color: var(--radio-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-dur { font-size: 0.72rem; color: var(--radio-muted); font-family: 'JetBrains Mono', monospace; flex-shrink: 0; }

.queue-remove {
    background: none; border: none;
    color: var(--radio-muted);
    cursor: pointer;
    font-size: 0.82rem;
    padding: 2px 5px;
    border-radius: 4px;
    transition: color 0.15s;
    flex-shrink: 0;
}
.queue-remove:hover { color: var(--radio-danger); }

/* ── History ─────────────────────────────────────────────────────────────── */
.history-card { margin-bottom: 1.25rem; }

.history-list { display: flex; flex-direction: column; }

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--radio-border);
}
.history-item:last-child { border-bottom: none; }
.history-info { flex: 1; min-width: 0; }
.history-title  { font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-artist { font-size: 0.72rem; color: var(--radio-muted); }
.history-time   { font-size: 0.68rem; color: var(--radio-muted); white-space: nowrap; flex-shrink: 0; }

.loading-small { color: var(--radio-muted); font-size: 0.85rem; padding: 1rem 0; text-align: center; }

/* ── DJ card ─────────────────────────────────────────────────────────────── */
.radio-side .radio-card { margin-bottom: 1.25rem; }
.radio-side .radio-card:last-child { margin-bottom: 0; }

.dj-badge {
    font-size: 0.62rem; font-weight: 800; letter-spacing: 0.12em;
    background: var(--radio-accent); color: #fff;
    padding: 2px 7px; border-radius: 99px;
}

.dj-controls { display: flex; gap: 0.65rem; flex-wrap: wrap; margin-bottom: 0.85rem; }

.dj-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border: none; border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.82rem; font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    background: var(--radio-accent); color: #fff;
}
.dj-btn:hover  { opacity: 0.85; }
.dj-btn:active { transform: scale(0.97); }
.dj-btn.skip-btn  { background: var(--radio-accent); }
.dj-btn.clear-btn { background: var(--radio-danger); }

.dj-logout {
    background: none; border: none;
    color: var(--radio-muted); font-family: 'Poppins', sans-serif;
    font-size: 0.78rem; cursor: pointer;
    padding: 0; text-decoration: underline;
}
.dj-logout:hover { color: #ccc; }

/* ── DJ Login ────────────────────────────────────────────────────────────── */
.dj-login-card details summary {
    cursor: pointer;
    font-size: 0.82rem; color: var(--radio-muted); font-weight: 500;
    list-style: none; user-select: none;
}
.dj-login-card details summary::-webkit-details-marker { display: none; }
.dj-login-card details summary::before { content: '▸ '; }
.dj-login-card details[open] summary::before { content: '▾ '; }

.dj-login-form { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

.dj-input {
    flex: 1;
    min-width: 0;
    background: var(--radio-surface2);
    border: 1px solid var(--radio-border);
    border-radius: 8px;
    color: #e4e6eb;
    font-family: 'Poppins', sans-serif;
    font-size: 0.82rem;
    padding: 0.45rem 0.75rem;
    outline: none;
}
.dj-input:focus { border-color: var(--radio-accent); }

.dj-login-error { font-size: 0.78rem; color: var(--radio-danger); margin-top: 0.5rem; }
