/* Sudoku page — builds on styles.css tokens */
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.nav-sudoku[aria-current="page"]{text-decoration:underline;text-decoration-color:var(--gold);text-decoration-thickness:2px;text-underline-offset:7px}
.sudoku-page h1{font-size:clamp(42px,4.4vw,64px);letter-spacing:-2.4px;margin:22px 0 24px;line-height:1.05}
.sudoku-page h1 em{color:#6e7f3f}
.sudoku{padding-top:52px}
.sudoku-intro{display:grid;grid-template-columns:1fr 1.1fr;column-gap:9%;align-items:end}
.sudoku-intro .eyebrow{grid-column:1/-1;margin:0;color:var(--muted)}
.sudoku-intro h1{grid-column:1;grid-row:3;margin-bottom:0}
.sudoku-intro .intro-text{grid-column:2;grid-row:3}
.sudoku-intro .intro-text{max-width:420px}
.sudoku-intro .intro-text p{line-height:1.8;color:var(--muted);font-size:16px;margin:0}
.sudoku-intro .sudoku-note{grid-column:1;grid-row:2;max-width:520px;margin:18px 0 6px;padding-left:16px;border-left:2px solid var(--gold);font-family:Georgia,'Times New Roman',serif;font-style:italic;font-size:19px;line-height:1.6;color:#6e7f3f}

.sudoku-game{display:grid;grid-template-columns:minmax(0,560px) minmax(260px,1fr);gap:56px;margin-top:36px;align-items:start}
.board-wrap{min-width:0}
.board-bar{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:14px}
.difficulty{display:inline-flex;border:1px solid #a9b5a9;border-radius:3px;overflow:hidden}
.difficulty button{font:inherit;font-size:13px;font-weight:600;letter-spacing:.4px;background:transparent;color:var(--ink);border:0;padding:10px 16px;cursor:pointer}
.difficulty button+button{border-left:1px solid #a9b5a9}
.difficulty button[aria-pressed="true"]{background:var(--forest);color:var(--cream)}
.difficulty button:hover:not([aria-pressed="true"]){background:#e3e7d9}
.timer{margin:0;font-family:Georgia,serif;font-size:22px;color:var(--ink);font-variant-numeric:tabular-nums}

.board{display:grid;grid-template-columns:repeat(9,1fr);background:#fffdf6;border:2px solid var(--forest);border-radius:3px;box-shadow:0 18px 40px -28px rgba(18,43,39,.55);user-select:none;-webkit-user-select:none;touch-action:manipulation}
.board .row{display:contents}
.cell{position:relative;aspect-ratio:1;min-width:0;padding:0;margin:0;border:0;border-right:1px solid #d9dccf;border-bottom:1px solid #d9dccf;background:transparent;color:#6b4f1d;font-family:Georgia,'Times New Roman',serif;font-size:clamp(18px,5.6vw,31px);line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background-color .12s}
.cell:nth-child(9n){border-right:0}
.row:last-child .cell{border-bottom:0}
.cell.edge-right{border-right:2px solid var(--forest)}
.cell.edge-bottom{border-bottom:2px solid var(--forest)}
.cell.given{color:var(--forest);font-weight:700}
.cell.peer{background:#eef0e6}
.cell.same{background:#efe2bf}
.cell.selected{background:var(--gold)}
.cell.conflict{color:#a4271c;background:#f7ddd7}
.cell.conflict.selected{background:#eec2b8}
.cell.clash{background:#f7ddd7}
.cell.wrong .value{text-decoration:underline wavy #a4271c;text-decoration-thickness:1.5px;text-underline-offset:5px}
.cell:focus{outline:none}
.cell:focus-visible{outline:3px solid #ba671d;outline-offset:-3px;z-index:1}
.cell .value:empty{display:none}
.notes{position:absolute;inset:3px;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);font-family:Arial,Helvetica,sans-serif;font-size:clamp(8px,1.9vw,12px);font-weight:400;color:var(--muted);pointer-events:none}
.notes span{display:flex;align-items:center;justify-content:center}
.cell .value:not(:empty)+.notes{display:none}
.noscript{padding:16px;background:#e8e9df;margin-top:12px}

.controls{display:flex;flex-direction:column;gap:18px;min-width:0}
.pad{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.pad button{position:relative;font-family:Georgia,serif;font-size:28px;color:var(--forest);background:#fffdf6;border:1px solid #c5ccbd;border-radius:3px;padding:14px 0;cursor:pointer}
.pad button:hover{background:#efe2bf}
.pad button.done{color:#a7b0a5;background:#eceee5}
.pad .left{position:absolute;top:5px;right:7px;font-family:Arial,sans-serif;font-size:10px;color:var(--muted)}
.tools{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.tools button{font:inherit;font-size:13px;font-weight:600;color:var(--ink);background:transparent;border:1px solid #a9b5a9;border-radius:3px;padding:11px 6px;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:4px}
.tools button span[aria-hidden]{font-size:18px;line-height:1}
.tools button:hover:not(:disabled){background:#e3e7d9}
.tools button:disabled{opacity:.45;cursor:default}
#notes[aria-pressed="true"]{background:var(--forest);color:var(--cream);border-color:var(--forest)}
#notes .state{font-size:10px;font-weight:400;letter-spacing:1px;text-transform:uppercase}
.pad button:focus-visible,.tools button:focus-visible,.difficulty button:focus-visible,.new-game:focus-visible,.solved-card .button:focus-visible{outline:3px solid #ba671d;outline-offset:2px}
.new-game{justify-content:space-between;background:var(--forest);color:var(--cream);border:0;cursor:pointer;font-family:inherit;margin-top:0}
.new-game:hover{background:#1c3d37;text-decoration:none}
.status{min-height:1.7em;margin:0;font-size:14px;line-height:1.7;color:var(--ink)}
.stats{display:grid;grid-template-columns:repeat(3,1fr);margin:0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.stats div{padding:14px 0}
.stats div+div{padding-left:16px;border-left:1px solid var(--line)}
.stats dt{font-size:10px;letter-spacing:1.6px;font-weight:600;color:var(--muted);text-transform:uppercase}
.stats dd{margin:6px 0 0;font-family:Georgia,serif;font-size:22px}
.keys{margin:0;font-size:11px;letter-spacing:.3px;color:var(--muted);line-height:1.7}

.solved{position:fixed;inset:0;background:rgba(11,12,16,.55);display:flex;align-items:center;justify-content:center;padding:20px;z-index:20}
.solved[hidden]{display:none}
.solved-card{background:var(--forest);color:var(--cream);max-width:440px;width:100%;padding:40px 36px;border-radius:120px 120px 6px 6px;text-align:center;border:1px solid #40534a}
.solved-card .eyebrow{color:var(--gold);margin-top:18px}
.solved-card h2{font-size:clamp(36px,6vw,50px);margin:14px 0 18px}
.solved-card h2 em{color:var(--gold)}
.solved-card p:not(.eyebrow){color:#d4ddd1;line-height:1.7;margin-bottom:24px}
.solved-card .button{border:0;cursor:pointer;font-family:inherit}
.solved-close{display:block;margin:16px auto 0;background:none;border:0;color:#c3cfc2;font:inherit;font-size:12px;letter-spacing:.4px;text-decoration:underline;text-underline-offset:4px;cursor:pointer}

@media(max-width:1000px){.sudoku-game{grid-template-columns:minmax(0,1fr) minmax(240px,300px);gap:36px}}
@media(max-width:800px){
  .sudoku{padding-top:44px}
  .sudoku-intro{grid-template-columns:1fr;gap:20px}
  .sudoku-intro h1,.sudoku-intro .intro-text,.sudoku-intro .sudoku-note{grid-column:1;grid-row:auto}
  .sudoku-game{grid-template-columns:1fr;gap:22px;margin-top:30px}
  .board-wrap{max-width:560px;width:100%;justify-self:center}
  .controls{max-width:560px;width:100%;justify-self:center}
  .pad{grid-template-columns:repeat(9,1fr);gap:5px}
  .pad button{font-size:22px;padding:11px 0}
  .pad .left{top:2px;right:3px;font-size:8px}
  .tools{grid-template-columns:repeat(6,1fr);gap:5px}
  .tools button{font-size:11px;padding:9px 2px}
  .keys{display:none}
}
@media(max-width:480px){
  .difficulty button{padding:9px 11px;font-size:12px}
  .timer{font-size:19px}
  .tools{grid-template-columns:repeat(3,1fr)}
}
@media(prefers-reduced-motion:reduce){.cell{transition:none}}
/* Mobile: bring the board into the first screen */
@media(max-width:800px){
  .sudoku{display:flex;flex-direction:column;padding-top:22px}
  .sudoku-intro{display:contents}
  .sudoku-intro .eyebrow{order:1;margin:0 0 8px;font-size:11px}
  .sudoku-intro .sudoku-note{order:2;margin:2px 0 12px;font-size:16px;padding-left:12px}
  .sudoku-intro h1{order:3;font-size:34px;letter-spacing:-1.2px;margin:0}
  .sudoku-intro h1 br{display:none}
  .sudoku-intro h1 em{display:inline;margin-left:.25em}
  .sudoku-game{order:4;margin-top:16px}
  .sudoku-intro .intro-text{order:5;margin-top:26px}
  .sudoku-intro .intro-text p{font-size:15px}
  .board-bar{margin-bottom:10px}
  .difficulty button{min-height:40px}
  .pad .left{font-size:10px;top:3px;right:4px}
  .stats dt{font-size:11px}
  .tools button{min-height:56px}
  .solved-close{min-height:44px}
}
@media(max-width:420px){.sudoku-intro h1{font-size:28px}}
@media(max-width:360px){.sudoku-intro h1 em{display:block;margin-left:0}}
/* Short landscape screens: keep the whole board visible */
@media(max-height:520px) and (orientation:landscape){
  .sudoku{padding-top:20px}
  .sudoku-intro{display:block;position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .sudoku-game{margin-top:0;grid-template-columns:minmax(0,calc(100svh - 148px)) minmax(240px,1fr);gap:28px}
  .sudoku{padding-top:14px;padding-bottom:30px}
  .difficulty button{padding:6px 9px;font-size:11px;min-height:34px}
  .timer{font-size:16px}
  .board-bar{margin-bottom:8px}
  .pad button{padding:8px 0;font-size:22px}
  .tools button{padding:7px 4px}
  .keys{display:none}
}
/* Size digits from the board's own width so cells stay square at every size */
.board{container-type:inline-size}
.cell{font-size:clamp(14px,5.6cqi,31px)}
.notes{font-size:clamp(7px,2cqi,12px)}
