/* ═══════════════════════════════════════════════
   SPDN — Segment Pool Delivery Network
   Design System & Styles
   ═══════════════════════════════════════════════ */

:root {
    /* Color palette */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-subtle: rgba(255, 255, 255, 0.08);

    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;

    --accent-indigo: #818cf8;
    --accent-violet: #a78bfa;
    --accent-purple: #c084fc;
    --accent-cyan: #22d3ee;
    --accent-green: #34d399;
    --accent-amber: #fbbf24;
    --accent-red: #f87171;
    --accent-primary: #818cf8;
    --accent-secondary: #a78bfa;

    --gradient-primary: linear-gradient(135deg, #818cf8, #c084fc);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Ambient Background ── */
.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.18;
    animation: orbFloat 20s ease-in-out infinite;
    will-change: transform;
    transition: transform 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-indigo);
    top: -200px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-purple);
    bottom: -200px;
    right: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: var(--accent-cyan);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    opacity: 0.1;
}

.orb-4 {
    width: 550px;
    height: 550px;
    background: var(--accent-violet);
    top: -100px;
    right: -150px;
    animation-delay: -3s;
    opacity: 0.14;
}

.orb-5 {
    width: 350px;
    height: 350px;
    background: var(--accent-indigo);
    top: 40%;
    right: 10%;
    animation-delay: -10s;
    opacity: 0.12;
}

.orb-6 {
    width: 450px;
    height: 450px;
    background: var(--accent-purple);
    bottom: 20%;
    left: 15%;
    animation-delay: -5s;
    opacity: 0.1;
}

.orb-7 {
    width: 300px;
    height: 300px;
    background: var(--accent-cyan);
    top: 20%;
    left: 60%;
    animation-delay: -17s;
    opacity: 0.08;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(40px, 30px) scale(1.02); }
}

/* ── App Container ── */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── App Footer ── */
.app-footer {
    background: rgba(10, 10, 15, 0.95);
    border-top: 1px solid var(--border);
    padding: 40px 24px 24px;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.footer-col.brand-col {
    max-width: 320px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.footer-logo img {
    height: 28px;
}

.footer-logo-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-muted {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 12px;
}

.footer-links {
    display: flex;
    gap: 60px;
    flex-wrap: wrap;
}

.footer-col h4 {
    color: var(--text-primary);
    font-size: 15px;
    margin-bottom: 16px;
    font-weight: 600;
}

.footer-col a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 12px;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--accent-violet);
}

.footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

/* ── Info Pages ── */
.info-section {
    padding: 60px 0;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.info-container h2 {
    font-size: 32px;
    margin-bottom: 32px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.info-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.info-block h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 12px;
    margin-top: 24px;
}

.info-block h3:first-child {
    margin-top: 0;
}

.info-block p, .info-block ul {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
    font-size: 15px;
}

.info-block ul {
    padding-left: 20px;
}

.info-block li {
    margin-bottom: 6px;
}

.info-block blockquote {
    border-left: 3px solid var(--accent-primary);
    margin: 12px 0 16px 0;
    padding: 12px 16px;
    background: rgba(129, 140, 248, 0.06);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.info-updated {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 20px !important;
}

/* ── Header ── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.header-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.nav-link:hover {
    color: var(--accent-primary);
    background: rgba(129, 140, 248, 0.08);
    border-color: rgba(129, 140, 248, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: contain;
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.logo-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 2px;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 13px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-amber);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.connected {
    background: var(--accent-green);
    animation: none;
}

.status-dot.error {
    background: var(--accent-red);
    animation: none;
}

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

/* ── Stream Input Section ── */
.stream-input-section {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 60vh;
    padding-top: 48px;
}

.input-card {
    width: 100%;
    max-width: 700px;
    padding: 48px;
    background: var(--gradient-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(20px);
    text-align: center;
}

.join-card {
    max-width: 440px;
}

.join-card .btn-create-room {
    width: auto;
    padding: 12px 40px;
}

/* Join input row */
.join-input-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    max-width: 320px;
    margin: 0 auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.join-input-row:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

.join-input-row .room-code-input {
    border: none;
    border-radius: 0;
    max-width: none;
    flex: 1;
    margin: 0;
}

.join-input-row .room-code-input:focus {
    border-color: transparent;
    box-shadow: none;
}

.btn-join {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-violet));
    border: none;
    border-left: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-join:hover {
    filter: brightness(1.15);
}

/* Room Code Input */
.room-code-input {
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
    display: block;
    padding: 14px 16px;
    font-size: 24px;
    font-weight: 700;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    letter-spacing: 8px;
    text-align: center;
    text-transform: uppercase;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.room-code-input::placeholder {
    color: var(--text-muted);
    opacity: 0.4;
    letter-spacing: 8px;
}

.room-code-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

/* Join Divider */
.join-divider {
    width: 60%;
    height: 1px;
    margin: 20px auto;
    background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}

/* Alt text */
.join-alt-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Browse Rooms Button */
.btn-browse-rooms {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-browse-rooms:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
    background: rgba(129, 140, 248, 0.08);
}

.input-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.input-desc {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 32px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.stream-input {
    flex: 1;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.stream-input:focus {
    border-color: var(--accent-indigo);
}

.stream-input::placeholder {
    color: var(--text-muted);
}

.btn-play {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-play:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 30px rgba(129, 140, 248, 0.3);
}

.btn-play:active {
    transform: translateY(0);
}

.test-streams {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.test-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.test-btn {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.test-btn:hover {
    border-color: var(--accent-indigo);
    color: var(--accent-indigo);
    background: rgba(129, 140, 248, 0.08);
}

.test-btn.selected {
    border-color: var(--accent-indigo);
    color: white;
    background: var(--gradient-primary);
    font-weight: 600;
}

/* Tab Bar */
.tab-bar {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.tab-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Join Hint */
.join-hint {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 12px;
}

/* Room Badge & Stats */
.room-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.1), rgba(192, 132, 252, 0.1));
    border-bottom: 1px solid rgba(129, 140, 248, 0.15);
}

.room-badge-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.room-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.5px;
}

.room-code {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 6px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.room-stats-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-stat svg {
    width: 16px;
    height: 16px;
    color: var(--accent-indigo);
}

.segment-activity-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.segment-activity-panel .panel-header {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.segment-activity-panel .panel-header svg {
    color: var(--accent-violet);
}

.segment-activity-panel .log-entries {
    height: 250px;
    overflow-y: auto;
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: auto;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.12);
    color: var(--text-primary);
}

/* Small loading spinner */
.loading-spinner-sm {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ── Player Section ── */
.player-section {
    padding-top: 32px;
    padding-bottom: 40px;
}

.player-grid {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.player-main-column {
    flex: 1;
    min-width: 0;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.chat-panel {
    flex-shrink: 0;
    width: 340px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: calc(100vh - 140px);
    max-height: 800px;
}

@media (max-width: 1200px) {
    .player-grid {
        flex-direction: column;
        align-items: stretch;
    }
    .player-main-column {
        display: contents;
    }
    .player-container {
        order: 1;
    }
    .chat-panel {
        order: 2;
        width: 100%;
        height: 500px;
    }
    .stats-panels-row {
        order: 3;
    }
}

@media (max-width: 768px) {
    .player-section {
        padding-top: 16px;
    }
    .player-grid {
        gap: 16px;
    }
    .player-main-column {
        gap: 16px;
    }
    .chat-panel {
        height: 500px; /* Don't be too tall on small screens */
    }
    .form-row-half,
    .form-row-third {
        grid-template-columns: 1fr;
    }
}

/* ── Video Player ── */
.player-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: #000;
}

.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 70vh;
    background: #000;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.overlay-content {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ── Init Overlay (P2P Connection Screen) ── */
.overlay-init {
    max-width: 360px;
    animation: initFadeIn 0.6s ease-out;
}

@keyframes initFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.mesh-loader {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 28px;
}

.mesh-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #818cf8;
    border-right-color: rgba(129, 140, 248, 0.3);
    animation: meshSpin 1.8s linear infinite;
}

.mesh-ring-2 {
    inset: 10px;
    border-top-color: #c084fc;
    border-right-color: rgba(192, 132, 252, 0.2);
    animation-duration: 2.4s;
    animation-direction: reverse;
}

.mesh-ring-3 {
    inset: 20px;
    border-top-color: #67e8f9;
    border-right-color: rgba(103, 232, 249, 0.2);
    animation-duration: 3.2s;
}

@keyframes meshSpin {
    to { transform: rotate(360deg); }
}

.mesh-center-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a5b4fc;
    animation: centerPulse 2s ease-in-out infinite;
}

@keyframes centerPulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.overlay-title {
    font-size: 18px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.overlay-desc {
    font-size: 13px;
    color: rgba(148, 163, 184, 0.8);
    margin-bottom: 28px;
}

.overlay-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
    margin: 0 auto 24px;
    width: fit-content;
}

.overlay-step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: rgba(148, 163, 184, 0.3);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-4px);
}

.overlay-step.active {
    color: #e2e8f0;
    transform: translateX(0);
}

.overlay-step.done {
    color: #34d399;
    transform: translateX(0);
}

.step-indicator {
    position: relative;
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

.step-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(100, 116, 139, 0.3);
    transition: all 0.5s ease;
}

.overlay-step.active .step-pulse {
    background: #818cf8;
    box-shadow: 0 0 12px rgba(129, 140, 248, 0.6), 0 0 24px rgba(129, 140, 248, 0.2);
    animation: stepGlow 1.5s ease-in-out infinite;
}

.overlay-step.done .step-pulse {
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
    animation: none;
}

@keyframes stepGlow {
    0%, 100% { transform: scale(1); box-shadow: 0 0 8px rgba(129, 140, 248, 0.4); }
    50% { transform: scale(1.3); box-shadow: 0 0 16px rgba(129, 140, 248, 0.7), 0 0 32px rgba(129, 140, 248, 0.2); }
}

.overlay-progress-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 20px;
}

.overlay-progress-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(129, 140, 248, 0.5);
    animation: dotBounce 1.4s ease-in-out infinite;
}

.overlay-progress-dots span:nth-child(2) { animation-delay: 0.2s; }
.overlay-progress-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
    40% { transform: scale(1.2); opacity: 1; }
}

.overlay-warn {
    font-size: 11px;
    color: rgba(250, 204, 21, 0.6);
    letter-spacing: 0.02em;
}

/* ── Speed Test Progress Bar ── */
.speed-test-bar {
    width: 100%;
    max-width: 280px;
    margin: 8px auto 4px;
}

.speed-test-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    backdrop-filter: blur(4px);
}

.speed-test-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    background: linear-gradient(90deg, #6366f1, #a78bfa, #22d3ee);
    background-size: 200% 100%;
    animation: speedFillShimmer 2s ease infinite;
    transition: width 0.3s ease;
}

@keyframes speedFillShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.speed-test-info {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.speed-test-info span:last-child {
    color: #a78bfa;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ── Buffer Overlay (during playback) ── */
.overlay-buffer {
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent-indigo);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* P2P Badge */
.p2p-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-mono);
    transition: all var(--transition-smooth);
}

.p2p-badge.active {
    color: var(--accent-green);
    border-color: rgba(52, 211, 153, 0.3);
    background: rgba(52, 211, 153, 0.1);
}

/* Player Controls */
.player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #0f111a;
    border-top: 1px solid var(--border);
}

.ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.ctrl-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

.volume-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 8px;
    border-left: 1px solid rgba(255,255,255,0.1);
}

.volume-slider-container {
    position: relative;
    width: 80px;
    height: 32px;
    display: flex;
    align-items: center;
}

.volume-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    height: 4px;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    transition: transform 0.1s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-indigo), var(--accent-violet));
    border-radius: 2px;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

.stream-codec-info {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.spacer {
    flex: 1;
}

/* ── Stats Panel Collapsibles ── */
.stats-panels-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

@media (max-width: 1200px) {
    .stats-panels-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.stats-collapse {
    flex: 1;
    min-width: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
}

.stats-collapse-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid transparent;
    transition: background 0.2s, border-color 0.2s;
}

.stats-collapse-summary::-webkit-details-marker {
    display: none;
}

.stats-collapse-summary:hover {
    background: rgba(255, 255, 255, 0.04);
}

.stats-collapse[open] .stats-collapse-summary {
    border-bottom-color: var(--border);
    background: rgba(255, 255, 255, 0.01);
}

.summary-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-title svg {
    color: var(--accent-violet);
}

.collapse-icon {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.stats-collapse[open] .collapse-icon {
    transform: rotate(180deg);
}

.collapse-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.log-content-box {
    padding: 0;
}

/* Stat Cards */
.stat-card {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.stat-highlight {
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.06), rgba(192, 132, 252, 0.06));
    border-color: rgba(129, 140, 248, 0.15);
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Gauge */
.gauge-container {
    text-align: center;
    padding: 4px 0;
}

.gauge {
    width: 120px;
    height: 70px;
}

.gauge-value {
    font-size: 28px;
    font-weight: 800;
    font-family: var(--font-mono);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: -10px;
}

.gauge-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

/* Segment Log */
.log-entries {
    max-height: 260px;
    min-height: 100px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;

    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.log-entries::-webkit-scrollbar {
    width: 4px;
}

.log-entries::-webkit-scrollbar-track {
    background: transparent;
}

.log-entries::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
}

.log-entry {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.log-time {
    color: var(--text-muted);
    margin-right: 6px;
}

.log-p2p {
    color: var(--accent-green);
    background: rgba(52, 211, 153, 0.06);
}

.log-origin {
    color: var(--accent-amber);
    background: rgba(251, 191, 36, 0.06);
}

.log-upload {
    color: var(--accent-cyan);
    background: rgba(34, 211, 238, 0.06);
}

.log-error {
    color: var(--accent-red);
    background: rgba(248, 113, 113, 0.06);
}

.log-info {
    color: var(--text-muted);
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
}

/* ── Selection ── */
::selection {
    background: rgba(129, 140, 248, 0.3);
    color: white;
}

/* ── RTMP Mode Toggle ── */
.mode-toggle {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 4px;
}

.mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.mode-btn.active {
    background: rgba(129, 140, 248, 0.15);
    color: var(--accent-indigo);
}

/* ── RTMP Panel ── */
.rtmp-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.6;
}

.btn-rtmp {
    width: 100%;
    justify-content: center;
    background: linear-gradient(135deg, #f97316, #ef4444);
}

.btn-rtmp:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.3);
}

.rtmp-detail {
    margin-bottom: 14px;
}

.rtmp-detail label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.rtmp-value-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rtmp-value {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    word-break: break-all;
    user-select: all;
}

.rtmp-key {
    color: var(--accent-amber);
}

.rtmp-room {
    color: var(--accent-green);
    font-size: 16px;
    letter-spacing: 2px;
    font-weight: 600;
}

.copy-sm {
    padding: 8px 12px;
    background: rgba(129, 140, 248, 0.15);
    border: 1px solid rgba(129, 140, 248, 0.2);
    border-radius: 8px;
    color: var(--accent-indigo);
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.copy-sm:hover {
    background: rgba(129, 140, 248, 0.25);
}

.rtmp-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    margin: 16px 0;
}

.btn-watch {
    width: 100%;
    justify-content: center;
    background: linear-gradient(135deg, #34d399, #22d3ee);
}

.btn-watch:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(52, 211, 153, 0.3);
}

/* ═══════════════════════════════════════════════
   Room Settings Form
   ═══════════════════════════════════════════════ */

.room-settings { margin-top: 0.5rem; }

.settings-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.settings-divider::before,
.settings-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}

/* ── Toggle Switch ── */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    margin-bottom: 16px;
}

.toggle-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.toggle-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-violet));
    border-color: transparent;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: #fff;
}

/* ── Create Room Button ── */
.btn-create-room {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 28px;
    margin-top: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-violet));
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(129, 140, 248, 0.25);
    letter-spacing: 0.3px;
}

.btn-create-room:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(129, 140, 248, 0.35);
}

.btn-create-room:active {
    transform: translateY(0) scale(0.98);
}

/* Legacy */
.chat-enable-link { display: none; }

.form-row { margin-bottom: 0.75rem; }

.form-row-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.form-row-third {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

.form-field label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.form-field .optional {
    color: var(--text-muted);
    font-weight: 400;
}

.form-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.15);
}

.form-input::placeholder { color: var(--text-muted); }

.form-input-small { margin-top: 0.4rem; width: 100%; }

.form-select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    box-sizing: border-box;
}

.form-select:focus { border-color: var(--accent-primary); }
.form-select option { background: #1a1a2e; color: var(--text-primary); }

.limit-toggle {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.limit-btn {
    flex: 1;
    padding: 0.45rem 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.limit-btn.active {
    background: rgba(129, 140, 248, 0.15);
    color: var(--accent-primary);
}

.limit-btn:hover:not(.active) { background: rgba(255, 255, 255, 0.04); }

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
}

.toggle-track {
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    transition: background 0.3s;
}

.toggle-track.active {
    background: linear-gradient(135deg, #818cf8, #a78bfa);
}

.toggle-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-track.active .toggle-thumb { transform: translateX(18px); }
.toggle-label { font-size: 0.8rem; color: var(--text-secondary); }

.btn-create-final {
    width: 100%;
    justify-content: center;
    margin-top: 0.75rem;
    font-size: 0.95rem;
    padding: 0.75rem 1.5rem;
}

/* ═══════════════════════════════════════════════
   Chat Panel
   ═══════════════════════════════════════════════ */

.chat-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
    min-height: 400px;
    max-height: 600px;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-viewer-count { font-size: 0.7rem; color: var(--text-muted); }

.chat-admin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.chat-admin-btn:hover {
    background: rgba(129, 140, 248, 0.15);
    color: var(--accent-primary);
}

.chat-minimize-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.chat-minimize-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.chat-toggle-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #818cf8, #6366f1);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4), 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    animation: fabBounceIn 0.3s ease-out;
}

.chat-toggle-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5), 0 2px 8px rgba(0,0,0,0.3);
}

@keyframes fabBounceIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Nickname Setup */
.chat-nickname-setup {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 2rem 1rem;
    gap: 0.75rem;
}

.chat-nickname-setup .form-input {
    max-width: 220px;
    text-align: center;
}

.btn-nick { padding: 0.5rem 1.5rem !important; font-size: 0.85rem; }

/* Chat Messages */
.chat-messages {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.chat-msg-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.chat-msg {
    padding: 0.3rem 0;
    font-size: 0.8rem;
    line-height: 1.4;
    word-break: break-word;
}

.chat-nick {
    font-weight: 600;
    color: var(--accent-primary);
    margin-right: 0.4rem;
    cursor: default;
}

.chat-admin-msg .chat-nick { color: #fbbf24; }
.chat-crown { margin-right: 0.15rem; font-size: 0.7rem; }
.chat-text { color: var(--text-secondary); }
.chat-system { padding: 0.2rem 0; }

.chat-system-text {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Chat Input */
.chat-input-area {
    display: flex;
    gap: 0;
    padding: 0.5rem;
    border-top: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
}

.chat-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: 8px 0 0 8px;
    color: var(--text-primary);
    font-size: 0.82rem;
    outline: none;
    border-right: none;
}

.chat-input:focus { border-color: var(--accent-primary); }
.chat-input::placeholder { color: var(--text-muted); }

.chat-send-btn {
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 0 8px 8px 0;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
}

.chat-send-btn:hover { opacity: 0.85; }

/* Context Menu */
.chat-context-menu {
    position: fixed;
    z-index: 9999;
    background: #1a1a2e;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.25rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    min-width: 160px;
}

.chat-context-menu button {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
}

.chat-context-menu button:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.chat-context-menu .ctx-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Banned Panel */
.banned-panel {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(239, 68, 68, 0.04);
}

.banned-panel h4 {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.banned-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.unban-btn {
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: 4px;
    color: #34d399;
    cursor: pointer;
}

.unban-btn:hover { background: rgba(52, 211, 153, 0.2); }

.banned-empty {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ═══════════════════════════════════════════════
   Public Rooms Listing
   ═══════════════════════════════════════════════ */

.public-rooms-section { 
    max-width: 900px; 
    margin: 0 auto;
    padding: 32px 16px 60px;
}

.public-rooms-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.public-rooms-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.public-rooms-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.public-rooms-actions { display: flex; gap: 0.5rem; }

.pr-refresh-btn, .pr-back-btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.pr-refresh-btn:hover { background: rgba(129, 140, 248, 0.1); color: var(--accent-primary); }
.pr-back-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-primary); }

.public-rooms-list { padding: 0.5rem; }

.pr-room-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.pr-room-card:last-child { border-bottom: none; }
.pr-room-card:hover { background: rgba(255, 255, 255, 0.03); }

.pr-room-flag {
    font-size: 2.8rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    flex-shrink: 0;
}

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

.pr-room-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pr-room-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.pr-room-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.pr-meta-item { 
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: var(--radius-md);
}

.pr-room-id {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(129, 140, 248, 0.15);
    letter-spacing: 1px;
}

.pr-watch-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.pr-watch-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(129, 140, 248, 0.3);
}

.pr-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.pr-empty p { font-size: 1rem; margin: 0.75rem 0 0.25rem; color: var(--text-secondary); }
.pr-empty span { font-size: 0.82rem; }

.pr-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .pr-room-card { flex-wrap: wrap; }
    .pr-watch-btn { width: 100%; justify-content: center; }
    .header-nav { display: none; }
}

/* ── Flag Icons ── */
.flag-icon {
    width: 24px;
    height: 18px;
    vertical-align: middle;
    border-radius: 2px;
    box-shadow: 0 0 2px rgba(0,0,0,0.3);
    object-fit: cover;
}

.pr-room-flag .flag-icon {
    width: 32px;
    height: 24px;
    border-radius: 3px;
}

/* ── Custom Flag Select Dropdown ── */
.flag-select {
    position: relative;
    width: 100%;
}

.flag-select-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.flag-select-trigger:hover {
    border-color: var(--border-hover);
}

.flag-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    max-height: 280px;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.flag-select-dropdown.open {
    display: flex;
}

.flag-search {
    padding: 8px 12px;
    background: var(--bg-card);
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}

.flag-search::placeholder {
    color: var(--text-muted);
}

.flag-options {
    overflow-y: auto;
    max-height: 230px;
}

.flag-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: background 0.15s;
}

.flag-option:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.flag-options::-webkit-scrollbar {
    width: 4px;
}

.flag-options::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* ═══════════════════════════════════════════════
   Premium Animations & Enhanced Interactions
   ═══════════════════════════════════════════════ */

/* ── Keyframes ── */
@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes sectionFadeIn {
    from { opacity: 0; transform: scale(0.97) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes slideIndicator {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes dropdownReveal {
    from { opacity: 0; transform: scaleY(0.92) translateY(-6px); }
    to { opacity: 1; transform: scaleY(1) translateY(0); }
}

@keyframes breatheGlow {
    0%, 100% { border-color: rgba(129, 140, 248, 0.06); box-shadow: 0 0 40px rgba(129, 140, 248, 0.02); }
    50% { border-color: rgba(129, 140, 248, 0.12); box-shadow: 0 0 60px rgba(129, 140, 248, 0.04); }
}

/* ── Tab Content Entrance Animation ── */
.tab-content.active {
    animation: tabFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Tab Button Enhancements ── */
.tab-btn {
    position: relative;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 30%;
    right: 30%;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 1px;
    animation: slideIndicator 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Section Transitions ── */
.section-enter {
    animation: sectionFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Button Hover Enhancements ── */
.btn-play {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.btn-play::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0));
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-play:hover::before {
    opacity: 1;
}

.btn-play:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 8px 25px rgba(129, 140, 248, 0.3),
        0 0 40px rgba(129, 140, 248, 0.1),
        inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-play:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 100ms;
    box-shadow: 0 2px 8px rgba(129, 140, 248, 0.2);
}

/* ── Test Stream Buttons Enhanced ── */
.test-btn {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.test-btn:hover {
    border-color: var(--accent-indigo);
    color: var(--accent-indigo);
    background: rgba(129, 140, 248, 0.08);
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 4px 15px rgba(129, 140, 248, 0.12);
}

/* ── Nav Link Enhanced ── */
.nav-link {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover {
    color: var(--accent-primary);
    background: rgba(129, 140, 248, 0.1);
    border-color: rgba(129, 140, 248, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(129, 140, 248, 0.12);
}

/* ── Input Focus Enhanced ── */
.stream-input {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.stream-input:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1), 0 0 24px rgba(129, 140, 248, 0.05);
}

.form-input {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1), 0 0 20px rgba(129, 140, 248, 0.04);
}

/* ── Stat Card Enhanced ── */
.stat-card {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(129, 140, 248, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* ── Input Card Breathing ── */
.input-card {
    animation: breatheGlow 6s ease-in-out infinite;
    transition: border-color 0.3s;
}

/* ── Logo Interaction ── */
.logo-icon {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo:hover .logo-icon {
    transform: rotate(10deg) scale(1.1);
}

.logo:active {
    opacity: 0.7;
    transition: opacity 0.1s;
}

/* ── Mode Toggle Enhanced ── */
.mode-btn {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mode-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

.mode-btn.active {
    background: rgba(129, 140, 248, 0.15);
    color: var(--accent-indigo);
    box-shadow: inset 0 0 12px rgba(129, 140, 248, 0.06);
}

/* ── Limit/Toggle Buttons Enhanced ── */
.limit-btn {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.limit-btn.active {
    background: rgba(129, 140, 248, 0.15);
    color: var(--accent-primary);
    box-shadow: inset 0 0 10px rgba(129, 140, 248, 0.06);
}

.limit-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

/* ── Flag Select Trigger (Smaller — matches other form controls) ── */
.flag-select-trigger {
    padding: 0.42rem 0.6rem;
    font-size: 0.78rem;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.flag-select-trigger:hover {
    border-color: rgba(129, 140, 248, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.flag-select-trigger .flag-icon {
    width: 20px;
    height: 15px;
}

/* ── Flag Dropdown Animation ── */
.flag-select-dropdown {
    transform-origin: top center;
    max-height: 240px;
}

.flag-select-dropdown.open {
    animation: dropdownReveal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Flag Option Hover Enhanced ── */
.flag-option {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 4px;
    margin: 1px 4px;
}

.flag-option:hover {
    background: rgba(129, 140, 248, 0.1);
    color: var(--text-primary);
    padding-left: 16px;
}

/* ── Status Dot Enhanced ── */
.status-dot {
    transition: background 0.3s;
    box-shadow: 0 0 6px currentColor;
}

/* ── PR Room Card Enhanced ── */
.pr-room-card {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pr-room-card:hover {
    background: rgba(129, 140, 248, 0.04);
    transform: translateX(4px);
}

.pr-watch-btn {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pr-watch-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 24px rgba(129, 140, 248, 0.35);
}

/* ── Copy Button Enhanced ── */
.copy-btn {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.copy-btn:hover {
    background: rgba(129, 140, 248, 0.15);
    color: var(--accent-primary);
    border-color: rgba(129, 140, 248, 0.25);
    transform: scale(1.1);
}

/* ── Chat Send Button Enhanced ── */
.chat-send-btn {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-send-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.2);
}

/* ── Settings Divider Enhanced ── */
.settings-divider::before,
.settings-divider::after {
    background: linear-gradient(90deg, transparent, rgba(129, 140, 248, 0.15), transparent);
}

/* ── Player Control Buttons Enhanced ── */
.ctrl-btn {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ctrl-btn:hover {
    color: var(--text-primary);
    background: rgba(129, 140, 248, 0.1);
    transform: scale(1.08);
}

/* ── PR Action Buttons Enhanced ── */
.pr-refresh-btn, .pr-back-btn {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pr-refresh-btn:hover {
    background: rgba(129, 140, 248, 0.12);
    color: var(--accent-primary);
    border-color: rgba(129, 140, 248, 0.2);
    transform: translateY(-1px);
}

.pr-back-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* ── Chat Enable Link Enhanced ── */
.chat-enable-link {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-enable-link:hover {
    color: var(--accent-secondary);
    text-shadow: 0 0 12px rgba(167, 139, 250, 0.3);
}

/* ── Enhanced Ambient Orbs (8-step) ── */
@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.15; }
    12.5% { transform: translate(20px, -30px) scale(1.03); }
    25% { transform: translate(30px, -40px) scale(1.05); opacity: 0.18; }
    37.5% { transform: translate(10px, -10px) scale(1.02); }
    50% { transform: translate(-20px, 20px) scale(0.95); opacity: 0.12; }
    62.5% { transform: translate(-10px, 35px) scale(0.98); }
    75% { transform: translate(40px, 30px) scale(1.02); opacity: 0.16; }
    87.5% { transform: translate(25px, 10px) scale(1.01); }
}

/* ═══════════════════════════════════════════════
   Header Nav Buttons
   ═══════════════════════════════════════════════ */

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-sans);
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    white-space: nowrap;
}

.nav-btn:hover {
    color: var(--text-primary);
    border-color: rgba(129, 140, 248, 0.3);
    background: rgba(129, 140, 248, 0.06);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(129, 140, 248, 0.1);
}

.nav-btn:active {
    transform: translateY(0) scale(0.97);
    transition-duration: 80ms;
}

.nav-btn-accent {
    color: var(--accent-indigo);
    border-color: rgba(129, 140, 248, 0.25);
    background: rgba(129, 140, 248, 0.06);
}

.nav-btn-accent:hover {
    background: rgba(129, 140, 248, 0.12);
    border-color: rgba(129, 140, 248, 0.4);
    box-shadow: 0 4px 20px rgba(129, 140, 248, 0.15);
}

/* ═══════════════════════════════════════════════
   Landing Page
   ═══════════════════════════════════════════════ */

.landing-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: calc(100vh - 80px);
    padding: 0 0 60px;
    text-align: center;
}

/* Hero */
.landing-hero {
    margin-bottom: 36px;
}

.hero-logo {
    width: 420px;
    max-width: 80%;
    height: auto;
    display: block;
    margin: -8px auto -10px;
    object-fit: contain;
    filter: drop-shadow(0 0 24px rgba(129, 140, 248, 0.2));
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-violet);
    background: rgba(167, 139, 250, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.15);
    border-radius: 100px;
    margin-bottom: 24px;
}

.hero-title {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
    letter-spacing: -1.5px;
    margin-bottom: 20px;
}

.hero-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto;
}

/* Flow Steps — numbered timeline */
.landing-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 56px;
    max-width: 720px;
    width: 100%;
}

.flow-step {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
}

.flow-num {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--accent-indigo);
    background: rgba(129, 140, 248, 0.08);
    border: 1px solid rgba(129, 140, 248, 0.15);
    border-radius: 12px;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.flow-step:hover .flow-num {
    background: rgba(129, 140, 248, 0.15);
    border-color: rgba(129, 140, 248, 0.3);
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(129, 140, 248, 0.12);
}

.flow-content {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 2px;
}

.flow-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.flow-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.flow-line {
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, rgba(129, 140, 248, 0.3), rgba(192, 132, 252, 0.3));
    margin: 0 16px;
    flex-shrink: 0;
}

/* CTA Buttons */
.landing-cta {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 28px;
}

.cta-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-sans);
    color: #fff;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(129, 140, 248, 0.25);
}

.cta-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0));
    opacity: 0;
    transition: opacity 0.3s;
}

.cta-primary:hover::before {
    opacity: 1;
}

.cta-primary:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow:
        0 8px 30px rgba(129, 140, 248, 0.35),
        0 0 60px rgba(129, 140, 248, 0.1);
}

.cta-primary:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 80ms;
}

.cta-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cta-secondary:hover {
    border-color: rgba(129, 140, 248, 0.35);
    background: rgba(129, 140, 248, 0.06);
    color: var(--accent-indigo);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(129, 140, 248, 0.1);
}

.cta-secondary:active {
    transform: translateY(0) scale(0.97);
    transition-duration: 80ms;
}

/* Browse link */
.landing-browse {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
}

.landing-browse:hover {
    color: var(--accent-indigo);
    gap: 8px;
}

/* ═══════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════ */

/* ── Tablet (≤1024px) ── */
@media (max-width: 1024px) {
    .header-nav {
        gap: 6px;
    }
    .nav-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    .landing-flow {
        gap: 0;
        max-width: 100%;
        padding: 0 16px;
    }
    .flow-line {
        width: 24px;
        margin: 0 10px;
    }
}

/* ── Mobile (≤768px) ── */
@media (max-width: 768px) {
    .app {
        padding: 0 16px;
    }

    /* Header stacks */
    .header {
        flex-wrap: wrap;
        gap: 12px;
        padding: 16px 0;
        margin-bottom: 16px;
    }
    .header-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 8px;
    }
    .logo-sub {
        display: none;
    }

    /* Landing */
    .landing-section {
        padding: 8px 0 40px;
        min-height: auto;
    }
    .landing-hero {
        margin-bottom: 36px;
    }
    .hero-logo {
        width: 180px;
        margin-bottom: 20px;
    }
    .hero-title {
        font-size: 28px;
        letter-spacing: -0.5px;
    }
    .hero-desc {
        font-size: 14px;
        padding: 0 8px;
    }
    .hero-badge {
        font-size: 10px;
        padding: 5px 12px;
    }

    /* Flow goes vertical */
    .landing-flow {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 0 20px;
        margin-bottom: 40px;
        max-width: 340px;
    }
    .flow-line {
        width: 1px;
        height: 20px;
        margin: 6px 0 6px 19px;
    }
    .flow-step {
        gap: 12px;
    }

    /* CTA stacks */
    .landing-cta {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
    .cta-primary, .cta-secondary {
        width: 100%;
        justify-content: center;
        padding: 12px 24px;
        font-size: 14px;
    }

    /* Stream input */
    .stream-input-section {
        min-height: auto;
        padding: 16px 0;
    }
    .input-card {
        padding: 24px 16px;
    }
    .form-row-half,
    .form-row-third {
        grid-template-columns: 1fr;
    }
}

/* ── Small Mobile (≤480px) ── */
@media (max-width: 480px) {
    .app {
        padding: 0 12px;
    }
    .header {
        padding: 12px 0;
    }
    .header-nav {
        flex-wrap: wrap;
    }
    .nav-btn {
        padding: 6px 10px;
        font-size: 11px;
        gap: 4px;
    }
    .nav-btn svg {
        width: 12px;
        height: 12px;
    }
    .logo-icon {
        width: 32px;
        height: 32px;
    }
    .logo-text {
        font-size: 18px;
    }
    .hero-logo {
        width: 140px;
        margin-bottom: 16px;
    }
    .hero-title {
        font-size: 24px;
        letter-spacing: -0.5px;
    }
    .hero-desc {
        font-size: 13px;
    }
    .flow-num {
        width: 34px;
        height: 34px;
        font-size: 12px;
        border-radius: 10px;
    }
    .flow-label {
        font-size: 13px;
    }
    .flow-sub {
        font-size: 11px;
    }
    .cta-primary, .cta-secondary {
        padding: 11px 20px;
        font-size: 13px;
    }
    .landing-browse {
        font-size: 12px;
    }
}

/* ── Accessibility: Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.1ms !important;
    }
    .gradient-orb { animation: none !important; }
    .input-card { animation: none !important; }
}

/* ── Legal Disclaimer ── */
.legal-disclaimer {
    font-size: 13px;
    color: var(--text-secondary);
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.08), rgba(192, 132, 252, 0.08));
    border: 1px solid rgba(129, 140, 248, 0.15);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: inset 0 0 20px rgba(129, 140, 248, 0.02);
}

.legal-disclaimer svg {
    color: var(--accent-violet);
}

.legal-disclaimer strong {
    color: var(--text-primary);
    font-weight: 700;
}

.home-disclaimer {
    margin-top: 40px;
    margin-bottom: 20px;
}

.player-disclaimer-bottom {
    margin-top: 24px;
}
