*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  text-align: center;
  background: #f2f2f2;
}

h2 {
  margin: 16px 0 4px;
}

.controls {
  margin: 15px;
}

/* ── CSS-table grid ─────────────────────────────── */
.grid-table {
  display: table;
  border-collapse: collapse;
  margin: 0 auto;
}

.grid-row {
  display: table-row;
}

.grid-cell {
  display: table-cell;
  border: 1px solid #333;
  padding: 0;
  vertical-align: top;
  background: white;
}

/*
 * The inner wrapper is the sole sizing authority.
 * Both the number label and the input are absolutely
 * positioned inside it so neither can push the other
 * out of alignment.
 */
.cell-inner {
  position: relative;
  width: 42px;
  height: 42px;
}

.cell-inner input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  text-transform: uppercase;
  background: transparent;
  outline: none;
  padding: 0;
  margin: 0;
}

.cell-inner .number {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 10px;
  line-height: 1;
  color: #444;
  pointer-events: none;
  z-index: 1;
}

/* Black (empty) cell */
.grid-cell.block {
  background: #222;
}

/* ── Clues ──────────────────────────────────────── */
.clues {
  width: 650px;
  margin: 30px auto;
  text-align: left;
  display: flex;
  gap: 40px;
}

#across, #down {
  flex: 1;
}

#status {
  margin: 10px;
  font-weight: bold;
}

/* Check-answer colouring */
.cell-inner input.correct {
  background: #c8f7c5;
}

.cell-inner input.wrong {
  background: #f7c5c5;
}
