/* ==========================================================================
   TWITCH WHEEL OF FORTUNE - CORE STYLES & GLOW RED/BLACK DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --bg-dark: #070709;
    --bg-card: rgba(14, 14, 17, 0.85);
    --border-color: rgba(255, 0, 60, 0.2);
    --neon-red: #ff003c;
    --dark-red: #990024;
    --neon-cyan: #00f0ff;
    --text-main: #f5f4f6;
    --text-muted: #a3a3ac;
    --success: #00f59b;
    --font-primary: 'Outfit', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Dynamic Theme Variables (Default Neon Red) */
    --theme-glow: rgba(255, 0, 60, 0.12);
    --theme-grid: rgba(255, 0, 60, 0.006);
    --theme-shadow-40: rgba(255, 0, 60, 0.4);
    --theme-shadow-10: rgba(255, 0, 60, 0.1);
    --theme-shadow-08: rgba(255, 0, 60, 0.08);
    --mouse-glow-color: rgba(255, 0, 60, 0.22);
    --mouse-glow-border-color: rgba(255, 0, 60, 0.45);

    /* Winner-overlay role theming — set per winner via JS on <html>; these are the
       fallbacks (theme red) used before the first winner. See the winner-overlay
       role block further down for the rules that consume them. */
    --winner-accent: #ff003c;
    --winner-accent-rgb: 255, 0, 60;
    --winner-close-dark: #990024;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
}

/* Background grid overlay for premium streamer aesthetic */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 50% 50%, var(--theme-glow) 0%, transparent 50%),
        linear-gradient(var(--theme-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--theme-grid) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    z-index: 0;
    pointer-events: none;
}

/* Canvas background for particles */
#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ==========================================================================
   APP LAYOUT
   ========================================================================== */

#app-container {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
    overflow: hidden; /* Prevents collapsed sidebar from causing horizontal scroll/viewport shifts */
}

/* Sidebar Settings (frosted glass glassmorphism) */
#sidebar {
    width: 360px;
    flex-shrink: 0; /* Prevents sidebar from squeezing during transition */
    height: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    padding: 0;
    display: block;
    overflow: hidden;
    z-index: 10;
    transition: margin-left 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.7);
}

.sidebar-scroll-wrapper {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-sizing: border-box;
    /* Firefox: tint the scrollbar to the active theme colour. */
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--theme-rgb, 255, 0, 60), 0.4) transparent;
}

.sidebar-scroll-wrapper::-webkit-scrollbar {
    width: 6px;
}
.sidebar-scroll-wrapper::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-scroll-wrapper::-webkit-scrollbar-thumb {
    background: rgba(var(--theme-rgb, 255, 0, 60), 0.3);
    border-radius: 3px;
}

/* Main Area (3-row Grid for perfect dynamic spacing of Header, Wheel, and Footer) */
#main-content {
    flex: 1;
    height: 100vh;
    box-sizing: border-box;
    display: grid;
    grid-template-rows: 1fr auto 1fr; /* Top gap, Center Wheel, Bottom gap */
    align-items: center;
    justify-items: center;
    padding: 15px 0;
    overflow: hidden;
    position: relative;
}

/* ==========================================================================
   SIDEBAR UI COMPONENTS
   ========================================================================== */

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px; /* Perfect vertical alignment with the eye icon */
    padding-bottom: 16px;
    padding-left: 48px; /* Offset to clear the floating eye button in the top left */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo-section svg {
    width: 32px;
    height: 32px;
    color: var(--neon-red);
    filter: drop-shadow(0 0 8px rgba(255, 0, 60, 0.6));
}

.logo-section h1 {
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    background: linear-gradient(120deg, #ffffff 0%, var(--neon-red) 35%, #ffffff 70%, var(--neon-red) 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: logo-shimmer 6s ease-in-out infinite;
}

@keyframes logo-shimmer {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

input[type="text"], input[type="number"] {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text-main);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

input[type="text"]:focus, input[type="number"]:focus {
    outline: none;
    border-color: var(--neon-red);
    background: rgba(255, 0, 60, 0.05);
    box-shadow: 0 0 15px rgba(255, 0, 60, 0.2);
}

/* Sleek tab selector in the sidebar */
.mode-selector-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text-muted);
    font-family: var(--font-primary);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.tab-btn.active {
    color: var(--text-main);
    background: var(--neon-red);
    box-shadow: 0 0 12px rgba(255, 0, 60, 0.45);
}


/* File Upload styling - unneeded now but preserved */
.file-upload {
    position: relative;
    border: 2px dashed rgba(255, 0, 60, 0.3);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 0, 60, 0.02);
    transition: var(--transition-smooth);
}

.file-upload:hover {
    border-color: var(--neon-red);
    background: rgba(255, 0, 60, 0.05);
}

.file-upload input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Switches & Buttons */
.toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.settings-group-box {
    display: flex;
    flex-direction: column;
    margin: 8px 0;
}

.settings-group-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-group-row:last-child {
    border-bottom: none;
}

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

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.12);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--neon-red);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.btn {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--neon-red), var(--dark-red));
    color: white;
    box-shadow: 0 4px 20px rgba(255, 0, 60, 0.35);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 0, 60, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: rgba(255, 0, 60, 0.12);
    color: #ff3366;
    border: 1px solid rgba(255, 0, 60, 0.25);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(255, 0, 60, 0.2);
    border-color: #ff3366;
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.decapi-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(145, 70, 255, 0.1); /* Twitch-Lila transparent */
    border: 1px solid rgba(145, 70, 255, 0.35);
    color: #a970ff; /* Twitch-Lila Akzent */
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: var(--transition-smooth);
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    margin-top: 6px;
}

.decapi-link-btn:hover {
    background: rgba(145, 70, 255, 0.2);
    border-color: #a970ff;
    box-shadow: 0 0 12px rgba(145, 70, 255, 0.35);
    color: #ffffff;
}

/* Status Indicator (shown next to the title in the logo section) */

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--text-muted);
}

.status-dot.connected {
    background-color: var(--neon-red);              /* follows the active theme colour */
    box-shadow: 0 0 8px var(--neon-red);
    /* Subtle glow "breathe" (no scaling, so it doesn't look like it's searching). */
    animation: dot-breathe 2.6s ease-in-out infinite;
}

.status-dot.connecting {
    background-color: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
    animation: pulse-dot 1s infinite;
}

/* Disconnected: a grey dot that gently blinks red. */
.status-dot.disconnected {
    background-color: #555;
    box-shadow: none;
    animation: blink-red 1.6s ease-in-out infinite;
}

/* In the header it's the only connection indicator → bigger, pushed to the right
   (with a small gap so it isn't flush against the edge). */
.logo-section .status-dot { width: 12px; height: 12px; margin-left: auto; margin-right: 16px; }

@keyframes pulse-dot {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

/* Gentle glow breathe for the connected dot — calm, not a "searching" ping. */
@keyframes dot-breathe {
    0%, 100% { box-shadow: 0 0 5px var(--neon-red); opacity: 0.82; }
    50%      { box-shadow: 0 0 11px var(--neon-red); opacity: 1; }
}

/* Disconnected: subtle red blink on a grey dot (soft, not harsh). */
@keyframes blink-red {
    0%, 100% { background-color: #555; box-shadow: none; }
    50%      { background-color: #ff3366; box-shadow: 0 0 8px rgba(255, 51, 102, 0.8); }
}

/* Section Dividers */
.section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--neon-red);
    letter-spacing: 1px;
    margin-top: 10px;
    text-transform: uppercase;
}

/* Participant counter list style */
.stat-box {
    display: flex;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.01);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--neon-cyan);
}

.user-list-container {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}

/* Hide scrollbar for past winners list */
#past-winners-list::-webkit-scrollbar {
    display: none;
}
#past-winners-list {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.user-item:last-child {
    border-bottom: none;
}

.user-item-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    letter-spacing: -0.3px; /* Slightly narrower look */
}

.remove-user-btn {
    background: transparent;
    border: none;
    color: #ff3366;
    cursor: pointer;
    font-size: 0.75rem;
    opacity: 0.6;
    transition: var(--transition-smooth);
}

.remove-user-btn:hover {
    opacity: 1;
}

/* ==========================================================================
   CIRCULAR WHEEL ARENA (MAIN GRAPHICS)
   ========================================================================== */

#arena-container {
    position: relative;
    width: 88%;
    max-width: min(850px, 78vh); /* Große, beeindruckende Skalierung in Fullscreen */
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Canvas element for drawing slices (Kuchenstücke) */
#wheel-canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 2;
}

/* Container for Raffle Ticker cards (supports border spotlights & card styling) */
#ticker-container {
    position: relative;
    width: 100%;
    height: 200px; /* Erhöhte Höhe für ein intensiveres und prachtvolleres Ticker-Erlebnis */
    background: rgba(22, 22, 26, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    z-index: 2;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
}

#ticker-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    border-radius: inherit;
}

/* Ticker Mode Arena Container layout transition */
#arena-container.ticker-mode {
    width: 88%;
    max-width: 850px; /* Perfekte Symmetrie mit der neuen Glücksrad-Breite */
    height: 480px; /* Leicht erhöht für das größere Seitenverhältnis */
    flex-direction: column;
    justify-content: center;
    gap: 35px; /* Increased from 20px to push the logo lower */
    border-radius: 0;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

#arena-container.ticker-mode .outer-orbit-ring,
#arena-container.ticker-mode .radar-ring,
#arena-container.ticker-mode #wheel-canvas {
    display: none !important;
}

#arena-container.ticker-mode #ticker-container {
    display: block !important;
}

#arena-container.ticker-mode .center-logo-container {
    width: 105px;
    height: 105px;
    margin-top: 20px; /* Extra spacing to push the logo lower */
    box-shadow: 0 0 25px var(--theme-glow);
    animation: gentle-float-ticker 6s ease-in-out infinite;
}

@keyframes gentle-float-ticker {
    0% { margin-top: 20px; }
    50% { margin-top: 16px; }
    100% { margin-top: 20px; }
}


/* Center Logo Outer Circle (Perfect stationary overlay) */
.center-logo-container {
    position: relative;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: #070709;
    border: 1px solid rgba(255, 255, 255, 0.03);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.8), 0 0 12px var(--theme-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    cursor: pointer;
    animation: gentle-float 6s ease-in-out infinite;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.5s ease;
}

.center-logo-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    box-shadow: 0 0 35px var(--neon-red), 0 0 15px rgba(255, 255, 255, 0.25);
    opacity: var(--logo-glow-opacity, 0); /* Dynamically scales with cursor proximity! */
    z-index: -1;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.center-logo-container:hover {
    transform: scale(1.06);
    border-color: var(--neon-red);
}

.center-logo-container:focus,
.center-logo-container:focus-visible {
    outline: none;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.65); /* Elegant glowing white focus ring instead of browser default blue outline! */
}

/* Actual image or fallback initials */
.center-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    padding: 3px;
}

.center-logo-fallback {
    font-size: 2.2rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    background: linear-gradient(135deg, #fff, var(--neon-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Pulsing radar rings behind logo */
.radar-ring {
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 2px solid var(--neon-red);
    opacity: 0;
    z-index: 3;
    pointer-events: none;
    animation: radar-pulse 3.5s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}

.radar-ring:nth-child(2) {
    animation-delay: 1.1s;
    border-color: var(--dark-red);
}

.radar-ring:nth-child(3) {
    animation-delay: 2.2s;
    border-color: #ffffff;
}

/* Rotating orbit ring behind canvas rim */
.outer-orbit-ring {
    display: none;
}



/* ==========================================================================
   WINNER OVERLAY / SCREEN
   ========================================================================== */

#winner-overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 4, 6, 0.45); /* Highly translucent to see the wheel behind */
    backdrop-filter: blur(4px); /* Light blur to keep wheel beautifully visible */
    -webkit-backdrop-filter: blur(4px);
    z-index: 19;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

body.winner-active #winner-overlay-backdrop {
    opacity: 1;
    pointer-events: auto;
}

#winner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 21; /* Raised from 20 to 21 */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

#winner-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

#winner-overlay-ambient-glow {
    position: absolute;
    width: 500px;
    height: 350px; /* approximate winner card height */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
    border-radius: 24px;
    background: radial-gradient(
        220px circle at var(--mouse-x, 250px) var(--mouse-y, 175px),
        var(--mouse-glow-bg-color, rgba(255, 0, 60, 0.06)) 0%,
        transparent 70%
    );
    filter: blur(45px);
    -webkit-filter: blur(45px);
    opacity: var(--spotlight-opacity, 0);
}

.winner-card {
    background: linear-gradient(180deg, #101013 0%, #060608 100%);
    border: none;
    box-shadow: 
        0 10px 50px var(--theme-shadow-40),
        0 0 calc(100px + var(--spotlight-opacity, 0) * 40px) var(--theme-shadow-10),
        inset 0 0 30px var(--theme-shadow-08);
    border-radius: 24px;
    width: 500px; /* Slightly wider for the chat messages container */
    padding: 35px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transform: scale(0.85);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.winner-card-spotlight {
    position: relative;
    background-clip: padding-box !important;
}


#winner-overlay.active .winner-card {
    transform: scale(1);
}

/* Glowing background lines inside card */
.winner-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, var(--theme-shadow-10) 30%, transparent 60%);
    animation: rotate-clockwise 10s linear infinite;
    pointer-events: none;
    z-index: 1;
}

.winner-top-row {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* badge in the centre column → stays centred */
    align-items: center;
    z-index: 10;
}
.winner-top-row > .winner-followage-box { grid-column: 1; justify-self: start; }
.winner-top-row > .winner-badge { grid-column: 2; justify-self: center; }
.winner-top-row > .winner-timer-box { grid-column: 3; justify-self: end; } /* stays top-right even without a badge */

.winner-card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding-top: 45px; /* Pushes content down to perfectly clear the top header row */
}

.winner-badge {
    background: linear-gradient(135deg, var(--neon-red), var(--dark-red));
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    box-shadow: 0 4px 15px var(--theme-shadow-40);
    display: inline-block;
}

.winner-name {
    font-size: 2.8rem;
    font-weight: 900;
    color: white;
    letter-spacing: -0.5px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    word-break: break-all;
    line-height: 1.1;
    margin: 5px 0;
}

.prize-announcement {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Monospace chat terminal log styling */
.winner-chat-log {
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
    max-height: 160px;
    box-shadow: none;
    margin-top: 10px; /* Preserve spacing after hiding 'Letzte Chat-Nachrichten' title label */
}

.chat-log-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chat-log-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    font-size: 0.85rem;
    color: var(--text-main);
    max-height: 110px;
    border-radius: 0;
    padding: 0;
    background: transparent;
    border: none;
    scrollbar-width: none; /* Hide scrollbar in Firefox */
}

/* Hide scrollbar in Chrome, Safari and Opera */
.chat-log-box::-webkit-scrollbar {
    display: none;
}

.chat-bubble-line {
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--neon-red);
    padding: 6px 10px;
    border-radius: 0 6px 6px 0;
    word-break: break-word;
    line-height: 1.35;
}

.chat-bubble-line::-webkit-scrollbar {
    width: 4px;
}

.winner-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
}

/* ==========================================================================
   STREAMER MODE / OBS CAPTURE (COLLAPSES SIDEBAR)
   ========================================================================== */

/* Permanently visible Eye toggle button in the top left */
.streamer-toggle-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(14, 14, 17, 0.8);
    border: 1px solid transparent; /* no contour while sidebar is out; OBS-mode + hover re-add it */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: var(--transition-smooth);
}

.streamer-toggle-btn:hover {
    border-color: var(--neon-red);
    color: var(--neon-red);
    box-shadow: 0 0 15px rgba(255, 0, 60, 0.4);
    transform: scale(1.08);
}

.streamer-mode #sidebar {
    margin-left: -360px;
    opacity: 0;
    pointer-events: none;
}

.streamer-mode .streamer-toggle-btn {
    opacity: 0.35;
    background: rgba(7, 7, 9, 0.3);
    border-color: rgba(255, 255, 255, 0.05);
}

.streamer-mode .streamer-toggle-btn:hover {
    opacity: 1;
    background: rgba(14, 14, 17, 0.85);
    border-color: var(--neon-red);
}

/* ==========================================================================
   COUNTDOWN TIMER/STOPWATCH STYLES
   ========================================================================== */

.winner-timer-box {
    background: rgba(255, 0, 60, 0.08);
    border: 1px solid rgba(255, 0, 60, 0.3);
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--neon-red);
    text-shadow: 0 0 10px rgba(255, 0, 60, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: var(--transition-smooth);
}

.winner-timer-box.warning {
    color: #ff3366;
    border-color: #ff3366;
    background: rgba(255, 0, 85, 0.15);
    animation: pulse-timer 0.5s infinite alternate ease-in-out;
}

.winner-timer-box.confirmed {
    color: var(--theme-confirmed-color, var(--success));
    border-color: var(--theme-confirmed-border, rgba(0, 245, 155, 0.4));
    background: var(--theme-confirmed-bg, rgba(0, 245, 155, 0.12));
    text-shadow: 0 0 10px var(--theme-confirmed-shadow, rgba(0, 245, 155, 0.5));
    animation: pulse-confirmed 1.5s infinite alternate ease-in-out;
}

/* ==========================================================================
   WINNER-OVERLAY ROLE THEMING
   Static replacement for the ~290 lines of CSS that applyWinnerRoleCSS() used
   to inject per winner. The accent is driven by three custom properties set on
   <html> from JS: --winner-accent, --winner-accent-rgb, --winner-close-dark.
   The rules below paint the active color theme; adding `winner-role-colored` to
   <body> swaps in the Sub/VIP/Mod colored badge + redraw-button variant.
   Everything is scoped to body.winner-active, so it only applies while the
   overlay is on screen.
   ========================================================================== */
body.winner-active #winner-overlay-ambient-glow {
    --mouse-glow-bg-color: rgba(var(--winner-accent-rgb), 0.06) !important;
}
body.winner-active #winner-overlay .winner-card {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.85), 0 0 60px rgba(var(--winner-accent-rgb), 0.32), inset 0 0 30px rgba(var(--winner-accent-rgb), 0.15) !important;
    border: none !important;
    --mouse-glow-border-color: rgba(var(--winner-accent-rgb), 0.85) !important;
}
body.winner-active #winner-overlay .winner-card::before {
    background: conic-gradient(from 0deg, transparent, rgba(var(--winner-accent-rgb), 0.1) 30%, transparent 60%) !important;
}
body.winner-active #winner-overlay .winner-badge {
    background: linear-gradient(135deg, var(--winner-accent), rgba(var(--winner-accent-rgb), 0.4)) !important;
    box-shadow: 0 4px 15px rgba(var(--winner-accent-rgb), 0.4) !important;
    color: #ffffff !important;
    text-shadow: none !important;
}
body.winner-active #winner-overlay .winner-name {
    color: var(--winner-accent) !important;
    text-shadow: 0 0 15px rgba(var(--winner-accent-rgb), 0.5) !important;
}
body.winner-active #winner-overlay .winner-timer-box {
    color: var(--winner-accent) !important;
    background: rgba(var(--winner-accent-rgb), 0.08) !important;
    border: 1px solid rgba(var(--winner-accent-rgb), 0.3) !important;
    text-shadow: 0 0 10px rgba(var(--winner-accent-rgb), 0.5) !important;
}
body.winner-active #winner-overlay .winner-timer-box.warning {
    color: #ff3366 !important;
    border-color: #ff3366 !important;
    background: rgba(255, 0, 85, 0.15) !important;
    text-shadow: 0 0 10px rgba(255, 0, 85, 0.5) !important;
}
body.winner-active #winner-overlay .winner-timer-box.confirmed {
    color: var(--winner-accent) !important;
    border-color: rgba(var(--winner-accent-rgb), 0.4) !important;
    background: rgba(var(--winner-accent-rgb), 0.12) !important;
    text-shadow: 0 0 10px rgba(var(--winner-accent-rgb), 0.5) !important;
}
body.winner-active #winner-overlay #winner-redraw-btn {
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: var(--text-main) !important;
    background: transparent !important;
}
body.winner-active #winner-overlay #winner-redraw-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}
body.winner-active #winner-overlay #winner-close-btn {
    background: linear-gradient(135deg, var(--winner-accent), var(--winner-close-dark)) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 20px rgba(var(--winner-accent-rgb), 0.35) !important;
}
body.winner-active #winner-overlay #winner-close-btn:hover {
    box-shadow: 0 6px 25px rgba(var(--winner-accent-rgb), 0.5) !important;
}
body.winner-active #winner-overlay .chat-bubble-line {
    color: var(--winner-accent) !important;
    text-shadow: 0 0 10px rgba(var(--winner-accent-rgb), 0.5) !important;
    /* The left bar inherits the base rule's hardcoded --neon-red; pin it to the
       winner accent so it matches the text (theme color for followers, role color
       for Sub/VIP/Mod) instead of staying red under a non-red color theme. */
    border-left-color: var(--winner-accent) !important;
}
body.winner-active .mouse-glow {
    --mouse-glow-color: rgba(var(--winner-accent-rgb), 0.22) !important;
}

/* Sub/VIP/Mod variant: colored bordered badge + colored redraw button, with a
   slightly stronger card halo and name glow than the default-theme winner. */
body.winner-active.winner-role-colored #winner-overlay .winner-card::before {
    background: conic-gradient(from 0deg, transparent, rgba(var(--winner-accent-rgb), 0.15) 30%, transparent 60%) !important;
}
body.winner-active.winner-role-colored #winner-overlay .winner-badge {
    background: rgba(16, 16, 19, 0.6) !important;
    border: 1.5px solid var(--winner-accent) !important;
    color: var(--winner-accent) !important;
    box-shadow: 0 4px 15px rgba(var(--winner-accent-rgb), 0.25) !important;
    text-shadow: 0 0 8px rgba(var(--winner-accent-rgb), 0.5) !important;
}
body.winner-active.winner-role-colored #winner-overlay .winner-name {
    text-shadow: 0 0 15px rgba(var(--winner-accent-rgb), 0.6) !important;
}
body.winner-active.winner-role-colored #winner-overlay #winner-redraw-btn {
    border: 1px solid rgba(var(--winner-accent-rgb), 0.3) !important;
    color: var(--winner-accent) !important;
    background: rgba(var(--winner-accent-rgb), 0.04) !important;
}
body.winner-active.winner-role-colored #winner-overlay #winner-redraw-btn:hover {
    background: rgba(var(--winner-accent-rgb), 0.12) !important;
    border-color: var(--winner-accent) !important;
    box-shadow: 0 0 12px rgba(var(--winner-accent-rgb), 0.25) !important;
}

#winner-overlay .winner-followage-box {
    background: rgba(0, 0, 0, 0.4) !important; /* Deep embedded glass well */
    border: 1px solid rgba(255, 255, 255, 0.08) !important; /* Fine premium outline */
    padding: 6px 14px !important; /* Return pill padding */
    border-radius: 20px !important; /* capsule shape */
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: 1.1rem;
    color: #ffffff !important; /* Elegant white text */
    text-shadow: none !important;
    box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.85), inset 0 -1px 2px rgba(255, 255, 255, 0.04) !important; /* Luxury sunken 3D well */
    transition: var(--transition-smooth);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

@keyframes pulse-timer {
    0% {
        transform: scale(1);
        box-shadow: 0 0 5px rgba(255, 0, 60, 0.3);
    }
    100% {
        transform: scale(1.08);
        box-shadow: 0 0 20px rgba(255, 0, 60, 0.7);
    }
}

@keyframes pulse-confirmed {
    0% {
        transform: scale(1);
        box-shadow: 0 0 5px var(--theme-confirmed-shadow-02, rgba(0, 245, 155, 0.2));
    }
    100% {
        transform: scale(1.05);
        box-shadow: 0 0 20px var(--theme-confirmed-shadow-05, rgba(0, 245, 155, 0.5));
    }
}

/* ==========================================================================
   PARTICIPANTS MANAGEMENT MODAL STYLES
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 4, 6, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-card {
    position: relative;
    background: linear-gradient(180deg, #101013 0%, #060608 100%);
    border: 1px solid rgba(255, 255, 255, 0.08); /* hairline instead of the heavy 2px neon ring */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(var(--theme-rgb, 255, 0, 60), 0.06);
    border-radius: 18px;
    width: 580px;
    max-height: 85vh;
    padding: 26px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Hairline theme accent inset along the top edge — subtle premium detail (fades out at the
   ends so it never sticks past the rounded corners; no overflow:hidden needed). */
.modal-card::before {
    content: '';
    position: absolute;
    top: 0; left: 16px; right: 16px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--theme-rgb, 255, 0, 60), 0.55), transparent);
    pointer-events: none;
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding-bottom: 14px;
}

.modal-header-titles {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

/* Live participant summary under the title: "N Teilnehmer · M aktiv · K pausiert" */
.modal-subcount {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.modal-subcount:empty { display: none; }

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-shimmer-title {
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    background: linear-gradient(120deg, #ffffff 0%, var(--neon-red) 35%, #ffffff 70%, var(--neon-red) 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: logo-shimmer 6s ease-in-out infinite;
    display: inline-block;
}

.modal-close-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
}

.modal-close-btn:hover {
    color: var(--neon-red);
    border-color: rgba(var(--theme-rgb, 255, 0, 60), 0.4);
    background: rgba(var(--theme-rgb, 255, 0, 60), 0.08);
}

.modal-search-bar {
    position: relative;
    flex: 1;
    min-width: 0;
}

.modal-search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition-smooth);
}

.modal-search-bar input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 11px 14px 11px 40px;
    color: var(--text-main);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.modal-search-bar input:focus {
    outline: none;
    border-color: var(--neon-red);
    box-shadow: 0 0 0 3px rgba(255, 0, 60, 0.1);
}

.modal-search-bar:focus-within .modal-search-icon {
    color: var(--neon-red);
}

/* Search + filter button share one row; the filter options open in a popover. */
.modal-search-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.modal-filter-wrap {
    position: relative;
    flex-shrink: 0;
    display: flex; /* lets the button stretch to the search field's height */
}

.modal-filter-btn {
    position: relative;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.modal-filter-btn:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
}

.modal-filter-btn.active {
    color: var(--neon-red);
    border-color: var(--neon-red);
    background: rgba(255, 0, 60, 0.08);
}

/* Dot on the button while ≥1 filter is active. */
.modal-filter-dot {
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--neon-red);
    box-shadow: 0 0 6px rgba(255, 0, 60, 0.7);
}

.modal-filter-btn.has-active .modal-filter-dot {
    display: block;
}

.modal-filter-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    width: 260px;
    padding: 12px;
    background: #15151b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
    display: none;
}

.modal-filter-popover.open {
    display: block;
}

.modal-filter-popover-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 9px;
}

/* Additive (OR) category filters, laid out as a vertical menu inside the popover.
   Each chip carries its own --chip-accent (matched to the badge palette); selecting
   several widens the result set. */
.modal-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.modal-filter-chip {
    --chip-accent: 255, 255, 255;
    display: flex;
    width: 100%;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    border-radius: 9px;
    font-family: var(--font-primary);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: var(--transition-smooth);
    white-space: nowrap;
    text-align: left;
}

/* Leading category dot. */
.modal-filter-chip::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgb(var(--chip-accent));
    flex-shrink: 0;
}

.modal-filter-chip:hover {
    color: var(--text-main);
    border-color: rgba(var(--chip-accent), 0.45);
    background: rgba(var(--chip-accent), 0.06);
}

.modal-filter-chip.active {
    color: rgb(var(--chip-accent));
    border-color: rgba(var(--chip-accent), 0.6);
    background: rgba(var(--chip-accent), 0.14);
    box-shadow: 0 0 12px rgba(var(--chip-accent), 0.18);
}

.modal-filter-count {
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0.7;
    margin-left: auto;
}

.modal-filter-count:empty { display: none; }

.modal-filter-chip[data-filter="winners"]  { --chip-accent: 169, 112, 255; }
.modal-filter-chip[data-filter="alts"]      { --chip-accent: 255, 138, 60; }
.modal-filter-chip[data-filter="follower"]  { --chip-accent: 255, 51, 102; }
.modal-filter-chip[data-filter="nonfollower"] { --chip-accent: 150, 152, 162; }
.modal-filter-chip[data-filter="sub"]       { --chip-accent: 255, 234, 0; }
.modal-filter-chip[data-filter="vip"]       { --chip-accent: 255, 0, 127; }
.modal-filter-chip[data-filter="mod"]       { --chip-accent: 57, 255, 20; }

.modal-users-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    max-height: 360px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.modal-users-grid::-webkit-scrollbar {
    width: 8px;
}

.modal-users-grid::-webkit-scrollbar-track {
    background: transparent;
}

.modal-users-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.modal-users-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
    background-clip: padding-box;
}

.modal-user-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: var(--transition-smooth);
}

.modal-user-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.07);
}

/* Per-row avatar (initial), coloured in the participant's colour via --row-accent —
   same design language as the winner-card avatars (.mp-pc-avatar). Initials only, no
   network fetch (the list can hold hundreds of rows). */
.modal-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0c0c0f;
    border: 1.5px solid var(--row-accent, var(--neon-red));
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    font-family: var(--font-primary);
    font-size: 0.82rem;
    font-weight: 900;
    color: var(--row-accent, var(--neon-red));
    text-transform: uppercase;
    user-select: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

/* Click the avatar to activate/deactivate the participant (replaces the row toggle). */
.modal-user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18), 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Deactivated → dark grey avatar (initial + border) to match the name. */
.modal-user-row.paused .modal-user-avatar {
    color: #5c5c64;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

/* Name + follow-age stacked, so the age sits as a quiet sub-line instead of being
   squeezed in beside the name. */
.modal-user-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.modal-user-row.paused {
    background: rgba(0, 0, 0, 0.3);
}

/* Deactivated → dark grey name, no strikethrough. */
.modal-user-row.paused .modal-user-name {
    color: #5c5c64;
}

/* Mute the badges + follow-age so the whole row reads as deactivated. */
.modal-user-row.paused .modal-user-badge,
.modal-user-row.paused .modal-user-badge-follow,
.modal-user-row.paused .modal-user-followage {
    opacity: 0.45;
}

/* Deactivated suspicious user → fade the ⚠ warning symbol too (filter, since its
   flicker animation drives opacity and would override a static opacity). */
.modal-user-row.paused .alt-warning-badge {
    filter: opacity(0.5);
}

.modal-user-row.non-follower {
    background: rgba(100, 100, 100, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
}

.modal-user-row.non-follower:hover {
    background: rgba(100, 100, 100, 0.12) !important;
}

.modal-user-row.alt-flagged {
    border-color: rgba(255, 215, 0, 0.35) !important;
    background: rgba(255, 215, 0, 0.04) !important;
    box-shadow: inset 0 0 10px rgba(255, 215, 0, 0.03) !important;
}

.modal-user-row.alt-flagged:hover {
    background: rgba(255, 215, 0, 0.07) !important;
    border-color: rgba(255, 215, 0, 0.55) !important;
    box-shadow: inset 0 0 15px rgba(255, 215, 0, 0.06), 0 0 12px rgba(255, 215, 0, 0.10) !important;
}

.alt-warning-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
    font-size: 0.95rem;
    margin-left: 6px;
    animation: warning-flicker 4s infinite alternate ease-in-out;
}

@keyframes warning-flicker {
    0%, 100% {
        opacity: 0.85;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.08);
        text-shadow: 0 0 12px rgba(255, 215, 0, 0.9);
    }
}

.alt-tooltip {
    position: fixed;
    background: #111114;
    border: 1px solid rgba(255, 215, 0, 0.45);
    color: #ffd700;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7), 0 0 12px rgba(255, 215, 0, 0.08);
    transform: translateX(-50%) translateY(-100%);
    max-width: 300px;
    white-space: normal;
}

.alt-tooltip.visible {
    opacity: 1;
}

.alt-tooltip div + div {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 215, 0, 0.15);
}

.modal-user-badge-follow {
    font-size: 0.95rem;
    line-height: 1;
    user-select: none;
    color: var(--neon-red); /* text heart ❤ in the theme colour, like the winner-card heart */
}

.modal-user-name {
    font-weight: 600;
    font-size: 0.95rem;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
    color: var(--row-name-color, var(--neon-red));
}

/* Holographic shimmer for role names (Mods/Subs/VIPs): a white sheen sweeps across the
   role colour — same language as the app's other holographic titles. */
.modal-user-name--holo {
    background: linear-gradient(110deg, var(--row-name-color) 0%, #ffffff 35%, var(--row-name-color) 60%, #ffffff 85%, var(--row-name-color) 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: logo-shimmer 4.5s ease-in-out infinite;
}

/* Deactivated → drop the shimmer, solid dark grey (matches the other paused names). */
.modal-user-row.paused .modal-user-name--holo {
    background: none;
    -webkit-text-fill-color: #5c5c64;
    animation: none;
}

/* MacherModus (perf mode): no ambient animation → solid role colour. */
/* MacherModus off: keep the gradient (static Verlauf), just stop the animation. */
.performance-mode .modal-user-name--holo {
    animation: none;
    background-position: 50% 50%;
}

/* Live follow duration shown next to each name in the participant modal,
   kept current by the rolling DecAPI refresh. Muted so it never competes with
   the name; empty (no text) for bots, the broadcaster, and non-followers. */
.modal-user-followage {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    letter-spacing: 0.2px;
    opacity: 0.85;
}

.modal-user-followage:empty { display: none; }

/* Fixed-width slot so every status icon lines up in one column across rows. A non-follower
   without a role gets an empty slot (no icon, but the ✕ stays aligned). */
.modal-user-icon {
    width: 26px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Frameless coloured glyph (no pill) — uniform with the heart + the winner-card badges. */
.modal-user-badge {
    font-size: 1rem;
    line-height: 1;
    font-weight: 700;
}

.modal-user-badge.owner { color: #ff003c; text-shadow: 0 0 7px rgba(255, 0, 60, 0.55); }
.modal-user-badge.mod { color: #39ff14; text-shadow: 0 0 7px rgba(57, 255, 20, 0.55); }
.modal-user-badge.sub { color: #ffea00; text-shadow: 0 0 7px rgba(255, 234, 0, 0.55); }
.modal-user-badge.vip { color: #ff007f; text-shadow: 0 0 7px rgba(255, 0, 127, 0.55); }

/* icedout: Diamant-Blau + gelegentlicher Funkel-Stern am Icon. */
.modal-user-badge.iced {
    color: #38bdf8;
    text-shadow: 0 0 7px rgba(56, 189, 248, 0.6);
    position: relative;
}
.modal-user-badge.iced::after {
    content: '✦';
    position: absolute;
    top: -5px;
    right: -6px;
    font-size: 9px;
    color: #eaf7ff;
    text-shadow: 0 0 6px #38bdf8, 0 0 10px #38bdf8;
    opacity: 0;
    pointer-events: none;
    animation: mg-twinkle 3.6s ease-in-out infinite;
}
.performance-mode .modal-user-badge.iced::after { animation: none; opacity: 0; }

/* Owner (MACHER): gleiches Funkeln in Rot am Icon. */
.modal-user-badge.owner { position: relative; }
.modal-user-badge.owner::after {
    content: '✦';
    position: absolute;
    top: -5px;
    right: -6px;
    font-size: 9px;
    color: #ffffff;
    text-shadow: 0 0 6px #ff003c, 0 0 10px #ff003c;
    opacity: 0;
    pointer-events: none;
    animation: mg-twinkle 3.6s ease-in-out infinite;
}
.performance-mode .modal-user-badge.owner::after { animation: none; opacity: 0; }

/* Gelegentliches Diamant-Funkeln (geteilt von Icon + Karten): nur kurz sichtbar pro Zyklus. */
@keyframes mg-twinkle {
    0%, 72%, 100% { opacity: 0; transform: scale(0.2) rotate(0deg); }
    80%           { opacity: 1; transform: scale(1.15) rotate(40deg); }
    88%           { opacity: 0; transform: scale(0.35) rotate(80deg); }
}

.modal-user-badge.mod-unfollowed,
.modal-user-badge.sub-unfollowed,
.modal-user-badge.vip-unfollowed {
    color: rgba(255, 255, 255, 0.28);
    text-shadow: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.modal-user-badge.mod-unfollowed:hover,
.modal-user-badge.sub-unfollowed:hover,
.modal-user-badge.vip-unfollowed:hover {
    color: rgba(255, 255, 255, 0.85);
    transform: scale(1.15);
}

.modal-user-remove {
    background: transparent;
    border: none;
    color: #ff3366;
    cursor: pointer;
    font-size: 1.05rem;
    opacity: 0.55;
    transition: var(--transition-smooth);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-user-remove:hover {
    opacity: 1;
    transform: scale(1.15);
}

.modal-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 16px;
    margin-top: 4px;
}

/* Bulk action buttons — two side by side, equal width. */
.modal-bulk-btn {
    flex: 1;
    text-align: center;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.82rem;
    padding: 9px 16px;
    border-radius: 9px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.modal-bulk-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

/* "Alle pausieren" — the configured theme/custom colour (from settings). */
.modal-bulk-btn--custom {
    color: var(--neon-red);
    border-color: rgba(var(--theme-rgb, 255, 0, 60), 0.4);
    background: rgba(var(--theme-rgb, 255, 0, 60), 0.08);
}

.modal-bulk-btn--custom:hover {
    background: rgba(var(--theme-rgb, 255, 0, 60), 0.16);
    border-color: rgba(var(--theme-rgb, 255, 0, 60), 0.6);
}

/* Empty-state when no participants match the search (replaces an inline-styled div). */
.modal-empty-state {
    padding: 28px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.modal-empty-state svg { opacity: 0.45; }

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */

@keyframes gentle-float {
    0% { margin-top: 0px; }
    50% { margin-top: -8px; }
    100% { margin-top: 0px; }
}

@keyframes radar-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(2.0);
        opacity: 0;
    }
}

@keyframes rotate-clockwise {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   FLOATING PARTICIPANTS AND HORIZONTAL ARENA CONTAINERS
   ========================================================================== */

/* Floating participants manager button in the top right */
.participants-floating-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    height: 44px;
    padding: 0 16px;
    border-radius: 22px;
    background: rgba(14, 14, 17, 0.8);
    border: 1px solid transparent; /* no contour while sidebar is out; OBS-mode + hover re-add it */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: var(--transition-smooth);
}

.participants-floating-btn:hover {
    border-color: var(--neon-red);
    color: var(--neon-red);
    box-shadow: 0 0 15px rgba(255, 0, 60, 0.4);
    transform: scale(1.04);
}

.participants-floating-btn.alt-alert {
    animation: alt-btn-pulse 2.2s ease-in-out infinite;
}

.participants-floating-btn.alt-alert:hover {
    border-color: #ffd700;
    color: #ffd700;
    box-shadow: 0 0 24px rgba(255, 215, 0, 0.7);
}

@keyframes alt-btn-pulse {
    0%, 100% {
        border-color: rgba(255, 215, 0, 0.2);
        color: rgba(255, 215, 0, 0.4);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
        opacity: 0.6;
    }
    50% {
        border-color: #ffd700;
        color: #ffd700;
        box-shadow: 0 0 28px rgba(255, 215, 0, 0.9), 0 0 50px rgba(255, 215, 0, 0.3);
        opacity: 1.0;
    }
}

.streamer-mode .participants-floating-btn {
    opacity: 0.35;
    background: rgba(7, 7, 9, 0.3);
    border-color: rgba(255, 255, 255, 0.05);
}

.streamer-mode .participants-floating-btn:hover {
    opacity: 1;
    background: rgba(14, 14, 17, 0.85);
    border-color: var(--neon-red);
}

/* Active Keyword Display (Dynamically centered vertically inside the top gap) */
.keyword-display-container {
    grid-row: 1; /* Placed in top grid cell */
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 8px 18px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 3;
    transition: opacity 0.4s ease; /* Smooth fade transitions when window is small */
}

#keyword-bold-text {
    font-weight: 900;
    color: var(--neon-red);
    font-size: 0.95rem;
    letter-spacing: 1px;
    margin-left: 4px;
    text-shadow: 0 0 10px rgba(255, 0, 60, 0.4);
}

/* Vertical Past Winners Display (Dynamically centered vertically inside the bottom gap) */
.past-winners-display-container {
    grid-row: 3; /* Placed in bottom grid cell */
    width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 3;
    opacity: 1;
    transition: opacity 0.3s ease; /* Smooth fade transitions */
}

.winners-title {
    font-family: var(--font-primary);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--neon-red);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255, 0, 60, 0.2);
}

.winners-row {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 84px; /* Perfectly fits exactly 3 vertical names + gaps */
    overflow-y: auto;
    overflow-x: hidden !important;
    padding: 2px;
    position: relative;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 0) 100%);
    -ms-overflow-style: none !important;  /* IE and Edge */
    scrollbar-width: none !important;  /* Firefox */
}

/* Bulletproof scrollbar hiding across all WebKit browsers */
.winners-row::-webkit-scrollbar,
#arena-past-winners-list::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

.winners-row::-webkit-scrollbar-thumb,
#arena-past-winners-list::-webkit-scrollbar-thumb,
.winners-row::-webkit-scrollbar-track,
#arena-past-winners-list::-webkit-scrollbar-track {
    display: none !important;
    background: transparent !important;
}

.no-winners-placeholder {
    font-family: var(--font-primary);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 8px;
}

/* SLEEK borderless vertical stacked names (Non-removable) */
.winner-stack-item {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 2px 0;
    width: auto;
    text-align: center;
    animation: badge-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: var(--transition-smooth);
}

.winner-stack-item:hover {
    transform: scale(1.05);
}

.winner-stack-name {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

@keyframes badge-pop {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Premium circular floating sound button in the bottom-left of the sidebar */
.sound-toggle-btn {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(14, 14, 17, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: var(--transition-smooth);
}

/* Dynamic Volume Contour Ring */
.sound-toggle-btn::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 50%;
    background: linear-gradient(
        to top,
        var(--neon-red) var(--volume-percent, 100%),
        transparent var(--volume-percent, 100%)
    );
    pointer-events: none;
    z-index: 5;
    -webkit-mask-image: radial-gradient(circle, transparent 20px, black 21px);
    mask-image: radial-gradient(circle, transparent 20px, black 21px);
    transition: opacity 0.3s ease;
    opacity: 0; /* Hidden by default, only visible on hover */
}

.sound-toggle-btn:hover::before {
    opacity: 1;
}

.sound-toggle-btn:hover {
    z-index: 300; /* Stacks above leaderboard and other buttons when active! */
    border-color: transparent !important; /* Hide button border on hover to prevent subpixel double border halo! */
    color: var(--neon-red);
    box-shadow: 0 0 15px rgba(255, 0, 60, 0.3);
    transform: scale(1.08);
}

.sound-toggle-btn.muted {
    opacity: 0.55;
    color: var(--text-muted);
    background: rgba(7, 7, 9, 0.4);
    border-color: rgba(255, 255, 255, 0.05);
}

.sound-toggle-btn.muted::before {
    opacity: 0;
}

.sound-toggle-btn.muted:hover {
    opacity: 1;
    color: var(--neon-red);
    border-color: var(--neon-red);
}

/* Premium circular floating settings button in the bottom-right of the sidebar */
.settings-toggle-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(14, 14, 17, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08); /* neutral, like the sound button (no theme-coloured ring) */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: var(--transition-smooth);
}

.settings-toggle-btn:hover {
    border-color: var(--neon-red); /* red contour on hover */
    color: var(--neon-red);
    box-shadow: 0 0 15px rgba(255, 0, 60, 0.3);
    transform: scale(1.08);
}

/* Premium Color Theme Selector Styles */
.theme-selector-row {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 6px 0;
}

.theme-color-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: var(--transition-smooth);
    position: relative;
    box-sizing: border-box;
}

.theme-color-dot:hover {
    transform: scale(1.2);
    border-color: rgba(255, 255, 255, 0.6);
}

.theme-color-dot.active {
    transform: scale(1.15);
    border-color: #ffffff;
    box-shadow: 0 0 12px currentColor;
}

/* Premium circular floating leaderboard button in the bottom-middle of the sidebar */
.leaderboard-toggle-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(14, 14, 17, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08); /* neutral, like the sound button (no theme-coloured ring) */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: var(--transition-smooth);
}

.leaderboard-toggle-btn:hover {
    border-color: transparent; /* no coloured ring on hover either — match the sound button */
    color: var(--neon-red);
    box-shadow: 0 0 15px rgba(255, 0, 60, 0.3);
    transform: translateX(-50%) scale(1.08);
}

/* Leaderboard List Row Styling */
.leaderboard-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 14px;
    border-radius: 8px;
    transition: var(--transition-smooth);
}

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

/* Subtle scrollbar that blends into the dark background (matches the participant list). */
.leaderboard-list { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.12) transparent; }
.leaderboard-list::-webkit-scrollbar { width: 8px; }
.leaderboard-list::-webkit-scrollbar-track { background: transparent; }
.leaderboard-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 4px; border: 2px solid transparent; background-clip: padding-box; }
.leaderboard-list::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); background-clip: padding-box; }

.lb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lb-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.lb-rank {
    width: 26px; height: 26px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-primary); font-weight: 900; font-size: 0.82rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.lb-name {
    font-weight: 700; font-size: 0.95rem; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.lb-wins { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; min-width: 58px; text-align: right; }
.lb-role { width: 22px; flex-shrink: 0; text-align: center; font-size: 1.05rem; font-weight: 700; line-height: 1; }

/* Podium placements: 1st gold, 2nd silver, 3rd bronze — rank chip + row tint + holo foil. */
.leaderboard-row.lb-gold   { --lb-accent: #ffd700; --lb-accent-rgb: 255, 215, 0;   position: relative; border-color: rgba(255, 215, 0, 0.4); background: rgba(255, 215, 0, 0.06); }
.leaderboard-row.lb-gold .lb-rank {
    color: #ffd700; background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.55); box-shadow: 0 0 10px rgba(255, 215, 0, 0.25);
}
.leaderboard-row.lb-silver { --lb-accent: #cdd3da; --lb-accent-rgb: 205, 211, 218; position: relative; border-color: rgba(205, 211, 218, 0.35); background: rgba(205, 211, 218, 0.05); }
.leaderboard-row.lb-silver .lb-rank {
    color: #cdd3da; background: rgba(205, 211, 218, 0.15); border-color: rgba(205, 211, 218, 0.45);
}
.leaderboard-row.lb-bronze { --lb-accent: #cd7f32; --lb-accent-rgb: 205, 127, 50; position: relative; border-color: rgba(205, 127, 50, 0.4); background: rgba(205, 127, 50, 0.07); }
.leaderboard-row.lb-bronze .lb-rank {
    color: #cd7f32; background: rgba(205, 127, 50, 0.16); border-color: rgba(205, 127, 50, 0.5);
}

/* Top 3 → a holographic foil sheen sweeping across the row background, like the Ticker's
   privileged Sub/VIP/Mod cards: a coloured + white diagonal sweep in the placement colour. */
.leaderboard-row.lb-gold::before,
.leaderboard-row.lb-silver::before,
.leaderboard-row.lb-bronze::before {
    content: '';
    position: absolute; inset: 0; border-radius: inherit; z-index: 0; pointer-events: none;
    background: linear-gradient(110deg,
        transparent 20%,
        rgba(var(--lb-accent-rgb), 0.30) 42%,
        rgba(255, 255, 255, 0.30) 50%,
        rgba(var(--lb-accent-rgb), 0.30) 58%,
        transparent 80%);
    background-size: 250% 100%;
    animation: logo-shimmer 8s ease-in-out infinite;
}
/* Stagger the sheen between the three places so they shimmer slightly out of sync. */
.leaderboard-row.lb-silver::before { animation-delay: -2.7s; }
.leaderboard-row.lb-bronze::before { animation-delay: -5.3s; }
/* Keep the row content above the sheen. */
.leaderboard-row.lb-gold .lb-left,   .leaderboard-row.lb-gold .lb-right,
.leaderboard-row.lb-silver .lb-left, .leaderboard-row.lb-silver .lb-right,
.leaderboard-row.lb-bronze .lb-left, .leaderboard-row.lb-bronze .lb-right { position: relative; z-index: 1; }

/* Holographic shimmer on the name in the placement colour. */
.leaderboard-row.lb-gold .lb-name,
.leaderboard-row.lb-silver .lb-name,
.leaderboard-row.lb-bronze .lb-name {
    background: linear-gradient(110deg, var(--lb-accent) 0%, #ffffff 38%, var(--lb-accent) 62%, #ffffff 88%, var(--lb-accent) 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    animation: logo-shimmer 7.5s ease-in-out infinite;
}
.leaderboard-row.lb-silver .lb-name { animation-delay: -2.5s; }
.leaderboard-row.lb-bronze .lb-name { animation-delay: -5s; }
.performance-mode .leaderboard-row .lb-name { animation: none; background-position: 50% 50%; }
.performance-mode .leaderboard-row::before { animation: none; background-position: 50% 50%; }

/* Hide number input spin-buttons (up/down arrows) globally for clean input styling */
input[type="number"]::-webkit-inner-spin-button, 
input[type="number"]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
}

/* Smoothly fade out Past Winners list if vertical screen space is extremely narrow to avoid colliding with the wheel */
@media (max-height: 580px) {
    .past-winners-display-container {
        opacity: 0;
        pointer-events: none;
    }
}

/* Smoothly fade out Active Keyword Display if vertical screen space is extremely narrow */
@media (max-height: 500px) {
    .keyword-display-container {
        opacity: 0;
        pointer-events: none;
    }
}

/* Custom class for flex titles inside modals to align emojis and shimmers */
.modal-title-flex {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Dynamic trailing mouse spotlight glow */
.mouse-glow {
    position: fixed;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--mouse-glow-color) 0%, transparent 75%);
    filter: blur(100px);
    -webkit-filter: blur(100px);
    pointer-events: none;
    z-index: 9999; /* Kept on top of all elements so it blends dynamically with all canvas and layout layers */
    left: 0;
    top: 0;
    mix-blend-mode: screen;
    opacity: 0; /* Hidden by default until mouse moves to prevent top-left popup */
    transform: translate3d(-1000px, -1000px, 0) translate(-50%, -50%);
    transition: transform 0.16s cubic-bezier(0.1, 0.6, 0.2, 1), opacity 0.5s ease;
}

/* Premium border spotlight hover effect */
.spotlight-hover {
    position: relative;
    background-clip: padding-box !important;
    --border-width: 2px; /* Default border thickness matched to cards */
}

.spotlight-hover::after {
    content: '';
    position: absolute;
    /* Position exactly on top of the parent border boundary by offsetting by border width */
    top: calc(-1 * var(--border-width));
    left: calc(-1 * var(--border-width));
    right: calc(-1 * var(--border-width));
    bottom: calc(-1 * var(--border-width));
    border-radius: inherit;
    padding: var(--border-width); /* Border thickness matched perfectly */
    background: radial-gradient(
        220px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
        var(--mouse-glow-border-color, rgba(255, 0, 60, 0.45)) 0%,
        transparent 70%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    opacity: var(--spotlight-opacity, 0); /* Dynamically bound to proximity easing loop in JS */
    z-index: 10; /* Keep it above standard container content but below clicks */
}

/* Specific border width overrides for 1px bordered frames */
#sidebar,
.center-logo-container {
    --border-width: 1px;
}
/* Override positioning for #sidebar to prevent browser clipping due to overflow: hidden */
#sidebar::after {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    padding: 1px !important;
}
/* Override positioning for .winner-card to prevent browser clipping due to overflow: hidden */
.winner-card::after {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    padding: 2px !important;
}
.keyword-display-container {
    --border-width: 1px;
}
#ticker-container {
    --border-width: 1px;
}

/* =========================================================================
   PREMIUM HOLOGRAPHIC SHIMMER & FLUID BACKGROUND MESH GLOWS
   ========================================================================= */

/* Holographic gloss sweep for the winner-card badge (the participant-list glyphs are
   frameless, so they get no sweep). */
.winner-badge {
    position: relative;
    overflow: hidden;
}

.winner-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.28) 50%,
        transparent
    );
    transform: skewX(-25deg);
    animation: holo-shine 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes holo-shine {
    0% { left: -150%; }
    15% { left: 150%; }
    100% { left: 150%; }
}

/* Ethereal Background Mesh Gradients (Fluid Dynamic Glow) */
.mesh-background-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.75;
}

.mesh-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(65px); /* Reduced from 120px to save significant GPU fillrate */
    -webkit-filter: blur(65px);
    mix-blend-mode: screen;
    opacity: 0.11;
    will-change: transform; /* Promotes element to a dedicated GPU composited layer */
    transition: background-image 1.0s ease, opacity 1.0s ease;
}

/* Core blobs themed matching standard Neon Red but reacts dynamically to theme variables! */
.blob-1 {
    top: -10%;
    left: 20%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--neon-red, #ff003c) 0%, transparent 85%); /* Softer transparent stop to preserve ethereal look */
    animation: float-blob-1 25s ease-in-out infinite alternate;
}

.blob-2 {
    bottom: -15%;
    right: 15%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--neon-red, #ff003c) 0%, transparent 85%);
    animation: float-blob-2 30s ease-in-out infinite alternate;
}

.blob-3 {
    top: 40%;
    left: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, var(--neon-red, #ff003c) 40%, transparent 85%);
    animation: float-blob-3 20s ease-in-out infinite alternate;
}

@keyframes float-blob-1 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(8%, 12%, 0) scale(1.12); }
    100% { transform: translate3d(-5%, -5%, 0) scale(0.95); }
}

@keyframes float-blob-2 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-10%, -8%, 0) scale(0.9); }
    100% { transform: translate3d(5%, 15%, 0) scale(1.08); }
}

@keyframes float-blob-3 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(12%, -10%, 0) scale(1.15); }
    100% { transform: translate3d(-10%, 10%, 0) scale(0.85); }
}

/* Blur and disable floating capture/management buttons when the winner overlay is active */
body.winner-active .streamer-toggle-btn,
body.winner-active .participants-floating-btn {
    filter: blur(6px) !important;
    pointer-events: none !important;
    opacity: 0.12 !important;
    box-shadow: none !important;
    transition: filter 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Performance Mode (Energy-Saving Modus) Overrides to cut off expensive ambient rendering.
   The canvas renderers (wheel/ticker/particles) read window.__perfMode to skip their own
   heavy effects. */
.performance-mode .mesh-background-glow {
    display: none !important;
}
.performance-mode .mouse-glow {
    opacity: 0 !important;
    pointer-events: none !important;
}
.performance-mode .radar-ring {
    display: none !important;
}
.performance-mode .spotlight-hover:not(#performance-mode-toggle-btn)::after {
    display: none !important;
}
/* Stop the continuously running ambient keyframe animations */
.performance-mode .modal-shimmer-title,
.performance-mode .logo-section h1,
.performance-mode .center-logo-container,
.performance-mode .keyword-display-container {
    animation: none !important;
}

/* ==========================================================================
   SOUND MIXER (Einstellungen) + MASTER VOLUME FLYOUT (Sidebar sound icon)
   ========================================================================== */

.sound-mixer {
    display: flex;
    flex-direction: column;
    gap: 11px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 13px 15px;
}

.mixer-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mixer-label {
    font-size: 0.8rem;
    color: #fff;
    font-weight: 700;
    min-width: 108px;
    white-space: nowrap;
}

/* Shared slider styling for mixer + master volume */
.mixer-slider,
#master-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

#master-volume-slider {
    height: 8px !important;
    border-radius: 4px !important;
}

.mixer-slider:hover,
#master-volume-slider:hover {
    background: rgba(255, 255, 255, 0.18);
}

.mixer-slider::-webkit-slider-thumb,
#master-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--neon-red);
    box-shadow: 0 0 8px var(--theme-shadow-40, rgba(255, 0, 60, 0.4));
    cursor: pointer;
    transition: transform 0.15s ease;
}

#master-volume-slider::-webkit-slider-thumb {
    width: 20px !important;
    height: 20px !important;
    box-shadow: 0 0 10px var(--theme-shadow-40, rgba(255, 0, 60, 0.45)) !important;
}

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

.mixer-slider::-moz-range-thumb,
#master-volume-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border: none;
    border-radius: 50%;
    background: var(--neon-red);
    box-shadow: 0 0 8px var(--theme-shadow-40, rgba(255, 0, 60, 0.4));
    cursor: pointer;
}

#master-volume-slider::-moz-range-thumb {
    width: 20px !important;
    height: 20px !important;
}

/* Master volume flyout rechts neben dem Sidebar Sound-Button platziert */
.sound-master-flyout {
    position: absolute;
    top: 50%;
    left: calc(100% + 12px);
    width: 250px; /* Länge um das Einstellungsicon abzudecken */
    background: rgba(16, 16, 19, 0.97);
    border: 1px solid var(--border-color, rgba(255, 0, 60, 0.2));
    border-radius: 14px;
    padding: 16px 18px; /* Erhöhte Tiefe / Polsterung */
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 18px var(--theme-shadow-10, rgba(255, 0, 60, 0.1));
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 200;
    cursor: default;
}

/* Unsichtbare Brücke links, damit Hover beim Rüberbewegen nicht abbricht */
.sound-master-flyout::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 0;
    bottom: 0;
    width: 12px;
    height: auto;
}

.sound-toggle-btn:hover .sound-master-flyout {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
}

.flyout-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.flyout-value {
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    min-width: 34px;
    text-align: right;
    flex-shrink: 0;
}

/* Premium clickable MacherModus button next to Farbschema */
.macher-mode-label {
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.9rem; /* Größere Schrift */
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    user-select: none;
    transition: border-color 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 8px 16px; /* Mehr Polsterung */
    border-radius: 8px; /* Größerer Radius */
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    outline: none;
    display: inline-block;
}

.macher-mode-label:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

/* When active, it has the theme color border and glow */
.macher-mode-label.active {
    color: white;
    border-color: var(--neon-red);
    background: rgba(var(--theme-rgb, 255, 0, 60), 0.08);
    box-shadow: 0 0 10px var(--theme-shadow-40);
}

/* Shimmer animation decoupled from font-size.
   NOTE: use background-IMAGE (not the `background` shorthand) so we don't also force
   background-position:0% with !important — that would beat the logo-shimmer keyframe
   (which animates background-position) and leave the gradient frozen/static. */
.shimmer-text {
    background-image: linear-gradient(120deg, #ffffff 0%, var(--neon-red) 35%, #ffffff 70%, var(--neon-red) 100%) !important;
    background-size: 300% 100% !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    animation: logo-shimmer 6s ease-in-out infinite !important;
    display: inline-block !important;
}

/* Bulletproof direct rule for the Machermodus active text.
   background-IMAGE (not shorthand) so the animated background-position isn't pinned. */
.macher-mode-label.active .macher-text {
    background-image: linear-gradient(120deg, #ffffff 0%, var(--neon-red) 35%, #ffffff 70%, var(--neon-red) 100%) !important;
    background-size: 300% 100% !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    animation: logo-shimmer 6s ease-in-out infinite !important;
    display: inline-block !important;
}

/* Ensure modal-shimmer-title class inherits typography when used on the Machermodus button */
.macher-mode-label .modal-shimmer-title {
    font-size: inherit !important;
    font-weight: inherit !important;
    text-transform: inherit !important;
    letter-spacing: inherit !important;
}

/* Disabled/Faded in energy-saving mode */
.performance-mode .shimmer-text,
.performance-mode .macher-mode-label.active .macher-text {
    animation: none !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
    color: inherit !important;
}

/* MacherModus AUS (.performance-mode, Button nicht .active): beim Hovern bekommt der
   Button-Text denselben animierten Farbverlauf (logo-shimmer) wie die Titel im
   MacherModus — als kleine Vorschau auf den Effekt, den man wieder einschalten würde.
   Nur im Hover-Zustand, also kein dauerhaftes Rendern im Energiesparmodus. Steht NACH
   der Deaktivierungsregel oben, damit es sie für diesen Fall überschreibt. */
.performance-mode .macher-mode-label:hover .macher-text {
    background-image: linear-gradient(120deg, #ffffff 0%, var(--neon-red) 35%, #ffffff 70%, var(--neon-red) 100%) !important;
    background-size: 300% 100% !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    animation: logo-shimmer 6s ease-in-out infinite !important;
    display: inline-block !important;
}

/* Elevate celebratory particle canvas above blurred winner overlay background on announcement */
body.winner-active #particle-canvas {
    z-index: 20;
}

/* ==========================================================================
   MODAL FORM HELPERS
   Extracted from repeated inline styles in index.html (settings + multipliers
   modals). The selectors carry an element qualifier (input.*) so they keep
   winning over the base input[type=...] rules exactly as the inline styles did.
   ========================================================================== */
input.modal-input {
    font-size: 0.85rem;
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 14px;
    color: white;
    transition: var(--transition-smooth);
}

.luck-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 8px 14px;
    border-radius: 8px;
}

.luck-label {
    font-size: 0.85rem;
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

input.luck-input {
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 6px 10px;
    color: white;
    width: 75px;
    text-align: center;
    box-sizing: border-box;
}

/* ==========================================================================
   SOCIAL-AUSLOSUNG — Instagram + TikTok (social.js / #social-modal)
   Import per Copy-Paste ohne Login; Akzentfarben sind bewusst die Marken-
   farben (Instagram-Pink #e1306c, TikTok-Rot #fe2c55) statt Twitch-Rollen.
   Die ig-*-Klassen sind der Namespace des gemeinsamen Modals.
   ========================================================================== */

/* Sidebar-Buttons: Icon + Text nebeneinander; im aktiven Social-Modus (nach
   einem Import) glimmt der jeweilige Button, bis „Teilnehmer leeren“ endet. */
.social-sidebar-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.8rem;
    padding: 8px 12px;
}

.social-sidebar-btn.social-active {
    color: #e1306c;
    border-color: rgba(225, 48, 108, 0.55);
    box-shadow: 0 0 14px rgba(225, 48, 108, 0.35);
}

#tiktok-draw-btn.social-active {
    color: #fe2c55;
    border-color: rgba(254, 44, 85, 0.55);
    box-shadow: 0 0 14px rgba(254, 44, 85, 0.35);
}

/* Modal-Inhalt darf scrollen (Beitrags-Vorschau + Optionen + Chips werden lang) */
#social-modal .ig-modal-body {
    max-height: min(62vh, 640px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
}

.ig-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.ig-url-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

/* Absprung-Pfeil neben dem Beitrags-Link (öffnet instagram.com im neuen Tab) */
.ig-open-link {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e1306c;
    font-size: 1.05rem;
    font-weight: 800;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.ig-open-link:hover {
    border-color: rgba(225, 48, 108, 0.55);
    box-shadow: 0 0 12px rgba(225, 48, 108, 0.3);
}

/* Beitrags-Vorschau über Instagrams öffentliche /embed/-Seite (kein Login) */
.ig-embed-wrap {
    height: 290px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.ig-embed-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: transparent;
}

/* Einfüge-Feld für kopierte Kommentare / „Gefällt mir“-Listen */
textarea.ig-paste {
    font-size: 0.85rem;
    font-family: var(--font-primary);
    width: 100%;
    min-height: 110px;
    resize: vertical;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 14px;
    color: white;
    transition: var(--transition-smooth);
}

textarea.ig-paste:focus {
    outline: none;
    border-color: rgba(var(--theme-rgb, 255, 0, 60), 0.5);
    box-shadow: 0 0 12px rgba(var(--theme-rgb, 255, 0, 60), 0.2);
}

/* Zähler-Badge neben „Erkannte Teilnehmer“ */
.ig-count {
    display: inline-block;
    min-width: 26px;
    text-align: center;
    padding: 1px 8px;
    margin-left: 6px;
    border-radius: 999px;
    background: rgba(225, 48, 108, 0.14);
    border: 1px solid rgba(225, 48, 108, 0.4);
    color: #e1306c;
    font-size: 0.75rem;
    font-weight: 800;
}

/* Vorschau der erkannten Nutzer als entfernbare Chips */
.ig-preview {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 6px;
    max-height: 150px;
    overflow-y: auto;
    padding: 2px;
}

.ig-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.75rem;
    color: white;
    white-space: nowrap;
}

.ig-user-chip .ig-chip-n {
    color: #e1306c;
    font-weight: 800;
}

.ig-user-chip .ig-chip-x {
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 800;
    line-height: 1;
    transition: var(--transition-smooth);
}

.ig-user-chip .ig-chip-x:hover {
    color: #ff3366;
}

.ig-empty {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 2px 0;
    flex-basis: 100%;
}

/* Profil-Absprung im Gewinner-Overlay (Social-Gewinner). Farbe/Glow setzt
   finalizeWinner inline passend zur Plattform (Instagram-Pink / TikTok-Rot). */
.social-profile-link {
    display: block;
    text-align: center;
    margin-top: 8px;
    padding: 6px 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: #e1306c;
    text-decoration: none;
    text-shadow: 0 0 10px rgba(225, 48, 108, 0.45);
}

.social-profile-link:hover {
    text-decoration: underline;
}





/* ==========================================================================
   MULTIPLAYER-MODUS — disabled count field + the multi-winner pop-up cards
   ========================================================================== */
/* The soft backdrop lives in its own layer (.mp-backdrop) BELOW the celebratory particle
   canvas, so the diamond particles render in front of it; #mp-overlay itself stays
   transparent and only holds the cards (which sit above the canvas at z-index 1000). */
#mp-overlay { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }

.mp-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 4, 6, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 15; /* above the app, below the winner-active particle canvas (z-index 20) */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.mp-backdrop.active { opacity: 1; }

/* No window frame — #mp-card is just a transparent, centred container for the player
   cards (the per-winner cards keep their own proximity contour). */
#mp-card {
    position: relative;
    width: fit-content; max-width: min(94vw, 920px); /* hug the cards */
}
/* Round chevron button (eye-button style) bottom-right — minimises/restores the winners.
   Lives outside #mp-card and is positioned fixed, so it stays put when the cards hide. */
.mp-minimize-btn {
    display: none; /* shown only while the winners overlay is active (see below) */
    position: fixed; bottom: 20px; right: 20px;
    width: 44px; height: 44px; border-radius: 50%;
    align-items: center; justify-content: center;
    background: rgba(14, 14, 17, 0.8);
    border: 1px solid transparent; /* invisible at rest (no contour); hover + minimised(OBS-dimmed) re-add it */
    color: var(--text-main); cursor: pointer; z-index: 1001;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: var(--transition-smooth);
    pointer-events: auto;
}
#mp-overlay.active .mp-minimize-btn { display: flex; }
.mp-minimize-btn:hover {
    border-color: var(--neon-red); color: var(--neon-red);
    box-shadow: 0 0 15px rgba(255, 0, 60, 0.4);
    transform: scale(1.08);
}
.mp-minimize-btn svg { transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
/* Minimised: the "V" chevron flips to an inverted "^", and the cards + backdrop hide
   (clicks pass through to the app), leaving only the button to restore them. */
#mp-overlay.mp-minimized .mp-minimize-btn svg { transform: rotate(180deg); }
/* When minimised, dim it to match the eye icon's closed (OBS-mode) look: faint border,
   dimmed icon — identical values to .streamer-mode .streamer-toggle-btn. */
#mp-overlay.mp-minimized .mp-minimize-btn {
    opacity: 0.35;
    background: rgba(7, 7, 9, 0.3);
    border-color: rgba(255, 255, 255, 0.05);
}
#mp-overlay.mp-minimized .mp-minimize-btn:hover {
    opacity: 1;
    background: rgba(14, 14, 17, 0.85);
    border-color: var(--neon-red);
}
#mp-overlay.mp-minimized { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none; }
#mp-overlay.mp-minimized #mp-card { display: none; }
.mp-grid {
    display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start;
    gap: 14px;
    padding: 4px 2px 2px;
    max-height: 68vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--theme-rgb, 255, 0, 60), 0.4) transparent;
}
.mp-grid::-webkit-scrollbar { width: 6px; }
.mp-grid::-webkit-scrollbar-thumb { background: rgba(var(--theme-rgb, 255, 0, 60), 0.3); border-radius: 3px; }

/* One winner card — tinted to the winner's role via scoped --mp-accent vars. */
.mp-player-card {
    position: relative;
    width: 200px; flex: 0 0 auto;    /* fixed width so the flex grid hugs the cards */
    --border-width: 1px;             /* proximity ring matches the card's 1px border */
    --mouse-glow-border-color: rgba(var(--mp-accent-rgb, var(--theme-rgb, 255, 0, 60)), 0.65); /* contour glow in the winner's colour */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 12px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid transparent; /* invisible by default (only the cursor-proximity ring shows); turns red on timeout */
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), 0 0 16px rgba(var(--mp-accent-rgb, var(--theme-rgb, 255, 0, 60)), 0.1);
    animation: mp-card-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Rotating conic-gradient sheen — in an inner clip layer so the CARD itself needs no
   overflow:hidden (which would clip the cursor-proximity contour ::after). */
.mp-pc-sheen {
    position: absolute; inset: 0; z-index: 0; border-radius: inherit; overflow: hidden;
    pointer-events: none;
}
.mp-pc-sheen::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(var(--mp-accent-rgb, var(--theme-rgb, 255, 0, 60)), 0.13) 30%, transparent 60%);
    animation: rotate-clockwise 10s linear infinite;
}
/* Content above the sheen. Exclude the sheen (must stay position:absolute, else it
   collapses to 0×0) AND the ✕ (must stay position:absolute in the corner). */
.mp-player-card > *:not(.mp-pc-sheen):not(.mp-pc-x) { position: relative; z-index: 1; }
.performance-mode .mp-pc-sheen { display: none; } /* no ambient sheen in energy-saving mode */
@keyframes mp-card-in { 0% { transform: scale(0.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.mp-player-card.mp-swap { animation: mp-card-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
/* "Zeit abgelaufen!" cue: red frame + soft red glow (the transparent base border keeps the layout from jumping). */
.mp-player-card.mp-timed-out {
    border-color: rgba(255, 51, 102, 0.7); opacity: 0.92;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), 0 0 18px rgba(255, 51, 102, 0.28);
}

.mp-pc-head {
    position: relative; /* positioning context for the ✕, which lives in this row */
    display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: center; gap: 6px;
    width: 100%;
}
.mp-pc-followage {
    grid-column: 1; justify-self: start;
    display: flex; align-items: center; gap: 4px;
    font-size: 0.68rem; font-weight: 700; color: var(--text-muted, rgba(255, 255, 255, 0.6));
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 96px;
}
.mp-pc-followage .mp-pc-fa-ic { color: var(--mp-accent, var(--neon-red)); }
.mp-pc-badge {
    grid-column: 2; justify-self: center; /* centred, independent of the timer's width/visibility */
    font-size: 0.6rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
    color: var(--mp-accent, var(--neon-red));
    text-shadow: 0 0 8px rgba(var(--mp-accent-rgb, var(--theme-rgb)), 0.5);
}
.mp-pc-timer {
    grid-column: 3; justify-self: end; /* always pinned top-right, even when no badge shows */
    font-family: var(--font-primary);
    font-size: 0.78rem; font-weight: 800; letter-spacing: 0.5px;
    padding: 3px 8px; border-radius: 7px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff; white-space: nowrap;
}
.mp-pc-timer.warning { color: #ff3366; border-color: rgba(255, 51, 102, 0.4); background: rgba(255, 0, 85, 0.12); }
.mp-pc-timer.timeout { color: #ff3366; border-color: #ff3366; background: rgba(255, 0, 85, 0.18); }
.mp-pc-timer.confirmed {
    color: var(--mp-accent, var(--neon-red));
    border-color: rgba(var(--mp-accent-rgb, var(--theme-rgb)), 0.45);
    background: rgba(var(--mp-accent-rgb, var(--theme-rgb)), 0.12);
    box-shadow: 0 0 10px rgba(var(--mp-accent-rgb, var(--theme-rgb)), 0.4);
}

.mp-pc-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    border: 2px solid var(--mp-accent, var(--neon-red));
    box-shadow: 0 0 16px rgba(var(--mp-accent-rgb, var(--theme-rgb)), 0.4);
    overflow: hidden; background: #070709; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.mp-pc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mp-pc-initial {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-family: var(--font-primary); font-size: 1.6rem; font-weight: 900;
    background: linear-gradient(135deg, #fff, var(--mp-accent, var(--neon-red)));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.mp-pc-name {
    font-family: var(--font-primary); font-size: 0.98rem; font-weight: 900; color: #fff;
    max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-shadow: 0 0 12px rgba(var(--mp-accent-rgb, var(--theme-rgb)), 0.4);
}
/* Exactly one message tall → only the newest line shows, with no sliver of the line
   above peeking in; older ones stay scrollable. line-height 1.5 (on the lines) gives
   descenders like "g" room so they aren't clipped. */
.mp-pc-chat {
    width: 100%; height: 31px; overflow-y: auto;
    border-radius: 9px; padding: 5px 8px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex; flex-direction: column; gap: 4px;
    scrollbar-width: thin; scrollbar-color: rgba(var(--mp-accent-rgb, var(--theme-rgb, 255, 0, 60)), 0.5) transparent;
}
/* While waiting for the first message: no frame around the placeholder, and let the
   (possibly two-line) hint size itself so it isn't clipped. */
.mp-pc-chat.mp-pc-chat--waiting {
    height: auto; min-height: 31px;
    background: none;
    border-color: transparent;
}
.mp-pc-chat::-webkit-scrollbar { width: 4px; }
/* Scrollbar tinted to the winner's colour. */
.mp-pc-chat::-webkit-scrollbar-thumb { background: rgba(var(--mp-accent-rgb, var(--theme-rgb, 255, 0, 60)), 0.5); border-radius: 2px; }
/* "Warte auf Nachricht…" gently blinks like the single-winner card; on timeout it
   becomes a solid red "Zeit abgelaufen!" (the .is-timeout class stops the blink). */
@keyframes mp-pulse-placeholder { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
.mp-pc-chat-ph {
    font-size: 0.72rem; color: var(--text-muted, rgba(255, 255, 255, 0.45));
    text-align: center; margin: auto 0; font-weight: 600;
    animation: mp-pulse-placeholder 1.5s ease-in-out infinite;
}
.mp-pc-chat-ph.is-timeout { animation: none; color: #ff3366; }
.performance-mode .mp-pc-chat-ph { animation: none; }
.mp-pc-chat-line {
    font-size: 0.78rem; font-weight: 600; line-height: 1.5; color: #fff;
    word-break: break-word;
    flex-shrink: 0; /* keep full height so older lines overflow (scrollable), never squeezed */
    text-shadow: 0 0 8px rgba(var(--mp-accent-rgb, var(--theme-rgb)), 0.4);
}
/* ✕ in the card's top-right corner, on the same line as the follow-age / badge /
   countdown — shown only after the countdown is gone (a non-follower or someone who
   didn't answer in time). Clicking it drops + backfills the slot. */
.mp-pc-x {
    position: absolute; top: 10px; right: 12px; /* aligned with the header row */
    width: 22px; height: 22px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; line-height: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted, rgba(255, 255, 255, 0.55));
    font-size: 0.95rem; font-weight: 700; cursor: pointer;
    transition: var(--transition-smooth, all 0.2s ease);
    z-index: 4;
}
.mp-pc-x:hover {
    color: #ff3366; border-color: #ff3366; background: rgba(255, 0, 85, 0.15);
    transform: scale(1.12);
}
