/* Adfree Arcade — a warm paper shell. Every surface is cream, every control a
   soft white card, and the games bring the colour (see tmp/ design refs). */

:root{
  --bg:#FAF4E8; --card:#FFFDF8; --card-2:#FFF9EE; --line:rgba(63,54,45,.08);
  --ink:#3F362D; --ink-dim:#8A7E6F; --ink-faint:#B7AC9B;
  --shadow:0 6px 18px rgba(96,74,46,.12);
  --shadow-big:0 12px 30px rgba(96,74,46,.16);
  --chip-pink-bg:#FBDCE4; --chip-pink:#D5566E;
  --chip-gold-bg:#FBEFD2; --chip-gold:#A87F24;
  --chip-green-bg:#D9F0E4; --chip-green:#2F7A57;
  --chip-purple-bg:#E9E0FA; --chip-purple:#7C5CD1;
  --radius:22px;
  --safe-t:env(safe-area-inset-top,0px);  --safe-b:env(safe-area-inset-bottom,0px);
  --safe-l:env(safe-area-inset-left,0px); --safe-r:env(safe-area-inset-right,0px);
  /* The strip of screen the notch or Dynamic Island sits in. Everything the app
     puts up there is laid out *inside* this band, either side of --notch-w,
     rather than below it — which is the difference between a 60px bar of dead
     space across the top of every game and none at all. On a device with no
     cutout the band is still tall enough for the same controls to be tappable,
     and --notch-w stays 0, so the ears just spread to the two corners.
     js/safe.js measures the cutout and fills --notch-w in. */
  --ear-h:max(var(--safe-t),46px);
  --notch-w:0px;
  /* Height of the app. 100% resolves against the *large* viewport on iOS, i.e.
     the height the page would have if Safari's toolbar were retracted — so the
     bottom of every screen sits underneath the toolbar and is simply not
     visible. `svh` is the small viewport: the height with the browser chrome
     showing. Using it means the board is never clipped, at the cost of a strip
     of unused space on the rare frames where the toolbar is hidden.
     Standalone (installed) has no chrome, so there svh == the whole screen. */
  --app-h:100%;
  --ease:cubic-bezier(.22,1,.36,1);
}
@supports (height:100svh){ :root{ --app-h:100svh } }
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{height:var(--app-h);touch-action:none;overscroll-behavior:none}
body{
  margin:0;background:var(--bg);color:var(--ink);
  font-family:'Fredoka',-apple-system,"SF Pro Display","SF Pro Text",ui-rounded,"Segoe UI Variable","Segoe UI",Roboto,system-ui,sans-serif;
  font-size:16px;line-height:1.4;
  overscroll-behavior:none;                 /* kill rubber-band: reads as native */
  touch-action:none;                        /* no pinch-zoom, no double-tap zoom,
                                               and drags never get stolen by the
                                               browser mid-gesture (iOS ignores
                                               user-scalable=no, so this is the
                                               only reliable lever) */
  -webkit-user-select:none;user-select:none;
  -webkit-font-smoothing:antialiased;
}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none}
h1,h2,h3,p{margin:0}

/* ---------- screens ---------- */
.screen{
  position:fixed;inset:0;height:var(--app-h);display:flex;flex-direction:column;
  opacity:0;visibility:hidden;transform:translateX(18px);
  transition:opacity .26s var(--ease),transform .26s var(--ease),visibility .26s;
}
.screen.show{opacity:1;visibility:visible;transform:none}
.screen.behind{transform:translateX(-14%) scale(.97);opacity:0}

/* ---------- the notch band ----------
   One row pinned to the very top, split into a left ear, the width of the
   cutout, and a right ear. Nothing in it is a bar: the row ignores pointers so
   whatever is underneath keeps the whole screen, and each control claims its
   own back. */
.ears{
  position:absolute;z-index:20;top:0;left:0;right:0;height:var(--ear-h);
  display:flex;align-items:center;
  padding-left:max(var(--safe-l),10px);padding-right:max(var(--safe-r),10px);
  pointer-events:none;
}
.ear{flex:1 1 0;min-width:0;display:flex;align-items:center;gap:8px}
.ear.right{justify-content:flex-end}
.ear>*{pointer-events:auto}
.notch{flex:0 0 var(--notch-w);align-self:stretch}

/* The one number worth carrying up beside the cutout: a soft mint chip, like
   the level badge on the design sheets. */
.level-chip{
  display:inline-flex;align-items:center;line-height:1.15;
  font-size:11.5px;font-weight:700;color:var(--chip-green);white-space:nowrap;
  background:var(--chip-green-bg);border:1px solid rgba(47,122,87,.14);
  padding:5px 11px;border-radius:14px;box-shadow:var(--shadow);
  overflow:hidden;text-overflow:ellipsis;
}

/* ---------- home ---------- */
.home-bg{flex:1;min-height:0;position:relative;display:flex;flex-direction:column;
  background:var(--bg);padding-top:var(--ear-h)}
.header{display:flex;align-items:center;justify-content:center;
  padding:2px 16px 10px;pointer-events:none;flex:none}
.header h1{font-size:25px;font-weight:600;color:var(--ink);letter-spacing:.01em}

/* Resource chips under the title. Real numbers — games started, coins earned,
   best score — wearing the design sheet's candy chip shapes. */
.chip-row{flex:none;display:flex;justify-content:center;gap:10px;
  padding:0 max(var(--safe-l),14px) 12px max(var(--safe-r),14px)}
.chip-row:empty{display:none}
.chip{
  display:inline-flex;align-items:center;gap:6px;
  font-size:13.5px;font-weight:700;font-variant-numeric:tabular-nums;
  padding:7px 14px;border-radius:99px;box-shadow:var(--shadow);
  border:1px solid rgba(63,54,45,.05);white-space:nowrap;
}
.chip .ico{font-size:14px;line-height:1}
.chip.pink{background:var(--chip-pink-bg);color:var(--chip-pink)}
.chip.gold{background:var(--chip-gold-bg);color:var(--chip-gold)}
.chip.green{background:var(--chip-green-bg);color:var(--chip-green)}
.chip.purple{background:var(--chip-purple-bg);color:var(--chip-purple)}

/* The grid itself scrolls; everything around it stays put. touch-action must
   open pan-y back up here — the body locks all gestures for the games' sake,
   and without this override the card list simply refuses to move. */
#shelves{flex:1 1 0;min-height:0;overflow-y:auto;touch-action:pan-y;
  overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
  padding:2px max(var(--safe-r),14px) 10px max(var(--safe-l),14px)}
.shelf-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;
  max-width:520px;margin:0 auto}
@media (min-width:700px){ .shelf-grid{grid-template-columns:repeat(3,1fr);max-width:760px} }

.game-card{
  display:flex;flex-direction:column;text-align:left;
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  padding:12px 12px 13px;box-shadow:var(--shadow);
  transition:transform .14s var(--ease),box-shadow .14s;
}
.game-card:active{transform:scale(.965);box-shadow:0 3px 10px rgba(96,74,46,.14)}
.card-art{display:block;border-radius:14px;background:var(--card-2);
  padding:10px 6px;margin-bottom:10px}
.card-art svg{display:block;width:100%;height:auto}
.card-foot{display:flex;align-items:center;gap:9px;min-width:0}
.card-mini{flex:none;width:34px;height:34px;border-radius:11px;background:var(--card-2);
  display:grid;place-items:center;border:1px solid var(--line)}
.card-mini svg{width:22px;height:22px;display:block}
.card-text{display:flex;flex-direction:column;gap:3px;min-width:0}
.card-name{font-size:15.5px;font-weight:600;color:var(--ink);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card-badge{align-self:flex-start;font-size:11px;font-weight:700;
  padding:2px 9px;border-radius:99px;
  background:var(--chip-gold-bg);color:var(--chip-gold);
  white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.card-badge.new{background:var(--chip-green-bg);color:var(--chip-green)}

.foot{flex:none;text-align:center;font-size:11px;color:var(--ink-faint);
  padding:6px 16px;pointer-events:none}

/* Bottom navigation card, as on the sheet. */
.home-nav{
  flex:none;display:flex;gap:6px;
  margin:0 max(var(--safe-r),12px) calc(var(--safe-b) + 10px) max(var(--safe-l),12px);
  padding:7px;border-radius:24px;
  background:var(--card);border:1px solid var(--line);box-shadow:var(--shadow-big);
}
.nav-item{
  flex:1 1 0;min-width:0;position:relative;
  display:flex;flex-direction:column;align-items:center;gap:3px;
  padding:9px 2px 7px;border-radius:17px;color:var(--ink-dim);
  transition:transform .12s var(--ease),background .15s,color .15s;
}
.nav-item span{font-size:10.5px;font-weight:600;max-width:100%;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nav-item.is-on{color:var(--ink);background:var(--card-2)}
.nav-item:active{transform:translateY(1px) scale(.97)}

/* ---------- play host ---------- */
/* The play chrome lives in the ears (see .ears above): back button and title in
   the left one, score in the right, nothing between them but the cutout. */
.play-head h2{font-size:16px;font-weight:600;letter-spacing:-.01em;color:var(--ink);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;
  text-shadow:0 1px 5px rgba(255,255,255,.7)}
.icon-btn{
  width:40px;height:40px;border-radius:50%;display:grid;place-items:center;flex:none;
  background:var(--card);border:1px solid var(--line);color:var(--ink);
  box-shadow:var(--shadow);
  transition:transform .12s var(--ease),background .12s;
}
.icon-btn:active{transform:scale(.9);background:#F3ECE1}
/* The score reads as a badge tucked beside the cutout rather than a line of
   text in a header, because a badge is the only shape that fits an ear. */
.stat{font-size:13px;font-weight:700;color:var(--chip-green);
  font-variant-numeric:tabular-nums;white-space:nowrap;
  background:var(--chip-green-bg);border:1px solid rgba(47,122,87,.14);
  box-shadow:var(--shadow);
  padding:6px 12px;border-radius:99px;
  max-width:100%;overflow:hidden;text-overflow:ellipsis}
.stat:empty{display:none}
/* Two-line score badge: the level is the thing you are on, the best is the
   thing you are chasing, and stacking them keeps both inside one ear. */
.stat.two{display:flex;flex-direction:column;align-items:flex-end;gap:0;line-height:1.16;padding:5px 12px}
.stat .stat-sub{font-size:10.5px;font-weight:700;opacity:.72}
/* Full-bleed on purpose: the game owns every pixel, including the ones behind
   the notch and the home indicator, and the chrome floats on top of it. */
.stage{position:absolute;inset:0;overflow:hidden;display:flex;flex-direction:column;background:var(--bg)}

/* The chrome is light everywhere now, so the light skin *is* the default look.
   The class stays because games still request it on mount and hand it back on
   teardown, and a future dark scene may want the inverse again. */
#play.skin-light .play-head h2{color:var(--ink)}

/* ---------- shared game primitives ---------- */
.pill{
  display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:99px;
  background:var(--card);border:1px solid var(--line);box-shadow:var(--shadow);
  font-size:14px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--ink);
}
/* Every bottle sorted. The counter and the board are saying the same thing in
   the same gold. */
.pill.hot{
  background:var(--chip-gold-bg);border-color:rgba(168,127,36,.25);color:var(--chip-gold);
  box-shadow:0 0 0 1px rgba(245,197,66,.25),0 4px 18px rgba(245,197,66,.3);
}
.bar{display:flex;align-items:center;justify-content:center;gap:9px;padding:4px 16px 12px;flex:none}
.tool-row{display:flex;justify-content:center;gap:10px;padding:12px 16px calc(var(--safe-b) + 14px);flex:none}
.tool{
  min-width:64px;height:56px;border-radius:18px;display:grid;place-items:center;
  background:var(--card);border:1px solid var(--line);box-shadow:var(--shadow);
  font-size:21px;position:relative;color:var(--ink);
  transition:transform .12s var(--ease);
}
.tool:active{transform:translateY(2px) scale(.96)}
.tool[disabled]{opacity:.4;box-shadow:none}
.tool .cnt{position:absolute;top:-5px;right:-5px;font-size:11px;font-weight:700;
  background:var(--chip-pink);color:#fff;padding:1px 7px;border-radius:99px;border:2px solid var(--bg)}

/* ---------- modal ---------- */
.modal{position:fixed;inset:0;z-index:60;background:rgba(63,54,45,.32);
  display:flex;align-items:center;justify-content:center;padding:24px;
  backdrop-filter:blur(10px);animation:fade .2s var(--ease)}
@keyframes fade{from{opacity:0}}
[hidden]{display:none!important}
.modal-card{
  width:100%;max-width:330px;background:var(--card);border:1px solid var(--line);
  border-radius:26px;padding:24px 20px;text-align:center;
  box-shadow:0 24px 60px rgba(96,74,46,.35);animation:pop .26s var(--ease);
}
@keyframes pop{from{transform:scale(.9) translateY(12px);opacity:0}}
.modal-card h2{font-size:22px;font-weight:600;margin-bottom:6px}
.modal-card p{font-size:14.5px;color:var(--ink-dim);margin:5px 0}
.big-num{font-size:44px;font-weight:600;letter-spacing:-.02em;margin:6px 0;font-variant-numeric:tabular-nums}
.btns{display:flex;flex-direction:column;gap:9px;margin-top:18px}
.btn{
  padding:14px;border-radius:16px;font-size:16px;font-weight:600;
  background:var(--card-2);border:1px solid var(--line);color:var(--ink);
  box-shadow:var(--shadow);
  transition:transform .12s var(--ease),filter .12s;
}
.btn:active{transform:translateY(2px)}
.btn.primary{background:linear-gradient(180deg,#F58BA8,#EF6F92);border-color:transparent;color:#fff;
  box-shadow:0 6px 18px rgba(213,86,110,.35)}
.btn.ghost{background:transparent;border:1px solid var(--line);color:var(--ink-dim);box-shadow:none}
.row{display:flex;align-items:center;justify-content:space-between;
  padding:13px 2px;border-bottom:1px solid var(--line);font-size:15px;font-weight:600}
.row:last-of-type{border-bottom:0}
.switch{width:50px;height:30px;border-radius:99px;background:#E5DBC9;position:relative;transition:background .2s}
.switch[aria-checked="true"]{background:#5FBC85}
.switch::after{content:"";position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;
  background:#fff;box-shadow:0 2px 6px rgba(63,54,45,.25);transition:transform .2s var(--ease)}
.switch[aria-checked="true"]::after{transform:translateX(20px)}

/* ---------- toast + confetti ---------- */
.toast{
  position:fixed;left:50%;bottom:calc(var(--safe-b) + 92px);transform:translateX(-50%) translateY(10px);
  background:var(--card);border:1px solid var(--line);color:var(--ink);
  box-shadow:var(--shadow-big);
  padding:10px 17px;border-radius:99px;font-size:14px;font-weight:600;
  opacity:0;transition:.24s var(--ease);pointer-events:none;z-index:70;
  max-width:88vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.fx-layer{position:fixed;inset:0;pointer-events:none;z-index:65;overflow:hidden}
.confetti{position:absolute;top:-14px;width:9px;height:15px;border-radius:2px;
  animation:fall linear forwards}
@keyframes fall{to{transform:translateY(105vh) rotate(720deg);opacity:.15}}

@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* ================= Games =================
   Every game is a three.js scene, so the only DOM each one needs is a
   full-bleed positioning context plus a couple of overlays. The stage owns the
   canvas and sizes it inline; nothing here may set its width or height. */
.game-wrap{flex:1;position:relative;overflow:hidden;
  /* Invisible padding, read by gl.js as "keep the playfield out of here". The
     scene still renders to all four corners; only the framing respects it. */
  padding:var(--ear-h) var(--safe-r) calc(var(--safe-b) + 6px) var(--safe-l)}
.game-hud{position:absolute;z-index:2;top:calc(var(--ear-h) + 6px);left:0;right:0;
  display:flex;justify-content:center;gap:10px;pointer-events:none}
/* Buy button in the HUD. The HUD ignores pointers so a shot aimed high still
   reaches the canvas underneath it — this one control opts back in, and gives
   up that claim again the moment it is disabled. */
.hud-buy{
  pointer-events:auto;
  display:inline-flex;align-items:center;gap:5px;padding:7px 13px;border-radius:99px;
  font-size:13px;font-weight:700;font-variant-numeric:tabular-nums;
  color:var(--chip-gold);background:var(--chip-gold-bg);
  border:1px solid rgba(168,127,36,.2);box-shadow:0 3px 16px rgba(245,197,66,.3);
  transition:transform .12s var(--ease);
}
.hud-buy:active{transform:translateY(1px) scale(.96)}
.hud-buy[disabled]{
  pointer-events:none;opacity:.42;box-shadow:none;
  background:var(--card);border-color:var(--line);color:var(--ink-faint);
}
.game-note{position:absolute;z-index:2;top:calc(var(--ear-h) + 46px);left:0;right:0;
  display:flex;justify-content:center;gap:8px;flex-wrap:wrap;
  pointer-events:none;font-size:11px;color:var(--ink-dim)}
.game-note span{background:var(--card);border:1px solid var(--line);border-radius:999px;padding:3px 10px}
.game-wrap .tool-row{position:absolute;z-index:2;left:0;right:0;
  bottom:calc(14px + var(--safe-b));
  display:flex;justify-content:center;gap:10px}

/* ---------- install hint ----------
   The only way to actually remove the browser's toolbar is to run standalone,
   so the app asks once. Hidden entirely when already installed. */
.install-tip{
  position:fixed;z-index:80;left:12px;right:12px;
  bottom:calc(12px + var(--safe-b));
  display:flex;align-items:center;gap:12px;
  padding:12px 14px;border-radius:18px;
  background:var(--card);border:1px solid var(--line);
  box-shadow:var(--shadow-big);
  transform:translateY(140%);transition:transform .32s var(--ease);
}
.install-tip.show{transform:none}
.install-tip p{flex:1;font-size:13.5px;line-height:1.35;color:var(--ink)}
.install-tip b{font-weight:700}
.install-tip .btn{padding:9px 14px;border-radius:12px;font-size:14px;flex:none}
.install-tip .x{
  width:30px;height:30px;border-radius:50%;flex:none;
  display:grid;place-items:center;color:var(--ink-faint);font-size:18px;
}
@media (display-mode:standalone){ .install-tip{display:none} }

/* ================= Sudoku =================
   Progress and hearts above the board, the three rules and the two tools below
   it — the same warm cards as everywhere else. The canvas is absolutely
   positioned and painted after this DOM, so everything here needs its own
   z-index; the wrap's padding keeps the framed board clear of the cards. */
.game-wrap.mdk{
  padding:calc(var(--ear-h) + 66px) max(var(--safe-r),12px)
          calc(var(--safe-b) + 168px) max(var(--safe-l),12px);
}
.mdk-top{position:absolute;z-index:2;top:calc(var(--ear-h) + 8px);
  left:max(var(--safe-l),12px);right:max(var(--safe-r),12px);
  display:flex;align-items:stretch;gap:10px;pointer-events:none}
.mdk-card{background:var(--card);border:1px solid var(--line);
  border-radius:16px;box-shadow:var(--shadow);padding:9px 14px}
.mdk-prog{flex:1 1 0;min-width:0}
.mdk-prog-head{display:flex;justify-content:space-between;gap:8px;
  font-size:12.5px;font-weight:700;color:var(--ink);margin-bottom:6px}
.mdk-prog-head b{color:var(--chip-purple);font-variant-numeric:tabular-nums}
.mdk-bar{height:8px;border-radius:99px;background:#EFE7D8;overflow:hidden}
.mdk-bar i{display:block;height:100%;width:0;border-radius:99px;
  background:linear-gradient(90deg,#8B7CE8,#B59BF0);transition:width .3s var(--ease)}
.mdk-lives{display:flex;align-items:center;gap:7px;
  font-size:15px;font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums}
.mdk-lives .heart{font-size:16px;line-height:1}
.mdk-lives.low b{color:var(--chip-pink)}
.mdk-bottom{position:absolute;z-index:2;
  left:max(var(--safe-l),12px);right:max(var(--safe-r),12px);
  bottom:calc(var(--safe-b) + 12px);
  display:flex;flex-direction:column;gap:12px;pointer-events:none}
.mdk-rules{display:flex;gap:8px}
.mdk-rule{flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:6px;
  background:var(--card);border:1px solid var(--line);
  border-radius:16px;box-shadow:var(--shadow);padding:10px 10px}
.mdk-rule p{font-size:10.5px;line-height:1.3;color:var(--ink);font-weight:600;margin:0}
.mdk-rule .ic{display:block;line-height:0}
.mdk-tools{display:flex;justify-content:space-between;gap:10px}
.mdk-btn{pointer-events:auto;display:inline-flex;align-items:center;gap:7px;
  padding:11px 24px;border-radius:99px;
  background:var(--card);border:1px solid var(--line);box-shadow:var(--shadow);
  font-size:14px;font-weight:600;color:var(--ink);
  transition:transform .12s var(--ease)}
.mdk-btn:active{transform:translateY(1px) scale(.97)}
.mdk-btn .ic{line-height:0;font-size:16px}

/* ================= Crate Smash =================
   A light HUD for a light scene. Every surface here is the same warm white
   card at the same radius; what changes between them is only what they hold. */
.game-wrap.sf{
  padding:calc(var(--ear-h) + 56px) max(var(--safe-r),10px)
          calc(var(--safe-b) + 104px) max(var(--safe-l),10px);
}
/* The counters become one rail rather than four floating pills, because they
   are read together — how much is left against what it costs to keep going. */
.game-wrap.sf .game-hud{
  top:calc(var(--ear-h) + 8px);
  left:max(var(--safe-l),10px);right:max(var(--safe-r),10px);
  justify-content:space-between;gap:0;padding:5px;
  background:rgba(255,253,250,.93);border:1px solid rgba(120,96,64,.1);
  border-radius:20px;box-shadow:0 6px 20px rgba(96,74,46,.16);
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
}
.game-wrap.sf .game-hud>*{flex:1 1 0;min-width:0;justify-content:center}
.game-wrap.sf .game-hud>*+*{border-left:1px solid rgba(120,96,64,.13)}
.game-wrap.sf .game-hud .pill{
  background:none;border:0;box-shadow:none;color:#4a4038;font-size:14.5px;font-weight:700;
  padding:6px 4px;gap:5px;
}
.sf-chip svg{width:19px;height:19px;flex:none}
.sf-chip i{font-style:normal;font-weight:700;font-size:12px;opacity:.5}
.sf-chip-goal{color:#d5566e}
.sf-life{
  display:inline-flex;align-items:center;gap:5px;padding:6px 4px;
  font-size:14.5px;font-weight:700;color:#4a4038;font-variant-numeric:tabular-nums;
}
.sf-life svg{width:19px;height:19px;flex:none}
/* The HUD ignores pointers so a shot aimed high still reaches the canvas
   underneath it. This one control opts back in, and gives up the claim again
   the moment there is nothing left to buy. */
.sf-plus{
  pointer-events:auto;width:22px;height:22px;border-radius:50%;flex:none;
  display:grid;place-items:center;line-height:1;
  font-size:15px;font-weight:700;color:#7a6a58;background:rgba(120,96,64,.1);
  transition:transform .12s var(--ease);
}
.sf-plus:active{transform:scale(.88)}
.sf-plus[disabled]{opacity:.3;pointer-events:none}

/* The objective, said once and loudly. The rail carries the same number, but
   the rail is a row of running totals and this is the win condition. */
.sf-goal{
  position:absolute;z-index:2;pointer-events:none;
  top:calc(var(--ear-h) + 62px);left:max(var(--safe-l),12px);
  display:flex;flex-direction:column;align-items:flex-start;
  padding:8px 15px;border-radius:16px;
  background:rgba(255,253,250,.93);border:1px solid rgba(120,96,64,.1);
  box-shadow:0 6px 18px rgba(96,74,46,.16);
}
.sf-goal-n{font-size:22px;font-weight:700;line-height:1.05;color:#d5566e;font-variant-numeric:tabular-nums}
.sf-goal-l{font-size:11px;font-weight:700;color:#7a6a58}

/* Shown at the top of a level and gone the moment the first shot goes out —
   an instruction that outstays the moment it was needed is just clutter. */
.sf-hint{
  position:absolute;z-index:2;pointer-events:none;
  left:0;right:0;margin-inline:auto;width:max-content;max-width:80%;
  bottom:calc(var(--safe-b) + 106px);
  padding:10px 22px;border-radius:99px;
  background:rgba(255,253,250,.93);border:1px solid rgba(120,96,64,.1);
  box-shadow:0 6px 18px rgba(96,74,46,.18);
  font-size:16px;font-weight:600;color:#4a4038;
  opacity:0;transform:translateY(8px);
  transition:opacity .3s var(--ease),transform .3s var(--ease);
}
.sf-hint.show{opacity:1;transform:none}

.sf-tools{
  position:absolute;z-index:2;
  left:max(var(--safe-l),10px);right:max(var(--safe-r),10px);
  bottom:calc(var(--safe-b) + 10px);
  display:flex;gap:5px;padding:6px;
  background:rgba(255,253,250,.93);border:1px solid rgba(120,96,64,.1);
  border-radius:22px;box-shadow:0 8px 24px rgba(96,74,46,.18);
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
}
.sf-tool{
  flex:1 1 0;min-width:0;position:relative;
  display:flex;flex-direction:column;align-items:center;gap:3px;
  padding:9px 2px 7px;border-radius:16px;
  background:transparent;border:2px solid transparent;
  transition:transform .12s var(--ease),background .15s,border-color .15s;
}
.sf-tool-i{width:30px;height:30px;flex:none}
.sf-tool-i svg{display:block;width:100%;height:100%}
.sf-tool-l{
  font-size:10px;font-weight:600;letter-spacing:-.01em;color:#6b5c4a;max-width:100%;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.sf-tool-n{
  position:absolute;top:2px;right:4px;min-width:17px;padding:0 4px;
  font-size:10px;font-weight:700;line-height:17px;text-align:center;
  color:#5d4b36;background:#f4e7cf;border-radius:99px;
  font-variant-numeric:tabular-nums;
}
.sf-tool.is-on{background:#f1f8ff;border-color:#9bd1f5;box-shadow:0 0 0 3px rgba(155,209,245,.28)}
.sf-tool.is-on .sf-tool-l{color:#2f6d9e}
.sf-tool:active{transform:translateY(1px) scale(.97)}
.sf-tool[disabled]{opacity:.38}

/* Slow Time is a state, not an event, so it gets a state's feedback: the frame
   itself cools down and stays cooled until the charge runs out. */
.game-wrap.sf.sf-slow::after{
  content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
  box-shadow:inset 0 0 90px rgba(63,143,208,.42);
  animation:sf-pulse 1.7s ease-in-out infinite;
}
@keyframes sf-pulse{50%{box-shadow:inset 0 0 130px rgba(63,143,208,.6)}}
