/* ==========================================================================
   TABLAS MÁGICAS DE MULTIPLICAR - ESTILOS COMPACTOS Y ULTRA-RESPONSIVOS
   Diseñado para adaptarse perfectamente a TODO TIPO de dispositivos (Móvil, Tablet, Laptop, Desktop)
   ========================================================================== */

:root {
  --primary-pink: #ec4899;
  --primary-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-gold: #f59e0b;
  --success-green: #10b981;
  --error-red: #ef4444;
  
  --bg-gradient-1: #1e1b4b;
  --bg-gradient-2: #31103f;
  --bg-gradient-3: #0f172a;
  
  --glass-bg: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.25);
  --glass-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.35);
  
  --text-light: #ffffff;
  --text-sub: #e2e8f0;
  
  --font-heading: 'Fredoka', cursive, sans-serif;
  --font-body: 'Outfit', sans-serif;
}

/* Reset y Normalización */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2), var(--bg-gradient-3));
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  min-height: 100vh;
  color: var(--text-light);
  overflow-x: hidden;
  position: relative;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Canvases de fondo y confeti */
#bgCanvas, #confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

#bgCanvas { z-index: 1; }
#confettiCanvas { z-index: 99; }

/* Contenedor Principal Adaptable y Compacto */
.app-container {
  position: relative;
  z-index: 10;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100vh;
  justify-content: flex-start;
}

/* Tarjeta de Vidrio Compacta (Glassmorphism) */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
  padding: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Encabezado Compacto */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo-icon {
  font-size: 1.4rem;
  animation: spinSlow 6s linear infinite;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.header-title h1 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  background: linear-gradient(to right, #f472b6, #fbbf24, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

/* Marcador en Vivo Compacto */
.dad-scoreboard {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

.hearts-badge { border-color: rgba(236, 72, 153, 0.5); }
.belts-badge { border-color: rgba(245, 158, 11, 0.5); }
.streak-badge { border-color: rgba(56, 189, 248, 0.5); }

.badge-icon { font-size: 1.1rem; }
.badge-val { font-weight: 700; color: #fff; }

/* Controles de Audio/Voz */
.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--glass-border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.25);
}

.icon-btn.active {
  box-shadow: 0 0 10px var(--accent-cyan);
}

.text-btn {
  background: linear-gradient(135deg, var(--accent-gold), #d97706);
  border: none;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
  white-space: nowrap;
}

.text-btn:hover {
  transform: translateY(-2px);
}

.install-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Vistas / Pantallas */
.screen-view {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.screen-view.active {
  display: block;
}

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

/* PANTALLA 1: SELECCIÓN COMPACTA */
.hero-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}

.hero-header h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 3.5vw, 1.6rem);
  margin-top: 4px;
}

.hero-header p {
  color: var(--text-sub);
  margin-top: 2px;
  font-size: 0.9rem;
}

.mascot-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #f43f5e, #a855f7);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.5);
}

.pulse-anim {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* Grid de Tablas Adaptable y Compacto */
.table-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 8px;
}

.table-card-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid var(--glass-border);
  border-radius: 14px;
  padding: 10px 6px;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.table-card-btn span {
  font-size: 1.1rem;
}

.table-card-btn:hover, .table-card-btn:active {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--accent-cyan);
}

.table-card-btn.selected {
  background: linear-gradient(135deg, var(--primary-pink), var(--primary-purple));
  border-color: #fff;
  box-shadow: 0 0 18px rgba(236, 72, 153, 0.6);
}

.special-btn {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #f59e0b, #ec4899, #8b5cf6);
  background-size: 200% 200%;
  animation: gradientBG 6s infinite;
  font-size: 1rem;
  padding: 12px;
  flex-direction: row;
  justify-content: center;
  gap: 8px;
}

/* Opciones del Juego Compactas */
.game-options-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  background: rgba(0, 0, 0, 0.25);
  padding: 12px;
  border-radius: 14px;
  text-align: left;
}

.option-group label {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  display: block;
  margin-bottom: 6px;
  color: var(--accent-cyan);
}

.toggle-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.toggle-opt {
  flex: 1;
  min-width: 80px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-sub);
  padding: 8px 10px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.toggle-opt.active {
  background: var(--accent-cyan);
  color: #0f172a;
  border-color: #fff;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.4);
}

/* Botón CTA Compacto */
.cta-button {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  padding: 14px 24px;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
  transition: all 0.2s ease;
  width: 100%;
}

.cta-button:hover, .cta-button:active {
  transform: scale(1.02);
}

/* PANTALLA 2: ARENA DE JUEGO COMPACTA */
.game-arena-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.arena-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-btn-small {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.85rem;
}

.player-turn-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(139, 92, 246, 0.3);
  border: 1px solid var(--primary-purple);
  padding: 4px 12px;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
}

.progress-container {
  flex: 1;
  max-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
  color: var(--text-sub);
}

.progress-bar-track {
  height: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--primary-pink), var(--accent-cyan));
  border-radius: 8px;
  transition: width 0.3s ease;
}

.timer-badge {
  background: rgba(239, 68, 68, 0.3);
  border: 1px solid var(--error-red);
  padding: 4px 12px;
  border-radius: 16px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: #fca5a5;
}

.hidden { display: none !important; }

/* Mascota y Burbuja Compactas */
.mascot-speech-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 4px 0;
}

.mascot-character {
  font-size: 2.4rem;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.6));
  animation: floatMascot 3s ease-in-out infinite;
}

@keyframes floatMascot {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.mascot-bubble {
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  padding: 8px 14px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  max-width: 320px;
}

/* Tarjeta de Pregunta Matemática Compacta */
.math-question-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1.5px solid var(--glass-border);
  border-radius: 18px;
  padding: 16px 10px;
  text-align: center;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.4);
}

.question-expression {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 7vw, 3.2rem);
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.num-highlight {
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.op-symbol, .eq-symbol {
  color: var(--primary-pink);
}

.answer-placeholder {
  min-width: clamp(65px, 18vw, 95px);
  height: clamp(48px, 12vw, 65px);
  background: rgba(255, 255, 255, 0.15);
  border: 2px dashed var(--accent-cyan);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  font-size: clamp(2rem, 6vw, 2.8rem);
  padding: 0 10px;
}

.answer-placeholder.has-value {
  color: #fff;
  border-style: solid;
  border-color: #fff;
  background: rgba(6, 182, 212, 0.3);
}

/* Teclado Numérico y Entrada Directa Compacto */
.input-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#directInput {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.virtual-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 320px;
}

.key-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 10px;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  min-height: 48px;
  cursor: pointer;
  transition: all 0.1s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.key-btn:active {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0.95);
}

.danger-key {
  background: rgba(239, 68, 68, 0.3);
  border-color: var(--error-red);
  font-size: 1rem;
}

.action-key {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--success-green), #059669);
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* OVERLAYS Y MODALES COMPACTOS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  animation: fadeIn 0.25s ease forwards;
}

.feedback-content {
  text-align: center;
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 16px;
}

.feedback-icon-big {
  font-size: 4rem;
  line-height: 1;
}

.heart-pop {
  animation: heartPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite alternate;
}

@keyframes heartPop {
  0% { transform: scale(0.9); }
  100% { transform: scale(1.15); }
}

.belt-wobble {
  animation: beltWobble 0.5s ease-in-out infinite;
}

@keyframes beltWobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-12deg); }
  75% { transform: rotate(12deg); }
}

.success-title {
  font-family: var(--font-heading);
  color: #34d399;
  font-size: 1.8rem;
}

.error-title {
  font-family: var(--font-heading);
  color: #f87171;
  font-size: 1.6rem;
}

.feedback-msg {
  font-size: 0.95rem;
  color: var(--text-sub);
}

.reward-pill, .punish-pill {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  padding: 6px 16px;
  border-radius: 50px;
  align-self: center;
}

.reward-pill {
  background: rgba(236, 72, 153, 0.3);
  border: 1px solid var(--primary-pink);
  color: #f472b6;
}

.punish-pill {
  background: rgba(245, 158, 11, 0.3);
  border: 1px solid var(--accent-gold);
  color: #fbbf24;
}

.correct-answer-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px;
  border-radius: 10px;
  font-size: 1rem;
}

/* PANTALLA 3: PANEL PAPÁ & RESUMEN COMPACTO */
.summary-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.summary-header h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--accent-cyan);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.stat-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  padding: 12px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-icon {
  font-size: 1.8rem;
}

.stat-info h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: #fff;
}

.stat-info p {
  font-size: 0.75rem;
  color: var(--text-sub);
}

.achievements-section h3, .history-table-container h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.badges-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-item {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--accent-gold);
  padding: 6px 12px;
  border-radius: 16px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.table-responsive {
  max-height: 200px;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

.history-table th {
  background: rgba(0, 0, 0, 0.5);
  padding: 8px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--accent-cyan);
  position: sticky;
  top: 0;
}

.history-table td {
  padding: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
}

.summary-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-btn {
  flex: 1;
  min-width: 140px;
  background: linear-gradient(135deg, var(--primary-purple), var(--primary-pink));
  border: none;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: 50px;
  cursor: pointer;
}

.gold-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.outline-btn {
  background: transparent;
  border: 1.5px solid var(--glass-border);
}

/* DIPLOMA MODAL COMPACTO */
.certificate-wrapper {
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 14px;
}

.close-cert-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

.certificate-border {
  background: #fff;
  color: #1e293b;
  border: 6px double #d97706;
  border-radius: 14px;
  padding: 18px 12px;
  text-align: center;
}

.cert-header .cert-crown { font-size: 2.2rem; }
.cert-header h1 { font-family: var(--font-heading); font-size: 1.6rem; color: #b45309; }
.cert-sub { font-weight: 700; color: #64748b; font-size: 0.75rem; letter-spacing: 1px; }

.cert-body { margin: 12px 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem; }

.student-name-input-wrap input {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  text-align: center;
  color: #0369a1;
  border: none;
  border-bottom: 2px solid #0369a1;
  outline: none;
  width: 90%;
}

#certTableTitle { font-family: var(--font-heading); color: #7c3aed; font-size: 1.3rem; }

.cert-stats { font-weight: 600; font-size: 0.95rem; color: #334155; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }

.cert-footer {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.signature-box { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sig-line { font-family: 'Fredoka', cursive; font-size: 1rem; border-bottom: 1.5px dashed #94a3b8; width: 120px; }
.signature-box p { font-size: 0.75rem; color: #64748b; }
.print-btn { margin-top: 12px; background: linear-gradient(135deg, #0284c7, #0369a1); font-size: 1rem; padding: 10px 20px; }

/* Estilos de Impresión */
@media print {
  body * { visibility: hidden; }
  #certificateModal, #certificateModal * { visibility: visible; }
  #certificateModal { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: none; }
  .close-cert-btn, .print-btn { display: none; }
}

/* ==========================================================================
   BREAKPOINTS ADAPTABLES PARA TODO TIPO DE DISPOSITIVOS Y ORIENTACIONES
   ========================================================================== */

/* 1. Teléfonos Móviles en Retrato (< 550px) */
@media (max-width: 550px) {
  .app-container { padding: 8px; gap: 8px; }
  .main-header { flex-direction: column; gap: 6px; padding: 8px 10px; }
  .header-title h1 { font-size: 1.1rem; }
  .dad-scoreboard { width: 100%; justify-content: center; }
  .score-badge { padding: 3px 8px; font-size: 0.85rem; }
  
  .table-selection-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .table-card-btn { padding: 8px 4px; font-size: 0.8rem; }
  .table-card-btn span { font-size: 0.95rem; }
  
  .game-options-container { grid-template-columns: 1fr; gap: 8px; padding: 10px; }
  .toggle-opt { font-size: 0.8rem; padding: 6px 8px; }
  .cta-button { font-size: 1.05rem; padding: 10px 16px; }

  .math-question-card { padding: 12px 8px; }
  .question-expression { font-size: clamp(1.8rem, 8vw, 2.6rem); gap: 6px; }
  .answer-placeholder { min-width: 60px; height: 46px; font-size: 2.2rem; }

  .virtual-keypad { max-width: 290px; gap: 6px; }
  .key-btn { min-height: 42px; font-size: 1.25rem; padding: 6px; }
}

/* 2. Pantallas Súper Pequeñas / Relojes o Móviles Antiguos (< 360px) */
@media (max-width: 360px) {
  .table-selection-grid { grid-template-columns: repeat(2, 1fr); }
  .score-badge { font-size: 0.75rem; padding: 2px 6px; }
}

/* 3. Dispositivos Móviles en Modo Paisaje / Horizontal (max-height: 500px) */
@media (max-height: 500px) and (orientation: landscape) {
  .main-header { padding: 4px 10px; }
  .hero-section { gap: 6px; }
  .hero-header p, .mascot-avatar { display: none; }
  .table-selection-grid { grid-template-columns: repeat(6, 1fr); gap: 4px; }
  
  .game-arena-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: center;
  }
  .arena-header { grid-column: 1 / -1; }
  .mascot-speech-container { margin: 0; }
  .virtual-keypad { max-width: 260px; gap: 4px; }
  .key-btn { min-height: 36px; font-size: 1.1rem; padding: 4px; }
}

/* 4. Tablets y Pantallas Medianas (551px a 1024px) */
@media (min-width: 551px) and (max-width: 1024px) {
  .app-container { max-width: 720px; padding: 16px; gap: 16px; }
  .table-selection-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .game-options-container { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .question-expression { font-size: 3.2rem; }
  .virtual-keypad { max-width: 380px; gap: 10px; }
  .key-btn { min-height: 54px; font-size: 1.5rem; }
}

/* 5. Computadoras y Pantallas Escritorio Grandes (> 1024px) */
@media (min-width: 1025px) {
  .app-container { max-width: 860px; padding: 20px; gap: 20px; }
  .table-selection-grid { grid-template-columns: repeat(5, 1fr); gap: 12px; }
  .game-options-container { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .virtual-keypad { max-width: 420px; gap: 12px; }
  .key-btn { min-height: 58px; font-size: 1.6rem; }
}
