/* ═══════════════════════════════════════════════════════
   VEYLO — DESIGN SYSTEM
   Ultra Premium Futuristic Anonymous Social Platform
═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:wght@300;400;500;600&family=Space+Mono:wght@400;700&display=swap');

:root {
  /* Core Colors */
  --void: #020208;
  --abyss: #07070f;
  --surface: #0d0d1a;
  --surface-2: #12122a;
  --surface-3: #1a1a35;

  /* Neon Palette */
  --violet: #7c3aed;
  --violet-bright: #9d5bf5;
  --violet-glow: rgba(124, 58, 237, 0.4);
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.35);
  --pink: #ec4899;
  --pink-glow: rgba(236, 72, 153, 0.35);
  --blue: #3b82f6;
  --blue-glow: rgba(59, 130, 246, 0.35);
  --emerald: #10b981;
  --amber: #f59e0b;

  /* Glass */
  --glass: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(255, 255, 255, 0.07);
  --glass-strong: rgba(255, 255, 255, 0.1);

  /* Text */
  --text-primary: #f0eeff;
  --text-secondary: rgba(240, 238, 255, 0.6);
  --text-muted: rgba(240, 238, 255, 0.35);
  --text-accent: #c4b5fd;

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;

  /* Spacing */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 16px;
  --gap-lg: 24px;
  --gap-xl: 40px;
  --gap-2xl: 64px;

  /* Radius */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --t-fast: 150ms;
  --t-base: 250ms;
  --t-slow: 450ms;

  /* Shadows */
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.6);
  --shadow-violet: 0 8px 40px var(--violet-glow);
  --shadow-cyan: 0 8px 40px var(--cyan-glow);
  --shadow-pink: 0 8px 40px var(--pink-glow);

  /* Z-index */
  --z-base: 1;
  --z-float: 10;
  --z-overlay: 100;
  --z-modal: 200;
  --z-toast: 300;
  --z-splash: 999;
}

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--void);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--abyss); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--violet); }

/* ── Selection ── */
::selection { background: var(--violet-glow); color: var(--text-primary); }

/* ══════════════════════════════════════════
   ANIMATED BACKGROUND
══════════════════════════════════════════ */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  animation: blobFloat 18s ease-in-out infinite;
}

.bg-blob-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #7c3aed, transparent 70%);
  top: -200px; left: -200px;
  animation-delay: 0s;
}
.bg-blob-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  top: 30%; right: -150px;
  animation-delay: -6s;
}
.bg-blob-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #ec4899, transparent 70%);
  bottom: -100px; left: 30%;
  animation-delay: -12s;
}
.bg-blob-4 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, #3b82f6, transparent 70%);
  bottom: 20%; left: -100px;
  animation-delay: -4s;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 30px) scale(0.95); }
  75% { transform: translate(40px, 20px) scale(1.02); }
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
}

.bg-noise {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ══════════════════════════════════════════
   SPLASH SCREEN
══════════════════════════════════════════ */
.splash {
  position: fixed;
  inset: 0;
  background: var(--void);
  z-index: var(--z-splash);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}

.splash.hidden { opacity: 0; visibility: hidden; }

.splash-logo {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  background: linear-gradient(135deg, #c4b5fd, #7c3aed, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -2px;
  animation: splashPulse 1.5s ease-in-out infinite alternate;
}

@keyframes splashPulse {
  from { filter: drop-shadow(0 0 20px var(--violet-glow)); }
  to { filter: drop-shadow(0 0 50px var(--cyan-glow)); }
}

.splash-loader {
  width: 200px;
  height: 3px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}

.splash-loader-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--cyan), var(--pink));
  border-radius: 999px;
  animation: loaderFill 1.8s ease-in-out forwards;
}

@keyframes loaderFill {
  from { width: 0%; }
  to { width: 100%; }
}

.splash-tag {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

/* ══════════════════════════════════════════
   GLASS COMPONENTS
══════════════════════════════════════════ */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--r-xl);
  transition: all var(--t-base) var(--ease);
}

.glass-card:hover {
  background: var(--glass-hover);
  border-color: rgba(124, 58, 237, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-violet);
}

.glass-inset {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-md);
}

/* ══════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--r-full);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  transition: all var(--t-base) var(--ease-spring);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--t-fast);
}

.btn:hover::after { background: rgba(255,255,255,0.06); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--violet), #5b21b6);
  color: white;
  box-shadow: var(--shadow-violet), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:hover { box-shadow: 0 12px 50px var(--violet-glow), inset 0 1px 0 rgba(255,255,255,0.2); }

.btn-cyan {
  background: linear-gradient(135deg, var(--cyan), #0891b2);
  color: white;
  box-shadow: var(--shadow-cyan), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-cyan:hover { box-shadow: 0 12px 50px var(--cyan-glow); }

.btn-pink {
  background: linear-gradient(135deg, var(--pink), #be185d);
  color: white;
  box-shadow: var(--shadow-pink);
}

.btn-ghost {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  backdrop-filter: blur(12px);
}
.btn-ghost:hover { border-color: var(--violet); color: var(--text-primary); background: var(--glass-hover); }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 16px; }
.btn-icon { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: var(--r-full); }
.btn-icon-sm { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: var(--r-full); }

/* Ripple */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ══════════════════════════════════════════
   NAVIGATION
══════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-float);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-glass {
  background: rgba(2, 2, 8, 0.6);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, #c4b5fd, #7c3aed, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

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

.nav-link {
  padding: 8px 16px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--t-base) var(--ease);
}
.nav-link:hover { color: var(--text-primary); background: var(--glass); }
.nav-link.active { color: var(--text-primary); background: var(--glass); border: 1px solid var(--glass-border); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

/* Mobile Bottom Nav */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: var(--z-float);
  background: rgba(7, 7, 15, 0.85);
  border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}

.mobile-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all var(--t-base) var(--ease);
  position: relative;
}
.mobile-nav-item svg { width: 22px; height: 22px; transition: all var(--t-base) var(--ease-spring); }
.mobile-nav-item.active { color: var(--violet-bright); }
.mobile-nav-item.active svg { transform: scale(1.1); filter: drop-shadow(0 0 8px var(--violet-glow)); }
.mobile-nav-badge {
  position: absolute;
  top: 4px; right: 8px;
  width: 16px; height: 16px;
  background: var(--pink);
  border-radius: 50%;
  font-size: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: white;
  box-shadow: 0 0 8px var(--pink-glow);
}

/* ══════════════════════════════════════════
   HERO SECTION
══════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--r-full);
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  font-size: 12px;
  font-weight: 600;
  color: var(--violet-bright);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 32px;
  animation: fadeInUp 0.8s var(--ease) both;
}

.hero-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 800;
  letter-spacing: -3px;
  line-height: 0.95;
  margin-bottom: 24px;
  animation: fadeInUp 0.8s var(--ease) 0.1s both;
}

.hero-title-line {
  display: block;
}

.hero-title-gradient {
  background: linear-gradient(135deg, #f0eeff 0%, #c4b5fd 30%, #7c3aed 60%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title-glow {
  background: linear-gradient(135deg, #ec4899, #7c3aed, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 40px rgba(124,58,237,0.5));
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 48px;
  line-height: 1.7;
  animation: fadeInUp 0.8s var(--ease) 0.2s both;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeInUp 0.8s var(--ease) 0.3s both;
  margin-bottom: 80px;
}

/* ══════════════════════════════════════════
   STATS BAR
══════════════════════════════════════════ */
.stats-bar {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  padding: 0;
  overflow: hidden;
  backdrop-filter: blur(20px);
  animation: fadeInUp 0.8s var(--ease) 0.4s both;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  position: relative;
}

.stat-item + .stat-item::before {
  content: '';
  position: absolute;
  left: 0; top: 25%; bottom: 25%;
  width: 1px;
  background: var(--glass-border);
}

.stat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}
.stat-dot-green { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }
.stat-dot-violet { background: var(--violet); box-shadow: 0 0 8px var(--violet-glow); animation-delay: 0.5s; }
.stat-dot-cyan { background: var(--cyan); box-shadow: 0 0 8px var(--cyan-glow); animation-delay: 1s; }
.stat-dot-pink { background: var(--pink); box-shadow: 0 0 8px var(--pink-glow); animation-delay: 1.5s; }
.stat-dot-amber { background: var(--amber); box-shadow: 0 0 8px rgba(245,158,11,0.5); animation-delay: 0.7s; }

.stat-num {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ══════════════════════════════════════════
   ROOM LOBBY
══════════════════════════════════════════ */
.section {
  position: relative;
  z-index: 1;
  padding: var(--gap-2xl) var(--gap-xl);
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-primary);
}

.section-title span {
  background: linear-gradient(135deg, var(--violet-bright), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-sub { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  margin-bottom: 28px;
}
.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  padding: 8px 18px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  white-space: nowrap;
  transition: all var(--t-base) var(--ease);
}
.filter-tab:hover { color: var(--text-primary); border-color: var(--violet); }
.filter-tab.active {
  background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(6,182,212,0.2));
  border-color: var(--violet);
  color: var(--text-primary);
  box-shadow: 0 0 20px rgba(124,58,237,0.2);
}

/* Room Grid */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.room-card {
  position: relative;
  padding: 20px;
  border-radius: var(--r-xl);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  transition: all var(--t-base) var(--ease);
  cursor: pointer;
  overflow: hidden;
}

.room-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, transparent 0%, rgba(124,58,237,0.05) 100%);
  opacity: 0;
  transition: opacity var(--t-base);
}

.room-card:hover {
  border-color: rgba(124,58,237,0.4);
  transform: translateY(-3px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 40px rgba(124,58,237,0.15);
}
.room-card:hover::before { opacity: 1; }

.room-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}

.room-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.room-icon-gaming { background: rgba(124,58,237,0.2); }
.room-icon-music { background: rgba(236,72,153,0.2); }
.room-icon-chill { background: rgba(16,185,129,0.2); }
.room-icon-study { background: rgba(245,158,11,0.2); }
.room-icon-anon { background: rgba(6,182,212,0.2); }
.room-icon-late { background: rgba(99,102,241,0.2); }

.room-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-live {
  background: rgba(16,185,129,0.2);
  color: var(--emerald);
  border: 1px solid rgba(16,185,129,0.3);
  animation: livePulse 2s infinite;
}
.badge-live::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--emerald);
  animation: pulse 2s infinite;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.3); }
  50% { box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}
.badge-game {
  background: rgba(124,58,237,0.2);
  color: var(--violet-bright);
  border: 1px solid rgba(124,58,237,0.3);
}
.badge-voice {
  background: rgba(6,182,212,0.2);
  color: var(--cyan);
  border: 1px solid rgba(6,182,212,0.3);
}
.badge-new {
  background: rgba(236,72,153,0.2);
  color: var(--pink);
  border: 1px solid rgba(236,72,153,0.3);
}

.room-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.room-category {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.room-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--glass-border);
  gap: 12px;
}

.room-users {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.user-avatars {
  display: flex;
}
.user-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--void);
  margin-left: -8px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 9px;
  font-weight: 700;
}
.user-avatar:first-child { margin-left: 0; }

.room-activity {
  height: 24px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}
.activity-bar {
  width: 3px;
  background: var(--violet);
  border-radius: 2px;
  animation: barPulse 1.2s ease-in-out infinite;
  opacity: 0.5;
}
.activity-bar:nth-child(1) { height: 8px; animation-delay: 0s; }
.activity-bar:nth-child(2) { height: 16px; animation-delay: 0.2s; }
.activity-bar:nth-child(3) { height: 12px; animation-delay: 0.4s; }
.activity-bar:nth-child(4) { height: 20px; animation-delay: 0.1s; }
.activity-bar:nth-child(5) { height: 10px; animation-delay: 0.3s; }
@keyframes barPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.7); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ══════════════════════════════════════════
   CHAT PAGE
══════════════════════════════════════════ */
.chat-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.chat-sidebar {
  width: 320px;
  flex-shrink: 0;
  background: rgba(7, 7, 15, 0.9);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(30px);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--glass-border);
}

.sidebar-search {
  position: relative;
  margin-top: 12px;
}
.sidebar-search input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--t-base);
}
.sidebar-search input:focus { border-color: var(--violet); }
.sidebar-search input::placeholder { color: var(--text-muted); }
.sidebar-search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px; height: 16px;
}

.sidebar-rooms {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}

.sidebar-room-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all var(--t-base) var(--ease);
  position: relative;
}
.sidebar-room-item:hover { background: var(--glass); }
.sidebar-room-item.active { background: rgba(124,58,237,0.15); border: 1px solid rgba(124,58,237,0.2); }

.sidebar-room-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  position: relative;
}
.online-dot {
  position: absolute;
  bottom: -1px; right: -1px;
  width: 10px; height: 10px;
  background: var(--emerald);
  border: 2px solid var(--void);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--emerald);
}

.sidebar-room-info { flex: 1; min-width: 0; }
.sidebar-room-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-room-preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.sidebar-room-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.sidebar-time { font-size: 11px; color: var(--text-muted); }
.sidebar-unread {
  min-width: 18px; height: 18px;
  background: var(--violet);
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
  box-shadow: 0 0 10px var(--violet-glow);
}

/* Chat Main */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--abyss);
  position: relative;
}

.chat-header {
  padding: 16px 24px;
  background: rgba(7,7,15,0.8);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 2;
}

.chat-header-info { flex: 1; min-width: 0; }
.chat-room-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
}
.chat-room-status {
  font-size: 12px;
  color: var(--emerald);
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-room-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
  animation: pulse 2s infinite;
}

.chat-header-actions { display: flex; align-items: center; gap: 8px; }

/* Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Date Divider */
.date-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.date-divider::before,
.date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}
.date-divider span {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 4px 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
}

/* Message Bubbles */
.message-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.message-row.own { flex-direction: row-reverse; }

.message-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  align-self: flex-end;
}
.message-avatar.placeholder { opacity: 0; }

.message-content { max-width: 65%; display: flex; flex-direction: column; gap: 2px; }
.message-row.own .message-content { align-items: flex-end; }

.message-sender {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  padding: 0 12px;
}

.message-bubble {
  padding: 10px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  position: relative;
  animation: msgSlideIn 0.3s var(--ease-spring) both;
}

@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.message-bubble-in {
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
}
.message-bubble-in:first-child { border-top-left-radius: 18px; }
.message-bubble-in:last-child { border-bottom-left-radius: 4px; }

.message-bubble-out {
  background: linear-gradient(135deg, var(--violet), #5b21b6);
  border-bottom-right-radius: 4px;
  color: white;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  margin-top: 2px;
}
.message-time {
  font-size: 10px;
  color: var(--text-muted);
}
.message-status { width: 14px; height: 14px; color: var(--cyan); }

/* Emoji reaction */
.message-reactions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 4px 6px;
}
.reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--t-fast);
}
.reaction-pill:hover { border-color: var(--violet); transform: scale(1.1); }
.reaction-count { font-size: 11px; color: var(--text-secondary); }

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  animation: fadeInUp 0.3s var(--ease) both;
}
.typing-bubble {
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.typing-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}
.typing-text {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Chat Input */
.chat-input-area {
  padding: 16px 24px;
  background: rgba(7,7,15,0.8);
  border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.chat-input-wrap {
  flex: 1;
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px;
  transition: border-color var(--t-base);
}
.chat-input-wrap:focus-within { border-color: var(--violet); }

.chat-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text-primary);
  resize: none;
  max-height: 120px;
  line-height: 1.5;
  padding: 4px 0;
}
.chat-input::placeholder { color: var(--text-muted); }

.input-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.input-action-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-base);
  flex-shrink: 0;
}
.input-action-btn:hover { color: var(--violet-bright); background: rgba(124,58,237,0.15); }
.input-action-btn svg { width: 18px; height: 18px; }

.send-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), #5b21b6);
  color: white;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-violet);
  transition: all var(--t-base) var(--ease-spring);
}
.send-btn:hover { transform: scale(1.1); box-shadow: 0 8px 30px var(--violet-glow); }
.send-btn svg { width: 18px; height: 18px; }

/* Voice Record Button */
.voice-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--t-base) var(--ease-spring);
}
.voice-btn.recording {
  background: rgba(236,72,153,0.3);
  border-color: var(--pink);
  color: var(--pink);
  box-shadow: 0 0 20px var(--pink-glow);
  animation: recordPulse 1.5s infinite;
}
@keyframes recordPulse {
  0%, 100% { box-shadow: 0 0 10px var(--pink-glow); }
  50% { box-shadow: 0 0 30px var(--pink-glow); }
}

/* ══════════════════════════════════════════
   RANDOM MATCH PAGE
══════════════════════════════════════════ */
.match-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  position: relative;
  z-index: 1;
}

.match-status {
  text-align: center;
  margin-bottom: 48px;
}
.match-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
}
.match-sub {
  font-size: 15px;
  color: var(--text-secondary);
}

.match-animation {
  position: relative;
  width: 200px; height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 48px;
}

.match-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  animation: matchSpin 3s linear infinite;
}
.match-ring-1 {
  border-top-color: var(--violet);
  border-right-color: var(--violet);
  box-shadow: 0 0 20px var(--violet-glow);
}
.match-ring-2 {
  inset: 20px;
  border-bottom-color: var(--cyan);
  border-left-color: var(--cyan);
  animation-direction: reverse;
  animation-duration: 2s;
  box-shadow: 0 0 15px var(--cyan-glow);
}
.match-ring-3 {
  inset: 40px;
  border-top-color: var(--pink);
  animation-duration: 1.5s;
  box-shadow: 0 0 10px var(--pink-glow);
}
@keyframes matchSpin { to { transform: rotate(360deg); } }

.match-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}

.match-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Connected State */
.match-connected {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
  max-width: 800px;
  margin-bottom: 24px;
}

.user-panel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.user-panel.you { border-color: rgba(124,58,237,0.3); background: rgba(124,58,237,0.05); }
.user-panel.stranger { border-color: rgba(6,182,212,0.3); background: rgba(6,182,212,0.05); }

.user-avatar-lg {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  position: relative;
}
.you .user-avatar-lg { background: linear-gradient(135deg, var(--violet), #5b21b6); }
.stranger .user-avatar-lg { background: linear-gradient(135deg, var(--cyan), #0891b2); }

.speaking-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px solid var(--cyan);
  animation: speakingPulse 1s ease-in-out infinite;
  opacity: 0;
}
.speaking-ring.active { opacity: 1; }
@keyframes speakingPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 0.3; }
}

.user-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}
.user-tag {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ══════════════════════════════════════════
   GAMES
══════════════════════════════════════════ */
.game-wrapper {
  max-width: 600px;
  margin: 0 auto;
}

.game-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.game-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.game-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

/* Tic-Tac-Toe */
.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 24px;
  max-width: 320px;
  margin: 0 auto;
}

.ttt-cell {
  aspect-ratio: 1;
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  cursor: pointer;
  transition: all var(--t-base) var(--ease-spring);
  position: relative;
  overflow: hidden;
}
.ttt-cell:hover:not(.taken) { border-color: var(--violet); background: rgba(124,58,237,0.1); transform: scale(1.02); }
.ttt-cell.taken { cursor: default; }
.ttt-cell.x { color: var(--cyan); text-shadow: 0 0 20px var(--cyan-glow); }
.ttt-cell.o { color: var(--pink); text-shadow: 0 0 20px var(--pink-glow); }
.ttt-cell.win-cell {
  border-color: var(--violet);
  background: rgba(124,58,237,0.2);
  animation: winFlash 0.5s ease-in-out 3;
}
@keyframes winFlash {
  0%, 100% { background: rgba(124,58,237,0.2); }
  50% { background: rgba(124,58,237,0.4); }
}

.ttt-symbol {
  animation: symbolPop 0.3s var(--ease-spring) both;
}
@keyframes symbolPop {
  from { transform: scale(0) rotate(-30deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Game turn indicator */
.turn-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--glass-inset);
  border-radius: var(--r-lg);
  margin: 16px 24px;
}

.player-turn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  opacity: 0.4;
  transition: all var(--t-base);
}
.player-turn.active {
  opacity: 1;
  background: rgba(124,58,237,0.2);
  border: 1px solid rgba(124,58,237,0.4);
}
.player-turn-symbol {
  font-size: 20px;
}

/* Dice */
.dice-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px;
}

.dice {
  width: 60px; height: 60px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 2px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  cursor: pointer;
  transition: all var(--t-base) var(--ease-spring);
  box-shadow: var(--shadow-md);
}
.dice:hover { border-color: var(--violet); transform: scale(1.05) rotate(5deg); }
.dice.rolling { animation: diceRoll 0.5s ease-in-out; }
@keyframes diceRoll {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(90deg) scale(1.1); }
  50% { transform: rotate(180deg) scale(0.9); }
  75% { transform: rotate(270deg) scale(1.05); }
}

/* Snake board */
.snake-board {
  display: grid;
  gap: 2px;
  padding: 16px;
  margin: 0 auto;
  max-width: 400px;
}
.snake-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
  position: relative;
  overflow: hidden;
  transition: background var(--t-fast);
}
.snake-cell.player-1 { background: rgba(124,58,237,0.6); box-shadow: inset 0 0 8px rgba(124,58,237,0.5); }
.snake-cell.player-2 { background: rgba(6,182,212,0.6); box-shadow: inset 0 0 8px rgba(6,182,212,0.5); }
.snake-cell.snake { background: rgba(16,185,129,0.4); }
.snake-cell.ladder { background: rgba(245,158,11,0.4); }
.snake-cell.num { font-size: 7px; }

/* ══════════════════════════════════════════
   DRAW TOGETHER
══════════════════════════════════════════ */
.draw-canvas-wrap {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: #fff;
}

.draw-canvas {
  display: block;
  width: 100%;
  touch-action: none;
  cursor: crosshair;
}

.draw-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  flex-wrap: wrap;
}

.color-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all var(--t-base) var(--ease-spring);
}
.color-swatch:hover, .color-swatch.active { border-color: white; transform: scale(1.2); }

.brush-size {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brush-size input[type=range] {
  -webkit-appearance: none;
  width: 80px;
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  outline: none;
}
.brush-size input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--violet);
  cursor: pointer;
}

/* ══════════════════════════════════════════
   VOICE ROOM
══════════════════════════════════════════ */
.voice-room {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px;
  gap: 32px;
}

.voice-users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 600px;
}

.voice-user-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  transition: all var(--t-base);
}
.voice-user-card.speaking {
  border-color: var(--cyan);
  background: rgba(6,182,212,0.1);
  box-shadow: 0 0 30px var(--cyan-glow);
}

.voice-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 20px;
  position: relative;
}

.voice-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  opacity: 0;
  animation: voiceRing 1.5s ease-out infinite;
}
.speaking .voice-ring { opacity: 1; }
@keyframes voiceRing {
  from { transform: scale(0.9); opacity: 0.8; }
  to { transform: scale(1.3); opacity: 0; }
}

.voice-username { font-size: 12px; font-weight: 600; text-align: center; }
.voice-muted-icon { color: var(--text-muted); }

.voice-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.voice-ctrl-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-base) var(--ease-spring);
  border: 1px solid var(--glass-border);
}
.voice-ctrl-btn:hover { transform: scale(1.05); }
.voice-ctrl-btn.mic { background: rgba(124,58,237,0.2); color: var(--violet-bright); }
.voice-ctrl-btn.mic.muted { background: rgba(236,72,153,0.2); color: var(--pink); }
.voice-ctrl-btn.leave { background: rgba(239,68,68,0.2); color: #ef4444; }

/* ══════════════════════════════════════════
   MEDIA PREVIEW
══════════════════════════════════════════ */
.media-preview {
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  max-width: 280px;
}
.media-preview img, .media-preview video {
  width: 100%;
  display: block;
  border-radius: inherit;
  transition: filter var(--t-base);
}
.media-preview.blurred img, .media-preview.blurred video {
  filter: blur(20px);
}
.media-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--t-base);
}
.media-preview:hover .media-overlay { opacity: 1; }
.tap-to-view {
  background: rgba(0,0,0,0.7);
  padding: 8px 16px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
}

/* File attachment */
.file-bubble {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  min-width: 200px;
}
.file-icon-wrap {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  background: rgba(124,58,237,0.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.file-icon-wrap svg { color: var(--violet-bright); width: 20px; height: 20px; }
.file-info { min-width: 0; }
.file-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 11px; color: var(--text-muted); }

/* ══════════════════════════════════════════
   MODALS
══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--t-base);
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(20px);
  transition: transform var(--t-base) var(--ease-spring);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--glass);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-base);
}
.modal-close:hover { color: var(--text-primary); background: var(--glass-hover); }

.modal-body { margin-bottom: 24px; }
.modal-footer { display: flex; gap: 12px; justify-content: flex-end; }

/* Input field */
.input-group { margin-bottom: 16px; }
.input-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; display: block; }
.input-field {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--t-base);
}
.input-field:focus { border-color: var(--violet); }
.input-field::placeholder { color: var(--text-muted); }

/* ══════════════════════════════════════════
   TOASTS
══════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 80px; right: 16px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
  max-width: 320px;
  font-size: 14px;
  pointer-events: all;
  animation: toastSlide 0.4s var(--ease-spring) both;
}
.toast.exit { animation: toastSlide 0.3s var(--ease) reverse both; }

@keyframes toastSlide {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-icon { width: 20px; height: 20px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--emerald); }
.toast.error .toast-icon { color: #ef4444; }
.toast.info .toast-icon { color: var(--violet-bright); }
.toast.warning .toast-icon { color: var(--amber); }

/* ══════════════════════════════════════════
   WINNER POPUP
══════════════════════════════════════════ */
.winner-popup {
  text-align: center;
  padding: 40px;
}
.winner-emoji {
  font-size: 64px;
  margin-bottom: 16px;
  animation: winnerBounce 0.6s var(--ease-spring) both;
}
@keyframes winnerBounce {
  from { transform: scale(0) rotate(-20deg); opacity: 0; }
  70% { transform: scale(1.2) rotate(5deg); }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}
.winner-text {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ══════════════════════════════════════════
   SETTINGS
══════════════════════════════════════════ */
.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  transition: background var(--t-base);
}
.setting-row:hover { background: var(--glass-hover); }
.setting-info { display: flex; flex-direction: column; gap: 2px; }
.setting-name { font-weight: 600; font-size: 14px; }
.setting-desc { font-size: 12px; color: var(--text-muted); }

/* Toggle */
.toggle {
  position: relative;
  width: 44px; height: 24px;
  background: var(--surface-3);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background var(--t-base);
}
.toggle.on { background: var(--violet); }
.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform var(--t-base) var(--ease-spring);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.toggle.on::after { transform: translateX(20px); }

/* ══════════════════════════════════════════
   LEGAL PAGES
══════════════════════════════════════════ */
.legal-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 120px 24px 80px;
  position: relative;
  z-index: 1;
}

.legal-hero {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--glass-border);
}
.legal-hero-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--violet-bright);
  font-family: var(--font-mono);
  margin-bottom: 12px;
}
.legal-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
}
.legal-date { font-size: 13px; color: var(--text-muted); }

.legal-toc {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 24px;
  margin-bottom: 48px;
}
.legal-toc-title {
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 16px;
  font-size: 15px;
}
.legal-toc a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  color: var(--text-secondary);
  font-size: 14px;
  transition: color var(--t-base);
  border-bottom: 1px solid var(--glass-border);
}
.legal-toc a:last-child { border-bottom: none; }
.legal-toc a:hover { color: var(--violet-bright); }
.toc-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.legal-section { margin-bottom: 48px; }
.legal-section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}
.legal-section-title::before {
  content: '';
  width: 4px; height: 24px;
  background: linear-gradient(to bottom, var(--violet), var(--cyan));
  border-radius: 2px;
  flex-shrink: 0;
}
.legal-body {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.8;
}
.legal-body p { margin-bottom: 16px; }
.legal-body ul { padding-left: 20px; margin-bottom: 16px; }
.legal-body li { margin-bottom: 8px; position: relative; list-style: disc; }
.legal-body li::marker { color: var(--violet); }
.legal-body strong { color: var(--text-primary); }
.legal-highlight {
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14px;
  color: var(--text-secondary);
}
.legal-highlight strong { color: var(--violet-bright); }

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.footer {
  position: relative;
  z-index: 1;
  padding: 64px 40px 32px;
  border-top: 1px solid var(--glass-border);
  background: rgba(2,2,8,0.8);
  backdrop-filter: blur(20px);
  margin-top: 80px;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #c4b5fd, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}
.footer-brand-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 280px;
}

.footer-col-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-link {
  font-size: 14px;
  color: var(--text-muted);
  transition: color var(--t-base);
}
.footer-link:hover { color: var(--text-primary); }

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
}
.footer-socials { display: flex; gap: 12px; }
.social-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-base);
}
.social-btn:hover { border-color: var(--violet); color: var(--violet-bright); background: rgba(124,58,237,0.1); }
.social-btn svg { width: 16px; height: 16px; }

/* ══════════════════════════════════════════
   ANIMATIONS & UTILITIES
══════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.fade-in-up { animation: fadeInUp 0.6s var(--ease) both; }
.fade-in { animation: fadeIn 0.5s var(--ease) both; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--gap-sm); }
.gap-md { gap: var(--gap-md); }
.gap-lg { gap: var(--gap-lg); }
.w-full { width: 100%; }
.relative { position: relative; }
.z-1 { position: relative; z-index: 1; }
.mt-auto { margin-top: auto; }
.mb-0 { margin-bottom: 0; }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .chat-sidebar { width: 280px; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-nav { display: block; }
  body { padding-bottom: 72px; }

  .stats-bar {
    flex-wrap: wrap;
    border-radius: var(--r-xl);
    justify-content: center;
  }
  .stat-item { flex: 0 0 auto; }
  .stat-item + .stat-item::before { display: none; }

  .hero { padding: 100px 20px 60px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn-lg { width: 100%; justify-content: center; }

  .rooms-grid { grid-template-columns: 1fr; }
  .section { padding: 40px 16px; }

  .chat-sidebar { display: none; }
  .chat-sidebar.mobile-open {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: var(--z-overlay);
    width: 100%;
  }

  .match-connected { grid-template-columns: 1fr; }

  .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .footer { padding: 40px 20px 24px; }
  .footer-bottom { flex-direction: column; text-align: center; }

  .chat-messages { padding: 16px; }
  .chat-input-area { padding: 12px 16px; }

  .modal { padding: 24px 20px; }

  .ttt-board { max-width: 280px; }
  .ttt-cell { font-size: 32px; }
}

@media (max-width: 480px) {
  .hero-title { letter-spacing: -2px; }
  .stats-bar { width: 100%; border-radius: var(--r-xl); }
  .stat-item { padding: 10px 14px; }
  .stat-label { display: none; }
  .filter-tab { padding: 6px 14px; font-size: 12px; }
}

/* ══════════════════════════════════════════
   LIGHT MODE
══════════════════════════════════════════ */
body.light-mode {
  --void: #f8f8ff;
  --abyss: #f0f0fa;
  --surface: #e8e8f5;
  --surface-2: #e0e0ef;
  --surface-3: #d0d0e8;
  --glass: rgba(255,255,255,0.6);
  --glass-border: rgba(0,0,0,0.08);
  --glass-hover: rgba(255,255,255,0.8);
  --text-primary: #1a1a2e;
  --text-secondary: rgba(26,26,46,0.65);
  --text-muted: rgba(26,26,46,0.4);
  --text-accent: #7c3aed;
  --shadow-md: 0 8px 32px rgba(0,0,0,0.12);
}

/* ══════════════════════════════════════════
   FLOATING PARTICLES
══════════════════════════════════════════ */
.particles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.particle {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: var(--violet);
  opacity: 0;
  animation: particleFloat linear infinite;
}
@keyframes particleFloat {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.3; }
  100% { transform: translateY(-100px) scale(1); opacity: 0; }
}

/* PWA install banner */
.pwa-banner {
  position: fixed;
  bottom: 80px; left: 16px; right: 16px;
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: var(--z-overlay);
  box-shadow: var(--shadow-lg);
  animation: slideUpIn 0.4s var(--ease-spring);
}
@keyframes slideUpIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.pwa-icon {
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.pwa-info { flex: 1; }
.pwa-title { font-weight: 700; font-size: 14px; }
.pwa-sub { font-size: 12px; color: var(--text-muted); }
