/* ==========================================================================
   ESTILOS WOW: EL UNIVERSO DE LOS MONSTRUOS GEOMÉTRICOS (3° BÁSICO COLEGIO ROBLES)
   ========================================================================== */

:root {
  --bg-dark: #070913;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-glass: rgba(255, 255, 255, 0.12);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-cyan: #38bdf8;
  --accent-gold: #f59e0b;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-emerald: #10b981;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --font-main: 'Outfit', sans-serif;
  --font-title: 'Syne', sans-serif;
  --shadow-glow: 0 0 40px rgba(56, 189, 248, 0.25);
  --transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow-x: hidden;
}

/* Background Cosmic Canvas & Mesh */
body {
  min-height: 100vh;
  background: 
    radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.08) 0%, transparent 60%),
    linear-gradient(135deg, #070913 0%, #0d111d 50%, #090d18 100%);
  position: relative;
}

/* Partículas Geométricas Flotantes */
.geometric-bg-shapes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.geo-shape {
  position: absolute;
  opacity: 0.15;
  animation: floatGeo 18s ease-in-out infinite alternate;
}

.geo-shape--1 {
  top: 10%;
  left: 5%;
  width: 120px;
  height: 120px;
  border: 3px solid var(--accent-cyan);
  transform: rotate(45deg);
}

.geo-shape--2 {
  top: 70%;
  right: 8%;
  width: 150px;
  height: 150px;
  border: 3px solid var(--accent-purple);
  border-radius: 50%;
}

.geo-shape--3 {
  top: 40%;
  left: 80%;
  width: 0;
  height: 0;
  border-left: 60px solid transparent;
  border-right: 60px solid transparent;
  border-bottom: 100px solid rgba(245, 158, 11, 0.4);
}

@keyframes floatGeo {
  0% { transform: translateY(0) rotate(0deg) scale(1); }
  50% { transform: translateY(-30px) rotate(180deg) scale(1.1); }
  100% { transform: translateY(30px) rotate(360deg) scale(0.95); }
}

/* ==========================================================================
   1. INTRO CINEMATOGRÁFICA (WANO CINE SCREEN)
   ========================================================================== */

.intro-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #1e1b4b 0%, #070913 80%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.intro-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-content {
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: introFadeIn 1.2s ease-out;
}

@keyframes introFadeIn {
  0% { opacity: 0; transform: scale(0.9) translateY(20px); }
  100% { opacity: 0.99; transform: scale(1) translateY(0); }
}

.intro-school-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 8px 20px;
  border-radius: 100px;
  color: var(--accent-cyan);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
}

.intro-title {
  font-family: var(--font-title);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 0%, #38bdf8 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.intro-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text-muted);
  font-weight: 400;
  max-width: 650px;
  line-height: 1.6;
}

.btn-launch {
  margin-top: 16px;
  background: linear-gradient(135deg, #38bdf8 0%, #a855f7 100%);
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 1.25rem;
  font-weight: 800;
  padding: 20px 48px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.4), 0 10px 25px rgba(0, 0, 0, 0.4);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.btn-launch:hover {
  transform: scale(1.06) translateY(-3px);
  box-shadow: 0 0 60px rgba(168, 85, 247, 0.6), 0 15px 35px rgba(0, 0, 0, 0.5);
}

.btn-launch::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: rotate(30deg);
  animation: shine 4s infinite;
}

@keyframes shine {
  0% { transform: translateX(-100%) rotate(30deg); }
  20%, 100% { transform: translateX(100%) rotate(30deg); }
}

/* ==========================================================================
   2. HEADER & NAVEGACIÓN
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 9, 19, 0.85);
  backdrop-filter: blur(16px);
  border-b: 1px solid var(--border-glass);
  padding: 16px 24px;
}

.header-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.4rem;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.brand-text h1 {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-text p {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

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

.btn-random {
  background: linear-gradient(135deg, var(--accent-gold), #f97316);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-random:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

/* ==========================================================================
   3. HERO BANNER & FILTROS GEOMÉTRICOS
   ========================================================================== */

.hero-section {
  position: relative;
  z-index: 10;
  max-width: 1300px;
  margin: 40px auto 20px;
  padding: 0 24px;
  text-align: center;
}

.hero-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: var(--accent-purple);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.main-title {
  font-family: var(--font-title);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 12px;
}

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

.hero-sub {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

/* Barra de Filtros */
.filters-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.filter-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  color: var(--text-main);
  border-color: rgba(56, 189, 248, 0.4);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

/* Contador de Monstruos */
.monsters-counter {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-weight: 500;
}

.monsters-counter strong {
  color: var(--accent-gold);
}

/* ==========================================================================
   4. GALERÍA DE TARJETAS 3D HOLO
   ========================================================================== */

.monsters-grid {
  position: relative;
  z-index: 10;
  max-width: 1300px;
  margin: 0 auto 80px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

.monster-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
}

.monster-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(56, 189, 248, 0.2);
}

.video-preview-wrapper {
  position: relative;
  width: 100%;
  padding-top: 100%; /* Aspect ratio 1:1 */
  background: #000;
  overflow: hidden;
}

.monster-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 19, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.monster-card:hover .card-play-overlay {
  opacity: 1;
}

.play-icon-badge {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.3rem;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.6);
  transform: scale(0.8);
  transition: var(--transition);
}

.monster-card:hover .play-icon-badge {
  transform: scale(1);
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.monster-badge-tag {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
}

.monster-name {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.monster-short-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--accent-gold);
  font-weight: 600;
}

/* ==========================================================================
   5. MODAL LABORATORIO DE GEOMETRÍA
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 19, 0.9);
  backdrop-filter: blur(20px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 50px rgba(56, 189, 248, 0.3);
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  animation: modalScaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  0% { transform: scale(0.9) translateY(20px); }
  100% { transform: scale(1) translateY(0); }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-glass);
  border-radius: 50%;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: #ef4444;
  transform: rotate(90deg);
}

.modal-media-player {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 350px;
}

.modal-media-player video {
  width: 100%;
  height: 100%;
  max-height: 600px;
  object-fit: contain;
}

.modal-details {
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-monster-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  align-self: flex-start;
}

.modal-monster-title {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
}

.modal-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-item {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-main);
  font-weight: 500;
}

.superpower-box {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(56, 189, 248, 0.15));
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 16px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ==========================================================================
   6. FOOTER INSTITUCIONAL COLEGIO ROBLES
   ========================================================================== */

.app-footer {
  border-top: 1px solid var(--border-glass);
  background: rgba(7, 9, 19, 0.9);
  padding: 40px 24px;
  text-align: center;
  position: relative;
  z-index: 10;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-logo-title {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 800;
}

.footer-logo-title span {
  color: var(--accent-cyan);
}

.footer-credits {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-credits a {
  color: var(--accent-gold);
  text-decoration: none;
  font-weight: 700;
}

/* ==========================================================================
   8. PESTAÑAS PRINCIPALES Y PANELES DE SECCIÓN
   ========================================================================== */

.main-tabs-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-tab-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  color: var(--text-main);
}

.main-tab-btn.active {
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.tab-content-panel {
  display: none;
}

.tab-content-panel.active {
  display: block;
}

/* ==========================================================================
   9. TALLER CREADOR DE MONSTRUOS GEOMÉTRICOS 2D
   ========================================================================== */

.creator-container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 24px;
}

.creator-header {
  text-align: center;
  margin-bottom: 28px;
}

.creator-header h2 {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--text-main);
  margin-bottom: 8px;
}

.creator-header p {
  color: var(--text-muted);
  font-size: 1rem;
}

.creator-workspace {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.creator-tools {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tool-group-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.shape-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.shape-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 8px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.shape-btn:hover {
  background: rgba(56, 189, 248, 0.2);
}

.shape-btn.active {
  background: var(--accent-cyan);
  color: white;
  border-color: transparent;
}

.color-picker-grid {
  display: flex;
  gap: 10px;
}

.color-picker-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.color-picker-btn.active {
  transform: scale(1.2);
  border-color: white;
  box-shadow: 0 0 10px rgba(255,255,255,0.6);
}

.creator-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.btn-tool {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
  padding: 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-tool:hover {
  background: var(--accent-cyan);
  color: white;
}

.btn-tool-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.btn-tool-danger:hover {
  background: #ef4444;
  color: white;
}

.canvas-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

#creatorCanvas {
  background: #090d18;
  border: 2px dashed rgba(56, 189, 248, 0.4);
  border-radius: 16px;
  touch-action: none;
  cursor: crosshair;
}

.canvas-instructions {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.creator-summary-box {
  margin-top: 16px;
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-glass);
  padding: 16px;
  border-radius: 12px;
}

.creator-summary-box h4 {
  font-size: 0.85rem;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

/* ==========================================================================
   10. CENTRO DE JUEGOS GEOMÉTRICOS (SNAKE, TRIVIA, CONTADOR)
   ========================================================================== */

.games-center-container {
  max-width: 1000px;
  margin: 30px auto;
  padding: 0 24px;
}

.games-header {
  text-align: center;
  margin-bottom: 24px;
}

.games-header h2 {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--text-main);
  margin-bottom: 8px;
}

.game-tabs-wrapper {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.game-tab-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.game-tab-btn:hover {
  background: rgba(168, 85, 247, 0.2);
  color: white;
}

.game-tab-btn.active {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

.game-sub-section {
  display: none;
}

.game-sub-section.active {
  display: block;
}

.game-card-box {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  text-align: center;
}

/* JUEGO 1: SNAKE */
.snake-game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.snake-target-box {
  font-size: 1.1rem;
  font-weight: 800;
  padding: 6px 16px;
  background: rgba(255,255,255,0.06);
  border-radius: 100px;
}

.snake-score-badge {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.snake-canvas-container {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}

#snakeCanvas {
  border: 3px solid var(--accent-purple);
  border-radius: 16px;
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.3);
}

.snake-touch-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}

.snake-touch-row {
  display: flex;
  gap: 12px;
}

.snake-touch-btn {
  width: 48px;
  height: 48px;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid var(--accent-cyan);
  border-radius: 12px;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
}

.snake-gameover-card {
  margin-top: 16px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 16px;
  border-radius: 16px;
  color: var(--text-main);
  animation: modalScaleUp 0.3s ease;
}

.snake-gameover-card h4 {
  font-size: 1.2rem;
  color: #f87171;
  margin-bottom: 6px;
}

.snake-gameover-card p {
  font-size: 1rem;
  margin-bottom: 8px;
}

.game-card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-random-sm {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-random-sm:hover {
  background: var(--accent-cyan);
  color: white;
}

/* STYLES PARA GEO-TANGRAM INTERACTIVO */
.tangram-interactive-workspace {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.tangram-silueta-box {
  background: #090d18;
  border: 2px dashed var(--accent-cyan);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.tangram-palette-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-glass);
  padding: 20px;
  border-radius: 16px;
  text-align: left;
  min-width: 220px;
}

.tangram-palette-box h4 {
  font-size: 0.9rem;
  color: var(--accent-gold);
  margin-bottom: 12px;
}

.tangram-pieces-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tangram-piece-item {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.tangram-piece-item:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
  transform: translateX(4px);
}

/* JUEGO 2: TRIVIA REAL */
.quiz-title-head {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.quiz-svg-box {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 16px;
  background: #090d18;
  border: 1px solid var(--border-glass);
  padding: 16px;
  border-radius: 16px;
  max-width: 200px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.quiz-question-text {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--accent-cyan);
}

.quiz-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 600px;
  margin: 0 auto 20px;
}

.quiz-opt-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 16px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.quiz-opt-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
}

.quiz-opt-btn.correct {
  background: #10b981 !important;
  color: white;
  border-color: transparent;
}

.quiz-opt-btn.wrong {
  background: #ef4444 !important;
  color: white;
  border-color: transparent;
}

.feedback-success {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
}

.feedback-error {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
}

/* JUEGO 3: CONSTRUE-GEOMETRÍA */
.build-challenge-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.build-svg-box {
  background: #090d18;
  border: 1px solid var(--border-glass);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.build-challenge-info {
  text-align: left;
  max-width: 400px;
}

.build-challenge-info h4 {
  font-size: 1.3rem;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.build-question-text {
  font-size: 1.05rem;
  color: var(--text-main);
  margin-bottom: 16px;
}

.build-input-group {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.build-input-group input {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-glass);
  color: white;
  padding: 10px 16px;
  border-radius: 100px;
  font-size: 1rem;
  width: 140px;
}

/* RESPONSIVE PESTAÑAS Y CREADOR */
@media (max-width: 850px) {
  .main-tabs-nav {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 6px;
  }

  .creator-workspace {
    grid-template-columns: 1fr;
  }

  .quiz-options-grid {
    grid-template-columns: 1fr;
  }
}


@media (max-width: 768px) {
  /* Header Móvil */
  .app-header {
    padding: 12px 16px;
  }

  .header-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    border-radius: 10px;
  }

  .brand-text h1 {
    font-size: 1.1rem;
  }

  .brand-text p {
    font-size: 0.72rem;
  }

  .btn-random {
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: 100px;
  }

  .btn-random span {
    display: none; /* Ocultar texto largo en celular muy pequeño, solo mostrar icono o corto */
  }

  /* Intro Screen en Celulares */
  .intro-screen {
    padding: 16px;
  }

  .intro-school-badge {
    font-size: 0.75rem;
    padding: 6px 14px;
  }

  .intro-title {
    font-size: clamp(1.8rem, 7vw, 2.6rem);
  }

  .intro-subtitle {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .btn-launch {
    width: 100%;
    max-width: 320px;
    padding: 16px 28px;
    font-size: 1.05rem;
    justify-content: center;
  }

  /* Hero Banner & Filtros en Celulares */
  .hero-section {
    margin: 20px auto 16px;
    padding: 0 16px;
  }

  .main-title {
    font-size: 1.8rem;
  }

  .hero-sub {
    font-size: 0.92rem;
    margin-bottom: 24px;
  }

  /* Barra de Filtros con Desplazamiento Suave Horizontal en Celulares */
  .filters-wrapper {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 4px 0 12px;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .filters-wrapper::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  /* Rejilla de Monstruos 2 Columnas para Celulares */
  .monsters-grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 14px;
    padding: 0 16px;
    margin-bottom: 40px;
  }

  .monster-card {
    border-radius: var(--radius-md);
  }

  .card-body {
    padding: 12px;
    gap: 6px;
  }

  .monster-badge-tag {
    font-size: 0.68rem;
    padding: 3px 8px;
  }

  .monster-name {
    font-size: 0.98rem;
  }

  .monster-short-desc {
    font-size: 0.8rem;
    -webkit-line-clamp: 2;
  }

  .card-footer {
    font-size: 0.72rem;
    padding-top: 8px;
  }

  /* Modal Laboratorio Adaptado a Teléfonos */
  .modal-backdrop {
    padding: 12px;
  }

  .modal-card {
    grid-template-columns: 1fr;
    max-height: 92vh;
    border-radius: 20px;
  }

  .modal-close-btn {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .modal-media-player {
    min-height: 220px;
    max-height: 300px;
  }

  .modal-details {
    padding: 18px;
    gap: 14px;
  }

  .modal-monster-title {
    font-size: 1.4rem;
  }

  .chip-item {
    font-size: 0.78rem;
    padding: 4px 10px;
  }

  .superpower-box {
    padding: 12px;
    font-size: 0.88rem;
    line-height: 1.5;
  }
}

@media (min-width: 480px) and (max-width: 768px) {
  .btn-random span {
    display: inline;
  }
}

/* ==========================================================================
   MODAL DE JUEGO CUNCUNA (FOCUS MODE & CONTROLES UNIVERSALES)
   ========================================================================== */
.snake-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 20, 0.95);
  backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.snake-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.snake-modal-card {
  background: #090d18;
  border: 2px solid var(--accent-cyan);
  border-radius: 24px;
  padding: 24px;
  width: 100%;
  max-width: 460px;
  max-height: 95vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 40px rgba(56, 189, 248, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
}

.snake-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-glass);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.snake-modal-close:hover {
  background: #ef4444;
  transform: rotate(90deg);
}

.snake-canvas-container canvas {
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.6);
  touch-action: none;
  max-width: 100%;
  height: auto;
}

.snake-touch-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}

.snake-touch-row {
  display: flex;
  gap: 12px;
}

.snake-touch-btn {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.9);
  border: 1.5px solid var(--accent-cyan);
  color: white;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: transform 0.1s ease, background 0.2s ease;
}

.snake-touch-btn:active {
  transform: scale(0.92);
  background: var(--accent-cyan);
}


