@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 Timez 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:#C9A7F5; --new-ink:#2A1452;                 /* the Timez 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}}

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

/* Time Traveller: the trip along the top (a mark per stop and its year: right, wrong, or the one you're
   at); the stop, big ("London, 1900"); the four things, two by two; after a tap, the years, and a line on
   the one that didn't exist yet. Then Hint and Next stop. Its colour is bronze. */
.trip{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(5,1fr);position:relative}
.trip::before{content:"";position:absolute;left:10%;right:10%;top:7px;height:2px;background:var(--line)}
.trip li{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px}
.trip i{width:12px;height:12px;border-radius:50%;background:var(--bg);border:2px solid var(--line)}
.trip span{font-size:12px;font-weight:700;color:var(--muted);font-variant-numeric:tabular-nums}
.trip li.now i{border-color:var(--tile);background:var(--tile);box-shadow:0 0 0 4px color-mix(in srgb, var(--tile) 30%, transparent)}
.trip li.now span{color:var(--ink)}
.trip li.ok i{background:var(--good);border-color:var(--good)}
.trip li.no i{background:var(--bad);border-color:var(--bad)}

.stage{justify-content:center;gap:14px}
.stop{text-align:center;display:flex;flex-direction:column;gap:2px}
.stop .eyebrow{margin:0;color:var(--tile)}
.when{margin:0;font-family:var(--display);font-weight:800;font-size:44px;letter-spacing:-.02em;line-height:1;font-variant-numeric:tabular-nums}
.grid4{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.thing,.grid4 > span{min-height:96px;border:0;border-radius:16px;padding:12px;background:var(--surface);color:var(--ink);box-shadow:inset 0 0 0 2px var(--line);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;text-align:center;touch-action:manipulation}
.thing b,.grid4 > span b{font-family:var(--display);font-weight:800;font-size:18px;line-height:1.15;text-wrap:balance}
.thing small,.grid4 > span small{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.thing:active:not(:disabled){background:var(--raised);box-shadow:inset 0 0 0 3px var(--tile)}
.thing:disabled{cursor:default}
.thing.was,.grid4 > span.was{opacity:.7}
.thing.odd{box-shadow:inset 0 0 0 3px var(--good);opacity:1}
.thing.ok,.grid4 > span.ok{background:var(--good);color:#0B2016;box-shadow:none;opacity:1}
.thing.no{background:var(--bad);color:#2A0D08;box-shadow:none;opacity:1}
.thing.ok small,.thing.no small,.grid4 > span.ok small{color:inherit;opacity:.75}
.thing.gone{opacity:.25;box-shadow:inset 0 0 0 2px var(--line);background:transparent}
.thing.gone b{text-decoration:line-through}
.thing.pop{animation:pop .45s ease}
@keyframes pop{50%{transform:scale(1.04)}}
.said{margin:0;min-height:2.6em;text-align:center;font-size:14px;line-height:1.35;color:var(--muted)}
.said b{color:var(--ink)}
.said.ok b:first-child{color:var(--good)}
.said.no b:first-child{color:var(--bad)}
.controls .ghost-btn[disabled]{opacity:.45}

/* the result and the example */
.legs{list-style:none;margin:4px 0 0;padding:0;display:flex;flex-direction:column}
.legs li{display:flex;flex-direction:column;gap:1px;padding:7px 0 7px 12px;border-bottom:1px solid var(--line);position:relative;line-height:1.3}
.legs li:last-child{border-bottom:0}
.legs li::before{content:"";position:absolute;left:0;top:9px;bottom:9px;width:4px;border-radius:2px}
.legs li.ok::before{background:var(--good)}
.legs li.no::before{background:var(--bad)}
.legs b{font-size:13px;color:var(--muted)}
.legs em{font-style:normal;font-size:12px;color:var(--muted)}
.ex-when{margin:0;font-family:var(--display);font-weight:800;font-size:22px}
.example-box .grid4{width:100%}
.example-box .grid4 > span{min-height:60px;padding:8px}
.example-box .grid4 > span b{font-size:15px}

@media (max-height:720px){ .when{font-size:36px} .thing{min-height:80px} .thing b{font-size:16px} .stage{gap:10px} }
@media (max-height:620px){ .thing{min-height:68px;padding:8px} .stop .eyebrow{display:none} }
@media (prefers-reduced-motion: reduce){ .thing.pop{animation:none} }


/* ---------- on wordz.club ---------- */
/* The back arrow at the top left leads to the app's page on wordz.club (wordz.club/timez/). */
.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}
