:root {
  --cell: clamp(36px, 10vw, 64px);
}

.conecta-panel {
  margin-top: 0.5rem;
  text-align: center;
}

.conecta-board {
  margin: 1.4rem auto 0;
  display: grid;
  gap: 6px;
  justify-content: center;
  touch-action: none;
}

.cell {
  width: var(--cell);
  height: var(--cell);
  border: 2px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  color: var(--fg);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  transition: transform 0.08s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.cell:hover {
  transform: translateY(-1px);
}

.cell:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.cell.number {
  background: color-mix(in oklab, var(--accent) 28%, var(--card));
  border-color: color-mix(in oklab, var(--accent) 80%, var(--border));
}

.cell.path {
  background: color-mix(in oklab, var(--focus) 22%, var(--card));
  border-color: var(--focus);
}

.cell.active {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #0f172a;
}

.cell.complete {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--btn-primary-fg);
}

.next-btn {
  margin-top: 1rem;
  width: min(100%, 360px);
  border-radius: 999px;
  border: 0;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  padding: 0.95rem 1.2rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.next-btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

@media (max-width: 480px) {
  .conecta-board {
    gap: 4px;
  }

  .cell {
    border-radius: 14px;
  }
}

.conecta-progreso {
  width: min(100%, 520px);
  margin: 1rem auto 1.2rem;
}

.progreso-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.progreso-bar {
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

#progressFill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.25s ease;
}

/* Fix modal ayuda — overlay centrado tipo FALLTEM */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-backdrop .modal-card {
  width: min(100%, 640px);
  max-height: min(86vh, 760px);
  overflow: auto;
  background: var(--card);
  color: var(--fg);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.32);
}

.final-actions {
  margin-top: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.final-actions[hidden] {
  display: none !important;
}

.final-actions .btn {
  width: min(100%, 360px);
  border-radius: 999px;
}

.final-actions a.btn.secundario,
.final-actions .btn.secundario {
  background: #ffffff;
  color: #0f172a !important;
  border: 1px solid #dbe2ea;
  text-decoration: none;
  font-weight: 700;
}

.final-actions a.btn.secundario:hover,
.final-actions .btn.secundario:hover {
  background: #f8fafc;
}

