/* Mainnet FM — Web Player */

:root {
    --bg: #0a0a0c;
    --bg-card: #111114;
    --bg-hover: #18181c;
    --border: #222228;
    --text: #e0e0e4;
    --text-dim: #888890;
    --text-faint: #555560;
    --accent: #4a9eff;
    --accent-dim: #2a6ecc;
    --live: #ff4444;
    --live-glow: rgba(255, 68, 68, 0.3);
    --green: #44cc66;
    --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html { font-size: 15px; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1.2rem;
}

/* Header */
header {
    padding: 2rem 0 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.brand h1 {
    font-family: var(--mono);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.brand .tagline {
    font-size: 0.8rem;
    color: var(--text-faint);
    font-style: italic;
}

/* Player Section */
.player {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.play-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.play-btn:hover {
    background: var(--accent);
    color: var(--bg);
}

.play-btn svg { width: 22px; height: 22px; fill: currentColor; }

.player-info { flex: 1; min-width: 0; }

.player-show {
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-segment {
    font-size: 0.85rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-host {
    font-size: 0.75rem;
    color: var(--text-faint);
    font-family: var(--mono);
    margin-top: 0.15rem;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--live);
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--live);
    border-radius: 4px;
    flex-shrink: 0;
}

.live-badge.active {
    box-shadow: 0 0 8px var(--live-glow);
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--live);
}

.live-badge.active .live-dot {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Volume */
.player-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.volume-icon {
    color: var(--text-dim);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
}

/* Archive player bar */
.archive-player {
    background: var(--bg-card);
    border: 1px solid var(--accent-dim);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: none;
}

.archive-player.active { display: block; }

.archive-player-top {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.archive-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.archive-play-btn:hover {
    background: var(--accent);
    color: var(--bg);
}

.archive-play-btn svg { width: 18px; height: 18px; fill: currentColor; }

.archive-info {
    flex: 1;
    min-width: 0;
}

.archive-title {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.archive-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.archive-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    line-height: 1;
}

.archive-close:hover { color: var(--text); }

.archive-seek {
    width: 100%;
    margin-top: 0.5rem;
}

.archive-seek input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    outline: none;
    cursor: pointer;
}

.archive-seek input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
}

.archive-seek input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
}

.archive-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-faint);
    font-family: var(--mono);
    margin-top: 0.2rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.2rem;
}

.tab {
    padding: 0.6rem 1.2rem;
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 0.8rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.tab:hover { color: var(--text); }

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Panels */
.panel { display: none; }
.panel.active { display: block; }

/* Schedule */
.schedule-list { list-style: none; }

.schedule-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 0.8rem;
    border-radius: 6px;
    transition: background 0.1s;
}

.schedule-item:hover { background: var(--bg-hover); }

.schedule-item.on-air {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.schedule-time {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    white-space: nowrap;
    min-width: 5.5rem;
}

.schedule-item.on-air .schedule-time { color: var(--accent); }

.schedule-show {
    font-weight: 600;
    font-size: 0.9rem;
}

.schedule-item.on-air .schedule-show { color: var(--accent); }

.schedule-host {
    font-size: 0.75rem;
    color: var(--text-faint);
}

.on-air-tag {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--live);
    border: 1px solid var(--live);
    border-radius: 3px;
    padding: 0.1rem 0.35rem;
    margin-left: auto;
    flex-shrink: 0;
}

/* Archive */
.archive-shows {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.archive-show-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.9rem 1rem;
    cursor: pointer;
    transition: all 0.15s;
}

.archive-show-card:hover {
    border-color: var(--accent-dim);
    background: var(--bg-hover);
}

.archive-show-card.selected {
    border-color: var(--accent);
}

.archive-show-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.archive-show-count {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: var(--mono);
}

.archive-back {
    background: none;
    border: none;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 0.8rem;
    display: none;
}

.archive-back:hover { text-decoration: underline; }

.segment-list { list-style: none; }

.segment-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
}

.segment-item:hover { background: var(--bg-hover); }

.segment-item.playing { background: var(--bg-card); border: 1px solid var(--accent-dim); }

.segment-play-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--text-faint);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-dim);
}

.segment-item:hover .segment-play-icon { border-color: var(--accent); color: var(--accent); }
.segment-item.playing .segment-play-icon { border-color: var(--accent); color: var(--accent); }

.segment-play-icon svg { width: 12px; height: 12px; fill: currentColor; }

.segment-details { flex: 1; min-width: 0; }

.segment-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.segment-date {
    font-size: 0.7rem;
    color: var(--text-faint);
    font-family: var(--mono);
}

.segment-size {
    font-size: 0.7rem;
    color: var(--text-faint);
    font-family: var(--mono);
    flex-shrink: 0;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-top: 2rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-faint);
}

/* Loading / empty states */
.loading, .empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 600px) {
    html { font-size: 14px; }
    header { padding: 1.2rem 0 0.8rem; }
    .player { padding: 1rem; }
    .play-btn { width: 44px; height: 44px; }
    .volume-slider { width: 70px; }
    .archive-shows { grid-template-columns: 1fr 1fr; }
    .schedule-time { min-width: 4.5rem; font-size: 0.75rem; }
    .tab { padding: 0.5rem 0.8rem; font-size: 0.75rem; }
}

@media (max-width: 400px) {
    .archive-shows { grid-template-columns: 1fr; }
}
