/* ws.css — page layer for /word-search-maker/. The shell (header, controls, buttons,
   explainer, footer) is /assets/polyatic.css; this file adds the cutting-mat stage with
   the printed sheet on it, as on /gift-tag-maker/. The sheet is paper-white in both
   themes: it is an object on the mat. */
.ws-noscript{margin:1rem;padding:.875rem 1rem;border:1px solid var(--line);border-left:.25rem solid var(--accent);border-radius:.625rem;background:var(--surface)}
.ws-head h1{margin-bottom:.25rem}
.ws-head .sub{margin-bottom:.875rem}

/* ---------- the stage ---------- */
.duo.ws-duo>.pane-result{position:static}
.ws-stage{background:radial-gradient(120% 80% at 50% 0%,rgba(255,196,120,.16),transparent 60%),linear-gradient(180deg,var(--mat),var(--mat-2));
  color:var(--mat-ink);border-radius:var(--r);padding:.75rem .875rem 1rem;box-shadow:var(--shadow);min-width:0}
.ws-stage-h{font-family:var(--mono);font-size:.6875rem;font-weight:500;text-transform:uppercase;letter-spacing:.07em;color:var(--mat-muted);margin:0 0 .5rem;text-align:center}
.ws-tabs{display:flex;justify-content:center;gap:.375rem;margin:0 auto .625rem}
.ws-tabs button{border:1px solid rgba(255,255,255,.3);background:transparent;color:var(--mat-ink);border-radius:999px;padding:.3125rem .875rem;min-height:2.125rem;font:inherit;font-size:.8125rem;font-weight:600;cursor:pointer}
.ws-tabs button.active{background:var(--mat-ink);color:var(--mat);border-color:var(--mat-ink)}
.ws-tabs button:focus-visible{outline:2px solid var(--signal);outline-offset:2px}
.ws-paper{max-width:30rem;margin:0 auto;line-height:0}
.ws-paper canvas{display:block;width:100%;height:auto;background:#fff;border-radius:2px;
  box-shadow:0 1px 0 rgba(0,0,0,.1),0 18px 40px -16px rgba(0,0,0,.6)}
.ws-summary{margin:.625rem 0;text-align:center;font-size:.875rem;color:var(--mat-ink)}
.ws-summary b{color:#fff}
.ws-notes{max-width:30rem;margin:0 auto .625rem}
.ws-notes:empty{display:none}
.ws-note{margin:0 0 .5rem;padding:.625rem .75rem;border-radius:.5rem;font-size:.8125rem;line-height:1.45;background:rgba(255,255,255,.08);border-left:.1875rem solid var(--mat-muted)}
.ws-note.warn{background:rgba(255,190,90,.14);border-left-color:#f2c94c}
.ws-note b{color:#fff}
.ws-note .btn{margin-top:.5rem;min-height:2.25rem;padding:.375rem .875rem;font-size:.8125rem}
.ws-dl{display:flex;flex-wrap:wrap;gap:.5rem;max-width:30rem;margin:0 auto}
.ws-dl .btn{flex:1 1 9rem}
.ws-dl #pdfBtn{flex-basis:100%}
.ws-dl #pdfBtn small{font-weight:500;opacity:.8;margin-left:.375rem}
.ws-dl .btn:disabled{opacity:.6;cursor:progress}
.ws-stage .btn.ghost{color:var(--mat-ink);border-color:rgba(255,255,255,.4);background:transparent}
.ws-msg{margin:.5rem 0 0;text-align:center;font-size:.8125rem;color:var(--mat-muted)}
.ws-msg:empty{display:none}

/* ---------- the form ---------- */
.ws-form-h{margin:0 0 .75rem;font-size:1.1875rem}
.ws-hint{margin:.375rem 0 0;font-size:.8125rem;color:var(--muted);line-height:1.45}
.ws-form textarea{min-height:10rem;resize:vertical;line-height:1.45}
.ws-form .modes button small{display:block;font-weight:500;font-size:.6875rem;opacity:.8}
.ws-row{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem .75rem}
.ws-row .ws-hint{margin:0}

@media(min-width:920px){
  .duo.ws-duo{grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);grid-template-areas:none}
  .duo.ws-duo>.pane-result,.duo.ws-duo>.pane-main{grid-area:auto}
  .ws-stage{position:sticky;top:1rem}
}
.ws-starters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
@media(min-width:520px){.ws-starters{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* ---------- share to play ---------- */
.ws-dl #shareBtn{flex-basis:100%}
.ws-share{max-width:30rem;margin:.625rem auto 0;padding:.625rem .75rem;border-radius:.5rem;background:rgba(255,255,255,.08);border-left:.1875rem solid var(--signal)}
.ws-share-msg{margin:0 0 .375rem;font-weight:600;font-size:.875rem}
.ws-share input{width:100%;box-sizing:border-box;font-family:var(--mono);font-size:.75rem}
.ws-share-hint{margin:.375rem 0 0;font-size:.8125rem;line-height:1.45;color:var(--mat-muted)}
.ws-share a{color:var(--mat-ink)}

/* ---------- play mode (a #p= link): the paper sheet becomes a board you drag across ---------- */
.ws-duo[hidden],.ws-play[hidden]{display:none}
.ws-play{display:grid;gap:1rem;align-items:start}
.ws-play-board{padding:.625rem .625rem .875rem}
.ws-play-bar{display:flex;justify-content:space-between;align-items:baseline;max-width:34rem;margin:0 auto .5rem;font-family:var(--mono);font-size:.8125rem;color:var(--mat-muted)}
.ws-timer{font-variant-numeric:tabular-nums;font-size:1rem;font-weight:600;color:var(--mat-ink)}
.ws-board{position:relative;max-width:34rem;margin:0 auto;aspect-ratio:1/1;background:#fff;border-radius:3px;
  box-shadow:0 1px 0 rgba(0,0,0,.1),0 18px 40px -16px rgba(0,0,0,.6);
  touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;container-type:inline-size;cursor:crosshair}
.ws-board:focus{outline:none}
.ws-board:focus-visible{outline:2px solid var(--signal);outline-offset:3px}
.ws-cells{position:absolute;inset:2%;display:grid;grid-template-columns:repeat(var(--n,12),1fr);grid-template-rows:repeat(var(--n,12),1fr)}
.ws-cells span{display:flex;align-items:center;justify-content:center;font-family:var(--sans);font-weight:600;line-height:1;color:#1b1d1c;
  font-size:calc(96cqi / var(--n,12) * .56)}
.ws-cells span.msg{color:#1d6b3f;font-weight:800}
.ws-lines{position:absolute;inset:2%;width:96%;height:96%;pointer-events:none;overflow:visible}
.ws-lines line{stroke-linecap:round;stroke-width:.76;fill:none}
.ws-lines .sel{stroke:#9cc41e;stroke-opacity:.5}
.ws-lines .miss{stroke:#d23b3f;stroke-opacity:.3;transition:stroke-opacity .45s ease-out}
.ws-lines .miss.gone{stroke-opacity:0}
.ws-lines .hit{stroke-opacity:.4}
.ws-lines .c0{stroke:#e5484d}.ws-lines .c1{stroke:#ef8f4a}.ws-lines .c2{stroke:#e0b32a}.ws-lines .c3{stroke:#3aa564}.ws-lines .c4{stroke:#3b82c4}
.ws-lines .ans{stroke:#5a5f5b;stroke-opacity:.25}
.ws-lines .cur{fill:none;stroke:#111312;stroke-width:.07}
.ws-board-help{max-width:34rem;margin:.5rem auto 0;font-size:.8125rem;line-height:1.45;color:var(--mat-muted);text-align:center}
.ws-wordlist{list-style:none;margin:0 0 1rem;padding:0;columns:2 8rem;column-gap:1rem}
.ws-wordlist li{padding:.1875rem 0;font-weight:600;break-inside:avoid}
.ws-wordlist li.found{text-decoration:line-through;text-decoration-thickness:2px;color:var(--muted)}
.ws-wordlist li.shown{color:var(--muted);font-weight:500;font-style:italic}
/* picture clues (pictures.js): one card per word, the drawing crossed out when its word is found */
.ws-wordlist.pics{columns:auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(4.75rem,1fr));gap:.5rem}
.ws-wordlist.pics li{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.125rem;min-height:4.75rem;padding:.375rem;border:1px solid var(--line);border-radius:.625rem;background:var(--surface);text-align:center;font-size:.875rem;text-transform:uppercase}
.ws-pic{width:3rem;height:3rem;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.ws-wordlist.pics li.found{text-decoration:none}
.ws-wordlist.pics li.found .ws-pic{opacity:.35}
.ws-wordlist.pics li.found::after{content:"";position:absolute;inset:.5rem;background:linear-gradient(to top right,transparent calc(50% - 2px),var(--signal) calc(50% - 2px),var(--signal) calc(50% + 2px),transparent calc(50% + 2px))}
.ws-wordlist.pics li.shown .ws-pic{opacity:.5}
.ws-clues .ws-group{gap:.375rem;margin-top:.75rem}
.ws-clues .ws-hint{margin:.5rem 0 0}
.ws-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
.ws-play-btns .btn{flex:1 1 9rem}
.ws-finish{margin:0 0 1rem;padding:.75rem 1rem;border-radius:.625rem;background:var(--surface-2);border-left:.25rem solid var(--signal)}
.ws-finish:focus{outline:none}
.ws-finish-h{margin:0 0 .25rem;font-weight:700;font-size:1.0625rem}
.ws-finish-msg{margin:0;line-height:1.5}
.ws-finish-msg b{display:inline-block;margin-top:.25rem;font-family:var(--mono);font-size:1.0625rem;letter-spacing:.04em;text-transform:uppercase}
@media(min-width:920px){.ws-play{grid-template-columns:minmax(0,1.3fr) minmax(0,.7fr)}.ws-play-board{position:sticky;top:1rem}}
@media(prefers-reduced-motion:reduce){.ws-lines .miss{transition:none}}

/* ---------- puzzle book ---------- */
.ws-group{display:grid;gap:1.25rem}
.ws-group[hidden],.ws-tabs[hidden],.ws-dl .btn[hidden]{display:none}
.ws-mode button small{display:block;font-weight:500;font-size:.6875rem;opacity:.8}
.ws-themes-field{border:0;margin:0;padding:0;min-width:0}
.ws-themes-field legend{display:flex;justify-content:space-between;width:100%;padding:0;margin-bottom:.5rem}
.ws-themes{display:grid;grid-template-columns:repeat(auto-fill,minmax(11rem,1fr));gap:.5rem .875rem;margin-bottom:.625rem}
.ws-themes label.check{font-size:.875rem}
.ws-small{min-height:2.25rem;padding:.375rem .875rem;font-size:.8125rem}
.ws-levels{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
.ws-levels button:last-child{grid-column:1/-1}
@media(min-width:620px){.ws-levels{grid-template-columns:repeat(5,minmax(0,1fr))}.ws-levels button:last-child{grid-column:auto}}
.ws-progress{display:block;width:100%;max-width:30rem;height:.5rem;margin:.625rem auto 0;accent-color:var(--signal)}
.ws-progress[hidden]{display:none}

/* ---------- word scramble ---------- */
.ws-mode{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
.ws-scr-levels{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
.ws-scr-levels button small{display:block;font-weight:500;font-size:.6875rem;opacity:.8}
#scrCluesField[hidden]{display:none}
.ws-scr-clues{display:grid;gap:.5rem;margin-top:.625rem}
.ws-scr-clues:empty{display:none}
.ws-scr-clue{display:grid;grid-template-columns:minmax(5.5rem,auto) minmax(0,1fr);gap:.5rem;align-items:center}
.ws-scr-clue span{font-size:.8125rem;font-weight:600;overflow-wrap:anywhere}
.ws-scr-clue input{min-width:0}

/* ---------- seasonal section (#hanukkah): two ready puzzles, loaded into the maker ---------- */
.ws-season{margin:1.5rem 0}
.ws-season h2{margin:0 0 .375rem}
.ws-season p{margin:0 0 .875rem;color:var(--muted);max-width:44rem}
.ws-season-btns{display:grid;gap:.625rem}
@media(min-width:600px){.ws-season-btns{grid-template-columns:repeat(2,minmax(0,1fr))}}
.ws-season-btns .btn{height:auto;min-height:3.25rem;padding:.625rem 1rem;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;text-align:left;gap:.125rem}
.ws-season-btns .btn small{font-weight:400;font-size:.78125rem;opacity:.85}
