/* ============================================================
   Brainy Puzzles — shared stylesheet
   Simple, clean, no frills. Print-friendly.
   ============================================================ */

:root {
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --ink: #1f2937;
  --muted: #6b7280;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e5e7eb;
  --black: #111827;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---------- Layout ---------- */

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.site-header .inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.brand span {
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 18px;
  font-size: 15px;
}

.site-nav a {
  color: var(--ink);
}

.site-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Puzzles dropdown */

.nav-group {
  position: relative;
}

.nav-caret {
  font-size: 11px;
  vertical-align: 1px;
}

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: -10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 240px;
  padding: 6px 0;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  z-index: 60;
}

.nav-dropdown::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}

.nav-group:hover .nav-dropdown,
.nav-group:focus-within .nav-dropdown,
.nav-group.nav-open .nav-dropdown {
  display: block;
}

.nav-dropdown a {
  display: block;
  padding: 7px 16px;
  font-size: 14px;
  white-space: nowrap;
}

.nav-dropdown a:hover {
  background: var(--bg);
  color: var(--accent);
  text-decoration: none;
}

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.page-foot {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 24px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.page-foot a {
  color: var(--muted);
  margin: 0 8px;
}

/* ---------- Generic bits ---------- */

h1 {
  font-size: 30px;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 22px;
  margin: 28px 0 10px;
}

p {
  margin: 10px 0;
}

.lead {
  color: var(--muted);
  font-size: 17px;
  max-width: 720px;
  margin: 0 0 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin: 16px 0;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 22px 0;
}

.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tool-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.08);
}

.tool-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.tool-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  background: #dbeafe;
  color: var(--accent-dark);
  border-radius: 20px;
  padding: 2px 10px;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.button:hover {
  background: var(--accent-dark);
}

.button.secondary {
  background: #eef2f7;
  color: var(--ink);
}

.button.secondary:hover {
  background: #e2e8f0;
}

/* ---------- Controls ---------- */

.controls {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 18px 0;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field select {
  font-size: 15px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  min-width: 150px;
}

.controls .button {
  margin-left: auto;
}

/* ---------- Puzzle grid ---------- */

.puzzle-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  overflow-x: auto;
}

.puzzle-grid {
  display: grid;
  gap: 2px;
  width: max-content;
  margin: 0 auto;
}

.puzzle-grid .cell {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fff;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  position: relative;
  text-transform: uppercase;
}

.puzzle-grid .cell.black {
  background: var(--black);
  border-color: var(--black);
}

.puzzle-grid .cell .slot-num {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
}

.puzzle-grid .cell .letter {
  display: none;
}

.puzzle-grid.show-answers .cell .letter {
  display: block;
}

/* ---------- Word list ---------- */

.wordlist {
  margin: 20px 0 0;
}

.wordlist h2 {
  margin-top: 0;
}

.word-group {
  margin-bottom: 14px;
}

.word-group .len-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}

.word-group .words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.word-chip {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.03em;
}

.word-chip .num {
  color: var(--muted);
  font-weight: 600;
  margin-left: 4px;
}

/* ---------- Crossword clues ---------- */

.clues {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 24px 0 0;
}

.clues h2 {
  margin-top: 0;
  font-size: 18px;
}

.clue-item {
  display: flex;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 15px;
  line-height: 1.4;
}

.clue-num {
  font-weight: 700;
  color: var(--accent);
  min-width: 26px;
}

@media (max-width: 640px) {
  .clues {
    grid-template-columns: 1fr;
  }
}

/* ---------- Sudoku ---------- */

.puzzle-grid.sudoku {
  gap: 0;
  border: 2px solid #334155;
  border-radius: 6px;
}

.puzzle-grid.sudoku .cell {
  width: 42px;
  height: 42px;
  font-size: 22px;
  border: 1px solid #cbd5e1;
  border-radius: 0;
}

.puzzle-grid.sudoku .cell.thick-right {
  border-right: 2px solid #334155;
}

.puzzle-grid.sudoku .cell.thick-bottom {
  border-bottom: 2px solid #334155;
}

.puzzle-grid.sudoku .cell.given {
  font-weight: 700;
}

.sudoku-input,
.cell-input,
.killer-input,
.cm-input,
.ft-input,
.hd-input,
.sky-input,
.cd-input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  font-family: inherit;
  outline: none;
  padding: 0;
}

.cell-input:focus,
.sudoku-input:focus,
.killer-input:focus,
.cm-input:focus,
.ft-input:focus,
.hd-input:focus,
.sky-input:focus,
.cd-input:focus {
  outline: 2px solid var(--accent);
  border-radius: 2px;
}

.puzzle-grid .cell.wrong {
  background: #fee2e2;
}

.puzzle-grid.show-answers .sudoku-input,
.puzzle-grid.show-answers .cell-input,
.puzzle-grid.show-answers .killer-input,
.puzzle-grid.show-answers .cm-input,
.puzzle-grid.show-answers .ft-input,
.puzzle-grid.show-answers .hd-input,
.puzzle-grid.show-answers .sky-input,
.puzzle-grid.show-answers .cd-input {
  display: none;
}

.puzzle-grid.show-answers .cell:not(.given)::after {
  content: attr(data-answer);
  font-weight: 600;
}

/* ---------- Killer Sudoku ---------- */

.puzzle-grid.killer {
  gap: 0;
  border: 2px solid #334155;
  border-radius: 6px;
}

.puzzle-grid.killer .cell {
  width: 42px;
  height: 42px;
  font-size: 22px;
  border: 1px solid #cbd5e1;
  border-radius: 0;
}

.puzzle-grid.killer .cell.thick-t {
  border-top: 2px solid #334155;
}

.puzzle-grid.killer .cell.thick-r {
  border-right: 2px solid #334155;
}

.puzzle-grid.killer .cell.thick-b {
  border-bottom: 2px solid #334155;
}

.puzzle-grid.killer .cell.thick-l {
  border-left: 2px solid #334155;
}

.puzzle-grid.killer .cell .killer-clue {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
  pointer-events: none;
  z-index: 1;
}

/* ---------- Cross Math ---------- */

.puzzle-grid.cross-math {
  gap: 0;
  border: 2px solid #334155;
  border-radius: 6px;
}

.puzzle-grid.cross-math .cell {
  width: 42px;
  height: 42px;
  font-size: 22px;
  border: 1px solid #cbd5e1;
  border-radius: 0;
}

.puzzle-grid.cross-math .cell.cm-rop,
.puzzle-grid.cross-math .cell.cm-cop,
.puzzle-grid.cross-math .cell.cm-eq {
  background: #f1f5f9;
  color: var(--muted);
  font-weight: 700;
}

.puzzle-grid.cross-math .cell.cm-num.given {
  font-weight: 700;
}

.puzzle-grid.cross-math .cell.cm-unused {
  border: none;
  background: transparent;
}

/* ---------- Futoshiki ---------- */

.puzzle-grid.futoshiki {
  gap: 0;
  border: 2px solid #334155;
  border-radius: 6px;
}

.puzzle-grid.futoshiki .cell {
  width: 42px;
  height: 42px;
  font-size: 22px;
  border: 1px solid #cbd5e1;
  border-radius: 0;
}

.puzzle-grid.futoshiki .cell.given {
  font-weight: 700;
}

.puzzle-grid.futoshiki .cell.ft-hsign,
.puzzle-grid.futoshiki .cell.ft-vsign {
  width: 26px;
  height: 42px;
  border: none;
  background: transparent;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}

.puzzle-grid.futoshiki .cell.ft-fill {
  border: none;
  background: transparent;
}

/* ---------- Hidato ---------- */

.puzzle-grid.hidato {
  gap: 2px;
}

.puzzle-grid.hidato .cell {
  width: 42px;
  height: 42px;
  font-size: 20px;
}

.puzzle-grid.hidato .cell.given {
  font-weight: 700;
}

/* ---------- Skyscrapers ---------- */

.puzzle-grid.skyscrapers {
  gap: 0;
  border: 2px solid #334155;
  border-radius: 6px;
}

.puzzle-grid.skyscrapers .cell {
  width: 42px;
  height: 42px;
  font-size: 20px;
  border: 1px solid #cbd5e1;
  border-radius: 0;
}

.puzzle-grid.skyscrapers .cell.given {
  font-weight: 700;
}

.puzzle-grid.skyscrapers .cell.sky-clue {
  width: 26px;
  height: 26px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  background: #f1f5f9;
}

.puzzle-grid.skyscrapers .cell.sky-fill {
  border: none;
  background: transparent;
}

/* ---------- Slitherlink ---------- */

.puzzle-grid.slitherlink {
  gap: 0;
}

.puzzle-grid.slitherlink .cell {
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.puzzle-grid.slitherlink .sl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
}

.puzzle-grid.slitherlink .sl-edge {
  position: relative;
  cursor: pointer;
}

.puzzle-grid.slitherlink .sl-hedge {
  width: 26px;
  height: 10px;
}

.puzzle-grid.slitherlink .sl-vedge {
  width: 10px;
  height: 26px;
}

.puzzle-grid.slitherlink .sl-edge.on::after,
.puzzle-grid.slitherlink .sl-edge.answer-line::after {
  content: "";
  position: absolute;
  background: var(--accent);
}

.puzzle-grid.slitherlink .sl-hedge.on::after,
.puzzle-grid.slitherlink .sl-hedge.answer-line::after {
  left: 0;
  top: 50%;
  width: 100%;
  height: 4px;
  transform: translateY(-50%);
}

.puzzle-grid.slitherlink .sl-vedge.on::after,
.puzzle-grid.slitherlink .sl-vedge.answer-line::after {
  top: 0;
  left: 50%;
  height: 100%;
  width: 4px;
  transform: translateX(-50%);
}

.puzzle-grid.slitherlink .sl-edge.cross {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.puzzle-grid.slitherlink .sl-clue {
  width: 26px;
  height: 26px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

/* ---------- Calcudoku ---------- */

.puzzle-grid.calcudoku {
  gap: 0;
  border: 2px solid #334155;
  border-radius: 6px;
}

.puzzle-grid.calcudoku .cell {
  width: 42px;
  height: 42px;
  font-size: 22px;
  border: 1px solid #cbd5e1;
  border-radius: 0;
}

.puzzle-grid.calcudoku .cell.given {
  font-weight: 700;
}

.puzzle-grid.calcudoku .cell.thick-t {
  border-top: 2px solid #334155;
}

.puzzle-grid.calcudoku .cell.thick-r {
  border-right: 2px solid #334155;
}

.puzzle-grid.calcudoku .cell.thick-b {
  border-bottom: 2px solid #334155;
}

.puzzle-grid.calcudoku .cell.thick-l {
  border-left: 2px solid #334155;
}

.puzzle-grid.calcudoku .cd-clue {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
}

/* ---------- Bingo ---------- */

.bingo-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.bingo-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  width: 340px;
}

.bingo-card .card-label {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.bingo-card .bingo-header {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  margin-bottom: 4px;
}

.bingo-card .bingo-header span {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.bingo-card .bingo-header span.wide {
  grid-column: 1 / -1;
  font-size: 14px;
  letter-spacing: 0.2em;
}

.bingo-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: 3px;
}

.bingo-grid .cell {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
}

.bingo-grid .cell.word {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 2px;
  line-height: 1.1;
}

.bingo-grid .cell.free {
  background: #dbeafe;
  color: var(--accent-dark);
}

/* ---------- Bingo call sheet ---------- */

.call-sheet {
  margin-top: 24px;
}

.call-sheet h2 {
  margin-top: 0;
}

.call-columns {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.call-col {
  min-width: 130px;
}

.call-col h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.call-item {
  font-size: 14px;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 4px;
  user-select: none;
}

.call-item:hover {
  background: #f1f5f9;
}

.call-item.called {
  text-decoration: line-through;
  color: var(--muted);
  background: #f1f5f9;
}

/* ---------- Articles ---------- */

.article {
  max-width: 720px;
}

.article h1 {
  margin-bottom: 4px;
}

.article-meta {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 20px;
}

.article h2 {
  margin-top: 32px;
}

.article h3 {
  margin-top: 22px;
  font-size: 18px;
}

.article ul,
.article ol {
  padding-left: 22px;
}

.article li {
  margin: 6px 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 14px;
}

.related {
  margin-top: 32px;
}

.article-list .tool-card {
  margin-bottom: 14px;
}

.article-list .tool-card p {
  margin-bottom: 4px;
}

.article-date {
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Ads ---------- */

/* Placeholder ad boxes are hidden until real ad units are configured
   (see js/ads.js — manualSlots: true + real slot IDs). With auto ads
   enabled in AdSense, Google places ads automatically and these boxes
   are not needed. Keeping them invisible keeps the site clean for
   AdSense review and for visitors. */
.ad-slot {
  display: none;
}

.ad-slot.filled {
  margin: 22px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.02);
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Nonogram ---------- */

.puzzle-grid.nonogram {
  --cell: 30px;
  display: grid;
  grid-template-columns: 54px repeat(var(--n), var(--cell));
  grid-template-rows: 56px repeat(var(--n), var(--cell));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  width: max-content;
  margin: 0 auto;
}

.puzzle-grid.nonogram .cell {
  width: auto;
  height: auto;
  border: none;
  border-radius: 0;
  background: #fff;
  cursor: pointer;
}

.puzzle-grid.nonogram .cell.black {
  background: var(--black);
}

.puzzle-grid.nonogram .cell.cross::after {
  content: "×";
  color: #9ca3af;
  font-size: 18px;
  line-height: 1;
}

.puzzle-grid.nonogram .cell.wrong {
  outline: 2px solid #dc2626;
  outline-offset: -2px;
}

.puzzle-grid.nonogram .cell:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  z-index: 1;
}

.puzzle-grid.nonogram .nono-clue {
  background: #f3f4f6;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  text-align: center;
  min-width: 0;
  overflow: hidden;
}

.puzzle-grid.nonogram .nono-clue.row {
  justify-content: flex-end;
  padding-right: 6px;
}

.puzzle-grid.nonogram .nono-clue.col {
  align-items: flex-end;
  padding-bottom: 3px;
  gap: 1px;
}

.puzzle-grid.nonogram .nono-clue.corner {
  background: #e5e7eb;
}

.nono-legend {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.controls .field-label {
  font-size: 13px;
  color: var(--muted);
  margin-right: 6px;
  align-self: center;
}

.button.small {
  padding: 6px 12px;
  font-size: 13px;
}

.button.small.active {
  background: var(--accent);
  color: #fff;
}

/* ---------- Word Search ---------- */

.puzzle-grid.search {
  gap: 0;
  border: 2px solid #334155;
  border-radius: 6px;
}

.puzzle-grid.search .letter-cell {
  width: 34px;
  height: 34px;
  border: 1px solid #e2e8f0;
  border-radius: 0;
  font-size: 19px;
  cursor: pointer;
  user-select: none;
}

.puzzle-grid.search .letter-cell.pending {
  background: #dbeafe;
}

.puzzle-grid.search .letter-cell.found {
  background: #dcfce7;
  color: #166534;
}

.search-wordlist .word-chip.found {
  text-decoration: line-through;
  color: var(--muted);
  background: #f8fafc;
}

/* ---------- Word Scramble ---------- */

.scramble-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scramble-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  flex-wrap: wrap;
}

.scramble-row.wrong {
  border-color: #f87171;
  background: #fef2f2;
}

.scramble-num {
  font-weight: 700;
  color: var(--accent);
  min-width: 22px;
  text-align: center;
}

.scramble-tiles {
  display: inline-flex;
  gap: 3px;
}

.scramble-tile {
  width: 28px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
}

.scramble-clue {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  margin-right: auto;
}

.scramble-input {
  width: 130px !important;
  height: 32px !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  background: #fff !important;
  padding: 0 8px !important;
  font-size: 16px !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.scramble-input:focus {
  outline: 2px solid var(--accent);
}

/* ---------- Maze ---------- */

.puzzle-grid.maze {
  gap: 0;
  border: 2px solid #1f2937;
  border-radius: 6px;
}

.maze-cell {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  box-sizing: border-box;
  color: #1f2937;
}

.maze-cell.maze-start {
  background: #dbeafe;
  color: #1d4ed8;
}

.maze-cell.maze-end {
  background: #dcfce7;
  color: #166534;
}

.maze-cell.sol {
  background: #93c5fd;
}

/* ---------- Matching / Flashcards ---------- */

.match-wrap {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.match-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 240px;
  max-width: 330px;
}

.match-item {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
}

.match-item.pending {
  border-color: var(--accent);
  background: #dbeafe;
}

.match-item.matched {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.match-item.shake {
  border-color: #f87171;
  background: #fee2e2;
}

.match-tag {
  display: inline-block;
  min-width: 22px;
  font-weight: 700;
  color: var(--accent);
}

.flashcards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.flashcard {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  background: #fff;
  page-break-inside: avoid;
  break-inside: avoid;
}

.flash-word {
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.flash-clue {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Word Ladder ---------- */

.ladder {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.ladder-rung {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ladder-pos {
  font-size: 12px;
  color: var(--muted);
  min-width: 52px;
  text-align: right;
}

.ladder-word {
  min-width: 120px;
  text-align: center;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ladder-word.given {
  border-color: #93c5fd;
  background: #eff6ff;
  color: var(--accent-dark);
}

.ladder-input {
  width: 120px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: inherit;
  outline: none;
}

.ladder-input:focus {
  outline: 2px solid var(--accent);
}

.ladder-rung.wrong .ladder-input {
  border-color: #f87171;
  background: #fee2e2;
}

/* ---------- Code Breaker ---------- */

.code-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 580px;
  margin: 0 auto;
}

.code-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.code-num {
  font-weight: 700;
  color: var(--accent);
  min-width: 20px;
  text-align: center;
}

.code-encoded {
  font-family: "Courier New", monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.12em;
  min-width: 140px;
}

.code-input {
  width: 160px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: inherit;
  outline: none;
}

.code-input:focus {
  outline: 2px solid var(--accent);
}

.code-row.wrong .code-input {
  border-color: #f87171;
  background: #fee2e2;
}

.code-clue {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* ---------- Cryptogram ---------- */

.crypto-grid {
  max-width: 620px;
  margin: 0 auto;
}

.crypto-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 2px 6px;
  line-height: 1;
}

.crypto-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.crypto-cipher {
  font-family: "Courier New", monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.crypto-cell .crypto-input,
.crypto-map-cell .map-input {
  width: 26px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  outline: none;
}

.crypto-cell .crypto-input:focus,
.crypto-map-cell .map-input:focus {
  outline: 2px solid var(--accent);
}

.crypto-cell.wrong .crypto-input,
.crypto-map-cell.wrong .map-input {
  border-color: #f87171;
  background: #fee2e2;
}

.crypto-punc {
  font-size: 18px;
  font-weight: 700;
  margin-top: 18px; /* align with the answer inputs below the code letters */
  color: var(--ink);
}

.crypto-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.crypto-map-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.crypto-map-cell .map-input {
  width: 22px;
  height: 24px;
  font-size: 14px;
}

/* ---------- Word Wheel ---------- */

.puzzle-grid.wheel {
  grid-template-columns: repeat(3, 64px) !important;
  gap: 8px;
}

.wheel-tile {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
}

.wheel-tile.center {
  border-color: var(--accent);
  background: #dbeafe;
  color: var(--accent-dark);
}

.wheel-found {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wheel-answers .word-chip.found {
  text-decoration: line-through;
  color: var(--muted);
  background: #f8fafc;
}

.wheel-entry {
  display: flex;
  flex-direction: column;
}

.text-input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
}

/* ---------- Kakuro ---------- */

.puzzle-grid.kakuro {
  gap: 0;
  border: 2px solid #334155;
  border-radius: 6px;
}

.puzzle-grid.kakuro .kakuro-cell {
  width: 46px;
  height: 46px;
  border: 1px solid #cbd5e1;
  border-radius: 0;
}

.puzzle-grid.kakuro .kakuro-cell.black {
  background: var(--black);
  border-color: var(--black);
}

.kakuro-clue {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.kakuro-down {
  position: absolute;
  top: 2px;
  left: 3px;
}

.kakuro-across {
  position: absolute;
  top: 2px;
  right: 3px;
}

.kakuro-input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  font-family: inherit;
  outline: none;
  padding: 0;
}

.kakuro-input:focus {
  outline: 2px solid var(--accent);
  border-radius: 2px;
}

.puzzle-grid.show-answers .kakuro-input {
  display: none;
}

/* ---------- Print ---------- */

@media print {
  body {
    background: #fff;
  }

  .site-header,
  .site-nav,
  .page-foot,
  .controls,
  .ad-slot,
  .no-print,
  .card {
    display: none !important;
  }

  main {
    max-width: none;
    padding: 0;
  }

  .puzzle-wrap {
    border: none;
    padding: 0;
    overflow-x: visible !important;
  }

  .puzzle-grid {
    gap: 2px;
    transform: none !important;
    margin-bottom: 0 !important;
  }

  .puzzle-grid .cell {
    transform: none !important;
  }

  .puzzle-grid .cell {
    width: 26px;
    height: 26px;
    font-size: 16px;
    border: 1px solid #000;
    border-radius: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .puzzle-grid .cell.black {
    background: #000;
  }

  /* Nonogram */
  .puzzle-grid.nonogram {
    --cell: 26px;
    grid-template-columns: 46px repeat(var(--n), var(--cell));
    grid-template-rows: 46px repeat(var(--n), var(--cell));
  }

  .sheets.nono-sheets.sheets-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }

  .sheets.nono-sheets.sheets-2 .puzzle-grid.nonogram {
    --cell: 21px;
    grid-template-columns: 38px repeat(var(--n), var(--cell));
    grid-template-rows: 38px repeat(var(--n), var(--cell));
  }

  .sheets.nono-sheets.sheets-2 .nono-legend {
    font-size: 10px;
  }

  .word-chip {
    border: 1px solid #000;
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .clues {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 20px;
  }

  .clue-item {
    border-bottom: none;
    padding: 2px 0;
    font-size: 13px;
    line-height: 1.35;
  }

  .print-heading {
    display: block !important;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  .puzzle-grid.sudoku {
    gap: 0;
    border: 2px solid #000;
  }

  .puzzle-grid.sudoku .cell {
    width: 26px;
    height: 26px;
    font-size: 16px;
    border: 1px solid #000;
    border-radius: 0;
  }

  .puzzle-grid.sudoku .cell.thick-right {
    border-right: 2px solid #000;
  }

  .puzzle-grid.sudoku .cell.thick-bottom {
    border-bottom: 2px solid #000;
  }

  /* Killer Sudoku */
  .puzzle-grid.killer {
    gap: 0;
    border: 2px solid #000;
  }

  .puzzle-grid.killer .cell {
    width: 26px;
    height: 26px;
    font-size: 16px;
    border: 1px solid #000;
    border-radius: 0;
  }

  .puzzle-grid.killer .cell.thick-t {
    border-top: 2px solid #000;
  }

  .puzzle-grid.killer .cell.thick-r {
    border-right: 2px solid #000;
  }

  .puzzle-grid.killer .cell.thick-b {
    border-bottom: 2px solid #000;
  }

  .puzzle-grid.killer .cell.thick-l {
    border-left: 2px solid #000;
  }

  .puzzle-grid.killer .cell .killer-clue {
    color: #000;
    font-size: 9px;
  }

  /* Cross Math */
  .puzzle-grid.cross-math {
    gap: 0;
    border: 2px solid #000;
  }

  .puzzle-grid.cross-math .cell {
    width: 26px;
    height: 26px;
    font-size: 16px;
    border: 1px solid #000;
    border-radius: 0;
  }

  .puzzle-grid.cross-math .cell.cm-rop,
  .puzzle-grid.cross-math .cell.cm-cop,
  .puzzle-grid.cross-math .cell.cm-eq {
    background: #fff;
    color: #000;
  }

  .puzzle-grid.sudoku .sudoku-input,
  .puzzle-grid .cell-input,
  .puzzle-grid .killer-input,
  .puzzle-grid .cm-input,
  .puzzle-grid .ft-input,
  .puzzle-grid .hd-input,
  .puzzle-grid .sky-input,
  .puzzle-grid .cd-input {
    display: none;
  }

  /* Calcudoku */
  .puzzle-grid.calcudoku {
    gap: 0;
    border: 2px solid #000;
  }

  .puzzle-grid.calcudoku .cell {
    width: 26px;
    height: 26px;
    font-size: 16px;
    border: 1px solid #000;
    border-radius: 0;
  }

  .puzzle-grid.calcudoku .cell.thick-t {
    border-top: 2px solid #000;
  }

  .puzzle-grid.calcudoku .cell.thick-r {
    border-right: 2px solid #000;
  }

  .puzzle-grid.calcudoku .cell.thick-b {
    border-bottom: 2px solid #000;
  }

  .puzzle-grid.calcudoku .cell.thick-l {
    border-left: 2px solid #000;
  }

  .puzzle-grid.calcudoku .cd-clue {
    color: #000;
    font-size: 8px;
  }

  /* Hidato: roomy cells for two- and three-digit numbers */
  .puzzle-grid.hidato .cell {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  /* Skyscrapers */
  .puzzle-grid.skyscrapers {
    gap: 0;
    border: 2px solid #000;
  }

  .puzzle-grid.skyscrapers .cell {
    width: 26px;
    height: 26px;
    font-size: 16px;
    border: 1px solid #000;
    border-radius: 0;
  }

  .puzzle-grid.skyscrapers .cell.sky-clue {
    width: 17px;
    height: 17px;
    font-size: 11px;
    color: #000;
    background: #fff;
  }

  /* Slitherlink */
  .puzzle-grid.slitherlink .sl-dot {
    width: 6px;
    height: 6px;
    background: #000;
  }

  .puzzle-grid.slitherlink .sl-hedge {
    width: 22px;
    height: 8px;
  }

  .puzzle-grid.slitherlink .sl-vedge {
    width: 8px;
    height: 22px;
  }

  .puzzle-grid.slitherlink .sl-clue {
    width: 22px;
    height: 22px;
    font-size: 13px;
    color: #000;
  }

  .puzzle-grid.slitherlink .sl-edge.on::after,
  .puzzle-grid.slitherlink .sl-edge.answer-line::after {
    background: #000;
  }

  .puzzle-grid.slitherlink .sl-hedge.on::after,
  .puzzle-grid.slitherlink .sl-hedge.answer-line::after {
    height: 3px;
  }

  .puzzle-grid.slitherlink .sl-vedge.on::after,
  .puzzle-grid.slitherlink .sl-vedge.answer-line::after {
    width: 3px;
  }

  /* Futoshiki */
  .puzzle-grid.futoshiki {
    gap: 0;
    border: 2px solid #000;
  }

  .puzzle-grid.futoshiki .cell {
    width: 26px;
    height: 26px;
    font-size: 16px;
    border: 1px solid #000;
    border-radius: 0;
  }

  .puzzle-grid.futoshiki .cell.ft-hsign,
  .puzzle-grid.futoshiki .cell.ft-vsign {
    width: 18px;
    height: 26px;
    font-size: 16px;
    color: #000;
  }

  .bingo-cards {
    display: grid;
    gap: 12px;
    justify-content: stretch;
  }

  /* 1 card per page — large, centered */
  .bingo-cards.page-1 {
    grid-template-columns: 1fr;
  }

  .bingo-cards.page-1 .bingo-card {
    width: 55%;
    margin: 0 auto;
  }

  /* 2 cards per page */
  .bingo-cards.page-2 {
    grid-template-columns: 1fr 1fr;
  }

  /* 3 cards per page */
  .bingo-cards.page-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }

  /* 4 cards per page */
  .bingo-cards.page-4 {
    grid-template-columns: 1fr 1fr;
  }

  .bingo-card {
    width: 100%;
    border: 2px solid #000;
    border-radius: 0;
    page-break-inside: avoid;
  }

  .bingo-grid {
    gap: 2px;
  }

  .bingo-grid .cell {
    border: 1px solid #000;
    border-radius: 0;
    font-size: 14px;
  }

  .bingo-grid .cell.word {
    font-size: 8px;
  }

  /* Compact 3- and 4-per-page layouts */
  .bingo-cards.page-3 .card-label,
  .bingo-cards.page-4 .card-label {
    font-size: 9px;
    margin-bottom: 2px;
  }

  .bingo-cards.page-3 .bingo-header span,
  .bingo-cards.page-4 .bingo-header span {
    font-size: 11px;
  }

  .bingo-cards.page-3 .bingo-header span.wide,
  .bingo-cards.page-4 .bingo-header span.wide {
    font-size: 9px;
  }

  .bingo-cards.page-3 .bingo-grid .cell {
    font-size: 11px;
  }

  .bingo-cards.page-3 .bingo-grid .cell.word {
    font-size: 6px;
  }

  .bingo-cards.page-4 .bingo-grid .cell {
    font-size: 10px;
  }

  .bingo-cards.page-4 .bingo-grid .cell.word {
    font-size: 5.5px;
  }

  /* Multi-page batches: start a fresh page after every Nth card */
  .bingo-cards.page-2 .bingo-card:nth-child(2n) {
    page-break-after: always;
  }

  .bingo-cards.page-3 .bingo-card:nth-child(3n) {
    page-break-after: always;
  }

  .bingo-cards.page-4 .bingo-card:nth-child(4n) {
    page-break-after: always;
  }

  .bingo-cards.page-2 .bingo-card:last-child,
  .bingo-cards.page-3 .bingo-card:last-child,
  .bingo-cards.page-4 .bingo-card:last-child {
    page-break-after: auto;
  }

  .print-heading {
    break-after: avoid;
  }

  .call-sheet {
    display: none;
  }

  body.print-cards .call-sheet {
    display: none !important;
  }

  body.print-call .bingo-cards {
    display: none !important;
  }

  body.print-call .call-sheet {
    display: block !important;
  }

  body.print-call .call-item {
    cursor: default;
  }

  /* Word search */
  .puzzle-grid.search {
    gap: 0;
    border: 2px solid #000;
  }

  .puzzle-grid.search .letter-cell {
    width: 26px;
    height: 26px;
    font-size: 14px;
    border: 1px solid #000;
    border-radius: 0;
    cursor: default;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .puzzle-grid.search .letter-cell.found {
    background: #c8e6c9;
    color: #000;
    font-weight: 700;
  }

  .puzzle-grid.search .letter-cell.pending {
    background: #fff;
  }

  .search-wordlist .word-chip {
    border: 1px solid #000;
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .search-wordlist .word-chip.found {
    text-decoration: line-through;
    color: #000;
    background: #fff;
  }

  /* 2 word searches side by side */
  .sheets.search-sheets.sheets-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }

  .sheets.search-sheets.sheets-2 .puzzle-sheet {
    border-bottom: none;
    padding-bottom: 0;
  }

  .sheets.search-sheets.sheets-2 .print-heading h1 {
    font-size: 14px;
  }

  .sheets.search-sheets.sheets-2 .print-heading p {
    font-size: 11px;
  }

  .sheets.search-sheets.sheets-2 .puzzle-grid.search .letter-cell {
    width: 17px;
    height: 17px;
    font-size: 10px;
  }

  .sheets.search-sheets.sheets-2 .search-wordlist {
    margin-top: 10px;
  }

  .sheets.search-sheets.sheets-2 .len-label {
    font-size: 11px;
  }

  .sheets.search-sheets.sheets-2 .word-chip {
    font-size: 11px;
    padding: 2px 8px;
  }

  /* Word scramble */
  .scramble-row {
    border: none;
    border-bottom: 1px solid #000;
    border-radius: 0;
    padding: 6px 2px;
    gap: 8px;
  }

  .scramble-row.wrong {
    border-color: #000;
    background: #fff;
  }

  .scramble-tile {
    width: 22px;
    height: 26px;
    font-size: 14px;
    border: 1px solid #000;
    border-radius: 0;
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .scramble-clue {
    font-size: 11px;
  }

  /* blank answer line on the worksheet; answers shown when printing
     answers (inputs filled by the app) */
  .scramble-input {
    width: 120px !important;
    height: 24px !important;
    border: 1px solid #000 !important;
    border-radius: 0 !important;
    background: #fff !important;
    font-size: 13px !important;
    color: #000;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sheets.scramble-sheets.sheets-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }

  .sheets.scramble-sheets.sheets-2 .puzzle-sheet {
    border-bottom: none;
    padding-bottom: 0;
  }

  .sheets.scramble-sheets.sheets-2 .print-heading h1 {
    font-size: 14px;
  }

  .sheets.scramble-sheets.sheets-2 .print-heading p {
    font-size: 11px;
  }

  .sheets.scramble-sheets.sheets-2 .scramble-tile {
    width: 16px;
    height: 20px;
    font-size: 11px;
  }

  .sheets.scramble-sheets.sheets-2 .scramble-clue {
    display: none;
  }

  .sheets.scramble-sheets.sheets-2 .scramble-input {
    width: 90px !important;
    height: 20px !important;
    font-size: 11px !important;
  }
}

.print-heading {
  display: none;
  text-align: center;
  margin-bottom: 16px;
}

.print-heading h1 {
  font-size: 22px;
  margin: 0;
}

.print-heading p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Puzzle sheets (multi-puzzle pages) ---------- */

.sheets {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.puzzle-sheet {
  page-break-inside: avoid;
  break-inside: avoid;
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
}

.puzzle-sheet:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.puzzle-sheet .print-heading h1 {
  font-size: 18px;
}

/* Multi-puzzle: fit 2 fill-ins / crosswords side by side when printing */
@media print {
  .sheets.fillin-sheets.sheets-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }

  .sheets.fillin-sheets.sheets-2 .puzzle-sheet {
    border-bottom: none;
    padding-bottom: 0;
  }

  .sheets.fillin-sheets.sheets-2 .print-heading h1 {
    font-size: 14px;
  }

  .sheets.fillin-sheets.sheets-2 .print-heading p {
    font-size: 11px;
  }

  .sheets.fillin-sheets.sheets-2 .puzzle-grid .cell {
    width: 17px;
    height: 17px;
    font-size: 11px;
    gap: 1px;
  }

  .sheets.fillin-sheets.sheets-2 .puzzle-grid .cell .slot-num {
    font-size: 6px;
  }

  .sheets.fillin-sheets.sheets-2 .wordlist {
    margin-top: 10px;
  }

  .sheets.fillin-sheets.sheets-2 .len-label {
    font-size: 11px;
    margin-bottom: 3px;
  }

  .sheets.fillin-sheets.sheets-2 .word-chip {
    font-size: 9px;
    padding: 2px 6px;
  }

  .sheets.fillin-sheets.sheets-2 .clues {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
  }

  .sheets.fillin-sheets.sheets-2 .clues h2 {
    font-size: 12px;
  }

  .sheets.fillin-sheets.sheets-2 .clue-item {
    font-size: 9px;
    padding: 1px 0;
  }

  .sheets.fillin-sheets.sheets-2 .clue-num {
    min-width: 16px;
  }

  /* Sudoku: up to 8 compact puzzles per page */
  .sheets.sudoku-sheets.sheets-4,
  .sheets.sudoku-sheets.sheets-6,
  .sheets.sudoku-sheets.sheets-8 {
    display: grid;
    gap: 12px;
    align-items: start;
  }

  .sheets.sudoku-sheets.sheets-4 {
    grid-template-columns: 1fr 1fr;
  }

  .sheets.sudoku-sheets.sheets-6 {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .sheets.sudoku-sheets.sheets-8 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }

  .sheets.sudoku-sheets.sheets-4 .puzzle-sheet,
  .sheets.sudoku-sheets.sheets-6 .puzzle-sheet,
  .sheets.sudoku-sheets.sheets-8 .puzzle-sheet {
    border-bottom: none;
    padding-bottom: 0;
  }

  .sheets.sudoku-sheets.sheets-4 .print-heading h1,
  .sheets.sudoku-sheets.sheets-6 .print-heading h1,
  .sheets.sudoku-sheets.sheets-8 .print-heading h1 {
    font-size: 11px;
  }

  .sheets.sudoku-sheets.sheets-4 .print-heading p,
  .sheets.sudoku-sheets.sheets-6 .print-heading p,
  .sheets.sudoku-sheets.sheets-8 .print-heading p {
    font-size: 8px;
  }

  .sheets.sudoku-sheets.sheets-4 .print-heading,
  .sheets.sudoku-sheets.sheets-6 .print-heading,
  .sheets.sudoku-sheets.sheets-8 .print-heading {
    margin-bottom: 6px;
  }

  .sheets.sudoku-sheets.sheets-4 .puzzle-grid.sudoku .cell {
    width: 18px;
    height: 18px;
    font-size: 11px;
  }

  .sheets.sudoku-sheets.sheets-6 .puzzle-grid.sudoku .cell {
    width: 14px;
    height: 14px;
    font-size: 9px;
  }

  .sheets.sudoku-sheets.sheets-8 .puzzle-grid.sudoku .cell {
    width: 11px;
    height: 11px;
    font-size: 7px;
  }

  .sheets.sudoku-sheets.sheets-4 .puzzle-grid.sudoku {
    border-width: 1px;
  }

  .sheets.sudoku-sheets.sheets-6 .puzzle-grid.sudoku,
  .sheets.sudoku-sheets.sheets-8 .puzzle-grid.sudoku {
    border-width: 1px;
  }

  .sheets.sudoku-sheets.sheets-4 .puzzle-grid.sudoku .cell.thick-right {
    border-right-width: 1.5px;
  }

  .sheets.sudoku-sheets.sheets-4 .puzzle-grid.sudoku .cell.thick-bottom {
    border-bottom-width: 1.5px;
  }

  .sheets.sudoku-sheets.sheets-6 .puzzle-grid.sudoku .cell.thick-right,
  .sheets.sudoku-sheets.sheets-8 .puzzle-grid.sudoku .cell.thick-right {
    border-right-width: 1.5px;
  }

  .sheets.sudoku-sheets.sheets-6 .puzzle-grid.sudoku .cell.thick-bottom,
  .sheets.sudoku-sheets.sheets-8 .puzzle-grid.sudoku .cell.thick-bottom {
    border-bottom-width: 1.5px;
  }

  .sheets.sudoku-sheets.sheets-8 .puzzle-grid.sudoku .cell {
    border-width: 0.5px;
  }

  /* Answer keys print with all grids filled */
  .sheets.print-answers .puzzle-grid.show-answers .cell:not(.given)::after {
    content: attr(data-answer);
    font-weight: 600;
  }

  /* Maze */
  .puzzle-grid.maze {
    border: 2px solid #000;
  }

  .maze-cell {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sheets.maze-sheets.sheets-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }

  .sheets.maze-sheets.sheets-2 .puzzle-sheet {
    border-bottom: none;
    padding-bottom: 0;
  }

  .sheets.maze-sheets.sheets-2 .print-heading h1 {
    font-size: 14px;
  }

  .sheets.maze-sheets.sheets-2 .print-heading p {
    font-size: 11px;
  }

  .sheets.maze-sheets.sheets-2 .maze-cell {
    width: 14px;
    height: 14px;
    font-size: 9px;
  }

  /* Matching / Flashcards */
  .match-item {
    border: 1px solid #000;
    border-radius: 0;
  }

  .match-item.matched {
    background: #d1fae5;
    color: #000;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .flashcard {
    border: 1px solid #000;
    border-radius: 0;
  }

  .sheets.match-sheets.sheets-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }

  .sheets.match-sheets.sheets-2 .puzzle-sheet {
    border-bottom: none;
    padding-bottom: 0;
  }

  .sheets.match-sheets.sheets-2 .print-heading h1 {
    font-size: 14px;
  }

  .sheets.match-sheets.sheets-2 .print-heading p {
    font-size: 11px;
  }

  .sheets.match-sheets.sheets-2 .match-item {
    font-size: 12px;
    padding: 5px 8px;
  }

  /* Word Ladder */
  .ladder-word,
  .ladder-input {
    border: 1px solid #000;
    border-radius: 0;
    background: #fff;
    color: #000;
  }

  .ladder-input {
    border-bottom: 2px solid #000;
  }

  .ladder-rung.wrong .ladder-input {
    background: #fff;
  }

  /* Code Breaker */
  .code-input {
    border: none;
    border-bottom: 2px solid #000;
    border-radius: 0;
    background: #fff;
    color: #000;
  }

  .code-row.wrong .code-input {
    background: #fff;
  }

  .sheets.code-sheets.sheets-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }

  .sheets.code-sheets.sheets-2 .puzzle-sheet {
    border-bottom: none;
    padding-bottom: 0;
  }

  .sheets.code-sheets.sheets-2 .print-heading h1 {
    font-size: 14px;
  }

  .sheets.code-sheets.sheets-2 .print-heading p {
    font-size: 11px;
  }

  .sheets.code-sheets.sheets-2 .code-clue {
    display: none;
  }

  /* Cryptogram */
  .crypto-cell .crypto-input,
  .crypto-map-cell .map-input {
    border: none;
    border-bottom: 2px solid #000;
    border-radius: 0;
    background: #fff;
    color: #000;
  }

  .crypto-cell.wrong .crypto-input,
  .crypto-map-cell.wrong .map-input {
    background: #fff;
  }

  .sheets.crypto-sheets.sheets-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }

  .sheets.crypto-sheets.sheets-2 .puzzle-sheet {
    border-bottom: none;
    padding-bottom: 0;
  }

  .sheets.crypto-sheets.sheets-2 .print-heading h1 {
    font-size: 14px;
  }

  .sheets.crypto-sheets.sheets-2 .print-heading p {
    font-size: 11px;
  }

  .sheets.code-sheets.sheets-2 .code-encoded {
    font-size: 15px;
  }

  .sheets.code-sheets.sheets-2 .code-input {
    width: 110px;
    font-size: 13px;
  }

  /* Word Wheel */
  .puzzle-grid.wheel {
    grid-template-columns: repeat(3, 40px) !important;
    gap: 4px;
  }

  .wheel-tile {
    width: 40px;
    height: 40px;
    border: 2px solid #000;
    border-radius: 0;
    font-size: 20px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .wheel-tile.center {
    background: #dbeafe;
  }

  .sheets.wheel-sheets.sheets-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }

  .sheets.wheel-sheets.sheets-2 .puzzle-sheet {
    border-bottom: none;
    padding-bottom: 0;
  }

  .sheets.wheel-sheets.sheets-2 .print-heading h1 {
    font-size: 14px;
  }

  .sheets.wheel-sheets.sheets-2 .print-heading p {
    font-size: 11px;
  }

  /* Kakuro */
  .puzzle-grid.kakuro {
    border: 2px solid #000;
  }

  .puzzle-grid.kakuro .kakuro-cell {
    width: 28px;
    height: 28px;
    border: 1px solid #000;
  }

  .puzzle-grid.kakuro .kakuro-input {
    display: none;
  }

  .kakuro-clue {
    font-size: 9px;
  }

  .sheets.kakuro-sheets.sheets-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }

  .sheets.kakuro-sheets.sheets-2 .puzzle-sheet {
    border-bottom: none;
    padding-bottom: 0;
  }

  .sheets.kakuro-sheets.sheets-2 .print-heading h1 {
    font-size: 14px;
  }

  .sheets.kakuro-sheets.sheets-2 .print-heading p {
    font-size: 11px;
  }

  .sheets.kakuro-sheets.sheets-2 .kakuro-cell {
    width: 20px;
    height: 20px;
  }

  .sheets.kakuro-sheets.sheets-2 .kakuro-clue {
    font-size: 7px;
  }
}
