/* ═══════════════════════════════════════════════════════════
   Turing Test Web-App — Shared Stylesheet
   Modern, hochwertig, spielerisch
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
    --color-dark-teal: #1e3f3e;
    --color-redorange: #f54d26;
    --color-redorange-hover: #d43d16;
    --color-beige: #e6e4d0;
    --color-teal: #00908d;
    --color-teal-hover: #007270;
    --color-danger: #dc3545;
    --color-danger-hover: #c82333;

    --color-bg: #ffffff;
    --color-bg-page: var(--color-beige);
    --color-text: #1e3f3e;
    --color-text-muted: #6b7280;
    --color-text-light: #9ca3af;
    --color-card-bg: #ffffff;
    --color-card-bg-alt: #f8f8f8;
    --color-border: #e6e4d0;
    --color-border-light: #f0eee0;
    --color-input-border: #e6e4d0;
    --color-input-bg: #ffffff;
    --color-footer-text: #6b7280;

    --gradient-bg: linear-gradient(135deg, #1e3f3e 0%, #00908d 50%, #1e3f3e 100%);
    --gradient-bg-size: 200% 200%;
    --gradient-card: linear-gradient(135deg, rgba(0,144,141,0.05) 0%, rgba(30,63,62,0.05) 100%);
    --gradient-stat: linear-gradient(135deg, #00908d 0%, #1e3f3e 100%);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.18);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.25);
    --shadow-glow-red: 0 0 20px rgba(245, 77, 38, 0.4);
    --shadow-glow-teal: 0 0 20px rgba(0, 144, 141, 0.3);

    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 50px;
    --radius-full: 50%;

    --transition-fast: 0.15s ease;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    --font-sans: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-mono: 'Cascadia Code', 'Fira Code', 'Consolas', 'Courier New', monospace;

    --z-header: 100;
    --z-modal: 200;
    --z-toast: 300;
}

/* ── Dark Mode ── */
.dark {
    --color-bg: #0f172a;
    --color-bg-page: #0f172a;
    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-text-light: #64748b;
    --color-card-bg: #1e293b;
    --color-card-bg-alt: #1a2332;
    --color-border: #334155;
    --color-border-light: #293548;
    --color-input-border: #475569;
    --color-input-bg: #1e293b;
    --color-footer-text: #64748b;
    --gradient-bg: linear-gradient(135deg, #0f172a 0%, #1e3f3e 50%, #0f172a 100%);
    --gradient-card: linear-gradient(135deg, rgba(0,144,141,0.08) 0%, rgba(30,63,62,0.08) 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.6);
}

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

body {
    font-family: var(--font-sans);
    background: var(--gradient-bg);
    background-size: var(--gradient-bg-size);
    animation: gradientShift 12s ease infinite;
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ── Typography ── */
h1 {
    color: var(--color-dark-teal);
    font-size: 2em;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.dark h1 { color: var(--color-beige); }

h2 {
    color: var(--color-teal);
    font-size: 1.4em;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.dark h2 { color: var(--color-teal); }

h3 {
    color: var(--color-dark-teal);
    font-size: 1.1em;
    font-weight: 600;
}
.dark h3 { color: var(--color-beige); }

/* ── Container ── */
.container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--color-card-bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.5s var(--transition) both;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-teal), var(--color-redorange), var(--color-teal));
    background-size: 200% 100%;
    animation: gradientLine 3s ease infinite;
}

@keyframes gradientLine {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 0%; }
}

.container-wide {
    max-width: 1200px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--color-redorange);
    color: white;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 1em;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.3) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
}
.btn:active::after { opacity: 1; }

.btn:hover {
    background: var(--color-redorange-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow-red);
}

.btn:disabled {
    background: var(--color-text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--color-teal);
}
.btn-secondary:hover {
    background: var(--color-teal-hover);
    box-shadow: var(--shadow-glow-teal);
}

.btn-danger {
    background: var(--color-danger);
}
.btn-danger:hover {
    background: var(--color-danger-hover);
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-teal);
    color: var(--color-teal);
}
.btn-outline:hover {
    background: var(--color-teal);
    color: white;
}

.btn-glow {
    animation: glow 2s ease-in-out infinite;
}

.btn-icon {
    font-size: 1.1em;
}

/* ── Cards ── */
.card {
    background: var(--color-card-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    position: relative;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.card-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.dark .card-glass {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--color-dark-teal);
}
.dark .card-title { color: var(--color-beige); }

/* ── Status Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-teal {
    background: rgba(0, 144, 141, 0.15);
    color: var(--color-teal);
}
.dark .badge-teal {
    background: rgba(0, 144, 141, 0.25);
}

.badge-red {
    background: rgba(245, 77, 38, 0.15);
    color: var(--color-redorange);
}
.dark .badge-red {
    background: rgba(245, 77, 38, 0.25);
}

.badge-green {
    background: rgba(22, 163, 74, 0.15);
    color: #16a34a;
}
.dark .badge-green {
    background: rgba(22, 163, 74, 0.25);
    color: #4ade80;
}

.badge-yellow {
    background: rgba(234, 179, 8, 0.15);
    color: #b45309;
}
.dark .badge-yellow {
    background: rgba(234, 179, 8, 0.25);
    color: #fbbf24;
}

.badge-thinking {
    background: rgba(234, 179, 8, 0.15);
    color: #b45309;
    animation: pulse 1.5s ease-in-out infinite;
}
.dark .badge-thinking {
    background: rgba(234, 179, 8, 0.25);
    color: #fbbf24;
}

.badge-submitted {
    background: rgba(22, 163, 74, 0.15);
    color: #16a34a;
}

/* ── Status Bar ── */
.status-bar {
    display: flex;
    justify-content: space-around;
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 8px;
}

.status-item {
    text-align: center;
    padding: 4px 12px;
}

.status-label {
    font-size: 0.82em;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.status-value {
    font-size: 1.5em;
    color: var(--color-text);
    font-weight: 800;
    transition: all var(--transition);
}

/* ── Stat Cards (Moderator) ── */
.stat-card {
    background: var(--gradient-stat);
    padding: 20px;
    border-radius: var(--radius-md);
    text-align: center;
    color: white;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transition: all 0.5s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow-teal);
}

.stat-card:hover::after {
    top: -30%;
    right: -30%;
}

.stat-card .stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.82em;
}

.stat-card .stat-value {
    color: white;
    font-size: 2.2em;
    font-weight: 800;
}

/* ── Pairing Cards ── */
.pairing-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-teal);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    transition: all var(--transition);
    animation: slideInRight 0.4s var(--transition) both;
}

.pairing-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pairing-card.moderator-pairing {
    border-left-color: var(--color-redorange);
    background: linear-gradient(135deg, rgba(245,77,38,0.03) 0%, var(--color-card-bg) 100%);
}
.dark .pairing-card.moderator-pairing {
    background: linear-gradient(135deg, rgba(245,77,38,0.08) 0%, var(--color-card-bg) 100%);
}

.pairing-card.moderator-pairing.needs-action {
    animation: borderPulse 2s ease-in-out infinite;
}

@keyframes borderPulse {
    0%, 100% { border-left-color: var(--color-redorange); }
    50% { border-left-color: #ff8a65; }
}

.pairing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.pairing-participants {
    font-weight: 700;
    color: var(--color-text);
    font-size: 1.05em;
}

.qa-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.qa-box {
    background: var(--color-card-bg-alt);
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-light);
}

.qa-label {
    font-weight: 700;
    color: var(--color-text-muted);
    margin-bottom: 6px;
    font-size: 0.82em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.qa-content {
    color: var(--color-text);
    font-size: 0.92em;
    line-height: 1.5;
}

/* ── Form Elements ── */
input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-input-border);
    border-radius: var(--radius-sm);
    font-size: 1em;
    font-family: inherit;
    background: var(--color-input-bg);
    color: var(--color-text);
    transition: all var(--transition);
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-teal);
    box-shadow: 0 0 0 3px rgba(0, 144, 141, 0.15);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

label {
    display: block;
    color: var(--color-text);
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.92em;
}

/* ── Received Answer Box ── */
.received-answer {
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin: 12px 0;
    border-left: 4px solid var(--color-teal);
    font-size: 0.95em;
    line-height: 1.6;
}

/* ── Vote Buttons ── */
.vote-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.vote-button {
    flex: 1;
    min-width: 160px;
    padding: 18px 32px;
    font-size: 1.15em;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.vote-button .vote-icon {
    font-size: 1.6em;
    display: block;
    margin-bottom: 4px;
}

.vote-button.human {
    background: var(--color-teal);
}
.vote-button.human:hover {
    background: var(--color-teal-hover);
    box-shadow: var(--shadow-glow-teal);
}
.vote-button.human:hover .vote-icon {
    animation: humanWave 0.5s ease;
}

.vote-button.ai {
    background: var(--color-redorange);
}
.vote-button.ai:hover {
    box-shadow: var(--shadow-glow-red);
}
.vote-button.ai:hover .vote-icon {
    animation: robotWiggle 0.5s ease infinite;
}

/* ── Dark Mode Toggle ── */
.theme-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: var(--z-header);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--color-beige);
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(20deg);
}

.theme-toggle .icon {
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.dark .theme-toggle .icon {
    transform: rotate(360deg);
}

/* ── Language Switch ── */
.lang-switch {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: var(--z-header);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--color-beige);
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-size: 0.88em;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all var(--transition);
    letter-spacing: 0.02em;
}

.lang-switch:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* ── Footer ── */
.footer {
    margin-top: 32px;
    padding-top: 20px;
    border-top: none;
    text-align: center;
    font-size: 0.85em;
    color: var(--color-footer-text);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-border), transparent);
}

.footer a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer a:hover {
    color: var(--color-teal);
}

/* Page-level footer (outside container, on gradient bg) */
.footer-page {
    margin-top: 24px;
    text-align: center;
    font-size: 0.85em;
    color: rgba(230, 228, 208, 0.7);
}
.footer-page a {
    color: rgba(230, 228, 208, 0.7);
    text-decoration: none;
}
.footer-page a:hover {
    color: var(--color-beige);
}

/* ── Login Form ── */
.login-form {
    max-width: 400px;
    margin: 80px auto;
    text-align: center;
}

.login-form input {
    margin: 12px 0;
}

/* ── Controls ── */
.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* ── Accordion ── */
.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    background: var(--color-card-bg-alt);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.95em;
    transition: all var(--transition);
    user-select: none;
}

.accordion-header:hover {
    background: var(--color-border-light);
}

.accordion-arrow {
    transition: transform var(--transition);
    font-size: 0.8em;
    color: var(--color-text-muted);
}
.accordion-arrow.open {
    transform: rotate(90deg);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 16px;
}

.accordion-body.open {
    max-height: 2000px;
    padding: 16px;
}

/* ── Info/Tip/Warning Boxes ── */
.info-box {
    background: rgba(0, 144, 141, 0.08);
    border-left: 4px solid var(--color-teal);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 14px 18px;
    margin: 16px 0;
    font-size: 0.92em;
    line-height: 1.7;
}

.highlight-box {
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    padding: 20px;
    border-radius: var(--radius-md);
    border-left: 5px solid var(--color-teal);
    margin: 24px 0;
}

/* ── Marker/Tag ── */
.you-marker {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--color-redorange);
    color: white;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.75em;
    font-weight: 700;
    margin-left: 6px;
    letter-spacing: 0.03em;
}

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */

/* Eingangsanimation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Slide von rechts (für Log-Einträge, Cards) */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide von links */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Pulsieren (Warten, Live-Badge) */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Typing Dots (Chat-Indikator) */
.typing-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 8px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--color-teal);
    animation: typingDot 1.4s ease-in-out infinite;
}

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

@keyframes typingDot {
    0%, 60%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    30% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Glow-Effekt für Call-to-Action */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(245, 77, 38, 0.3),
                    0 4px 15px rgba(245, 77, 38, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(245, 77, 38, 0.5),
                    0 4px 30px rgba(245, 77, 38, 0.3);
    }
}

/* Roboter-Wackeln */
@keyframes robotWiggle {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-12deg); }
    40% { transform: rotate(10deg); }
    60% { transform: rotate(-8deg); }
    80% { transform: rotate(6deg); }
}

/* Mensch-Winken */
@keyframes humanWave {
    0% { transform: rotate(0deg); }
    20% { transform: rotate(14deg); }
    40% { transform: rotate(-8deg); }
    60% { transform: rotate(10deg); }
    80% { transform: rotate(-4deg); }
    100% { transform: rotate(0deg); }
}

/* Shake (Elimination) */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
    20%, 40%, 60%, 80% { transform: translateX(6px); }
}

/* Konfetti */
@keyframes confettiFall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(calc(100vh + 20px)) rotate(720deg);
        opacity: 0;
    }
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: var(--z-modal);
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 10px;
    animation: confettiFall linear forwards;
}

/* Scale-Pop (für Gewinner etc.) */
@keyframes scalePop {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Trophy Bounce */
@keyframes trophyBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    30% { transform: translateY(-15px) scale(1.1); }
    50% { transform: translateY(-8px) scale(1.05); }
    70% { transform: translateY(-3px); }
}

/* Border-Puls für Moderator-Action */
@keyframes borderGlow {
    0%, 100% { box-shadow: inset 0 0 0 0 rgba(245,77,38,0); }
    50% { box-shadow: inset 0 0 0 2px rgba(245,77,38,0.3); }
}

/* ── LIVE Badge ── */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    background: rgba(220, 38, 38, 0.15);
    border-radius: var(--radius-pill);
    font-size: 0.78em;
    font-weight: 800;
    color: #ef4444;
    letter-spacing: 0.08em;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: #ef4444;
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
}

/* ── Stagger Animation Helper ── */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* ── Agent Language Selector ── */
.lang-selector {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: var(--color-card-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: 2px;
    font-size: 0.85em;
}

.lang-option {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-weight: 600;
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
    border: none;
    background: none;
    font-family: inherit;
}

.lang-option.active {
    background: var(--color-teal);
    color: white;
}

.lang-option:hover:not(.active) {
    color: var(--color-text);
}

/* ── Activity Panel (inline in moderator) ── */
.activity-panel {
    margin-top: 24px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.activity-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--color-card-bg-alt);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.92em;
    transition: background var(--transition-fast);
    user-select: none;
}

.activity-panel-header:hover {
    background: var(--color-border-light);
}

.activity-panel-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.activity-panel-body.open {
    max-height: 600px;
}

.activity-log-entry {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.88em;
    animation: slideInRight 0.3s var(--transition) both;
}

.activity-log-entry:last-child {
    border-bottom: none;
}

.activity-time {
    color: var(--color-text-light);
    font-family: var(--font-mono);
    font-size: 0.85em;
    white-space: nowrap;
    min-width: 55px;
}

.activity-text {
    color: var(--color-text);
    flex: 1;
    line-height: 1.4;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--color-teal);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--color-teal-hover); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .qa-section {
        grid-template-columns: 1fr;
    }

    .controls {
        flex-direction: column;
    }

    .controls .btn {
        width: 100%;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    body { padding: 12px; }

    .container {
        padding: 20px 16px;
        border-radius: var(--radius-md);
    }

    h1 { font-size: 1.5em; }
    h2 { font-size: 1.2em; }

    .status-bar {
        flex-direction: column;
        gap: 4px;
    }

    .vote-buttons {
        flex-direction: column;
    }

    .vote-button {
        width: 100%;
        min-width: unset;
    }

    .btn {
        display: flex;
        width: 100%;
    }

    .theme-toggle {
        width: 38px;
        height: 38px;
        font-size: 1em;
    }

    .lang-switch {
        padding: 6px 14px;
        font-size: 0.82em;
    }
}

/* ═══════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════ */

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; }
.font-mono { font-family: var(--font-mono); }

/* ═══════════════════════════════════════════════════════════
   DARK MODE TOGGLE SCRIPT (inline in pages)
   Use: <script>initTheme();</script>
   ═══════════════════════════════════════════════════════════ */
