/* ==========================================================================
   DIT - Conecta Tablas | CSS Stylesheet
   Estilo visual 2D limpio, moderno, educativo-tecnológico
   Fondo blanco con tonos azules y morados, degradados suaves y tarjetas redondeadas
   ========================================================================== */

:root {
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Colores DIT & UI Oficiales (Basados en Disruptive---LOGO + Alpha.png) */
  --dit-purple: #7d3c9e;
  --dit-purple-dark: #632d80;
  --dit-purple-light: #a24ced;
  --dit-blue: #4f7fff;
  --dit-cyan: #06b6d4;
  --dit-gold: #f59e0b;
  --dit-emerald: #10b981;
  --dit-rose: #ef4444;

  /* Fondos y Superficies */
  --bg-canvas: #f8faff;
  --bg-card: #ffffff;
  --bg-modal: #130f26;
  --bg-modal-card: #1f183d;

  /* Texto */
  --text-dark: #1e1b4b;
  --text-muted: #64748b;
  --text-light: #f8fafc;

  /* Bordes y Sombras */
  --border-light: rgba(226, 232, 240, 0.9);
  --shadow-card: 0 16px 36px -8px rgba(15, 23, 42, 0.08), 0 6px 16px -4px rgba(15, 23, 42, 0.04);
  --shadow-floating: 0 24px 48px -12px rgba(15, 23, 42, 0.16);
  --radius-card: 20px;
  --radius-pill: 9999px;
  --radius-sm: 10px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-canvas);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  user-select: none;
}

/* ==========================================================================
   Fondo Tecnológico Suave (Cuadrícula + Luces Ambientales + Silueta Vectorial)
   ========================================================================== */
.background-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: 
    linear-gradient(to right, rgba(99, 102, 241, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  pointer-events: none;
}

.bg-glow-blue {
  top: -100px;
  left: 10%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, transparent 70%);
}

.bg-glow-purple {
  top: 15%;
  right: 5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.22) 0%, transparent 70%);
}

.bg-glow-gold {
  bottom: 0;
  left: 20%;
  width: 400px;
  height: 350px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, transparent 70%);
}

.bg-scenery {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 320px;
  opacity: 0.7;
}

/* ==========================================================================
   HUD Superior
   ========================================================================== */
.game-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dit-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: #1e1b4b;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  border: 1.5px solid rgba(125, 60, 158, 0.25);
  box-shadow: 0 4px 14px rgba(125, 60, 158, 0.1);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dit-pill-badge:hover {
  border-color: #7d3c9e;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(125, 60, 158, 0.2);
}

.dit-brand-acronym {
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #7d3c9e 0%, #4f7fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.dit-logo-gem {
  color: #7d3c9e;
  font-size: 0.95rem;
  animation: pulseGem 2.5s infinite;
}

.header-divider {
  color: #cbd5e1;
  font-weight: 300;
}

.header-subtitle {
  color: #7d3c9e;
  font-weight: 700;
  font-size: 0.78rem;
}

.level-indicator {
  display: inline-block;
  background: rgba(241, 245, 249, 0.9);
  color: #334155;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(203, 213, 225, 0.7);
}

/* Banner Central de Misión */
.mission-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #ffffff;
  padding: 8px 22px;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mission-sparkle {
  font-size: 1rem;
}

.badge-mini-gold {
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid #f59e0b;
  color: #fef08a;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.8rem;
}

.badge-mini-purple {
  background: rgba(216, 180, 254, 0.25);
  border: 1px solid #c084fc;
  color: #f3e8ff;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.8rem;
}

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

.icon-btn {
  background: #ffffff;
  border: 1px solid var(--border-light);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.05rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
  border-color: #cbd5e1;
}

.icon-btn:active {
  transform: translateY(0);
}

/* ==========================================================================
   Toast de Error (Captura 4)
   ========================================================================== */
.error-toast {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 620px;
  width: 90%;
}

.error-toast.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.error-toast.shake {
  animation: toastShake 0.45s ease-in-out;
}

.toast-content {
  background: #0f172a;
  color: #ffffff;
  border: 1.5px solid rgba(239, 68, 68, 0.7);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: 0 12px 32px rgba(239, 68, 68, 0.2), 0 4px 12px rgba(0,0,0,0.4);
}

.toast-icon-circle {
  color: #ef4444;
  flex-shrink: 0;
  margin-top: 2px;
}

.toast-texts {
  flex: 1;
}

.toast-title {
  color: #f87171;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.toast-message {
  color: #e2e8f0;
  font-size: 0.88rem;
  line-height: 1.4;
}

.toast-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.toast-close:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.1);
}

/* ==========================================================================
   Escenario del Juego (Tablas y Capa SVG)
   ========================================================================== */
.game-stage {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 90px;
  padding: 36px 24px 140px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

/* Capa SVG de Conexión */
.connection-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

.drag-cable {
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.6));
  stroke-linecap: round;
}

.connected-cable {
  stroke-linecap: round;
  transition: stroke 0.3s ease;
}

.cable-particles circle {
  fill: #34d399;
  filter: drop-shadow(0 0 6px #10b981);
}

/* Indicador de Estado Reubicado a la Cabecera (Discreto y Elegante) */
.status-connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.02em;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  transition: all 0.3s ease;
}

/* Estado Conectado del Badge */
.status-connection-badge.connected {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #059669;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.2);
  transform: scale(1.02);
}

.status-connection-badge.connected .status-indicator-dot {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseSuccessDot 1.6s infinite;
}

@keyframes pulseSuccessDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.8; }
}

/* ==========================================================================
   Tarjetas de Tabla (Clientes y Pedidos)
   ========================================================================== */
.table-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  width: 480px;
  max-width: 100%;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(226, 232, 240, 0.85);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  z-index: 6;
}

.table-card:hover {
  box-shadow: var(--shadow-floating);
}

.table-card.active-target {
  border-color: var(--dit-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2), var(--shadow-floating);
}

/* Encabezados de Tabla */
.table-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
}

.header-clientes {
  background: linear-gradient(135deg, #f97316 0%, #4338ca 100%);
}

.header-pedidos {
  background: linear-gradient(135deg, #7c3aed 0%, #312e81 100%);
}

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

.db-3d-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.table-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.table-subtitle {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 2px;
  font-weight: 400;
}

.table-role-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.25);
  letter-spacing: 0.03em;
  backdrop-filter: blur(4px);
}

/* Barra de Sección de Campos */
.fields-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
}

.fields-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #64748b;
}

.fields-section-hint {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #3b82f6;
  text-transform: uppercase;
}

/* Lista de Campos */
.fields-list {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Filas de Campo */
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border-light);
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
  outline: none;
}

.field-row:hover {
  transform: translateY(-1px);
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.field-row:focus-visible {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
  border-color: var(--dit-purple);
}

/* Estado de Selección (para modo Tap/Click) */
.field-row.selected {
  border-color: var(--dit-purple) !important;
  background: #f5f3ff !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

/* Estilos Específicos para PK y FK */
.row-pk {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.7) 0%, rgba(253, 230, 138, 0.35) 100%);
  border-color: #fbbf24;
}

.row-pk:hover {
  border-color: #f59e0b;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.15);
}

.row-fk {
  background: linear-gradient(135deg, rgba(243, 232, 255, 0.8) 0%, rgba(233, 213, 255, 0.4) 100%);
  border-color: #c084fc;
}

.row-fk:hover {
  border-color: #a855f7;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.15);
}

.row-orders-pk {
  border-color: #fde68a;
}

/* Animación de Conexión Exitosa */
.field-row.connected-pulse {
  border-color: #10b981 !important;
  background: #ecfdf5 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: pulseSuccessRow 1.8s infinite;
}

/* Animación de Error en Fila */
.field-row.shake-error {
  animation: rowShake 0.4s ease-in-out;
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
}

.field-left-meta, .field-right-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field-name-label {
  font-size: 0.92rem;
  color: #1e293b;
}

.field-code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.94rem;
}

.field-type-tag {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
}

/* Píldoras de Metadata */
.pill-info-pk {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef08a;
  color: #854d0e;
  border: 1px solid #facc15;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
}

.pill-info-fk {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #d8b4fe;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
}

.pill-order-pk {
  background: #fef9c3;
  color: #a16207;
  border: 1px solid #fde047;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
}

.pill-regular-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
}

/* Nodos Conectores Circulares */
.node-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.connection-node {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
}

.connection-node:hover {
  transform: scale(1.35);
}

.connection-node:active {
  cursor: grabbing;
}

.node-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border-width: 2.5px;
  border-style: solid;
  transition: all 0.2s ease;
}

.node-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

/* Colores de Nodos */
.node-gold .node-ring {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
}
.node-gold .node-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.node-purple .node-ring {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.15);
}
.node-purple .node-dot {
  background: #a855f7;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
}

.node-neutral .node-ring {
  border-color: #94a3b8;
  background: rgba(148, 163, 184, 0.15);
}
.node-neutral .node-dot {
  background: #94a3b8;
}

/* Pulso en el nodo destino cuando se está arrastrando */
.is-dragging .node-purple {
  animation: nodeTargetPulse 1.2s infinite;
}

/* ==========================================================================
   Vista Previa de Ejemplo de Datos (Spreadsheet)
   ========================================================================== */
.data-preview-section {
  padding: 12px 18px 16px;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
}

.data-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.data-preview-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #64748b;
}

.link-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #059669;
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.link-count-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #7c3aed;
  background: #ede9fe;
  border: 1px solid #ddd6fe;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.table-responsive-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.records-table th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 7px 10px;
  border-bottom: 1px solid #e2e8f0;
  font-family: var(--font-mono);
}

.records-table th.th-pk {
  color: #b45309;
  background: #fefce8;
}

.records-table th.th-fk {
  color: #7e22ce;
  background: #faf5ff;
}

.records-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-size: 0.8rem;
  transition: background-color 0.2s ease;
}

.record-row {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.record-row:hover {
  background-color: #f8fafc;
}

.cell-pk {
  font-family: var(--font-mono);
  font-weight: 700;
}

.pk-badge-number {
  background: #fef08a;
  color: #854d0e;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #facc15;
}

.cell-fk {
  font-family: var(--font-mono);
  font-weight: 700;
}

.fk-badge-number {
  background: #f3e8ff;
  color: #7e22ce;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #d8b4fe;
}

.cell-email {
  color: #64748b;
}

.cell-price {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #047857;
}

/* Resaltado interactivo de registros enlazados */
.record-row.active-highlight {
  background-color: #ecfdf5 !important;
}

.record-row.active-highlight .pk-badge-number,
.record-row.active-highlight .fk-badge-number {
  background-color: #10b981;
  color: #ffffff;
  border-color: #059669;
}

/* ==========================================================================
   Barra Inferior de Éxito (Captura 5)
   ========================================================================== */
.bottom-success-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: #ffffff;
  border-top: 2px solid #a7f3d0;
  box-shadow: 0 -8px 30px rgba(16, 185, 129, 0.15);
  transform: translateY(110%);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 14px 24px;
}

.bottom-success-bar.active {
  transform: translateY(0);
}

.success-bar-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.success-badge-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: #ecfdf5;
  border: 1.5px solid #a7f3d0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-text-content {
  flex: 1;
}

.success-headline {
  font-size: 1.12rem;
  font-weight: 800;
  color: #065f46;
  margin-bottom: 3px;
}

.success-description {
  font-size: 0.9rem;
  color: #1e293b;
  margin-bottom: 2px;
}

.success-subtip {
  font-size: 0.82rem;
  color: #047857;
  font-weight: 500;
}

.tip-highlight {
  font-weight: 700;
}

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

.btn-retry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-retry:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.btn-next-level {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
  color: #ffffff;
  border: none;
  padding: 11px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
  transition: all 0.2s ease;
}

.btn-next-level:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
  background: linear-gradient(135deg, #10b981 0%, #0f766e 100%);
}

.btn-next-level:active {
  transform: translateY(0);
}

/* ==========================================================================
   Modales (Bienvenida y ¿Cómo se Juega?)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-modal);
  border: 1.5px solid rgba(139, 92, 246, 0.35);
  border-radius: 24px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(139, 92, 246, 0.15);
  color: #ffffff;
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalScaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Modal de Bienvenida (Captura 1) */
.welcome-card {
  width: 440px;
  max-width: 95vw;
  padding: 36px 32px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.crystal-container {
  position: relative;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 16px rgba(168, 85, 247, 0.6));
  animation: floatCrystal 3s ease-in-out infinite;
}

.crystal-svg {
  display: block;
}

.dit-brand-letters {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.25em;
  margin-bottom: 12px;
  position: relative;
  padding-bottom: 8px;
}

.dit-brand-letters .l-d { color: #d8b4fe; text-shadow: 0 0 12px #c084fc; }
.dit-brand-letters .l-i { color: #93c5fd; text-shadow: 0 0 12px #60a5fa; }
.dit-brand-letters .l-t { color: #67e8f9; text-shadow: 0 0 12px #22d3ee; }

.dit-brand-line {
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #c084fc, transparent);
  box-shadow: 0 0 8px #c084fc;
}

.welcome-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  color: #ffffff;
}

.welcome-badges-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.capsule-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 800;
}

.capsule-gold {
  background: #f59e0b;
  color: #000000;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.capsule-purple {
  background: #c084fc;
  color: #3b0764;
  box-shadow: 0 2px 8px rgba(192, 132, 252, 0.4);
}

.capsule-arrows {
  color: #38bdf8;
  font-size: 1.1rem;
  font-weight: 700;
}

.welcome-desc {
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 26px;
}

.welcome-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-primary-gradient {
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  color: #ffffff;
  border: none;
  padding: 14px 20px;
  border-radius: 14px;
  font-family: var(--font-main);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 8px 24px -4px rgba(37, 99, 235, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s ease;
}

.btn-primary-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -4px rgba(6, 182, 212, 0.6);
  background: linear-gradient(135deg, #1d4ed8 0%, #0891b2 100%);
}

.btn-primary-gradient:active {
  transform: translateY(0);
}

.btn-secondary-dark {
  background: rgba(30, 41, 59, 0.7);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 12px 20px;
  border-radius: 14px;
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-secondary-dark:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(148, 163, 184, 0.4);
  color: #ffffff;
}

/* Modal de Instrucciones (Captura 2) */
.instructions-card {
  width: 480px;
  max-width: 95vw;
  padding: 24px;
}

.instructions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

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

.modal-header-title h2 {
  font-size: 1.35rem;
  font-weight: 800;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.4rem;
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s ease, background 0.15s ease;
}

.modal-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.instructions-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
}

.guide-card {
  background: #17203d;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 14px 16px;
}

.guide-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.guide-num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.num-gold {
  background: #f59e0b;
  color: #000000;
}

.num-purple {
  background: #a855f7;
  color: #ffffff;
}

.guide-name {
  font-weight: 800;
  font-size: 0.95rem;
}

.guide-gold .guide-name { color: #fbbf24; }
.guide-purple .guide-name { color: #d8b4fe; }

.guide-desc {
  font-size: 0.86rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.guide-desc code {
  font-family: var(--font-mono);
  background: rgba(0,0,0,0.3);
  padding: 2px 6px;
  border-radius: 4px;
  color: #38bdf8;
  font-size: 0.82rem;
}

.guide-methods {
  background: #1e1b4b;
  border-color: rgba(168, 85, 247, 0.35);
}

.methods-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e9d5ff;
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.methods-list {
  list-style: none;
  font-size: 0.86rem;
  color: #cbd5e1;
  line-height: 1.5;
  padding-left: 4px;
}

.methods-list li {
  margin-bottom: 4px;
  position: relative;
  padding-left: 14px;
}

.methods-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #c084fc;
}

.btn-primary-purple {
  width: 100%;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: #ffffff;
  border: none;
  padding: 13px;
  border-radius: 12px;
  font-family: var(--font-main);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.4);
  transition: all 0.2s ease;
}

.btn-primary-purple:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #9333ea 100%);
  transform: translateY(-1px);
}

/* ==========================================================================
   Canvas de Confeti
   ========================================================================== */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
}

/* Utilidades */
.hidden {
  display: none !important;
}

/* ==========================================================================
   Animaciones Clave (Keyframes)
   ========================================================================== */
@keyframes floatCrystal {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}

@keyframes pulseGem {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.25); opacity: 1; filter: drop-shadow(0 0 6px #c084fc); }
}

@keyframes toastShake {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  20%, 60% { transform: translateX(calc(-50% - 8px)) translateY(0); }
  40%, 80% { transform: translateX(calc(-50% + 8px)) translateY(0); }
}

@keyframes rowShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@keyframes pulseSuccessRow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2); }
  50% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.45); }
}

@keyframes nodeTargetPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.4); filter: drop-shadow(0 0 8px #c084fc); }
}

@keyframes modalScaleIn {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Adaptabilidad Móvil y Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .game-stage {
    gap: 40px;
    padding: 24px 16px 160px;
  }
}

@media (max-width: 860px) {
  .game-header {
    flex-wrap: wrap;
    padding: 10px 16px;
  }
  .mission-banner {
    order: 3;
    width: 100%;
    justify-content: center;
    font-size: 0.85rem;
    padding: 6px 14px;
  }
  .game-stage {
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding-bottom: 200px;
  }
  .table-card {
    width: 100%;
    max-width: 480px;
  }
  .success-bar-inner {
    flex-direction: column;
    text-align: center;
  }
  .success-badge-icon {
    display: none;
  }
  .success-actions {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   Selector de Niveles y Navegación de Catálogo
   ========================================================================== */
.level-nav-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.level-pills-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.level-pill-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-family: var(--font-main);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.level-pill-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: translateY(-1px);
}

.level-pill-btn.active {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #ffffff;
  border-color: #6d28d9;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
  transform: scale(1.04);
}

.btn-catalog-nav {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #7d3c9e 0%, #4f7fff 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 14px rgba(125, 60, 158, 0.3);
  text-decoration: none;
}

.btn-catalog-nav:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(125, 60, 158, 0.45);
  filter: brightness(1.08);
}

/* ==========================================================================
   Catálogo de Juegos DIT Arcade (Vista de Portal)
   ========================================================================= */
.arcade-hub {
  position: relative;
  z-index: 6;
  max-width: 1200px;
  margin: 0 auto;
  padding: 44px 24px 100px;
  width: 100%;
}

.hub-hero {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 40px;
}

.hub-badge-sparkle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, rgba(125, 60, 158, 0.1) 0%, rgba(79, 127, 255, 0.1) 100%);
  color: #7d3c9e;
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  border: 1.5px solid rgba(125, 60, 158, 0.35);
  box-shadow: 0 4px 16px rgba(125, 60, 158, 0.12);
}

.hub-main-title {
  font-size: 2.3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #1e1b4b;
  margin-bottom: 12px;
  line-height: 1.2;
}

.hub-main-desc {
  font-size: 1.05rem;
  color: #475569;
  line-height: 1.55;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}

.game-card {
  background: #ffffff;
  border-radius: 22px;
  border: 1.5px solid #e2e8f0;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-floating);
}

.card-featured {
  border-color: #c084fc;
  box-shadow: 0 16px 36px -8px rgba(139, 92, 246, 0.2);
}

.card-status-strip {
  padding: 8px 16px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f5f3ff;
  color: #7c3aed;
  border-bottom: 1px solid rgba(192, 132, 252, 0.3);
}

.status-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseSuccessDot 1.5s infinite;
}

.strip-soon {
  background: #f8fafc;
  color: #94a3b8;
  border-bottom-color: #e2e8f0;
}

.card-icon-banner {
  background: linear-gradient(135deg, #4338ca 0%, #7c3aed 100%);
  padding: 32px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.banner-dim {
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
}

.game-emoji-big {
  font-size: 3rem;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.4));
}

.card-nodes-preview {
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-pk {
  background: #fef08a;
  color: #854d0e;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
}

.preview-link {
  color: #ffffff;
  font-size: 1.1rem;
}

.preview-fk {
  background: #f3e8ff;
  color: #7e22ce;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
}

.card-info {
  padding: 20px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.card-desc {
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.tag-pill {
  background: #f1f5f9;
  color: #334155;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
}

.tag-muted {
  color: #94a3b8;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}

.card-footer-action {
  padding: 14px 22px 20px;
}

.btn-play-game {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #ffffff;
  padding: 12px;
  border-radius: 12px;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-play-game:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.45);
  background: linear-gradient(135deg, #1d4ed8 0%, #6d28d9 100%);
}

.btn-play-disabled {
  width: 100%;
  padding: 12px;
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: not-allowed;
}

/* ==========================================================================
   Modal de Graduación / Victoria Final (Nivel 3)
   ========================================================================== */
.final-victory-card {
  width: 490px;
  max-width: 95vw;
  padding: 34px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.victory-trophy-badge {
  font-size: 3.5rem;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.6));
  animation: floatCrystal 2.5s ease-in-out infinite;
}

.final-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: #ffffff;
}

.final-subtitle {
  font-size: 0.95rem;
  color: #cbd5e1;
  margin-bottom: 18px;
}

.learning-summary-box {
  background: #17203d;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 14px;
  padding: 16px 18px;
  width: 100%;
  text-align: left;
  margin-bottom: 22px;
}

.summary-box-title {
  color: #38bdf8;
  font-size: 0.92rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.summary-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: #e2e8f0;
  line-height: 1.45;
  margin-bottom: 8px;
}

.summary-item:last-child {
  margin-bottom: 0;
}

.summary-item .item-icon {
  font-size: 1.1rem;
}

.final-actions-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ==========================================================================
   DIT Branding: Logo & Favicon Elements
   ========================================================================== */
.dit-brand-logo-img {
  height: 26px;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(0 2px 6px rgba(99, 102, 241, 0.2));
  transition: transform 0.2s ease;
}

.dit-pill-badge:hover .dit-brand-logo-img {
  transform: scale(1.05);
}

.hub-brand-badge-wrap {
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hub-hero-logo {
  height: 216px;
  width: auto;
  max-width: 88vw;
  object-fit: contain;
  filter: drop-shadow(0 10px 32px rgba(125, 60, 158, 0.3));
  animation: floatChef 4.5s ease-in-out infinite;
}

/* ==========================================================================
   Arcade Hub: Tarjeta Chef Prompter
   ========================================================================== */
.card-prompter {
  border-color: rgba(245, 158, 11, 0.35);
}

.card-prompter:hover {
  border-color: #f59e0b;
  box-shadow: 0 20px 40px -10px rgba(245, 158, 11, 0.25);
}

.strip-prompter {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  font-weight: 700;
}

.dot-orange {
  background-color: #f59e0b !important;
  box-shadow: 0 0 8px #f59e0b !important;
}

.banner-chef {
  background: radial-gradient(circle at center, rgba(254, 243, 199, 0.8) 0%, rgba(253, 230, 138, 0.4) 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 0;
}

.card-navibot-avatar-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #ffffff;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.25);
  border: 2px solid #f59e0b;
}

.card-navibot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.chef-hat-badge {
  position: absolute;
  top: -8px;
  right: -6px;
  font-size: 1.6rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
  animation: floatChef 3s ease-in-out infinite;
}

.btn-play-orange {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35) !important;
}

.btn-play-orange:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.45) !important;
}

/* ==========================================================================
   Chef Prompter: Stage Principal
   ========================================================================== */
.chef-prompter-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Banner de Avatar NaviBot & Diálogo */
.chef-hero-banner {
  display: flex;
  align-items: center;
  gap: 22px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 24px;
  padding: 20px 24px;
  box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.08);
}

.chef-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff 0%, #fef3c7 100%);
  border: 3px solid #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
}

.chef-avatar-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.4) 0%, transparent 70%);
  z-index: -1;
  animation: pulseGlow 2.8s ease-in-out infinite;
}

.chef-navibot-img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  border-radius: 50%;
}

.chef-hat-badge-float {
  position: absolute;
  top: -12px;
  right: -8px;
  font-size: 2rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
  animation: floatChef 2.6s ease-in-out infinite;
}

.chef-status-pill {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.chef-dialogue-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chef-speaker-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b45309;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chef-speaker-label strong {
  color: #0f172a;
}

.chef-sparkle {
  color: #f59e0b;
}

.chef-speech-bubble {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 16px;
  padding: 16px 20px;
  font-size: 0.98rem;
  line-height: 1.55;
  color: #1e293b;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  position: relative;
}

.chef-speech-bubble strong {
  color: #0f172a;
}

.chef-speech-bubble em {
  color: #d97706;
  font-style: normal;
  font-weight: 600;
}

/* Barra de Pasos de la Cocina */
.kitchen-steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 9999px;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.kitchen-step-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  background: rgba(241, 245, 249, 0.8);
  transition: all 0.25s ease;
}

.kitchen-step-badge .step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.kitchen-step-badge.active {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.kitchen-step-badge.active .step-num {
  background: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.kitchen-step-badge.completed {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.kitchen-step-badge.completed .step-num {
  background: #10b981;
  color: #ffffff;
}

.kitchen-step-arrow {
  color: #cbd5e1;
  font-size: 0.85rem;
}

/* Fases y Contenedores */
.chef-phase-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeInPhase 0.35s ease;
}

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

.phase-header-center {
  text-align: center;
  margin-bottom: 6px;
}

.phase-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.phase-desc {
  font-size: 0.95rem;
  color: #64748b;
  max-width: 620px;
  margin: 0 auto;
}

/* Grid de Platos (Fase 0) */
.chef-dishes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.chef-dish-card {
  background: #ffffff;
  border: 2px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 8px 24px -6px rgba(15, 23, 42, 0.05);
}

.chef-dish-card:hover {
  transform: translateY(-4px);
  border-color: #f59e0b;
  box-shadow: 0 16px 36px -8px rgba(245, 158, 11, 0.2);
}

.dish-card-icon {
  font-size: 2.4rem;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.1));
}

.dish-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dish-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
}

.dish-card-tag {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #b45309;
  background: #fef3c7;
  padding: 3px 8px;
  border-radius: 9999px;
}

.dish-card-desc {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.45;
  margin-top: 4px;
}

.btn-select-dish {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.chef-dish-card:hover .btn-select-dish {
  filter: brightness(1.08);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

/* Tarjeta de Formulario de Pasos (Fases 1, 2, 3) */
.phase-card-box {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 24px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.06);
}

.phase-card-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.phase-icon-badge {
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: 9999px;
}

.badge-gold {
  background: #fef3c7;
  color: #b45309;
}

.badge-purple {
  background: #f3e8ff;
  color: #7e22ce;
}

.badge-blue {
  background: #e0f2fe;
  color: #0369a1;
}

.chef-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chef-label {
  font-size: 0.92rem;
  color: #334155;
}

.chef-input, .chef-textarea {
  width: 100%;
  font-family: var(--font-main);
  font-size: 0.95rem;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  outline: none;
  transition: all 0.2s ease;
}

.chef-input:focus, .chef-textarea:focus {
  border-color: #f59e0b;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.shake-input {
  animation: shakeInput 0.35s ease;
  border-color: #ef4444 !important;
}

@keyframes shakeInput {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

/* Zona de Sugerencias e Ingredientes */
.suggestions-zone {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
  border-radius: 16px;
  padding: 16px;
  border: 1px dashed #cbd5e1;
}

.suggestions-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

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

.ingredient-chip {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 6px 14px;
  font-family: var(--font-main);
  font-size: 0.84rem;
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.ingredient-chip:hover {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
  transform: translateY(-1px);
}

/* Tip del Chef Callout */
.chef-tip-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fffbeb;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 16px;
  padding: 14px 18px;
}

.tip-action {
  background: #faf5ff;
  border-color: rgba(168, 85, 247, 0.4);
}

.tip-chef-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.tip-chef-text {
  font-size: 0.9rem;
  color: #92400e;
  line-height: 1.45;
}

.tip-action .tip-chef-text {
  color: #6b21a8;
}

.chef-actions-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

/* Opciones de Emplatado (Fase 3) */
.format-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.format-option-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.format-option-card:hover {
  border-color: #3b82f6;
  background: #f8fafc;
}

.format-option-card.selected {
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.2);
}

.format-card-icon {
  font-size: 1.5rem;
}

.format-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.format-card-desc {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.35;
}

.btn-bake-glow {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%) !important;
  font-size: 1.05rem !important;
  padding: 14px 28px !important;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4) !important;
}

.btn-bake-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.5) !important;
}

/* Plato Servido (Fase Final) */
.plated-box {
  background: #0d1326;
  border-color: rgba(245, 158, 11, 0.4);
  color: #f8fafc;
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.5);
}

.plated-box .phase-title {
  color: #ffffff;
}

.plated-box .phase-desc {
  color: #94a3b8;
}

.plated-header {
  text-align: center;
}

.plated-trophy-badge {
  font-size: 3.2rem;
  margin-bottom: 8px;
  animation: floatChef 3s ease-in-out infinite;
}

.prompt-platter-container {
  background: #17203d;
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.platter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 19, 38, 0.8);
  padding: 12px 18px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
}

.platter-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fbbf24;
}

.btn-copy-prompt {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-copy-prompt:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-copy-prompt.btn-copied {
  background: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.prompt-pre-block {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  background: #0f172a;
}

.prompt-code-output {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}

.chef-success-congrats {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 16px;
  padding: 14px 18px;
}

.congrats-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.congrats-text {
  font-size: 0.9rem;
  color: #6ee7b7;
  line-height: 1.45;
}

.congrats-text strong {
  color: #ffffff;
}

.plated-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

/* Animaciones Culinarias */
@keyframes floatChef {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.08); }
}

/* Responsividad para Móviles en Chef Prompter */
@media (max-width: 768px) {
  .chef-hero-banner {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .chef-dialogue-box {
    align-items: center;
  }

  .kitchen-steps-bar {
    border-radius: 16px;
    gap: 6px;
  }

  .kitchen-step-badge {
    padding: 4px 10px;
    font-size: 0.75rem;
  }

  .kitchen-step-arrow {
    display: none;
  }

  .phase-card-box {
    padding: 20px 16px;
  }

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

  .plated-actions-grid {
    grid-template-columns: 1fr;
  }

  .hub-hero-logo {
    height: 140px;
  }
}

