/* Number Grid Tic-Tac-Toe. Original School Launch styles (same palette as the other explainers). */
:root{
  --ink:#2a211b; --muted:#6b5d52; --paper:#f7f2e8; --card:#fffdf8; --line:#e2d7c5; --brick:#8c3b22; --brick-dk:#6e2c18;
  --focus:#1f5f8b; --night:#15100c;
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--paper);color:var(--ink)}
body{line-height:1.5;font-size:16px;overflow-x:hidden}
.app{max-width:1280px;margin:0 auto;padding:12px 16px 32px}
a{color:var(--brick)}
:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
[hidden]{display:none!important}
.skip{position:absolute;left:-999px;top:0;background:var(--ink);color:#fff;padding:.5rem .8rem;z-index:30}
.skip:focus{left:.5rem;top:.5rem}
.noscript{padding:12px 16px;background:var(--card);border:1px solid var(--line);border-radius:8px}
.top h1{margin:4px 0 0;font-size:28px;color:var(--brick);letter-spacing:.01em;font-family:Georgia,"Times New Roman",serif}
.top .sub{margin:2px 0 10px;color:var(--muted)}
.tabs{display:flex;flex-wrap:wrap;gap:6px;border-bottom:2px solid var(--line);margin-bottom:12px}
.tabs button{font:inherit;font-size:15px;font-weight:600;border:1px solid var(--line);border-bottom:0;background:#efe6d6;color:var(--ink);border-radius:8px 8px 0 0;padding:8px 14px;cursor:pointer;min-height:42px;margin-bottom:-2px}
.tabs button[aria-selected="true"]{background:var(--card);color:var(--brick);border-color:var(--brick);border-bottom:2px solid var(--card)}
.tabs button:hover{background:#f8efe2}
.layout{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:18px;align-items:start}
.stage{min-width:0}
.stage canvas{display:block;width:100%;height:auto;background:var(--night);border-radius:8px;border:1px solid #3a2c22;touch-action:none}
.caption{margin:6px 2px 0;font-size:14px;color:var(--muted);min-height:1.5em}
.side{display:flex;flex-direction:column;gap:12px;min-width:0}
.card{background:var(--card);border:1px solid var(--line);border-radius:8px;padding:10px 14px}
.card h2{margin:0 0 8px;font-size:18px;color:var(--brick-dk)}
.card h3{margin:14px 0 4px;font-size:16px;color:var(--brick-dk)}
.row{display:flex;align-items:center;gap:8px;margin:6px 0}
.row label{flex:0 0 66px;font-weight:600;font-size:14px}
select{font:inherit;font-size:15px;flex:1;min-width:0;border:1px solid var(--muted);border-radius:6px;padding:5px 6px;background:#fff;color:var(--ink);min-height:36px}
.seg{display:flex;flex-wrap:wrap;gap:4px 12px;margin:0 0 6px;font-size:14.5px}
.seg label,.check{display:flex;align-items:center;gap:6px;cursor:pointer;min-height:30px;font-size:14.5px}
input[type=radio],input[type=checkbox]{width:17px;height:17px;accent-color:var(--brick);margin:0}
input[type=range]{width:100%;accent-color:var(--brick);min-height:28px}
.slider{margin:6px 0}
.slider label{display:flex;justify-content:space-between;font-weight:600;font-size:14px}
.slider output{font-weight:700;color:var(--brick);font-variant-numeric:tabular-nums}
.slider.wide{margin:10px 2px 0}
.btns{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:8px}
.btns .inline{font-size:14px;font-weight:600}
.btns input[type=range]{flex:1;width:auto}
.btn{font:inherit;font-size:15px;border:1px solid var(--muted);background:#fff;color:var(--ink);border-radius:6px;padding:6px 14px;cursor:pointer;min-height:38px}
.btn:hover{background:#f3ebdd}
.btn.primary{background:var(--brick);border-color:var(--brick);color:#fff;font-weight:600}
.btn.primary:hover{background:var(--brick-dk)}
.presets{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:10px;font-size:14px}
.presets span{font-weight:600;color:var(--muted)}
.chip{font:inherit;font-size:14px;border:1px solid var(--line);background:#fff;border-radius:999px;padding:3px 10px;cursor:pointer;min-height:32px}
.chip:hover{border-color:var(--brick)}
.readout{font-size:14.5px;font-variant-numeric:tabular-nums}
.readout dl{display:grid;grid-template-columns:auto 1fr;gap:3px 12px;margin:0}
.readout dt{color:var(--muted)}
.readout dd{margin:0;font-weight:600;text-align:right}
.readout .big{font-size:22px;color:var(--brick)}
.readout .note{margin:8px 0 0;font-size:13.5px;color:var(--muted)}
.bar{display:flex;height:14px;border-radius:4px;overflow:hidden;border:1px solid var(--line);margin:8px 0 2px}
.bar span{display:block;height:100%}
.swatch{display:inline-block;width:12px;height:12px;border-radius:2px;margin-right:5px;vertical-align:-1px;border:1px solid #0003}
.notes summary{font-weight:700;color:var(--brick-dk);cursor:pointer}
.notes p{margin:8px 0;font-size:15px}
.small{font-size:13.5px;color:var(--muted)}
.levbtns{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0}
.levbtns .btn{min-width:54px;padding:6px 8px}
.levbtns .btn[aria-pressed="true"]{background:var(--brick);border-color:var(--brick);color:#fff}
.lines{margin:0;padding-left:22px;font-size:14px;max-height:220px;overflow:auto;font-variant-numeric:tabular-nums}
.lines li{margin:2px 0}
.lines .sw{display:inline-block;width:12px;height:12px;border-radius:2px;vertical-align:-1px;margin-right:4px;border:1px solid #0003}
.lines:empty::before{content:"None yet.";color:var(--muted);margin-left:-22px}
/* explainer level */
.levelbar{display:flex;flex-wrap:wrap;align-items:center;gap:4px 12px;margin:-4px 0 10px;font-size:14.5px}
.levelbar>span{font-weight:600;color:var(--muted)}
.levelbar .seg{margin:0}
.notes-row{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:4px 0;font-size:14px}
.notes-row span{font-weight:600;color:var(--muted)}
.chip[aria-pressed="true"]{background:var(--brick);border-color:var(--brick);color:#fff}
.btn[aria-pressed="true"].on{background:#f3ebdd}
.formula{font-family:Georgia,"Times New Roman",serif;font-size:17px;text-align:center;margin:4px 0!important}
.ex{margin:6px 0;padding-left:20px;font-size:15px}.ex li{margin:0 0 6px}
.reveal{margin:4px 0 0}.reveal summary{cursor:pointer;color:var(--brick);font-weight:600;font-size:14px}
.reveal p{background:#f6efe2;border-radius:4px;padding:6px 8px}
.guidecols{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;align-items:start}
.guide p,.guide li{font-size:15px}
.qs li{margin:0 0 8px}
.aside{background:#f6efe2;border-left:4px solid var(--brick);padding:8px 10px;border-radius:4px;font-size:14.5px}
.foot{margin-top:18px;font-size:13px;color:var(--muted);border-top:1px solid var(--line);padding-top:8px}
@media (max-width:1100px){.guidecols{grid-template-columns:1fr 1fr}.guidecols article:last-child{grid-column:1/-1}}
@media (max-width:900px){.layout{grid-template-columns:1fr}.guidecols{grid-template-columns:1fr}}
@media (max-width:560px){.app{padding:8px 10px 24px}.top h1{font-size:23px}.tabs button{font-size:14px;padding:6px 10px}}
@media print{.tabs,.stage,.side,.skip{display:none!important}.panel[hidden]{display:block!important}.panel:not(.guide){display:none!important}.guidecols{display:block}}
@media (max-width:560px){.hbar{grid-template-columns:118px 1fr}}

/* Site header and footer (School Launch nav and footer link row, as on every inner page). Own --sl- variables so the
   explorer's palette above is untouched; values from courses/shared/course.css. Not sticky here, to keep the canvas in view. */
.site-head,.site-foot{--sl-ground:#F5F0E6;--sl-ink:#1F1B16;--sl-muted:#5A5247;--sl-line:#D9CFBC;--sl-linen:#EDE4D3;--sl-forge:#8C3A1F;--sl-brass:#B08A3E;--sl-paper:#FFFDF8;
  --ground:var(--sl-ground);--ink:var(--sl-ink);--forge:var(--sl-forge);--brass:var(--sl-brass);--paper:var(--sl-paper);
  font-family:'Source Sans 3','Segoe UI',system-ui,-apple-system,sans-serif;color:var(--sl-ink);line-height:1.55}
.site-head .wrap,.site-foot .wrap{max-width:1120px;margin:0 auto;padding-inline:20px}
.site-head{background:var(--sl-ground);border-bottom:1px solid var(--sl-line)}
.site-head .wrap{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-block:12px;flex-wrap:wrap}
.site-head .brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--sl-ink)}
.site-head .brand span{font-family:'Cinzel','Trajan Pro',Georgia,serif;font-weight:700;font-size:22px;color:var(--sl-forge);letter-spacing:.03em}
.site-head .nav{display:flex;gap:4px;flex-wrap:wrap}
.site-head .nav a{text-decoration:none;color:var(--sl-ink);font-weight:600;font-size:15px;padding:8px 12px;border-radius:6px}
.site-head .nav a:hover{background:var(--sl-linen)}
.site-foot{border-top:1px solid var(--sl-line);padding-block:28px;background:var(--sl-ground);font-size:17px}
.site-foot a{color:var(--sl-forge)}
.site-foot .wrap{display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;align-items:baseline}
.site-foot .eyebrow{font-size:13px;letter-spacing:.14em;text-transform:uppercase;font-weight:700;color:var(--sl-muted)}
.site-foot .muted{color:var(--sl-muted)}
.site-foot p{margin:0}
.site-foot .foot-links{display:flex;flex-wrap:wrap;gap:4px 18px;margin:0 0 10px;padding:0;list-style:none;font-size:15px;font-weight:600}
.site-foot .foot-links a{text-decoration:none}
.site-foot .foot-links a:hover{text-decoration:underline}
.site-foot .foot-base{margin-top:24px;padding-top:20px;border-top:1px solid var(--sl-line)}
.site-foot .motto{font-family:'Source Serif 4',Georgia,'Times New Roman',serif;font-style:italic}
.site-foot .network{display:flex;flex-direction:column;gap:12px;width:100%}
.site-foot .network h2{margin:0}
.site-foot .network-list{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.site-foot .network-list li{display:flex;flex-direction:column;gap:2px;font-size:15px}
.site-foot .network-list a{font-family:'Source Serif 4',Georgia,'Times New Roman',serif;font-weight:600;font-size:18px}
.site-foot .network-list span{color:var(--sl-muted)}
.site-foot .sl-foot-line{font-size:15px}
.site-foot .sl-foot-legal{font-size:13px;margin-top:6px}
@media (max-width:700px){.site-foot .network-list{grid-template-columns:minmax(0,1fr);gap:12px}}
@media print{.site-head,.site-foot{display:none!important}}
.slider .sl-row{display:flex;justify-content:space-between;align-items:baseline;gap:8px;font-weight:600;font-size:14px}

/* ---- Number Grid Tic-Tac-Toe ---- */
:root{--p1:#1d5a8a;--p1bg:#dcebf7;--p2:#a2410c;--p2bg:#fbe2cd;--p3:#2c6a2c;--p3bg:#dcefd6;--given:#e9e0cf;--bad:#b3261e}
.gamewrap{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:18px;align-items:start}
.setup fieldset{border:0;margin:0 0 10px;padding:0}
.setup legend{font-weight:700;color:var(--brick-dk);margin-bottom:4px;font-size:16px}
.choices{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:6px}
.choice{display:flex;gap:8px;align-items:flex-start;border:1px solid var(--line);background:#fff;border-radius:8px;padding:8px 10px;cursor:pointer;font-size:14.5px}
.choice input{margin-top:3px}
.choice b{display:block;font-size:15px}
.choice span{color:var(--muted);font-size:13.5px}
.choice:has(input:checked){border-color:var(--brick);background:#fbf3e8}
.board-area{min-width:0}
.turnbar{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;margin:0 0 8px;font-size:16px;min-height:32px}
.turnbar .who{font-weight:700}
.mark{display:inline-block;width:1.1em;text-align:center;font-weight:700}
.t1{color:var(--p1)}.t2{color:var(--p2)}.t3{color:var(--p3)}
.board{max-width:620px;margin:0 auto}
.tt{display:grid;grid-template-columns:1fr 10fr;gap:0}
.hdr{display:grid;font-weight:700;color:var(--brick-dk);font-size:13px;text-align:center;align-items:center;background:#f1e8d8}
.hdr.cols{grid-template-columns:repeat(10,1fr);aspect-ratio:10/1}
.hdr.rows{grid-template-rows:repeat(10,1fr)}
.hdr .x{aspect-ratio:1/1;display:flex;align-items:center;justify-content:center}
.corner{display:flex;align-items:center;justify-content:center;font-weight:700;color:var(--muted);background:#f1e8d8;aspect-ratio:1/1}
.grid{position:relative;display:grid;grid-template-columns:repeat(10,1fr);border-top:2px solid var(--ink);border-left:2px solid var(--ink);background:#fff;user-select:none;-webkit-user-select:none}
.grid.r10{aspect-ratio:1/1}.grid.r12{aspect-ratio:10/12}
.cell{font:inherit;position:relative;margin:0;padding:0;min-width:0;border:0;border-right:1px solid #9c8b78;border-bottom:1px solid #9c8b78;background:#fff;color:var(--ink);font-size:clamp(11px,2.9vw,17px);font-weight:600;font-variant-numeric:tabular-nums;cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:1;touch-action:manipulation}
.cell:nth-child(10n){border-right:2px solid var(--ink)}
.grid .cell.lastrow{border-bottom:2px solid var(--ink)}
@media (hover:hover){.cell:not(.given):not([class*=" o"]):hover{background:#fbf3e8}}
.cell:focus-visible{outline:3px solid var(--focus);outline-offset:-3px;z-index:2}
.cell.given{background:var(--given);font-weight:800;cursor:default}
.cell.o1{background:var(--p1bg);color:var(--p1)}.cell.o2{background:var(--p2bg);color:var(--p2)}.cell.o3{background:var(--p3bg);color:var(--p3)}
.cell .sym{position:absolute;top:1px;left:2px;font-size:8px;line-height:1;opacity:.85}
.cell.used{box-shadow:inset 0 0 0 2px currentColor}
.cell.bad{outline:2px dashed var(--bad);outline-offset:-4px}
.cell.bad::after{content:"?";position:absolute;top:1px;right:3px;font-size:10px;color:var(--bad);font-weight:800}
.cell .fix{display:block;font-size:.72em;color:var(--bad);text-decoration:line-through;font-weight:600}
.cell.reveal{flex-direction:column;gap:1px}
.ov{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:1}
.ov line{stroke-width:4;stroke-linecap:round;opacity:.55}
.ov line.void{stroke-dasharray:2 7;opacity:.85}
.ov .l1{stroke:var(--p1)}.ov .l2{stroke:var(--p2)}.ov .l3{stroke:var(--p3)}
.scores{display:flex;flex-direction:column;gap:6px}
.pl{display:grid;grid-template-columns:auto 1fr auto;gap:4px 10px;align-items:center;border:1px solid var(--line);border-radius:8px;padding:6px 10px;background:#fff}
.pl.now{border-color:var(--brick);box-shadow:0 0 0 2px #e7c9b6}
.pl .nm{font-weight:700}
.pl .pts{font-weight:800;font-size:20px;font-variant-numeric:tabular-nums}
.tally{grid-column:1/-1;min-height:20px;display:flex;flex-wrap:wrap;gap:8px}
.tally svg{width:30px;height:20px}
.tally line{stroke:currentColor;stroke-width:2.4;stroke-linecap:round}
.tally .none{font-size:13px;color:var(--muted)}
.msg{min-height:1.5em;font-weight:600}
dialog{border:1px solid var(--line);border-radius:10px;padding:14px 16px;max-width:min(400px,95vw);background:var(--card);color:var(--ink)}
dialog::backdrop{background:#2a211b66}
dialog h2{margin:0 0 4px;font-size:19px;color:var(--brick-dk)}
dialog .q{margin:0 0 8px;font-size:15px}
.entry{font:inherit;font-size:26px;font-weight:700;width:100%;text-align:center;border:2px solid var(--muted);border-radius:8px;padding:4px 6px;min-height:48px;font-variant-numeric:tabular-nums}
.keypad{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:10px 0}
.keypad button{font:inherit;font-size:22px;font-weight:700;min-height:48px;border:1px solid var(--muted);border-radius:8px;background:#fff;cursor:pointer;color:var(--ink)}
.keypad button:hover{background:#f3ebdd}
.keypad .wide{grid-column:span 1}
.dlg-btns{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
.err{color:var(--bad);font-size:14px;min-height:1.3em;margin:4px 0 0}
.summary table{border-collapse:collapse;width:100%;font-size:14px;font-variant-numeric:tabular-nums}
.summary th,.summary td{border-bottom:1px solid var(--line);padding:4px 4px;text-align:right}
.summary th[scope=col]{font-size:13px;line-height:1.2;vertical-align:bottom}
.summary .tw{overflow-x:auto}
.summary th:first-child,.summary td:first-child{text-align:left}
.summary .win{font-size:18px;font-weight:800;color:var(--brick);margin:4px 0 8px}
.printlinks{display:flex;flex-direction:column;gap:4px;font-size:15px}
.credit{font-size:14px}
@media (max-width:900px){.gamewrap{grid-template-columns:1fr}}
@media (max-width:560px){.cell .sym{font-size:7px}.ov line{stroke-width:4}.choice{padding:6px 8px}}
@media print{.gamewrap .side,.turnbar,.setup{display:none!important}.board{max-width:none}}
