/* =============================================
   MAIN.CSS — "Above the Gray Fog" Design System
   Lord of Mystery inspired cosmic-gothic portal
   ============================================= */

/* --- CSS Variables / Design Tokens --- */
:root {
    /* Background layers */
    --bg-void: #060a10;
    --bg-surface: #0a1018;
    --bg-elevated: #101820;
    --bg-card: rgba(10, 16, 24, 0.85);

    /* Borders */
    --border-subtle: rgba(80, 200, 200, 0.08);
    --border-accent: rgba(80, 200, 200, 0.2);
    --border-glow: rgba(80, 200, 200, 0.35);

    /* Teal — primary accent (ethereal, mystical) */
    --teal-primary: #4dc8c8;
    --teal-glow: rgba(80, 200, 200, 0.15);
    --teal-bright: #7eeaea;
    --teal-dim: #2a7878;
    --teal-deep: rgba(77, 200, 200, 0.06);

    /* Gold — secondary accent (warm contrast) */
    --gold-primary: #c9a55c;
    --gold-bright: #e8d5a0;
    --gold-dim: #8a7040;
    --gold-glow: rgba(201, 165, 92, 0.15);

    /* Violet — atmospheric depth */
    --violet-deep: #2a1840;
    --violet-glow: rgba(120, 60, 200, 0.12);

    /* Fog */
    --fog-color: rgba(140, 160, 180, 0.04);

    /* Text */
    --text-primary: #d8e4ef;
    --text-secondary: #8a9aae;
    --text-muted: #5a6878;
    --text-heading: #e8d5a0;

    /* Danger */
    --danger: #e74c3c;
    --danger-dim: rgba(231, 76, 60, 0.15);

    /* Typography */
    --font-display: 'Cormorant Garamond', 'Georgia', serif;
    --font-body: 'DM Sans', 'Helvetica Neue', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --section-padding: 80px;                     /* fallback for browsers without clamp() */
    --section-padding: clamp(60px, 8vw, 120px);
    --content-max: 1200px;
    --card-radius: 16px;
    --card-radius-sm: 10px;

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-fast: 200ms var(--ease-out-expo);
    --transition-medium: 400ms var(--ease-out-expo);
    --transition-slow: 800ms var(--ease-out-expo);

    /* Z-index scale */
    --z-bg: 0;
    --z-content: 1;
    --z-nav: 100;
    --z-modal: 200;
    --z-player: 150;
    --z-entrance: 500;
    --z-toast: 300;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-void);
    overflow-x: hidden;
    min-height: 100vh;
}

::selection {
    background: rgba(77, 200, 200, 0.3);
    color: var(--text-primary);
}

a {
    color: var(--teal-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--teal-bright);
}

/* Keyboard focus outlines — visible only for keyboard users */
:focus-visible {
    outline: 2px solid var(--teal-primary);
    outline-offset: 2px;
}
:focus:not(:focus-visible) {
    outline: none;
}

/* --- Cosmic Background --- */
.cosmic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-bg);
    pointer-events: none;
}

.nebula-layer {
    position: absolute;
    inset: 0;
    background:
        /* Crimson blood nebula — top left (MASSIVE) */
        radial-gradient(ellipse 85% 70% at 12% 18%, rgba(180, 20, 45, 0.72) 0%, rgba(120, 10, 30, 0.35) 35%, transparent 65%),
        /* Deep violet vortex — center right (MASSIVE) */
        radial-gradient(ellipse 75% 85% at 80% 32%, rgba(110, 30, 185, 0.70) 0%, rgba(70, 15, 130, 0.30) 40%, transparent 65%),
        /* Teal ethereal glow — lower left (MASSIVE) */
        radial-gradient(ellipse 70% 60% at 22% 72%, rgba(30, 170, 180, 0.65) 0%, rgba(20, 120, 130, 0.25) 40%, transparent 60%),
        /* Amber/gold mist — center (VIVID) */
        radial-gradient(ellipse 55% 45% at 52% 48%, rgba(200, 155, 45, 0.35) 0%, rgba(160, 110, 25, 0.12) 45%, transparent 65%),
        /* Deep blue void pocket — right (VIVID) */
        radial-gradient(ellipse 60% 70% at 92% 58%, rgba(15, 35, 130, 0.70) 0%, transparent 55%),
        /* Crimson wisp — bottom right (VIVID) */
        radial-gradient(ellipse 50% 40% at 72% 82%, rgba(160, 25, 50, 0.50) 0%, transparent 50%),
        /* Teal bright core — upper right */
        radial-gradient(circle 30% at 87% 12%, rgba(77, 220, 220, 0.40) 0%, transparent 55%),
        /* Purple haze — top center (MASSIVE) */
        radial-gradient(ellipse 90% 50% at 50% 2%, rgba(80, 20, 140, 0.60) 0%, transparent 50%),
        /* Emerald whisper — bottom center */
        radial-gradient(ellipse 60% 45% at 45% 90%, rgba(20, 150, 100, 0.35) 0%, transparent 55%),
        /* Base void gradient — deep rich colors */
        linear-gradient(180deg, #04061a 0%, #12062a 25%, #0a0520 50%, #060818 75%, #060a10 100%);
}

/* Secondary nebula layer for depth — slowly animates */
.nebula-layer::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 70% at 38% 38%, rgba(140, 20, 80, 0.45) 0%, transparent 55%),
        radial-gradient(ellipse 50% 60% at 68% 65%, rgba(40, 150, 170, 0.35) 0%, transparent 50%),
        radial-gradient(circle 35% at 18% 58%, rgba(120, 45, 200, 0.35) 0%, transparent 45%),
        radial-gradient(ellipse 45% 40% at 85% 80%, rgba(200, 80, 30, 0.25) 0%, transparent 50%);
    animation: nebulaShift 40s ease-in-out infinite alternate;
    opacity: 1;
}

/* Tertiary layer — warm streaks */
.nebula-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 45% 35% at 28% 28%, rgba(220, 130, 40, 0.28) 0%, transparent 45%),
        radial-gradient(ellipse 50% 40% at 78% 45%, rgba(190, 30, 75, 0.30) 0%, transparent 50%),
        radial-gradient(ellipse 40% 55% at 55% 75%, rgba(60, 20, 140, 0.25) 0%, transparent 50%);
    animation: nebulaShift 55s ease-in-out infinite alternate-reverse;
    opacity: 1;
}

@keyframes nebulaShift {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    25% { transform: translate(20px, -15px) scale(1.03) rotate(0.5deg); }
    50% { transform: translate(-15px, 10px) scale(0.98) rotate(-0.3deg); }
    75% { transform: translate(10px, 20px) scale(1.02) rotate(0.2deg); }
    100% { transform: translate(-10px, -10px) scale(1) rotate(0deg); }
}

.fog-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.fog-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    will-change: transform;
    opacity: 1;
    animation: fogDrift 25s ease-in-out infinite alternate;
    mix-blend-mode: screen;
}
/* Teal mist — massive drifting cloud from left */
.fog-1 {
    width: 1200px;
    height: 800px;
    background: radial-gradient(ellipse, rgba(50, 200, 200, 0.40), rgba(30, 150, 150, 0.15) 45%, transparent 70%);
    top: 2%;
    left: -20%;
    animation-duration: 32s;
    filter: blur(70px);
}
/* Deep violet cloud — right side */
.fog-2 {
    width: 1100px;
    height: 900px;
    background: radial-gradient(ellipse, rgba(130, 40, 220, 0.35), rgba(80, 20, 160, 0.12) 45%, transparent 70%);
    top: 35%;
    right: -15%;
    animation-duration: 26s;
    animation-delay: -8s;
    filter: blur(75px);
}
/* Crimson atmospheric mist — bottom center */
.fog-3 {
    width: 1300px;
    height: 700px;
    background: radial-gradient(ellipse, rgba(180, 30, 60, 0.30), rgba(120, 15, 35, 0.10) 45%, transparent 70%);
    bottom: 0%;
    left: 10%;
    animation-duration: 35s;
    animation-delay: -15s;
    filter: blur(85px);
}
/* Crimson ethereal wisp — upper right */
.fog-4 {
    width: 900px;
    height: 800px;
    background: radial-gradient(ellipse, rgba(200, 30, 55, 0.30), rgba(140, 15, 40, 0.10) 45%, transparent 65%);
    top: 10%;
    right: 5%;
    animation-duration: 28s;
    animation-delay: -5s;
    filter: blur(90px);
}
/* Golden mist — center */
.fog-5 {
    width: 1000px;
    height: 650px;
    background: radial-gradient(ellipse, rgba(220, 170, 50, 0.22), rgba(160, 110, 30, 0.08) 45%, transparent 65%);
    bottom: 20%;
    left: 25%;
    animation-duration: 38s;
    animation-delay: -20s;
    filter: blur(80px);
}
/* Blue void — lower left */
.fog-6 {
    width: 950px;
    height: 750px;
    background: radial-gradient(ellipse, rgba(20, 50, 160, 0.30), rgba(10, 25, 100, 0.10) 45%, transparent 65%);
    bottom: 25%;
    left: -12%;
    animation-duration: 30s;
    animation-delay: -12s;
    filter: blur(90px);
}

@keyframes fogDrift {
    0% { transform: translate(0, 0) scale(1); }
    20% { transform: translate(50px, -25px) scale(1.08); }
    40% { transform: translate(-20px, 40px) scale(0.95); }
    60% { transform: translate(35px, 15px) scale(1.12); }
    80% { transform: translate(-40px, -20px) scale(0.97); }
    100% { transform: translate(25px, -15px) scale(1.05); }
}

/* particle-canvas removed — consolidated into nebula-canvas (single canvas, single RAF loop) */

/* --- Interactive Nebula Interlude --- */
/* Nebula section is hidden — canvas is now fullscreen fixed */
.nebula-interlude {
    display: none;
}
#nebula-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none; /* clicks pass through to content */
    /* Transparent — CSS background shows through */
    will-change: contents;
}

/* --- Sticky Nav --- */
.sticky-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-nav);
    padding: 0 24px;
    background: rgba(6, 10, 16, 0.95);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border-subtle);
    transform: translateY(-100%);
    transition: transform 0.4s var(--ease-out-expo);
}
.sticky-nav.visible {
    transform: translateY(0);
}

.nav-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    gap: 32px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.nav-logo-icon {
    font-size: 22px;
}

.nav-links {
    display: flex;
    gap: 28px;
}
.nav-link {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    position: relative;
    padding: 4px 0;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--teal-primary);
    transition: width var(--transition-medium);
}
.nav-link:hover {
    color: var(--teal-bright);
}
.nav-link:hover::after {
    width: 100%;
}

.nav-btn {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.nav-btn-primary {
    background: var(--teal-primary);
    color: var(--bg-void);
}
.nav-btn-primary:hover {
    background: var(--teal-bright);
    box-shadow: 0 0 20px var(--teal-glow);
}

/* --- Section Layout --- */
.section {
    position: relative;
    z-index: var(--z-content);
    padding: var(--section-padding) 24px;
    max-width: var(--content-max);
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;                         /* fallback */
    margin-bottom: clamp(40px, 5vw, 70px);
}

.section-title {
    font-family: var(--font-display);
    font-size: 40px;                              /* fallback */
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 400;
    color: var(--text-heading);
    letter-spacing: 0.02em;
    line-height: 1.2;
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 15px;                              /* fallback */
    font-size: clamp(14px, 2vw, 17px);
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    z-index: var(--z-content);
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 80px 24px 40px;
    max-width: none;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 56px;                              /* fallback */
    font-size: clamp(42px, 8vw, 88px);
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: -0.01em;
    margin-bottom: 24px;
}
.hero-title-line {
    display: block;
    color: var(--text-primary);
}
.hero-title-accent {
    color: var(--gold-bright);
    font-weight: 500;
    position: relative;
}
.hero-title-accent::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--teal-primary), transparent);
}

.hero-subtitle {
    font-size: 17px;                              /* fallback */
    font-size: clamp(15px, 2vw, 19px);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 20px;
    line-height: 1.7;
}

.hero-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 36px;
}
.hero-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.hero-meta strong {
    color: var(--gold-bright);
}
.hero-meta-divider {
    color: var(--text-muted);
    opacity: 0.3;
    font-size: 8px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Dashboard stats */
.hero-dashboard {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
    flex-wrap: wrap;
}

.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--card-radius-sm);
    padding: 20px 28px;
    text-align: center;
    min-width: 130px;
    backdrop-filter: blur(12px);
    transition: all var(--transition-medium);
}
.dash-card:hover {
    border-color: var(--border-accent);
    box-shadow: 0 0 24px var(--teal-deep);
}

.dash-card-accent {
    border-color: var(--border-accent);
    background: linear-gradient(135deg, var(--bg-card), rgba(77, 200, 200, 0.05));
}

.dash-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 500;
    color: var(--teal-bright);
    margin-bottom: 4px;
}

.dash-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.btn-primary {
    background: var(--teal-primary);
    color: var(--bg-void);
}
.btn-primary:hover {
    background: var(--teal-bright);
    box-shadow: 0 0 28px var(--teal-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-accent);
}
.btn-secondary:hover {
    color: var(--teal-bright);
    border-color: var(--teal-primary);
    background: var(--teal-deep);
}

.btn-danger {
    background: var(--danger-dim);
    color: var(--danger);
    border: 1px solid rgba(231, 76, 60, 0.3);
}
.btn-danger:hover {
    background: rgba(231, 76, 60, 0.25);
}

.btn-sm {
    font-size: 12px;
    padding: 8px 16px;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-glow {
    box-shadow: 0 0 20px var(--teal-glow);
}

.btn-icon {
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* --- Glass Panel --- */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--card-radius);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: border-color var(--transition-medium), box-shadow var(--transition-medium);
}
.glass-panel:hover {
    border-color: var(--border-accent);
    box-shadow: 0 4px 40px var(--teal-deep);
}

/* --- Forms --- */
.form-group {
    margin-bottom: 16px;
}
.form-group-half {
    flex: 1;
    min-width: 120px;
}
.form-row {
    display: flex;
    gap: 12px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    background: rgba(6, 10, 16, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 10px 14px;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-input:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a6878' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-status {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* --- Hosts Section --- */
.hosts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.host-card {
    position: relative;
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    border-radius: var(--card-radius);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-medium);
}
.host-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--teal-primary), transparent);
    opacity: 0;
    transition: opacity var(--transition-medium);
}
.host-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 40px var(--teal-deep);
}
.host-card:hover::before {
    opacity: 1;
}
.host-card.male-host {
    --host-accent: var(--teal-primary);
}
.host-card.female-host {
    --host-accent: var(--gold-primary);
}

.host-name {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    transition: color var(--transition-fast);
}
.host-card:hover .host-name {
    color: var(--host-accent);
}

.host-gender-icon {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: block;
}

.host-style {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.5s var(--ease-out-expo), opacity 0.4s ease, margin 0.5s var(--ease-out-expo);
    margin-top: 0;
}
.host-style > span {
    overflow: hidden;
}
.host-card:hover .host-style,
.host-card.expanded .host-style {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 8px;
}

/* --- Channels Section --- */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (min-width: 1024px) {
    .channels-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.channel-card {
    position: relative;
    padding: 28px;
    border-radius: var(--card-radius);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all var(--transition-medium);
    overflow: hidden;
}
.channel-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--teal-primary), var(--gold-primary));
    transform: scaleX(0);
    transition: transform 0.5s var(--ease-out-expo);
}
.channel-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 40px var(--teal-deep), 0 0 60px rgba(77, 200, 200, 0.04);
    will-change: transform;
}
.channel-card:hover::after {
    transform: scaleX(1);
}

.channel-name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.channel-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.channel-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.channel-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.badge-tts {
    background: var(--teal-deep);
    color: var(--teal-primary);
    border: 1px solid rgba(77, 200, 200, 0.15);
}
.badge-tone {
    background: var(--gold-glow);
    color: var(--gold-primary);
    border: 1px solid rgba(201, 165, 92, 0.15);
}
.badge-new {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.2);
    animation: badgePulse 2s ease-in-out infinite;
}
.badge-generating {
    background: rgba(241, 196, 15, 0.1);
    color: #f1c40f;
    border: 1px solid rgba(241, 196, 15, 0.2);
    animation: badgePulse 1.5s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Generating spinner for button */
.generating-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spinnerRotate 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

@keyframes spinnerRotate {
    to { transform: rotate(360deg); }
}

.channel-latest {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.channel-latest strong {
    color: var(--text-secondary);
}

.channel-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 10, 16, 0.7);
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
    border-radius: var(--card-radius);
}
.channel-card:hover .channel-play-overlay {
    opacity: 1;
}
.channel-play-icon {
    font-size: 48px;
    color: var(--teal-bright);
    text-shadow: 0 0 30px var(--teal-glow);
}

/* --- Create Section --- */
.create-panels {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.create-panel {
    padding: 32px;
    min-width: 0;
    overflow: hidden;
}

.create-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.create-panel-icon {
    font-size: 28px;
}
.create-panel-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 500;
    color: var(--text-heading);
}
.create-panel-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.create-form {
    margin-top: 8px;
}

.episodes-mini-list {
    margin-top: 20px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 16px;
}

.mini-episode {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
}
.mini-episode:last-child {
    border-bottom: none;
}

.mini-ep-info {
    flex: 1;
    min-width: 0;
}
.mini-ep-title {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mini-ep-meta {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.mini-ep-play {
    background: var(--teal-deep);
    border: 1px solid var(--border-accent);
    color: var(--teal-primary);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.mini-ep-play:hover {
    background: var(--teal-primary);
    color: var(--bg-void);
}

/* --- Hood Section --- */
.hood-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}
.hood-actions .btn {
    min-width: 160px;
    justify-content: center;
}

/* --- Dev Panel --- */
.dev-panel-wrapper {
    margin-top: 20px;
}

.dev-panel-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: rgba(6, 10, 16, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--card-radius-sm);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.dev-panel-toggle:hover {
    border-color: var(--border-accent);
    color: var(--text-secondary);
}
.dev-toggle-arrow {
    transition: transform var(--transition-fast);
}
.dev-panel-toggle.open .dev-toggle-arrow {
    transform: rotate(180deg);
}

.dev-panel {
    margin-top: 12px;
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--card-radius);
}

.dev-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.dev-section-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.dev-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.dev-info strong {
    color: var(--teal-bright);
}

.dev-button-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.dev-btn {
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 6px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.dev-btn:hover {
    border-color: var(--teal-primary);
    color: var(--teal-bright);
    background: var(--teal-deep);
}
.dev-btn.active {
    border-color: var(--teal-primary);
    background: var(--teal-primary);
    color: var(--bg-void);
}

/* --- Dev Panel Outputs --- */
.dev-output {
    margin-top: 12px;
    padding: 12px;
    background: rgba(6, 10, 16, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--card-radius-sm);
    max-height: 300px;
    overflow-y: auto;
    font-size: 12px;
}
.dev-output pre {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}
.dev-feedback-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
}
.dev-feedback-item:last-child {
    border-bottom: none;
}
.dev-episode-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
}
.dev-episode-row:last-child {
    border-bottom: none;
}
.dev-danger-zone {
    border: 1px solid rgba(231, 76, 60, 0.2);
    border-radius: var(--card-radius-sm);
    padding: 16px;
    background: rgba(231, 76, 60, 0.03);
}

/* --- Music Tracks List --- */
.music-tracks-list {
    display: grid;
    gap: 2px;
}
.music-track-item {
    padding: 10px 14px;
    background: rgba(6, 10, 16, 0.4);
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
}
.music-track-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 2px;
}
.music-track-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* --- Stats for Nerds --- */
.stats-grid {
    display: grid;
    gap: 24px;
}
.stats-intro {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
}
.stats-phase-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    color: var(--gold-bright);
    margin: 28px 0 14px;
    letter-spacing: 0.02em;
}
.stats-phase-title:first-of-type {
    margin-top: 0;
}
.stats-section-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
    color: var(--text-heading);
    margin-bottom: 12px;
}
.stats-pipeline {
    display: grid;
    gap: 12px;
}
.pipeline-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 16px;
    background: rgba(6, 10, 16, 0.4);
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}
.pipeline-num {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--teal-deep);
    border: 1px solid var(--border-accent);
    color: var(--teal-bright);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}
.pipeline-step strong {
    color: var(--text-primary);
    font-size: 14px;
    display: block;
    margin-bottom: 2px;
}
.pipeline-step p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}
.stats-pre {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    background: rgba(6, 10, 16, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 16px;
    max-height: 250px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
.stats-empty {
    font-size: 13px;
    color: var(--text-muted);
}

/* --- Sources by Channel --- */
.sources-channel {
    margin-bottom: 24px;
}
.sources-channel-name {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    color: var(--text-heading);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
}
.source-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(80, 200, 200, 0.04);
}
.source-item:last-child {
    border-bottom: none;
}
.source-title {
    font-size: 14px;
    margin-bottom: 2px;
}
.source-title a {
    color: var(--teal-primary);
}
.source-title a:hover {
    color: var(--teal-bright);
    text-decoration: underline;
}
.source-domain {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* --- Footer --- */
.site-footer {
    position: relative;
    z-index: var(--z-content);
    border-top: 1px solid var(--border-subtle);
    padding: 60px 24px 30px;
    max-width: var(--content-max);
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    margin-bottom: 40px;
}

.footer-heading {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 500;
    color: var(--text-heading);
    margin-bottom: 12px;
}

.footer-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-link, .footer-link-btn {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    transition: color var(--transition-fast);
    background: none;
    border: none;
    font-family: var(--font-body);
    cursor: pointer;
    padding: 0;
    text-align: left;
}
.footer-link:hover, .footer-link-btn:hover {
    color: var(--teal-bright);
}

.footer-inline-link {
    color: var(--teal-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
    font-size: 12px;
    color: var(--text-muted);
}

/* --- Sticky Player --- */
.sticky-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-player);
    background: rgba(6, 10, 16, 0.97);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border-top: 1px solid var(--border-accent);
    padding: 0 32px;
}

.player-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
    height: 80px;
}

.player-info {
    flex: 0 0 180px;
    min-width: 0;
}
.player-channel {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--teal-primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.player-episode {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 20px;
    padding: 8px;
    border-radius: 6px;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}
.player-btn:hover {
    color: var(--teal-bright);
    background: rgba(77, 200, 200, 0.08);
}

.player-btn-main {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--teal-primary);
    color: var(--bg-void);
    font-size: 20px;
}
.player-btn-main:hover {
    background: var(--teal-bright);
    box-shadow: 0 0 16px var(--teal-glow);
}

.player-seek {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.player-time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    min-width: 40px;
    text-align: center;
}

.player-seekbar,
.player-volume-bar {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
    cursor: pointer;
}
.player-seekbar {
    flex: 1;
}
.player-volume-bar {
    width: 90px;
}

.player-seekbar::-webkit-slider-thumb,
.player-volume-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--teal-primary);
    cursor: pointer;
    border: 2px solid var(--bg-void);
    transition: box-shadow var(--transition-fast);
}
.player-seekbar::-webkit-slider-thumb:hover,
.player-volume-bar::-webkit-slider-thumb:hover {
    box-shadow: 0 0 12px var(--teal-glow);
    transform: scale(1.15);
}

/* Firefox seekbar thumb */
.player-seekbar::-moz-range-thumb,
.player-volume-bar::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--teal-primary);
    cursor: pointer;
    border: 2px solid var(--bg-void);
}

/* Clickable seekbar area — expand hit target */
.player-seekbar::-webkit-slider-runnable-track,
.player-volume-bar::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 6px;
}

.player-close {
    font-size: 20px;
    color: var(--text-muted);
    margin-left: 8px;
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: rgba(6, 10, 16, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 36px;
    animation: modalSlideUp 0.4s var(--ease-out-expo);
}
.modal-wide {
    max-width: 900px;
}

@keyframes modalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color var(--transition-fast);
}
.modal-close:hover {
    color: var(--text-primary);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    color: var(--text-heading);
    margin-bottom: 20px;
}

.modal-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}
.modal-text p {
    margin-bottom: 12px;
}

/* --- Generation Status Overlay --- */
.gen-status-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: rgba(6, 10, 16, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.gen-status-content {
    text-align: center;
    padding: 48px;
    max-width: 400px;
    width: 100%;
}

.gen-status-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 500;
    color: var(--text-heading);
    margin-bottom: 24px;
}

.gen-progress-ring {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}
.gen-progress-ring svg {
    transform: rotate(-90deg);
}
.gen-progress-bg {
    fill: none;
    stroke: var(--border-subtle);
    stroke-width: 6;
}
.gen-progress-fill {
    fill: none;
    stroke: var(--teal-primary);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 0.5s ease;
}
.gen-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 500;
    color: var(--teal-bright);
}

.gen-status-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.gen-status-steps {
    text-align: left;
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-void);
}
::-webkit-scrollbar-thumb {
    background: rgba(77, 200, 200, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(77, 200, 200, 0.3);
}

/* --- Loading Skeletons --- */
.skeleton {
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-elevated) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}
@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-card {
    height: 200px;
    border-radius: var(--card-radius);
    border: 1px solid var(--border-subtle);
}
.skeleton-host {
    height: 100px;
    border-radius: var(--card-radius);
    border: 1px solid var(--border-subtle);
}
.skeleton-dash {
    height: 80px;
    border-radius: var(--card-radius-sm);
    min-width: 130px;
    border: 1px solid var(--border-subtle);
}

/* --- Scroll Progress Bar --- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--teal-primary), var(--gold-primary));
    z-index: calc(var(--z-nav) + 1);
    transition: width 50ms linear;
    pointer-events: none;
}

/* --- Back to Top --- */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    color: var(--teal-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-medium);
    z-index: 9999;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    pointer-events: none;
}
.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.back-to-top:hover {
    background: var(--teal-primary);
    color: var(--bg-void);
    box-shadow: 0 0 20px var(--teal-glow);
}
/* Shift up when player is visible */
.back-to-top.player-active {
    bottom: 100px;
}

/* --- Party Mode Button --- */
#party-btn {
    position: fixed;
    bottom: 78px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(131, 56, 236, 0.25);
    border: 1px solid rgba(131, 56, 236, 0.4);
    color: var(--text-secondary);
    font-size: 1.6em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-medium);
    z-index: 9999;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(131, 56, 236, 0.3);
}
#party-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
#party-btn:hover {
    background: rgba(131, 56, 236, 0.4);
    border-color: rgba(131, 56, 236, 0.6);
    transform: scale(1.15) rotate(-8deg);
    box-shadow: 0 6px 24px rgba(131, 56, 236, 0.5);
}
#party-btn.player-active {
    bottom: 154px;
}

/* --- Party Mode Overlay --- */
#party-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99999;
    pointer-events: none;
    overflow: hidden;
}
#party-overlay.active {
    display: block;
}
.disco-ball {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 100px;
    animation: discoDrop 0.6s ease-out forwards, discoSpin 1s linear infinite;
    filter: drop-shadow(0 0 40px rgba(255,255,255,0.5));
}
@keyframes discoDrop {
    from { top: -120px; opacity: 0; }
    to { top: 30px; opacity: 1; }
}
@keyframes discoSpin {
    from { transform: translateX(-50%) rotate(0deg); }
    to { transform: translateX(-50%) rotate(360deg); }
}
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    opacity: 0;
    animation: confettiFall linear forwards;
}
@keyframes confettiFall {
    0% { opacity: 1; top: -10px; transform: rotate(0deg) scale(1); }
    80% { opacity: 1; }
    100% { opacity: 0; top: 110vh; transform: rotate(720deg) scale(0.5); }
}
.party-lights {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255,0,128,0.2) 0%, transparent 40%),
                radial-gradient(circle at 80% 30%, rgba(0,200,255,0.2) 0%, transparent 40%),
                radial-gradient(circle at 50% 80%, rgba(255,230,0,0.18) 0%, transparent 40%),
                radial-gradient(circle at 10% 70%, rgba(0,255,128,0.18) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(200,0,255,0.18) 0%, transparent 40%);
    animation: partyPulse 0.35s ease-in-out infinite alternate;
}
@keyframes partyPulse {
    from { opacity: 0.4; filter: hue-rotate(0deg); }
    to { opacity: 1; filter: hue-rotate(90deg); }
}
.party-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.5em;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px #f0f, 0 0 40px #0ff, 0 0 60px #ff0, 0 0 80px #f0f;
    animation: partyTextPop 0.5s ease-out forwards, partyTextGlow 0.3s ease-in-out infinite alternate;
    letter-spacing: 6px;
    white-space: nowrap;
}
@keyframes partyTextPop {
    from { transform: translate(-50%, -50%) scale(0.2); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes partyTextGlow {
    from { text-shadow: 0 0 20px #f0f, 0 0 40px #0ff, 0 0 60px #ff0; }
    to { text-shadow: 0 0 40px #0ff, 0 0 80px #f0f, 0 0 120px #0f0; }
}
.laser {
    position: absolute;
    height: 3px;
    transform-origin: left center;
    opacity: 0;
    filter: blur(1px);
    box-shadow: 0 0 8px currentColor, 0 0 20px currentColor;
    animation: laserShoot linear forwards;
}
@keyframes laserShoot {
    0% { opacity: 0; width: 0; }
    10% { opacity: 1; width: 0; }
    50% { opacity: 1; width: 110vw; }
    80% { opacity: 0.8; width: 110vw; }
    100% { opacity: 0; width: 110vw; }
}
.laser-v {
    position: absolute;
    width: 3px;
    transform-origin: top center;
    opacity: 0;
    filter: blur(1px);
    box-shadow: 0 0 8px currentColor, 0 0 20px currentColor;
    animation: laserShootV linear forwards;
}
@keyframes laserShootV {
    0% { opacity: 0; height: 0; }
    10% { opacity: 1; height: 0; }
    50% { opacity: 1; height: 110vh; }
    80% { opacity: 0.8; height: 110vh; }
    100% { opacity: 0; height: 110vh; }
}
.sparkle {
    position: absolute;
    font-size: 18px;
    opacity: 0;
    animation: sparklePop ease-out forwards;
    pointer-events: none;
}
@keyframes sparklePop {
    0% { opacity: 0; transform: scale(0) rotate(0deg); }
    30% { opacity: 1; transform: scale(1.3) rotate(90deg); }
    70% { opacity: 1; transform: scale(1) rotate(180deg); }
    100% { opacity: 0; transform: scale(0.5) rotate(360deg); }
}

/* --- Chat Widget --- */
#chat-btn {
    position: fixed;
    bottom: 28px;
    left: 28px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: #fff;
    font-size: 0.9em;
    font-weight: 600;
    padding: 12px 18px;
    border-radius: 24px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(102,126,234,0.4);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.4s;
    opacity: 0;
    pointer-events: none;
}
#chat-btn.visible {
    opacity: 1;
    pointer-events: auto;
}
#chat-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 28px rgba(102,126,234,0.6);
}
#chat-btn.player-active {
    bottom: 100px;
}
#chat-panel {
    position: fixed;
    bottom: 80px;
    left: 28px;
    width: 380px;
    max-height: 520px;
    background: var(--bg-surface);
    border: 1px solid var(--border-accent);
    border-radius: 16px;
    display: none;
    flex-direction: column;
    z-index: 1001;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
}
#chat-panel.visible {
    display: flex;
}
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-weight: 600;
    font-size: 0.95em;
}
.chat-header button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-size: 1.2em;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.chat-header button:hover {
    background: rgba(255,255,255,0.35);
}
.chat-home-bar {
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-subtle);
}
.chat-home-bar button {
    background: none;
    border: none;
    color: var(--teal-primary);
    cursor: pointer;
    font-size: 0.85em;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}
.chat-home-bar button:hover {
    background: var(--teal-glow);
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 200px;
    max-height: 340px;
}
.chat-msg {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.88em;
    line-height: 1.5;
    max-width: 85%;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.chat-msg.bot {
    background: var(--bg-elevated);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.chat-msg.user {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.chat-quick-group {
    margin-bottom: 8px;
}
.chat-quick-label {
    font-size: 0.75em;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.chat-quick-btn {
    display: inline-block;
    background: rgba(102,126,234,0.15);
    border: 1px solid rgba(102,126,234,0.25);
    color: var(--teal-bright);
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 0.82em;
    cursor: pointer;
    margin: 2px 4px 2px 0;
    transition: background 0.15s, color 0.15s;
}
.chat-quick-btn:hover {
    background: rgba(102,126,234,0.3);
    color: #fff;
}
.chat-input-area {
    display: flex;
    padding: 10px 12px;
    border-top: 1px solid var(--border-subtle);
    gap: 8px;
}
.chat-input-area input {
    flex: 1;
    background: var(--bg-void);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.88em;
    outline: none;
}
.chat-input-area input:focus {
    border-color: var(--teal-primary);
}
.chat-input-area button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85em;
    cursor: pointer;
    transition: opacity 0.15s;
}
.chat-input-area button:hover {
    opacity: 0.85;
}
.chat-feedback-area {
    padding: 10px 12px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chat-feedback-area textarea {
    background: var(--bg-void);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.88em;
    min-height: 70px;
    resize: vertical;
    outline: none;
    font-family: inherit;
}
.chat-feedback-area textarea:focus {
    border-color: var(--teal-primary);
}
.chat-feedback-area input {
    background: var(--bg-void);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85em;
    outline: none;
}
.chat-feedback-area input:focus {
    border-color: var(--teal-primary);
}
.chat-feedback-area button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
.chat-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    align-self: flex-start;
}
.chat-typing span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: chatTyping 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* --- Audio Visualizer --- */
.player-visualizer {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 24px;
    padding: 0 6px;
}
.visualizer-bar {
    width: 3px;
    background: var(--teal-primary);
    border-radius: 2px;
    height: 4px;
    transition: height 120ms ease;
}
.visualizer-bar.active {
    animation: vizBounce var(--viz-speed, 0.5s) ease-in-out infinite alternate;
}
@keyframes vizBounce {
    0% { height: 4px; opacity: 0.6; }
    100% { height: var(--viz-height, 16px); opacity: 1; }
}

/* --- Episode Count Badge --- */
.channel-ep-count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}
.channel-ep-count strong {
    color: var(--teal-primary);
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}
.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}
.empty-state-text {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.empty-state-hint {
    font-size: 13px;
    color: var(--text-muted);
}

/* --- Keyboard Shortcut Hint --- */
.keyboard-hint {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: 8px;
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    z-index: var(--z-toast);
    opacity: 0;
    transition: all 0.3s var(--ease-out-expo);
    pointer-events: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    white-space: nowrap;
}
.keyboard-hint.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.keyboard-hint kbd {
    display: inline-block;
    background: rgba(77, 200, 200, 0.1);
    border: 1px solid var(--border-accent);
    border-radius: 4px;
    padding: 1px 6px;
    margin: 0 2px;
    color: var(--teal-bright);
    font-family: var(--font-mono);
    font-size: 11px;
}

/* --- Utility --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* =============================================
   PERFORMANCE TIER OVERRIDES
   Driven by data-perf-tier attribute on <html>
   set by perf-tier.js (HIGH/MEDIUM/LOW)
   HIGH = default styles (no overrides needed)
   ============================================= */

/* --- CSS Containment (all tiers) --- */
#hosts-section,
#channels-section,
#create-section,
#hood-section {
    contain: layout style paint;
}

/* NOTE: content-visibility: auto was removed — it conflicts with GSAP ScrollTrigger
   position calculations, causing cards to appear late on mobile. The CSS containment
   above (contain: layout style paint) still provides layout isolation benefits. */

/* --- Backdrop-filter removal for MEDIUM + LOW tiers ---
   Replaces expensive real-time Gaussian blur compositing
   with slightly more opaque backgrounds (visually near-identical) */

[data-perf-tier="medium"] .sticky-nav,
[data-perf-tier="low"] .sticky-nav {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(6, 10, 16, 0.98);
}

[data-perf-tier="medium"] .dash-card,
[data-perf-tier="low"] .dash-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(10, 16, 24, 0.95);
}

[data-perf-tier="medium"] .glass-panel,
[data-perf-tier="low"] .glass-panel {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(10, 16, 24, 0.95);
}

[data-perf-tier="medium"] #sticky-player,
[data-perf-tier="low"] #sticky-player {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(6, 10, 16, 0.99);
}

[data-perf-tier="medium"] .modal-overlay,
[data-perf-tier="low"] .modal-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(6, 10, 16, 0.92);
}

[data-perf-tier="medium"] .back-to-top,
[data-perf-tier="low"] .back-to-top {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(10, 16, 24, 0.95);
}

[data-perf-tier="medium"] #party-btn,
[data-perf-tier="low"] #party-btn {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(10, 16, 24, 0.95);
}

[data-perf-tier="medium"] #chat-panel,
[data-perf-tier="low"] #chat-panel {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(10, 16, 24, 0.97);
}

[data-perf-tier="medium"] .keyboard-hint,
[data-perf-tier="low"] .keyboard-hint {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(10, 16, 24, 0.95);
}

/* --- LOW tier: Entrance + Fog optimizations ---
   Old phones (5+ years) can't handle GPU-heavy entrance + 6 animated fog blobs */

/* Remove expensive box-shadow blur on gold sparks during entrance */
[data-perf-tier="low"] .gold-spark {
    box-shadow: none;
}

/* Hide fog blobs 4-6, stop animation on remaining 3, reduce blur */
[data-perf-tier="low"] .fog-4,
[data-perf-tier="low"] .fog-5,
[data-perf-tier="low"] .fog-6 {
    display: none;
}
[data-perf-tier="low"] .fog-blob {
    animation: none;
    filter: blur(40px);
}
