/* =========================================================
 * ELITECRYPT · Main stylesheet
 * Extracted from index.html <style> block (V19 R1 refactor).
 * Contents are byte-identical to the original inline block.
 * No rules added, removed, or reordered.
 * ========================================================= */
/* ═══════════════════════════════════════════════════════════════
   ELITECRYPT — CYBER LUXURY DESIGN SYSTEM v3.0
   Ästhetik: Deep Black · Neon Cyan · Violett · Gold
   ═══════════════════════════════════════════════════════════════ */

/* ── Google Fonts: Poppins + Space Grotesk + JetBrains Mono ── */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
  /* Core Backgrounds */
  --bg:        #000000;
  --bg2:       #050508;
  --bg3:       #0a0a12;
  --bg4:       #0f0f1a;

  /* Borders */
  --border:    rgba(120,100,255,0.12);
  --border-hi: rgba(0,255,255,0.25);

  /* Accent Colors */
  --accent:    #7c6af7;
  --accent-hi: #9b8fff;
  --cyan:      #00ffff;
  --cyan-dim:  #00cccc;
  --purple:    #9333ea;
  --gold:      #ffd700;
  --gold-dim:  #ccaa00;
  --danger:    #ff3355;
  --green:     #00ff88;

  /* Typography */
  --text:      #e8e8f2;
  --text2:     #7070a0;
  --text3:     #404060;
  --font:      'Poppins', 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', 'Space Mono', monospace;

  /* FX */
  --glow-cyan:   0 0 20px rgba(0,255,255,0.35), 0 0 60px rgba(0,255,255,0.12);
  --glow-purple: 0 0 20px rgba(147,51,234,0.4), 0 0 60px rgba(147,51,234,0.15);
  --glow-gold:   0 0 15px rgba(255,215,0,0.4),  0 0 40px rgba(255,215,0,0.12);
  --glass:       rgba(255,255,255,0.025);
  --glass-hi:    rgba(255,255,255,0.05);
  --blur:        blur(30px) saturate(180%);
  --blur-heavy:  blur(60px) saturate(200%);

  /* Spacing */
  --radius:    14px;
  --radius-lg: 22px;
  --radius-xl: 32px;

  /* Accent legacy aliases */
  --accent2: var(--cyan);
  --resend-purple: var(--accent);
  --resend-cyan:   var(--cyan);
}

/* ── Neon Glow Animations ──────────────────────────────────── */
@keyframes neonPulse {
  0%,100% { text-shadow: 0 0 10px rgba(0,255,255,0.6), 0 0 30px rgba(0,255,255,0.3), 0 0 60px rgba(0,255,255,0.1); }
  50%     { text-shadow: 0 0 20px rgba(0,255,255,0.9), 0 0 50px rgba(0,255,255,0.5), 0 0 100px rgba(0,255,255,0.2); }
}
@keyframes neonPulseGold {
  0%,100% { text-shadow: 0 0 10px rgba(255,215,0,0.5), 0 0 25px rgba(255,215,0,0.2); }
  50%     { text-shadow: 0 0 20px rgba(255,215,0,0.8), 0 0 50px rgba(255,215,0,0.4); }
}
@keyframes neonBorderSpin {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes cyberFadeIn {
  from { opacity:0; transform:translateY(24px) scale(0.97); filter:blur(4px); }
  to   { opacity:1; transform:translateY(0)    scale(1);    filter:blur(0); }
}
@keyframes cyberSlideIn {
  from { opacity:0; transform:translateX(-20px); }
  to   { opacity:1; transform:translateX(0); }
}
@keyframes gradientFlow {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}
@keyframes scanLine {
  0%   { transform:translateY(-100%); }
  100% { transform:translateY(100vh); }
}
@keyframes pulse   { 0%,100%{transform:scale(1)opacity:.8} 50%{transform:scale(1.05)opacity:1} }
@keyframes msg     { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
@keyframes slide   { from{transform:translateY(40px);opacity:0} to{transform:none;opacity:1} }
@keyframes shake   { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
@keyframes blink   { 0%,100%{opacity:1} 50%{opacity:0} }
@keyframes tdot    { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }
@keyframes sp      { from{transform:rotate(0)} to{transform:rotate(360deg)} }
@keyframes mic     { 0%,100%{box-shadow:0 0 0 0 rgba(255,71,87,.4)} 70%{box-shadow:0 0 0 10px rgba(255,71,87,0)} }
@keyframes gradient{ 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
@keyframes fade    { from{opacity:0} to{opacity:1} }
@keyframes float   { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
@keyframes spin    { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }
@keyframes callPulse{ 0%,100%{box-shadow:0 0 0 0 rgba(46,204,113,.4)} 70%{box-shadow:0 0 0 16px rgba(46,204,113,0)} }
@keyframes typing  { 0%,100%{opacity:.3} 50%{opacity:1} }
@keyframes online  { 0%,100%{box-shadow:0 0 0 0 rgba(0,255,136,.4)} 70%{box-shadow:0 0 0 8px rgba(0,255,136,0)} }
@keyframes lockoutGlitch {
  0%,100%{ opacity:1; transform:none; }
  25%{ opacity:.85; transform:translateX(-3px) skew(-0.5deg); filter:hue-rotate(15deg); }
  50%{ opacity:.9;  transform:translateX(3px) skew(0.5deg); }
  75%{ opacity:.8;  transform:translateX(-1px); filter:hue-rotate(-15deg); }
}
@keyframes glitchPulse {
  0%,100%{ text-shadow:0 0 20px #ff0000,0 0 40px #ff0000; }
  50%{ text-shadow:0 0 40px #ff0000,0 0 80px #ff0000,3px 0 #ff0000,-3px 0 #00ffff; }
}
@keyframes stagger {
  from{ opacity:0; transform:translateY(16px); }
  to  { opacity:1; transform:translateY(0); }
}
@keyframes revealUp {
  from{ opacity:0; transform:translateY(40px) scale(0.96); }
  to  { opacity:1; transform:translateY(0) scale(1); }
}
@keyframes borderGlow {
  0%,100%{ border-color:rgba(0,255,255,0.2); box-shadow:0 0 10px rgba(0,255,255,0.05); }
  50%    { border-color:rgba(0,255,255,0.5); box-shadow:0 0 20px rgba(0,255,255,0.15); }
}
@keyframes slide-up { from{transform:translateY(100%);opacity:0} to{transform:translateY(0);opacity:1} }

/* ── Base Reset ────────────────────────────────────────────── */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html { overflow:hidden; -webkit-tap-highlight-color:transparent; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  height: 100svh;
  overflow: hidden;
  position: relative;
  display: block;
}

/* Scanline-Overlay (subtil, gibt Depth) */
body::after {
  content:'';
  position:fixed;
  inset:0;
  pointer-events:none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,255,255,0.008) 2px,
    rgba(0,255,255,0.008) 4px
  );
  z-index:99997;
}

/* ── Screen System ─────────────────────────────────────────── */
.screen {
  display: none;
  position: fixed;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  z-index: 1;
}
.screen.active { display:block; animation: cyberFadeIn 0.4s cubic-bezier(.16,1,.3,1) both; }


/* ════════════════════════════════════════════════════
   V12 MASTER FIX — Icons · Vault · Footer · Mobile
════════════════════════════════════════════════════ */

/* ── TOP BAR ICONS: Rock-solid sticky positioning ── */
.top-bar,
.chat-top-bar {
  position: sticky !important;
  top: 0;
  z-index: 1000 !important;
  /* Prevent invisible elements stealing pointer events */
  pointer-events: auto;
  will-change: transform;
}
.top-bar > *,
.chat-top-bar > * {
  pointer-events: auto;
  position: relative;
  z-index: 2;
}
.icon-btn {
  pointer-events: auto !important;
  position: relative;
  z-index: 3;
  /* Ensure visible at all times - no visibility:hidden race conditions */
  opacity: 1 !important;
  visibility: visible !important;
  /* V12 Glass look */
  background: rgba(20, 10, 40, 0.6) !important;
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  border: 1px solid rgba(138, 43, 226, 0.25) !important;
}
.icon-btn:hover {
  border-color: rgba(0, 209, 255, 0.5) !important;
  box-shadow: 0 0 20px rgba(138, 43, 226, 0.3),
              inset 0 0 10px rgba(0, 209, 255, 0.1);
  color: #00D1FF !important;
  transform: scale(1.08);
}

/* ── VAULT SCREEN: Remove invisible click-blockers ── */
#vault-screen {
  min-height: 100dvh !important;
  min-height: 100vh !important;
  max-height: 100dvh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  background: #000 !important;
}
#vault-screen > *:first-child {
  /* Top bar stays fixed */
  flex-shrink: 0;
}
#vault-screen .vault-content,
#vault-screen > div:not(.top-bar):not(.chat-top-bar) {
  flex: 1;
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  position: relative;
  z-index: 1;
}

/* Kill all invisible overlays that might block clicks inside vault */
#vault-screen::before,
#vault-screen::after,
#rooms-screen::before,
#rooms-screen::after {
  pointer-events: none !important;
}

/* Buttons + interactive elements always clickable */
#vault-screen button,
#vault-screen a,
#vault-screen .icon-btn,
#vault-screen [onclick],
#rooms-screen button,
#rooms-screen [onclick] {
  pointer-events: auto !important;
  position: relative;
  z-index: 2;
}

/* ── DESIGN-SYNC: Rooms + Vault OLED Black ── */
#rooms-screen,
#chat-screen,
#vault-screen {
  background: #000000 !important;
}
#rooms-screen .top-bar,
#chat-screen .chat-top-bar,
#vault-screen .top-bar {
  background: rgba(0, 0, 0, 0.92) !important;
  border-bottom: 1px solid rgba(138, 43, 226, 0.15) !important;
}
#rooms-screen .top-bar-title,
#vault-screen .top-bar-title {
  background: linear-gradient(135deg, #fff 0%, #8A2BE2 50%, #00D1FF 100%) !important;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Rooms list items - OLED glass */
.room-item, .chat-msg-card {
  background: rgba(20, 10, 40, 0.4) !important;
  border: 1px solid rgba(138, 43, 226, 0.15) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.room-item:hover {
  background: rgba(30, 15, 60, 0.6) !important;
  border-color: rgba(0, 209, 255, 0.3) !important;
}

/* ── FOOTER MOBILE CLICK FIX ── */
#v11-legal-footer {
  pointer-events: auto !important;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 2147483647 !important;
  cursor: default;
}
#v11-legal-footer a {
  pointer-events: auto !important;
  cursor: pointer !important;
  display: inline-block;
  padding: 10px 8px !important;
  margin: -4px 4px !important;
  min-height: 44px;
  min-width: 44px;
  vertical-align: middle;
  line-height: 24px;
  -webkit-tap-highlight-color: rgba(138,43,226,0.3);
  touch-action: manipulation;
  position: relative;
  z-index: 1;
}
#v11-legal-footer a:active {
  background: rgba(138,43,226,0.2);
  border-radius: 6px;
}

/* Anti-Screenshot: window.onblur CSS-Blur */
body.ec-blur-active::after {
  content: '🔒 EliteCrypt gesichert';
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 2147483646;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8A2BE2;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.05em;
  pointer-events: none;
}

/* Web-Worker Loading Animation - Elite Style */
#v12-crypt-loader {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  background: radial-gradient(circle at center, #0a0514 0%, #000 80%);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  pointer-events: none;
}
#v12-crypt-loader.active { display: flex; }
.v12-crypt-ring {
  width: 80px; height: 80px;
  border: 3px solid rgba(138,43,226,0.15);
  border-top-color: #8A2BE2;
  border-right-color: #00D1FF;
  border-radius: 50%;
  animation: v12CryptSpin 1s linear infinite;
  box-shadow: 0 0 40px rgba(138,43,226,0.4);
}
@keyframes v12CryptSpin {
  to { transform: rotate(360deg); }
}
.v12-crypt-text {
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  background: linear-gradient(135deg, #8A2BE2, #00D1FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: v12TextPulse 1.6s ease-in-out infinite;
}
.v12-crypt-sub {
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
}
@keyframes v12TextPulse {
  0%,100% { opacity: 1; filter: drop-shadow(0 0 8px rgba(138,43,226,0.6)); }
  50% { opacity: 0.7; filter: drop-shadow(0 0 16px rgba(0,209,255,0.6)); }
}

/* Override v11 auth-gate: icon-btn inside top-bar always visible (prevent flash) */
body:not(.auth-ready) .top-bar .icon-btn,
body:not(.auth-ready) .chat-top-bar .icon-btn {
  visibility: hidden;
}
body.auth-ready .top-bar .icon-btn,
body.auth-ready .chat-top-bar .icon-btn {
  visibility: visible;
  animation: v12IconFadeIn 0.3s ease-out both;
}
@keyframes v12IconFadeIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* V11 AUTH GATE — Prevents DOM-flash before auth validation */
body:not(.auth-ready) #chat-screen,
body:not(.auth-ready) #vault-screen,
body:not(.auth-ready) #rooms-screen,
body:not(.auth-ready) #pin-screen {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}
body.auth-ready #chat-screen.active,
body.auth-ready #vault-screen.active,
body.auth-ready #rooms-screen.active,
body.auth-ready #pin-screen.active {
  display: block;
  opacity: 1;
  visibility: visible;
}

/* V11 SCROLL FIX — iPhone 17 Pro Max & iOS Safari */
.screen {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
#vault-screen,
#rooms-screen,
#chat-screen {
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  height: 100dvh !important;
  height: 100vh;
  max-height: 100dvh !important;
  max-height: 100vh;
}
.vault-content, .rooms-content, .chat-messages {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  height: 100%;
}
/* Momentum scrolling iOS */
* {
  -webkit-tap-highlight-color: transparent;
}

/* V11 APP-SWITCHER BLUR — Auto-trigger on visibilitychange */
body.ec-hidden #splash,
body.ec-hidden #chat-screen,
body.ec-hidden #vault-screen,
body.ec-hidden #rooms-screen,
body.ec-hidden #login-screen,
body.ec-hidden #setup-new,
body.ec-hidden #setup-join {
  filter: blur(24px) brightness(0.3) saturate(0.5);
  transition: filter 0.15s ease-out;
}
body.ec-hidden::before {
  content: '🔒 EliteCrypt · Gesichert';
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8A2BE2;
  font-size: 20px;
  font-weight: 800;
  font-family: 'Poppins', sans-serif;
  letter-spacing: 0.05em;
  animation: ecPrivacyPulse 2s ease-in-out infinite;
}
@keyframes ecPrivacyPulse {
  0%,100% { opacity: 0.9; }
  50% { opacity: 1; text-shadow: 0 0 32px rgba(138,43,226,0.8); }
}

/* V11 DESIGN-SYSTEM — Deep OLED + Gradients + Glassmorphism */
:root {
  --v11-black: #000000;
  --v11-violet: #8A2BE2;
  --v11-cyan: #00D1FF;
  --v11-gradient: linear-gradient(135deg, #8A2BE2 0%, #00D1FF 100%);
  --v11-glass: rgba(255,255,255,0.03);
  --v11-glass-border: rgba(255,255,255,0.08);
  --v11-glow: 0 0 32px rgba(138,43,226,0.15);
}
.v11-glass {
  background: var(--v11-glass);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid var(--v11-glass-border);
  border-radius: 16px;
}
.v11-glass-hover:hover {
  border-color: rgba(138,43,226,0.3);
  box-shadow: var(--v11-glow);
  transform: translateY(-2px);
  transition: all 0.25s cubic-bezier(.16,1,.3,1);
}
.v11-bento {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  padding: 14px;
}
.v11-bento > .v11-bento-wide { grid-column: span 2; }
.v11-gradient-text {
  background: var(--v11-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.v11-glow-border {
  position: relative;
}
.v11-glow-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: var(--v11-gradient);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.2s;
}
.v11-glow-border:hover::before { opacity: 0.4; }

/* V11 FOOTER MODAL LINKS — ALWAYS clickable via body-level handlers */
.v11-footer-legal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999999;
  display: none;
  padding: 8px 16px;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  pointer-events: auto;
}
.v11-footer-legal a {
  color: rgba(138,43,226,0.8);
  text-decoration: none;
  margin: 0 8px;
  cursor: pointer;
}
.v11-footer-legal a:hover { color: #00D1FF; text-decoration: underline; }
body.show-legal-footer .v11-footer-legal { display: block; }

#landing-screen { overflow-y:scroll!important; -webkit-overflow-scrolling:touch!important; }
#landing-screen.active { display:block; position:fixed; inset:0; overflow-y:scroll!important; z-index:1; }

/* ── Typography ────────────────────────────────────────────── */
h1,h2,h3,h4 { font-family:var(--font); font-weight:700; letter-spacing:-0.02em; }

.neon-text {
  background: linear-gradient(135deg, var(--cyan), var(--accent), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradientFlow 4s ease infinite;
}
.neon-glow {
  animation: neonPulse 3s ease-in-out infinite;
  color: var(--cyan);
}

/* ── Top Bar ───────────────────────────────────────────────── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: rgba(0,0,0,0.85);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid rgba(0,255,255,0.06);
  min-height: 58px;
  position: relative;
  z-index: 10;
}
.top-bar::after {
  content:'';
  position:absolute;
  bottom:-1px; left:0; right:0;
  height:1px;
  background: linear-gradient(90deg, transparent, rgba(0,255,255,0.3), transparent);
}
.top-bar-title {
  font-family: var(--font);
  font-weight: 800;
  font-size: 18px;
  background: linear-gradient(135deg, #fff 0%, var(--cyan) 60%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}
.chat-top-bar {
  background: rgba(0,0,0,0.9)!important;
  border-bottom: 1px solid rgba(0,255,255,0.06)!important;
  backdrop-filter: var(--blur)!important;
}

/* ── Glassmorphism Container ───────────────────────────────── */
.glass-card {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0,255,255,0.15), rgba(147,51,234,0.15));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  background: linear-gradient(135deg, var(--accent) 0%, #5a4fcf 50%, var(--purple) 100%);
  background-size: 200% 200%;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 16px 40px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  width: 100%;
  max-width: 300px;
  transition: all 0.3s cubic-bezier(.16,1,.3,1);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.02em;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--cyan), var(--accent), var(--purple), var(--cyan));
  background-size: 300% 300%;
  opacity: 0;
  transition: opacity 0.3s;
  animation: gradientFlow 3s ease infinite;
}
.btn:hover::before { opacity: 0.25; }
.btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 30px rgba(124,106,247,0.5), var(--glow-purple);
}
.btn:active { transform: translateY(-1px) scale(0.99); }

.btn.primary {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--accent) 100%);
  color: #000;
  font-weight: 700;
}
.btn.primary:hover {
  box-shadow: 0 8px 30px rgba(0,255,255,0.4), var(--glow-cyan);
}

.btn.secondary {
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  color: var(--text2);
}
.btn.secondary:hover {
  border-color: rgba(0,255,255,0.3);
  color: var(--cyan);
  box-shadow: 0 4px 20px rgba(0,255,255,0.1);
}

.btn.danger {
  background: linear-gradient(135deg, #ff3355, #cc0033);
}
.btn.danger:hover {
  box-shadow: 0 8px 30px rgba(255,51,85,0.4);
}

/* Gold Buy Button — animierter Gradient-Flow */
.btn-gold, .btn-primary {
  background: linear-gradient(135deg, #ffd700 0%, #ffab00 25%, #ffd700 50%, #ffe066 75%, #ffd700 100%);
  background-size: 300% 300%;
  animation: gradientFlow 3s ease infinite;
  color: #000;
  font-weight: 800;
  border: none;
  border-radius: 50px;
  padding: 16px 40px;
  font-size: 15px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(.16,1,.3,1);
  letter-spacing: 0.02em;
}
.btn-gold:hover, .btn-primary:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: var(--glow-gold), 0 12px 40px rgba(255,215,0,0.35);
}

/* Icon Button */
.icon-btn {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text2);
  font-size: 18px;
  transition: all 0.25s;
  backdrop-filter: blur(10px);
}
.icon-btn:hover {
  border-color: rgba(0,255,255,0.3);
  color: var(--cyan);
  box-shadow: 0 0 12px rgba(0,255,255,0.15);
  transform: scale(1.08);
}

/* ── Input Fields ──────────────────────────────────────────── */
.input-group { display:flex; flex-direction:column; gap:8px; }
.input-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.input-group input,
.input-group textarea,
.input-group select,
input[type=text], input[type=password], input[type=email],
input[type=number], textarea {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 16px;
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  transition: all 0.25s cubic-bezier(.16,1,.3,1);
  width: 100%;
}
.input-group input:focus,
.input-group textarea:focus,
input[type=text]:focus, input[type=password]:focus,
input[type=number]:focus, textarea:focus {
  border-color: rgba(0,255,255,0.4);
  background: rgba(0,255,255,0.03);
  box-shadow: 0 0 0 3px rgba(0,255,255,0.08), inset 0 0 0 1px rgba(0,255,255,0.15);
}
input[type=text]:hover, input[type=password]:hover,
.input-group input:hover { border-color: rgba(0,255,255,0.2); }

.input-with-gen {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.input-with-gen input { flex: 1; }
.gen-btn {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text2);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  white-space: nowrap;
  transition: all 0.2s;
}
.gen-btn:hover {
  border-color: rgba(0,255,255,0.3);
  color: var(--cyan);
  box-shadow: 0 0 8px rgba(0,255,255,0.1);
}

/* ── Modal System ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.modal-overlay.active { display:flex; animation:fade .25s ease; }
.modal {
  background: linear-gradient(160deg, rgba(10,10,20,0.97) 0%, rgba(5,5,15,0.98) 100%);
  border: 1px solid rgba(0,255,255,0.12);
  border-radius: 24px 24px 0 0;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 88dvh;
  overflow-y: auto;
  animation: slide-up .35s cubic-bezier(.16,1,.3,1);
  position: relative;
}
.modal::before {
  content:'';
  position:absolute; top:0; left:20%; right:20%;
  height:1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0.5;
}
.modal-handle {
  width: 40px; height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  margin: -8px auto 16px;
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  font-family: var(--font);
}

/* ── Avatar & User Badge ───────────────────────────────────── */
.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 5px 10px 5px 5px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--border);
  transition: all 0.25s;
  backdrop-filter: blur(10px);
}
.user-badge:hover {
  border-color: rgba(0,255,255,0.3);
  box-shadow: 0 0 12px rgba(0,255,255,0.1);
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}
.avatar::after {
  content:'';
  position:absolute; inset:-2px;
  border-radius:50%;
  background: conic-gradient(var(--cyan), var(--accent), var(--purple), var(--cyan));
  z-index:-1;
  animation: spin 4s linear infinite;
  opacity: 0.4;
}

/* Avatar colors */
.color-a { background: linear-gradient(135deg,#7c6af7,#9333ea); }
.color-b { background: linear-gradient(135deg,#0ea5e9,#0284c7); }
.color-c { background: linear-gradient(135deg,#10b981,#059669); }
.color-d { background: linear-gradient(135deg,#f59e0b,#d97706); }
.color-e { background: linear-gradient(135deg,#ef4444,#dc2626); }
.color-f { background: linear-gradient(135deg,#ec4899,#db2777); }

/* ── Room / Chat List Items ────────────────────────────────── */
.room-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(.16,1,.3,1);
  border: 1px solid transparent;
  position: relative;
}
.room-item:hover {
  background: rgba(0,255,255,0.04);
  border-color: rgba(0,255,255,0.1);
  transform: translateX(3px);
}
.room-item:active { transform:scale(0.99); }

/* ── Messages ──────────────────────────────────────────────── */
.msg-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  animation: msg 0.25s cubic-bezier(.16,1,.3,1);
  word-break: break-word;
}
.msg-bubble.mine {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 20px rgba(124,106,247,0.3);
}
.msg-bubble.theirs {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  backdrop-filter: blur(10px);
  color: var(--text);
}

/* ── Security Badge ────────────────────────────────────────── */
.security-badge {
  background: rgba(0,255,136,0.06);
  border: 1px solid rgba(0,255,136,0.2);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(0,255,136,0.8);
  font-family: var(--font-mono);
}

/* ── Toast Notifications ───────────────────────────────────── */
#toast {
  position: fixed;
  bottom: max(100px, calc(env(safe-area-inset-bottom,0px) + 100px));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(10,10,20,0.92);
  border: 1px solid rgba(0,255,255,0.25);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-family: var(--font);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 20px rgba(0,255,255,0.1);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(.16,1,.3,1);
  white-space: nowrap;
  max-width: calc(100vw - 40px);
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Landing Page ──────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 140%;
  background: radial-gradient(
    ellipse at 50% 30%,
    rgba(0,255,255,0.08) 0%,
    rgba(124,106,247,0.06) 35%,
    transparent 70%
  );
  pointer-events: none;
  animation: pulse 8s ease-in-out infinite;
}

/* Floating orbs */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  animation: float 6s ease-in-out infinite;
}

.section-title {
  font-family: var(--font);
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 16px;
  font-family: var(--font-mono);
}
.section-sub {
  font-size: 17px;
  color: var(--text2);
  line-height: 1.6;
  font-weight: 400;
}

/* Feature Cards — Glassmorphism + 3D Hover */
.feature-card {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(.16,1,.3,1);
  transform-style: preserve-3d;
  perspective: 1000px;
  cursor: default;
}
.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(0,255,255,0.04), rgba(147,51,234,0.04));
  opacity: 0;
  transition: opacity 0.4s;
}
.feature-card:hover {
  transform: perspective(800px) rotateX(-3deg) rotateY(2deg) translateY(-6px);
  border-color: rgba(0,255,255,0.25);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(0,255,255,0.08);
}
.feature-card:hover::before { opacity: 1; }

/* Nav */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(16px,env(safe-area-inset-top)) 24px 16px;
  z-index: 100;
  background: rgba(0,0,0,0.6);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid rgba(0,255,255,0.04);
}
.nav-logo {
  font-family: var(--font);
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-links { display:flex; align-items:center; gap:8px; }
.nav-btn {
  padding: 8px 18px;
  border-radius: 40px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.25s;
  border: 1px solid transparent;
  text-decoration: none;
}
.nav-btn.outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text2);
}
.nav-btn.outline:hover {
  border-color: rgba(0,255,255,0.3);
  color: var(--cyan);
}
.nav-btn.solid {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff;
}
.nav-btn.solid:hover {
  box-shadow: var(--glow-purple);
  transform: translateY(-2px);
}

/* ── CTA Section ───────────────────────────────────────────── */
.cta-section {
  padding: clamp(60px,8vw,120px) clamp(20px,4vw,40px) clamp(80px,10vw,160px);
  text-align: center;
  position: relative;
  overflow: visible;
  z-index: 2;
  isolation: isolate;
  background: transparent;
}
.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(124,106,247,0.06) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}
.cta-glow {
  z-index: -1;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ── Comparison Table ──────────────────────────────────────── */
.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.compare-table th {
  background: rgba(0,255,255,0.05);
  color: var(--text2);
  padding: 12px 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
.compare-table td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.compare-table tr:hover td {
  background: rgba(0,255,255,0.02);
}

/* ── Trust bar ─────────────────────────────────────────────── */
.trust-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  padding: 24px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text2);
  font-family: var(--font-mono);
}

/* ── Footer ────────────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 10;
  border-top: 1px solid rgba(255,255,255,0.04);
  padding: 40px 24px max(48px,env(safe-area-inset-bottom,48px));
  background: rgba(0,0,0,0.95);
  overflow: visible;
}
footer::before {
  content:'';
  position:absolute; top:0; left:20%; right:20%;
  height:1px;
  background: linear-gradient(90deg, transparent, rgba(0,255,255,0.3), transparent);
}
.footer-logo {
  font-family: var(--font);
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--cyan), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  justify-content: center;
}
.footer-links a {
  color: var(--text2);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--cyan); }

/* ── Message Input ─────────────────────────────────────────── */
.msg-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px;
  padding-bottom: max(10px, env(safe-area-inset-bottom,10px));
  background: rgba(0,0,0,0.9);
  border-top: 1px solid rgba(0,255,255,0.06);
  backdrop-filter: blur(20px);
}
#msg-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 16px;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  resize: none;
  max-height: 120px;
  outline: none;
  transition: all 0.25s;
  line-height: 1.4;
}
#msg-input:focus {
  border-color: rgba(0,255,255,0.3);
  box-shadow: 0 0 0 3px rgba(0,255,255,0.06);
}

/* Send Button */
.send-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--accent));
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.25s;
  box-shadow: 0 0 15px rgba(0,255,255,0.2);
}
.send-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--glow-cyan);
}

/* ── Stagger Animation für Listen ──────────────────────────── */
.stagger-item {
  animation: stagger 0.5s cubic-bezier(.16,1,.3,1) both;
}
.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.10s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.20s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.30s; }
.stagger-item:nth-child(7) { animation-delay: 0.35s; }
.stagger-item:nth-child(8) { animation-delay: 0.40s; }

/* ── Reveal Animation ──────────────────────────────────────── */
.reveal { opacity:0; transition: opacity 0.7s ease, transform 0.7s ease; transform:translateY(30px); }
.reveal.visible { opacity:1; transform:translateY(0); }

/* ── Pill / Badge ──────────────────────────────────────────── */
.badge-cyber {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.badge-gold {
  background: rgba(255,215,0,0.1);
  border: 1px solid rgba(255,215,0,0.3);
  color: var(--gold);
  animation: neonPulseGold 4s ease-in-out infinite;
}
.badge-cyan {
  background: rgba(0,255,255,0.08);
  border: 1px solid rgba(0,255,255,0.2);
  color: var(--cyan);
}
.badge-purple {
  background: rgba(147,51,234,0.1);
  border: 1px solid rgba(147,51,234,0.25);
  color: var(--accent-hi);
}

/* ── Avatar Grid ───────────────────────────────────────────── */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6,1fr);
  gap: 8px;
}
.avatar-opt {
  aspect-ratio: 1;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  background: var(--glass);
}
.avatar-opt:hover {
  border-color: rgba(0,255,255,0.3);
  transform: scale(1.08);
  box-shadow: 0 0 10px rgba(0,255,255,0.15);
}
.avatar-opt.selected { border-color: var(--cyan); box-shadow: var(--glow-cyan); }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width:4px; height:4px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--cyan), var(--accent));
  border-radius:4px;
  opacity:0.5;
}

/* ── Selection ─────────────────────────────────────────────── */
::selection { background:rgba(0,255,255,0.2); color:var(--cyan); }

/* ── Typing Indicator ──────────────────────────────────────── */
.typing-dot {
  width:6px; height:6px;
  border-radius:50%;
  background: var(--cyan);
  display:inline-block;
  animation:tdot .8s ease infinite;
}
.typing-dot:nth-child(2){ animation-delay:.15s; }
.typing-dot:nth-child(3){ animation-delay:.30s; }

/* ── Online Indicator ──────────────────────────────────────── */
.online-dot {
  width:8px; height:8px;
  border-radius:50%;
  background:var(--green);
  animation:online 2s ease-in-out infinite;
}

/* ── Neon Border Card ──────────────────────────────────────── */
.neon-border-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.neon-border-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--cyan), var(--accent), var(--purple), var(--cyan));
  background-size: 300% 300%;
  animation: gradientFlow 4s ease infinite;
  z-index: 0;
  opacity: 0.5;
}
.neon-border-card > * { position: relative; z-index: 1; }

/* ── Price Cards ───────────────────────────────────────────── */
.plan-card {
  background: var(--glass);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: all 0.35s cubic-bezier(.16,1,.3,1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.plan-card:hover {
  transform: translateY(-6px) perspective(600px) rotateX(-2deg);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4), 0 0 30px rgba(0,255,255,0.1);
  border-color: rgba(0,255,255,0.3);
}
.plan-card.selected {
  border-color: var(--cyan);
  background: rgba(0,255,255,0.05);
  box-shadow: 0 0 30px rgba(0,255,255,0.15);
}

/* ── Settings Item ─────────────────────────────────────────── */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: all 0.2s;
}
.settings-row:hover { padding-left: 4px; }

/* ── Toggle Switch ─────────────────────────────────────────── */
.toggle-switch {
  position: relative;
  width: 48px; height: 26px;
  display: block;
  cursor: pointer;
}
.toggle-switch input { opacity:0; width:0; height:0; position:absolute; }
.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  background: rgba(255,255,255,0.1);
  transition: background 0.3s;
  display: flex; align-items: center;
  padding: 0 3px;
}
.toggle-switch input:checked + .toggle-track {
  background: linear-gradient(135deg, var(--cyan), var(--accent));
  box-shadow: 0 0 10px rgba(0,255,255,0.3);
}
.toggle-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.3s cubic-bezier(.16,1,.3,1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.toggle-switch input:checked ~ .toggle-track .toggle-thumb { transform: translateX(22px); }

/* ── Bento Grid ────────────────────────────────────────────── */
@media (max-width:767px) {
  #bento-grid { grid-template-columns:repeat(2,1fr)!important; }
  #bento-grid > div[style*="grid-column:span 2"] { grid-column:span 2!important; }
}
@media (max-width:480px) {
  #bento-grid { grid-template-columns:1fr!important; }
  #bento-grid > div[style*="grid-column:span 2"] { grid-column:span 1!important; }
}
@media (min-width:768px) {
  #bento-grid > div { min-height:160px!important; }
  #bento-grid { align-items:stretch!important; }
}

/* ── Bento Grid Desktop — gleichmäßig ─────────────────────── */
#bento-grid { display:grid; gap:14px; }

/* ── Premium Section Fixes ─────────────────────────────────── */
#premium { z-index:1; isolation:isolate; }

/* ── Mobile Fixes ──────────────────────────────────────────── */
#landing-screen section { position:relative; z-index:1; clear:both; }
.cta-section * { position:relative; z-index:2; }
.cta-section .cta-glow,
.cta-section::before,
.cta-section::after { z-index:-1!important; position:absolute!important; }

@media (max-width:767px) {
  #premium { padding:60px 16px!important; }
  #id-check-section { padding:24px 16px!important; }
  .cta-section { padding:60px 20px 80px!important; }
  .cta-section h2 { font-size:clamp(28px,8vw,48px)!important; line-height:1.15!important; }
}
footer { position:relative!important; z-index:10!important; overflow:visible!important; }

/* ── Logged-In State ───────────────────────────────────────── */
body.is-logged-in .lp-register-btn,
body.is-logged-in #lp-nav-open-btn,
body.is-logged-in .lp-login-btn { display:none!important; }

/* ── Lockout Screen ────────────────────────────────────────── */
#lockout-overlay { font-family:var(--font-mono); }

/* ── Aurora Theme Override ─────────────────────────────────── */
[data-theme="aurora"] {
  --bg: #020208;
  --bg2: #050510;
  --accent: #7c6af7;
}
[data-theme="aurora"] .top-bar,
.aurora-theme .top-bar {
  background:rgba(0,0,0,0.85)!important;
  border-bottom:1px solid rgba(0,255,255,0.06)!important;
}
[data-theme="aurora"] .chat-top-bar {
  background:rgba(0,0,0,0.9)!important;
  border-bottom:1px solid rgba(0,255,255,0.05)!important;
}

/* ── Trust Bar Mobile ──────────────────────────────────────── */
@media (max-width:480px) { .trust-bar { gap:0; } }
.footer-links { flex-wrap:wrap!important; justify-content:center!important; gap:12px!important; }

/* ── Textarea Resize None ──────────────────────────────────── */
textarea { resize:vertical; }

/* ── Details/Summary (FAQ) ─────────────────────────────────── */
details summary { list-style:none; }
details summary::-webkit-details-marker { display:none; }
details[open] summary { color:var(--cyan); }

/* ── Landing Page overflow fix ─────────────────────────────── */
#landing-screen { overflow-x:hidden!important; max-width:100vw; }
#landing-screen * { max-width:100%; word-wrap:break-word; overflow-wrap:break-word; }
#landing-screen table { table-layout:fixed; width:100%; }

/* ── Misc Fixes ────────────────────────────────────────────── */
.modal-overlay { align-items:flex-end; }
a { color:inherit; }
button { font-family:var(--font); }
img { max-width:100%; }


/* V15 FIX: Emoji Picker nur sichtbar wenn explizit .show */
.emoji-picker {
  display: none !important;
  position: fixed;
  bottom: 70px;
  left: 20px;
  z-index: 9999;
  padding: 8px 12px;
  background: rgba(20, 10, 40, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(138, 43, 226, 0.3);
  border-radius: 14px;
  gap: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.emoji-picker.show {
  display: inline-flex !important;
  animation: epFadeIn 0.2s ease-out;
}
.emoji-picker .ep-emoji {
  cursor: pointer;
  font-size: 22px;
  padding: 4px 6px;
  border-radius: 8px;
  transition: transform 0.15s, background 0.15s;
  user-select: none;
}
.emoji-picker .ep-emoji:hover {
  background: rgba(138, 43, 226, 0.15);
  transform: scale(1.2);
}
@keyframes epFadeIn {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}



/* ═══════════════════════════════════════════════════════
   V16 GLOBAL BUTTON-CLICK FIX
   Guarantee all buttons/interactive elements are clickable
   on rooms-screen, chat-screen, vault-screen and all modals
   ═══════════════════════════════════════════════════════ */
.screen.active {
  pointer-events: auto !important;
}
.screen.active button,
.screen.active [onclick],
.screen.active a,
.screen.active input,
.screen.active textarea,
.screen.active select,
.screen.active [role="button"] {
  pointer-events: auto !important;
  position: relative;
  z-index: 2;
}
/* Disable pointer-events on all decorative pseudo-elements */
.screen.active *::before,
.screen.active *::after {
  pointer-events: none !important;
}
/* BUT: keep pseudo-elements interactive when they are the actual interactive surface */
.screen.active button::before,
.screen.active button::after,
.screen.active [onclick]::before,
.screen.active [onclick]::after {
  pointer-events: none !important;  /* Decorative only */
}
/* Ensure invisible screens don't block */
.screen:not(.active) {
  pointer-events: none !important;
  display: none !important;
}
/* Override v11 auth-gate display:none conflict */
body.auth-ready .screen.active {
  display: block !important;
}
body.auth-ready #rooms-screen.screen.active {
  display: block !important;
}
@media (min-width: 900px) {
  body.auth-ready #rooms-screen.screen.active {
    display: grid !important;  /* Three-column override */
  }
}

/* Modals: super high z-index + always pointer-events */
.modal.active,
.modal.show {
  pointer-events: auto !important;
  z-index: 99999 !important;
}
.modal-backdrop {
  pointer-events: auto !important;
  z-index: 99998 !important;
}

/* FAB floating over rooms */
.fab {
  pointer-events: auto !important;
  cursor: pointer !important;
  z-index: 100 !important;
}


/* ═══ V17 POLISH ═══ */

/* Hide welcome card on mobile (< 900px) */
@media (max-width: 899px) {
  #v16-welcome-card { display: none !important; }
}

@media (min-width: 900px) {
  /* Hide welcome card when chat is open (body has active chat class) */
  body.ec-chat-open #v16-welcome-card { display: none !important; }

  /* Better contact items */
  #rooms-screen.screen.active .room-item {
    padding: 14px 12px !important;
    border-radius: 14px !important;
    transition: background 0.18s cubic-bezier(.16,1,.3,1) !important;
  }
  #rooms-screen.screen.active .room-item:active {
    background: rgba(138,43,226,0.22) !important;
    transform: scale(0.98) !important;
  }

  /* Avatar in contact item */
  #rooms-screen.screen.active .room-item .room-icon,
  #rooms-screen.screen.active .room-item .avatar {
    width: 44px !important;
    height: 44px !important;
    border-radius: 14px !important;
    font-size: 20px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, rgba(138,43,226,0.2), rgba(0,209,255,0.15)) !important;
    border: 1px solid rgba(138,43,226,0.15) !important;
  }

  /* Contact name + sub */
  #rooms-screen.screen.active .room-item .room-name,
  #rooms-screen.screen.active .room-item > div:not(.room-icon):not(.avatar) {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  #rooms-screen.screen.active .room-item .room-name {
    color: #fff !important;
    font-size: 14.5px !important;
    font-weight: 600 !important;
    letter-spacing: -0.2px !important;
    margin-bottom: 2px !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
  }
  #rooms-screen.screen.active .room-item .room-last,
  #rooms-screen.screen.active .room-item .room-sub {
    font-size: 12.5px !important;
    color: rgba(255,255,255,0.45) !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
  }

  /* Time on the right */
  #rooms-screen.screen.active .room-item .room-time {
    font-size: 11px !important;
    color: rgba(255,255,255,0.35) !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
    font-variant-numeric: tabular-nums !important;
  }

  /* Searchable contacts header */
  #rooms-screen.screen.active .rooms-list::before {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-right: 50px !important; /* room for FAB */
  }

  /* Empty state when no rooms */
  #rooms-screen.screen.active .rooms-list:empty::after {
    content: 'Noch keine Chats. Klick auf + um einen zu starten.';
    display: block;
    padding: 40px 20px;
    text-align: center;
    color: rgba(255,255,255,0.35);
    font-size: 13px;
    line-height: 1.6;
  }

  /* Chat screen becomes column 3 of the grid when open */
  body.ec-chat-open #chat-screen.screen.active {
    position: absolute !important;
    top: 0 !important;
    left: 412px !important; /* sidebar 72 + contacts 340 */
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    z-index: 50 !important;
  }

  /* Smaller back button on desktop — feels more native */
  body.ec-chat-open #chat-screen .chat-top-bar .back-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
  }
}

/* ═══ Scrollbar polish (WebKit + Firefox) ═══ */
#rooms-screen .rooms-list::-webkit-scrollbar { width: 6px; }
#rooms-screen .rooms-list::-webkit-scrollbar-track { background: transparent; }
#rooms-screen .rooms-list::-webkit-scrollbar-thumb {
  background: rgba(138,43,226,0.2);
  border-radius: 3px;
}
#rooms-screen .rooms-list::-webkit-scrollbar-thumb:hover {
  background: rgba(138,43,226,0.4);
}
#rooms-screen .rooms-list { scrollbar-width: thin; scrollbar-color: rgba(138,43,226,0.25) transparent; }

/* ═══ Focus rings für Accessibility ═══ */
.screen.active button:focus-visible,
.screen.active [onclick]:focus-visible,
.screen.active a:focus-visible {
  outline: 2px solid #00D1FF !important;
  outline-offset: 2px !important;
  border-radius: 10px !important;
}

/* ═══════════════════════════════════════════════════════════
   V16 "VARIATION 1" — Ultra-Minimalist Chat Redesign
   Only active on Desktop (>= 900px) — Mobile stays unchanged
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 900px) {

  /* Three-column grid on rooms-screen when active */
  #rooms-screen.screen.active {
    display: grid !important;
    grid-template-columns: 72px 340px 1fr;
    grid-template-rows: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
    background:
      radial-gradient(ellipse 60% 50% at 75% 30%, rgba(138,43,226,0.08), transparent 60%),
      radial-gradient(ellipse 50% 40% at 25% 75%, rgba(0,209,255,0.06), transparent 60%),
      #050509;
    overflow: hidden;
  }

  /* ─── Sidebar (Column 1) ─────────────────────────────── */
  #rooms-screen.screen.active .top-bar {
    grid-column: 1;
    grid-row: 1;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 20px 0 !important;
    gap: 18px !important;
    background: rgba(0,0,0,0.6) !important;
    border-right: 1px solid rgba(255,255,255,0.04) !important;
    border-bottom: none !important;
    min-height: auto !important;
    max-height: none !important;
  }
  #rooms-screen.screen.active .top-bar-title {
    display: none !important;  /* Logo moves up */
  }
  #rooms-screen.screen.active .top-bar > *:not(.top-bar-title) {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    align-items: center !important;
    flex: 1 !important;
    width: 100% !important;
  }
  /* Logo in sidebar */
  #rooms-screen.screen.active .top-bar::before {
    content: '🔐';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #8A2BE2, #00D1FF);
    font-size: 22px;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(138,43,226,0.4);
  }
  /* Stack user-badge + icon-btns vertically in sidebar */
  #rooms-screen.screen.active .user-badge {
    flex-direction: column !important;
    gap: 2px !important;
    padding: 6px 0 !important;
    background: transparent !important;
    border: none !important;
  }
  #rooms-screen.screen.active .user-badge span {
    display: none !important;  /* Hide name, just avatar */
  }
  #rooms-screen.screen.active .user-badge .avatar {
    width: 40px !important;
    height: 40px !important;
    font-size: 16px !important;
  }
  #rooms-screen.screen.active .icon-btn {
    width: 44px !important;
    height: 44px !important;
    border-radius: 12px !important;
    background: transparent !important;
    border: none !important;
    color: rgba(255,255,255,0.4) !important;
    font-size: 18px !important;
    transition: all 0.2s !important;
  }
  #rooms-screen.screen.active .icon-btn:hover {
    background: rgba(138,43,226,0.15) !important;
    color: #00D1FF !important;
    transform: translateY(-1px) !important;
    box-shadow: none !important;
  }
  /* Push logout to bottom */
  #rooms-screen.screen.active .top-bar .icon-btn[onclick*="logout"] {
    margin-top: auto !important;
  }

  /* ─── Contacts (Column 2) ────────────────────────────── */
  #rooms-screen.screen.active .rooms-list {
    grid-column: 2;
    grid-row: 1;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 24px 16px 100px !important;
    background: rgba(8,5,15,0.5) !important;
    border-right: 1px solid rgba(255,255,255,0.04) !important;
    position: relative !important;
  }
  #rooms-screen.screen.active .rooms-list::before {
    content: 'Contacts';
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 20px;
    padding: 0 8px;
    letter-spacing: -0.5px;
  }
  #rooms-screen.screen.active .room-item {
    background: transparent !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 12px 10px !important;
    margin-bottom: 2px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    cursor: pointer !important;
    transition: background 0.15s !important;
  }
  #rooms-screen.screen.active .room-item:hover {
    background: rgba(138,43,226,0.08) !important;
  }
  #rooms-screen.screen.active .room-item.active,
  #rooms-screen.screen.active .room-item.selected {
    background: rgba(138,43,226,0.18) !important;
  }
  /* FAB as small gradient button in upper-right of contacts */
  #rooms-screen.screen.active .fab {
    position: absolute !important;
    top: 22px !important;
    right: 18px !important;
    bottom: auto !important;
    left: auto !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    background: linear-gradient(135deg, #8A2BE2, #00D1FF) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    box-shadow: 0 6px 20px rgba(138,43,226,0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
    color: #fff !important;
    border: none !important;
    cursor: pointer !important;
    transition: transform 0.2s !important;
  }
  #rooms-screen.screen.active .fab:hover {
    transform: scale(1.08) rotate(90deg) !important;
  }

  /* ─── Welcome Card (Column 3) — floating QR card ───── */
  #rooms-screen.screen.active::after {
    content: '';
    grid-column: 3;
    grid-row: 1;
    /* Welcome area is filled by #v16-welcome-card via JS */
  }

  #v16-welcome-card {
    grid-column: 3;
    grid-row: 1;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
  }
  #v16-welcome-card .v16-card {
    position: relative;
    max-width: 420px;
    width: 100%;
    padding: 36px 32px;
    background: rgba(20, 14, 35, 0.55);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(138, 43, 226, 0.2);
    border-radius: 28px;
    box-shadow:
      0 30px 80px rgba(0,0,0,0.5),
      0 0 0 1px rgba(255,255,255,0.04),
      inset 0 1px 0 rgba(255,255,255,0.05);
    overflow: hidden;
    text-align: center;
    animation: v16CardIn 0.8s cubic-bezier(.16,1,.3,1);
  }
  /* Soft glow behind card */
  #v16-welcome-card .v16-card::before {
    content: '';
    position: absolute;
    inset: -40%;
    background:
      radial-gradient(circle at 30% 30%, rgba(138,43,226,0.25), transparent 50%),
      radial-gradient(circle at 70% 70%, rgba(0,209,255,0.2), transparent 50%);
    filter: blur(50px);
    z-index: -1;
    animation: v16Glow 8s ease-in-out infinite alternate;
  }
  @keyframes v16Glow {
    from { transform: rotate(0deg) scale(1); }
    to   { transform: rotate(40deg) scale(1.1); }
  }
  @keyframes v16CardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.96); filter: blur(10px); }
    to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  }

  #v16-welcome-card .v16-qr-wrap {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto 24px;
    padding: 14px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.08);
    overflow: hidden;
  }
  #v16-welcome-card .v16-qr-wrap canvas,
  #v16-welcome-card .v16-qr-wrap svg,
  #v16-welcome-card .v16-qr-wrap img {
    width: 100% !important;
    height: 100% !important;
    display: block;
  }
  /* 3D particle canvas behind QR */
  #v16-welcome-card .v16-3d-bg {
    position: absolute;
    inset: -20px;
    z-index: -1;
    border-radius: 28px;
    pointer-events: none;
  }

  #v16-welcome-card .v16-title {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
    margin: 0 0 6px;
  }
  #v16-welcome-card .v16-sub {
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    line-height: 1.55;
    margin: 0 0 20px;
    font-weight: 400;
  }
  #v16-welcome-card .v16-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(138,43,226,0.12);
    border: 1px solid rgba(138,43,226,0.3);
    color: #00D1FF;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
  }
  #v16-welcome-card .v16-download-btn:hover {
    background: rgba(138,43,226,0.2);
    border-color: rgba(0,209,255,0.4);
    transform: translateY(-1px);
  }

  #v16-welcome-card .v16-lang-row {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
  }
  #v16-welcome-card .v16-lang-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
  }
  #v16-welcome-card .v16-lang-pill:hover {
    background: rgba(138,43,226,0.1);
    border-color: rgba(138,43,226,0.3);
  }

  /* ─── CHAT SCREEN: center + max-width on Desktop ────── */
  #chat-screen.screen.active {
    max-width: 1100px !important;
    margin: 0 auto !important;
    background: rgba(10, 6, 20, 0.4) !important;
    border-left: 1px solid rgba(255,255,255,0.04) !important;
    border-right: 1px solid rgba(255,255,255,0.04) !important;
    box-shadow: 0 0 80px rgba(0,0,0,0.5) !important;
  }

  /* Prevent screenshot-blur overlay from shifting layout */
  body.ec-blur-active::after {
    pointer-events: none !important;
  }

  /* Ensure ALL buttons in rooms-screen click (master pointer-events fix) */
  #rooms-screen.screen.active button,
  #rooms-screen.screen.active [onclick],
  #rooms-screen.screen.active .icon-btn,
  #rooms-screen.screen.active .fab,
  #rooms-screen.screen.active .room-item,
  #rooms-screen.screen.active .user-badge {
    pointer-events: auto !important;
    position: relative;
    z-index: 2;
  }
}

/* Cleaner message bubbles on all screen sizes */
.chat-msg-card,
.message-bubble {
  transition: transform 0.15s;
}
.chat-msg-card:hover,
.message-bubble:hover {
  transform: translateY(-1px);
}
