.play-main {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.testing-badge {
  display: inline-block;
  margin-bottom: 1rem;
  background: var(--paper-dark);
  border: 2px solid var(--ink);
  border-radius: 20px;
  padding: 0.3rem 0.9rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.win-banner {
  width: 100%;
  max-width: 480px;
  background: var(--pine);
  color: #fff8ec;
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 0.9rem;
  text-align: center;
  font-weight: 700;
  margin-bottom: 1rem;
}

.stats {
  display: flex;
  justify-content: space-around;
  margin-top: 1rem;
  padding: 0.75rem 0.5rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 8px;
}

.stat { text-align: center; }

.stat-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink);
}

.board-wrap {
  overflow-x: auto;
  max-width: 100%;
  padding: 0.5rem;
}

.sudoku-board {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(2.4rem, 3.4rem));
  grid-template-rows: repeat(var(--n), minmax(2.4rem, 3.4rem));
  border: 3px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card);
  margin: 0 auto;
  box-shadow: 6px 6px 0 var(--shadow);
}

.sudoku-board.solved { pointer-events: none; opacity: 0.85; }

.cell {
  border: 1px solid var(--line-thin);
  background: var(--card);
  font-family: 'Kdam Thmor Pro', 'Baloo 2', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.cell.given {
  background: var(--paper-dark);
  font-weight: 800;
  cursor: default;
}

.cell.hint-cell { background: #e3efe4; }

.cell.peer { background: #f5c14275; }
.cell.same-value { background: #ffcf87; }
.cell.selected { background: #ff9f45; color: #2b2320; }

.cell.error { color: #a3313f; background: #f6d6d6; }

.cell.box-top { border-top: 3px solid var(--ink); }
.cell.box-left { border-left: 3px solid var(--ink); }
.cell.box-bottom { border-bottom: 3px solid var(--ink); }
.cell.box-right { border-right: 3px solid var(--ink); }

.number-pad {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  max-width: 420px;
}

.number-pad button {
  width: 2.6rem;
  height: 2.6rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--card);
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--shadow);
}

.number-pad button:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--shadow); }
.number-pad button.erase { background: var(--paper-dark); font-size: 0.85rem; }

.play-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1.5rem;
}

@media (max-width: 480px) {
  .sudoku-board {
    grid-template-columns: repeat(var(--n), minmax(1.9rem, 2.6rem));
    grid-template-rows: repeat(var(--n), minmax(1.9rem, 2.6rem));
  }
  .cell { font-size: 1.05rem; }
  .number-pad { max-width: 100%; }
  .number-pad button { width: 2.2rem; height: 2.2rem; font-size: 0.95rem; }
  .stats { flex-wrap: wrap; gap: 0.75rem; }
}

@media print {
  .play-main, .layout { display: none !important; }
}
