:root {
  --bg: #0b0b0c;
  --panel: #141416;
  --cell: #1a1a1d;
  --line: #34343a;
  --block: #8a8a94;
  --text: #f2f2f4;
  --muted: #9a9aa4;
  --accent: #7dd3a8;
  --accent-ink: #06281a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.05), transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(125, 211, 168, 0.06), transparent 45%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.6;
}

.page {
  width: min(100% - 32px, 34rem);
  margin: 0 auto;
  padding: 28px 0 24px;
}

.back { color: var(--muted); font-size: 0.85rem; text-decoration: none; }
.back:hover { color: var(--text); }

h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.9rem, 6vw, 2.5rem);
  margin: 10px 0 4px;
}

.lede { color: var(--muted); margin: 0 0 20px; }

/* ---- the React app ---- */
.sudokugrid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  gap: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  margin: 0;
  background: var(--cell);
  border: 3px solid var(--block) !important;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.numbersquare {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--cell);
  color: var(--text);
  font: 500 clamp(1.05rem, 5vw, 1.7rem) 'Inter', system-ui, sans-serif;
  text-align: center;
  caret-color: var(--accent);
  border-radius: 0;
}

.innerrightedge { border-right: 2px solid var(--block); }
.innerbottomedge { border-bottom: 2px solid var(--block); }

.numbersquare:focus {
  outline: none;
  background: #23312b;
  box-shadow: inset 0 0 0 2px var(--accent);
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

.buttongrid { display: block; width: 100%; height: auto; margin: 16px 0 0; }

.buttongrid button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 1.05rem 'Inter', system-ui, sans-serif;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.buttongrid button:hover:not(:disabled) { filter: brightness(1.08); }
.buttongrid button:active:not(:disabled) { transform: translateY(1px); }
.buttongrid button:focus-visible,
.secondary:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.buttongrid button:disabled { background: #3a2a2a; color: #f1b5b5; cursor: default; }

.secondary {
  display: block;
  margin: 10px auto 0;
  padding: 8px 14px;
  background: none;
  border: 0;
  color: var(--muted);
  font: 0.9rem 'Inter', system-ui, sans-serif;
  text-decoration: underline;
  cursor: pointer;
}
.secondary:hover { color: var(--text); }

/* ---- supporting text ---- */
.about { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.93rem; }
.about h2 { color: var(--text); font-weight: 500; font-size: 1.05rem; margin: 0 0 6px; }
.about a, footer a { color: #9cc4ff; }

footer { margin-top: 26px; color: var(--muted); font-size: 0.78rem; text-align: center; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
