/* Sudoku: a puzzle page torn from a newspaper. Cream newsprint, heavy black box rules, printed givens in bold,
   your answers in a blue ballpoint, notes in small pencil grey. Red only for a clash. */
:root { --page: #f5f0e3; --card: #fffdf6; --ink: #1a1813; --soft: #5e594b; --line: #cfc6ad; --field: #ece5d2; --act: #1f3f8f; --on-act: #ffffff; --stop: #b3261e;
  --pen: #1f3f8f; --rule: #1a1813; --hi: #e6dcc0; --same: #d3c393; --sel: #f2c94c; --wide: 560px; color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --page: #16140f; --card: #201d16; --ink: #efe9da; --soft: #aaa38f; --line: #3b3628; --field: #16140f; --act: #9db7ff; --on-act: #0d1a3d; --stop: #ff8a80;
    --pen: #9db7ff; --rule: #efe9da; --hi: #2c281e; --same: #4a4230; --sel: #7a6420; color-scheme: dark; }
}
.top { justify-content: space-between; align-items: baseline; }
.time { font-size: 20px; font-weight: 700; }
.picks { justify-content: space-between; align-items: center; }
.board { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); border: 3px solid var(--rule); background: var(--card); width: 100%; aspect-ratio: 1; user-select: none; -webkit-user-select: none; }
.cell { min-height: 0; border: 0; border-radius: 0; padding: 0; background: transparent; color: var(--pen); font-weight: 500; font-size: clamp(20px, 6.4vw, 32px);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; place-items: center; position: relative; aspect-ratio: 1; touch-action: manipulation; }
.cell:nth-child(9n) { border-right: 0; }
.cell:nth-child(9n + 3), .cell:nth-child(9n + 6) { border-right: 2px solid var(--rule); }
.cell:nth-child(n + 19):nth-child(-n + 27), .cell:nth-child(n + 46):nth-child(-n + 54) { border-bottom: 2px solid var(--rule); }
.cell:nth-child(n + 73) { border-bottom: 0; }
.cell.given { color: var(--ink); font-weight: 800; }
.cell.peer { background: var(--hi); } .cell.same { background: var(--same); } .cell.sel { background: var(--sel); }
.cell.bad { color: var(--stop); text-decoration: underline wavy; text-underline-offset: 3px; }
.cell:focus-visible { outline: 3px solid var(--act); outline-offset: -3px; }
.notes { position: absolute; inset: 2px; display: grid; grid-template-columns: repeat(3, 1fr); font-size: clamp(10px, 2.9vw, 13px); color: var(--soft); font-weight: 600; line-height: 1; }
.notes i { font-style: normal; display: grid; place-items: center; }
.pad { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; }
.pad button { min-height: 52px; padding: 0; border-radius: 10px; font-size: 22px; background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
.pad button:disabled { opacity: .3; }
.tools { justify-content: center; } .tools button { flex: 1 1 90px; }
#notes[aria-pressed="true"] { background: var(--ink); color: var(--page); }
.won { border: 2px solid var(--act); } .won button { justify-self: start; }
@media (max-width: 370px) { .pad { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
