@font-face{font-family:"Bricolage Grotesque";font-weight:700;font-style:normal;font-display:swap;src:url(../fonts/bricolage-grotesque-latin-700-normal.woff2) format("woff2")}
@font-face{font-family:"Bricolage Grotesque";font-weight:800;font-style:normal;font-display:swap;src:url(../fonts/bricolage-grotesque-latin-800-normal.woff2) format("woff2")}
@font-face{font-family:"Figtree";font-weight:400;font-style:normal;font-display:swap;src:url(../fonts/figtree-latin-400-normal.woff2) format("woff2")}
@font-face{font-family:"Figtree";font-weight:500;font-style:normal;font-display:swap;src:url(../fonts/figtree-latin-500-normal.woff2) format("woff2")}
@font-face{font-family:"Figtree";font-weight:600;font-style:normal;font-display:swap;src:url(../fonts/figtree-latin-600-normal.woff2) format("woff2")}
@font-face{font-family:"Figtree";font-weight:700;font-style:normal;font-display:swap;src:url(../fonts/figtree-latin-700-normal.woff2) format("woff2")}
/* What every Numberz game page shares: the palette, the one-screen column (header, rule line, stage,
   controls), toasts, bottom sheets (rules, result, hint, ad break) and buttons. Each game sets its own
   colour (--tile) and adds its own styles.css for its board. Always dark: one palette, on purpose. */
:root{
  --bg:#0F1422; --surface:#182033; --raised:#1F2940; --ink:#E6EAF4; --muted:#96A1B8; --line:#35415C;
  --tile:#5468FF; --tile-ink:#FFFFFF; --tile-edge:rgba(0,0,0,.28);
  --new:#3AD7F2; --new-ink:#062A33;                 /* the Numberz highlight */
  --key:#29334A; --key-ink:#E6EAF4;
  --good:#45C486; --bad:#F2735F; --scrim:rgba(3,6,14,.66);
  --display:"Bricolage Grotesque","Arial Black",system-ui,sans-serif;
  --body:"Figtree",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --ad-h:0px;                          /* height of the ad banner, set by the app */
  --safe-top:0px; --safe-bottom:0px;   /* phone notch and gesture bar, set by the app's page */
  color-scheme:dark;
}
html,body{height:100%}
body{background:var(--bg);color:var(--ink);font-family:var(--body);font-size:15px;-webkit-tap-highlight-color:transparent}
button{font:inherit;color:inherit;cursor:pointer}
button:focus-visible{outline:2px solid var(--new);outline-offset:2px}

.app{box-sizing:border-box;height:100%;max-width:520px;margin:0 auto;padding-inline:16px;padding-block:calc(10px + var(--safe-top)) calc(12px + var(--safe-bottom) + var(--ad-h));display:flex;flex-direction:column;gap:10px}

/* header */
.top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.brand h1{margin:0;font-family:var(--display);font-weight:800;font-size:28px;letter-spacing:-.03em;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.meta{font-size:13px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.meta .chip{display:inline-block;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--new-ink);background:var(--new);padding:2px 6px;border-radius:4px;margin-right:4px;vertical-align:1px}
.top-actions{display:flex;gap:8px;flex-shrink:0}
.ghost-btn{border:1.5px solid var(--line);background:transparent;border-radius:8px;padding:6px 10px;font-size:13px;font-weight:600}
.ghost-btn:hover{border-color:var(--muted)}
.round{width:34px;height:34px;padding:0;border-radius:50%;font-weight:700}

.rule{margin:0;font-size:14px;color:var(--muted);line-height:1.35}
.rule b{color:var(--ink);font-weight:600}

.stage{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:center;position:relative}

.toast{position:absolute;left:50%;top:0;transform:translate(-50%,-6px);background:var(--ink);color:var(--bg);font-weight:600;font-size:14px;padding:8px 14px;border-radius:8px;max-width:calc(100% - 20px);text-align:center;opacity:0;pointer-events:none;transition:opacity .18s,transform .18s;z-index:5}
.toast.show{opacity:1;transform:translate(-50%,0)}
.toast.good{background:var(--good);color:var(--bg)}

/* controls */
.controls{display:flex;gap:8px}
.controls .ghost-btn{flex:1;padding:11px 8px;font-size:14px}
.controls .ghost-btn[disabled]{opacity:.45;cursor:default}
.controls .primary{background:var(--tile);color:var(--tile-ink);border-color:var(--tile)}
.ad-tag{display:inline-block;font-size:9px;font-weight:800;letter-spacing:.08em;padding:1px 4px;border-radius:3px;background:var(--new);color:var(--new-ink);vertical-align:2px;margin-left:3px}

/* sheets */
.scrim[hidden]{display:none}
.scrim{position:fixed;inset:0 0 var(--ad-h) 0;background:var(--scrim);z-index:10;display:flex;align-items:flex-end;justify-content:center}
.sheet{box-sizing:border-box;width:100%;max-width:520px;max-height:calc(100% - 24px);overflow:auto;background:var(--surface);color:var(--ink);border-radius:14px 14px 0 0;padding-inline:20px;padding-block:18px calc(20px + var(--safe-bottom));animation:up .28s cubic-bezier(.2,.8,.2,1)}
@keyframes up{from{transform:translateY(24px);opacity:.4}}
.sheet:focus{outline:none}
.sheet-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.eyebrow{font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin:0 0 4px}
.sheet h2{margin:0;font-family:var(--display);font-weight:800;font-size:30px;letter-spacing:-.02em;line-height:1.05;text-wrap:balance}
.sheet p{line-height:1.45;margin:0}
.sheet section{margin-top:18px;display:flex;flex-direction:column;gap:8px}
.sheet h3{margin:0;font-size:12px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.sheet-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:20px}
.sheet-actions button{flex:1 1 140px;border-radius:8px;padding:11px 12px;font-weight:700;border:1.5px solid var(--line);background:transparent}
.sheet-actions .primary{background:var(--tile);border-color:var(--tile);color:var(--tile-ink)}
.rules{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:6px;line-height:1.45}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.stats div{display:flex;flex-direction:column;align-items:center;gap:2px}
.stats b{font-family:var(--display);font-size:26px;font-weight:800;font-variant-numeric:tabular-nums}
.stats span{font-size:12px;color:var(--muted);text-align:center}
.score{font-size:16px}
.score b{font-family:var(--display);font-size:22px;font-variant-numeric:tabular-nums}
.next{margin:14px 0 0;font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}
.copybox{width:100%;box-sizing:border-box;font:13px/1.4 ui-monospace,Menlo,monospace;border:1.5px solid var(--line);border-radius:8px;padding:8px;background:var(--bg);color:var(--ink);resize:none}
.sheet .x{flex-shrink:0}

/* the example in the rules */
.example-box{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px;margin:14px 0 4px;border-radius:12px;background:var(--bg)}
.example-box .row{display:flex;gap:8px;align-items:center;font-weight:700}
.example-box .chip-btn{display:inline-grid;place-items:center;min-width:44px;height:34px;padding:0 10px;border-radius:9px;background:var(--tile);color:var(--tile-ink);font-family:var(--display);font-weight:800;font-size:18px}

/* ad break (apps only) */
.adbreak{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;padding-block:18px 6px}
.adbreak p:last-child{color:var(--muted);max-width:32ch}
.adbreak-mark{display:flex;gap:6px;margin-bottom:10px}
.adbreak-mark i{display:block;width:14px;height:14px;border-radius:4px;background:var(--tile);animation:breathe 1.2s ease-in-out infinite alternate}
.adbreak-mark i:nth-child(2){animation-delay:.2s}
.adbreak-mark i:nth-child(3){background:var(--new);animation-delay:.4s}
@keyframes breathe{to{opacity:.35}}


/* the number keypad */
.kp{display:flex;flex-direction:column;gap:6px;user-select:none}
.kr{display:flex;gap:6px;justify-content:center}
.key{flex:1;height:48px;border:0;border-radius:8px;background:var(--key);color:var(--key-ink);font-family:var(--display);font-weight:800;font-size:20px;touch-action:manipulation;font-variant-numeric:tabular-nums}
.key.wide{flex:1.6;font-family:var(--body);font-size:15px;font-weight:700}
.key.primary{background:var(--tile);color:var(--tile-ink)}
.key:active:not(:disabled){filter:brightness(.88)}
.key:disabled{opacity:.4}
@media (max-height:680px){ .key{height:42px} }

@media (prefers-reduced-motion: reduce){
  .sheet,.adbreak-mark i{animation:none}
  .toast{transition:none}
}
@media (max-height:640px){ .rule{display:none} }

/* Sign Here: the five steps of the day as pips; the steps already solved, small; the row you're on, big:
   numbers as tiles, gaps you tap and fill from the four signs, then "= target". Its colour is red. */
.steps{display:flex;gap:6px}
.steps i{flex:1;height:8px;border-radius:4px;background:var(--line)}
.steps i.on{background:var(--tile)}
.steps i.now{background:var(--line);box-shadow:inset 0 0 0 2px var(--tile)}
.stage{justify-content:center;gap:16px}
.row{--c:44px;display:flex;justify-content:center;align-items:center;gap:4px;flex-wrap:nowrap}
.row .n{box-sizing:border-box;min-width:var(--c);height:var(--c);padding:0 6px;border-radius:9px;background:var(--surface);display:grid;place-items:center;
  font-family:var(--display);font-weight:800;font-size:calc(var(--c) * .5);font-variant-numeric:tabular-nums}
.row .g{box-sizing:border-box;width:calc(var(--c) * .8);height:var(--c);border-radius:9px;border:2px dashed var(--line);display:grid;place-items:center;
  font-family:var(--display);font-weight:800;font-size:calc(var(--c) * .58);color:var(--ink);cursor:pointer}
.row .g.set{border-style:solid;border-color:var(--tile);background:var(--tile);color:var(--tile-ink)}
.row .g.sel{border-style:solid;border-color:var(--new);box-shadow:0 0 0 2px var(--new)}
.row .g.hinted{border-color:var(--new);background:var(--new);color:var(--new-ink);cursor:default}
.row .eq{font-family:var(--display);font-weight:800;font-size:calc(var(--c) * .55);color:var(--muted);padding:0 2px}
.row .t{box-sizing:border-box;min-width:var(--c);height:var(--c);padding:0 8px;border-radius:9px;border:2px solid var(--new);display:grid;place-items:center;
  font-family:var(--display);font-weight:800;font-size:calc(var(--c) * .5);font-variant-numeric:tabular-nums}
.row.small{--c:24px;gap:2px;opacity:.8}
.row.small .g{border:0;background:var(--tile);color:var(--tile-ink);width:calc(var(--c) * .9)}
.row.small .t{border-width:1.5px}
.row.small .mark{margin-left:6px;font-size:13px}
.done-rows{display:flex;flex-direction:column;gap:6px;align-items:center}
.row.shake{animation:shake .38s}
@keyframes shake{20%{transform:translateX(-7px)}40%{transform:translateX(6px)}60%{transform:translateX(-4px)}80%{transform:translateX(3px)}}
.row.win .n,.row.win .g,.row.win .t{animation:pop .5s ease both;animation-delay:calc(var(--i) * 35ms)}
@keyframes pop{50%{transform:translateY(-6px)}}
.signs{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.sign{height:60px;border:0;border-radius:14px;background:var(--key);color:var(--key-ink);font-family:var(--display);font-weight:800;font-size:32px;line-height:1;touch-action:manipulation}
.sign:active:not(:disabled){filter:brightness(.88)}
.sign:disabled{opacity:.35}
.result-rows{display:flex;flex-direction:column;gap:8px}
.result-rows .row{justify-content:flex-start;opacity:1}
@media (max-height:700px){ .sign{height:52px} .row.small{--c:20px} }
@media (prefers-reduced-motion: reduce){ .row.shake,.row.win .n,.row.win .g,.row.win .t{animation:none} }
.example-box .row{--c:30px}


/* ---------- on wordz.club ---------- */
/* The back arrow at the top left leads to the app's page on wordz.club (wordz.club/numberz/). */
.wz-back{flex-shrink:0;width:36px;height:36px;margin-left:-8px;border:0;border-radius:999px;background:transparent;color:var(--ink);display:grid;place-items:center;padding:0;cursor:pointer;-webkit-tap-highlight-color:transparent}
.wz-back:hover,.wz-back:active{background:var(--raised)}
.brand{gap:6px}
@media (max-width:380px){ .brand h1{font-size:24px} }
/* A friend's challenge (a shared link): a short note above the game, with a close button. */
.wz-note{flex-shrink:0;display:flex;align-items:center;gap:8px;padding:8px 6px 8px 12px;border-radius:12px;background:var(--raised);border:1px solid var(--line);border-left:4px solid var(--new);font-size:14px;line-height:1.35;color:var(--ink);animation:wz-note-in .35s ease-out both}
.wz-note p{margin:0;flex:1;min-width:0}
.wz-note b{color:var(--new);font-weight:700}
.wz-note-x{flex-shrink:0;width:30px;height:30px;border:0;border-radius:999px;background:transparent;color:var(--muted);font-size:14px;cursor:pointer}
.wz-note-x:hover{background:var(--key)}
@keyframes wz-note-in{from{opacity:0;transform:translateY(-6px)}}
@media (prefers-reduced-motion:reduce){ .wz-note{animation:none} }
/* "Get the app": the bar at the top of the game, and the store buttons in its sheet. */
.getapp{flex-shrink:0;display:flex;align-items:center;gap:10px;background:var(--raised);border:1px solid var(--line);border-radius:10px;padding-block:6px;padding-inline:12px 6px;font-size:13px}
.getapp-text{flex:1;min-width:0;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.getapp-btn{flex-shrink:0;border:0;border-radius:7px;background:var(--new);color:var(--new-ink);font-weight:700;font-size:13px;padding:6px 10px;cursor:pointer}
.getapp-x{flex-shrink:0;border:0;background:transparent;color:var(--muted);width:28px;height:28px;border-radius:6px;font-size:13px;cursor:pointer}
.getapp-x:hover{background:var(--key)}
.stores{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px}
.store-btn{flex:1 1 140px;display:flex;flex-direction:column;justify-content:center;gap:1px;padding:8px 14px;border-radius:9px;background:var(--ink);color:var(--bg);text-decoration:none;line-height:1.15}
.store-btn small{font-size:11px;opacity:.8}
.store-btn b{font-family:var(--display);font-size:17px;font-weight:700;letter-spacing:-.01em}
.store-btn.soon{background:transparent;color:var(--muted);border:1.5px dashed var(--line)}
.store-btn:focus-visible{outline:2px solid var(--new);outline-offset:2px}
