:root{color-scheme:dark;--bg:#0a1412;--surface:#132520;--line:#304a40;--strong:#73988a;--text:#eff8f1;--muted:#a3b7a9;--mint:#a2ffdf;--related:#1b332b;--error:#ffaaa4;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-synthesis:none;color:var(--text);background:var(--bg)}
*{box-sizing:border-box}body{margin:0;min-width:300px;-webkit-tap-highlight-color:transparent}button,a,input{touch-action:manipulation}button{font:inherit;color:inherit;border:0;cursor:pointer}button:disabled{opacity:.28;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid var(--mint);outline-offset:4px}button{user-select:none;-webkit-user-select:none}button:active:not(:disabled){transform:translateY(1px)}[hidden]{display:none!important}.app{width:min(100% - 40px,440px);margin:auto;padding-top:max(24px,env(safe-area-inset-top));padding-bottom:max(14px,env(safe-area-inset-bottom))}.header{display:flex;align-items:center;justify-content:space-between;height:44px}.brand{color:var(--text);text-decoration:none;display:flex;align-items:center;gap:10px;font:600 35px/1 Georgia,serif;letter-spacing:-1.3px}.brand svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.65}.header nav{display:flex;gap:6px}.icon-button{width:44px;height:44px;background:transparent;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;padding:10px}.icon-button:hover{background:var(--related)}svg.icon{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}.intro{margin:26px 0 20px}.intro h1{margin:0;font:500 clamp(25px,6.8vw,32px)/1.2 Georgia,serif;letter-spacing:-.6px}.intro p{font-size:14px;line-height:1.5;color:var(--muted);margin:7px 0 0}.metadata{height:48px;display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.difficulty{background:none;padding:8px 0;display:flex;align-items:center;gap:8px;font-size:17px;font-weight:500;min-height:44px}.difficulty svg{width:16px;height:16px}.timer-controls{display:flex;align-items:center;gap:3px}.timer{font-variant-numeric:tabular-nums;font-size:16px;letter-spacing:.6px;display:flex;align-items:center;gap:8px}.timer svg{width:18px;height:18px;color:var(--muted)}.timer-controls .icon-button{margin-right:-10px}.board-wrap{position:relative;aspect-ratio:1}.board{width:100%;height:100%;display:grid;grid-template-rows:repeat(9,minmax(0,1fr));border:2px solid var(--strong);border-radius:5px;overflow:hidden;background:var(--surface);isolation:isolate}.board-row{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));min-height:0}.cell{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;width:100%;height:100%;padding:0;background:var(--surface);border-right:1px solid var(--line);border-bottom:1px solid var(--line);font-size:clamp(21px,5.7vw,28px);font-weight:450;font-variant-numeric:tabular-nums;border-radius:0;outline-offset:-3px!important;transition:background-color .12s}.cell:nth-child(3),.cell:nth-child(6){border-right:2px solid var(--strong)}.cell:last-child{border-right:0}.board-row:nth-child(3) .cell,.board-row:nth-child(6) .cell{border-bottom:2px solid var(--strong)}.board-row:last-child .cell{border-bottom:0}.cell.related{background:var(--related)}.cell.entered{color:var(--mint);font-weight:500}.cell.match{background:#254b3e;color:var(--mint)}.cell.conflict{color:var(--error);background:#4c2b2a}.cell.selected{background:var(--mint);color:var(--bg)}.cell.selected.conflict{background:var(--error);color:#351614}.cell.selected .note{color:#193e2f}.cell:active{transform:none!important}.cell.hinted:after{content:"";position:absolute;bottom:3px;width:3px;height:3px;border-radius:50%;background:currentColor}.cell .pencil-grid{display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);position:absolute;inset:2px;pointer-events:none}.note{display:flex;align-items:center;justify-content:center;font-size:clamp(9px,2.35vw,11px);line-height:1;color:#b1cabb;font-weight:450}.progress{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--muted);font-size:11px;line-height:1.3;min-height:35px;font-variant-numeric:tabular-nums}.progress span:first-child{color:var(--text)}.tools{display:grid;grid-template-columns:repeat(4,1fr);margin:10px -5px 18px;gap:4px}.tool{background:transparent;border-radius:8px;min-height:62px;padding:6px 1px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;font-size:12px}.tool-icon{height:26px;display:flex;align-items:center;justify-content:center}.tool svg{width:25px;height:25px}.tool:hover:not(:disabled),.tool[aria-pressed=true]{background:var(--related);color:var(--mint)}.tool[aria-pressed=true] .tool-icon:after{content:"";position:absolute;width:5px;height:5px;border-radius:50%;background:var(--mint);transform:translate(16px,-13px)}.number-pad{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:5px}.number-key{height:61px;background:var(--related);border-radius:7px;color:var(--mint);font-size:28px;font-weight:450;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:2px}.number-key:hover{background:#284c3e}.number-key small{font-size:9px;line-height:1;color:#90b4a2}.number-key.exhausted{color:#718d7e;background:var(--surface)}.number-key.active{box-shadow:inset 0 0 0 1px var(--mint)}.new-game{display:flex;align-items:center;justify-content:center;gap:9px;background:none;min-height:52px;font-size:15px;margin:17px auto 0;padding:4px 15px}.new-game svg{width:22px;height:22px;display:block}.new-game:hover{color:var(--mint)}.pause-cover{position:absolute;inset:0;background:var(--surface);border:2px solid var(--strong);border-radius:5px;display:flex;align-items:center;justify-content:center;flex-direction:column;padding:24px;text-align:center}.pause-cover h2{font:400 26px/1.2 Georgia,serif;margin:18px 0 24px}.pause-symbol{height:28px;width:22px;border-left:7px solid var(--mint);border-right:7px solid var(--mint)}.primary{background:var(--mint);color:var(--bg);min-height:48px;padding:12px 24px;border-radius:7px;font-weight:650;font-size:15px}.secondary{background:var(--related);color:var(--text);min-height:46px;border-radius:7px;padding:10px 18px;font-size:14px}.toast{position:fixed;bottom:max(20px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:max-content;max-width:min(90vw,440px);background:#254b3e;border:1px solid #638d79;color:var(--text);box-shadow:0 8px 35px #0006;border-radius:9px;padding:14px 18px;font-size:14px;text-align:center;z-index:20}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}dialog{width:min(100% - 32px,420px);padding:20px 24px 26px;border:1px solid var(--line);border-radius:16px;background:var(--bg);color:var(--text);max-height:calc(100dvh - 40px);overflow-y:auto;box-shadow:0 24px 100px #0008}dialog::backdrop{background:#030a08b8;backdrop-filter:blur(6px)}.dialog-top{display:flex;align-items:center;justify-content:space-between;margin:-3px -10px 18px 0}.dialog-brand{font:500 24px Georgia,serif;letter-spacing:-1px;color:var(--muted)}dialog h2{font:400 29px/1.2 Georgia,serif;margin:0 0 12px;letter-spacing:-.6px}dialog p{font-size:14px;line-height:1.65;color:var(--muted);margin:0 0 18px}dialog .primary,dialog .secondary{width:100%;margin-top:12px}.level-options{display:grid;gap:8px}.level-option{display:flex;justify-content:space-between;align-items:center;width:100%;padding:14px 16px;text-align:left;background:var(--surface);border:1px solid var(--line);border-radius:9px;min-height:61px}.level-option strong{font-size:16px;font-weight:550}.level-option small{display:block;color:var(--muted);font-size:12px;margin-top:4px}.level-option:hover{border-color:var(--mint)}.level-option svg{color:var(--mint);width:20px;height:20px}.divider{height:1px;background:var(--line);margin:19px 0}.setting-row{display:flex;align-items:center;gap:14px;justify-content:space-between;padding:15px 0;border-bottom:1px solid var(--line);font-size:14px;line-height:1.4}.setting-row span small{display:block;color:var(--muted);margin-top:4px;font-size:12px}.setting-row input{appearance:none;-webkit-appearance:none;width:42px;height:26px;border-radius:20px;background:#304b3e;position:relative;flex-shrink:0;cursor:pointer}.setting-row input:before{content:"";position:absolute;left:4px;top:4px;width:18px;height:18px;border-radius:50%;background:var(--text);transition:transform .15s}.setting-row input:checked{background:#43846c}.setting-row input:checked:before{transform:translateX(16px);background:var(--mint)}.statistics{display:grid;grid-template-columns:repeat(2,1fr);gap:20px;margin:22px 0}.statistics strong{font-size:24px;font-variant-numeric:tabular-nums;font-weight:500;display:block;color:var(--mint)}.statistics span{font-size:12px;color:var(--muted)}.rules{padding-left:20px;color:var(--muted);font-size:14px;line-height:1.7}.rules li{padding-left:4px;margin-bottom:10px}.hint-equation{display:block;font-size:44px;font-weight:500;color:var(--mint);margin:22px 0}.hint-mark{color:var(--mint)}.win-symbol{margin:0 0 15px;color:var(--mint)}.win-symbol svg{height:44px;width:44px}.dialog-actions{display:flex;gap:10px}.daily-label{color:var(--mint);font-size:12px}
/* Keep the whole playing surface within a phone's first viewport. */
.app{width:min(100% - 40px,420px);padding-top:max(20px,env(safe-area-inset-top))}.header{height:38px}.intro{margin:18px 0 12px}.intro h1{font-size:clamp(25px,6.8vw,30px);line-height:1.15}.intro p{line-height:1.4;margin-top:5px}.metadata{height:44px;margin-bottom:8px}
@media(min-width:760px) and (min-height:700px){.cell{font-size:27px}.number-key{height:61px}}
@media(max-width:360px){.app{width:calc(100% - 28px)}.intro h1{font-size:25px}.number-pad{gap:3px}.number-key{font-size:25px}.progress{font-size:10px}.brand{font-size:31px}}
@media(max-height:760px) and (orientation:portrait){.app{padding-top:max(10px,env(safe-area-inset-top));padding-bottom:max(8px,env(safe-area-inset-bottom))}.header{height:36px}.brand{font-size:30px}.brand svg{width:23px;height:23px}.intro{margin:12px 0 4px}.intro h1{font-size:23px;line-height:1.1}.intro p{display:none}.metadata{height:40px;margin-bottom:7px}.board-wrap{max-width:calc(100svh - 334px);margin:auto}.progress{max-width:calc(100svh - 334px);margin:auto;min-height:25px}.tools{margin:1px -5px 7px}.tool{min-height:49px;font-size:11px;gap:4px}.tool svg{width:22px;height:22px}.number-key{height:51px;font-size:26px}.new-game{margin-top:7px;min-height:43px;font-size:14px}}
@media(max-height:560px) and (orientation:landscape){.app{width:min(100% - 48px,850px);padding-top:max(12px,env(safe-area-inset-top));padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}.header{height:35px}.brand{font-size:28px}.intro{display:none}.metadata{height:35px;margin:0;max-width:calc(100svh - 110px)}.game-layout{display:grid;grid-template-columns:minmax(0,calc(100svh - 115px)) minmax(0,1fr);gap:26px;align-items:center;justify-content:center}.board-wrap{width:100%;max-width:100%;}.cell{font-size:20px}.progress{font-size:10px;min-height:23px}.controls-region{max-width:390px}.tools{margin:0 0 16px;gap:0}.tool{font-size:11px}.number-pad{grid-template-columns:repeat(3,1fr);gap:6px}.number-key{height:44px;font-size:22px}.number-key small{display:none}.new-game{margin-top:12px;min-height:38px}.timer{font-size:14px}.difficulty{font-size:14px}.metadata .icon-button{height:34px}.note{font-size:8px}.toast{bottom:12px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;animation:none!important}}
@media(min-height:761px) and (max-height:820px) and (orientation:portrait){.app{padding-top:max(12px,env(safe-area-inset-top))}.header{height:36px}.intro{margin:12px 0 8px}.intro h1{font-size:25px}.intro p{font-size:13px}.metadata{height:40px;margin-bottom:6px}.tools{margin:4px -5px 12px}.new-game{margin-top:12px}}
@media(max-height:560px) and (orientation:landscape){.app{padding-bottom:max(10px,env(safe-area-inset-bottom))}}
