@charset "UTF-8";
:root { --paper:#f7f6f1; --ink:#202522; --muted:#626b65; --line:#d9ddd5; --blue:#245f9b; --green:#346b52; --red:#a1463c; font-family:Arial,Helvetica,sans-serif; color:var(--ink); background:var(--paper); font-synthesis:none; }
* { box-sizing:border-box; }
body { margin:0; -webkit-font-smoothing:antialiased; }
button,a { -webkit-tap-highlight-color:transparent; }
button { font:inherit; cursor:pointer; touch-action:manipulation; color:inherit; }
button:disabled { cursor:default; opacity:.42; }
a { color:inherit; }
button:focus-visible,a:focus-visible { outline:3px solid var(--blue); outline-offset:3px; }
[hidden] { display:none!important; }
.shell { width:min(100% - 36px,880px); margin:auto; padding:24px 0 30px; }
.topbar { display:flex; justify-content:space-between; align-items:center; font-size:.78rem; font-weight:700; letter-spacing:.03em; }
.topbar a { text-decoration:none; min-height:44px; display:flex; align-items:center; }
.topbar button { border:0; background:transparent; min-height:44px; color:var(--muted); }
.topbar span { display:inline-grid; place-items:center; border:1px solid var(--line); border-radius:50%; width:24px; height:24px; margin-left:5px; }
.masthead { text-align:center; padding:28px 0 25px; }
.eyebrow { text-transform:uppercase; letter-spacing:.18em; font-size:.65rem; font-weight:700; color:var(--muted); }
h1 { font-family:Georgia,'Times New Roman',serif; font-weight:400; font-size:clamp(3.2rem,8vw,4.8rem); line-height:1.08; letter-spacing:-.055em; margin:12px 0; }
.title-dot { color:#a47715; }
.tagline { font-size:.92rem; color:var(--muted); line-height:1.5; margin:12px 0; }
.modebar { display:flex; justify-content:space-between; align-items:center; border-top:1px solid var(--line); padding:6px 0; font-size:.78rem; }
#difficulty-label { font-weight:700; }
.mode-separator,#progress { color:var(--muted); }
.mode-separator { margin:0 8px; }
.modebar button { border:0; background:transparent; min-height:44px; padding:8px 0 8px 12px; }
.modebar button span { margin-left:5px; }
.message { margin:0 0 20px; padding:12px 16px; background:#eeeee6; border-radius:8px; font-size:.83rem; line-height:1.5; min-height:48px; }
.message.error { background:#f8e9e3; color:#89392f; }
.play-layout { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(230px,1fr); gap:30px; align-items:start; }
.board-panel { min-width:0; }
.board { display:grid; grid-template-columns:repeat(9,minmax(0,1fr)); border:3px solid var(--ink); background:var(--ink); width:100%; aspect-ratio:1; }
.cell { position:relative; border:0; border-right:1px solid #d7dad2; border-bottom:1px solid #d7dad2; background:#fff; padding:0; display:grid; place-items:center; color:var(--blue); font-size:clamp(1.2rem,3.6vw,1.85rem); font-weight:500; min-width:0; min-height:0; line-height:1; border-radius:0; }
.cell:nth-child(9n) { border-right:0; }
.cell:nth-child(n+73) { border-bottom:0; }
.cell.box-right { border-right:2px solid var(--ink); }
.cell.box-bottom { border-bottom:2px solid var(--ink); }
.cell.given { color:var(--ink); font-weight:700; }
.cell.related { background:#f3f4ef; }
.cell.matching { background:#e3ebf0; }
.cell.selected { background:#dae8f6; box-shadow:inset 0 0 0 2px var(--blue); z-index:1; }
.cell.conflict,.cell.incorrect { background:#fae6df; color:#9a332b; }
.cell.selected.conflict,.cell.selected.incorrect { box-shadow:inset 0 0 0 2px var(--red); }
.cell:focus-visible { outline:3px solid var(--blue); outline-offset:-3px; z-index:2; }
.conflict-mark { position:absolute; top:3px; right:3px; font-size:.55rem; font-weight:700; }
.pencil-notes { display:grid; grid-template-columns:repeat(3,1fr); grid-template-rows:repeat(3,1fr); width:100%; height:100%; padding:3px; color:#4e6476; font-weight:400; font-size:clamp(.56rem,1.5vw,.75rem); }
.pencil-notes span { display:grid; place-items:center; }
.board.complete { border-color:var(--green); }
.board-caption { display:flex; justify-content:center; align-items:center; gap:7px; font-size:.66rem; color:var(--muted); margin:14px 0 0; }
.given-sample,.entry-sample,.conflict-sample { font-size:.8rem; font-weight:700; }
.given-sample { color:var(--ink); }
.entry-sample { color:var(--blue); margin-left:8px; }
.conflict-sample { color:var(--red); margin-left:8px; }
h2 { font-family:Georgia,'Times New Roman',serif; font-size:1.35rem; font-weight:400; letter-spacing:-.025em; margin:0; }
.controls { padding:22px; border:1px solid var(--line); background:#fff; border-radius:12px; }
.control-heading p { font-size:.74rem; color:var(--muted); margin:10px 0 20px; }
.keypad { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.number-button { min-height:62px; border:1px solid var(--line); border-radius:7px; background:var(--paper); display:grid; justify-items:center; align-content:center; gap:5px; }
.number-button>span { font-size:1.4rem; }
.number-button small { font-size:.6rem; color:var(--muted); }
.number-button:not(:disabled):hover { background:#e6edf2; border-color:var(--blue); }
.tools { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:15px; }
.tool { display:flex; align-items:center; justify-content:center; gap:6px; min-height:46px; border:1px solid var(--line); border-radius:7px; background:#fff; font-size:.74rem; }
.tool>span:first-child { font-size:1.1rem; }
#notes-state { font-size:.6rem; color:var(--muted); }
.tool[aria-pressed="true"] { background:#e3edf6; border-color:var(--blue); color:var(--blue); }
.control-note,.save-note { font-size:.7rem; color:var(--muted); line-height:1.6; margin:13px 0 0; }
.text-button { border:0; background:transparent; text-decoration:underline; text-underline-offset:3px; color:var(--muted); font-size:.72rem; min-height:44px; padding:8px 0; margin-top:7px; }
.save-note { border-top:1px solid var(--line); padding-top:14px; margin-top:0; font-size:.65rem; }
.thinking-note { text-align:center; font-family:Georgia,serif; font-style:italic; font-size:.95rem; color:var(--muted); line-height:1.6; margin:28px 12px; }
footer { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; border-top:1px solid var(--line); padding-top:10px; margin-top:32px; font-size:.68rem; color:var(--muted); }
footer a { text-decoration:none; display:flex; align-items:center; min-height:44px; }
.completion { border:1px solid #b5c7b6; background:#ecf3ec; border-radius:12px; padding:24px; margin-bottom:20px; }
.completion h2 { font-size:1.8rem; margin:10px 0; }
.completion>p { font-size:.85rem; line-height:1.6; }
.primary,.secondary { border-radius:8px; min-height:48px; padding:12px 18px; font-size:.83rem; line-height:1.4; font-weight:700; }
.primary { background:var(--ink); color:#fff; border:1px solid var(--ink); }
.secondary { border:1px solid var(--line); background:white; color:var(--ink); }
dialog { background:var(--paper); border:1px solid var(--line); border-radius:14px; width:min(100% - 32px,490px); padding:28px; color:var(--ink); max-height:85dvh; overflow-y:auto; }
dialog::backdrop { background:rgb(25 31 25 / .4); }
dialog p,dialog li { font-size:.86rem; line-height:1.7; }
dialog li { margin-bottom:10px; }
dialog ul { padding-left:22px; }
.dialog-heading { display:flex; justify-content:space-between; gap:12px; align-items:start; }
.close-button { border:0; background:transparent; font-size:1.6rem; min-width:44px; min-height:44px; margin-top:-10px; color:var(--muted); }
#start-playing { width:100%; margin-top:10px; }
.dialog-actions { display:flex; gap:10px; margin-top:20px; }
.dialog-actions>* { flex:1; }
.difficulty-options { display:grid; gap:9px; }
.difficulty-options button { display:flex; justify-content:space-between; align-items:center; text-align:left; gap:10px; padding:15px; min-height:52px; background:white; border:1px solid var(--line); border-radius:8px; font-size:.8rem; }
.difficulty-options span { font-size:.72rem; color:var(--muted); }
.difficulty-options [aria-pressed="true"] { border-color:var(--ink); background:#edf0e7; box-shadow:inset 0 0 0 1px var(--ink); }
@media(max-width:680px) {
    .shell { width:calc(100% - 28px); max-width:470px; padding-top:12px; }
    .masthead { padding:18px 0 18px; }
    h1 { font-size:3.4rem; }
    .tagline { font-size:.84rem; }
    .message { margin-bottom:14px; font-size:.78rem; padding:10px 12px; }
    .play-layout { grid-template-columns:1fr; gap:19px; }
    .controls { padding:0; border:0; background:transparent; border-radius:0; }
    .control-heading { display:flex; justify-content:space-between; gap:10px; align-items:center; margin-bottom:12px; }
    .control-heading h2 { font-size:1.2rem; }
    .control-heading p { font-size:.65rem; margin:0; text-align:right; }
    .keypad { grid-template-columns:repeat(5,1fr); gap:7px; }
    .number-button { min-height:52px; background:#fff; }
    .number-button>span { font-size:1.25rem; }
    .tools { grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; margin-top:12px; }
    .tool { gap:4px; font-size:.67rem; min-height:46px; }
    .tool>span:first-child { font-size:.95rem; }
    #notes-state { font-size:.55rem; }
    .cell { font-size:clamp(1.15rem,5.2vw,1.65rem); }
    .pencil-notes { font-size:clamp(.5rem,1.8vw,.7rem); padding:2px; }
    .board-caption { font-size:.62rem; }
    .control-note { margin-top:10px; }
    .save-note { padding-top:10px; }
    .thinking-note { margin:24px 10px; }
    footer { font-size:.63rem; margin-top:24px; }
    dialog { padding:22px; }
}
@media(max-width:350px) { .shell { width:calc(100% - 20px); } .tool>span:first-child { display:none; } .board-caption { gap:5px; font-size:.58rem; } .entry-sample,.conflict-sample { margin-left:3px; } }
