* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.3);
    --accent: #0ea5e9;
    --bg-darkest: #0f172a;
    --bg-dark: #1e293b;
    --bg-medium: #334155;
    --bg-light: #475569;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --discord: #5865F2;
    --border: rgba(148, 163, 184, 0.2);
    --glass: rgba(30, 41, 59, 0.8);
    --glass-border: rgba(148, 163, 184, 0.1);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-darkest);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

body.theme-light {
    --bg-darkest: #f8fafc;
    --bg-dark: #ffffff;
    --bg-medium: #e2e8f0;
    --bg-light: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border: rgba(15, 23, 42, 0.2);
    --glass: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(15, 23, 42, 0.1);
}

body.theme-blue {
    --bg-darkest: #0c1929;
    --bg-dark: #1e3a5f;
    --bg-medium: #2d5a8e;
    --bg-light: #3d7abd;
    --text-primary: #e0f2fe;
    --text-secondary: #7dd3fc;
    --border: rgba(125, 211, 252, 0.2);
    --glass: rgba(30, 58, 95, 0.8);
    --glass-border: rgba(125, 211, 252, 0.1);
}

/* Maintenance & Disabled Overlays */
.maintenance-overlay, .disabled-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.maintenance-content, .disabled-content {
    text-align: center;
    padding: 40px;
    background: var(--bg-dark);
    border-radius: 20px;
    border: 1px solid var(--border);
    max-width: 500px;
    width: 90%;
}

.maintenance-icon, .disabled-icon {
    width: 80px;
    height: 80px;
    color: var(--warning);
    margin-bottom: 20px;
}

.disabled-icon {
    color: var(--danger);
}

.maintenance-content h2, .disabled-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.maintenance-content p, .disabled-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.maintenance-reason, .disabled-reason {
    font-style: italic;
    color: var(--primary-light);
    margin-top: 20px;
    padding: 15px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 10px;
    border-left: 4px solid var(--primary);
}

/* Loading */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-darkest);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s ease, visibility 0.4s;
}
.loading-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-content { text-align: center; }
.loading-logo {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    margin-bottom: 20px;
    animation: logoFloat 3s ease-in-out infinite;
}
@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.loading-title {
    font-size: 2.5rem;
    color: var(--primary-light);
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: 2px;
}
.loading-bar {
    width: 240px;
    height: 3px;
    background: var(--bg-medium);
    border-radius: 2px;
    margin: 0 auto 15px;
    overflow: hidden;
}
.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: 2px;
    animation: loadingFill 1.5s ease-out forwards;
}
@keyframes loadingFill { to { width: 100%; } }
.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-darkest);
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s ease;
}
.header.scrolled { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); }
.header-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}
.logo { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.logo:hover .logo-img { transform: scale(1.1) rotate(5deg); }
.logo-text h1 {
    font-size: 1.4rem;
    color: var(--primary-light);
    letter-spacing: 1px;
    font-weight: 700;
}
.logo-subtitle {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    display: block;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    background: var(--bg-medium);
}
.icon-btn:hover { background: var(--primary); transform: translateY(-2px); }
.icon-btn svg { width: 20px; height: 20px; }

.header-right { display: flex; align-items: center; gap: 10px; }

/* Discord Login */
.discord-login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--discord);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.discord-login-btn:hover {
    background: #4752c4;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.4);
}
.discord-login-btn .discord-icon {
    width: 20px;
    height: 20px;
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: var(--bg-medium);
    border-radius: 25px;
    animation: fadeIn 0.3s ease;
}
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}
.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.settings-btn, .logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}
.settings-btn:hover {
    background: var(--primary);
    color: white;
    transform: rotate(90deg);
}
.logout-btn:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
}
.settings-btn svg, .logout-btn svg { width: 16px; height: 16px; }

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--success);
}
.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tabs */
.tabs-nav {
    display: flex;
    gap: 4px;
    background: var(--bg-dark);
    padding: 4px;
    border-radius: 10px;
}
.tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: inherit;
}
.tab-btn svg { width: 16px; height: 16px; }
.tab-btn:hover { color: var(--text-primary); background: rgba(59, 130, 246, 0.1); }
.tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 10px var(--primary-glow);
}

.main { padding: 30px 20px; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

.container {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 20px;
}

.channels-section, .categories-section {
    background: var(--glass);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--glass-border);
    height: fit-content;
}
.section-title {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}
.section-title.centered {
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    border-bottom: none;
}
.title-icon { width: 20px; height: 20px; color: var(--primary); }
.title-icon svg { width: 100%; height: 100%; }
.badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}
.channels-list { display: flex; flex-direction: column; gap: 8px; }
.channel-card {
    background: var(--bg-dark);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}
.channel-card:hover { background: var(--bg-medium); border-color: var(--primary); transform: translateX(4px); }
.channel-card.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--primary);
}
.channel-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}
.radio-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.radio-card-icon svg { width: 26px; height: 26px; color: white; }
.channel-info { flex: 1; min-width: 0; }
.channel-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.channel-status {
    font-size: 0.75rem;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}
.channel-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
}

.categories-list { display: flex; flex-direction: column; gap: 6px; }
.category-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-dark);
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: left;
    font-family: inherit;
}
.category-btn svg { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; }
.category-btn span:not(.badge) { flex: 1; }
.category-btn:hover { background: var(--bg-medium); border-color: var(--primary); }
.category-btn.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--primary);
}

.player-section {
    background: var(--glass);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid var(--glass-border);
}
.player-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
#video-player, #modal-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}
.player-loading {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.3s ease, visibility 0.3s;
}
.player-loading.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--bg-medium);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 15px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.player-loading p { color: var(--text-secondary); font-size: 0.9rem; }

.player-overlay, .modal-player-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: opacity 0.3s ease, visibility 0.3s;
}
.player-overlay.hidden, .modal-player-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.play-button-large {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.play-button-large:hover { transform: scale(1.1); }
.play-button-large svg { width: 36px; height: 36px; color: white; margin-left: 4px; }

/* Tap indicators */
.tap-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    opacity: 0;
    pointer-events: none;
    z-index: 7;
}
.tap-indicator svg { width: 28px; height: 28px; margin-bottom: 2px; }
.tap-indicator.left { left: 15%; }
.tap-indicator.right { right: 15%; }
.tap-indicator.show { animation: tapShow 0.5s ease; }
@keyframes tapShow {
    0% { opacity: 0; transform: translateY(-50%) scale(0.5); }
    30% { opacity: 1; transform: translateY(-50%) scale(1); }
    100% { opacity: 0; transform: translateY(-50%) scale(1); }
}

/* Stats overlay */
.stats-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 12px;
    border-radius: 6px;
    color: white;
    font-size: 0.7rem;
    font-family: 'Courier New', monospace;
    z-index: 8;
    display: none;
}
.stats-overlay.show { display: block; }
.stats-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 2px 0;
}
.stats-row span:first-child { color: var(--primary-light); }
.stats-row span:last-child { color: white; font-weight: 600; }

.player-controls, .modal-player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 50px 15px 15px;
    z-index: 6;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.player-controls.hidden, .modal-player-controls.hidden {
    opacity: 0;
    transform: translateY(15px);
    pointer-events: none;
}
.controls-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    z-index: -1;
}
.progress-container { margin-bottom: 12px; padding: 0 4px; }
.progress-bar {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    transition: height 0.2s ease;
}
.progress-bar:hover { height: 6px; }
.progress-buffer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    width: 0%;
}
.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    width: 0%;
}
.progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.2s ease;
    pointer-events: none;
}
.progress-bar:hover .progress-handle { transform: translate(-50%, -50%) scale(1); }
.progress-times {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    font-variant-numeric: tabular-nums;
}
#time-current { color: var(--danger); font-weight: 700; }
#time-current.dvr { color: rgba(255, 255, 255, 0.8); }

.controls-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}
.live-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: 6px;
    cursor: pointer;
    color: var(--danger);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    font-family: inherit;
}
.live-button:hover { background: rgba(239, 68, 68, 0.35); }
.live-button.at-live { background: var(--danger); color: white; }
.live-button .live-dot {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
}
.current-channel {
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quality-selector, .more-menu-wrapper { position: relative; }
.quality-menu, .more-menu, .speed-menu {
    position: absolute;
    bottom: 45px;
    right: 0;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 20;
    max-height: 300px;
    overflow-y: auto;
}
.quality-menu.show, .more-menu.show, .speed-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.quality-option, .speed-option, .more-option {
    padding: 8px 12px;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: background 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.more-option { gap: 10px; }
.more-option svg { width: 18px; height: 18px; color: var(--primary-light); flex-shrink: 0; }
.more-option span { flex: 1; }
.quality-option:hover, .speed-option:hover, .more-option:hover { background: var(--bg-medium); }
.quality-option.active, .speed-option.active { background: var(--primary); color: white; }
.quality-option .quality-label { font-weight: 600; }
.quality-option .quality-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    font-weight: 700;
}
.quality-option.active .quality-badge { background: rgba(255, 255, 255, 0.3); }

.toggle-switch {
    width: 32px;
    height: 18px;
    background: var(--bg-medium);
    border-radius: 9px;
    position: relative;
    transition: background 0.2s ease;
    flex-shrink: 0;
}
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    transition: left 0.2s ease;
}
.toggle-switch.active { background: var(--primary); }
.toggle-switch.active::after { left: 16px; }

.controls-bottom { display: flex; justify-content: space-between; align-items: center; }
.control-left, .control-right { display: flex; align-items: center; gap: 6px; }
.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}
.control-btn:hover { background: var(--primary); transform: scale(1.05); }
.control-btn-main {
    width: 42px;
    height: 42px;
    background: var(--primary);
}
.control-btn-main:hover { background: var(--primary-dark); }
.control-btn svg { width: 18px; height: 18px; }
.control-btn-main svg { width: 20px; height: 20px; }
.speed-btn { width: auto; padding: 0 10px; }
.speed-label { font-size: 0.75rem; font-weight: 700; color: white; }

.volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}
.volume-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: var(--primary);
    border-radius: 2px;
    pointer-events: none;
}
.volume-slider input[type="range"] {
    position: absolute;
    top: -8px;
    left: 0;
    width: 100%;
    height: 20px;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    z-index: 2;
}
.volume-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}
.volume-slider input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}
.volume-value {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 28px;
    text-align: center;
}

.radio-section {
    background: var(--glass);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--glass-border);
}
.radio-player-wrapper { margin-bottom: 20px; }
.radio-player {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(14, 165, 233, 0.1));
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--primary);
}
.radio-visualizer {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 4px;
    height: 60px;
    margin-bottom: 20px;
}
.visualizer-bar {
    flex: 1;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
    height: 15%;
    min-height: 6px;
    transition: height 0.1s ease;
    animation: visualizerIdle 1.2s ease-in-out infinite;
}
@keyframes visualizerIdle {
    0%, 100% { height: 15%; }
    50% { height: 40%; }
}
.visualizer-bar:nth-child(2n) { animation-delay: 0.1s; }
.visualizer-bar:nth-child(3n) { animation-delay: 0.2s; }
.visualizer-bar:nth-child(4n) { animation-delay: 0.3s; }
.visualizer-bar:nth-child(5n) { animation-delay: 0.4s; }
.radio-player.playing .visualizer-bar { animation: visualizerActive 0.5s ease-in-out infinite; }
@keyframes visualizerActive {
    0% { height: 20%; }
    25% { height: 80%; }
    50% { height: 40%; }
    75% { height: 90%; }
    100% { height: 30%; }
}
.radio-player.playing .visualizer-bar:nth-child(2) { animation-delay: 0.05s; }
.radio-player.playing .visualizer-bar:nth-child(3) { animation-delay: 0.1s; }
.radio-player.playing .visualizer-bar:nth-child(4) { animation-delay: 0.15s; }
.radio-player.playing .visualizer-bar:nth-child(5) { animation-delay: 0.2s; }
.radio-player.playing .visualizer-bar:nth-child(6) { animation-delay: 0.25s; }
.radio-player.playing .visualizer-bar:nth-child(7) { animation-delay: 0.3s; }
.radio-player.playing .visualizer-bar:nth-child(8) { animation-delay: 0.35s; }
.radio-player.playing .visualizer-bar:nth-child(9) { animation-delay: 0.4s; }
.radio-player.playing .visualizer-bar:nth-child(10) { animation-delay: 0.45s; }
.radio-player.playing .visualizer-bar:nth-child(11) { animation-delay: 0.5s; }
.radio-player.playing .visualizer-bar:nth-child(12) { animation-delay: 0.55s; }
.radio-player.playing .visualizer-bar:nth-child(13) { animation-delay: 0.6s; }
.radio-player.playing .visualizer-bar:nth-child(14) { animation-delay: 0.65s; }
.radio-player.playing .visualizer-bar:nth-child(15) { animation-delay: 0.7s; }

.radio-info { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.radio-icon-large {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.radio-icon-large svg { width: 30px; height: 30px; color: white; }
.radio-details { flex: 1; }
.radio-station-name { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.radio-station-category { font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; }
.radio-controls { display: flex; align-items: center; gap: 10px; }
.radio-control-btn {
    background: var(--primary);
    border: none;
    color: white;
    cursor: pointer;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.radio-control-btn:hover { background: var(--primary-dark); transform: scale(1.05); }
.radio-control-btn svg { width: 20px; height: 20px; }
.radio-volume { flex: 1; height: 5px; background: rgba(255, 255, 255, 0.15); border-radius: 3px; position: relative; cursor: pointer; }
.radio-volume-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: var(--primary);
    border-radius: 3px;
    pointer-events: none;
}
.radio-volume input[type="range"] {
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 25px;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    z-index: 2;
}
.radio-volume input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}
.radio-volume input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}
.radio-volume-value { font-size: 0.85rem; color: var(--text-secondary); min-width: 30px; text-align: center; font-weight: 600; }

.chat-section {
    background: var(--glass);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--glass-border);
    height: fit-content;
}
.chat-container { width: 100%; height: 500px; border-radius: 10px; overflow: hidden; background: #000; }
.chat-container iframe { width: 100%; height: 100%; border: none; }

.replays-container { max-width: 1400px; margin: 0 auto; padding: 20px; }
.replays-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}
.replay-card {
    background: var(--glass);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--glass-border);
}
.replay-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
}
.replay-banner { width: 100%; height: 200px; object-fit: contain; background: #000; display: block; }
.replay-info { padding: 15px; }
.replay-title { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.replay-desc { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.4; }

.video-modal, .iframe-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.video-modal.active, .iframe-modal.active { display: flex; }
.modal-content {
    background: var(--bg-dark);
    border-radius: 12px;
    padding: 15px;
    max-width: 900px;
    width: 100%;
    position: relative;
}
.modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: var(--danger);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 20;
}
.modal-close:hover { background: #dc2626; transform: rotate(90deg); }
.modal-player-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}
.modal-title { font-size: 1.3rem; color: var(--text-primary); text-align: center; }
.iframe-modal-content {
    background: var(--bg-dark);
    border-radius: 12px;
    padding: 15px;
    width: 100%;
    max-width: 1000px;
    height: 75vh;
    max-height: 650px;
    position: relative;
    display: flex;
    flex-direction: column;
}
.iframe-wrapper { flex: 1; background: #000; border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
#modal-iframe { width: 100%; height: 100%; border: none; background: #000; }

/* Settings Modal */
.settings-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.settings-modal.active { display: flex; }
.settings-content {
    background: var(--bg-dark);
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    position: relative;
    border: 1px solid var(--border);
    max-height: 90vh;
    overflow-y: auto;
}
.settings-content h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}
.settings-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--bg-medium);
    border-radius: 12px;
    margin-bottom: 25px;
}
.settings-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--primary);
}
.settings-user-details h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 5px;
}
.settings-user-details p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.settings-section {
    margin-bottom: 25px;
}
.settings-section h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}
.settings-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-medium);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}
.settings-input:focus {
    outline: none;
    border-color: var(--primary);
}
.theme-options {
    display: flex;
    gap: 10px;
}
.theme-btn {
    flex: 1;
    padding: 12px;
    background: var(--bg-medium);
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.theme-btn:hover {
    background: var(--bg-light);
}
.theme-btn.active {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.2);
}
.admin-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}
.admin-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-medium);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.admin-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateX(5px);
}
.admin-btn svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
.admin-input-section {
    margin-top: 15px;
}
.admin-input-section label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.save-settings-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-top: 10px;
}
.save-settings-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.add-link-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.add-link-modal.active { display: flex; }
.add-link-content {
    background: var(--bg-dark);
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    position: relative;
    border: 1px solid var(--border);
}
.add-link-header { text-align: center; margin-bottom: 25px; }
.add-link-icon {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}
.add-link-icon svg { width: 30px; height: 30px; color: white; }
.add-link-header h2 {
    font-size: 1.5rem;
    color: var(--primary-light);
    margin-bottom: 6px;
    font-weight: 700;
}
.add-link-subtitle { color: var(--text-secondary); font-size: 0.9rem; }
.add-link-form { display: flex; flex-direction: column; gap: 15px; }
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label { color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; }
.input-group input {
    background: var(--bg-medium);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s ease;
}
.input-group input:focus { border-color: var(--primary); }
.input-group input::placeholder { color: var(--text-secondary); opacity: 0.6; }
.supported-sites {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.supported-sites > span { color: var(--text-secondary); font-size: 0.8rem; margin-right: 4px; }
.site-badge {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-light);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.3);
}
.add-link-error { color: var(--danger); font-size: 0.85rem; min-height: 18px; text-align: center; }
.add-link-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}
.add-link-submit:hover { background: var(--primary-dark); }
.add-link-submit svg { width: 18px; height: 18px; }

.embed-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.embed-modal.active { display: flex; }
.embed-modal-content {
    background: var(--bg-dark);
    border-radius: 12px;
    padding: 15px;
    width: 100%;
    max-width: 1100px;
    height: 80vh;
    max-height: 700px;
    position: relative;
    display: flex;
    flex-direction: column;
}
.embed-wrapper { flex: 1; background: #000; border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
#embed-iframe { width: 100%; height: 100%; border: none; background: #000; }

.screenshot-toast {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--success);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    font-weight: 600;
}
.screenshot-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.screenshot-toast svg { width: 20px; height: 20px; }

.footer {
    text-align: center;
    padding: 25px 20px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 30px;
}

/* Responsive */
@media (max-width: 1200px) {
    .container { grid-template-columns: 1fr; }
    .channels-section, .categories-section, .chat-section { order: 2; }
    .player-section, .radio-section { order: 1; }
    .channels-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
    .header-content { flex-wrap: wrap; gap: 10px; }
    .tabs-nav { order: 3; width: 100%; justify-content: center; }
}
@media (max-width: 640px) {
    .logo-text h1 { font-size: 1.2rem; }
    .logo-subtitle { display: none; }
    .main { padding: 15px 10px; }
    .channel-card { padding: 8px; }
    .channel-icon { width: 44px; height: 44px; }
    .volume-slider, .volume-value, .radio-volume-value { display: none; }
    .loading-title { font-size: 2rem; }
    .header-content { padding: 0 10px; }
    .current-channel { font-size: 0.85rem; }
    .chat-container { height: 400px; }
    .radio-player { padding: 15px; }
    .radio-station-name { font-size: 1.1rem; }
    .radio-icon-large { width: 50px; height: 50px; }
    .radio-control-btn { width: 38px; height: 38px; }
    .icon-btn { width: 36px; height: 36px; }
    .icon-btn svg { width: 18px; height: 18px; }
    .discord-login-btn { padding: 6px 12px; font-size: 0.8rem; }
    .user-name { display: none; }
    .replays-grid { grid-template-columns: 1fr; }
    .replay-banner { height: 160px; }
    .iframe-modal-content { height: 85vh; max-height: none; }
    .modal-content { padding: 10px; }
    .modal-close { top: -45px; width: 36px; height: 36px; font-size: 1.4rem; }
    .add-link-content { padding: 20px; }
    .add-link-header h2 { font-size: 1.3rem; }
    .add-link-icon { width: 50px; height: 50px; }
    .add-link-icon svg { width: 26px; height: 26px; }
    .tab-btn { padding: 6px 12px; font-size: 0.8rem; }
    .tab-btn span { display: none; }
    .tab-btn svg { width: 18px; height: 18px; }
    .control-btn { width: 32px; height: 32px; }
    .control-btn svg { width: 16px; height: 16px; }
    .control-btn-main { width: 38px; height: 38px; }
    .status-badge span:last-child { display: none; }
    .status-badge { padding: 6px 10px; }
    .quality-menu, .more-menu, .speed-menu { min-width: 150px; right: -5px; }
    #stats-btn { display: none; }
    .settings-content { padding: 20px; }
    .settings-content h2 { font-size: 1.5rem; }
    .theme-options { flex-direction: column; }
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }