/* Handeware web kit, Word Grid's copy (from arcade-web/_kit/kit.css),
   recoloured light: cards, pills, rows, toggles, toasts, the Arcade link.
   No web fonts: system type only. */
:root{
  --paper:#F3F5F8;--panel:#FFFFFF;--ink:#16202B;--ink-soft:#4F5D6C;--ink-dim:#7A8796;--hair:#D5DCE4;
  --accent:#2F6FDE;--accent-hi:#5B90EE;--accent-lo:#1F55B8;--good:#1F8A55;--bad:#C8382C;
  --sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  color-scheme:light;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{font:18px/1.45 var(--sans);color:var(--ink);background:var(--paper);-webkit-tap-highlight-color:transparent;overflow:hidden}
button{font:inherit;color:inherit;cursor:pointer}
[hidden]{display:none!important}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.screen{position:absolute;inset:0;display:flex;flex-direction:column}

.pill{border:0;border-radius:999px;padding:.7em 2.2em;font-weight:800;font-size:1.15em;color:#fff;min-height:48px;
  background:linear-gradient(180deg,var(--accent-hi),var(--accent));box-shadow:0 3px 0 var(--accent-lo),0 8px 18px rgba(31,85,184,.25)}
.pill:active{transform:translateY(2px);box-shadow:0 1px 0 var(--accent-lo),0 4px 10px rgba(31,85,184,.2)}
.pill.soft{background:var(--panel);color:var(--accent);box-shadow:0 0 0 2px var(--accent) inset}
.link{background:none;border:0;color:var(--accent);text-decoration:underline;text-underline-offset:.2em;padding:.4em .6em;min-height:44px}
.pill:focus-visible,.link:focus-visible,.choice:focus-visible,.row:focus-visible,.toggle:focus-visible,.x:focus-visible{outline:3px solid var(--accent-hi);outline-offset:3px}

.veil{position:fixed;inset:0;background:rgba(22,32,43,.42);display:grid;place-items:center;z-index:20;padding:.8em}
.card{background:var(--panel);border:1px solid var(--hair);border-radius:1.2em;box-shadow:0 20px 50px rgba(22,32,43,.25);
  width:min(26em,100%);max-height:calc(100% - .4em);overflow:auto;padding:1.3em 1.3em 1.1em;position:relative;animation:pop .18s ease-out}
@keyframes pop{from{transform:scale(.94);opacity:0}}
.card h2{font:800 1.5em/1.1 var(--sans);color:var(--ink);text-align:center;margin:0 0 .6em}
.card p{margin:.3em 0}
.card .x{position:absolute;right:.5em;top:.5em;width:44px;height:44px;border-radius:50%;border:0;background:none;display:grid;place-items:center}
.card .x svg{width:1.1em;height:1.1em;fill:none;stroke:var(--ink-soft);stroke-width:2.2;stroke-linecap:round}
.card .actions{display:flex;flex-direction:column;align-items:center;gap:.4em;margin-top:1em}
.rows{display:flex;flex-direction:column;gap:.5em}
.row{display:flex;align-items:center;justify-content:space-between;gap:1em;padding:.6em .9em;min-height:48px;border-radius:.8em;background:var(--paper);border:1px solid var(--hair);width:100%;text-align:left}
.row b{font-weight:700}
.row small{display:block;color:var(--ink-soft);font-size:.8em}
.choices{display:flex;gap:.4em;flex-wrap:wrap;justify-content:center}
.choice{border:1px solid var(--hair);background:var(--panel);border-radius:.7em;padding:.5em .8em;min-height:44px;color:var(--ink)}
.choice[aria-pressed=true]{background:var(--accent);color:#fff;border-color:var(--accent);font-weight:700}
.toggle{width:3em;height:1.7em;border-radius:999px;border:1px solid var(--hair);background:#DDE3EA;position:relative;flex:none;padding:0}
.toggle::after{content:"";position:absolute;top:.15em;left:.15em;width:1.3em;height:1.3em;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:left .2s}
.toggle[aria-pressed=true]{background:var(--accent)}
.toggle[aria-pressed=true]::after{left:1.5em}
.stats{display:flex;justify-content:center;gap:1.4em;margin:.2em 0 .6em;color:var(--ink-soft);text-align:center;font-size:.85em}
.stats b{display:block;color:var(--ink);font:800 1.6em/1.1 var(--sans)}
.note{color:var(--ink-soft);font-size:.9em;text-align:center}
.toast{position:fixed;left:50%;bottom:5em;transform:translateX(-50%);background:var(--ink);color:#fff;border-radius:999px;padding:.6em 1.2em;z-index:30;white-space:nowrap}
.apps{display:flex;gap:.6em;justify-content:center;flex-wrap:wrap}
.store-badge{display:inline-flex;height:52px;align-items:center}
.store-badge img{height:52px;width:auto;display:block}
.foot{font-size:.72em;color:var(--ink-dim);text-align:center}
.foot a{color:var(--ink-soft)}
@media (max-width:420px){body{font-size:16px}}
@media (min-width:700px) and (min-height:700px) and (pointer:coarse){body{font-size:21px}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* Handeware web-game shell v1: the way back to the arcade, the same in every
   game. Shown only while the game's home screen is (#home without [hidden]). */
.hw-arcade{display:none;position:fixed;z-index:50;top:max(10px,env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));align-items:center;gap:6px;min-height:44px;padding:0 16px 0 12px;border-radius:999px;background:rgba(255,255,255,.94);color:#121417;font:700 17px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;text-decoration:none;box-shadow:0 2px 10px rgba(0,0,0,.18)}
.hw-arcade:hover{background:#fff}
.hw-arcade svg{width:18px;height:18px;flex:none}
body:has(#home:not([hidden])) .hw-arcade{display:inline-flex}
@media (max-width:760px){html:not(.hw-embed) body:has(#home:not([hidden])) #home{padding-top:max(64px,calc(env(safe-area-inset-top) + 58px))!important}}
html.hw-embed .hw-arcade{display:none!important}

/* hw-nav v3 (owner, 2026-10-28: "consistent nav layer on the games"). The way
   back to the arcade shows on every screen that is not play: the home screen and
   any card (pause, result, how to play, settings, stats). During play it hides so
   it never covers the board; Pause is always one tap away. In the console it
   never shows: the console's Close is the way back. Cards fit a short screen,
   rows in two columns, so no button ever hides below the fold. */
html:not(.hw-embed) body:has(> .veil) .hw-arcade{display:inline-flex;z-index:21}
@media (max-width:760px){html:not(.hw-embed) body:has(> .veil) .veil{padding-top:max(64px,calc(env(safe-area-inset-top) + 58px))}}
@media (max-height:480px){
  html:not(.hw-embed) .veil{padding:.4em .5em .4em max(136px,calc(env(safe-area-inset-left) + 126px))}
  html.hw-embed .veil{padding:.4em}
  .card{padding:.8em 1em .7em;max-height:calc(100% - .2em)}
  .card h2{margin:0 0 .4em;font-size:1.3em}
  .card:has(.row ~ .row ~ .row){width:min(40em,100%)}
  .card:has(> .row ~ .row ~ .row), .card :not(.row):has(> .row ~ .row ~ .row){display:grid;grid-template-columns:1fr 1fr;gap:.4em .6em;align-content:start}
  .card:has(> .row ~ .row ~ .row) > :not(.row){grid-column:1/-1}
  .card .row{padding:.5em .7em;min-height:44px}
  .card .row small{display:none}
  .card .actions{margin-top:.5em;flex-direction:row;flex-wrap:wrap;justify-content:center}
}
/* A card's own buttons stay in view on any screen: a long how-to scrolls under them. */
.card .actions{position:sticky;bottom:-1.2em;z-index:1;padding:.5em 0 .6em;background:inherit}
html.hw-embed .hw-arcade{display:none!important}
/* /hw-nav v3 */
