/* Modernized rebuild of 12x12sudoku.com's inline styles.
   Same palette/identity as the 6x6 rebuild: blue header banner, gray navbar,
   blue bold form cells, double-border box grouping. Widened to fit the
   bigger 12x12 grid and the 728px banner ad. */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: #EEEEFF;
  font-family: Arial, Helvetica, sans-serif;
  color: #000;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  border: 4px solid #000;
}

.topper {
  color: #FFFFFF;
  background-color: #6666FF;
  text-align: center;
  padding: 0.5rem;
}

.topper h1 {
  margin: 0;
  font-size: 1.5rem;
}

.layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

.navbar {
  background-color: #CCCCCC;
  width: 200px;
  flex-shrink: 0;
  padding: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.4;
}

.navbar ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.navbar .adsbygoogle {
  margin-top: 0.75rem;
}

.board-area {
  flex: 1;
  min-width: 0;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Sudoku grid: CSS Grid replaces the old nested <table> box structure.
   --grid-size / --box-rows / --box-cols are set inline by sudoku-engine.js
   so the same stylesheet works for any grid size sharing this class. */
.sudoku-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-size), 40px);
  grid-template-rows: repeat(var(--grid-size), 40px);
  border: 3px solid #000;
  border-style: double;
}

.sudoku-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #000;
  font-weight: bolder;
  font-size: 1rem;
}

.sudoku-cell.box-top {
  border-top-style: double;
  border-top-width: 3px;
}
.sudoku-cell.box-bottom {
  border-bottom-style: double;
  border-bottom-width: 3px;
}
.sudoku-cell.box-left {
  border-left-style: double;
  border-left-width: 3px;
}
.sudoku-cell.box-right {
  border-right-style: double;
  border-right-width: 3px;
}

.sudoku-given {
  color: #000;
}

.sudoku-input {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  text-align: center;
  background-color: #EEEEFF;
  font-weight: bolder;
  color: blue;
  font-size: 1rem;
}

.sudoku-input:focus {
  outline: 2px solid #6666FF;
  outline-offset: -2px;
}

.controls {
  margin-top: 1rem;
  text-align: center;
}

.puzzle-label {
  margin: 0 0 0.5rem;
  font-weight: bold;
}

.controls button {
  font-size: 1rem;
  padding: 0.3rem 0.8rem;
  margin: 0 0.25rem;
  cursor: pointer;
}

.ad-slot-banner {
  margin-top: 1rem;
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  text-align: center;
}

@media (max-width: 600px) {
  .layout {
    flex-direction: column;
  }
  .navbar {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .sudoku-grid {
    grid-template-columns: repeat(var(--grid-size), 28px);
    grid-template-rows: repeat(var(--grid-size), 28px);
  }
  .sudoku-cell {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }
}
