/* ========================================
   BIGONE.1 CHAT â€” PREMIUM DESIGN SYSTEM
   ======================================== */

:root {
    --accent-1: #f43f5e;
    --accent-2: #fb923c;
    --accent-blue: #6366f1;
    --bg-deep: #06090f;
    --bg-surface: #0d1117;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --gradient-main: linear-gradient(135deg, #f43f5e, #fb923c);
    --shadow-glow: 0 0 40px rgba(244, 63, 94, 0.25);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    /* Legacy compat */
    --cam-bg: #000;
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-bg: rgba(13, 17, 23, 0.8);
    --primary-color: #6366f1;
    --text-main: #f1f5f9;
}

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

html {
    height: 100%;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    height: 100%;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

/* ----------------------------------------
   ANIMATED BACKGROUND AURORA
   ---------------------------------------- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 15% 8%, rgba(244, 63, 94, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse 55% 50% at 85% 92%, rgba(99, 102, 241, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse 45% 45% at 50% 50%, rgba(251, 146, 60, 0.07) 0%, transparent 60%);
    animation: bgPulse 14s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes bgPulse {
    0% {
        opacity: 0.75;
        transform: scale(1);
    }

    100% {
        opacity: 1;
        transform: scale(1.06);
    }
}

/* ========================================
   AUTH SCREEN — PREMIUM SPLIT LAYOUT
   ======================================== */
#auth-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: stretch;
    z-index: 10;
    overflow: hidden;
    background: radial-gradient(circle at 10% 20%, rgba(244, 63, 94, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
        linear-gradient(135deg, #07090e 0%, #0d1017 100%);
}

/* Floating Top Navbar */
.auth-navbar {
    position: absolute;
    top: 1.5rem;
    left: 3rem;
    right: 3rem;
    height: 64px;
    background: rgba(15, 18, 26, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem 0 1.2rem;
    z-index: 20;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.auth-nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-badge-b1 {
    background: linear-gradient(135deg, #ff3366, #ff7b00);
    color: #fff;
    font-weight: 900;
    font-style: italic;
    font-size: 1.15rem;
    padding: 3px 8px;
    border-radius: 8px;
    letter-spacing: -1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 51, 102, 0.35);
    font-family: 'Outfit', 'Inter', sans-serif;
    line-height: 1;
}

.logo-badge-b1 span {
    opacity: 0.85;
}

.logo-badge-b1.big {
    font-size: 2.2rem;
    padding: 6px 14px;
    border-radius: 12px;
    box-shadow: 0 6px 22px rgba(255, 51, 102, 0.45);
}

.auth-nav-logo .logo-text,
.auth-logo-big {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 900;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    line-height: 1.25;
    padding-bottom: 0.12em;
    overflow: visible;
}

.auth-nav-logo .logo-text {
    font-size: 1.4rem;
    display: inline-block;
}

.auth-nav-logo .logo-text span,
.auth-logo-big span,
.auth-logo-small span {
    opacity: 0.6;
}

.auth-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    color: #94a3b8;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 10px;
    transition: all 0.2s;
    font-size: 0.92rem;
}

.nav-link:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
    color: #ff4b4b;
    background: rgba(255, 75, 75, 0.1);
}

.nav-btn-reg {
    border: 1px solid #ff4b4b;
    color: #ff6b6b;
    background: rgba(255, 75, 75, 0.1);
    border-radius: 20px;
    padding: 8px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
}

.nav-btn-reg:hover {
    background: rgba(255, 75, 75, 0.2);
    box-shadow: 0 0 15px rgba(255, 75, 75, 0.3);
    transform: translateY(-1px);
}

/* Animated Particles */
.auth-bg-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: particleFloat linear infinite;
}

.p1 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #f43f5e 0%, transparent 70%);
    top: -120px;
    left: -120px;
    animation-duration: 22s;
}

.p2 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, #6366f1 0%, transparent 70%);
    bottom: -80px;
    right: -80px;
    animation-duration: 28s;
    animation-delay: -5s;
}

.p3 {
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, #fb923c 0%, transparent 70%);
    top: 45%;
    left: 32%;
    animation-duration: 19s;
    animation-delay: -11s;
}

.p4 {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, #f43f5e 0%, transparent 70%);
    bottom: 22%;
    left: -60px;
    animation-duration: 24s;
    animation-delay: -3s;
}

.p5 {
    width: 190px;
    height: 190px;
    background: radial-gradient(circle, #6366f1 0%, transparent 70%);
    top: 12%;
    right: 18%;
    animation-duration: 16s;
    animation-delay: -9s;
}

@keyframes particleFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }

    33% {
        transform: translateY(-35px) rotate(120deg) scale(1.05);
    }

    66% {
        transform: translateY(25px) rotate(240deg) scale(0.95);
    }
}

/* Left Promo Panel */
.auth-promo {
    flex: 1.35;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7rem 3.5rem 3rem 4rem;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.promo-watermark-b1 {
    position: absolute;
    right: -30px;
    top: 48%;
    transform: translateY(-50%) rotate(-10deg) skewX(-10deg);
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 28rem;
    font-weight: 900;
    line-height: 0.8;
    color: transparent;
    -webkit-text-stroke: 2px rgba(255, 75, 75, 0.18);
    text-shadow: 0 0 45px rgba(255, 51, 102, 0.12);
    pointer-events: none;
    z-index: 0;
    user-select: none;
    letter-spacing: -12px;
}

.auth-promo-inner {
    max-width: 580px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.auth-logo-big-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 1.5rem;
}

.auth-logo-big {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: clamp(2.8rem, 5vw, 4.2rem);
    font-weight: 900;
    line-height: 1.25;
    padding-bottom: 0.12em;
    overflow: visible;
    letter-spacing: -2px;
    display: inline-block;
}

.auth-promo-headline {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: clamp(2.4rem, 4vw, 3.8rem);
    font-weight: 800;
    line-height: 1.08;
    color: #ffffff;
    letter-spacing: -1.5px;
    margin-bottom: 1.5rem;
}

.auth-promo-headline span {
    color: #ff4b4b;
}

.auth-promo-sub {
    border-left: 3px solid #ff4b4b;
    padding-left: 1.25rem;
    color: #94a3b8;
    font-size: 1.12rem;
    line-height: 1.6;
    margin: 1.5rem 0 2.5rem 0;
    max-width: 520px;
}

.auth-features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 2.8rem;
    max-width: 640px;
}

.auth-feature-card {
    background: rgba(20, 24, 34, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 16px 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.auth-feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 75, 75, 0.45);
    background: rgba(25, 30, 45, 0.88);
    box-shadow: 0 10px 25px rgba(255, 51, 102, 0.2);
}

.fc-icon {
    font-size: 1.35rem;
    margin-bottom: 8px;
}

.fc-title {
    font-weight: 700;
    color: #f8fafc;
    font-size: 0.92rem;
    margin-bottom: 4px;
    font-family: 'Outfit', sans-serif;
}

.fc-desc {
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.35;
}

.auth-promo-footer {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    flex-wrap: wrap;
}

.auth-promo-live {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 100px;
    padding: 0.6rem 1.3rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #10b981;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: livePulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes livePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
        transform: scale(1.2);
    }
}

.auth-online-avatars {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-stack {
    display: flex;
    align-items: center;
}

.av-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #07090e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    margin-left: -10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.av-circle:first-child {
    margin-left: 0;
}

.online-count {
    color: #94a3b8;
    font-size: 0.92rem;
    font-weight: 600;
}

/* Right Form Panel */
.auth-form-wrapper {
    flex: 1;
    width: 100%;
    max-width: 480px;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6.5rem 3rem 2.5rem 1.5rem;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    overflow-y: auto;
}

.auth-card {
    width: 100%;
    background: rgba(13, 16, 23, 0.88);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 24px;
    padding: 2.75rem 2.25rem;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    animation: cardSlideUp 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardSlideUp {
    from {
        opacity: 0;
        transform: translateY(28px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-card-header {
    margin-bottom: 2rem;
    text-align: center;
}

.auth-logo-small {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    line-height: 1.25;
    padding-bottom: 0.1em;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-form-title {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 0.4rem;
}

.auth-form-sub {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
}

.auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.auth-input-field {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 1.1rem;
    font-size: 1.05rem;
    line-height: 1;
    pointer-events: none;
    z-index: 1;
}

.auth-input-field input {
    width: 100%;
    padding: 0.95rem 1rem 0.95rem 3rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.98rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: var(--transition);
}

.auth-input-field input:focus {
    border-color: #ff4b4b;
    background: rgba(244, 63, 94, 0.06);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15);
}

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

.auth-btn-primary {
    width: 100%;
    padding: 1.05rem 1.5rem;
    background: linear-gradient(135deg, #ff3366 0%, #ff7b00 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.02rem;
    font-weight: 700;
    font-family: 'Outfit', 'Inter', sans-serif;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 25px rgba(255, 51, 102, 0.35);
    margin-top: 0.5rem;
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(255, 51, 102, 0.55);
}

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

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.4rem 0;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.auth-guest-row {
    display: flex;
    gap: 0.7rem;
    align-items: center;
}

.auth-guest-row input {
    flex: 1;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: var(--transition);
}

.auth-guest-row input:focus {
    border-color: #ff4b4b;
}

.auth-guest-row input::placeholder {
    color: var(--text-muted);
}

.auth-btn-ghost {
    white-space: nowrap;
    padding: 0.85rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.26);
}

.auth-switch-link {
    margin-top: 1.6rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.auth-switch-link span {
    background: linear-gradient(135deg, #ff3366, #ff7b00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    transition: opacity 0.2s;
}

.auth-switch-link:hover span {
    opacity: 0.8;
}

.auth-error-msg {
    color: #f87171;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    min-height: 1.4em;
    margin-top: 0.75rem;
}

.auth-legal-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    margin-top: 2.2rem;
    font-size: 0.78rem;
    color: #64748b;
}

.auth-legal-links span {
    cursor: pointer;
    transition: color 0.2s;
}

.auth-legal-links span:not(.auth-legal-dot):hover {
    color: var(--text-secondary);
}

.auth-legal-dot {
    pointer-events: none;
}

/* Responsive adjustments for auth screen */
@media (max-width: 1100px) {
    .auth-navbar {
        left: 1.5rem;
        right: 1.5rem;
    }

    .auth-nav-links {
        display: none;
    }

    .auth-promo {
        padding: 6.5rem 2rem 2rem 2rem;
    }

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

    .promo-watermark-b1 {
        font-size: 18rem;
        right: -10px;
    }
}

@media (max-width: 850px) {
    #auth-screen {
        flex-direction: column;
        overflow-y: auto;
    }

    .auth-promo {
        flex: none;
        width: 100%;
        padding: 6rem 1.5rem 2rem 1.5rem;
    }

    .auth-form-wrapper {
        max-width: 100%;
        padding: 1rem 1.5rem 3rem 1.5rem;
    }

    .promo-watermark-b1 {
        display: none;
    }
}

@media (max-width: 480px) {
    .auth-navbar {
        left: 0.75rem;
        right: 0.75rem;
        padding: 0.6rem 1rem;
    }

    .auth-nav-logo .logo-text {
        display: none;
    }

    .auth-nav-action {
        display: none;
    }

    /* hide register btn on very small */
    .auth-promo {
        display: none;
    }

    /* hide promo block, keep it clean */
    .auth-form-wrapper {
        padding: 0.5rem 0.75rem 3rem 0.75rem;
        padding-top: 4.5rem;
    }

    .auth-card {
        padding: 1.5rem 1rem;
    }

    .auth-form-title {
        font-size: 1.3rem;
    }
}

/* ========================================
   MAIN CHAT INTERFACE
   ======================================== */
#chat-interface {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100%;
    position: relative;
    z-index: 1;
    overflow: hidden;
    background: radial-gradient(circle at 10% 20%, rgba(244, 63, 94, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 90% 80%, rgba(99, 102, 241, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(251, 146, 60, 0.08) 0%, transparent 55%),
        linear-gradient(135deg, #07090e 0%, #0d1017 100%);
}

/* Chat Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1.2rem;
    background: rgba(10, 14, 22, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    gap: 0.75rem;
    z-index: 20;
}

.header-user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: nowrap;
}

/* ========================================
   BUTTONS
   ======================================== */
button {
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
    padding: 0.6rem 1.1rem;
    font-size: 0.875rem;
    background: var(--gradient-main);
    color: white;
    box-shadow: 0 3px 12px rgba(244, 63, 94, 0.3);
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(244, 63, 94, 0.45);
}

button:active {
    transform: translateY(0) !important;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid var(--border-strong) !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.13) !important;
    border-color: rgba(255, 255, 255, 0.26) !important;
    box-shadow: none !important;
}

.primary-btn {
    background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 3px 14px rgba(99, 102, 241, 0.35) !important;
}

.primary-btn:hover {
    box-shadow: 0 6px 22px rgba(99, 102, 241, 0.5) !important;
    transform: translateY(-1px);
}

.danger-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 3px 12px rgba(239, 68, 68, 0.3) !important;
}

.danger-btn:hover {
    box-shadow: 0 5px 18px rgba(239, 68, 68, 0.5) !important;
    transform: translateY(-1px);
}

.icon-btn {
    padding: 0.5rem 0.65rem !important;
    font-size: 1rem !important;
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid var(--border-strong) !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
    border-radius: var(--radius-sm) !important;
    line-height: 1;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.14) !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
    transform: translateY(-1px) !important;
    box-shadow: none !important;
}

/* ========================================
   INPUTS
   ======================================== */
input,
select,
textarea {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

input:not(.auth-input-field input):not(.auth-guest-row input) {
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

input:not(.auth-input-field input):not(.auth-guest-row input):focus {
    border-color: var(--accent-1);
    background: rgba(244, 63, 94, 0.05);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1);
}

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

select {
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    background: rgba(10, 14, 22, 0.9);
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-primary);
}

textarea {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    resize: vertical;
    width: 100%;
    color: var(--text-primary);
}

textarea:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1);
}

textarea::placeholder {
    color: var(--text-muted);
}

/* ========================================
   GLASS PANEL
   ======================================== */
.glass-panel {
    background: rgba(10, 14, 22, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* ========================================
   CHAT LAYOUT
   ======================================== */
.chat-main {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

/* Rooms Sidebar */
.rooms-area {
    flex: 0 0 210px;
    width: 210px;
    display: flex;
    flex-direction: column;
    background: rgba(10, 14, 22, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-strong);
    padding: 1rem 0.85rem;
    gap: 0.35rem;
    overflow: hidden;
}

.rooms-area h3 {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--border);
    margin: 0 0 0.35rem 0;
}

#rooms-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    flex: 1;
}

#rooms-list::-webkit-scrollbar {
    width: 3px;
}

#rooms-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#rooms-list li {
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

#rooms-list li:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
}

#rooms-list li.active {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.22), rgba(251, 146, 60, 0.16));
    color: #fb923c;
    font-weight: 700;
    border: 1px solid rgba(251, 146, 60, 0.28);
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    background: rgba(10, 14, 22, 0.42);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

.chat-watermark-b1 {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%) rotate(-8deg) skewX(-8deg);
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: clamp(12rem, 25vw, 26rem);
    font-weight: 900;
    line-height: 0.8;
    color: transparent;
    -webkit-text-stroke: 2px rgba(255, 75, 75, 0.14);
    text-shadow: 0 0 50px rgba(255, 51, 102, 0.08);
    pointer-events: none;
    z-index: 0;
    user-select: none;
    letter-spacing: -10px;
}

/* Messages */
.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    scroll-behavior: smooth;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.message {
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    max-width: 87%;
    align-self: flex-start;
    animation: msgSlide 0.2s ease-out;
    border: 1px solid transparent;
    transition: background 0.15s;
    position: relative;
}

.message:hover {
    background: rgba(255, 255, 255, 0.06);
}

@keyframes msgSlide {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message .meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message .text {
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
    color: var(--text-primary);
}

.message.system {
    align-self: center;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: italic;
    max-width: 100%;
    padding: 0.2rem 0;
}

.message.mentioned {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(239, 68, 68, 0.1)) !important;
    border: 1px solid rgba(245, 158, 11, 0.42) !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
    animation: mentionPulse 2.5s ease-in-out infinite;
}

@keyframes mentionPulse {

    0%,
    100% {
        box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
    }

    50% {
        box-shadow: 0 0 22px rgba(245, 158, 11, 0.48);
    }
}

.message.whisper {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(236, 72, 153, 0.12));
    border: 1px solid rgba(168, 85, 247, 0.35);
}

/* Chat Input */
.chat-input-area {
    display: flex;
    padding: 0.8rem 1rem;
    gap: 0.5rem;
    background: rgba(10, 14, 22, 0.85);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    align-items: flex-end;
}

.chat-input-area input,
.chat-input-area textarea {
    flex: 1;
    min-height: 42px;
    padding: 0.65rem 0.9rem;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.chat-input-area input:focus,
.chat-input-area textarea:focus {
    border-color: rgba(244, 63, 94, 0.5);
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.1);
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    padding: 4px 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
    background: rgba(8, 11, 18, 0.75);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

/* User List */
.user-list-area {
    flex: 0 0 260px;
    width: 260px;
    display: flex;
    flex-direction: column;
    background: rgba(10, 14, 22, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--border-strong);
    padding: 1rem 0.85rem;
    overflow: hidden;
}

.user-list-area h3 {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--border);
    margin: 0 0 0.5rem 0;
}

#users-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#users-list::-webkit-scrollbar {
    width: 3px;
}

#users-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.user-list-item {
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.84rem;
    transition: var(--transition);
}

.user-list-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
}

/* Room Banner + Pinned */
.room-banner {
    display: flex;
}

/* ========================================
   FLOATING CAMS
   ======================================== */
.cam-box {
    position: absolute;
    width: 300px;
    height: 225px;
    min-width: 200px;
    min-height: 150px;
    max-width: 90vw;
    max-height: 90vh;
    background: #0a0e16;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), var(--shadow-glow);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    resize: both;
}

.cam-box::after {
    content: "◢";
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    z-index: 25;
}

#my-cam-box::after {
    display: none;
}

.cam-header {
    height: 36px;
    background: rgba(6, 9, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    cursor: grab;
    user-select: none;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 20;
}

.cam-header:active {
    cursor: grabbing;
}

.cam-close-btn {
    background: rgba(239, 68, 68, 0.8);
    border: none;
    color: white;
    font-size: 1rem;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.cam-close-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.cam-video-area {
    flex: 1;
    position: relative;
    background: #000;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cam-controls {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.4rem;
    z-index: 20;
}

.cam-action-btn {
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    font-size: 1.1rem !important;
    border-radius: 8px !important;
    background: rgba(6, 9, 15, 0.88) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.cam-action-btn:hover {
    background: rgba(255, 255, 255, 0.22) !important;
    transform: scale(1.1) !important;
}

.cam-action-btn.off {
    background: rgba(239, 68, 68, 0.85) !important;
}

.cam-viewer-badge {
    position: absolute;
    top: 38px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.72rem;
    color: var(--accent-2);
    font-weight: 600;
    z-index: 12;
    cursor: pointer;
}

.viewer-list {
    position: absolute;
    top: 64px;
    left: 8px;
    right: 8px;
    max-height: 110px;
    overflow-y: auto;
    background: rgba(6, 9, 15, 0.97);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 6px;
    font-size: 0.72rem;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 20;
}

.viewer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 6px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    color: #e2e8f0;
}

.kick-viewer-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 600;
}

.kick-viewer-btn:hover {
    background: #ef4444;
    color: #fff;
}

/* Form Groups */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
    text-align: left;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Chat Smilies */
.chat-smilie {
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.15s;
    position: relative;
}

.chat-smilie:hover {
    transform: scale(2.5);
    z-index: 50;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
}

.chat-user-mention {
    cursor: pointer;
    transition: opacity 0.15s;
}

.chat-user-mention:hover {
    text-decoration: underline;
    opacity: 0.85;
}

.smilie-pick-item {
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.15s, transform 0.15s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.smilie-pick-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.2);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulseLive {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Context Menu */
.user-context-menu {
    position: absolute;
    background: rgba(8, 12, 20, 0.97) !important;
    backdrop-filter: blur(28px) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-md) !important;
    padding: 6px !important;
    z-index: 9999 !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.85) !important;
    min-width: 190px !important;
    max-width: 240px !important;
    font-family: 'Inter', sans-serif !important;
    animation: ctxFadeIn 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ctxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-4px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ctx-user-header {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: var(--text-muted) !important;
    padding: 6px 10px 4px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ctx-divider {
    height: 1px !important;
    background: var(--border) !important;
    margin: 4px 0 !important;
}

.ctx-menu-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
}

.context-menu-btn {
    background: transparent !important;
    border: none !important;
    color: #e2e8f0 !important;
    text-align: left !important;
    width: 100% !important;
    padding: 7px 10px !important;
    border-radius: 6px !important;
    font-size: 0.83rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: background 0.12s !important;
    line-height: 1.3 !important;
}

.context-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    transform: none !important;
}

.context-menu-btn.danger-ctx:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
}

.ctx-icon {
    font-size: 1rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
}

.mobile-toggle-btn {
    display: none !important;
}

/* ========================================
   MOBILE RESPONSIVENESS
   ======================================== */
@media (max-width: 768px) {

    /* Auth: Stack on mobile */
    #auth-screen {
        flex-direction: column;
        overflow-y: auto;
    }

    .auth-promo {
        display: none;
    }

    .auth-form-wrapper {
        width: 100%;
        max-width: 100%;
        min-height: 100%;
        padding: 1.5rem 1rem;
        padding-top: 5rem;
        align-items: flex-start;
    }

    .auth-card {
        width: 100%;
        padding: 2rem 1.5rem;
    }

    /* Guest login row: stack vertically on mobile */
    .auth-guest-row {
        flex-direction: column;
    }

    .auth-guest-row input {
        width: 100%;
    }

    .auth-btn-ghost {
        width: 100%;
        justify-content: center;
    }

    /* SEO Section mobile fixes */
    #seo-section {
        padding: 2rem 1rem !important;
    }

    #seo-section .glass-panel {
        padding: 1.5rem 1rem !important;
    }

    #seo-section h1 {
        font-size: 1.5rem !important;
    }

    #seo-section h2 {
        font-size: 1.2rem !important;
    }

    #seo-section h3 {
        font-size: 1rem !important;
    }

    #seo-section p {
        font-size: 0.9rem !important;
    }

    /* SEO grid: stack on mobile */
    #seo-section > div[style*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Chat: Mobile */
    .mobile-toggle-btn {
        display: inline-flex !important;
    }

    #chat-interface {
        height: 100%;
        width: 100%;
    }

    /* ===== HEADER MOBILE FIX ===== */
    .chat-header {
        padding: 0.4rem 0.5rem;
        flex-wrap: wrap;
        gap: 0.3rem;
        overflow: visible;
    }

    .header-user-info {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
    }

    /* Hide "Eingeloggt als" text on mobile, show only username */
    .header-user-info > span {
        font-size: 0;
        display: inline-flex;
        align-items: center;
    }

    .header-user-info > span #my-username-display {
        font-size: 0.8rem !important;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
    }

    /* Hide role and bracket text on mobile */
    #my-role-display {
        display: none;
    }

    .header-actions {
        flex: 0 0 auto;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.25rem !important;
    }

    /* Hide many header buttons on mobile, keep essentials */
    .chat-header .secondary-btn:not(#mobile-rooms-btn):not(#mobile-users-btn):not(#toggle-sound-btn):not(#start-my-cam-btn) {
        display: none !important;
    }

    .chat-header select#my-status-select {
        display: none !important;
    }

    .chat-header #radio-player-bar {
        display: none !important;
    }

    /* Make cam button compact on mobile */
    #start-my-cam-btn {
        font-size: 0.8rem !important;
        padding: 5px 10px !important;
        white-space: nowrap;
    }

    /* Logout button compact */
    #logout-btn {
        font-size: 0.8rem !important;
        padding: 5px 10px !important;
    }

    /* Sound button compact */
    #toggle-sound-btn {
        font-size: 0.8rem !important;
        padding: 5px 8px !important;
        min-width: auto !important;
    }

    /* Mobile toggle buttons small */
    .mobile-toggle-btn {
        font-size: 1rem !important;
        padding: 5px 8px !important;
        min-width: auto !important;
    }

    .chat-main {
        flex-direction: row;
        overflow: hidden;
        position: relative;
    }

    .chat-area {
        width: 100%;
        min-width: 100%;
    }

    /* Chat input area - prevent overflow */
    .chat-input-area {
        padding: 0.5rem 0.5rem;
        gap: 0.4rem;
    }

    .chat-input-area #chat-input {
        min-width: 0;
        flex: 1;
        font-size: 0.9rem;
    }

    .chat-input-area #send-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* Smilie Picker mobile */
    #smilie-picker-popover {
        width: 95vw !important;
        height: 60vh !important;
        left: 2.5vw !important;
        bottom: 70px !important;
    }

    #pm-smilie-picker-popover {
        width: 95vw !important;
        height: 60vh !important;
    }

    /* Offcanvas sidebars */
    .rooms-area,
    .user-list-area {
        position: absolute;
        top: 0;
        bottom: 0;
        z-index: 100;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 260px;
        max-width: 82vw;
        border-radius: 0;
        flex: none;
        background: rgba(6, 9, 15, 0.98);
        backdrop-filter: blur(28px);
        border: none;
    }

    .rooms-area {
        left: 0;
        transform: translateX(-100%);
        border-right: 1px solid var(--border-strong);
    }

    .rooms-area.show {
        transform: translateX(0);
    }

    .user-list-area {
        right: 0;
        transform: translateX(100%);
        border-left: 1px solid var(--border-strong);
    }

    .user-list-area.show {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.65);
        z-index: 90;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.show {
        display: block;
    }

    #cams-container {
        pointer-events: none;
        z-index: 150;
    }

    .cam-box {
        width: 160px;
        height: auto;
        pointer-events: auto;
    }

    .cam-video-area video {
        height: 120px;
    }

    #my-cam-box {
        position: fixed !important;
        bottom: 70px !important;
        right: 10px !important;
        width: 140px !important;
        border-radius: 8px !important;
        z-index: 200 !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5) !important;
    }

    /* PM windows on mobile: full-width */
    .pm-window-instance {
        width: 95vw !important;
        height: 65vh !important;
        top: 10vh !important;
        left: 2.5vw !important;
        right: auto !important;
    }

    /* Minimized on mobile: stays where it is, collapses to header bar */
    .pm-window-instance.pm-minimized {
        width: 240px !important;
        height: 74px !important;
    }

    /* Modals on mobile */
    .glass-panel[id$="-modal"] > div,
    div[id$="-modal"] > .glass-panel,
    div[id$="-modal"] > .modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        padding: 1.5rem 1rem !important;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem 1rem;
        border-radius: var(--radius-lg);
    }

    .auth-form-title {
        font-size: 1.3rem;
    }

    .auth-btn-primary {
        font-size: 0.9rem;
    }

    .auth-form-wrapper {
        padding-top: 4.5rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Header: even more compact */
    .chat-header {
        padding: 0.3rem 0.4rem;
    }

    /* Hide "Eingeloggt als" completely, show tiny name */
    .header-user-info > span {
        display: none;
    }

    /* Make cam start button even smaller */
    #start-my-cam-btn {
        font-size: 0.7rem !important;
        padding: 4px 7px !important;
    }

    /* logout btn */
    #logout-btn {
        font-size: 0.7rem !important;
        padding: 4px 7px !important;
    }

    #toggle-sound-btn {
        font-size: 0.7rem !important;
        padding: 4px 6px !important;
    }

    .mobile-toggle-btn {
        font-size: 0.9rem !important;
        padding: 4px 6px !important;
    }

    /* SEO section even more compact */
    #seo-section {
        padding: 1rem 0.5rem !important;
    }

    #seo-section h1 {
        font-size: 1.2rem !important;
    }
}

/* Tablet: show smaller promo */
@media (min-width: 769px) and (max-width: 1100px) {
    .auth-promo {
        padding: 2rem;
    }

    .auth-logo-big {
        font-size: 2.5rem;
    }

    .auth-promo-headline {
        font-size: 1.9rem;
    }

    .auth-promo-sub {
        font-size: 0.9rem;
    }
}


/* Layout Container (Fixed full window height/width without jumping) */
.admin-body {
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    height: 100vh !important;
    width: 100vw !important;
    background: #090d16 !important;
}

.admin-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: radial-gradient(circle at 10% 20%, rgba(244, 63, 94, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(251, 146, 60, 0.08) 0%, transparent 40%),
        #090d16;
}

/* Admin Sidebar */
.admin-sidebar {
    width: 270px;
    min-width: 270px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.8rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
    z-index: 10;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.admin-brand h1 {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f43f5e, #fb923c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.admin-brand .version-tag {
    font-size: 0.7rem;
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    border: 1px solid rgba(244, 63, 94, 0.3);
    font-weight: 600;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    text-align: left;
    padding: 0.85rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: none;
    margin-bottom: 0;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.05);
    transform: translateX(3px);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.15), rgba(251, 146, 60, 0.15));
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.3);
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.15);
}

/* Main Content Wrapper - Fixes Width Jumping */
.admin-main {
    flex: 1;
    min-width: 0;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Top Header & Stats Cards */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.admin-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.5px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    width: 100%;
    margin-bottom: 1rem;
}

.stat-card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(251, 146, 60, 0.3);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.2), rgba(251, 146, 60, 0.2));
    border: 1px solid rgba(244, 63, 94, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-info .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.2;
}

.stat-info .stat-label {
    font-size: 0.825rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Tab Containers */
.tab-content {
    display: none;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
    width: 100%;
    animation: fadeIn 0.3s ease;
}

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

/* Modern Glass Table Styling */
.glass-table-container {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.25rem;
    overflow-x: auto;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.glass-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: #f8fafc;
}

.glass-table th {
    background: rgba(0, 0, 0, 0.35);
    padding: 1rem 1.2rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}

.glass-table th:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.glass-table th:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.glass-table td {
    padding: 1rem 1.2rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.925rem;
    text-align: left;
}

.glass-table tr {
    transition: background 0.2s ease;
}

.glass-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Modern Toggle Switch Component */
.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.15);
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: #cbd5e1;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

input:checked+.slider {
    background: linear-gradient(135deg, #f43f5e, #fb923c);
    border-color: rgba(251, 146, 60, 0.4);
}

input:checked+.slider:before {
    transform: translateX(20px);
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Custom Table Controls */
.glass-table input[type="text"],
.glass-table input[type="number"],
.glass-table select {
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
    width: 60px;
    /* Default width for inputs in the table so they aren't huge */
    text-align: center;
    /* Center the text inside small inputs */
}

.glass-table input[type="text"] {
    width: 120px;
    /* wider for text inputs like name */
    text-align: left;
}

/* Remove Arrows from Number Inputs */
.glass-table input[type="number"]::-webkit-outer-spin-button,
.glass-table input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.glass-table input[type="number"] {
    -moz-appearance: textfield;
}

.glass-table input[type="text"]:focus,
.glass-table input[type="number"]:focus,
.glass-table select:focus {
    border-color: #fb923c;
}

.glass-table input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: none;
    width: 38px;
    height: 38px;
    padding: 0 !important;
    margin: 0;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    overflow: hidden;
}

.glass-table input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    margin: 0;
}

.glass-table input[type="color"]::-webkit-color-swatch {
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
}

.glass-table input[type="color"]::-moz-color-swatch {
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
}

/* Status Badges */
.badge-status {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-status.success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-status.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-status.info {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Action Buttons inside tables */
.btn-sm {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.8rem !important;
    border-radius: 8px !important;
}

/* Responsive Mobile Admin */
@media (max-width: 900px) {
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .admin-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .tab-btn {
        white-space: nowrap;
        padding: 0.6rem 0.9rem;
    }

    .admin-main {
        padding: 1.25rem;
        height: auto;
        overflow-y: visible;
    }
}

.message.whisper {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%);
    border: 1px solid rgba(236, 72, 153, 0.4);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.15);
}

.smilie-pick-item {
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.15s;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.picker-smilie-img {
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}


.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.smilie-category-tab {
    padding: 6px 10px;
    border-radius: 6px;
    background: transparent;
    color: #ff4b4b;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    border: none;
}

.smilie-category-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff6b6b;
}

.smilie-category-tab.active {
    background: rgba(255, 75, 75, 0.2);
    color: #ff4b4b;
}


/* Pagination Controls */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pagination-select,
.filter-select {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f1f5f9;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: 0.2s;
}

.pagination-select:hover,
.filter-select:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.page-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

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

.page-info {
    color: #cbd5e1;
    font-size: 0.85rem;
    padding: 0 0.5rem;
    font-weight: 500;
}

/* PM Dock - no longer used for positioning, kept as empty container */
#pm-dock {
    display: none;
}

.pm-window-instance {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.95);
    border-radius: 12px;
    /* Smooth collapse/expand animation */
    transition: height 0.2s ease;
    /* Default size when open */
    width: 440px;
    height: 540px;
    position: fixed;
}

/* Minimized: stays in place, collapses to just the header bar */
.pm-window-instance.pm-minimized {
    height: 44px !important;
    overflow: hidden;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Hide everything below the header when minimized */
.pm-window-instance.pm-minimized .pm-content-area,
.pm-window-instance.pm-minimized .pm-cam-area {
    display: none !important;
}

/* Header stays as the drag handle when minimized */
.pm-window-instance.pm-minimized .pm-header {
    cursor: grab;
    border-radius: 12px;
}