/* ── Variables ──────────────────────────────────────────────────────── */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --bg-input: #1a1a26;
    --bg-elevated: #1e1e2a;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b8;
    --text-muted: #6a6a80;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-glow: rgba(139, 92, 246, 0.25);
    --accent-subtle: rgba(139, 92, 246, 0.08);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.2);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --info: #3b82f6;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --glass: rgba(255, 255, 255, 0.03);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--accent-glow);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 4px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--accent-hover);
    text-decoration: none;
}

::selection {
    background: var(--accent);
    color: #fff;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Navbar ─────────────────────────────────────────────────────────── */
.navbar {
    background: rgba(18, 18, 26, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #8b5cf6, #a78bfa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.nav-brand:hover {
    text-decoration: none;
    filter: brightness(1.2);
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-links a {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.nav-links a:hover {
    color: var(--text-primary);
    background: var(--glass);
}
.nav-user {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
    padding: 6px 12px;
    background: var(--accent-subtle);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(139, 92, 246, 0.15);
}

/* ── Container ──────────────────────────────────────────────────────── */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
    flex: 1;
}

/* ── Cards ──────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.card:hover {
    border-color: var(--border-hover);
}
.card h1 {
    margin-bottom: 24px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    gap: 8px;
    letter-spacing: 0.01em;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #fff;
    box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 2px 12px var(--danger-glow);
}
.btn-danger:hover {
    box-shadow: 0 4px 20px var(--danger-glow);
}

.btn-outline {
    background: var(--glass);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 6px;
}
.btn-lg {
    padding: 14px 32px;
    font-size: 15px;
    border-radius: var(--radius);
}
.btn-full {
    width: 100%;
}

.btn-accent {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    color: #fff;
    border: none;
    box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-accent:hover {
    box-shadow: 0 4px 24px var(--accent-glow);
    filter: brightness(1.1);
}

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}
.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all var(--transition);
    font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-elevated);
}
.form-group textarea {
    resize: vertical;
    min-height: 80px;
}
.form-group select {
    cursor: pointer;
}
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-check label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 400;
}
.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    border-radius: 4px;
}

/* ── Auth Pages ─────────────────────────────────────────────────────── */
.auth-container {
    max-width: 440px;
    margin: 60px auto;
}
.auth-container .card {
    padding: 36px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(139, 92, 246, 0.05);
}
.auth-container .card h1 {
    text-align: center;
    font-size: 26px;
    margin-bottom: 8px;
}
.auth-wide {
    max-width: 580px;
}
.auth-alt {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Flash Messages ─────────────────────────────────────────────────── */
.flash-container {
    margin-bottom: 24px;
}
.flash {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}
.flash-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}
.flash-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}
.flash-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}
.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.6;
    transition: opacity var(--transition);
}
.flash-close:hover {
    opacity: 1;
}

/* ── Grid Utilities ─────────────────────────────────────────────────── */
.grid {
    display: grid;
    gap: 20px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Hero ──────────────────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 80px 24px;
    background: radial-gradient(ellipse at 50% 0%, rgba(139, 92, 246, 0.15) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 20% 50%, rgba(168, 85, 247, 0.08) 0%, transparent 50%),
                var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 48px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}
.hero h1 {
    font-size: 52px;
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 0%, #c4b5fd 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    line-height: 1.1;
}
.hero p {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto 36px;
    position: relative;
    line-height: 1.7;
}
.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    position: relative;
}

/* ── Sections ──────────────────────────────────────────────────────── */
.section {
    margin-bottom: 48px;
}
.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.2px;
}
.live-dot {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px var(--danger-glow);
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* ── Channel Cards ─────────────────────────────────────────────────── */
.channel-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    display: block;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}
.channel-card:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: var(--shadow-md), 0 0 30px var(--accent-glow);
    text-decoration: none;
    background: var(--bg-card-hover);
}
.channel-card-thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--bg-input);
    overflow: hidden;
}
.channel-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.channel-card:hover .channel-card-thumb img {
    transform: scale(1.05);
}
.channel-card-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16132d 50%, #1e1a30 100%);
}
.live-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px var(--danger-glow);
}
.channel-card-info {
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: center;
}
.channel-card-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}
.avatar-default {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 2px 8px var(--accent-glow);
}
.channel-card-name {
    font-weight: 600;
    font-size: 14px;
}
.channel-card-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Empty State ───────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}
.empty-state h2 {
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 20px;
}
.empty-state p {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 15px;
}

/* ── Channel Page ──────────────────────────────────────────────────── */
.channel-banner {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #12121a 0%, #1a0e2e 50%, #0f1628 100%);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}
.channel-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.live-badge-lg {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 13px;
    padding: 5px 16px;
    border-radius: 6px;
}
.channel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 36px;
    gap: 20px;
    flex-wrap: wrap;
}
.channel-header-left {
    display: flex;
    gap: 18px;
    align-items: center;
}
.channel-avatar-lg img,
.avatar-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    font-size: 28px;
    border: 3px solid var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}
.channel-name {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 2px;
}
.channel-stats {
    font-size: 13px;
    color: var(--text-muted);
}
.channel-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 6px;
}
.channel-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ── Video Cards ───────────────────────────────────────────────────── */
.video-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    display: block;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}
.video-card:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: var(--shadow-md), 0 0 30px var(--accent-glow);
    text-decoration: none;
    background: var(--bg-card-hover);
}
.video-card-thumb {
    aspect-ratio: 16/9;
    background: var(--bg-input);
    overflow: hidden;
    position: relative;
}
.video-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.video-card:hover .video-card-thumb img {
    transform: scale(1.05);
}
.video-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: linear-gradient(135deg, #1a1a2e, #16132d);
}
.video-card-placeholder.small {
    min-height: 60px;
}
.private-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.75);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}
.video-card-info {
    padding: 12px 14px;
}
.video-card-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-card-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Watch Page ────────────────────────────────────────────────────── */
.watch-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
}
.video-player {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: var(--shadow-lg);
}
.video-player video {
    width: 100%;
    height: 100%;
}
.watch-info {
    margin-top: 18px;
}
.watch-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 10px;
}
.watch-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    gap: 6px;
}
.watch-channel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.watch-channel-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}
.watch-channel-link:hover {
    text-decoration: none;
    color: var(--accent);
}
.watch-actions {
    display: flex;
    gap: 8px;
}
.watch-description {
    margin-top: 16px;
    padding: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ── Watch Sidebar ─────────────────────────────────────────────────── */
.watch-sidebar h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
}
.sidebar-video {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
    color: var(--text-primary);
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.sidebar-video:hover {
    text-decoration: none;
    background: var(--glass);
}
.sidebar-video:hover .video-card-title {
    color: var(--accent);
}
.sidebar-video-thumb {
    width: 160px;
    min-width: 160px;
    aspect-ratio: 16/9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-input);
}
.sidebar-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sidebar-video-info {
    flex: 1;
}
.text-muted {
    color: var(--text-muted);
    font-size: 13px;
}

/* ── Upload / Edit Forms ───────────────────────────────────────────── */
.current-upload {
    margin-bottom: 10px;
}
.preview-img {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.preview-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}
.preview-banner {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
}
input[type="file"] {
    font-size: 13px;
    color: var(--text-muted);
    padding: 8px 0;
}
input[type="file"]::file-selector-button {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 12px;
    transition: all var(--transition);
}
input[type="file"]::file-selector-button:hover {
    background: var(--accent-subtle);
    border-color: var(--accent);
}
.stream-key-box {
    display: flex;
    gap: 8px;
}
.stream-key-box input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.upload-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #a78bfa);
    width: 0%;
    transition: width 0.3s;
    border-radius: 3px;
}

/* ── Stream Studio ─────────────────────────────────────────────────── */
.stream-studio {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    height: calc(100vh - 120px);
}
.studio-main {
    display: flex;
    flex-direction: column;
}
.studio-preview {
    position: relative;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: var(--shadow-lg);
}
.studio-preview video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.preview-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 16px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}
.studio-status {
    position: absolute;
    top: 14px;
    left: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.06);
}
.viewer-badge {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 13px;
}
.studio-controls {
    padding: 18px 0;
}
.control-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.control-row .btn {
    display: flex;
    align-items: center;
    gap: 8px;
}
.studio-sidebar {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 120px);
    gap: 16px;
}
.studio-sidebar .card h3 {
    margin-bottom: 16px;
    font-size: 15px;
}
.stream-timer {
    text-align: center;
    margin-top: 14px;
    font-size: 28px;
    font-weight: 700;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

/* ── Stream Player (viewer) ────────────────────────────────────────── */
.stream-player {
    position: relative;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: var(--shadow-lg);
}
.stream-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.stream-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
}
.stream-offline, .stream-loading {
    text-align: center;
    color: var(--text-muted);
}
.stream-offline svg, .stream-loading svg {
    margin-bottom: 16px;
    opacity: 0.5;
}
.stream-status-bar {
    position: absolute;
    top: 14px;
    left: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 14px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Chat ──────────────────────────────────────────────────────────── */
.stream-chat-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.chat-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}
.chat-header h3 {
    font-size: 13px;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    min-height: 200px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.chat-msg {
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background var(--transition);
}
.chat-msg:hover {
    background: var(--glass);
}
.chat-user {
    font-weight: 700;
    color: var(--accent);
}
.chat-empty {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 30px;
}
.chat-input-wrap {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
}
.chat-input-wrap input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    font-family: inherit;
    transition: all var(--transition);
}
.chat-input-wrap input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}
.chat-login-prompt {
    padding: 14px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
}

/* ── Page Header ───────────────────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 14px;
}
.page-header h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* ── Badges ────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-alert { background: rgba(139, 92, 246, 0.15); color: var(--accent); border: 1px solid rgba(139, 92, 246, 0.2); }
.badge-goal { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-ticker { background: rgba(59, 130, 246, 0.15); color: var(--info); border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-custom { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid var(--border); }
.badge-active { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-inactive { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Overlay Cards ─────────────────────────────────────────────────── */
.overlay-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
}
.overlay-card-header {
    margin-bottom: 10px;
}
.overlay-card-header .badge {
    margin-right: 4px;
}
.overlay-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 14px;
}
.overlay-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── Donate Page ───────────────────────────────────────────────────── */
.donate-header {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 28px;
}
.donate-header h1 {
    font-size: 22px;
    margin-bottom: 2px;
}
.amount-input-wrap {
    position: relative;
}
.amount-prefix {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    font-weight: 800;
    color: var(--text-muted);
}
.amount-input-wrap input {
    width: 100%;
    padding: 14px 16px 14px 36px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 800;
    outline: none;
    transition: all var(--transition);
}
.amount-input-wrap input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.quick-amounts {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* ── Donation History ──────────────────────────────────────────────── */
.donations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.donation-item {
    padding: 18px;
}
.donation-info {
    display: flex;
    gap: 16px;
    align-items: center;
}
.donation-amount {
    font-size: 24px;
    font-weight: 800;
    color: var(--success);
    min-width: 90px;
    text-shadow: 0 0 15px var(--success-glow);
}
.donation-user {
    font-size: 14px;
}
.donation-message {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 28px;
}

/* ── Donation Alert (on stream) ────────────────────────────────────── */
.donation-alert-overlay {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 50;
    pointer-events: none;
    animation: alertSlide 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.donation-alert-box {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: #fff;
    padding: 22px 36px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 40px rgba(139, 92, 246, 0.5);
    border: 1px solid rgba(255,255,255,0.1);
}
.donation-alert-amount {
    font-size: 36px;
    font-weight: 800;
}
.donation-alert-user {
    font-size: 16px;
    font-weight: 600;
    margin-top: 4px;
    opacity: 0.9;
}
.donation-alert-msg {
    font-size: 14px;
    margin-top: 8px;
    opacity: 0.8;
}
@keyframes alertSlide {
    from { transform: translateY(-40px) scale(0.7); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ── Nav Notification ───────────────────────────────────────────────── */
.nav-notif {
    position: relative;
    display: flex;
    align-items: center;
    padding: 6px 10px;
}
.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 8px var(--danger-glow);
}

/* ── Settings Layout ───────────────────────────────────────────────── */
.settings-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
    min-height: 60vh;
}
.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.settings-nav-item {
    display: block;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
}
.settings-nav-item:hover {
    background: var(--glass);
    color: var(--text-primary);
}
.settings-nav-item.active {
    background: var(--accent-subtle);
    color: var(--accent);
    border: 1px solid rgba(139, 92, 246, 0.15);
    font-weight: 600;
}
.settings-content {
    min-width: 0;
}

/* ── Notifications ─────────────────────────────────────────────────── */
.notif-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.notif-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
}
.notif-unread {
    border-color: rgba(139, 92, 246, 0.2);
    background: rgba(139, 92, 246, 0.03);
}
.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.notif-donation {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}
.notif-follow {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent);
}
.notif-body {
    flex: 1;
}
.notif-body p {
    font-size: 14px;
    margin-bottom: 2px;
}
.notif-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Admin ─────────────────────────────────────────────────────────── */
.grid-5 { grid-template-columns: repeat(5, 1fr); }

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 4px;
}
.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.admin-settings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.admin-setting-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.admin-setting-key {
    flex: 1;
    min-width: 0;
}
.admin-setting-key code {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    display: block;
    margin-bottom: 4px;
}
.admin-desc-input {
    width: 100%;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 12px;
    transition: all var(--transition);
}
.admin-desc-input:focus {
    border-color: var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
}
.admin-setting-val {
    width: 200px;
    flex-shrink: 0;
}
.admin-setting-val input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}
.admin-setting-val input[type="text"]:focus {
    border-color: var(--accent);
}
.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}
.toggle-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.add-setting-form {
    display: flex;
    gap: 10px;
    align-items: center;
}
.add-setting-form input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}
.add-setting-form input:focus {
    border-color: var(--accent);
}

/* ── Invite Links ──────────────────────────────────────────────────── */
.invite-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.invite-item {
    padding: 16px;
}
.invite-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.invite-code {
    flex: 1;
    font-size: 13px;
    color: var(--accent);
    word-break: break-all;
    background: var(--bg-input);
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* ── Edit Channel Tabs ──────────────────────────────────────────────── */
.edit-channel-page { max-width: 900px; margin: 0 auto; }
.edit-channel-page > h1 { font-size: 28px; font-weight: 700; margin-bottom: 20px; }

.edit-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.edit-tabs::-webkit-scrollbar { display: none; }
.edit-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    padding: 10px 16px;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    font-family: inherit;
}
.edit-tab:hover { color: var(--text-primary); }
.edit-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.edit-tab-panel { display: none; }
.edit-tab-panel.active { display: block; }

/* Form helpers */
.form-row { display: flex; gap: 20px; }
.form-half { flex: 1; min-width: 0; }
.input-with-prefix { display: flex; align-items: center; }
.input-prefix {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    padding: 10px 12px;
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
}
.input-with-prefix input {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    flex: 1;
    min-width: 0;
}
.char-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    float: right;
}

/* Checkbox grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
}
.check-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: var(--radius-xs);
    transition: background var(--transition);
}
.check-label:hover { background: var(--accent-subtle); }
.check-label input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}

/* Color pickers */
.color-picker-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.color-picker-row input[type="color"] {
    width: 44px;
    height: 36px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
}
.color-hex-input {
    width: 100px !important;
    font-family: monospace;
    font-size: 13px;
}
.color-preview {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.palette-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.palette-item label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}

/* Preview helpers */
.preview-video {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

/* Schedule editor */
.schedule-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    background: var(--bg-input);
    opacity: 0.6;
    transition: opacity var(--transition);
}
.schedule-row.schedule-active { opacity: 1; background: var(--bg-elevated); }
.schedule-day-check { min-width: 120px; margin: 0; padding: 0; }
.schedule-day-name { font-weight: 600; font-size: 13px; }
.schedule-times {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}
.schedule-times input[type="time"] {
    width: 110px;
    padding: 6px 8px;
    font-size: 13px;
}
.schedule-title-input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px !important;
    font-size: 13px !important;
}

/* Emote management */
.emote-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}
.emote-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.emote-item img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}
.btn-icon-delete {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.btn-icon-delete:hover { opacity: 0.7; }
.emote-add-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.emote-add-form input[type="text"] { width: 160px; }
.emote-add-form input[type="file"] { flex: 1; min-width: 150px; }

/* Featured video selector */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}
.featured-item {
    cursor: pointer;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition);
    position: relative;
}
.featured-item input { display: none; }
.featured-item.featured-selected,
.featured-item:has(input:checked) {
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}
.featured-thumb {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bg-input);
}
.featured-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.featured-title {
    display: block;
    padding: 6px 8px;
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Channel View Enhancements ─────────────────────────────────────── */
.banner-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.offline-overlay-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}
.channel-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.channel-logo-badge {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
}
.channel-display-name {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 2px;
}
.channel-short-bio {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}
.channel-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.tag {
    background: var(--accent-subtle);
    color: var(--accent);
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(139, 92, 246, 0.15);
}
.category-badge {
    display: inline-block;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
}
.channel-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.lang-badge {
    display: inline-block;
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}
.channel-languages {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.channel-long-bio {
    font-size: 14px;
    line-height: 1.7;
}
.channel-long-bio h3 {
    margin-bottom: 12px;
    font-size: 16px;
}
.markdown-content {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Intro video */
.intro-video-wrap {
    max-width: 640px;
}
.intro-video-player {
    width: 100%;
    border-radius: var(--radius);
    background: var(--bg-card);
}

/* Pinned stream */
.pinned-stream-card { padding: 16px; }
.pinned-stream-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Schedule grid (view) */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}
.schedule-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
}
.schedule-card-day {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--accent);
}
.schedule-card-time {
    font-size: 13px;
    color: var(--text-secondary);
}
.schedule-card-title {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Emote showcase (view page) */
.emote-showcase {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.emote-showcase-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 70px;
}
.emote-showcase-item img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}
.emote-showcase-item span {
    font-size: 10px;
    color: var(--text-muted);
}

/* Featured badge on video card */
.featured-badge-overlay {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* About page */
.about-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.about-body {
    font-size: 14px;
    line-height: 1.8;
}

/* ── Stream Creation & Scheduling ──────────────────────────────────── */
.stream-create-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.stream-meta-pills {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

/* Slider */
.slider-wrap { margin-top: 4px; }
.slider-input {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 3px;
    outline: none;
}
.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
}
.slider-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
}
.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 0 2px;
}
.slider-value {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Goal rows */
.goal-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.goal-row select,
.goal-type-select {
    width: 150px;
    min-width: 120px;
}
.goal-row input[type="text"] { flex: 1; min-width: 120px; }
.goal-row input[type="number"] { width: 120px; }
.goal-charity-field { max-width: 180px; }

/* Sponsor rows */
.sponsor-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}
.sponsor-row input[type="text"] { width: 100%; }
.sponsor-row textarea {
    font-size: 13px;
    font-family: inherit;
}

/* Schedule list */
.schedule-list { display: flex; flex-direction: column; gap: 8px; }
.schedule-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition);
}
.schedule-list-item:hover { border-color: var(--border-hover); }
.schedule-list-past { opacity: 0.6; }
.schedule-list-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}
.schedule-list-info h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}
.schedule-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
}
.schedule-thumb {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.schedule-list-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ── Access Control ────────────────────────────────────────────────── */
.access-rule-list { display: flex; flex-direction: column; gap: 6px; }
.access-rule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: border-color var(--transition);
}
.access-rule-item:hover { border-color: var(--border-hover); }
.access-rule-inactive { opacity: 0.5; }
.access-rule-inherited { opacity: 0.7; border-style: dashed; }
.access-rule-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    font-size: 13px;
}
.access-rule-type-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.access-rule-allow {
    background: var(--success-glow);
    color: var(--success);
}
.access-rule-block {
    background: var(--danger-glow);
    color: var(--danger);
}
.access-rule-type {
    color: var(--text-muted);
    font-size: 11px;
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
}
.access-rule-value {
    word-break: break-all;
}
.access-rule-meta {
    display: flex;
    gap: 8px;
    width: 100%;
    font-size: 11px;
}
.access-rule-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 0.02em;
}

/* ── Mobile Nav (hamburger) ─────────────────────────────────────────── */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background var(--transition);
}
.nav-toggle:hover {
    background: var(--glass);
}
.nav-toggle svg {
    display: block;
}

/* ── Responsive ─────────────────────────────────────────────────────── */

/* Large tablets / small desktops */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
    .stream-studio { grid-template-columns: 1fr 300px; }
    .watch-layout { grid-template-columns: 1fr 300px; }
}

/* Tablets */
@media (max-width: 768px) {
    /* Nav collapse */
    .nav-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: rgba(18, 18, 26, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px 16px;
        gap: 4px;
        box-shadow: var(--shadow-lg);
        z-index: 999;
    }
    .nav-links.open { display: flex; }
    .nav-links a {
        padding: 12px 16px;
        border-radius: var(--radius-sm);
        font-size: 14px;
        width: 100%;
    }
    .nav-links a:hover { background: var(--accent-subtle); }
    .nav-user {
        order: -1;
        text-align: left;
        width: 100%;
        margin-bottom: 4px;
    }
    .nav-notif {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
    }

    /* Layout */
    .container { padding: 20px 14px; }
    .card { padding: 20px; }
    .grid-2, .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-5 { grid-template-columns: repeat(2, 1fr); }
    .grid { gap: 14px; }

    /* Watch */
    .watch-layout { grid-template-columns: 1fr; }
    .sidebar-video-thumb { width: 140px; min-width: 140px; }

    /* Stream studio */
    .stream-studio { grid-template-columns: 1fr; height: auto; }
    .studio-sidebar { max-height: none; }

    /* Hero */
    .hero { padding: 44px 20px; }
    .hero h1 { font-size: 32px; }
    .hero p { font-size: 15px; }
    .hero-actions { flex-direction: column; align-items: center; }
    .hero-actions .btn { width: 100%; max-width: 280px; }

    /* Channel */
    .channel-header { flex-direction: column; }
    .channel-banner { height: 160px; }
    .channel-avatar-lg img, .avatar-lg { width: 56px; height: 56px; font-size: 22px; }
    .channel-name { font-size: 20px; }

    /* Settings */
    .settings-layout { grid-template-columns: 1fr; }
    .settings-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 4px;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }
    .settings-nav-item { white-space: nowrap; font-size: 12px; padding: 8px 12px; }

    /* Admin */
    .admin-setting-row { flex-wrap: wrap; }
    .admin-setting-val { width: 100%; }
    .add-setting-form { flex-wrap: wrap; }
    .add-setting-form input { min-width: 0; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 22px; }

    /* Auth */
    .auth-container { margin: 30px auto; max-width: 100%; }
    .auth-container .card { padding: 24px; }

    /* Donations */
    .amount-input-wrap input { font-size: 22px; }
    .donation-info { flex-wrap: wrap; }
    .donation-amount { font-size: 20px; min-width: auto; }

    /* Page header */
    .page-header h1 { font-size: 20px; }

    /* Watch info */
    .watch-title { font-size: 18px; }

    /* Chat */
    .chat-messages { max-height: 300px; }

    /* Edit tabs */
    .edit-tabs { gap: 2px; }
    .edit-tab { font-size: 12px; padding: 8px 10px; }
    .form-row { flex-direction: column; gap: 12px; }
    .palette-grid { grid-template-columns: 1fr; }
    .schedule-row { flex-wrap: wrap; gap: 8px; }
    .schedule-day-check { min-width: 100%; }
    .schedule-times { width: 100%; }
    .schedule-title-input { width: 100%; }
    .emote-add-form { flex-direction: column; align-items: stretch; }
    .emote-add-form input[type="text"] { width: 100%; }
    .checkbox-grid { grid-template-columns: repeat(2, 1fr); }

    /* Stream creation */
    .stream-create-actions { flex-direction: column; }
    .goal-row { flex-direction: column; }
    .goal-row select, .goal-row input[type="number"] { width: 100%; }
    .schedule-list-item { flex-direction: column; align-items: flex-start; }
    .schedule-list-actions { width: 100%; }
    .schedule-list-actions .btn { flex: 1; }
    .schedule-thumb { width: 100%; height: auto; }
    .access-rule-item { flex-direction: column; align-items: flex-start; }
    .access-rule-actions { width: 100%; }
    .access-rule-actions .btn { flex: 1; }
}

/* Small phones */
@media (max-width: 480px) {
    .container { padding: 16px 12px; }
    .card { padding: 16px; border-radius: var(--radius-sm); }

    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
    .grid { gap: 12px; }

    .hero { padding: 36px 16px; margin-bottom: 28px; }
    .hero h1 { font-size: 24px; letter-spacing: -0.5px; }
    .hero p { font-size: 14px; margin-bottom: 24px; }

    .btn-lg { padding: 12px 24px; font-size: 14px; }

    .section-title { font-size: 16px; }
    .section { margin-bottom: 28px; }

    .channel-card-info { padding: 10px; }
    .channel-card-name { font-size: 13px; }
    .channel-banner { height: 120px; }
    .channel-avatar-lg img, .avatar-lg { width: 48px; height: 48px; font-size: 18px; }
    .channel-name { font-size: 18px; }
    .channel-header-actions { width: 100%; }
    .channel-header-actions .btn { flex: 1; }

    .video-player { border-radius: var(--radius-sm); }
    .stream-player { border-radius: var(--radius-sm); }
    .watch-title { font-size: 16px; }
    .watch-channel { flex-direction: column; gap: 10px; align-items: flex-start; }
    .watch-actions { width: 100%; }
    .watch-actions .btn { flex: 1; }

    .sidebar-video { flex-direction: column; }
    .sidebar-video-thumb { width: 100%; min-width: 0; }

    .studio-preview { aspect-ratio: 4/3; }
    .control-row .btn { flex: 1; min-width: 0; font-size: 12px; padding: 10px 8px; }
    .stream-timer { font-size: 22px; }

    .settings-nav { gap: 2px; }
    .settings-nav-item { font-size: 11px; padding: 8px 10px; }

    .stat-card { padding: 12px; }
    .stat-value { font-size: 18px; }
    .stat-label { font-size: 10px; }

    .donate-header { flex-direction: column; text-align: center; }
    .amount-input-wrap input { font-size: 20px; padding: 12px 12px 12px 30px; }
    .amount-prefix { font-size: 16px; }
    .quick-amounts { justify-content: center; }

    .invite-info { flex-direction: column; }
    .invite-code { font-size: 11px; }

    .featured-grid { grid-template-columns: repeat(2, 1fr); }
    .schedule-grid { grid-template-columns: repeat(2, 1fr); }
    .emote-showcase { gap: 8px; }
    .checkbox-grid { grid-template-columns: 1fr; }

    .donation-alert-box { padding: 16px 20px; }
    .donation-alert-amount { font-size: 24px; }
    .donation-alert-user { font-size: 14px; }

    .notif-item { flex-wrap: wrap; padding: 14px; }
    .notif-icon { width: 32px; height: 32px; }

    .overlay-card-actions { flex-direction: column; }
    .overlay-card-actions .btn { width: 100%; }

    .page-header { flex-direction: column; align-items: flex-start; }
    .page-header h1 { font-size: 18px; }

    .footer { padding: 16px; }
}

/* ── Invite Management ──────────────────────────────────────────── */

.invite-list { display: flex; flex-direction: column; gap: 16px; }

.invite-item {
    background: var(--bg-card, #1e1e2e);
    border: 1px solid var(--border, #2e2e3e);
    border-radius: 12px;
    padding: 16px;
}
.invite-item.invite-inactive { opacity: 0.6; }

.invite-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.invite-type-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.invite-type-link { background: #3b82f6; color: #fff; }
.invite-type-username { background: #8b5cf6; color: #fff; }
.invite-type-email { background: #06b6d4; color: #fff; }
.invite-type-phone { background: #f59e0b; color: #000; }

.invite-tier-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}
.invite-tier-general { background: #4b5563; color: #e5e7eb; }
.invite-tier-vip { background: linear-gradient(135deg, #f59e0b, #d97706); color: #000; }

.invite-code {
    font-family: monospace;
    background: rgba(255,255,255,0.06);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.invite-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    background: rgba(139,92,246,0.15);
    color: #a78bfa;
}
.invite-badge-revoked { background: rgba(239,68,68,0.15); color: #f87171; }
.invite-badge-expired { background: rgba(156,163,175,0.15); color: #9ca3af; }

.invite-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 10px;
}

.invite-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.invite-claims-details {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border, #2e2e3e);
}
.invite-claims-details summary {
    cursor: pointer;
    font-size: 13px;
    color: #a78bfa;
}
.invite-claims-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    font-size: 13px;
}
.invite-claims-list li {
    padding: 4px 0;
    color: #d1d5db;
}

/* Invite Claim Page */
.invite-claim-page {
    display: flex;
    justify-content: center;
    padding: 40px 16px;
}
.invite-claim-card {
    max-width: 480px;
    width: 100%;
    text-align: center;
}
.invite-claim-header { margin-bottom: 24px; }
.invite-claim-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 16px;
}
.invite-claim-channel {
    font-size: 20px;
    font-weight: 700;
    color: #e5e7eb;
}
.invite-claim-stream {
    font-size: 14px;
    color: #9ca3af;
    margin-top: 4px;
}
.invite-claim-info { margin-bottom: 24px; }
.invite-claim-btn { width: 100%; }
.invite-claim-status { margin-bottom: 20px; }
.invite-claim-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.invite-plus-one-section,
.invite-reinvite-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border, #2e2e3e);
}
.invite-plus-one-section h3,
.invite-reinvite-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

/* QR Code Page */
.invite-qr-page {
    display: flex;
    justify-content: center;
    padding: 40px 16px;
}
.invite-qr-card {
    max-width: 480px;
    width: 100%;
    text-align: center;
}
.invite-qr-container {
    display: flex;
    justify-content: center;
    margin: 24px 0;
}
.qr-table { border-collapse: collapse; }
.qr-table td { width: 12px; height: 12px; }
.qr-dark { background: #e5e7eb; }
.qr-light { background: #1e1e2e; }
.invite-qr-url {
    margin: 16px 0;
    word-break: break-all;
}
.invite-qr-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

@media print {
    .nav, .footer, .invite-qr-actions { display: none; }
    .invite-qr-card { border: none; box-shadow: none; }
    .qr-dark { background: #000 !important; }
    .qr-light { background: #fff !important; }
}

/* ── Lobby & Waiting Room ──────────────────────────────────────── */

.lobby-page {
    min-height: calc(100vh - 120px);
    background-size: cover;
    background-position: center;
    background-color: var(--bg, #0f0f1a);
    padding: 24px;
}

.lobby-host-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(30,30,46,0.92);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    border: 1px solid rgba(139,92,246,0.3);
    backdrop-filter: blur(12px);
}
.lobby-host-avatar img,
.lobby-host-avatar .avatar-default {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}
.lobby-host-info h2 { margin: 0 0 4px; font-size: 22px; }
.lobby-stream-title { font-size: 14px; color: #a78bfa; margin: 0; }
.lobby-host-msg { font-size: 13px; color: #d1d5db; margin-top: 8px; }

.lobby-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

.lobby-main { display: flex; flex-direction: column; gap: 20px; }

.lobby-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Countdown */
.lobby-countdown-wrap {
    text-align: center;
    background: rgba(30,30,46,0.92);
    border-radius: 16px;
    padding: 32px;
    backdrop-filter: blur(12px);
}
.lobby-countdown-wrap h3 { margin: 0 0 8px; font-size: 14px; color: #9ca3af; text-transform: uppercase; letter-spacing: 1px; }
.lobby-countdown {
    font-size: 56px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Video */
.lobby-video-wrap {
    border-radius: 12px;
    overflow: hidden;
    max-height: 400px;
}
.lobby-video { width: 100%; display: block; }

/* Late join banner */
.lobby-late-join {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    animation: lobby-pulse 1s infinite;
}
@keyframes lobby-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* First-time prompt */
.lobby-first-time {
    background: rgba(139,92,246,0.15);
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: 8px;
    padding: 16px;
}

/* Polls */
.lobby-polls-section { display: flex; flex-direction: column; gap: 16px; }
.lobby-poll-card {
    background: rgba(30,30,46,0.92);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(12px);
}
.lobby-poll-card h3 { margin: 0 0 12px; }
.lobby-poll-options { display: flex; flex-direction: column; gap: 8px; }
.lobby-poll-option-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #e5e7eb;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.lobby-poll-option-btn:hover { background: rgba(139,92,246,0.2); }
.poll-opt-count { font-weight: 700; color: #a78bfa; }

.lobby-poll-item {
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}
.lobby-poll-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.lobby-poll-options li { padding: 4px 0; color: #d1d5db; }

/* Q&A */
.lobby-qa-section {
    background: rgba(30,30,46,0.92);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(12px);
}
.lobby-qa-section h3 { margin: 0 0 12px; }
.lobby-qa-form { margin-bottom: 16px; }
.lobby-qa-list { display: flex; flex-direction: column; gap: 8px; }
.lobby-qa-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
}
.lobby-qa-question { flex: 1; font-size: 14px; }

/* Trivia */
.lobby-trivia-section {
    background: rgba(30,30,46,0.92);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(12px);
}
.lobby-trivia-section h3 { margin: 0 0 12px; color: #f59e0b; }

/* Leaderboard */
.lobby-leaderboard-section {
    background: rgba(30,30,46,0.92);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(12px);
}
.lobby-leaderboard-section h3 { margin: 0 0 12px; }
.lobby-lb-entry { padding: 4px 0; font-size: 14px; }

/* Mini-game */
.lobby-game-section {
    background: rgba(30,30,46,0.92);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(12px);
}
.lobby-game-section h3 { margin: 0 0 12px; }

/* Rooms */
.lobby-rooms-section {
    background: rgba(30,30,46,0.92);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(12px);
}
.lobby-rooms-section h3 { margin: 0 0 12px; }
.lobby-rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.lobby-room-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}
.lobby-room-card:hover { border-color: #8b5cf6; }
.lobby-room-card h4 { margin: 0 0 4px; font-size: 14px; }
.room-count { font-weight: 700; color: #a78bfa; }

/* Preferences */
.lobby-prefs-section {
    background: rgba(30,30,46,0.92);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(12px);
}
.lobby-prefs-section h3 { margin: 0 0 12px; }

/* Sidebar components */
.lobby-user-count {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    padding: 16px;
    background: rgba(30,30,46,0.92);
    border-radius: 12px;
    backdrop-filter: blur(12px);
}
.lobby-user-count span { color: #a78bfa; font-size: 28px; }

.lobby-raise-btn { width: 100%; }

.lobby-raised-hands {
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
    padding: 4px;
}

.lobby-who-here {
    background: rgba(30,30,46,0.92);
    border-radius: 12px;
    padding: 16px;
    max-height: 200px;
    overflow-y: auto;
    backdrop-filter: blur(12px);
}
.lobby-who-here h3 { margin: 0 0 8px; font-size: 14px; }
.lobby-user-list { display: flex; flex-direction: column; gap: 6px; }
.lobby-user-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.lobby-user-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }

.lobby-seating {
    background: rgba(30,30,46,0.92);
    border-radius: 12px;
    padding: 16px;
    backdrop-filter: blur(12px);
}
.lobby-seating h3 { margin: 0 0 8px; font-size: 14px; }
.lobby-seating-chart { display: flex; flex-direction: column; gap: 4px; }
.lobby-seat { font-size: 12px; padding: 4px 8px; background: rgba(255,255,255,0.04); border-radius: 4px; }

/* Lobby Chat */
.lobby-chat {
    background: rgba(30,30,46,0.92);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 200px;
    backdrop-filter: blur(12px);
}
.lobby-chat h3 { margin: 0 0 8px; font-size: 14px; }
.lobby-chat-messages {
    flex: 1;
    overflow-y: auto;
    max-height: 300px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .lobby-layout { grid-template-columns: 1fr; }
    .lobby-countdown { font-size: 36px; }
    .lobby-host-card { flex-direction: column; text-align: center; }
}

/* ── Going Live & Pre-flight ─────────────────────────────────── */

/* 3-2-1 countdown overlay */
.studio-countdown-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.8);
    z-index: 20;
}
.studio-countdown-overlay span {
    font-size: 120px;
    font-weight: 900;
    color: #fff;
    animation: countdown-pulse 1s ease-in-out infinite;
}
@keyframes countdown-pulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* PiP camera overlay */
.studio-pip {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 200px;
    height: 150px;
    border-radius: 8px;
    border: 2px solid rgba(139,92,246,0.5);
    object-fit: cover;
    z-index: 10;
    cursor: move;
}

/* Mode badge */
.studio-mode-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 15;
}
.studio-mode-badge span {
    background: rgba(245,158,11,0.9);
    color: #000;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Tech check bar */
.studio-tech-bar {
    display: flex;
    gap: 16px;
    padding: 10px 16px;
    background: rgba(30,30,46,0.9);
    border-radius: 8px;
    margin-top: 8px;
}
.tech-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.tech-indicator label {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    min-width: 50px;
}
.tech-meter {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}
.tech-meter-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s, background 0.3s;
    background: #6366f1;
}
.tech-meter-good { background: #10b981; }
.tech-meter-warn { background: #f59e0b; }
.tech-meter-bad { background: #ef4444; }
.tech-value {
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #e5e7eb;
}

/* Camera / lighting assists */
.studio-assists {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}
.assist-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 6px 12px;
    background: rgba(30,30,46,0.9);
    border-radius: 6px;
}
.assist-icon { font-size: 16px; }
.assist-text { color: #9ca3af; transition: color 0.3s; }

/* Studio mode buttons */
.studio-mode-buttons .btn.active {
    background: rgba(139,92,246,0.2);
    border-color: #8b5cf6;
    color: #a78bfa;
}

/* Stream key */
.stream-key-input {
    font-family: monospace;
    font-size: 12px;
    flex: 1;
    min-width: 0;
}

/* Pre-flight checklist */
.preflight-checklist { display: flex; flex-direction: column; gap: 8px; }
.preflight-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.preflight-item-text {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    padding: 6px 10px;
    color: #e5e7eb;
    font-size: 14px;
}
.preflight-item input[type="checkbox"]:checked + .preflight-item-text {
    text-decoration: line-through;
    opacity: 0.6;
}

/* Pre-flight progress bar */
.preflight-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.preflight-progress {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}
.preflight-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #10b981);
    border-radius: 3px;
    transition: width 0.3s;
}

/* Co-host ready signals */
.cohost-ready-list { display: flex; flex-direction: column; gap: 6px; }
.cohost-ready-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    font-size: 13px;
}
.cohost-status {
    font-size: 12px;
    color: #9ca3af;
}
.cohost-status.cohost-ready {
    color: #10b981;
    font-weight: 700;
}

/* Control row extras */
.control-row .btn.active {
    background: rgba(139,92,246,0.2);
    border-color: #8b5cf6;
}

@media (max-width: 768px) {
    .studio-tech-bar { flex-wrap: wrap; gap: 8px; }
    .studio-assists { flex-direction: column; }
    .studio-pip { width: 120px; height: 90px; }
}

/* ── Streaming Infrastructure ───────────────────────────────────── */

.streaming-settings { max-width: 900px; margin: 0 auto; }

.streaming-tabs {
    display: flex; gap: 4px; margin-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.06); padding-bottom: 0;
}
.streaming-tab {
    background: none; border: none; color: var(--text-secondary);
    padding: 10px 18px; cursor: pointer; font-size: 14px;
    border-bottom: 2px solid transparent; transition: all 0.2s;
}
.streaming-tab:hover { color: var(--text-primary); }
.streaming-tab.active {
    color: var(--accent); border-bottom-color: var(--accent);
}
.streaming-tab-content { display: none; }
.streaming-tab-content.active { display: block; }

.streaming-protocol-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px; margin-top: 12px;
}
.streaming-protocol-card {
    background: var(--bg-input); border: 2px solid rgba(255,255,255,0.06);
    border-radius: 10px; padding: 16px; text-align: center; cursor: pointer;
    transition: all 0.2s;
}
.streaming-protocol-card:hover {
    border-color: rgba(139,92,246,0.3); background: var(--bg-elevated);
}
.streaming-protocol-card.selected {
    border-color: var(--accent); background: var(--accent-subtle);
}
.streaming-protocol-card input[type="radio"] { display: none; }
.protocol-icon { font-size: 28px; margin-bottom: 8px; }
.protocol-name { font-size: 13px; color: var(--text-primary); font-weight: 500; }

.streaming-toggle {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; cursor: pointer; font-size: 14px;
    color: var(--text-secondary);
}
.streaming-toggle input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; }

.streaming-range-val {
    display: inline-block; min-width: 30px; text-align: center;
    background: var(--bg-input); border-radius: 4px; padding: 2px 8px;
    font-weight: 600; color: var(--accent); margin-left: 8px;
}

.streaming-abr-table {
    width: 100%; border-collapse: collapse; margin-top: 12px;
}
.streaming-abr-table th {
    text-align: left; padding: 8px; font-size: 12px;
    color: var(--text-muted); border-bottom: 1px solid rgba(255,255,255,0.06);
}
.streaming-abr-table td { padding: 6px 8px; }
.streaming-abr-table tr:hover { background: rgba(255,255,255,0.02); }
.abr-input {
    width: 100%; background: var(--bg-input); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px; padding: 6px 8px; color: var(--text-primary); font-size: 13px;
}

.streaming-caps-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px; margin-top: 12px;
}
.cap-item label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.cap-item input {
    width: 100%; background: var(--bg-input); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px; padding: 6px 8px; color: var(--text-primary); font-size: 13px;
}

.streaming-info-box {
    background: var(--bg-input); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px; padding: 14px;
}
.streaming-info-box h4 { margin: 0 0 8px; font-size: 14px; color: var(--text-primary); }
.streaming-info-box code {
    background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 3px;
    font-size: 12px; word-break: break-all;
}

.streaming-endpoint-list { display: flex; flex-direction: column; gap: 6px; }
.endpoint-item { font-size: 13px; color: var(--text-secondary); }

/* Protocol picker on watch page */
.protocol-picker { margin-left: auto; }
.protocol-picker select {
    background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.15);
    color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 12px;
}

/* Ingest hint in go-live */
.ingest-hint { margin-top: 6px; }

@media (max-width: 768px) {
    .streaming-tabs { overflow-x: auto; white-space: nowrap; }
    .streaming-protocol-grid { grid-template-columns: 1fr 1fr; }
    .streaming-caps-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Audio Pipeline ─────────────────────────────────────────────── */

.audio-settings { max-width: 900px; margin: 0 auto; }

.audio-knobs-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
    margin-top: 8px; padding: 12px; background: var(--bg-input);
    border-radius: 8px;
}
.audio-knob label {
    display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px;
}
.audio-knob input {
    width: 100%; background: var(--bg-primary); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px; padding: 6px; color: var(--text-primary); font-size: 13px;
    text-align: center;
}

.voice-preset-grid {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
}

.audio-control-preview {
    display: flex; flex-direction: column; gap: 2px; margin-top: 12px;
}
.audio-control-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 6px;
    background: var(--bg-input); font-size: 13px; color: var(--text-secondary);
}
.audio-control-icon { font-size: 18px; width: 24px; text-align: center; }
.audio-control-item .tag {
    margin-left: auto; font-size: 10px; padding: 2px 8px;
    background: var(--accent-subtle); color: var(--accent); border-radius: 4px;
}

/* Live audio controls on go-live page */
.audio-live-controls {
    background: var(--bg-input); border-radius: 8px;
    padding: 10px 12px; margin-top: 12px;
}
.audio-ctrl-row {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.audio-gain-ctrl {
    display: flex; align-items: center; gap: 6px; flex: 1; min-width: 140px;
}
.audio-gain-ctrl label { white-space: nowrap; }
.audio-slider {
    flex: 1; accent-color: var(--accent); height: 4px;
}
.audio-gain-val {
    font-size: 11px; color: var(--accent); min-width: 36px; text-align: right;
}
.audio-ctrl-btn { font-size: 11px !important; padding: 4px 10px !important; }
.audio-ctrl-btn.active {
    background: rgba(239,68,68,0.2) !important; border-color: var(--danger) !important;
    color: var(--danger) !important;
}

/* Soundboard */
.soundboard-panel {
    background: var(--bg-input); border-radius: 8px; padding: 10px 12px;
}
.soundboard-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.soundboard-btn {
    background: var(--bg-elevated); border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary); border-radius: 6px; padding: 8px 4px;
    font-size: 11px; cursor: pointer; transition: all 0.15s;
}
.soundboard-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.soundboard-btn.active {
    background: var(--accent-subtle); border-color: var(--accent); transform: scale(0.95);
}

/* DJ crossfader */
.dj-crossfader {
    background: var(--bg-input); border-radius: 8px; padding: 10px 12px;
}
.dj-row {
    display: flex; align-items: center; gap: 8px;
}
.dj-slider { flex: 1; }

/* Audio-only mode on watch page */
.btn-audio-only {
    background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.15);
    color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 14px;
    cursor: pointer; margin-left: 8px; transition: all 0.2s;
}
.btn-audio-only:hover { border-color: var(--accent); }
.btn-audio-only.active {
    background: var(--accent); border-color: var(--accent);
}

.audio-only-active {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
    display: flex; align-items: center; justify-content: center; min-height: 300px;
}
.audio-only-active::after {
    content: "Audio Only Mode"; color: var(--text-muted);
    font-size: 18px; position: absolute;
}

/* Live transcript bar */
.live-transcript-bar {
    background: rgba(0,0,0,0.85); padding: 8px 16px;
    border-radius: 6px; margin-top: -4px; margin-bottom: 8px;
}
.transcript-text {
    color: #fff; font-size: 14px; line-height: 1.4;
    max-height: 60px; overflow-y: auto;
}

@media (max-width: 768px) {
    .audio-knobs-row { grid-template-columns: 1fr 1fr; }
    .soundboard-grid { grid-template-columns: repeat(3, 1fr); }
    .audio-ctrl-row { flex-direction: column; align-items: stretch; }
}

/* ── Camera, Scenes & Layouts ───────────────────────────────────── */

.scenes-settings { max-width: 900px; margin: 0 auto; }

/* Layout grid */
.layout-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px; margin-top: 12px;
}
.layout-card {
    background: var(--bg-input); border: 2px solid rgba(255,255,255,0.06);
    border-radius: 10px; padding: 12px; text-align: center; cursor: pointer;
    transition: all 0.2s;
}
.layout-card:hover { border-color: rgba(139,92,246,0.3); }
.layout-card.selected { border-color: var(--accent); background: var(--accent-subtle); }
.layout-card input[type="radio"] { display: none; }
.layout-preview {
    width: 100%; aspect-ratio: 16/9; background: var(--bg-primary);
    border-radius: 6px; margin-bottom: 8px; position: relative; overflow: hidden;
}
.layout-preview-pip::after {
    content: ''; position: absolute; bottom: 6px; right: 6px;
    width: 30%; height: 30%; background: var(--accent-subtle); border-radius: 4px;
    border: 1px solid var(--accent);
}
.layout-preview-side_by_side { display: flex; gap: 2px; }
.layout-preview-side_by_side .layout-thumb { flex: 1; background: var(--bg-elevated); border-radius: 3px; }
.layout-preview-side_by_side::before {
    content: ''; flex: 1; background: var(--bg-card-hover); border-radius: 3px;
}
.layout-preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.layout-preview-grid::before, .layout-preview-grid::after,
.layout-preview-grid .layout-thumb { background: var(--bg-elevated); border-radius: 2px; }
.layout-preview-grid::before { content: ''; }
.layout-preview-grid::after { content: ''; }
.layout-label { font-size: 12px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.layout-desc { font-size: 10px; color: var(--text-muted); line-height: 1.3; }

/* Scene switcher on go-live page */
.scene-switcher-card { }
.scene-switcher {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.scene-btn {
    background: var(--bg-input); border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary); border-radius: 6px; padding: 6px 14px;
    font-size: 12px; cursor: pointer; transition: all 0.15s;
}
.scene-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.scene-btn.active {
    background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}
.scene-transition-select {
    background: var(--bg-input); border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-primary); border-radius: 4px; padding: 4px 8px; font-size: 12px;
}

/* Scoreboard live controls */
.scoreboard-live {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    font-size: 18px; font-weight: 700; color: var(--text-primary);
}
.scoreboard-setup {
    display: flex; align-items: center; gap: 16px; margin-top: 12px;
}
.sb-team { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.sb-team label { font-size: 12px; color: var(--text-muted); }
.sb-team input[type="text"] {
    background: var(--bg-input); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px; padding: 6px 8px; color: var(--text-primary); font-size: 13px;
}
.sb-score-input {
    width: 60px !important; text-align: center; font-size: 18px !important;
    font-weight: 700 !important;
}
.sb-vs {
    font-size: 14px; color: var(--text-muted); font-weight: 600;
    padding: 0 8px;
}

/* Lower-third preview */
.lt-preview {
    background: var(--bg-primary); border-radius: 8px; padding: 60px 20px 20px;
    margin-top: 12px; position: relative; aspect-ratio: 16/9; display: flex;
    align-items: flex-end;
}
.lt-preview-bar {
    background: linear-gradient(90deg, var(--accent), rgba(139,92,246,0.6));
    padding: 8px 16px; border-radius: 4px; width: 60%;
}
.lt-preview-name { color: #fff; font-weight: 700; font-size: 14px; }
.lt-preview-sub { color: rgba(255,255,255,0.7); font-size: 11px; }

/* Scene hotkey preview */
.scene-hotkey-preview {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.hotkey-item {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text-secondary);
}
.hotkey-item kbd {
    background: var(--bg-input); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px; padding: 2px 8px; font-size: 12px; font-weight: 700;
    color: var(--accent);
}

@media (max-width: 768px) {
    .layout-grid { grid-template-columns: repeat(2, 1fr); }
    .scoreboard-setup { flex-direction: column; }
    .scene-switcher { gap: 4px; }
}
