@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Fira+Code:wght@400;600&family=Orbitron:wght@400;700&family=Dancing+Script:wght@700&family=Cinzel:wght@400;700&family=Press+Start+2P&family=VT323&display=swap');

:root {
    --bg: #09090b;
    --bg2: #131316;
    --fg: #e4e4e7;
    --fg2: #a1a1aa;
    --accent: #6366f1;
    --accent2: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --danger: #ef4444;
    --success: #22c55e;
    --input-bg: rgba(255, 255, 255, 0.04);
    --panel-bg: rgba(17, 17, 21, 0.85);
    --msg-self: linear-gradient(135deg, #4f46e5, #6366f1);
    --msg-self-solid: #4f46e5;
    --msg-other: rgba(39, 39, 42, 0.6);
    --font: 'Inter', -apple-system, sans-serif;
    --zoom: 1.35;
    --radius: 28px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --border: 1px solid rgba(255, 255, 255, 0.06);
    --backdrop: blur(20px) saturate(1.5);
    --glow: 0 0 40px var(--accent-glow);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

body {
    background: var(--bg);
    color: var(--fg);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: calc(15px * var(--zoom));
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 20% 50%, var(--accent-glow), transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.05), transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: slowGlow 8s infinite alternate ease-in-out;
}

@keyframes slowGlow {
    from {
        opacity: 0.7;
        transform: scale(1);
    }

    to {
        opacity: 1;
        transform: scale(1.05);
    }
}

.love-theme {
    --bg: #120208;
    --bg2: #1f0510;
    --fg: #fecdd3;
    --fg2: #fb7185;
    --accent: #e11d48;
    --accent2: #fb7185;
    --accent-glow: rgba(225, 29, 72, 0.15);
    --msg-self: linear-gradient(135deg, #be123c, #e11d48);
    --msg-self-solid: #be123c;
    --msg-other: rgba(63, 10, 25, 0.6);
    --input-bg: rgba(225, 29, 72, 0.08);
    --panel-bg: rgba(18, 2, 8, 0.9);
    --font: 'Dancing Script', cursive;
    --radius: 36px;
    --border: 1px solid rgba(225, 29, 72, 0.15);
}

.matrix-theme {
    --bg: #000;
    --bg2: #001100;
    --fg: #00ff41;
    --fg2: #00cc33;
    --accent: #00ff41;
    --accent2: #33ff66;
    --accent-glow: rgba(0, 255, 65, 0.1);
    --msg-self: linear-gradient(135deg, #003300, #004400);
    --msg-self-solid: #003300;
    --msg-other: rgba(0, 17, 0, 0.8);
    --input-bg: rgba(0, 255, 65, 0.03);
    --panel-bg: rgba(0, 5, 0, 0.95);
    --font: 'VT323', monospace;
    --radius: 0;
    --border: 1px solid rgba(0, 255, 65, 0.2);
    background-image: linear-gradient(rgba(0, 20, 0, 0.8) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 20, 0, 0.8) 1px, transparent 1px);
    background-size: 20px 20px;
}

.ocean-theme {
    --bg: #020617;
    --bg2: #0c1a3a;
    --fg: #bae6fd;
    --fg2: #7dd3fc;
    --accent: #0ea5e9;
    --accent2: #38bdf8;
    --accent-glow: rgba(14, 165, 233, 0.1);
    --msg-self: linear-gradient(135deg, #0369a1, #0ea5e9);
    --msg-self-solid: #0369a1;
    --msg-other: rgba(12, 26, 58, 0.6);
    --input-bg: rgba(14, 165, 233, 0.06);
    --panel-bg: rgba(2, 6, 23, 0.85);
    --radius: 26px;
    --border: 1px solid rgba(14, 165, 233, 0.12);
    background-image: linear-gradient(to bottom, #020617, #0c1a3a);
}

.sunset-theme {
    --bg: #1c0a00;
    --bg2: #2d1507;
    --fg: #fed7aa;
    --fg2: #fdba74;
    --accent: #f97316;
    --accent2: #fb923c;
    --accent-glow: rgba(249, 115, 22, 0.12);
    --msg-self: linear-gradient(135deg, #c2410c, #ea580c);
    --msg-self-solid: #c2410c;
    --msg-other: rgba(45, 21, 7, 0.6);
    --input-bg: rgba(249, 115, 22, 0.06);
    --panel-bg: rgba(28, 10, 0, 0.9);
    --radius: 28px;
    --border: 1px solid rgba(249, 115, 22, 0.15);
    background-image: linear-gradient(to top right, #1c0a00, #3b1a08);
}

.midnight-theme {
    --bg: #030712;
    --bg2: #0f172a;
    --fg: #c7d2fe;
    --fg2: #a5b4fc;
    --accent: #6366f1;
    --accent2: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.1);
    --msg-self: linear-gradient(135deg, #3730a3, #4338ca);
    --msg-self-solid: #3730a3;
    --msg-other: rgba(15, 23, 42, 0.7);
    --input-bg: rgba(99, 102, 241, 0.05);
    --panel-bg: rgba(3, 7, 18, 0.9);
    --radius: 22px;
    --border: 1px solid rgba(99, 102, 241, 0.12);
}

.forest-theme {
    --bg: #052e16;
    --bg2: #0a3d1f;
    --fg: #bbf7d0;
    --fg2: #86efac;
    --accent: #22c55e;
    --accent2: #4ade80;
    --accent-glow: rgba(34, 197, 94, 0.1);
    --msg-self: linear-gradient(135deg, #15803d, #16a34a);
    --msg-self-solid: #15803d;
    --msg-other: rgba(10, 40, 20, 0.6);
    --input-bg: rgba(34, 197, 94, 0.05);
    --panel-bg: rgba(5, 30, 14, 0.9);
    --radius: 12px;
    --border: 1px solid rgba(34, 197, 94, 0.15);
}

.cyber-theme {
    --bg: #02010a;
    --bg2: #0a0520;
    --fg: #67e8f9;
    --fg2: #22d3ee;
    --accent: #d946ef;
    --accent2: #e879f9;
    --accent-glow: rgba(217, 70, 239, 0.12);
    --msg-self: linear-gradient(135deg, #a21caf, #d946ef);
    --msg-self-solid: #a21caf;
    --msg-other: rgba(10, 5, 32, 0.7);
    --input-bg: rgba(0, 0, 0, 0.4);
    --panel-bg: rgba(2, 1, 10, 0.9);
    --font: 'Orbitron', sans-serif;
    --radius: 4px;
    --border: 1px solid rgba(34, 211, 238, 0.2);
    background-image: repeating-linear-gradient(45deg, #03010f 0, #03010f 10px, #06021a 10px, #06021a 20px);
}

.retro-theme {
    --bg: #1a1408;
    --bg2: #2a200f;
    --fg: #e8c88a;
    --fg2: #c9a862;
    --accent: #d97706;
    --accent2: #f59e0b;
    --accent-glow: rgba(217, 119, 6, 0.1);
    --msg-self: linear-gradient(135deg, #92400e, #b45309);
    --msg-self-solid: #92400e;
    --msg-other: rgba(42, 32, 15, 0.7);
    --input-bg: rgba(0, 0, 0, 0.2);
    --panel-bg: rgba(26, 20, 8, 0.95);
    --font: 'VT323', monospace;
    --radius: 2px;
    --border: 1px dashed rgba(232, 200, 138, 0.3);
}

.hacker-theme {
    --bg: #030303;
    --bg2: #0a0a0a;
    --fg: #39ff14;
    --fg2: #2ecc0f;
    --accent: #39ff14;
    --accent2: #5cff3e;
    --accent-glow: rgba(57, 255, 20, 0.08);
    --msg-self: linear-gradient(135deg, #003d00, #005200);
    --msg-self-solid: #003d00;
    --msg-other: rgba(10, 10, 10, 0.8);
    --input-bg: #050505;
    --panel-bg: rgba(3, 3, 3, 0.95);
    --font: 'Fira Code', monospace;
    --radius: 0;
    --border: 2px solid rgba(57, 255, 20, 0.3);
}

.bubblegum-theme {
    --bg: #1a0610;
    --bg2: #2d0d1e;
    --fg: #fbcfe8;
    --fg2: #f9a8d4;
    --accent: #ec4899;
    --accent2: #f472b6;
    --accent-glow: rgba(236, 72, 153, 0.12);
    --msg-self: linear-gradient(135deg, #be185d, #db2777);
    --msg-self-solid: #be185d;
    --msg-other: rgba(45, 13, 30, 0.6);
    --input-bg: rgba(236, 72, 153, 0.06);
    --panel-bg: rgba(26, 6, 16, 0.9);
    --radius: 22px;
    --border: 1px solid rgba(236, 72, 153, 0.2);
}

.dracula-theme {
    --bg: #1e1f29;
    --bg2: #282a36;
    --fg: #f8f8f2;
    --fg2: #bd93f9;
    --accent: #bd93f9;
    --accent2: #d4b8ff;
    --accent-glow: rgba(189, 147, 249, 0.1);
    --msg-self: linear-gradient(135deg, #44475a, #565970);
    --msg-self-solid: #44475a;
    --msg-other: rgba(40, 42, 54, 0.8);
    --input-bg: rgba(68, 71, 90, 0.4);
    --panel-bg: rgba(30, 31, 41, 0.95);
    --font: 'Fira Code', monospace;
    --radius: 8px;
    --border: 1px solid rgba(189, 147, 249, 0.15);
}

.vaporwave-theme {
    --bg: #0a0415;
    --bg2: #170830;
    --fg: #67e8f9;
    --fg2: #a78bfa;
    --accent: #f0abfc;
    --accent2: #f5d0fe;
    --accent-glow: rgba(240, 171, 252, 0.1);
    --msg-self: linear-gradient(135deg, #7e22ce, #a855f7);
    --msg-self-solid: #7e22ce;
    --msg-other: rgba(23, 8, 48, 0.7);
    --input-bg: rgba(23, 8, 48, 0.5);
    --panel-bg: rgba(10, 4, 21, 0.9);
    --radius: 0;
    --border: 1px solid rgba(103, 232, 249, 0.15);
    background-image: linear-gradient(to bottom, #0a0415, #170830);
}

.pixel-theme {
    --bg: #0f0f0f;
    --bg2: #1a1a1a;
    --fg: #e0e0e0;
    --fg2: #aaa;
    --accent: #3b82f6;
    --accent2: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.1);
    --msg-self: linear-gradient(135deg, #1e40af, #2563eb);
    --msg-self-solid: #1e40af;
    --msg-other: rgba(26, 26, 26, 0.8);
    --input-bg: #1a1a1a;
    --panel-bg: rgba(15, 15, 15, 0.95);
    --font: 'Press Start 2P', cursive;
    --zoom: 0.75;
    --radius: 0;
    --border: 3px solid rgba(59, 130, 246, 0.4);
}

.kawaii-theme {
    --bg: #1a0610;
    --bg2: #2d0d1e;
    --fg: #fda4af;
    --fg2: #fb7185;
    --accent: #f43f5e;
    --accent2: #fb7185;
    --accent-glow: rgba(244, 63, 94, 0.1);
    --msg-self: linear-gradient(135deg, #9f1239, #e11d48);
    --msg-self-solid: #9f1239;
    --msg-other: rgba(45, 13, 30, 0.6);
    --input-bg: rgba(244, 63, 94, 0.06);
    --panel-bg: rgba(26, 6, 16, 0.9);
    --font: 'Dancing Script', cursive;
    --radius: 22px;
    --border: 2px dotted rgba(244, 63, 94, 0.3);
}

.terminal-theme {
    --bg: #0a0a0a;
    --bg2: #141414;
    --fg: #d4d4d4;
    --fg2: #a3a3a3;
    --accent: #d4d4d4;
    --accent2: #e5e5e5;
    --accent-glow: rgba(212, 212, 212, 0.05);
    --msg-self: linear-gradient(135deg, #262626, #333);
    --msg-self-solid: #262626;
    --msg-other: rgba(20, 20, 20, 0.8);
    --input-bg: #141414;
    --panel-bg: rgba(10, 10, 10, 0.95);
    --font: 'Fira Code', monospace;
    --radius: 0;
    --border: 1px solid rgba(255, 255, 255, 0.08);
}

.cherry-theme {
    --bg: #1a0205;
    --bg2: #2d050a;
    --fg: #fecaca;
    --fg2: #fca5a5;
    --accent: #dc2626;
    --accent2: #ef4444;
    --accent-glow: rgba(220, 38, 38, 0.12);
    --msg-self: linear-gradient(135deg, #991b1b, #b91c1c);
    --msg-self-solid: #991b1b;
    --msg-other: rgba(45, 5, 10, 0.6);
    --input-bg: rgba(220, 38, 38, 0.06);
    --panel-bg: rgba(26, 2, 5, 0.9);
    --radius: 12px;
    --border: 1px solid rgba(220, 38, 38, 0.2);
}

.solarized-theme {
    --bg: #001e26;
    --bg2: #002b36;
    --fg: #839496;
    --fg2: #657b83;
    --accent: #b58900;
    --accent2: #cb9b00;
    --accent-glow: rgba(181, 137, 0, 0.1);
    --msg-self: linear-gradient(135deg, #073642, #0a4a5c);
    --msg-self-solid: #073642;
    --msg-other: rgba(0, 43, 54, 0.7);
    --input-bg: rgba(7, 54, 66, 0.4);
    --panel-bg: rgba(0, 30, 38, 0.95);
    --radius: 6px;
    --border: 1px solid rgba(181, 137, 0, 0.2);
}

.neon-theme {
    --bg: #030303;
    --bg2: #0a0a0a;
    --fg: #fff;
    --fg2: #d4d4d4;
    --accent: #e040fb;
    --accent2: #ea80fc;
    --accent-glow: rgba(224, 64, 251, 0.15);
    --msg-self: linear-gradient(135deg, rgba(224, 64, 251, 0.3), rgba(224, 64, 251, 0.15));
    --msg-self-solid: rgba(224, 64, 251, 0.3);
    --msg-other: rgba(255, 255, 255, 0.03);
    --input-bg: rgba(0, 0, 0, 0.6);
    --panel-bg: rgba(3, 3, 3, 0.9);
    --font: 'Orbitron', sans-serif;
    --radius: 8px;
    --border: 1px solid rgba(224, 64, 251, 0.3);
    --glow: 0 0 20px rgba(224, 64, 251, 0.3);
}

.coffee-theme {
    --bg: #130e0b;
    --bg2: #1f1714;
    --fg: #d7ccc8;
    --fg2: #a1887f;
    --accent: #8d6e63;
    --accent2: #a1887f;
    --accent-glow: rgba(141, 110, 99, 0.1);
    --msg-self: linear-gradient(135deg, #4e342e, #5d4037);
    --msg-self-solid: #4e342e;
    --msg-other: rgba(31, 23, 20, 0.7);
    --input-bg: rgba(78, 52, 46, 0.2);
    --panel-bg: rgba(19, 14, 11, 0.95);
    --radius: 8px;
    --border: 1px solid rgba(141, 110, 99, 0.15);
}

.space-theme {
    --bg: #030308;
    --bg2: #0a0a1a;
    --fg: #c7d2fe;
    --fg2: #a5b4fc;
    --accent: #4f46e5;
    --accent2: #6366f1;
    --accent-glow: rgba(79, 70, 229, 0.1);
    --msg-self: linear-gradient(135deg, #1e1b4b, #312e81);
    --msg-self-solid: #1e1b4b;
    --msg-other: rgba(10, 10, 26, 0.7);
    --input-bg: rgba(30, 27, 75, 0.3);
    --panel-bg: rgba(3, 3, 8, 0.9);
    --font: 'Orbitron', sans-serif;
    --radius: 10px;
    --border: 1px solid rgba(79, 70, 229, 0.15);
    background-image: radial-gradient(circle at 30% 30%, rgba(79, 70, 229, 0.05), transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(139, 92, 246, 0.03), transparent 50%);
}

.gothic-theme {
    --bg: #050505;
    --bg2: #0f0505;
    --fg: #a3a3a3;
    --fg2: #737373;
    --accent: #991b1b;
    --accent2: #b91c1c;
    --accent-glow: rgba(153, 27, 27, 0.1);
    --msg-self: linear-gradient(135deg, #450a0a, #7f1d1d);
    --msg-self-solid: #450a0a;
    --msg-other: rgba(15, 5, 5, 0.7);
    --input-bg: rgba(10, 10, 10, 0.5);
    --panel-bg: rgba(5, 5, 5, 0.95);
    --font: 'Cinzel', serif;
    --radius: 2px;
    --border: 1px solid rgba(153, 27, 27, 0.2);
    background-image: linear-gradient(to bottom, #050505, #0f0505);
}

.pastel-theme {
    --bg: #14140f;
    --bg2: #1f1f18;
    --fg: #fef9c3;
    --fg2: #fde68a;
    --accent: #f87171;
    --accent2: #fca5a5;
    --accent-glow: rgba(248, 113, 113, 0.1);
    --msg-self: linear-gradient(135deg, #6d83c4, #7d93d4);
    --msg-self-solid: #6d83c4;
    --msg-other: rgba(31, 31, 24, 0.6);
    --input-bg: rgba(31, 31, 24, 0.5);
    --panel-bg: rgba(20, 20, 15, 0.9);
    --radius: 16px;
    --border: 1px solid rgba(248, 113, 113, 0.15);
}

.aurora-theme {
    --bg: #020a10;
    --bg2: #051520;
    --fg: #d1fae5;
    --fg2: #6ee7b7;
    --accent: #10b981;
    --accent2: #34d399;
    --accent-glow: rgba(16, 185, 129, 0.12);
    --msg-self: linear-gradient(135deg, #065f46, #047857);
    --msg-self-solid: #065f46;
    --msg-other: rgba(5, 21, 32, 0.7);
    --input-bg: rgba(16, 185, 129, 0.05);
    --panel-bg: rgba(2, 10, 16, 0.9);
    --radius: 14px;
    --border: 1px solid rgba(16, 185, 129, 0.12);
    background-image: linear-gradient(150deg, rgba(16, 185, 129, 0.05) 0%, transparent 50%, rgba(139, 92, 246, 0.03) 100%);
}

.sakura-theme {
    --bg: #120508;
    --bg2: #1e0a10;
    --fg: #fce7f3;
    --fg2: #f9a8d4;
    --accent: #f472b6;
    --accent2: #f9a8d4;
    --accent-glow: rgba(244, 114, 182, 0.1);
    --msg-self: linear-gradient(135deg, #9d174d, #be185d);
    --msg-self-solid: #9d174d;
    --msg-other: rgba(30, 10, 16, 0.6);
    --input-bg: rgba(244, 114, 182, 0.05);
    --panel-bg: rgba(18, 5, 8, 0.9);
    --radius: 20px;
    --border: 1px solid rgba(244, 114, 182, 0.12);
    background-image: radial-gradient(ellipse at 20% 80%, rgba(244, 114, 182, 0.06), transparent 60%);
}

.nord-theme {
    --bg: #1a1e27;
    --bg2: #242933;
    --fg: #d8dee9;
    --fg2: #81a1c1;
    --accent: #88c0d0;
    --accent2: #8fbcbb;
    --accent-glow: rgba(136, 192, 208, 0.08);
    --msg-self: linear-gradient(135deg, #3b4252, #434c5e);
    --msg-self-solid: #3b4252;
    --msg-other: rgba(36, 41, 51, 0.7);
    --input-bg: rgba(59, 66, 82, 0.3);
    --panel-bg: rgba(26, 30, 39, 0.95);
    --radius: 8px;
    --border: 1px solid rgba(136, 192, 208, 0.1);
}

.monokai-theme {
    --bg: #1e1f1c;
    --bg2: #272822;
    --fg: #f8f8f2;
    --fg2: #a6e22e;
    --accent: #f92672;
    --accent2: #fd5ff0;
    --accent-glow: rgba(249, 38, 114, 0.1);
    --msg-self: linear-gradient(135deg, #3e3d32, #49483e);
    --msg-self-solid: #3e3d32;
    --msg-other: rgba(39, 40, 34, 0.8);
    --input-bg: rgba(62, 61, 50, 0.3);
    --panel-bg: rgba(30, 31, 28, 0.95);
    --font: 'Fira Code', monospace;
    --radius: 4px;
    --border: 1px solid rgba(249, 38, 114, 0.15);
}

.synthwave-theme {
    --bg: #090014;
    --bg2: #13002a;
    --fg: #ff7edb;
    --fg2: #b693d9;
    --accent: #f97e72;
    --accent2: #fede5d;
    --accent-glow: rgba(249, 126, 114, 0.12);
    --msg-self: linear-gradient(135deg, #36134e, #4a1a6b);
    --msg-self-solid: #36134e;
    --msg-other: rgba(19, 0, 42, 0.7);
    --input-bg: rgba(54, 19, 78, 0.3);
    --panel-bg: rgba(9, 0, 20, 0.9);
    --radius: 6px;
    --border: 1px solid rgba(255, 126, 219, 0.15);
    background-image: linear-gradient(to bottom, #090014, #1a003d);
}

.frost-theme {
    --bg: #050a12;
    --bg2: #0a1525;
    --fg: #e0f2fe;
    --fg2: #7dd3fc;
    --accent: #38bdf8;
    --accent2: #7dd3fc;
    --accent-glow: rgba(56, 189, 248, 0.08);
    --msg-self: linear-gradient(135deg, #075985, #0284c7);
    --msg-self-solid: #075985;
    --msg-other: rgba(10, 21, 37, 0.6);
    --input-bg: rgba(56, 189, 248, 0.04);
    --panel-bg: rgba(5, 10, 18, 0.9);
    --radius: 12px;
    --border: 1px solid rgba(56, 189, 248, 0.1);
}

.bloodmoon-theme {
    --bg: #0a0000;
    --bg2: #150505;
    --fg: #fca5a5;
    --fg2: #f87171;
    --accent: #b91c1c;
    --accent2: #dc2626;
    --accent-glow: rgba(185, 28, 28, 0.15);
    --msg-self: linear-gradient(135deg, #7f1d1d, #991b1b);
    --msg-self-solid: #7f1d1d;
    --msg-other: rgba(21, 5, 5, 0.7);
    --input-bg: rgba(185, 28, 28, 0.06);
    --panel-bg: rgba(10, 0, 0, 0.9);
    --radius: 4px;
    --border: 1px solid rgba(185, 28, 28, 0.2);
    background-image: radial-gradient(ellipse at 50% 0%, rgba(185, 28, 28, 0.08), transparent 60%);
}

#auth-screen,
#lobby-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    position: relative;
    z-index: 1;
}

.login-box,
.lobby-box {
    background: var(--panel-bg);
    padding: 3rem 2.5rem;
    border-radius: var(--radius);
    text-align: center;
    width: 420px;
    box-shadow: var(--shadow), var(--glow);
    border: var(--border);
    backdrop-filter: var(--backdrop);
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1), boxFloat 6s ease-in-out infinite alternate;
}

@keyframes boxFloat {
    from {
        transform: translateY(0);
        box-shadow: var(--shadow), var(--glow);
    }

    to {
        transform: translateY(-4px);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 50px var(--accent-glow);
    }
}

.login-box h1,
.lobby-box h2 {
    margin-bottom: 2rem;
    font-weight: 800;
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--fg), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.login-box input,
.lobby-box input {
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 16px;
    border: var(--border);
    border-radius: calc(var(--radius) * 0.7);
    background: var(--input-bg);
    color: var(--fg);
    outline: none;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-box input:focus,
.lobby-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(255, 255, 255, 0.06);
}

.login-box button,
.lobby-btns button {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: calc(var(--radius) * 0.7);
    background: var(--accent);
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden;
}

.login-box button::after,
.lobby-btns button::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s;
}

.login-box button:hover::after,
.lobby-btns button:hover::after {
    opacity: 1;
}

.lobby-btns {
    display: flex;
    gap: 12px;
}

.login-box button:hover,
.lobby-btns button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.login-box button:active,
.lobby-btns button:active {
    transform: translateY(0);
}

#app-screen {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    position: relative;
    z-index: 1;
    min-height: 0;
}

#chat-screen {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.top-bar {
    padding: 16px 24px;
    background: var(--panel-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 0 var(--border);
    z-index: 10;
    backdrop-filter: var(--backdrop);
    border-bottom: var(--border);
    flex-shrink: 0;
}

#countdown {
    font-family: 'Fira Code', monospace;
    font-weight: 600;
    color: var(--danger);
    font-size: 1.1rem;
    background: rgba(239, 68, 68, 0.08);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.12);
    letter-spacing: 1px;
}

#room-name {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
    color: var(--fg);
    opacity: 0.9;
}

.icon-btn {
    background: transparent;
    border: var(--border);
    color: var(--fg);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.logout-btn {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 8px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.25s;
    letter-spacing: 0.5px;
}

.logout-btn:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

#chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    scroll-behavior: smooth;
}

.msg {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: var(--radius);
    position: relative;
    word-wrap: break-word;
    animation: msgIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: transform 0.2s, opacity 0.2s;
}

.msg:hover {
    transform: scale(1.005);
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.95);
    }

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

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

#jump-btn {
    position: absolute;
    bottom: 90px;
    right: 24px;
    background: var(--accent);
    color: white;
    padding: 10px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    border: none;
    box-shadow: var(--shadow);
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    animation: fadeUp 0.2s ease;
}

#jump-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.msg.self {
    align-self: flex-end;
    background: var(--msg-self);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px var(--accent-glow), 0 1px 3px rgba(0, 0, 0, 0.2);
}

.msg.other {
    align-self: flex-start;
    background: var(--msg-other);
    border-bottom-left-radius: 4px;
    border: var(--border);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.msg-meta {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-bottom: 6px;
    display: flex;
    gap: 10px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.u-name {
    font-weight: 700;
    opacity: 1;
}

.msg-text {
    line-height: 1.55;
    font-size: 0.95rem;
    word-break: break-word;
}

.msg-actions {
    display: none;
    position: absolute;
    top: -14px;
    right: 8px;
    background: var(--bg2);
    padding: 4px 8px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: var(--border);
    backdrop-filter: blur(12px);
    z-index: 5;
}

.msg:hover .msg-actions {
    display: flex;
    gap: 8px;
    animation: fadeUp 0.15s ease;
}

.msg-actions span {
    cursor: pointer;
    font-size: 0.9rem;
    transition: transform 0.2s;
    opacity: 0.7;
}

.msg-actions span:hover {
    transform: scale(1.3);
    opacity: 1;
}

.read-receipt {
    font-size: 0.65rem;
    opacity: 0.4;
    text-align: right;
    margin-top: 4px;
    font-style: italic;
}

.reply-ref {
    font-size: 0.8rem;
    opacity: 0.8;
    border-left: 3px solid var(--accent);
    padding: 6px 10px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.attachment img,
.attachment video {
    max-width: min(100%, 400px);
    max-height: 400px;
    width: auto;
    height: auto;
    border-radius: calc(var(--radius) * 0.7);
    margin-top: 8px;
    cursor: pointer;
    border: var(--border);
    object-fit: contain;
    transition: transform 0.2s;
}

.attachment audio {
    width: 100%;
    min-width: 250px;
    max-width: 350px;
    height: 50px;
    margin-top: 8px;
    cursor: default;
    border-radius: 25px;
    outline: none;
}

.attachment img:hover {
    transform: scale(1.02);
}

.file-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    color: var(--fg);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.06);
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s;
    border: var(--border);
    font-size: 0.9rem;
}

.file-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.edited-tag {
    font-size: 0.6rem;
    opacity: 0.4;
    margin-left: 6px;
    font-style: italic;
}

.controls {
    padding: 16px 24px;
    background: var(--panel-bg);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    backdrop-filter: var(--backdrop);
    border-top: var(--border);
    flex-shrink: 0;
}

#lock-container {
    display: none;
}

#lock-icon {
    font-size: 1.3rem;
    cursor: pointer;
    transition: transform 0.2s;
}

#lock-icon:hover {
    transform: scale(1.15);
}

#reply-indicator {
    position: absolute;
    top: -40px;
    left: 24px;
    background: var(--bg2);
    padding: 8px 16px;
    border-radius: 10px 10px 0 0;
    font-size: 0.8rem;
    color: var(--fg2);
    border: var(--border);
    border-bottom: none;
    backdrop-filter: blur(12px);
    animation: fadeUp 0.2s ease;
}

.clip-btn {
    background: transparent;
    border: var(--border);
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--fg2);
    transition: all 0.25s;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.clip-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.clip-btn.recording {
    color: white;
    background: var(--danger);
    border-color: var(--danger);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(239, 68, 68, 0);
    }

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

#msg-in {
    flex: 1;
    padding: 12px 20px;
    border: var(--border);
    border-radius: 50px;
    background: var(--input-bg);
    color: var(--fg);
    outline: none;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
}

#msg-in:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(255, 255, 255, 0.06);
}

#msg-in::placeholder {
    color: var(--fg2);
    opacity: 0.4;
}

#typing-indicator {
    position: absolute;
    top: -36px;
    left: 24px;
    font-size: 0.8rem;
    color: var(--fg2);
    font-style: italic;
    background: var(--bg2);
    padding: 5px 12px;
    border-radius: 8px;
    border: var(--border);
    animation: fadeUp 0.2s ease;
}

#typing-indicator:empty {
    display: none;
}

.bottom-bar {
    background: var(--panel-bg);
    padding: 8px 24px;
    display: flex;
    justify-content: center;
    border-top: var(--border);
    flex-shrink: 0;
    gap: 8px;
}

.bottom-bar button {
    background: transparent;
    border: var(--border);
    color: var(--fg2);
    padding: 5px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.6;
    transition: all 0.2s;
    font-weight: 500;
}

.bottom-bar button:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent);
    color: var(--accent);
}

#admin-panel {
    padding: 12px 24px;
    background: var(--bg2);
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    border-top: var(--border);
    flex-shrink: 0;
}

#admin-panel button {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: var(--border);
    color: var(--fg2);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
}

#admin-panel button:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.sys-msg {
    text-align: center;
    font-size: 0.7rem;
    color: var(--fg2);
    opacity: 0.5;
    margin: 4px 0;
    font-weight: 500;
    letter-spacing: 0.3px;
}

#announcement-bar {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: white;
    text-align: center;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 100;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

#user-list {
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 16px;
    border: var(--border);
    border-radius: calc(var(--radius) * 0.7);
    padding: 8px;
    background: var(--input-bg);
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background 0.15s;
}

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

.user-actions {
    display: flex;
    gap: 6px;
}

.user-actions button {
    padding: 5px 12px;
    font-size: 0.75rem;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.user-actions button:hover {
    transform: translateY(-1px);
}

.user-actions button.danger {
    background: var(--danger);
}

.user-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.user-form input,
.user-form select {
    flex: 1;
    margin-bottom: 0;
    padding: 10px 14px;
    background: var(--input-bg);
    border: var(--border);
    border-radius: 8px;
    color: var(--fg);
    font-size: 0.85rem;
}

.user-form button {
    padding: 10px 20px;
    background: var(--success);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    position: relative;
    background: var(--panel-bg);
    padding: 32px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 460px;
    box-shadow: var(--shadow), var(--glow);
    animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: var(--border);
    backdrop-filter: blur(24px) saturate(1.5);
}

@keyframes modalIn {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }

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

.close-modal {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--fg2);
    opacity: 0.5;
    transition: all 0.2s;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.close-modal:hover {
    opacity: 1;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.modal h3 {
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--fg);
}

.modal input,
.modal textarea,
.modal select {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: var(--input-bg);
    border: var(--border);
    border-radius: calc(var(--radius) * 0.6);
    color: var(--fg);
    resize: none;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.modal input:focus,
.modal textarea:focus,
.modal select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}

.modal-btns {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-btns button {
    padding: 10px 22px;
    border: none;
    border-radius: calc(var(--radius) * 0.6);
    background: var(--accent);
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.modal-btns button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.modal-btns button.cancel {
    background: transparent;
    border: var(--border);
    color: var(--fg2);
}

.modal-btns button.cancel:hover {
    background: rgba(255, 255, 255, 0.05);
}

.modal-btns button.danger {
    background: var(--danger);
}

.emoji-popup {
    position: absolute;
    bottom: 100%;
    left: 80px;
    background: var(--bg2);
    border: var(--border);
    border-radius: 12px;
    padding: 6px;
    max-height: 240px;
    width: 280px;
    overflow-y: auto;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    z-index: 50;
    display: none;
    animation: fadeUp 0.15s ease;
}

.emoji-popup.show {
    display: block;
}

.emoji-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.9rem;
}

.emoji-item:hover,
.emoji-item.active {
    background: rgba(255, 255, 255, 0.06);
}

.emoji-item .emoji-char {
    font-size: 1.3rem;
    width: 28px;
    text-align: center;
}

.emoji-item .emoji-name {
    color: var(--fg2);
    font-size: 0.8rem;
    font-weight: 500;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

.top-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.msg.sending {
    opacity: 0.5;
}

.msg-status {
    font-size: 0.65rem;
    opacity: 0.5;
    margin-top: 3px;
    text-align: right;
    font-style: italic;
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .login-box,
    .lobby-box {
        width: 92%;
        max-width: 400px;
        padding: 2rem 1.5rem;
    }

    .login-box h1,
    .lobby-box h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .top-bar {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    #room-name {
        font-size: 1rem;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #countdown {
        font-size: 0.95rem;
        padding: 4px 8px;
    }

    .icon-btn {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }

    .logout-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    #chat-area {
        padding: 12px;
        gap: 6px;
    }

    .msg {
        max-width: 90%;
        padding: 10px 14px;
    }

    .msg-text {
        font-size: 0.9rem;
    }

    .controls {
        padding: 10px 16px;
        gap: 8px;
    }

    #msg-in {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .clip-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .bottom-bar {
        padding: 6px 16px;
    }

    .modal {
        padding: 20px;
        width: 94%;
    }

    .modal h3 {
        font-size: 1.2rem;
    }

    .modal-btns {
        flex-direction: column;
    }

    .modal-btns button {
        width: 100%;
        padding: 12px;
    }

    #admin-panel {
        padding: 8px 12px;
    }

    #admin-panel button {
        padding: 6px 10px;
        font-size: 0.75rem;
        flex: 1 1 auto;
    }

    .msg-actions {
        position: static;
        display: flex;
        gap: 6px;
        margin-top: 6px;
        background: none;
        box-shadow: none;
        border: none;
        padding: 0;
    }

    .emoji-popup {
        left: 12px;
        width: calc(100% - 24px);
    }

    #typing-indicator {
        top: -32px;
        left: 16px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 13px;
    }

    .login-box,
    .lobby-box {
        width: 96%;
        padding: 1.5rem 1.2rem;
    }

    .login-box h1,
    .lobby-box h2 {
        font-size: 1.5rem;
    }

    .login-box input,
    .lobby-box input {
        padding: 12px;
    }

    .lobby-btns {
        flex-direction: column;
    }

    .top-bar {
        padding: 8px 12px;
    }

    #room-name {
        font-size: 0.9rem;
        max-width: 90px;
    }

    .icon-btn {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
        border-radius: 8px;
    }

    #chat-area {
        padding: 8px;
        gap: 4px;
    }

    .msg {
        max-width: 95%;
        padding: 8px 12px;
    }

    .controls {
        padding: 8px 12px;
        gap: 6px;
        flex-wrap: wrap;
    }

    #msg-in {
        padding: 10px 14px;
        font-size: 0.9rem;
        border-radius: 25px;
        flex: 1 1 100%;
        min-width: 100%;
        order: 3;
        margin-top: 6px;
    }

    .clip-btn,
    #lock-container {
        flex: 0 0 auto;
        order: 1;
        margin-bottom: 2px;
    }

    .clip-btn {
        width: 34px;
        height: 34px;
    }

    .modal {
        padding: 16px;
        border-radius: 12px;
    }

    .emoji-popup {
        left: 4px;
        width: calc(100% - 8px);
        bottom: 120%;
    }
}