/* ======================================================
   FALLTEM — Sudoku
   Layout alineado a Memoria / Cálculo
   ====================================================== */

/* ===== CONTENEDOR GENERAL ===== */

.wrap {
  max-width: 860px;
  margin: 2.5rem auto;
  background: var(--card);
  border-radius: 24px;
  padding: clamp(20px, 3vw, 32px);
  box-shadow: 0 18px 55px rgba(15,23,42,0.12);
}

/* ===== INTRO ===== */

.header {
  max-width: 760px;
  margin: 0 auto var(--space);
}

.header-label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--label-brand);
}

.header h1 {
  margin: 0.3rem 0 0.5rem;
  font-size: clamp(2.1rem, 2.1vw + 1.3rem, 2.7rem);
  font-weight: 900;
}

.intro {
  max-width: 40rem;
  color: var(--muted);
}

/* ===== CONTROLES ===== */

.controles {
  max-width: 460px;
  margin: 1.6rem auto 2rem;
  display: grid;
  gap: 1rem;
}

/* ===== SECCIÓN JUEGO ===== */

.juego {
  margin-top: 2.2rem;
}

/* Contenedor interno del juego */
.game-shell {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}

/* ===== TABLERO ===== */

.sudoku-board {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  background: #9ca3af;
  border: 3px solid #9ca3af;
  border-radius: 6px;
}

/* ===== CELDAS ===== */

.sudoku-cell {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(18px, 4vw, 26px);
  font-weight: 700;
  color: #0f172a;
  user-select: none;
}

.sudoku-cell.is-fixed {
  background: #f1f5f9;
  font-weight: 800;
}

.sudoku-cell.is-selected {
  background: #fff6d6;
}

.sudoku-cell.conflict {
  background: #ffe4e6;
}

/* ===== BLOQUES 3×3 ===== */

.sudoku-cell:nth-child(3n) {
  border-right: 3px solid #9ca3af;
}

.sudoku-cell:nth-child(n + 19):nth-child(-n + 27),
.sudoku-cell:nth-child(n + 46):nth-child(-n + 54) {
  border-bottom: 3px solid #9ca3af;
}

/* ===== KEYPAD ===== */

.sudoku-keypad {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 10px;
  padding: 14px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.sudoku-key {
  height: 48px;
  border: none;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 800;
  background: #e6eefc;
  color: #1a4fd8;
}

/* ===== ESTADO / FOOTER ===== */

.estado {
  margin-top: 1.6rem;
  text-align: center;
  color: var(--muted);
}

.mini-credit {
  margin-top: 2rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  text-align: center;
  color: var(--muted);
}

/* ===== MOBILE ===== */

@media (max-width: 480px) {
  .wrap {
    margin: 1.2rem auto;
  }
}

/* =========================
   Keypad – ajuste mobile
   ========================= */
.sudoku-keypad {
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.sudoku-keypad {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 0.4rem;
}

@media (max-width: 480px) {
  .sudoku-keypad {
    padding: 0.75rem;
  }
}
