@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 Mapz 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:#3BA3FF; --new-ink:#04203F;                 /* the Mapz 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);width:max-content;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}}


/* while a game is still being made: its example puzzle, and test buttons for the home screen */
.soon{display:flex;flex-direction:column;align-items:center;gap:14px;text-align:center}
.soon .eyebrow{color:var(--new)}
.example{font-family:var(--display);font-weight:800;font-size:24px;line-height:1.35;letter-spacing:-.01em;white-space:pre-line;font-variant-numeric:tabular-nums;padding:16px 18px;border-radius:12px;background:var(--surface);box-shadow:inset 0 0 0 2px var(--tile)}
.soon-line{margin:0;color:var(--muted);max-width:34ch;line-height:1.45}
.soon-time{margin:0;font-family:var(--display);font-weight:700;font-size:18px;font-variant-numeric:tabular-nums;color:var(--muted)}
.progress{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;max-width:300px}
.progress i{width:22px;height:8px;border-radius:4px;background:var(--line)}
.progress i.on{background:var(--tile)}

/* 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} }

/* The map and the country picker the Mapz games share (src/games/_geo/). Part of every game's styles.css. */
:root{
  --map-sea:#17233B; --map-land:#3A4866; --map-border:#0F1422; --map-plain:#323D58;
  --map-on:var(--tile); --map-river:#5AA9E6; --map-coast:var(--new);
}

/* ---------- the map ---------- */
.geo-map{display:block;width:100%;height:100%;border-radius:12px;background:var(--map-sea)}
.geo-sea{fill:var(--map-sea)}
.geo-c{fill:var(--map-land);stroke:var(--map-border);stroke-width:.8;stroke-linejoin:round}
.geo-c.hole{fill:var(--map-sea);stroke:var(--map-sea);stroke-width:1.2}
.geo-c.on,.geo-c.start,.geo-c.end{fill:var(--map-on)}
.geo-c.start,.geo-c.end{stroke:#F7F9FB;stroke-width:1.4}
.geo-c.dim{fill:#2C3753}
/* plain land: no name, no borders inside, never part of a puzzle */
.geo-plain{fill:var(--map-plain);stroke:var(--map-plain);stroke-width:.8;stroke-linejoin:round}
.geo-lake{fill:var(--map-sea)}
.geo-river{fill:none;stroke:var(--map-river);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.geo-coast{fill:none;stroke:var(--map-coast);stroke-width:1.6;stroke-dasharray:4 3;stroke-linejoin:round}
.geo-dot{fill:var(--new);stroke:var(--map-border);stroke-width:1.5}
.geo-line{fill:none;stroke:var(--new);stroke-width:1.2;stroke-dasharray:5 4;opacity:.85}
.geo-label{fill:#F7F9FB;font-family:var(--body);font-weight:700;font-size:13px;paint-order:stroke;stroke:var(--map-border);stroke-width:3px;stroke-linejoin:round}

/* ---------- the country picker ---------- */
.picker{display:flex;flex-direction:column;gap:8px;user-select:none}
.picker.off{opacity:.5;pointer-events:none}
.pk-field{display:flex;align-items:center;gap:8px;min-height:44px;padding:0 6px 0 14px;border-radius:10px;background:var(--surface);box-shadow:inset 0 0 0 2px var(--line)}
.pk-typed{flex:1;min-width:0;font-family:var(--display);font-weight:800;font-size:20px;text-transform:uppercase;letter-spacing:.02em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pk-typed:empty::before{content:attr(data-empty);font-family:var(--body);font-weight:500;font-size:16px;text-transform:none;letter-spacing:0;color:var(--muted)}
.pk-typed:not(:empty)::after{content:'';display:inline-block;width:2px;height:1em;margin-left:2px;vertical-align:-2px;background:var(--new);animation:pk-blink 1s steps(1) infinite}
@keyframes pk-blink{50%{opacity:0}}
.pk-clear{width:34px;height:34px;border:0;border-radius:999px;background:transparent;color:var(--muted);font-size:16px}
.pk-list{display:flex;flex-wrap:wrap;gap:6px;min-height:40px;align-content:flex-start}
.pk-c{height:40px;padding:0 14px;border:0;border-radius:999px;background:var(--tile);color:var(--tile-ink);font-family:var(--body);font-weight:700;font-size:15px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;touch-action:manipulation}
.pk-c:first-child{box-shadow:0 0 0 2px var(--new)}
.pk-c.used{background:var(--raised);color:var(--muted);text-decoration:line-through;box-shadow:none}
.pk-hint{margin:0;align-self:center;color:var(--muted);font-size:14px}
.picker .kb{display:flex;flex-direction:column;gap:6px}
.picker .kr{gap:5px}
.picker .key{font-family:var(--body);font-weight:700;font-size:17px;text-transform:uppercase;max-width:42px;height:46px;padding:0}
.picker .key.wide{max-width:64px;flex:1.5;font-size:18px}
.picker .key.space{max-width:64px;flex:1.5;font-size:12px;letter-spacing:.04em}
@media (max-height:680px){ .picker .key{height:40px} .pk-field{min-height:38px} }

/* Unfurl: the flag under its six pieces (each turns over to show what's underneath), the countries tried with
   their flags, and the country picker. Its colour is brick red. */
.stage{justify-content:flex-start;gap:10px}
/* as tall as a 4:3 flag the width of the screen, less on a short screen */
.flagbox{flex:0 1 auto;width:100%;aspect-ratio:4/3;min-height:120px;display:flex;align-items:center;justify-content:center;container-type:size}
/* the biggest 4:3 box that fits */
.flag{position:relative;width:min(100cqw,100cqh * 4 / 3);aspect-ratio:4/3;border-radius:10px;overflow:hidden;background:var(--surface);
  box-shadow:0 0 0 1px var(--line)}
.flag img{position:absolute;inset:0;width:100%;height:100%;display:block}
.pieces{position:absolute;inset:0;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(2,1fr);perspective:600px}
.piece{position:relative;border:1.5px solid var(--bg);background:var(--tile);
  background-image:repeating-linear-gradient(135deg,rgba(255,255,255,.07) 0 10px,transparent 10px 20px);
  transition:transform .5s ease,opacity .5s ease;transform-origin:50% 50%;backface-visibility:hidden}
.piece.off{transform:rotateY(90deg);opacity:0}
.clueline{display:flex;align-items:center;gap:10px;min-height:32px}
.clueline .hint{flex-shrink:0;height:32px;padding:0 12px;font-size:13px}
.clueline .hint[disabled]{opacity:.4;cursor:default}
#picker[hidden],.clueline .hint[hidden]{display:none}
.clue-text{flex:1;margin:0;font-size:14px;line-height:1.4}
.clue-text b{font-weight:700}
.tried{display:flex;flex-wrap:wrap;gap:6px}
.tried:empty{display:none}
.tried span{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px 0 4px;border-radius:999px;background:var(--raised);color:var(--muted);font-size:13px;font-weight:600}
.tried img{width:24px;height:18px;border-radius:3px;box-shadow:0 0 0 1px var(--line)}
.answer{display:flex;align-items:center;gap:12px;padding:12px;border-radius:14px;background:var(--surface)}
.answer[hidden]{display:none}
.answer .an{flex:1;min-width:0}
.answer .an b{display:block;font-family:var(--display);font-weight:800;font-size:22px;line-height:1.1}
.answer .an span{font-size:13px;color:var(--muted)}
.answer button{flex-shrink:0;height:44px;padding:0 14px;border:0;border-radius:10px;background:var(--tile);color:var(--tile-ink);font-weight:700}

/* the result */
.found-head{display:flex;align-items:center;gap:12px}
.found-head img{width:96px;height:72px;border-radius:6px;box-shadow:0 0 0 1px var(--line)}
.found-head b{font-family:var(--display);font-weight:800;font-size:24px}
.res-map{height:150px;margin-top:4px}
.facts{margin:0;display:grid;grid-template-columns:auto 1fr;gap:4px 10px;font-size:14px;line-height:1.4}
.facts dt{color:var(--muted)}
.facts dd{margin:0}
.mini{display:inline-flex;align-items:center;gap:6px;margin-right:10px;white-space:nowrap}
.mini img{width:24px;height:18px;border-radius:3px;box-shadow:0 0 0 1px var(--line)}
.guess-list{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:4px}
.guess-list li.no{color:var(--muted)}
.guess-list li.ok{color:var(--good);font-weight:700}
@media (prefers-reduced-motion:reduce){ .piece{transition:none} }


/* ---------- on wordz.club ---------- */
/* The back arrow at the top left leads to the app's page on wordz.club (wordz.club/mapz/). */
.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}
/* (kit.css's .soon, the stand-in's page, doesn't lay out a store button) */
.store-btn.soon{background:transparent;color:var(--muted);border:1.5px dashed var(--line);align-items:stretch;text-align:start}
.store-btn:focus-visible{outline:2px solid var(--new);outline-offset:2px}
