:root {
    --live-bg: #121212;
    --live-bg-deep: #0a0a0a;
    --live-gold: #FFD700;
    --live-gold-dark: #FFAA00;
    --live-muted: #cccccc;
    --live-faint: #7a7a7a;
    --live-card: rgba(24, 24, 24, 0.76);
    --live-card-strong: rgba(10, 10, 10, 0.88);
    --live-line: rgba(255, 215, 0, 0.2);
    --live-line-strong: rgba(255, 215, 0, 0.42);
    --live-shadow: 0 16px 38px rgba(0, 0, 0, 0.38);
    --live-glow: 0 0 18px rgba(255, 215, 0, 0.54);
    --live-danger: #ff4444;
    --live-success: #28a745;
}

body.live-page {
    background:
        radial-gradient(circle at 16% 14%, rgba(255, 215, 0, 0.08), transparent 28rem),
        radial-gradient(circle at 84% 10%, rgba(255, 255, 255, 0.04), transparent 26rem),
        linear-gradient(180deg, var(--live-bg-deep) 0%, var(--live-bg) 46%, #0d0d0b 100%);
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1001;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--live-gold), var(--live-gold-dark));
    box-shadow: var(--live-glow);
    transition: width var(--motion-normal) var(--ease-standard);
}

#particles-js {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.34;
    pointer-events: none;
}

.live-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 126px 0 92px;
}

.live-title,
.live-subtitle,
.live-quick-actions,
.stream-stage,
.schedule-info {
    opacity: 0;
    transform: translateY(18px);
}

body.live-ready .live-title {
    animation: liveRise var(--motion-slow) var(--ease-decelerate) 40ms forwards;
}

body.live-ready .live-subtitle {
    animation: liveRise var(--motion-moderate) var(--ease-decelerate) 120ms forwards;
}

body.live-ready .live-quick-actions {
    animation: livePanelIn var(--motion-moderate) var(--ease-decelerate) 190ms forwards;
}

body.live-ready .stream-stage {
    animation: livePanelIn var(--motion-moderate) var(--ease-decelerate) 250ms forwards;
}

body.live-ready .schedule-info {
    animation: livePanelIn var(--motion-moderate) var(--ease-decelerate) 320ms forwards;
}

.live-hero {
    max-width: 900px;
    margin: 0 auto 30px;
    text-align: center;
}

.live-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0;
    color: var(--live-gold);
    font-family: 'Baby Doll', cursive, sans-serif;
    font-size: clamp(2.7rem, 7vw, 5rem);
    font-weight: 400;
    line-height: 0.96;
    text-shadow: 0 0 18px rgba(255, 215, 0, 0.64), 0 10px 34px rgba(0, 0, 0, 0.48);
}

.live-subtitle {
    max-width: 680px;
    margin: 1.1rem auto 0;
    color: rgba(235, 235, 235, 0.78);
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    line-height: 1.55;
}

.live-quick-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.72rem;
    margin-top: 1.25rem;
}

.live-status {
    display: none;
    align-items: center;
    gap: 0.45rem;
    min-height: 34px;
    padding: 0.48rem 0.8rem;
    border: 1px solid rgba(255, 68, 68, 0.42);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 68, 68, 0.16);
    font-family: 'Outfit', sans-serif;
    font-size: clamp(0.86rem, 1.8vw, 1rem);
    line-height: 1;
    text-shadow: none;
    box-shadow: 0 0 16px rgba(255, 68, 68, 0.22);
}

.live-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--live-danger);
    box-shadow: 0 0 14px rgba(255, 68, 68, 0.86);
    animation: livePulse 1.5s var(--ease-linear) infinite;
}

.stream-stage,
.schedule-info {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--live-line);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
        var(--live-card);
    box-shadow: var(--live-shadow);
}

.stream-stage::before,
.schedule-info::before {
    content: '';
    position: absolute;
    inset: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    pointer-events: none;
}

.schedule-info {
    padding: clamp(1.2rem, 3vw, 1.7rem);
    margin-bottom: 1.7rem;
}

.stream-stage {
    padding: clamp(1rem, 2.7vw, 1.35rem);
    margin-bottom: 1.7rem;
    border-color: rgba(255, 215, 0, 0.3);
    background:
        radial-gradient(circle at 18% 0%, rgba(255, 215, 0, 0.09), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
        var(--live-card);
}

.streams-controls {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.section-heading,
.subsection-heading {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    color: var(--live-gold);
    font-family: 'Baby Doll', cursive, sans-serif;
    font-weight: 400;
    line-height: 1;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.42);
}

.section-heading {
    font-size: clamp(1.8rem, 4vw, 2.55rem);
}

.subsection-heading {
    margin-bottom: 1.25rem;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.section-heading .material-icons,
.subsection-heading .material-icons {
    font-size: 0.72em;
}

.view-toggle,
.platform-selector,
.stream-actions,
.live-quick-actions,
.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.controls-stack {
    display: grid;
    justify-items: end;
    gap: 0.75rem;
}

.view-btn,
.platform-btn,
.stream-link,
.modal-btn {
    min-height: 44px;
    border: 1px solid rgba(255, 215, 0, 0.28);
    border-radius: 999px;
    color: var(--live-gold);
    background: rgba(255, 215, 0, 0.07);
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    transition:
        transform var(--motion-normal) var(--ease-standard),
        border-color var(--motion-normal) var(--ease-standard),
        background var(--motion-normal) var(--ease-standard),
        color var(--motion-fast) var(--ease-standard),
        box-shadow var(--motion-normal) var(--ease-standard);
    touch-action: manipulation;
}

.view-btn,
.platform-btn,
.stream-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.74rem 1.05rem;
}

.stream-link-primary {
    border-color: rgba(255, 215, 0, 0.62);
    color: #121212;
    background: linear-gradient(135deg, var(--live-gold), var(--live-gold-dark));
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.2);
}

.view-btn:hover,
.platform-btn:hover,
.stream-link:hover,
.modal-btn:hover {
    transform: translateY(-2px);
    border-color: var(--live-line-strong);
    background: rgba(255, 215, 0, 0.14);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22), 0 0 14px rgba(255, 215, 0, 0.16);
}

.view-btn:active,
.platform-btn:active,
.stream-link:active,
.modal-btn:active {
    transform: translateY(0) scale(0.98);
}

.view-btn.active,
.platform-btn.active {
    border-color: rgba(255, 215, 0, 0.62);
    color: #121212;
    background: linear-gradient(135deg, var(--live-gold), var(--live-gold-dark));
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.28);
}

.platform-btn.live {
    border-color: rgba(255, 68, 68, 0.6);
    box-shadow: 0 0 16px rgba(255, 68, 68, 0.2);
}

.material-icons {
    font-size: 1.1em;
    line-height: 1;
}

.platform-icon-small,
.stream-link img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.platform-item {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.16);
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
        rgba(10, 10, 10, 0.46);
    transition:
        transform var(--motion-normal) var(--ease-standard),
        border-color var(--motion-normal) var(--ease-standard),
        box-shadow var(--motion-normal) var(--ease-standard);
}

.platform-item::after,
.stream-player::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(255, 215, 0, 0.07), transparent);
    opacity: 0;
    transform: translateX(-20%);
    transition:
        opacity var(--motion-normal) var(--ease-standard),
        transform var(--motion-moderate) var(--ease-standard);
    pointer-events: none;
}

.platform-item:hover,
.stream-player:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 215, 0, 0.34);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

.platform-item:hover::after,
.stream-player:hover::after {
    opacity: 1;
    transform: translateX(20%);
}

.streams-container {
    display: grid;
    gap: 1rem;
}

.streams-container.single-view {
    grid-template-columns: 1fr;
}

.streams-container.dual-view {
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.8fr);
}

.streams-container.quad-view {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stream-player,
.chat-container {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.18);
    border-radius: 10px;
    background: var(--live-card-strong);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
    transition:
        opacity var(--motion-normal) var(--ease-standard),
        transform var(--motion-normal) var(--ease-standard),
        border-color var(--motion-normal) var(--ease-standard),
        box-shadow var(--motion-normal) var(--ease-standard);
}

.stream-player {
    display: none;
}

.stream-player.active,
.streams-container.quad-view .stream-player {
    display: block;
}

.streams-container.dual-view .stream-player:not(.active),
.streams-container.single-view .stream-player:not(.active) {
    display: none;
}

.stream-player.live {
    border-color: rgba(255, 68, 68, 0.38);
}

.stream-player.live .live-badge {
    display: inline-flex;
}

.chat-container {
    display: none;
    background: #050505;
}

.streams-container.dual-view .chat-container {
    display: block;
}

.streams-container.quad-view .chat-container {
    display: none;
}

.stream-header,
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 72px;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.16);
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.08), rgba(255, 215, 0, 0.02));
}

.chat-header {
    justify-content: flex-start;
    color: var(--live-gold);
    font-family: 'Baby Doll', cursive, sans-serif;
    font-size: 1.55rem;
}

.stream-platform,
.stream-stats,
.viewer-count {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.platform-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.platform-name {
    margin: 0;
    color: var(--live-gold);
    font-family: 'Baby Doll', cursive, sans-serif;
    font-size: clamp(1.55rem, 3vw, 2rem);
    font-weight: 400;
    line-height: 1;
}

.viewer-count {
    min-height: 34px;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: var(--live-muted);
    background: rgba(255, 255, 255, 0.045);
    font-variant-numeric: tabular-nums;
}

.live-badge {
    display: none;
    min-height: 34px;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 68, 68, 0.82);
    font-size: 0.82rem;
    letter-spacing: 0;
    box-shadow: 0 0 14px rgba(255, 68, 68, 0.32);
}

.stream-embed,
.chat-embed {
    position: relative;
    overflow: hidden;
    background: #000000;
}

.stream-embed {
    aspect-ratio: 16 / 9;
    min-height: 360px;
}

.chat-embed {
    min-height: 100%;
    height: clamp(360px, 48vw, 560px);
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 215, 0, 0.08), transparent 34%),
        #050505;
}

.stream-embed iframe,
.chat-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    color-scheme: dark;
    background: #050505;
}

.chat-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 0.85rem;
    border-top: 1px solid rgba(255, 215, 0, 0.16);
    background:
        linear-gradient(180deg, rgba(255, 215, 0, 0.05), rgba(255, 255, 255, 0.01)),
        #030303;
}

.stream-placeholder {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    padding: 1.5rem;
    color: var(--live-muted);
    text-align: center;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 215, 0, 0.14), transparent 35%),
        #050505;
}

.stream-placeholder.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--motion-normal) var(--ease-standard);
}

.stream-placeholder-fallback {
    background:
        radial-gradient(circle at 50% 0%, rgba(145, 70, 255, 0.18), transparent 36%),
        linear-gradient(180deg, rgba(255, 215, 0, 0.06), rgba(255, 255, 255, 0.015)),
        #050505;
}

.stream-placeholder-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
}

.stream-placeholder img,
.stream-placeholder .material-icons {
    width: 48px;
    height: 48px;
    object-fit: contain;
    color: var(--live-gold);
    font-size: 3rem;
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.28));
}

.stream-placeholder p {
    max-width: 360px;
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.45;
}

.stream-info {
    padding: 1rem;
}

.stream-description,
.schedule-text {
    margin: 0;
    color: var(--live-muted);
    font-size: clamp(1rem, 2vw, 1.12rem);
    line-height: 1.58;
}

.stream-actions {
    margin-top: 1rem;
}

.schedule-text + .schedule-text {
    margin-top: 0.9rem;
}

.schedule-text a {
    color: var(--live-gold);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 215, 0, 0.42);
    transition: color var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard);
}

.schedule-text a:hover {
    color: #ffffff;
    border-color: #ffffff;
}

.platform-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.platform-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-height: 96px;
    padding: 1rem;
}

.platform-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.platform-details h3 {
    margin: 0 0 0.2rem;
    color: var(--live-gold);
    font-family: 'Baby Doll', cursive, sans-serif;
    font-size: 1.55rem;
    font-weight: 400;
}

.platform-details p {
    margin: 0;
    color: var(--live-muted);
    line-height: 1.35;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.72);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--motion-normal) var(--ease-standard);
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: min(440px, 100%);
    padding: 1.4rem;
    border: 1px solid var(--live-line-strong);
    border-radius: 12px;
    color: #ffffff;
    background:
        linear-gradient(180deg, rgba(255, 215, 0, 0.08), rgba(255, 255, 255, 0.02)),
        rgba(10, 10, 10, 0.96);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.54), 0 0 24px rgba(255, 215, 0, 0.12);
    transform: translateY(16px) scale(0.98);
    transition: transform var(--motion-normal) var(--ease-decelerate);
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-title {
    margin: 0;
    color: var(--live-gold);
    font-family: 'Baby Doll', cursive, sans-serif;
    font-size: 2rem;
    font-weight: 400;
}

.modal-content p {
    margin: 0.6rem 0 1.1rem;
    color: var(--live-muted);
    line-height: 1.45;
}

.modal-btn {
    padding: 0.8rem 1.1rem;
}

.modal-btn.primary {
    color: #121212;
    border-color: rgba(255, 215, 0, 0.62);
    background: linear-gradient(135deg, var(--live-gold), var(--live-gold-dark));
}

.modal-btn.secondary {
    color: var(--live-muted);
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.055);
}

body.exporting-live .modal {
    cursor: progress;
}

.export-capture {
    background: #121212;
}

.export-loading {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px dashed rgba(255, 215, 0, 0.32);
    border-radius: 10px;
    color: var(--live-gold);
    font-family: 'Baby Doll', cursive, sans-serif;
    font-size: 1.45rem;
    text-align: center;
}

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

@keyframes livePanelIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.995);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes livePulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.55;
        transform: scale(0.72);
    }
}

@media (max-width: 980px) {
    .streams-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .controls-stack {
        justify-items: stretch;
    }

    .platform-grid,
    .streams-container.dual-view,
    .streams-container.quad-view {
        grid-template-columns: 1fr 1fr;
    }

    .streams-container.dual-view .chat-container {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .live-shell {
        width: min(100% - 24px, 1180px);
        padding-top: 108px;
    }

    .live-title {
        display: block;
    }

    .live-status {
        margin: 0.8rem auto 0;
        width: fit-content;
    }

    .platform-grid,
    .streams-container.dual-view,
    .streams-container.quad-view {
        grid-template-columns: 1fr;
    }

    .view-toggle,
    .platform-selector,
    .stream-actions,
    .live-quick-actions,
    .modal-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .view-btn,
    .platform-btn,
    .stream-link,
    .modal-btn {
        width: 100%;
    }

    .stream-embed {
        min-height: 240px;
    }

    .stream-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .stream-stats {
        width: 100%;
        justify-content: space-between;
    }

    .platform-item {
        min-height: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .live-title,
    .live-subtitle,
    .live-quick-actions,
    .stream-stage,
    .schedule-info {
        opacity: 1;
        transform: none;
        animation: none !important;
    }

    .live-status-dot {
        animation: none;
    }

    .platform-item::after,
    .stream-player::after {
        display: none;
    }
}
