@font-face{font-family:Prata;src:url(fonts/Prata-Regular.woff2) format("woff2");font-display:swap}
@font-face{font-family:Jost;src:url(fonts/Jost-Regular.woff2) format("woff2");font-weight:400;font-display:swap}
@font-face{font-family:Jost;src:url(fonts/Jost-Medium.woff2) format("woff2");font-weight:500;font-display:swap}

/* Walk (public/_games/shared/walk.js). The board is in the game's colour; the walk is drawn in bone over it. */
:root{
  --ground:#12110e;
  --fg:rgb(244 241 234);
  --soft:rgb(244 241 234 / .62);
  --hair:rgb(244 241 234 / .22);
  --n:6;
  --size:min(calc(100vw - 32px),calc(100svh - 284px),600px);
  --frame:min(calc(100vw - 32px),max(300px,var(--size)));
  --walk-board:var(--board,#8e6d50);
}
*{box-sizing:border-box;margin:0}
[hidden]{display:none!important}
html,body{height:100%}
html{background:var(--ground);color-scheme:dark;-webkit-text-size-adjust:100%;overscroll-behavior:none}
body{
  background:var(--ground);color:var(--fg);
  font:400 17px/1.45 Jost,system-ui,sans-serif;
  -webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent;
  padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overscroll-behavior:none;
}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;touch-action:manipulation;-webkit-user-select:none;user-select:none}
button:focus-visible{outline:2px solid var(--fg);outline-offset:2px}
h1,h2{font-family:Prata,Georgia,serif;font-weight:400}

.play{height:calc(100svh - env(safe-area-inset-top) - env(safe-area-inset-bottom));display:grid;grid-template-rows:40px 22px auto minmax(138px,1fr);justify-items:center;align-content:start;padding:12px 16px 16px;gap:12px}
.bar,.foot{width:var(--frame);min-width:0}
.play.solo .stats{width:var(--frame);min-width:0}
.bar{display:flex;justify-content:space-between;align-items:baseline}
.bar h1{font-size:30px;line-height:1}
.quiet{color:var(--soft);font-size:15px;min-height:44px;padding:0 4px}
.quiet:disabled{opacity:.35;cursor:default}

.board{
  position:relative;width:var(--size);aspect-ratio:1;border-radius:18px;overflow:hidden;
  display:grid;grid-template-columns:repeat(var(--n),1fr);
  background:linear-gradient(rgb(255 255 255 / .04),rgb(0 0 0 / .1)),var(--walk-board);
  box-shadow:inset 0 0 0 1px rgb(255 255 255 / .08),0 14px 34px rgb(0 0 0 / .32);
  touch-action:none;-webkit-touch-callout:none;cursor:crosshair;-webkit-user-select:none;user-select:none;
}
/* Open borders are faint; walls are solid. Only the player's route is a connecting line. */
.board{border-radius:12px;background:var(--walk-board);box-shadow:none}
.board svg{position:absolute;inset:0;width:100%;height:100%}
.cells rect{fill:transparent}
.cells rect.on{fill:rgb(244 241 234 / .10)}
.gridlines line{stroke:rgb(20 18 15 / .16);stroke-width:.012}
.walls line{stroke:#24211e;stroke-width:.075;stroke-linecap:round}
.markers .start,.markers .here{fill:#eee7d6}
.markers .ring{fill:none;stroke:#eee7d6;stroke-width:.055}
.trail polyline{fill:none;stroke:#eee7d6;stroke-width:.12;stroke-linecap:round;stroke-linejoin:round}
.board.done .cells rect{fill:rgb(244 241 234 / .16)}



.foot{display:grid;grid-template-rows:50px 40px minmax(46px,1fr);gap:0;height:100%;min-height:0}
.foot .controls{align-self:end;margin:0;min-height:46px}
.status{font-size:17px;height:50px}
.note{font-size:14px;color:var(--soft);height:40px}
.controls{display:flex;justify-content:space-between;align-items:center;margin-top:6px}
.btn{min-height:46px;padding:0 22px;border-radius:999px;border:1px solid rgb(244 241 234 / .2);font-weight:500}
.btn.solid{background:var(--fg);color:var(--ground);border-color:var(--fg)}

dialog{margin:auto;width:min(92vw,520px);max-height:88dvh;padding:26px;background:rgb(28 26 22 / .97);color:var(--fg);border:1px solid rgb(244 241 234 / .08);border-radius:28px;box-shadow:0 40px 80px -30px rgb(0 0 0 / .8)}
dialog::backdrop{background:rgb(8 7 6 / .55);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
dialog h2{font-size:34px;line-height:1}
/* The rules sheet matches Words and Doubles: a lede, then the rules between hairlines, with small squares as examples. */
dialog .lede{font-size:19px;margin:8px 0 16px}
.rule-list{padding:0 0 0 1.2em;border-top:1px solid var(--hair);margin-bottom:14px}
.rule-list li{padding:9px 0 9px 4px;border-bottom:1px solid var(--hair)}
.eg{display:inline-block;width:30px;height:22px;margin-right:6px;vertical-align:-5px}
.eg line{stroke:var(--fg);stroke-width:2;stroke-linecap:round;opacity:.55}
.eg circle{fill:var(--fg)}
.eg .ring{fill:none;stroke:var(--fg);stroke-width:1.6;opacity:1}
.others{color:var(--soft);font-size:15px;margin-bottom:18px}
dialog .btn{width:100%;margin-top:6px}
.grid{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;margin:10px 0 16px}
.grid button{aspect-ratio:1;border-radius:12px;border:1px solid rgb(244 241 234 / .14);font-variant-numeric:tabular-nums;font-size:15px}
.grid button.solved{background:rgb(244 241 234 / .12)}
.grid button.here{border-color:var(--fg)}
.grid button:disabled{opacity:.3;cursor:default}
.grid .size{grid-column:1/-1;font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:var(--soft);margin-top:6px}

@media (hover:hover) and (pointer:fine){.quiet:hover{color:var(--fg)}.btn.solid:hover{background:rgb(244 241 234 / .92)}.grid button:not(:disabled):hover{border-color:var(--soft)}}
.btn:active,.quiet:active{transform:scale(.97)}

/* A short landscape screen keeps the controls beside the board. */
@media (max-height:500px) and (min-width:600px){
  :root{--size:min(calc(100svh - 98px),calc(50vw - 32px))}
  .play{grid-template-columns:var(--size) minmax(220px,320px);grid-template-rows:40px 22px 1fr;column-gap:24px;justify-content:center}
  .bar{grid-column:1 / -1;width:100%}
  .solo .stats{grid-column:1;grid-row:2;min-width:0}
  .board{grid-column:1;grid-row:3}
  .foot{grid-column:2;grid-row:2 / 4;width:100%}
}

.walk-progress{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:18px 0 8px;font-size:14px;color:var(--soft)}
.walk-progress .earned{color:var(--fg)}

.hint-link{stroke:var(--white,#eee7d6);stroke-width:.09;stroke-dasharray:.12 .08;stroke-linecap:round}
.hint-cross{stroke:#eee7d6;stroke-width:.07;fill:none;stroke-linecap:round}
.hint-focus{stroke:#eee7d6;stroke-width:.035;fill:none;stroke-dasharray:.06 .04}
#hint-sheet .hint-preview{display:block;width:min(100%,220px,30svh);height:auto;aspect-ratio:1;margin:16px auto;pointer-events:none}
#hint-sheet .hint-preview svg{width:100%;height:100%}

#hint-title:focus{outline:none}
#hint-sheet .others{margin-bottom:12px}
