:root {
  --bg: #f4f7f3;
  --surface: #fffdf7;
  --ink: #172327;
  --muted: #5e6b70;
  --line: #c8d3d2;
  --line-strong: #203439;
  --brand: #087e8b;
  --brand-dark: #075761;
  --accent: #b76f2c;
  --gold: #e9b44c;
  --selected: #cbeeed;
  --related: #e8f2ed;
  --error: #c24132;
  --given: #edf2ef;
  --shadow: 0 24px 70px rgba(24, 49, 55, .14);
}

.primary-link {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  padding: 0 18px;
  text-decoration: none;
  font-weight: 850;
}

.tool-layout,
.guide-layout {
  display: grid;
  grid-template-columns: minmax(320px, 640px) minmax(260px, 1fr);
  gap: 18px;
  align-items: start;
  background: var(--surface);
  border: 1px solid rgba(39, 54, 56, .12);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.solver-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.solver-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  width: min(100%, 600px);
  aspect-ratio: 1;
  border: 3px solid var(--line-strong);
  background: var(--line-strong);
}

.solver-cell {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fffefa;
  color: var(--ink);
  text-align: center;
  font-size: clamp(1.1rem, 4vw, 2rem);
  font-weight: 850;
}

.solver-cell:nth-child(3n),
.mini-board span:nth-child(3n) {
  border-right-color: var(--line-strong);
}

.solver-cell:nth-child(9n),
.mini-board span:nth-child(9n) {
  border-right-color: var(--line);
}

.solver-cell:nth-child(n+19):nth-child(-n+27),
.solver-cell:nth-child(n+46):nth-child(-n+54),
.mini-board span:nth-child(n+19):nth-child(-n+27),
.mini-board span:nth-child(n+46):nth-child(-n+54) {
  border-bottom-color: var(--line-strong);
}

.grid-textarea {
  width: 100%;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  padding: 12px;
  resize: vertical;
}

.paste-first-panel {
  display: grid;
  gap: 10px;
  border: 2px solid rgba(8, 126, 139, .22);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffefa, #edf7f3);
  padding: 16px;
}

.paste-first-panel label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
}

.paste-grid-textarea {
  min-height: 148px;
  border-color: rgba(8, 126, 139, .42);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .95rem;
  line-height: 1.55;
}

.paste-first-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.text-button {
  width: fit-content;
  border: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sample-bank-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(39, 54, 56, .12);
  border-radius: 8px;
  background: #fffefa;
  padding: 16px;
}

.sample-bank-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--brand);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sample-bank-panel h2 {
  margin-bottom: 6px;
  font-size: 1.08rem;
}

.sample-bank-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.sample-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sample-meta {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-size: .88rem;
}

.solver-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.print-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr)) repeat(2, auto) auto auto;
  gap: 12px;
  align-items: end;
  background: var(--surface);
  border: 1px solid rgba(39, 54, 56, .12);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.check-field {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.print-sheet {
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid rgba(39, 54, 56, .12);
  border-radius: 8px;
  padding: 20px;
}

.print-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.print-grid.answers {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.print-puzzle h2 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.print-meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 750;
  line-height: 1.35;
}

.mini-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  aspect-ratio: 1;
  border: 2px solid var(--line-strong);
  background: var(--line-strong);
}

.mini-board span {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #fffefa;
  font-size: 1.2rem;
  font-weight: 800;
}

.large-print .print-grid {
  grid-template-columns: 1fr;
}

.large-print .mini-board span {
  font-size: 1.6rem;
}

.blank-grid-sheet {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  border: 1px solid rgba(39, 54, 56, .12);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
}

.blank-grid-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}

.blank-grid-header h2 {
  margin-bottom: 0;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.blank-grid-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 750;
}

.blank-sudoku-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  width: min(100%, 720px);
  aspect-ratio: 1;
  margin: 0 auto;
  border: 4px solid var(--line-strong);
  background: var(--line-strong);
}

.blank-sudoku-grid span {
  min-width: 0;
  border: 1px solid var(--line);
  background: #fffefa;
}

.blank-sudoku-grid span:nth-child(3n) {
  border-right-color: var(--line-strong);
}

.blank-sudoku-grid span:nth-child(9n) {
  border-right-color: var(--line);
}

.blank-sudoku-grid span:nth-child(n+19):nth-child(-n+27),
.blank-sudoku-grid span:nth-child(n+46):nth-child(-n+54) {
  border-bottom-color: var(--line-strong);
}

.blank-grid-note {
  width: min(100%, 720px);
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
}

.guide-main {
  border: 1px solid rgba(39, 54, 56, .12);
  border-radius: 8px;
  background: #fffefa;
  padding: 22px;
}

.guide-main h2 {
  margin: 18px 0 8px;
  font-size: 1.22rem;
}

.guide-main h2:first-child {
  margin-top: 0;
}

.guide-main p {
  color: var(--muted);
  line-height: 1.75;
}

.assist-card a {
  color: var(--brand);
  font-weight: 850;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin-bottom: 8px;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.section-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.intent-section {
  margin-top: 22px;
  border: 1px solid rgba(39, 54, 56, .12);
  border-radius: 8px;
  background:
    radial-gradient(circle at top right, rgba(233, 180, 76, .18), transparent 34%),
    linear-gradient(180deg, rgba(255, 253, 247, .94), rgba(244, 247, 243, .82));
  box-shadow: var(--shadow);
  padding: 22px;
}

.intent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.intent-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.intent-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border: 1px solid rgba(8, 126, 139, .18);
  border-radius: 8px;
  background: rgba(255, 254, 250, .9);
  padding: 16px;
}

.intent-label {
  width: fit-content;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(8, 126, 139, .1);
  color: var(--brand-dark);
  padding: 5px 9px;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.intent-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  line-height: 1.25;
}

.intent-card p {
  color: var(--muted);
  line-height: 1.55;
}

.intent-card a {
  margin-top: auto;
  color: var(--brand);
  font-weight: 900;
  text-decoration: none;
}

.intent-card a:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.deep-guide {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, .75fr);
  gap: 18px;
  margin-top: 24px;
}

.deep-guide-main,
.deep-guide-side {
  border: 1px solid rgba(39, 54, 56, .12);
  border-radius: 8px;
  background: rgba(255, 253, 248, .82);
  padding: 22px;
}

.deep-guide-main h2,
.deep-guide-side h2 {
  margin-bottom: 10px;
  font-size: clamp(1.35rem, 2.5vw, 1.82rem);
}

.deep-guide-main p,
.deep-guide-side p {
  color: var(--muted);
  line-height: 1.75;
}

.feature-list,
.check-list {
  margin: 16px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.7;
}

.feature-list li,
.check-list li {
  margin-bottom: 10px;
}

.feature-list strong,
.check-list strong {
  color: var(--ink);
}

.example-box {
  margin-top: 18px;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: #fff8e6;
  padding: 16px;
}

.example-box h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.example-box p {
  margin-bottom: 0;
}

.example-box code {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 10px;
  border-radius: 6px;
  background: rgba(23, 35, 39, .08);
  color: var(--ink);
  padding: 10px;
  font-size: .86rem;
  line-height: 1.5;
}

.step-card {
  max-height: 310px;
  overflow: auto;
}

.step-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.step-list li {
  margin-bottom: 8px;
}

.step-list strong {
  color: var(--ink);
}

@media (max-width: 820px) {
  .tool-layout,
  .guide-layout,
  .print-controls,
  .print-grid,
  .deep-guide,
  .intent-grid,
  .intent-grid.compact {
    grid-template-columns: 1fr;
  }

  .solver-grid {
    width: min(100%, calc(100vw - 58px));
  }
}

@media print {
  @page {
    margin: .45in;
    size: letter portrait;
  }

  body {
    background: white;
  }

  .site-nav,
  .hero,
  .print-controls,
  .ad-slot,
  .no-print,
  .content-grid {
    display: none !important;
  }

  .sudoku-app {
    width: 100%;
    padding: 0;
  }

  .print-sheet {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .blank-grid-sheet {
    margin: 0;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .blank-grid-header {
    display: flex;
    margin-bottom: .25in;
  }

  .blank-grid-header h2 {
    color: #111;
    font-size: 20pt;
  }

  .blank-grid-header .eyebrow {
    color: #444;
  }

  .blank-sudoku-grid {
    width: min(7.2in, 100%);
    border: 3px solid #111;
    background: #111;
  }

  .blank-sudoku-grid span {
    border-color: #777;
    background: white;
  }

  .blank-sudoku-grid span:nth-child(3n),
  .blank-sudoku-grid span:nth-child(n+19):nth-child(-n+27),
  .blank-sudoku-grid span:nth-child(n+46):nth-child(-n+54) {
    border-color: #111;
  }

  .blank-sudoku-grid span:nth-child(9n) {
    border-right-color: #777;
  }

  .blank-grid-note {
    margin-top: .2in;
    color: #333;
    font-size: 10pt;
  }
}

.progress-section {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
  gap: 18px;
  margin-top: 22px;
}

.progress-panel {
  border: 1px solid rgba(39, 54, 56, .12);
  border-radius: 8px;
  background: rgba(255, 253, 248, .78);
  padding: 18px;
}

.progress-panel h2 {
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.achievement {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f0e8;
  padding: 12px;
  color: var(--muted);
}

.achievement.unlocked {
  border-color: rgba(15, 118, 110, .35);
  background: linear-gradient(180deg, #fffdf8, #eaf5ef);
  color: var(--ink);
}

.achievement strong {
  display: block;
  margin-bottom: 4px;
  font-size: .92rem;
}

.achievement span {
  font-size: .78rem;
  line-height: 1.35;
}

.leaderboard {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.leaderboard strong {
  color: var(--ink);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid rgba(39, 54, 56, .12);
}

.site-footer a {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 750;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--brand);
}

.legal-page {
  max-width: 840px;
  margin: 0 auto;
}

.legal-page a {
  color: var(--brand-dark);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 820px) {
  .progress-section {
    grid-template-columns: 1fr;
  }

  .achievement-grid {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% -10%, rgba(8, 126, 139, .18), transparent 30%),
    linear-gradient(135deg, rgba(8, 126, 139, .08), transparent 34%),
    linear-gradient(315deg, rgba(233, 180, 76, .14), transparent 36%),
    linear-gradient(180deg, rgba(255, 253, 247, .6), transparent 44%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button,
select {
  font: inherit;
}

.sudoku-app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.site-nav a {
  border: 1px solid rgba(8, 126, 139, .24);
  border-radius: 999px;
  background: rgba(255, 253, 247, .88);
  color: var(--brand-dark);
  padding: 8px 13px;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 850;
}

.site-nav a:hover {
  background: var(--brand);
  color: white;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  margin-bottom: 20px;
}

.hero::after {
  content: "";
  display: block;
  height: 4px;
  grid-column: 1 / -1;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--gold), rgba(183, 111, 44, .18), transparent);
  opacity: .7;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  line-height: .95;
  letter-spacing: 0;
}

.intro {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.hero-meta span {
  border: 1px solid rgba(8, 126, 139, .24);
  border-radius: 999px;
  background: rgba(255, 253, 247, .78);
  color: var(--brand-dark);
  padding: 7px 11px;
  font-size: .82rem;
  font-weight: 850;
}

.hero-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.select-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.select-field select {
  height: 44px;
  min-width: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
}

.primary-button,
.tool-button,
.number-pad button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(180deg, #0b8f9d, var(--brand));
  color: white;
  padding: 0 18px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(8, 126, 139, .2);
}

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

.ad-slot {
  display: grid;
  place-items: center;
  border: 1px dashed #b8c7c2;
  border-radius: 8px;
  background: rgba(240, 236, 226, .82);
  color: #7a8582;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ad-leaderboard {
  min-height: 90px;
  margin: 0 0 16px;
}

.ad-rectangle {
  min-height: 250px;
}

.ad-sidebar {
  min-height: 280px;
  margin-top: 18px;
}

.ad-content {
  min-height: 90px;
  margin-top: 22px;
}

.game-shell {
  width: 100%;
  min-width: 0;
  background: linear-gradient(180deg, #fffdf7, #f9f6ed);
  border: 1px solid rgba(24, 49, 55, .14);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  margin-bottom: 16px;
}

.status-strip > div {
  background: #fffdf7;
  padding: 10px 14px;
}

.label {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.status-strip strong {
  display: block;
  margin-top: 3px;
  font-size: 1.12rem;
}

.play-area {
  display: grid;
  grid-template-columns: minmax(320px, 580px) minmax(260px, 1fr);
  gap: 18px;
  align-items: start;
}

.board-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  width: min(100%, 580px);
  aspect-ratio: 1;
  border: 3px solid var(--line-strong);
  background: var(--line-strong);
  touch-action: manipulation;
  user-select: none;
}

.cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fffef9;
  color: var(--ink);
  font-size: clamp(1.35rem, 4vw, 2.25rem);
  font-weight: 750;
}

.cell:nth-child(3n) {
  border-right-color: var(--line-strong);
}

.cell:nth-child(9n) {
  border-right-color: var(--line);
}

.cell:nth-child(n+19):nth-child(-n+27),
.cell:nth-child(n+46):nth-child(-n+54) {
  border-bottom-color: var(--line-strong);
}

.cell.given {
  background: linear-gradient(180deg, #edf4f1, #e5eeeb);
  color: #334246;
  font-weight: 900;
}

.cell.selected {
  background: var(--selected);
  outline: 3px solid var(--brand);
  outline-offset: -3px;
  z-index: 1;
}

.cell.related {
  background: var(--related);
}

.cell.same-number {
  background: #fde8bd;
}

.cell.error {
  color: var(--error);
}

.notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  padding: 5px;
  color: #65706d;
  font-size: clamp(.48rem, 1.45vw, .78rem);
  font-weight: 800;
  line-height: 1;
}

.notes span {
  display: grid;
  place-items: center;
}

.message {
  min-height: 24px;
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

.control-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
  align-content: start;
}

.tool-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tool-button {
  min-height: 44px;
  border-radius: 8px;
  background: #edf2ef;
  color: #263537;
  font-weight: 850;
}

.tool-button:hover,
.tool-button.active {
  background: var(--brand);
  color: white;
}

.number-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 430px;
}

.number-pad button {
  aspect-ratio: 1.55;
  border-radius: 8px;
  background: linear-gradient(180deg, #214e63, #153744);
  color: white;
  font-size: 1.42rem;
  font-weight: 900;
}

.number-pad button:hover {
  background: var(--brand);
}

.assist-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf7, #f6f1e7);
  padding: 16px;
}

.assist-card h2 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.assist-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.options-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf8f2;
  padding: 14px 16px;
  color: var(--muted);
  font-weight: 750;
}

.options-card label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.options-card p {
  margin-bottom: 0;
}

.text-button {
  justify-self: start;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  padding: 0;
  font-weight: 900;
}

.board.paused .cell {
  color: transparent;
}

.board.paused::after {
  content: "Paused";
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  display: grid;
  place-items: center;
  background: rgba(255, 253, 248, .88);
  color: var(--brand-dark);
  font-size: 2rem;
  font-weight: 900;
  z-index: 2;
}

.seo-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 28px;
  color: #354346;
}

.feature-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  margin-top: 22px;
}

.feature-band div {
  background: linear-gradient(180deg, #173f4b, #102f38);
  color: white;
  padding: 16px;
}

.feature-band strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1;
}

.feature-band span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, .76);
  font-size: .82rem;
  font-weight: 750;
}

.seo-section h2 {
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.seo-section p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.content-grid article,
.faq-section {
  border: 1px solid rgba(39, 54, 56, .12);
  border-radius: 8px;
  background: rgba(255, 253, 248, .74);
  padding: 18px;
}

.content-grid h2,
.faq-section h2 {
  margin-bottom: 10px;
  font-size: 1.12rem;
}

.content-grid p,
.faq-section p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.faq-section {
  margin-top: 24px;
}

.faq-section details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.faq-section details:first-of-type {
  border-top: 0;
}

.faq-section summary {
  cursor: pointer;
  color: #263537;
  font-weight: 850;
}

.faq-section details p {
  margin-top: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(29, 37, 40, .45);
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal-panel {
  width: min(440px, 100%);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
}

.modal-panel h2 {
  margin-bottom: 8px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

@media (max-width: 820px) {
  .sudoku-app {
    width: calc(100vw - 20px);
    padding-top: 18px;
  }

  .hero,
  .play-area,
  .seo-section,
  .content-grid {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .hero-actions {
    align-items: end;
  }

  .select-field {
    flex: 1;
    min-width: 0;
  }

  .select-field select,
  .primary-button {
    width: 100%;
  }

  .game-shell {
    padding: 10px;
  }

  .board {
    width: min(100%, calc(100vw - 58px));
    min-width: 0;
  }

  .status-strip > div {
    padding: 8px 10px;
  }

  .status-strip strong {
    font-size: 1rem;
  }

  .play-area {
    gap: 12px;
  }

  .tool-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .number-pad {
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 5px;
  }

  .number-pad button {
    aspect-ratio: 1;
    font-size: 1.05rem;
    border-radius: 6px;
  }

  .assist-card {
    display: none;
  }

  .ad-rectangle {
    display: none;
  }

  .ad-sidebar {
    display: none;
  }

  .feature-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .sudoku-app {
    width: calc(100vw - 20px);
  }

  .hero-actions {
    display: grid;
    grid-template-columns: minmax(0, 132px) minmax(0, 1fr);
  }

  .intro {
    max-width: 100%;
    font-size: .92rem;
    line-height: 1.5;
  }

  .hero-meta {
    gap: 6px;
    margin-top: 12px;
  }

  .hero-meta span {
    padding: 6px 9px;
    font-size: .76rem;
  }

  h1 {
    font-size: 2.35rem;
  }

  .ad-leaderboard,
  .ad-content {
    min-height: 82px;
  }

  .feature-band div,
  .content-grid article,
  .faq-section {
    padding: 14px;
  }

  .primary-button {
    padding: 0 12px;
  }

  .play-area {
    grid-template-columns: minmax(0, 1fr);
  }

  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .status-strip > div {
    min-width: 0;
    padding: 8px 9px;
  }

  .label {
    font-size: .66rem;
  }

  .status-strip strong {
    font-size: .96rem;
  }

  .cell {
    font-size: clamp(1.15rem, 7vw, 1.75rem);
  }

  .notes {
    padding: 3px;
    font-size: clamp(.42rem, 2.5vw, .64rem);
  }

  .tool-button {
    min-height: 40px;
    font-size: .86rem;
  }
}

@media (max-width: 600px) {
  .sudoku-app {
    width: min(calc(100vw - 24px), 366px);
    margin-left: 12px;
    margin-right: auto;
    overflow-x: hidden;
  }

  .site-nav {
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .site-nav a {
    flex: 0 0 auto;
  }

  .game-shell,
  .tool-layout,
  .guide-layout,
  .print-controls,
  .print-sheet,
  .progress-panel,
  .content-grid article,
  .faq-section {
    max-width: 100%;
  }

  .play-area,
  .board-panel,
  .control-panel {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .board,
  .solver-grid {
    box-sizing: border-box;
    width: min(100%, 342px);
    max-width: 100%;
    grid-template-columns: repeat(9, minmax(0, 1fr));
  }
}
