/* Sudoku Sets: the chalkboard look (locked, D75/D80). Own colours, system fonts only, no site theme. Layout C: lights column beside
   the board, two-row pad. Metrics (--B board px, --cs cell px, --g/--gh grip sizes, --tri, --ln lights width) are set by app.js. */
*{box-sizing:border-box}
html,body{margin:0;height:100%;overflow:hidden;background:#18302a;-webkit-text-size-adjust:100%}
body{overscroll-behavior:none}
[hidden]{display:none!important}
.app{--row:#ffe27a;--col:#ff9fb5;--box:#8fd3ff;--chalk:#f5f5ef;--dim:#e0ede7;--bd:#1f3a33;--ink2:#1f3a33;--pink:#ffb4c4;
 position:fixed;inset:0;overflow:hidden;color:var(--chalk);display:flex;flex-direction:column;gap:6px;
 padding:max(6px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));
 background-color:#1f3a33;background-image:radial-gradient(ellipse at 30% 15%,#2c5248 0,#1f3a33 62%,#18302a 100%);
 font-family:"Chalkboard SE","Segoe Print","Bradley Hand","Comic Sans MS",system-ui,sans-serif;font-size:16px;line-height:1.3;
 -webkit-tap-highlight-color:transparent;touch-action:manipulation;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.app::before{content:"";position:absolute;inset:0;pointer-events:none;opacity:.5;z-index:0;
 background:radial-gradient(ellipse at 72% 82%,#ffffff12,transparent 50%),radial-gradient(circle at 18% 68%,#ffffff0b,transparent 30%),
 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E")}
.app>*{position:relative;z-index:1}
.app button{font:inherit;color:inherit;background:none;border:0;padding:0;margin:0;cursor:pointer;-webkit-appearance:none;appearance:none;text-align:center;-webkit-touch-callout:none}
.app button:focus-visible,.cell:focus-visible{outline:3px solid var(--chalk);outline-offset:-3px;border-radius:8px}
.app .v{display:flex;align-items:center;justify-content:center;pointer-events:none}
/* header */
.hdr{display:flex;align-items:center;gap:6px;height:44px;flex:none}
.ttl{margin:0;font-size:1.35rem;font-weight:400;line-height:1;flex:1 1 auto;min-width:0;white-space:nowrap}
.ttl::after{content:"";display:block;height:3px;margin-top:3px;width:70%;background:repeating-linear-gradient(90deg,var(--chalk) 0 12px,transparent 12px 16px);opacity:.85}
.hbtn{height:44px;min-width:44px;padding:0 2px;flex:none}
.hbtn .v{height:36px;padding:0 10px;border:2px dashed var(--chalk);border-radius:10px;font-size:.95rem;white-space:nowrap}
.hbtn:active .v{background:var(--chalk);color:var(--ink2)}
.pop{position:absolute;right:6px;top:52px;z-index:20;background:#1b3029;border:2px solid var(--chalk);border-radius:12px;padding:4px;box-shadow:0 8px 20px #000a;max-height:calc(100% - 60px);overflow:auto;width:180px}
.pop button{display:block;width:100%;min-height:44px;text-align:left;padding:0 12px;border-radius:8px;font-size:1rem}
.pop button[aria-checked=true]{background:var(--chalk);color:var(--ink2)}
.pop hr{border:0;border-top:2px dashed #9fb8ae;margin:4px 6px}
.pop .pinfo{font-size:.8rem;color:var(--dim);padding:2px 12px 4px;margin:0;line-height:1.25}
.pop .lab{font-size:.8rem;color:var(--dim);padding:2px 12px;margin:0}
/* stage: grips + board + lights */
.stage{flex:none;display:grid;grid-template-columns:var(--g) var(--B) auto;grid-template-rows:var(--gh) var(--B);align-self:flex-start}
.colh{grid-column:2;grid-row:1;display:grid;grid-template-columns:repeat(9,1fr)}
.rowh{grid-column:1;grid-row:2;display:grid;grid-template-rows:repeat(9,1fr)}
.boardbox{grid-column:2;grid-row:2;position:relative;width:var(--B);height:var(--B)}
.grip{display:block;width:100%;height:100%;padding:0;position:relative;touch-action:none}
.grip::after{content:"";position:absolute}
.grip.hr::after{left:-6px;right:0;top:0;bottom:0}.grip.hc::after{top:-6px;left:0;right:0;bottom:0}
.grip .v{width:calc(100% - 4px);height:calc(100% - 4px);margin:2px;border:2px dashed #9fb8ae;border-radius:8px}
.hr .v{border-radius:8px 3px 3px 8px}.hc .v{border-radius:8px 8px 3px 3px}
.grip[aria-checked=true] .v{border-style:solid;border-color:var(--k);background:var(--k);box-shadow:0 0 10px var(--k)}
.hr{--k:var(--row)}.hc{--k:var(--col)}.hb{--k:var(--box)}
.board{position:absolute;inset:0;display:grid;grid-template-columns:repeat(9,1fr);grid-template-rows:repeat(9,1fr);gap:1px;background:#7f9b90;border:2px solid var(--chalk);border-radius:3px}
.cell{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;background-color:var(--bd);font-size:calc(var(--cs)*.6);line-height:1;cursor:pointer;overflow:hidden}
.cell.bt{border-top:2px solid var(--chalk)}.cell.bl{border-left:2px solid var(--chalk)}
.cell .d{font-weight:700;color:var(--chalk)}
.cell:not(.given) .d{font-weight:400;color:var(--row)}
.cell.bad .d{color:var(--pink);text-decoration:underline}
.cell .nt{display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);width:100%;height:100%;font-size:max(9px,calc(var(--cs)*.3));color:var(--dim);text-align:center;line-height:1}
.cell .nt i{font-style:normal;display:flex;align-items:center;justify-content:center}
.cell.cur{outline:3px dashed var(--chalk);outline-offset:-3px;z-index:2}
.cell.eqL{box-shadow:inset 0 0 0 3px #ff7a00}.cell.eqR{box-shadow:inset 0 0 0 3px #b79bff}
.cell.pr{animation:cellp .5s ease-in-out infinite;z-index:3;box-shadow:inset 0 0 0 3px var(--chalk),inset 0 0 12px var(--chalk)}
.cell.pl{box-shadow:inset 0 0 0 3px var(--chalk),inset 0 0 12px var(--chalk);animation:cellg .6s ease-in-out infinite}
@keyframes cellp{50%{transform:scale(1.18);box-shadow:inset 0 0 0 3px var(--chalk),inset 0 0 14px var(--chalk)}}
@keyframes cellg{50%{box-shadow:inset 0 0 0 3px var(--chalk),inset 0 0 22px var(--chalk)}}
.board.won{animation:wonb 1.2s ease-in-out 2}
@keyframes wonb{50%{box-shadow:0 0 22px 4px var(--chalk)}}
.ov{position:absolute;left:0;top:0;pointer-events:none;overflow:visible;z-index:3}
.ov .rg{fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;animation:glow 2.4s ease-in-out infinite alternate}
.ov .rg.draw{stroke-dasharray:1;stroke-dashoffset:1;animation:draw .7s ease-out forwards,glow 2.4s ease-in-out .7s infinite alternate}
@keyframes draw{to{stroke-dashoffset:0}}
@keyframes glow{from{filter:drop-shadow(0 0 2px currentColor)}to{filter:drop-shadow(0 0 7px currentColor)}}
.tris{position:absolute;inset:0;pointer-events:none;z-index:4}
.tri{position:absolute;width:var(--tri);height:var(--tri);pointer-events:auto;clip-path:polygon(100% 0,100% 100%,0 100%);padding:0;touch-action:manipulation;
 left:calc((var(--bc) + 1) * 3 * var(--cs) - var(--tri) - 2px);top:calc((var(--br) + 1) * 3 * var(--cs) - var(--tri) - 2px)}
.tri .v{width:100%;height:100%;background:#1f3a33;position:relative}
.tri .v::after{content:"";position:absolute;inset:0;background:var(--box);opacity:.5}
.tri[aria-checked=true] .v::after{opacity:1}
/* lights: the digits in the result */
.lights{grid-column:3;grid-row:2;display:grid;grid-template-rows:repeat(9,1fr);width:var(--ln);margin-left:4px}
.sd{display:block;height:100%;padding:0;position:relative}
.sd .v{width:calc(100% - 4px);height:calc(100% - 4px);margin:2px;border-radius:10px;border:2px solid #9fb8ae;color:var(--dim);font-size:1.05rem}
.sd.lit .v{background:var(--chalk);color:var(--ink2);border-color:var(--chalk);font-weight:700;box-shadow:0 0 10px #f5f5ef99}
.sd.cut .v{color:var(--pink);border:2px dashed var(--pink);text-decoration:line-through}
.sd.probe .v{outline:3px solid var(--chalk);outline-offset:1px}
.sd.shake .v{animation:shake .4s}
@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}
.popit .v,.ch.popit{animation:popit .45s cubic-bezier(.3,1.6,.5,1)}
@keyframes popit{0%{transform:scale(.5)}100%{transform:scale(1)}}
.ghost{position:absolute;z-index:30;pointer-events:none;font-weight:700;font-size:1.3rem;color:var(--row);text-shadow:0 0 8px var(--row);left:0;top:0}
/* below the board */
.below{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;gap:6px}
.info{flex:none;display:flex;align-items:center;gap:8px;height:44px;overflow:hidden}
.fm{flex:1 1 auto;min-width:0;font-size:.9rem;line-height:1.1;max-height:44px;overflow:hidden}
.tgl{height:44px;flex:none}
.tgl .v{height:40px;padding:0 10px;border:2px dashed var(--chalk);border-radius:10px;font-size:.92rem;white-space:nowrap;line-height:1}
.tgl[aria-pressed=true] .v,.acts button[aria-pressed=true] .v{background:var(--chalk);color:var(--ink2);border-style:solid}
.pad{display:grid;grid-template-columns:repeat(5,1fr);flex:1 1 104px;min-height:96px;max-height:150px}
.key{display:block;height:100%;padding:0}
.key .v{width:calc(100% - 4px);height:calc(100% - 4px);margin:2px;border:2px solid var(--chalk);border-radius:8px;font-size:1.5rem}
.key:active .v{background:var(--chalk);color:var(--ink2)}
.key.er .v{font-size:1rem;border-style:dashed}
.acts{flex:none;display:flex;gap:6px;height:44px}
.acts button{flex:1 1 0;height:44px;min-width:0}
.acts .v{height:40px;border:2px dashed var(--chalk);border-radius:10px;font-size:.95rem;width:100%}
.acts button:active .v{background:var(--chalk);color:var(--ink2)}
.acts .erase{display:none}
.how{display:none;margin:0;font-size:.95rem;color:var(--dim);line-height:1.35}
/* Venn: badge (counts) in the header, full Venn (digits) in the overlay over the board */
.venn{position:relative;flex:none;width:var(--vw,68px);height:var(--vh,44px)}
.venn .ec{position:absolute;top:0;height:var(--ch,44px);border-radius:50%;border:3px solid var(--k);background:color-mix(in srgb,var(--k) 12%,transparent);pointer-events:none}
.venn .ea{left:0;width:64%;--k:var(--ka,#9fb8ae)}.venn .eb{right:0;width:64%;--k:var(--kb,#9fb8ae)}
.venn .z{position:absolute;top:0;height:var(--ch,44px);display:flex;flex-wrap:wrap;gap:2px;align-items:center;justify-content:center;align-content:center;font-size:var(--vf,.8rem);pointer-events:none}
.venn .za{left:6%;width:28%}.venn .zi{left:36%;width:28%}.venn .zb{right:6%;width:28%}
.venn .z .n{font-weight:700}
.venn.badge{height:44px;width:68px}
.venn.big{width:100%;height:var(--vh,150px);--ch:calc(var(--vh,150px) - 30px)}
.venn.big .z{pointer-events:auto}
.venn.big .z:active{background:#ffffff1f}
.venn.big .zo{left:0;right:0;top:auto;bottom:0;height:26px;width:auto;gap:3px}
.venn .nl{font-size:.8rem;color:var(--dim);margin-right:4px}
.venn .ch{display:inline-flex;align-items:center;justify-content:center;min-width:1.45em;height:1.45em;border-radius:50%;border:1.5px solid transparent;color:var(--chalk);font-weight:700}
.venn .ch.lit{background:var(--chalk);color:var(--ink2);box-shadow:0 0 8px #f5f5ef99}
.venn .ch.cut{color:var(--pink);border:1.5px dashed var(--pink)}
.vbig{position:absolute;inset:0;z-index:12;display:flex;flex-direction:column;justify-content:center;gap:8px;padding:8px;background:#1b3029f5;border:2px solid var(--chalk);border-radius:6px}
.vbig .cap{margin:0;font-size:.85rem;color:var(--dim);line-height:1.3}
.wincard{position:absolute;left:8%;right:8%;top:32%;z-index:14;background:#1b3029;border:3px solid var(--chalk);border-radius:12px;padding:12px;text-align:center;box-shadow:0 8px 24px #000a;display:flex;flex-direction:column;gap:10px}
.wincard b{font-weight:400;font-size:1.1rem;line-height:1.25}
.wincard .wb{display:flex;gap:6px;justify-content:center}
.wincard .wb button{flex:1 1 0;height:44px}
.wincard .wb .v{height:40px;border:2px dashed var(--chalk);border-radius:10px;font-size:.9rem;width:100%}
/* advanced (hidden) rows live in the menu */
.pop .adv button{min-height:44px;font-size:.9rem}
/* wide: board left, everything else in a right-hand column */
.app.wide{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:56px minmax(0,1fr);column-gap:18px;row-gap:8px;
 padding:max(12px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left))}
.wide .hdr{grid-column:1/3;height:56px}
.wide .ttl{font-size:1.9rem}
.wide .venn.badge{width:96px;height:58px}
.wide .stage{grid-column:1;grid-row:2}
.wide .below{grid-column:2;grid-row:2;gap:12px;max-width:560px;justify-content:flex-start}
.wide .how{display:block}
.wide .info{height:50px}.wide .fm{font-size:1.1rem;max-height:50px}
.wide .pad{grid-template-columns:repeat(3,1fr);flex:1 1 auto;max-height:290px;min-height:150px}
.wide .key.er{display:none}
.wide .key .v{font-size:2rem;border-radius:12px}
.wide .acts{height:50px}.wide .acts button{height:50px}.wide .acts .v{height:46px;font-size:1.05rem}
.wide .acts .erase{display:flex}
.wide .pop{top:64px}
.wide .wincard{top:36%}
@media(max-height:640px){.wide .how{display:none}.wide .below{gap:8px}.wide .pad{min-height:120px}}
@media(prefers-reduced-motion:reduce){
 .ov .rg,.ov .rg.draw{animation:none;stroke-dashoffset:0}
 .cell.pr,.cell.pl{animation:none}
 .popit .v,.ch.popit,.sd.shake .v,.board.won{animation:none}
}
body[data-motion=reduced] .ov .rg,body[data-motion=reduced] .ov .rg.draw{animation:none;stroke-dashoffset:0}
body[data-motion=reduced] .cell.pr,body[data-motion=reduced] .cell.pl,body[data-motion=reduced] .board.won{animation:none}
body[data-motion=reduced] .popit .v,body[data-motion=reduced] .ch.popit,body[data-motion=reduced] .sd.shake .v{animation:none}
/* the site's floating feedback button overlaps the board and pad on phones: hide it; Feedback lives in the top menu (#fbk clicks it) */
#af-feedback-root #af-open{display:none!important}
