:root{
  box-sizing:border-box;
  padding-top:env(safe-area-inset-top,0px);
  padding-bottom:env(safe-area-inset-bottom,0px);
  --plate:#1b4b9b;        /* Sofia street-plate enamel */
  --plate-ink:#ffffff;
  --taxi:#f4c21b;         /* Sofia taxi yellow */
  --tile:#c4574d;         /* the red pavers */
  --tan:#c08a52;          /* Madike's legs and eyebrows */
  --card:#f7f1e6;
  --ink:#191b20;
  --muted:#575c68;
  --line:rgba(25,27,32,.16);
  --pill:rgba(247,241,230,.92);
  --bg:#d6e6f2;
  --glass:rgba(247,241,230,.86);
  --rim:rgba(255,255,255,.55);
  --sans:"Sofia Sans","Segoe UI",system-ui,-apple-system,"Helvetica Neue",Arial,sans-serif;
  --cond:"Sofia Sans Condensed","Sofia Sans","Arial Narrow","Segoe UI",system-ui,Arial,sans-serif;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --card:#161a22; --ink:#f3ede1; --muted:#a8afbc; --line:rgba(243,237,225,.18);
    --pill:rgba(22,26,34,.9); --bg:#1c2733; --glass:rgba(20,24,32,.82); --rim:rgba(255,255,255,.1);
  }
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --card:#161a22; --ink:#f3ede1; --muted:#a8afbc; --line:rgba(243,237,225,.18);
  --pill:rgba(22,26,34,.9); --bg:#1c2733; --glass:rgba(20,24,32,.82); --rim:rgba(255,255,255,.1);
}
*,*::before,*::after{box-sizing:inherit}
html,body{height:100%;margin:0}
body{background:var(--bg);color:var(--ink);font-family:var(--sans);overflow:hidden;
  -webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;overscroll-behavior:none}
[hidden]{display:none!important}
#scene{position:fixed;inset:0;width:100%;height:100%;display:block;touch-action:none;outline:none}
#ui{position:relative;height:100%;pointer-events:none}
#ui > *{pointer-events:auto}

/* Street-plate language: blue enamel, white keyline */
.plate{display:inline-flex;align-items:center;background:var(--plate);color:var(--plate-ink);
  font-family:var(--cond);font-weight:800;letter-spacing:.01em;line-height:1;
  border-radius:7px;padding:9px 13px;box-shadow:inset 0 0 0 2px var(--plate),inset 0 0 0 4px var(--plate-ink),0 2px 8px rgba(0,0,0,.25)}
.plate.num{font-size:26px;padding:8px 12px;border-radius:9px}

/* HUD */
#hud{position:absolute;inset:0;pointer-events:none}
#hud > *{pointer-events:auto}
/* layers that cover the screen must never catch the mouse: only their buttons and cards do */
#hud > .mg,#hud > .toasts,#hud > .area-banner,#hud > #flash{pointer-events:none}
.mg-bar,.mg-card{pointer-events:auto}
.hud-plate{position:absolute;left:12px;top:12px;flex-direction:column;align-items:flex-start;gap:8px;padding:11px 14px 10px;pointer-events:none}
.hud-plate .street{font-size:17px}
.counts{display:flex;gap:14px;font-family:var(--sans);font-weight:800;font-size:17px;font-variant-numeric:tabular-nums}
.count{display:inline-flex;align-items:center;gap:6px}
.count svg{width:19px;height:19px;flex:none}
.count small{font-weight:600;font-size:13px;opacity:.8}
.vitals{position:absolute;left:12px;top:92px;display:flex;align-items:center;gap:2px;background:var(--pill);border-radius:999px;padding:4px 14px 4px 10px;pointer-events:none;box-shadow:0 2px 8px rgba(0,0,0,.12)}
.hearts{display:flex;gap:3px;padding:3px 8px 3px 0;border-right:1px solid var(--line);margin-right:8px}
.hearts svg{width:20px;height:20px;fill:var(--tile);stroke:var(--tile);stroke-width:1.6}
.hearts svg.lost{fill:none;opacity:.5}
/* a poop bag in hand (nature.js): shown beside the score until it is in a bin */
.bagchip{display:flex;align-items:center;margin-left:9px;padding-left:9px;border-left:1px solid var(--line);color:var(--ink)}
.bagchip svg{width:21px;height:21px;animation:bagswing 1.4s ease-in-out infinite;transform-origin:50% 15%}
@keyframes bagswing{0%,100%{transform:rotate(-9deg)}50%{transform:rotate(9deg)}}
@media (prefers-reduced-motion: reduce){ .bagchip svg{animation:none} }
.icon-btn{width:40px;height:40px;border-radius:50%;border:0;background:var(--pill);color:var(--ink);display:grid;place-items:center;cursor:pointer}
.icon-btn svg{width:20px;height:20px}
.icon-btn:focus-visible,.go:focus-visible,.act:focus-visible,.jump:focus-visible{outline:3px solid var(--taxi);outline-offset:3px}
/* the way to go: one big arrow fixed at the top middle, turned towards the nearest thing to do (game.js, updateHUD) */
.compass{position:absolute;left:50%;top:10px;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:4px;pointer-events:none}
.compass .needle{width:76px;height:76px;display:block;filter:drop-shadow(0 3px 5px rgba(0,0,0,.4))}
.compass .needle svg{display:block;width:100%;height:100%;overflow:visible;transition:none}
#compass-txt{background:var(--pill);border-radius:999px;padding:4px 12px;font-weight:700;font-size:14px;line-height:1.2;white-space:nowrap;font-variant-numeric:tabular-nums;box-shadow:0 2px 8px rgba(0,0,0,.12)}
.hint{position:absolute;left:50%;bottom:26px;transform:translateX(-50%);max-width:min(92%,460px);text-align:center;
  background:var(--pill);border-radius:14px;padding:10px 16px;font-weight:600;font-size:15px;line-height:1.3;pointer-events:none}
.hint.go-now{background:#1f8a4c;color:#fff}
.hint.stop{background:var(--tile);color:#fff}
/* touch: the hint goes in the gap between the stick and the buttons, where it covers neither the dog nor the counts */
.touch .hint{bottom:30px;max-width:min(460px,calc(100% - 464px))}
.stick{position:absolute;left:22px;bottom:26px;width:132px;height:132px;border-radius:50%;
  background:rgba(255,255,255,.2);box-shadow:inset 0 0 0 2px rgba(255,255,255,.75);touch-action:none}
.stick .knob{position:absolute;left:50%;top:50%;width:56px;height:56px;margin:-28px 0 0 -28px;border-radius:50%;
  background:var(--plate);box-shadow:inset 0 0 0 3px #fff,0 2px 8px rgba(0,0,0,.3)}
.act{position:absolute;right:22px;bottom:34px;width:96px;height:96px;border-radius:50%;border:0;background:var(--taxi);color:#191b20;
  font-family:var(--sans);font-weight:800;font-size:15px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  box-shadow:inset 0 0 0 3px #191b20,0 3px 10px rgba(0,0,0,.3);touch-action:none;cursor:pointer}
.act svg{width:30px;height:30px}
.act:active{transform:scale(.95)}
.jump{position:absolute;right:132px;bottom:40px;width:84px;height:84px;border-radius:50%;border:0;background:var(--plate);color:#fff;
  font-family:var(--sans);font-weight:800;font-size:14px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;
  box-shadow:inset 0 0 0 3px #fff,0 3px 10px rgba(0,0,0,.3);touch-action:none;cursor:pointer}
.jump svg{width:28px;height:28px}
.jump:active{transform:scale(.95)}
#hud .score{display:flex;align-items:baseline;gap:7px;font-weight:800;font-size:17px;font-variant-numeric:tabular-nums}
.score .combo{color:#1f8a4c;font-size:15px}
.score .combo:empty{display:none}
#hud .pop{position:absolute;transform:translate(-50%,-50%);font-weight:800;font-size:21px;color:#fff;white-space:nowrap;pointer-events:none;
  text-shadow:0 1px 0 #191b20,0 0 8px rgba(0,0,0,.65);animation:pop 1s ease-out forwards}
@keyframes pop{from{opacity:1;margin-top:0}to{opacity:0;margin-top:-72px}}
.stars{display:flex;gap:6px;margin:0 0 12px}
.stars svg{width:36px;height:36px;fill:var(--taxi);stroke:#191b20;stroke-width:1.1;stroke-linejoin:round}
.stars svg.off{fill:none;stroke:currentColor;opacity:.3}
#flash{position:absolute;inset:0;background:#fff;opacity:0;pointer-events:none!important;transition:opacity .5s}
#flash.on{opacity:.55;transition:none}
#flash.soft{opacity:.85;background:#fff6e4;transition:opacity .45s}
#flash.cut,.cut-veil.on{animation:cut .6s ease-out}
.cut-veil{position:absolute;inset:0;opacity:0;background:#0d1118;pointer-events:none!important}
@keyframes cut{0%{opacity:1;background:#0d1118}100%{opacity:0;background:#0d1118}}

/* Title and end cards: a glassy panel over the live street, type that arrives letter by letter */
.veil{position:absolute;inset:0;display:flex;align-items:flex-start;padding:44px clamp(16px,6vw,84px) 20px;
  background:radial-gradient(120% 90% at 0% 50%,rgba(10,14,24,.62),rgba(10,14,24,.18) 55%,rgba(10,14,24,0) 80%);overflow:auto}
.card{position:relative;width:min(100%,460px);margin:auto 0;flex:none;color:var(--ink);border-radius:26px;padding:28px 28px 22px;
  background:var(--glass);-webkit-backdrop-filter:blur(18px) saturate(1.3);backdrop-filter:blur(18px) saturate(1.3);
  box-shadow:0 30px 80px rgba(0,0,0,.35),inset 0 0 0 1px var(--rim)}
.veil.in .card{animation:cardin .8s cubic-bezier(.2,.9,.25,1) both}
@keyframes cardin{from{opacity:0;transform:translateX(-28px) scale(.98)}to{opacity:1;transform:none}}
.card-top{display:flex;align-items:center;gap:8px;margin-bottom:18px}
.card-top .plate{font-size:18px}
.veil.in .card-top .plate{animation:platein .6s cubic-bezier(.2,1.4,.4,1) both}
.veil.in .card-top .plate+.plate{animation-delay:.08s}
@keyframes platein{from{opacity:0;transform:translateY(-10px) rotate(-4deg)}to{opacity:1;transform:none}}
.face{position:absolute;right:22px;top:-38px;width:116px;height:116px;border-radius:50%;object-fit:cover;
  border:4px solid var(--card);box-shadow:0 0 0 3px var(--taxi),0 10px 26px rgba(0,0,0,.35);animation:float 6s ease-in-out infinite}
@keyframes float{50%{transform:translateY(-6px) rotate(2deg)}}
h1,h2{font-family:var(--sans);font-weight:800;letter-spacing:-.025em;line-height:.95;margin:0 0 10px}
h1{font-size:clamp(46px,9vw,68px)}
h2{font-size:clamp(34px,7vw,46px)}
h1 .ch{display:inline-block;white-space:pre}
.veil.in h1 .ch{animation:chin .7s cubic-bezier(.2,1.2,.35,1) both;animation-delay:calc(.15s + var(--i) * 32ms)}
@keyframes chin{from{opacity:0;transform:translateY(.55em) rotate(8deg)}to{opacity:1;transform:none}}
.lede{font-size:17px;line-height:1.45;margin:0 0 14px;color:var(--ink);max-width:34ch}
.veil.in .lede,.veil.in .t-sky,.veil.in .go,.veil.in .t-tabs,.veil.in .stats,.veil.in .stars{animation:rise .7s cubic-bezier(.2,.9,.25,1) both}
.veil.in .lede{animation-delay:.35s}.veil.in .t-sky{animation-delay:.42s}.veil.in .go{animation-delay:.5s}.veil.in .t-tabs{animation-delay:.6s}.veil.in .stars{animation-delay:.3s}.veil.in .stats{animation-delay:.45s}
@keyframes rise{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
.t-sky{display:inline-flex;align-items:center;gap:8px;margin:0 0 16px;padding:6px 12px 6px 10px;border-radius:999px;background:var(--line);font-size:13.5px;font-weight:700}
.t-sky::before{content:"";width:9px;height:9px;border-radius:50%;background:var(--taxi);box-shadow:0 0 0 3px rgba(244,194,27,.3);animation:pulse 2.4s ease-in-out infinite}
@keyframes pulse{50%{box-shadow:0 0 0 7px rgba(244,194,27,0)}}
.go{position:relative;display:flex;align-items:center;justify-content:center;gap:10px;width:100%;border:0;border-radius:14px;background:var(--plate);color:#fff;font-family:var(--sans);font-weight:800;font-size:19px;
  padding:15px 18px;cursor:pointer;overflow:hidden;box-shadow:inset 0 0 0 2px var(--plate),inset 0 0 0 4px #fff,0 8px 22px rgba(27,75,155,.35);transition:transform .18s cubic-bezier(.2,1.4,.4,1),box-shadow .2s,filter .2s}
.go svg{width:22px;height:22px;transition:transform .25s cubic-bezier(.2,1.4,.4,1)}
.go::after{content:"";position:absolute;top:0;bottom:0;left:-60%;width:40%;background:linear-gradient(100deg,transparent,rgba(255,255,255,.35),transparent);transform:skewX(-20deg);transition:left .6s}
.go:hover{filter:brightness(1.08);transform:translateY(-1px)}
.go:hover svg{transform:translateX(4px)}
.go:hover::after{left:120%}
.go:active{transform:translateY(1px) scale(.98)}
.t-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 0}
.chip{border:0;border-radius:999px;padding:8px 14px;background:var(--line);color:var(--ink);font:700 14px/1.1 var(--sans);cursor:pointer;transition:background .2s,transform .15s}
.chip:hover{background:rgba(127,127,127,.28)}
.chip:active{transform:scale(.96)}
.chip.on{background:var(--ink);color:var(--card)}
.chip:focus-visible,.row:focus-visible,.minimap:focus-visible,.set select:focus-visible,.set input:focus-visible{outline:3px solid var(--taxi);outline-offset:2px}
.t-panel{margin-top:14px;padding-top:14px;border-top:1px solid var(--line);animation:rise .4s cubic-bezier(.2,.9,.25,1) both}
.goals{list-style:none;margin:0 0 4px;padding:0;display:grid;gap:10px;font-size:15px;line-height:1.35}
.goals li{display:grid;grid-template-columns:24px 1fr;gap:10px;align-items:start}
.goals svg{width:22px;height:22px;margin-top:-1px}
.keys{margin:12px 0 0;font-size:13.5px;line-height:1.45;color:var(--muted)}
.keys b{color:var(--ink);font-weight:800}
.glist{list-style:none;margin:0;padding:0;display:grid;gap:2px}
.glist li{display:flex;justify-content:space-between;gap:10px;padding:8px 2px;border-bottom:1px solid var(--line);font-size:15px}
.glist li.secret{color:var(--muted);font-style:italic}
.glist small{font-weight:700;color:var(--muted);font-size:12px}
.gbest{font-weight:800;font-variant-numeric:tabular-nums;display:inline-flex;align-items:center;gap:6px}
.med{width:12px;height:12px;border-radius:50%;display:inline-block;box-shadow:inset 0 0 0 1.5px rgba(0,0,0,.35)}
.med.gold{background:#f4c21b}.med.silver{background:#c9ced6}.med.bronze{background:#c98a46}
.gtoys{margin:10px 0 0;font-size:14px;color:var(--muted)}.gtoys b{color:var(--ink)}
.stats{display:grid;grid-template-columns:1fr auto;gap:8px 16px;margin:6px 0 20px;padding:14px 0 0;border-top:1px solid var(--line);font-size:16px}
.stats dt{color:var(--muted)}
.stats dd{margin:0;font-weight:800;font-variant-numeric:tabular-nums;text-align:right}
/* the end card is never taller than the screen: however long its list grows (a gift's note, games, rides), the list
   scrolls inside the card and the way to walk again stays in reach */
.e-card{display:flex;flex-direction:column;max-height:100%;overflow:auto}
.e-card > *{flex:none}
.e-card .stats{flex:0 1 auto;min-height:84px;overflow:auto;overscroll-behavior:contain}
.stats dt.wl{grid-column:1}
.stats dd.wide{grid-column:2/-1}
.stats dt.wide{grid-column:1/-1;color:var(--ink);font-weight:800}
/* a laptop screen: the end card's list stands two to a row, so the button to walk again is on screen without scrolling */
@media (min-width:700px) and (max-height:900px){
  .e-card{width:min(100%,640px)}
  .e-card .stats{grid-template-columns:1fr auto 1fr auto;gap:7px 14px;font-size:15.5px;margin-bottom:16px}
  .e-card .stats dt:nth-of-type(even):not(.wide):not(.wl){padding-left:18px}
  .e-card h2{margin-bottom:8px} .e-card .lede{max-width:none;margin-bottom:10px} .e-card .stars{margin-bottom:8px}
}
/* A game given as a present: a gift tag above the title, the giver's note on the end card */
.gift{display:inline-flex;align-items:center;gap:7px;max-width:100%;margin:0 0 12px;padding:5px 13px 5px 8px;border-radius:999px;
  background:var(--taxi);color:#191b20;font-family:var(--cond);font-weight:800;font-size:16px;line-height:1.15;letter-spacing:.01em;
  overflow-wrap:anywhere;box-shadow:inset 0 0 0 2px #191b20}
.gift svg{width:20px;height:20px;flex:none}
.note{position:relative;margin:0 0 18px;padding:11px 16px 13px;border-radius:12px;background:rgba(244,194,27,.16);border-left:5px solid var(--taxi)}
.note::before{content:"\201C";position:absolute;right:12px;top:4px;font:700 58px/1 Georgia,"Times New Roman",serif;color:var(--taxi);pointer-events:none}
.note figcaption{font-family:var(--cond);font-weight:800;font-size:15px;color:var(--muted);margin:0 34px 4px 0;overflow-wrap:anywhere}
.note blockquote{margin:0;font-size:17px;line-height:1.45;white-space:pre-line;overflow-wrap:anywhere;max-height:9.6em;overflow:auto;
  -webkit-user-select:text;user-select:text}
.report{margin:12px 0 0;font-size:12.5px}
/* on one of our own dogs: the way to a game about the player's dog */
.own{margin:14px 0 0;font-size:15px;line-height:1.4;color:var(--muted)}.own a{color:var(--plate);font-weight:800;white-space:nowrap}
a.go{box-sizing:border-box;text-decoration:none}.own-go{margin-top:10px}
.report a{color:var(--muted)}
#nogl{position:absolute;inset:0;display:grid;place-items:center;padding:24px;text-align:center;font-size:17px;line-height:1.5}

/* Sheets: pause, settings, the map */
/* (one column exactly as wide as the screen, in the sheet and again inside the map's card: left to size itself, it grew to fit the map's long weather line and pushed the close button off a phone) */
.sheet{position:absolute;inset:0;z-index:10;display:grid;grid-template-columns:minmax(0,1fr);place-items:center;padding:16px;background:rgba(8,11,18,0);transition:background .25s;-webkit-backdrop-filter:blur(0);backdrop-filter:blur(0)}
.sheet.in{background:rgba(8,11,18,.45);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
.sheet-card{width:min(100%,400px);max-height:calc(100% - 8px);overflow:auto;border-radius:24px;padding:24px 22px 18px;color:var(--ink);background:var(--glass);-webkit-backdrop-filter:blur(18px) saturate(1.3);backdrop-filter:blur(18px) saturate(1.3);
  box-shadow:0 30px 80px rgba(0,0,0,.4),inset 0 0 0 1px var(--rim);opacity:0;transform:translateY(16px) scale(.97);transition:opacity .22s,transform .3s cubic-bezier(.2,1.2,.35,1)}
.sheet.in .sheet-card,.sheet.in .map-card{opacity:1;transform:none}
.sheet-kicker{margin:0 0 4px;font:800 12px/1 var(--cond);letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.sheet h2{font-size:36px;margin-bottom:8px}
.p-sum{margin:0 0 16px;font-size:14.5px;color:var(--muted);font-variant-numeric:tabular-nums}
.menu{display:grid;gap:6px}
.menu .go{margin-bottom:6px}
.row{display:flex;justify-content:space-between;align-items:center;width:100%;border:0;border-radius:12px;padding:13px 14px;background:transparent;color:var(--ink);font:700 16px/1 var(--sans);cursor:pointer;text-align:left;transition:background .15s,transform .15s}
.row:hover{background:var(--line);transform:translateX(3px)}
.row kbd{font:700 12px/1 var(--sans);padding:4px 7px;border-radius:6px;background:var(--line);color:var(--muted)}
.set{display:grid;gap:2px;margin:6px 0 10px}
.set-row{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:10px 2px;border-bottom:1px solid var(--line);font-weight:700;font-size:15.5px}
.set select{font:600 15px/1.2 var(--sans);color:var(--ink);background:var(--line);border:0;border-radius:10px;padding:8px 10px;max-width:58%}
.set input[type=range]{width:46%;accent-color:var(--plate)}
.set input[role=switch]{-webkit-appearance:none;appearance:none;width:46px;height:28px;border-radius:999px;background:var(--line);position:relative;cursor:pointer;transition:background .2s;flex:none}
.set input[role=switch]::after{content:"";position:absolute;left:3px;top:3px;width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.3);transition:transform .25s cubic-bezier(.2,1.4,.4,1)}
.set input[role=switch]:checked{background:#1f8a4c}
.set input[role=switch]:checked::after{transform:translateX(18px)}
.set-sky{margin:4px 0 14px;font-size:13.5px;color:var(--muted)}
.map-sheet{padding:12px}
.map-card{position:relative;width:min(100%,980px);height:min(100%,760px);display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;border-radius:24px;overflow:hidden;color:var(--ink);background:var(--glass);
  -webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);box-shadow:0 30px 80px rgba(0,0,0,.45),inset 0 0 0 1px var(--rim);opacity:0;transform:scale(.97);transition:opacity .22s,transform .3s cubic-bezier(.2,1.2,.35,1)}
.map-head{display:flex;align-items:baseline;gap:12px;padding:14px 16px 10px}
.map-head h2{font-size:28px;margin:0}
.map-head p{margin:0;flex:1 1 0;min-width:0;color:var(--muted);font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.map-head .icon-btn{flex:none;font-size:24px;line-height:1}
/* on a phone the close button must stay on screen: tighter header, the sky line gives way first */
@media (max-width:430px){ .map-head{gap:6px;padding:12px 12px 8px} .map-head h2{font-size:24px} .map-head .icon-btn{width:36px;height:36px} }
.map-view{position:relative;touch-action:none;cursor:grab;overflow:hidden}
.map-view:active{cursor:grabbing}
.map-view canvas{position:absolute;inset:0;width:100%;height:100%}
.map-key{display:flex;flex-wrap:wrap;gap:6px 14px;margin:0;padding:10px 16px 14px;list-style:none;font-size:13px;font-weight:700;color:var(--muted)}
.map-key li{display:inline-flex;align-items:center;gap:6px}
.map-key i{width:11px;height:11px;border-radius:50%;box-shadow:inset 0 0 0 1.5px rgba(0,0,0,.4)}
.k-you{background:#e8503a}.k-home{background:#1b4b9b;border-radius:2px!important}.k-ball{background:#d9e83c}.k-sniff{background:#b5c341}.k-game{background:#f4c21b}.k-ride{background:#62c4a8}.k-toy{background:#f06fa0}

/* The minimap, toasts, and counts that bump */
.corner{position:absolute;right:12px;top:12px;display:flex;flex-direction:column;align-items:center;gap:8px}
.corner-btns{display:flex;gap:6px;padding:4px;border-radius:999px;background:var(--pill);box-shadow:0 2px 8px rgba(0,0,0,.12)}
.corner-btns .icon-btn{width:34px;height:34px;background:transparent}
.corner-btns .icon-btn:hover{background:var(--line)}
.corner-btns .icon-btn svg{width:18px;height:18px}
.minimap{position:relative;width:136px;height:136px;padding:0;border:0;border-radius:50%;background:var(--pill);box-shadow:0 0 0 3px var(--card),0 0 0 4px var(--line),0 8px 22px rgba(0,0,0,.28);cursor:pointer;overflow:visible}
.minimap canvas{width:100%;height:100%;border-radius:50%;display:block}
.minimap .mm-n{position:absolute;left:50%;top:50%;width:18px;height:18px;border-radius:50%;background:var(--ink);color:var(--card);font:800 11px/18px var(--sans);text-align:center;pointer-events:none}
.toasts{position:absolute;left:50%;top:126px;transform:translateX(-50%);display:grid;grid-template-areas:"t";justify-items:center;width:min(92%,460px);pointer-events:none}
.toast{grid-area:t}                                        /* the leaving one fades in the same spot the new one arrives in */
#hud .mg-bar{top:10px}
#hud:has(.mg-bar:not([hidden])) .toasts{top:70px}
/* in a mini-game the arrow rides at the front of its strip (game.js moves it there), the distance beside it */
.mg-bar .compass{position:static;transform:none;flex-direction:row;gap:4px;margin-left:-8px}
.mg-bar .compass .needle{width:30px;height:30px;filter:none}
.mg-bar #compass-txt{background:none;box-shadow:none;padding:0 4px 0 0;color:var(--card);font-size:15px}
.toast{max-width:100%;padding:10px 16px;border-radius:14px;background:var(--pill);color:var(--ink);font-weight:700;font-size:15px;line-height:1.3;text-align:center;box-shadow:0 8px 24px rgba(0,0,0,.18);
  opacity:0;transform:translateY(-12px) scale(.96);transition:opacity .3s,transform .35s cubic-bezier(.2,1.3,.4,1)}
.toast.in{opacity:1;transform:none}
.toast.out{opacity:0;transform:translateY(-8px) scale(.98)}
.bump{animation:bump .45s cubic-bezier(.2,1.6,.4,1)}
@keyframes bump{30%{transform:scale(1.4)}}
.counts b,#n-score{display:inline-block}
.hearts svg{transition:transform .3s,opacity .3s}
.hearts svg.lost{transform:scale(.8)}
@media (max-width:640px), (max-height:560px){
  .veil{align-items:flex-start;padding:48px 14px 14px;background:linear-gradient(0deg,rgba(15,20,30,.55),rgba(15,20,30,0) 75%)}
  .card{width:100%;max-width:520px;margin:auto auto 0;padding:22px 20px 18px}
  .face{width:92px;height:92px;top:-30px;right:16px}
  .minimap{width:104px;height:104px}
  .corner{right:10px;top:10px}
  .vitals{top:84px}
  .compass .needle{width:48px;height:48px}
  #compass-txt{font-size:13px;padding:3px 10px}
  .card{border-radius:22px}
  .lede{font-size:16px;max-width:none;padding-right:0}
  .goals{font-size:15px;gap:9px}
  .hud-plate .street{font-size:15px}
  .counts{font-size:16px}
}
/* a phone held upright: the top corners are taken by the counts and the minimap, so toasts and the mini-game strip go
   under them, the hint sits above the thumb controls, and the new-area banner clears both */
@media (max-width:640px){
  .compass{top:124px}                                   /* under the street plate and the minimap, still dead centre */
  .toasts{top:206px}
  #hud .mg-bar{top:124px}
  #hud:has(.mg-bar:not([hidden])) .toasts{top:180px}
  .mg-bar .mg-name{display:none}
  .touch .hint{bottom:176px;max-width:92%}
  #hud .area-banner{top:33%}
  body:has(.mapcredit) .veil{padding-bottom:26px}        /* a real place: the map's credit line stays readable under the card, not on top of its last line */
}
@media (max-width:430px){
  #snd{display:none}
  .hearts svg{width:17px;height:17px}
  .hud-plate{left:8px}
  .vitals{left:8px}
  .counts{gap:10px}
  .minimap{width:92px;height:92px}
}
@media (max-width:380px){
  .stick{left:14px;width:120px;height:120px}
  .act{right:14px;width:88px;height:88px}
  .jump{right:110px;width:76px;height:76px}
}
@media (max-height:560px){
  .veil{padding-top:14px}
  .card{max-width:720px;padding:14px 18px 14px}
  .card-top{margin-bottom:8px}
  h1{font-size:34px;margin-bottom:6px}
  h2{font-size:30px;margin-bottom:6px}
  .face{width:70px;height:70px;top:10px;right:14px}
  .lede{font-size:14.5px;margin-bottom:8px;padding-right:84px}
  .goals{grid-template-columns:1fr 1fr;gap:6px 18px;font-size:13.5px;margin-bottom:10px;padding-top:8px}
  .stats{grid-template-columns:1fr auto 1fr auto;font-size:14px;gap:4px 16px;margin-bottom:10px;padding-top:8px}
  .go{padding:11px 18px;font-size:17px}
  .keys{display:none}
  .minimap{width:84px;height:84px}
  .corner-btns .icon-btn{width:30px;height:30px}
  .t-tabs{margin-top:8px}
  .stick{width:112px;height:112px;left:16px;bottom:14px}
  .act{width:82px;height:82px;right:16px;bottom:18px}
  .jump{width:72px;height:72px;right:110px;bottom:22px}
  /* a phone on its side: toasts fit between the counts and the minimap, the hint between the stick and the buttons */
  .compass{top:6px}
  .compass .needle{width:48px;height:48px}
  #compass-txt{font-size:13px;padding:3px 10px}
  .toasts{top:88px;left:232px;transform:none;width:calc(100% - 362px)}
  #hud .mg-bar{top:6px;max-width:calc(100% - 472px)}
  #hud:has(.mg-bar:not([hidden])) .toasts{top:60px}
  .mg-bar .mg-name{display:none}
  .touch .hint{bottom:14px;max-width:calc(100% - 400px)}
  #hud .area-banner{top:34%}
  .stars{margin-bottom:6px}
  .stars svg{width:26px;height:26px}
  .gift{margin-bottom:6px;font-size:14px;padding:3px 11px 3px 7px;max-width:calc(100% - 84px)}
  .gift svg{width:17px;height:17px}
  .note{margin-bottom:10px;padding:8px 14px 9px}
  .note::before{font-size:40px}
  .note blockquote{font-size:14.5px;max-height:4.4em}
  .e-card .stats{min-height:38px}
}
@media (prefers-reduced-motion: reduce){ #flash{transition:none} @keyframes pop{from{opacity:1}to{opacity:0}} }
html.calm *,html.calm *::before,html.calm *::after{animation-duration:.01ms!important;animation-delay:0s!important;transition-duration:.01ms!important}
@media (prefers-color-scheme: dark){ .score .combo{color:#5fd08a} }
.mapcredit{position:fixed;right:8px;bottom:4px;margin:0;font:11px/1.3 var(--sans);color:rgba(25,27,32,.7);background:rgba(255,255,255,.6);padding:1px 6px;border-radius:6px;pointer-events:none;z-index:1}

/* Mini-games: the strip at the top while one runs, the countdown, the result card */
.mg{position:absolute;inset:0;pointer-events:none}
.mg-bar{position:absolute;left:50%;top:12px;transform:translateX(-50%);display:flex;align-items:center;gap:12px;background:var(--ink);color:var(--card);border-radius:999px;padding:7px 8px 7px 16px;font-weight:700;font-size:15px;pointer-events:auto;box-shadow:0 6px 20px rgba(0,0,0,.25);font-variant-numeric:tabular-nums;max-width:calc(100% - 24px)}
.mg-bar .mg-name{font-family:var(--cond);font-weight:800;letter-spacing:.02em;text-transform:uppercase;font-size:13px;opacity:.7}
.mg-bar .mg-main{font-size:20px;font-weight:800;white-space:nowrap}
.mg-bar .mg-sub{font-size:14px;opacity:.85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mg-x{width:30px;height:30px;border-radius:50%;border:0;background:rgba(255,255,255,.14);color:inherit;font-size:20px;line-height:1;cursor:pointer}
.mg-count{position:absolute;left:50%;top:38%;transform:translate(-50%,-50%);font:800 120px/1 var(--sans);color:#fff;text-shadow:0 4px 0 #191b20,0 0 30px rgba(0,0,0,.4)}
.mg-count.pop{animation:mgpop .9s ease-out}
@keyframes mgpop{from{transform:translate(-50%,-50%) scale(1.6);opacity:0}25%{opacity:1}to{transform:translate(-50%,-50%) scale(1);opacity:.9}}
.mg-card{position:absolute;left:50%;top:50%;width:min(92vw,380px);transform:translate(-50%,-46%) scale(.96);opacity:0;background:var(--card);color:var(--ink);border-radius:20px;padding:22px 22px 18px;box-shadow:0 24px 60px rgba(0,0,0,.4);pointer-events:auto;transition:transform .35s cubic-bezier(.2,1.3,.4,1),opacity .25s}
.mg-card.in{transform:translate(-50%,-50%) scale(1);opacity:1}
.mg-card h2{font-size:32px;margin:6px 0 6px}
.mg-res{margin:0 0 12px;font-size:16px;line-height:1.4}
.mg-medal{display:inline-block;font:800 13px/1 var(--cond);letter-spacing:.08em;text-transform:uppercase;padding:7px 12px;border-radius:999px;background:var(--line)}
.mg-medal.m3{background:#f4c21b;color:#191b20}.mg-medal.m2{background:#c9ced6;color:#191b20}.mg-medal.m1{background:#c98a46;color:#191b20}
.mg-stats{display:grid;grid-template-columns:1fr auto;gap:6px 14px;margin:0 0 16px;padding-top:12px;border-top:1px solid var(--line);font-size:15px}
.mg-stats dt{color:var(--muted)}.mg-stats dd{margin:0;font-weight:800;text-align:right;font-variant-numeric:tabular-nums}
.mg-btns{display:grid;gap:8px}
.go.ghost{background:transparent;color:var(--ink);box-shadow:inset 0 0 0 2px var(--line)}
@media (prefers-reduced-motion: reduce){ .mg-card{transition:opacity .2s} .mg-count.pop{animation:none} }

/* The map's extra keys and buttons, and the banner for a new part of town */
.map-head .icon-btn{font-size:22px;font-weight:800}
.map-head .icon-btn svg{width:18px;height:18px}
.k-way{background:#e8503a;border-radius:2px!important;transform:rotate(45deg)}.k-place{background:#c98a46}
/* (its own class: as "hint" it also took the walk's hint line's rules, and floated over the middle of the map) */
.map-key .key-hint{margin-left:auto;font-weight:600;opacity:.75}
.area-banner{position:absolute;left:50%;top:22%;transform:translate(-50%,-8px);text-align:center;pointer-events:none;opacity:0;transition:opacity .6s,transform .8s cubic-bezier(.2,.9,.25,1)}
.area-banner.in{opacity:1;transform:translate(-50%,0)}
.area-banner small{display:block;font:800 13px/1 var(--cond);letter-spacing:.32em;text-transform:uppercase;color:#fff;opacity:.85;text-shadow:0 1px 6px rgba(0,0,0,.6)}
.area-banner b{display:block;margin-top:6px;font:800 clamp(30px,6vw,54px)/1 var(--cond);letter-spacing:.04em;color:#fff;text-shadow:0 2px 0 rgba(0,0,0,.35),0 0 24px rgba(0,0,0,.45)}
.area-banner b::before,.area-banner b::after{content:"";display:inline-block;vertical-align:middle;width:46px;height:2px;margin:0 14px;background:linear-gradient(90deg,transparent,#f4c21b)}
.area-banner b::after{background:linear-gradient(90deg,#f4c21b,transparent)}

/* The start button while the town is built: a bar that fills, a quieter look */
.go.loading{cursor:progress;filter:saturate(.6);background:linear-gradient(90deg,rgba(255,255,255,.22) var(--p,0%),transparent var(--p,0%)),var(--plate)}
.go.loading svg{opacity:0}
.go.loading::after{animation:shine 1.2s linear infinite}
@keyframes shine{from{left:-60%}to{left:120%}}
.go:disabled{pointer-events:none}
