/* OPTIMIZED BUILD */
/* ═══════════════════════════════════════════════
   HELIX ARCADE — main.css (TRINITY ROOT v16)
   Tema: Retro-Futurista · Neón · Cyberpunk
═══════════════════════════════════════════════ */

:root {
  /* === COLORES CLIENTE === */
  --color-primary: #1E84C6;
  --color-primary-light: #40B8FF;
  --color-primary-dark: #155A8A;
  --color-accent: #FF6600;
  --color-accent-light: #FF8A00;
  --color-bg: #07090F;
  --color-surface: #0E1422;
  --color-surface-2: #151C30;
  --color-text: #E8F0FF;
  --color-text-secondary: #8090B0;
  --color-border: #1E2840;
  --color-neon-cyan: #00D8FF;
  --color-neon-orange: #FF6600;
  --color-success: #10B981;
  --color-error: #EF4444;
  --color-warning: #F59E0B;
  --color-info: #3B82F6;

  /* === GRADIENTES === */
  --helix-gradient: linear-gradient(135deg, #FF6600, #1E84C6);
  --helix-gradient-bg: linear-gradient(135deg, #155A8A -33%, #000000 50%, #FF6600 166%);

  /* === TIPOGRAFÍA === */
  --font-primary: 'Orbitron', 'Share Tech Mono', monospace;
  --font-body: 'Rajdhani', system-ui, sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
  --text-xs: 0.7rem;
  --text-sm: 0.85rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3.5rem;
  --text-6xl: 5rem;

  /* === SPACING === */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* === LAYOUT === */
  --max-width: 1300px;
  --topbar-height: 60px;

  /* === RADIUS === */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 16px;
  --radius-full: 9999px;
}

/* ═══ RESET ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: var(--text-base);
  line-height: 1.5;
}
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* ═══ BACKGROUND CANVAS ═══ */
#helix-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  background-image: var(--helix-gradient-bg);
  background-size: 100% 100%;
}

/* ═══ MAIN LAYOUT ═══ */
main, [role="main"], .app-container {
  position: relative;
  z-index: 10;
  pointer-events: auto;
}
#landing-section, #lobby-section {
  position: relative;
  z-index: 10;
  min-height: 100vh;
}

/* ═══ CONTAINER ═══ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* ═══ UTILITIES ═══ */
.hidden { display: none !important; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

/* ═══ BOTONES ═══ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.btn-primary {
  background: var(--helix-gradient);
  color: white;
  box-shadow: 0 0 20px rgba(30,132,198,0.3);
}
.btn-primary:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(30,132,198,0.5);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: transparent;
  color: var(--color-primary-light);
  border: 1px solid var(--color-primary);
}
.btn-secondary:hover {
  background: rgba(30,132,198,0.1);
  border-color: var(--color-primary-light);
  box-shadow: 0 0 12px rgba(30,132,198,0.3);
}
.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}
.btn-ghost:hover {
  background: var(--color-surface);
  color: var(--color-text);
}
.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--text-xs); }
.btn-hero {
  font-size: var(--text-base);
  padding: var(--space-4) var(--space-8);
  letter-spacing: 0.12em;
  box-shadow: 0 0 40px rgba(255,102,0,0.4);
}
.btn[disabled], .btn.loading { opacity: 0.5; pointer-events: none; }

/* ═══ SPINNER ═══ */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ TOAST ═══ */
.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}
.toast {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: white;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  pointer-events: auto;
  animation: toastIn 0.3s ease forwards;
  max-width: 320px;
}
.toast.success { background: var(--color-success); }
.toast.error   { background: var(--color-error); }
.toast.warning { background: var(--color-warning); color: #000; }
.toast.info    { background: var(--color-primary); }
.toast.hiding  { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn  { from { opacity:0; transform:translateX(100%); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; transform:translateX(0); } to { opacity:0; transform:translateX(100%); } }

/* ═══ SKELETON ═══ */
.skeleton {
  background: linear-gradient(90deg, var(--color-surface) 25%, var(--color-surface-2) 50%, var(--color-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-text  { height: 1em; margin-bottom: 0.5em; }
.skeleton-title { height: 1.5em; width: 60%; margin-bottom: 0.75em; }
.skeleton-image { height: 200px; width: 100%; }

/* ═══════════════════════════════════
   LANDING
═══════════════════════════════════ */
.landing-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-8);
  z-index: 100;
  background: rgba(7,9,15,0.6);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(30,132,198,0.2);
}
.logo-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.logo-icon {
  font-size: 1.8rem;
  background: var(--helix-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(255,102,0,0.6));
}
.logo-icon.small { font-size: 1.2rem; }
.logo-text {
  font-family: var(--font-primary);
  font-size: var(--text-lg);
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--color-text);
}
.logo-text.small { font-size: var(--text-base); }
.logo-accent { color: var(--color-accent); text-shadow: 0 0 12px rgba(255,102,0,0.7); }

/* HERO */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--topbar-height) + var(--space-8)) var(--space-4) var(--space-8);
}
.hero-badge {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  color: var(--color-success);
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
  text-shadow: 0 0 8px rgba(16,185,129,0.5);
}
.hero-title {
  font-family: var(--font-primary);
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 0.9;
  color: var(--color-text);
  text-shadow: 0 0 60px rgba(30,132,198,0.3);
  margin-bottom: var(--space-2);
}
.hero-title-accent {
  display: block;
  background: var(--helix-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(255,102,0,0.5));
}
.hero-sub {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  letter-spacing: 0.15em;
  margin: var(--space-6) 0;
}
.hero-stats {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-top: var(--space-8);
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat-num {
  font-family: var(--font-primary);
  font-size: var(--text-2xl);
  font-weight: 900;
  color: var(--color-neon-cyan);
  text-shadow: 0 0 12px rgba(0,216,255,0.6);
}
.stat-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  letter-spacing: 0.12em;
}
.stat-sep { color: var(--color-border); font-size: 1.5rem; }

/* CATEGORIES PREVIEW */
.categories-preview {
  padding: var(--space-8) var(--space-4) var(--space-16);
}
.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  max-width: 900px;
  margin: 0 auto;
}
.cat-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: default;
  border: 1px solid var(--color-border);
  transition: all 0.3s ease;
}
.cat-card.playable {
  cursor: pointer;
}
.cat-card.playable:hover {
  transform: scale(1.02);
  border-color: var(--color-primary);
  box-shadow: 0 0 30px rgba(30,132,198,0.4);
}
.cat-card.playable:hover .cat-arrow { opacity: 1; transform: translateX(0); }
.cat-card.locked:hover { border-color: rgba(255,255,255,0.1); }
.cat-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease;
}
.cat-card:hover .cat-bg { transform: scale(1.05); }
.cat-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.2) 100%);
}
.cat-lock-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  opacity: 0.6;
  z-index: 2;
}
.cat-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: var(--space-4);
  z-index: 3;
}
.cat-tag {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  color: var(--color-accent);
  text-shadow: 0 0 8px rgba(255,102,0,0.7);
  display: block;
  margin-bottom: var(--space-1);
}
.cat-title {
  font-family: var(--font-primary);
  font-size: var(--text-xl);
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1.1;
  color: var(--color-text);
  text-shadow: 0 0 20px rgba(0,216,255,0.4);
}
.cat-count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: var(--space-2);
}
.cat-arrow {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  font-size: 1.5rem;
  color: var(--color-primary-light);
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.3s ease;
}
.coming-soon { opacity: 0.6; }
.coming-soon::after {
  content: 'PRONTO';
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  color: var(--color-accent);
  background: rgba(255,102,0,0.15);
  border: 1px solid rgba(255,102,0,0.4);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  z-index: 4;
}

.legal-footer {
  text-align: center;
  padding: var(--space-4) var(--space-4) var(--space-8);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  opacity: 0.5;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════
   TOPBAR (LOBBY)
═══════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  z-index: 200;
  background: rgba(7,9,15,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(30,132,198,0.25);
}
.topbar-logo { display: flex; align-items: center; gap: var(--space-2); }
.topbar-nav { display: flex; align-items: center; gap: var(--space-2); }
.topbar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color 0.2s;
  border-radius: var(--radius-md);
}
.topbar-btn:hover { color: var(--color-text); background: var(--color-surface); }
.topbar-icon { font-size: 1.1rem; }
.topbar-label { font-family: var(--font-primary); font-size: 0.55rem; letter-spacing: 0.1em; }
.daily-streak {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-2) var(--space-3);
  background: rgba(255,102,0,0.1);
  border: 1px solid rgba(255,102,0,0.3);
  border-radius: var(--radius-full);
}
.streak-fire { font-size: 1rem; }
.streak-count {
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-accent);
  text-shadow: 0 0 8px rgba(255,102,0,0.6);
}
.topbar-avatar-btn {
  background: none;
  border: 2px solid var(--color-primary);
  border-radius: 50%;
  width: 38px; height: 38px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.topbar-avatar-btn:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 12px rgba(255,102,0,0.4);
}
.avatar-mini { width: 100%; height: 100%; }

/* ═══════════════════════════════════
   LOBBY PRINCIPAL
═══════════════════════════════════ */
#lobby-main {
  padding-top: var(--topbar-height);
  min-height: 100vh;
}
#view-lobby { padding: var(--space-8) var(--space-4); }
.lobby-title-row {
  text-align: center;
  margin-bottom: var(--space-8);
}
.lobby-title {
  font-family: var(--font-primary);
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 0.95;
  color: var(--color-text);
}
.lobby-title-accent {
  display: block;
  background: var(--helix-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lobby-welcome {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-3);
  letter-spacing: 0.1em;
}
.lobby-grid {
  max-width: 1000px;
  margin: 0 auto;
}

/* ═══════════════════════════════════
   GAMES GRID
═══════════════════════════════════ */
#view-games { padding: var(--space-6) var(--space-4); }
.view-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}
.view-title {
  font-family: var(--font-primary);
  font-size: var(--text-2xl);
  font-weight: 900;
  letter-spacing: 0.08em;
  background: var(--helix-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex: 1;
}
.back-btn {
  font-family: var(--font-primary);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  color: var(--color-text-secondary);
}
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
  max-width: 1200px;
  margin: 0 auto;
}
.game-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
}
.game-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(30,132,198,0.3);
}
.game-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: var(--color-surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}
.game-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--color-surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
}
.game-info { padding: var(--space-3) var(--space-4); }
.game-name {
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}
.game-desc {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  line-height: 1.4;
  margin-bottom: var(--space-3);
}
.game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.game-tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  background: rgba(255,102,0,0.1);
  border: 1px solid rgba(255,102,0,0.3);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}
.game-play-btn {
  font-family: var(--font-primary);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: var(--helix-gradient);
  color: white;
  border: none;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
}
.game-play-btn:hover { filter: brightness(1.15); }

/* ═══════════════════════════════════
   EMULADOR
═══════════════════════════════════ */
#view-emulator { padding: var(--space-4); }
.emu-header {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.emulator-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}
.emulator-screen {
  width: 100%;
  max-width: 854px;
  aspect-ratio: 4/3;
  background: #000;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(30,132,198,0.4), inset 0 0 20px rgba(0,0,0,0.5);
  position: relative;
}
.emulator-screen iframe { width: 100%; height: 100%; border: none; }
.emu-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: var(--space-4);
}
.emu-ph-text {
  font-family: var(--font-primary);
  font-size: var(--text-3xl);
  font-weight: 900;
  letter-spacing: 0.2em;
  background: var(--helix-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.4;
}
.emu-ph-sub {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  letter-spacing: 0.1em;
}
#emulator-container { width: 100%; height: 100%; position: absolute; inset: 0; }

/* Touch Controls */
.touch-controls {
  display: none;
  width: 100%;
  max-width: 854px;
  background: rgba(14,20,34,0.9);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}
.controls-left, .controls-right { flex: 1; display: flex; align-items: center; justify-content: center; }
.controls-center { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }

/* D-Pad */
.dpad {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
  gap: 2px;
}
.dpad-btn {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.1s;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.dpad-btn:active { background: var(--color-primary-dark); }
.dpad-up    { grid-column: 2; grid-row: 1; }
.dpad-left  { grid-column: 1; grid-row: 2; }
.dpad-center { grid-column: 2; grid-row: 2; background: transparent; border: none; cursor: default; }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down  { grid-column: 2; grid-row: 3; }

/* Center buttons */
.ctrl-btn {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.ctrl-btn:active { background: var(--color-primary-dark); color: white; }

/* Action buttons PS1 */
.action-btns {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.action-middle-row { display: flex; gap: 2px; }
.action-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.1s;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  font-weight: 700;
}
.btn-triangle { background: rgba(0,180,150,0.2); color: #00B496; border-color: #00B496; }
.btn-circle   { background: rgba(255,50,50,0.2); color: #FF3232; border-color: #FF3232; }
.btn-cross    { background: rgba(100,120,255,0.2); color: #6478FF; border-color: #6478FF; }
.btn-square   { background: rgba(255,100,180,0.2); color: #FF64B4; border-color: #FF64B4; }
.action-btn:active { filter: brightness(1.5); transform: scale(0.9); }

/* ═══════════════════════════════════
   MODALES
═══════════════════════════════════ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.modal-box {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 80px rgba(0,0,0,0.8), 0 0 40px rgba(30,132,198,0.2);
  animation: modalIn 0.3s ease;
}
@keyframes modalIn { from { opacity:0; transform:scale(0.95) translateY(10px); } to { opacity:1; transform:scale(1) translateY(0); } }
.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--color-error); color: white; border-color: var(--color-error); }
.modal-title {
  font-family: var(--font-primary);
  font-size: var(--text-xl);
  font-weight: 900;
  letter-spacing: 0.08em;
  background: var(--helix-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-6);
}

/* ═══ PERFIL ═══ */
.profile-box { max-width: 580px; }
.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.avatar-display {
  width: 100px; height: 100px;
  border: 3px solid var(--color-primary);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(30,132,198,0.5);
  background: var(--color-surface-2);
  display: flex; align-items: center; justify-content: center;
}
.profile-info { margin-bottom: var(--space-6); }
.profile-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}
.profile-field-row {
  display: flex;
  gap: var(--space-2);
}
.profile-input {
  flex: 1;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  letter-spacing: 0.05em;
  transition: border-color 0.2s;
}
.profile-input:focus { outline: none; border-color: var(--color-primary); }
.profile-stats-section {
  display: flex;
  justify-content: space-around;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
}
.profile-stat {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
}
.profile-stat span {
  font-family: var(--font-primary);
  font-size: var(--text-2xl);
  font-weight: 900;
  color: var(--color-neon-cyan);
  text-shadow: 0 0 10px rgba(0,216,255,0.5);
}
.profile-stat label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  color: var(--color-text-secondary);
}
.profile-section-title {
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
  text-transform: uppercase;
}
.achievements-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.achievement-badge {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  letter-spacing: 0.05em;
}
.logout-btn { margin-top: var(--space-4); width: 100%; color: var(--color-error); }
.logout-btn:hover { background: rgba(239,68,68,0.1); }

/* Avatar Editor */
.avatar-editor-preview {
  width: 120px; height: 120px;
  margin: 0 auto var(--space-4);
  border: 2px solid var(--color-primary);
  border-radius: 50%;
  background: var(--color-surface-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(30,132,198,0.4);
}
.avatar-options { margin-bottom: var(--space-4); }
.avatar-option-group { margin-bottom: var(--space-4); }
.avatar-option-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}
.color-swatches { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.swatch:hover, .swatch.active { border-color: white; transform: scale(1.15); }
.swatch-aura { border-radius: var(--radius-full); }
.accessory-options { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.acc-btn {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.acc-btn:hover { border-color: var(--color-primary); }
.acc-btn.active { border-color: var(--color-primary); background: rgba(30,132,198,0.15); }
.acc-btn.locked-acc { opacity: 0.4; cursor: not-allowed; }
.acc-lock { font-size: 0.7em; }

/* ═══ LEADERBOARD ═══ */
.lb-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-2);
}
.lb-tab {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-family: var(--font-primary);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}
.lb-tab.active { color: var(--color-text); background: var(--color-surface-2); }
.lb-list { display: flex; flex-direction: column; gap: var(--space-2); }
.lb-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s;
}
.lb-row.me { border-color: var(--color-primary); background: rgba(30,132,198,0.1); }
.lb-rank {
  font-family: var(--font-primary);
  font-size: var(--text-lg);
  font-weight: 900;
  min-width: 36px;
  text-align: center;
}
.lb-rank-1 { color: #FFD700; text-shadow: 0 0 10px rgba(255,215,0,0.6); }
.lb-rank-2 { color: #C0C0C0; }
.lb-rank-3 { color: #CD7F32; }
.lb-avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: var(--color-surface); border: 1px solid var(--color-border); flex-shrink: 0; }
.lb-name {
  flex: 1;
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.lb-score {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-neon-cyan);
}
.lb-sigue-asi-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s;
  padding: 2px;
}
.lb-sigue-asi-btn:hover { opacity: 1; transform: scale(1.2); }

/* ═══ AMIGOS ═══ */
.friends-search-row { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); }
.friends-list { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.friend-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.friend-name {
  flex: 1;
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  letter-spacing: 0.05em;
}
.empty-state {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  letter-spacing: 0.08em;
  padding: var(--space-3);
}

/* ═══ LOGRO (achievement popup) ═══ */
.achievement-box {
  text-align: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,215,0,0.5);
}
.achievement-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,215,0,0.1) 0%, transparent 70%);
  pointer-events: none;
  animation: achieveGlow 2s ease-in-out infinite alternate;
}
@keyframes achieveGlow { from { opacity: 0.5; } to { opacity: 1; } }
.achievement-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
  animation: achieveBounce 0.5s ease-out;
}
@keyframes achieveBounce { 0% { transform: scale(0) rotate(-20deg); } 80% { transform: scale(1.1) rotate(5deg); } 100% { transform: scale(1) rotate(0); } }
.achievement-title {
  font-family: var(--font-primary);
  font-size: var(--text-xl);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #FFD700;
  text-shadow: 0 0 20px rgba(255,215,0,0.6);
  margin-bottom: var(--space-2);
}
.achievement-name {
  font-family: var(--font-primary);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.achievement-desc {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
}

/* ═══ NOTIFICACIONES REALTIME ═══ */
.notif-container {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9500;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
  min-width: 280px;
}
.notif {
  background: var(--color-surface);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-primary);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--color-text);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 20px rgba(30,132,198,0.2);
  animation: notifIn 0.3s ease;
  text-align: center;
}
@keyframes notifIn { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

/* ═══ HELIX POWERED ═══ */
.helix-powered {
  text-align: center;
  padding: var(--space-4) var(--space-4) var(--space-6);
  position: relative;
  z-index: 10;
}
.helix-powered a {
  font-size: 10px;
  color: #999;
  opacity: 0.35;
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  transition: opacity 0.2s;
  font-family: var(--font-mono);
}
.helix-powered a:hover { opacity: 0.7; }

/* ═══════════════════════════════════
   RESPONSIVE
═══════════════════════════════════ */
@media (min-width: 768px) {
  .categories-grid { grid-template-columns: repeat(4, 1fr); }
  .touch-controls { display: flex; }
  .cat-title { font-size: var(--text-2xl); }
}
@media (min-width: 1024px) {
  .categories-grid { gap: var(--space-6); }
  .lobby-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 767px) {
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 2.5rem; }
  .hero-stats { gap: var(--space-4); }
  .topbar-label { display: none; }
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .touch-controls { display: flex; }
  .dpad-btn { width: 38px; height: 38px; }
}