/* UI v2 kit for "warpaths" (forged) : generated, do not edit. Source: uiv2/kit */
:root{--ui-img-panel:url(../../theme/ui/panel.png);--ui-img-well:url(../../theme/ui/well.png);--ui-img-btn-main:url(../../theme/ui/btn-main.png);--ui-img-btn-main-down:url(../../theme/ui/btn-main-down.png);--ui-img-btn-second:url(../../theme/ui/btn-second.png);--ui-img-btn-second-down:url(../../theme/ui/btn-second-down.png);--ui-img-btn-war:url(../../theme/ui/btn-war.png);--ui-img-btn-war-down:url(../../theme/ui/btn-war-down.png);--ui-img-btn-icon:url(../../theme/ui/btn-icon.png);--ui-img-btn-icon-down:url(../../theme/ui/btn-icon-down.png);--ui-img-card:url(../../theme/ui/card.png);--ui-img-bar:url(../../theme/ui/bar.png);--ui-img-tag:url(../../theme/ui/tag.png);--ui-img-plaque:url(../../theme/ui/plaque.png);--ui-img-coin:url(../../theme/ui/coin.png);--ui-img-heart:url(../../theme/ui/heart.png);--ui-img-heart-broken:url(../../theme/ui/heart-broken.png);--ui-img-heart-empty:url(../../theme/ui/heart-empty.png);--ui-img-star:url(../../theme/ui/star.png);--ui-img-star-empty:url(../../theme/ui/star-empty.png);--ui-img-lock:url(../../theme/ui/lock.png);--ui-img-skull:url(../../theme/ui/skull.png);--ui-img-corner-ornament:url(../../theme/ui/corner-ornament.png);--ui-img-divider:url(../../theme/ui/divider.png);--ui-img-crest:url(../../theme/ui/crest.png);--ui-img-torch:url(../../theme/ui/torch.png);--ui-img-lamp:url(../../theme/ui/lamp.png);--ui-img-spark:url(../../theme/ui/spark.png);--ui-img-bg-tile:url(../../theme/ui/bg-tile.png);--ui-img-door-l:url(../../theme/ui/door-l.png);--ui-img-door-r:url(../../theme/ui/door-r.png);--ui-img-role-tank:url(../../theme/ui/role-tank.png);--ui-img-role-ranged:url(../../theme/ui/role-ranged.png);--ui-img-role-healer:url(../../theme/ui/role-healer.png);--ui-img-role-aura:url(../../theme/ui/role-aura.png);--ui-img-role-assassin:url(../../theme/ui/role-assassin.png);--ui-img-role-mage:url(../../theme/ui/role-mage.png);--ui-img-victory:url(../../theme/ui/victory.png);--ui-img-defeat:url(../../theme/ui/defeat.png);}
/* UI v2 roles — written once, skin-neutral, tokens only.
   A role name between two percent signs is replaced by tools/compile.py with the game's selector list for that role (kit/games/<id>.json),
   wrapped so it outranks page CSS; a role with no selectors compiles to a selector that matches nothing.
   House rules for this file (and for games/<id>.css):
     - never set `display` (it would un-hide elements the page hides with a class) and never set `position`
       except through :where() (zero weight), so absolutely / fixed positioned page elements keep working;
     - frames are 9-slice border-images drawn at 2x, pixelated; the label sits on the calm centre;
     - `image-rendering` is inherited, so every role resets it on its children with zero weight. */

:where(:is(.info):not(#\9#\9),:not(*),:is(.sheet .btn:not(.ghost)):not(#\9#\9),:is(#prevBtn,#nextBtn,#levelsBtn,.sheet .btn.ghost,.shield):not(#\9#\9),:not(*),:is(.iconbtn,#clearBtn,#hintBtn):not(#\9#\9),:not(*),:not(*),:not(*),:not(*),:is(.sheet):not(#\9#\9),:is(.topbar):not(#\9#\9),:not(*),:is(.chip):not(#\9#\9)) > *{image-rendering:auto}
:where(:is(.sheet .btn:not(.ghost)):not(#\9#\9),:is(#prevBtn,#nextBtn,#levelsBtn,.sheet .btn.ghost,.shield):not(#\9#\9),:not(*),:is(.iconbtn,#clearBtn,#hintBtn):not(#\9#\9),:is(.sheet):not(#\9#\9),:not(*),:not(*)){position:relative}

/* ------------------------------------------------------------------ panel / well / bar / modal */
:is(.info):not(#\9#\9),:is(.sheet):not(#\9#\9){
  border-style:solid;border-color:transparent;border-width:var(--ui-panel-edge);
  border-image:var(--ui-img-panel) var(--ui-panel-slice) fill / var(--ui-panel-bw) / 0 round;
  background:none;border-radius:0;box-shadow:var(--ui-panel-shadow);image-rendering:pixelated;color:var(--ui-panel-ink)}
:not(*),:not(*){
  border-style:solid;border-color:transparent;border-width:var(--ui-well-edge);
  border-image:var(--ui-img-well) var(--ui-well-slice) fill / var(--ui-well-bw) / 0 round;
  background:none;border-radius:0;box-shadow:none;image-rendering:pixelated;color:var(--ui-well-ink)}
:not(*){border-width:var(--ui-slot-edge)}
:is(.topbar):not(#\9#\9){
  border-style:solid;border-color:transparent;border-width:var(--ui-bar-edge);
  border-image:var(--ui-img-bar) var(--ui-bar-slice) fill / var(--ui-bar-bw) / 0 round;
  background:none;border-radius:0;box-shadow:none;image-rendering:pixelated;color:var(--ui-bar-ink)}

:is(.sheet):not(#\9#\9){box-shadow:var(--ui-modal-shadow);animation:var(--ui-modal-anim)}
/* one small ornament in the top-right corner (the corner a heading never reaches) */
:is(.sheet):not(#\9#\9)::before{content:"";display:var(--ui-ornament-display);position:absolute;right:3px;top:3px;width:48px;height:48px;pointer-events:none;
  background:var(--ui-img-corner-ornament) 0 0/48px 48px no-repeat;image-rendering:pixelated;scale:-1 1;opacity:.85}

/* ------------------------------------------------------------------ buttons: main / second / war */
:is(.sheet .btn:not(.ghost)):not(#\9#\9),:is(#prevBtn,#nextBtn,#levelsBtn,.sheet .btn.ghost,.shield):not(#\9#\9),:not(*),:not(*),:not(*){
  border-style:solid;border-color:transparent;border-width:var(--ui-btn-edge);
  background:none;border-radius:0;box-shadow:none;outline-offset:1px;image-rendering:pixelated;
  font-family:var(--ui-font-display);font-weight:var(--ui-btn-weight);letter-spacing:var(--ui-btn-track);text-transform:var(--ui-btn-case);
  text-decoration:none;cursor:pointer;opacity:1;filter:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
:is(.sheet .btn:not(.ghost)):not(#\9#\9),:not(*){border-image:var(--ui-img-btn-main) var(--ui-btn-slice) fill / var(--ui-btn-bw) / 0 round;color:var(--ui-btn-main-ink);text-shadow:var(--ui-btn-main-ts)}
:is(#prevBtn,#nextBtn,#levelsBtn,.sheet .btn.ghost,.shield):not(#\9#\9){border-image:var(--ui-img-btn-second) var(--ui-btn-slice) fill / var(--ui-btn-bw) / 0 round;color:var(--ui-btn-second-ink);text-shadow:var(--ui-btn-second-ts)}
:not(*){border-image:var(--ui-img-btn-war) var(--ui-btn-slice) fill / var(--ui-btn-bw) / 0 round;color:var(--ui-btn-war-ink);text-shadow:var(--ui-btn-war-ts)}
:not(*){border-image:var(--ui-img-btn-second-down) var(--ui-btn-slice) fill / var(--ui-btn-bw) / 0 round;border-width:var(--ui-btn-edge-down);color:var(--ui-tab-ink);text-shadow:var(--ui-shadow-text)}
:not(*){border-width:var(--ui-btn-edge);color:var(--ui-tab-on-ink)}

/* pressed: the plate drops into its socket (image swap) and the label drops with it; no layout change */
:is(.sheet .btn:not(.ghost)):not(#\9#\9):active,:is(.sheet .btn:not(.ghost)):not(#\9#\9).ui-press{border-image-source:var(--ui-img-btn-main-down);border-width:var(--ui-btn-edge-down);filter:var(--ui-btn-press-filter)}
:is(#prevBtn,#nextBtn,#levelsBtn,.sheet .btn.ghost,.shield):not(#\9#\9):active,:is(#prevBtn,#nextBtn,#levelsBtn,.sheet .btn.ghost,.shield):not(#\9#\9).ui-press{border-image-source:var(--ui-img-btn-second-down);border-width:var(--ui-btn-edge-down);filter:var(--ui-btn-press-filter)}
:not(*):active,:not(*).ui-press{border-image-source:var(--ui-img-btn-war-down);border-width:var(--ui-btn-edge-down);filter:var(--ui-btn-press-filter)}
:is(.sheet .btn:not(.ghost)):not(#\9#\9):active,:is(#prevBtn,#nextBtn,#levelsBtn,.sheet .btn.ghost,.shield):not(#\9#\9):active,:not(*):active,:is(.iconbtn,#clearBtn,#hintBtn):not(#\9#\9):active,:is(.sheet .btn:not(.ghost)):not(#\9#\9).ui-press,:is(#prevBtn,#nextBtn,#levelsBtn,.sheet .btn.ghost,.shield):not(#\9#\9).ui-press,:not(*).ui-press,:is(.iconbtn,#clearBtn,#hintBtn):not(#\9#\9).ui-press{transform:none;box-shadow:none}

/* main: slow sheen (forged) / underglow pulse (neon).  war: a glow that breathes under the plate. */
:is(.sheet .btn:not(.ghost)):not(#\9#\9)::after{content:"";position:absolute;inset:var(--ui-sheen-inset);pointer-events:none;
  background:var(--ui-sheen) 160% 0/260% 100% no-repeat;animation:ui-sheen 5.6s linear infinite}
:is(.sheet .btn:not(.ghost)):not(#\9#\9)::before,:not(*)::before{content:"";position:absolute;left:9%;right:9%;bottom:-12px;height:14px;pointer-events:none;
  background:radial-gradient(closest-side,var(--ui-glow-main),transparent);animation:ui-glow 2.2s ease-in-out infinite alternate}
:is(.sheet .btn:not(.ghost)):not(#\9#\9)::before{display:var(--ui-glow-main-display)}
:not(*)::before{background:radial-gradient(closest-side,var(--ui-glow-war),transparent);animation-duration:1.5s}
@keyframes ui-sheen{0%,70%{background-position:160% 0}100%{background-position:-60% 0}}
@keyframes ui-glow{from{opacity:.35}to{opacity:1}}

/* icon button */
:is(.iconbtn,#clearBtn,#hintBtn):not(#\9#\9){
  border-style:solid;border-color:transparent;border-width:var(--ui-icon-edge);
  border-image:var(--ui-img-btn-icon) var(--ui-icon-slice) fill / var(--ui-icon-bw) / 0 round;
  background:none;border-radius:0;box-shadow:none;image-rendering:pixelated;color:var(--ui-icon-ink);text-shadow:var(--ui-shadow-text);
  text-decoration:none;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
:is(.iconbtn,#clearBtn,#hintBtn):not(#\9#\9):active,:is(.iconbtn,#clearBtn,#hintBtn):not(#\9#\9).ui-press{border-image-source:var(--ui-img-btn-icon-down);border-width:var(--ui-icon-edge-down);filter:var(--ui-btn-press-filter)}

/* disabled: grey, no glow, no sheen (attribute or the usual page classes) */
:is(:is(.sheet .btn:not(.ghost)):not(#\9#\9),:is(#prevBtn,#nextBtn,#levelsBtn,.sheet .btn.ghost,.shield):not(#\9#\9),:not(*),:is(.iconbtn,#clearBtn,#hintBtn):not(#\9#\9)):is(:disabled,[disabled],[aria-disabled="true"],.dis,.disabled,.locked){
  filter:var(--ui-btn-off-filter);cursor:default;text-shadow:none}
:is(:is(.sheet .btn:not(.ghost)):not(#\9#\9),:not(*)):is(:disabled,[disabled],[aria-disabled="true"],.dis,.disabled,.locked)::before,
:is(:is(.sheet .btn:not(.ghost)):not(#\9#\9),:not(*)):is(:disabled,[disabled],[aria-disabled="true"],.dis,.disabled,.locked)::after{display:none}

/* ------------------------------------------------------------------ card / tag / chip */
:not(*){
  border-style:solid;border-color:transparent;border-width:var(--ui-card-edge);
  border-image:var(--ui-img-card) var(--ui-card-slice) fill / var(--ui-card-bw) / 0 round;
  background:none;border-radius:0;box-shadow:none;image-rendering:pixelated;color:var(--ui-card-ink);text-shadow:var(--ui-card-ts)}
:not(*){
  border-style:solid;border-color:transparent;border-width:var(--ui-tag-edge);
  border-image:var(--ui-img-tag) var(--ui-tag-slice) fill / var(--ui-tag-bw) / 0 round;
  background:none;border-radius:0;box-shadow:none;image-rendering:pixelated;color:var(--ui-tag-ink);text-shadow:var(--ui-shadow-text);font-weight:800}
:is(.chip):not(#\9#\9){
  border-style:solid;border-color:transparent;border-width:var(--ui-chip-edge);
  border-image:var(--ui-img-well) var(--ui-well-slice) fill / var(--ui-well-bw) / 0 round;
  background:none;border-radius:0;box-shadow:none;image-rendering:pixelated;color:var(--ui-chip-ink);text-shadow:var(--ui-shadow-text);
  font-weight:800;font-variant-numeric:tabular-nums}

/* ------------------------------------------------------------------ text roles */
:not(*){font-family:var(--ui-font-display);color:var(--ui-title-ink);letter-spacing:var(--ui-title-track);text-transform:var(--ui-title-case);
  background:var(--ui-title-fill);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:var(--ui-title-clip);
  text-shadow:var(--ui-title-ts) !important;filter:var(--ui-title-fx);animation:var(--ui-title-anim)}
:not(*){font-family:var(--ui-font-eyebrow);color:var(--ui-eyebrow-ink);letter-spacing:var(--ui-eyebrow-track);text-transform:uppercase;
  font-weight:700;text-shadow:var(--ui-shadow-text)}

/* ------------------------------------------------------------------ selected */
:is(.shield.cur):not(#\9#\9){outline:2px solid var(--ui-selected-ring);outline-offset:-2px;box-shadow:var(--ui-selected-shadow);z-index:2}

/* ------------------------------------------------------------------ kit classes (added by ui-kit.js) */
/* a counter whose number just changed */
.ui-pop{animation:ui-pop .42s cubic-bezier(.2,1.4,.4,1)}
.ui-pop.ui-down{animation-name:ui-pop-down}
@keyframes ui-pop{0%{scale:1}30%{scale:1.32;color:var(--ui-pop-flash);text-shadow:0 0 10px var(--ui-accent-glow)}100%{scale:1}}
@keyframes ui-pop-down{0%{scale:1}25%{scale:.8;color:var(--ui-danger)}55%{translate:-2px 0}75%{translate:2px 0}100%{scale:1;translate:0 0}}

/* flanking torches / lamps (cfg.flank) */
.ui-flank::before,.ui-flank::after{content:"";position:absolute;top:var(--ui-flank-top,50%);width:32px;height:64px;margin-top:-32px;pointer-events:none;
  background:var(--ui-img-flame) 0 0/192px 64px no-repeat;image-rendering:pixelated;animation:ui-flame var(--ui-flame-dur) steps(6) infinite;
  -webkit-text-fill-color:initial;filter:none}
.ui-flank::before{left:var(--ui-flank-x,6px)}
.ui-flank::after{right:var(--ui-flank-x,6px);animation-delay:calc(var(--ui-flame-dur) * -.45);scale:-1 1}
@keyframes ui-flame{to{background-position:-192px 0}}

/* shared keyframes the tokens refer to */
@keyframes ui-drop{0%{translate:0 -22px;opacity:0}60%{opacity:1}100%{translate:0 0;opacity:1}}
@keyframes ui-wipe{0%{clip-path:inset(0 0 100% 0);filter:brightness(2.2)}60%{filter:brightness(1.4)}100%{clip-path:inset(0 0 0 0);filter:none}}
@keyframes ui-breathe{0%,100%{scale:1}50%{scale:1.045}}
@keyframes ui-scanart{0%,100%{filter:none}46%{filter:none}50%{filter:brightness(1.5) saturate(1.2)}54%{filter:none}}
@keyframes ui-glitch{0%,91%,100%{translate:0 0;opacity:1}92%{translate:-2px 0;opacity:.75}93.5%{translate:3px 1px;opacity:1}95%{translate:-1px 0;opacity:.55}96%{translate:0 0;opacity:1}}
@keyframes ui-hang{0%{opacity:0;translate:0 -14px;rotate:-1.2deg}100%{opacity:1;translate:0 0;rotate:0deg}}
@keyframes ui-slidein{0%{opacity:0;translate:-26px 0;filter:brightness(2)}100%{opacity:1;translate:0 0;filter:none}}

/* images that only appear on press are fetched up front so the first press does not blink */
#ui-preload{background-image:var(--ui-img-btn-main-down),var(--ui-img-btn-second-down),var(--ui-img-btn-war-down),var(--ui-img-btn-icon-down),
  var(--ui-img-btn-main),var(--ui-img-btn-second),var(--ui-img-btn-war),var(--ui-img-panel),var(--ui-img-well),var(--ui-img-corner-ornament)}   /* + the frames that first show inside a pop-up */

@media (prefers-reduced-motion:reduce){
  :is(.sheet .btn:not(.ghost)):not(#\9#\9)::after,:is(.sheet .btn:not(.ghost)):not(#\9#\9)::before,:not(*)::before{animation:none}
  :is(.sheet .btn:not(.ghost)):not(#\9#\9)::after{display:none}
  :is(.sheet):not(#\9#\9),:not(*){animation:none}
  .ui-pop,.ui-flank::before,.ui-flank::after{animation:none}
}

/* ---- warpaths.css ---- */
/* Warpaths / Supply Lines: path puzzle. Family layout (the shared block comes first) plus this game's own pieces. */
:root{--fm-px:14px;--fm-pt:10px;--fm-rim:4px}

/* ==== Puzzle family: shared by warpaths, camps, spoils, rampart and muster (this block is the same in all five files) ====
   One header strip, one console (level name, chips, tools), the board in a well, pop-ups with a banner. Skin-neutral: tokens only. */
html:root #app{background:none;box-shadow:none}

/* ---- header strip (full bleed) ---- */
:is(.topbar):not(#\9#\9).topbar{margin:calc(-1 * (calc(env(safe-area-inset-top) + var(--tc-frost, 0px)) + var(--fm-pt))) calc(-1 * var(--fm-px)) 0;min-height:calc(54px + calc(env(safe-area-inset-top) + var(--tc-frost, 0px)));
  padding:0;border-top-width:calc(2px + calc(env(safe-area-inset-top) + var(--tc-frost, 0px)));gap:6px}
html:root .topbar #homeLink{background:none;box-shadow:none;border:0;border-radius:0;min-height:40px;width:auto;padding:0 4px;font-family:var(--ui-font-display);
  font-weight:800;font-size:15px;color:var(--ui-ink);text-shadow:var(--ui-shadow-text);white-space:nowrap}
html:root .topbar #homeLink:active{transform:none;color:var(--ui-accent)}
html:root .topbar h1{font-family:var(--ui-font-display);font-weight:800;font-size:16px;letter-spacing:.1em;text-transform:uppercase;white-space:nowrap;
  color:var(--ui-accent);text-shadow:var(--ui-shadow-text);margin:0;line-height:1.1}
html:root .topbar .right{gap:6px}
:is(.iconbtn,#clearBtn,#hintBtn):not(#\9#\9).iconbtn{width:40px;height:40px;border-radius:0;font-size:15px;line-height:1;padding:0}
html:root .iconbtn.off{opacity:.5}

/* ---- console strip ---- */
html:root #lvlLabel{font-family:var(--ui-font-display);font-weight:800;font-size:14px;letter-spacing:.03em;color:var(--ui-ink);text-shadow:var(--ui-shadow-text);
  line-height:1.15;text-align:left;white-space:normal;min-width:0}
:is(.chip):not(#\9#\9).chip{padding:0;border-radius:0;font-size:12.5px;font-weight:600;color:var(--ui-ink-dim);line-height:1.5}
:is(.chip):not(#\9#\9).chip b{color:var(--ui-chip-ink);font-weight:800}
:is(.chip):not(#\9#\9).chip.full{box-shadow:0 0 0 1px var(--ui-accent),0 0 10px var(--ui-accent-glow)}
#ui-tools{display:flex;gap:5px;justify-content:flex-end;align-items:center}
/* the tools: small plates, picture on top, tiny word below; clearly second to everything gold */
:is(.iconbtn,#clearBtn,#hintBtn):not(#\9#\9):is(#undoBtn,#restartBtn,#clearBtn,#hintBtn,#spareBtn,#shufBtn){flex:0 0 auto;width:auto;min-width:46px;min-height:0;height:44px;padding:0 1px;
  border-radius:0;flex-direction:column;gap:1px;font-family:var(--ui-font-eyebrow);font-size:9.5px;font-weight:700;letter-spacing:.02em;text-transform:uppercase;
  line-height:1;color:var(--ui-ink-dim);white-space:nowrap}
:is(#undoBtn,#restartBtn,#clearBtn,#hintBtn,#spareBtn,#shufBtn)::before{font-size:17px;line-height:1;color:var(--ui-icon-ink);font-weight:400;letter-spacing:0}
#undoBtn::before{content:"\21B6"} #restartBtn::before,#clearBtn::before{content:"\21BA"} #hintBtn::before{content:"\1F4A1";font-size:15px}
#shufBtn::before{content:"\21C4"}
html:root .ui-empty{display:none}

/* ---- the board's well gets a thin metal rim so it reads as a framed table (drawn outside the box: no geometry change) ---- */
html:root :is(.frame,#boardFrame){outline:2px solid var(--ui-accent-deep);outline-offset:var(--fm-rim,4px);box-shadow:0 0 0 calc(var(--fm-rim,4px) + 4px) rgba(0,0,0,.55),0 0 22px 6px rgba(0,0,0,.5)}

/* ---- words under the board ---- */
html:root .status{color:var(--ui-ink);text-shadow:var(--ui-shadow-text)}
html:root .status.warn{color:var(--ui-accent)} html:root .status.bad{color:var(--ui-danger)}

/* ---- buttons ---- */
:is(.sheet .btn:not(.ghost)):not(#\9#\9).btn,:is(#prevBtn,#nextBtn,#levelsBtn,.sheet .btn.ghost,.shield):not(#\9#\9).btn{min-height:48px;padding:0 4px;font-size:16px;border-radius:0}
:is(#prevBtn,#nextBtn,#levelsBtn,.sheet .btn.ghost,.shield):not(#\9#\9):is(#levelsBtn,#winLevelsBtn,#loseLevelsBtn,#winLevels){color:var(--ui-accent)}

/* ---- pop-ups ---- */
html:root .overlay{background:rgba(4,3,2,.74)}
html:root .overlay.clear{background:rgba(4,3,2,.3)}
:is(.sheet):not(#\9#\9).sheet{border-radius:0;padding:4px 4px calc(6px + env(safe-area-inset-bottom));gap:10px}
html:root .sheet h2{font-family:var(--ui-font-display);font-weight:800;font-size:22px;line-height:1.15;color:var(--ui-accent);text-shadow:var(--ui-shadow-text);padding:0 34px}
html:root .sheet h3{font-family:var(--ui-font-eyebrow);font-size:11.5px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--ui-eyebrow-ink);text-shadow:var(--ui-shadow-text)}
html:root .sheet h3 small{color:var(--ui-ink-dim);letter-spacing:.04em;text-transform:none;font-family:inherit}
html:root .note,html:root .sheet p.note{color:var(--ui-ink-dim);text-shadow:var(--ui-shadow-text)}
html:root .sheet p,html:root .howto,html:root .howl{color:var(--ui-ink);text-shadow:var(--ui-shadow-text)}
html:root .howto b,html:root .howl b{color:var(--ui-accent)}
html:root #toast{border-radius:var(--ui-radius);border:1px solid var(--ui-accent-deep);background:rgba(8,6,4,.94);color:var(--ui-ink)}

/* ---- level tiles: stone / steel plates; won ones carry their stars, the current one glows ---- */
:is(#prevBtn,#nextBtn,#levelsBtn,.sheet .btn.ghost,.shield):not(#\9#\9):is(.shield,.lv){aspect-ratio:auto;min-height:60px;height:60px;padding:0;border-width:4px 6px 10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  animation:fm-tile .28s cubic-bezier(.2,1.2,.4,1) backwards}
:is(#prevBtn,#nextBtn,#levelsBtn,.sheet .btn.ghost,.shield):not(#\9#\9):is(.shield,.lv):active,:is(#prevBtn,#nextBtn,#levelsBtn,.sheet .btn.ghost,.shield):not(#\9#\9):is(.shield,.lv).ui-press{border-width:8px 6px 6px}
:is(.shield,.lv) svg{display:none}
html:root :is(.shield,.lv) b{margin:0;font-family:var(--ui-font-display);font-weight:800;font-size:19px;line-height:1;color:var(--ui-ink);text-shadow:0 2px 0 #000}
html:root :is(.shield.cur,.lv.cur) b{color:var(--ui-accent)}
:is(.shield.cur):not(#\9#\9):is(.shield,.lv){animation:fm-tile .28s cubic-bezier(.2,1.2,.4,1) backwards,fm-cur 1.6s ease-in-out .3s infinite alternate}
:is(.shields,.grid) > :nth-child(5n+2){animation-delay:.03s} :is(.shields,.grid) > :nth-child(5n+3){animation-delay:.06s}
:is(.shields,.grid) > :nth-child(5n+4){animation-delay:.09s} :is(.shields,.grid) > :nth-child(5n+5){animation-delay:.12s}
@keyframes fm-tile{from{opacity:0;translate:0 8px}}
@keyframes fm-cur{to{filter:brightness(1.25)}}
html:root :is(.shields,.grid){gap:6px}
/* a row of three small stars drawn from the kit images (--fm-s = how many are won) */
.fm-stars,html:root .shield .stars,html:root .lv span{position:static;display:block;width:48px;height:16px;font-size:0;line-height:0;letter-spacing:0;text-shadow:none;image-rendering:pixelated;
  background:var(--ui-img-star-empty) 0 0/16px 16px repeat-x;opacity:.4}
html:root :is(.shield[aria-label*="1 of 3"] .stars,.lv span[data-s="1"]){opacity:1;background:var(--ui-img-star) 0 0/16px 16px no-repeat,var(--ui-img-star-empty) 0 0/16px 16px repeat-x}
html:root :is(.shield[aria-label*="2 of 3"] .stars,.lv span[data-s="2"]){opacity:1;background:var(--ui-img-star) 0 0/16px 16px no-repeat,var(--ui-img-star) 16px 0/16px 16px no-repeat,var(--ui-img-star-empty) 0 0/16px 16px repeat-x}
html:root :is(.shield[aria-label*="3 of 3"] .stars,.lv span[data-s="3"]){opacity:1;background:var(--ui-img-star) 0 0/16px 16px repeat-x}

/* ---- win / lose / game over: a banner hung on the top edge, stars that land one by one, one gold button ---- */
:is(#winOverlay,#winOv,#loseOverlay,#overOverlay) :is(.sheet):not(#\9#\9).sheet{overflow:visible;margin-top:58px;padding-top:0;animation:fm-sheet .26s cubic-bezier(.2,1.2,.4,1) both}
@keyframes fm-sheet{from{opacity:0;translate:0 26px}}
:is(#winOverlay,#winOv,#loseOverlay,#overOverlay) :is(.sheet):not(#\9#\9).sheet::before{display:none}
/* the banner: the kit's victory / defeat picture (320x96) with the words on it; until those pictures are in the theme the home-page plaque stands in */
html:root :is(#winOverlay,#winOv,#loseOverlay,#overOverlay) .sheet h2{align-self:center;justify-self:center;display:flex;align-items:center;justify-content:center;box-sizing:border-box;
  width:320px;height:96px;margin:-54px -14px -16px;padding:0 60px 2px;font-size:17px;line-height:1.12;letter-spacing:.02em;text-align:center;
  color:var(--ui-accent);text-shadow:0 2px 0 rgba(0,0,0,.85),0 0 8px rgba(0,0,0,.6);
  background:var(--ui-img-victory,var(--ui-img-plaque)) 50% 50%/100% 100% no-repeat;image-rendering:pixelated;
  filter:drop-shadow(0 4px 0 rgba(0,0,0,.4));animation:fm-banner .36s .08s cubic-bezier(.2,1.4,.4,1) both}
html:root :is(#loseOverlay,#overOverlay) .sheet h2{background-image:var(--ui-img-defeat,var(--ui-img-plaque));color:var(--ui-ink)}
html:root #overOverlay .sheet:has(#newBestTxt:not(.hidden)) h2{background-image:var(--ui-img-victory,var(--ui-img-plaque));color:var(--ui-accent)}
@keyframes fm-banner{0%{opacity:0;translate:0 -26px;scale:1.25}60%{opacity:1}100%{opacity:1;translate:0 0;scale:1}}
@keyframes fm-star{0%{opacity:0;scale:2.6;rotate:-35deg}55%{opacity:1;scale:.88;rotate:6deg}75%{scale:1.1}100%{opacity:1;scale:1;rotate:0deg}}
:is(#winOverlay,#winOv,#loseOverlay,#overOverlay) :is(.sheet .btn:not(.ghost)):not(#\9#\9).btn{min-height:54px;font-size:18px}

@media (prefers-reduced-motion:reduce){
  :is(#prevBtn,#nextBtn,#levelsBtn,.sheet .btn.ghost,.shield):not(#\9#\9):is(.shield,.lv),:is(.shield.cur):not(#\9#\9):is(.shield,.lv){animation:none}
  html:root :is(#winOverlay,#winOv,#loseOverlay,#overOverlay) .sheet h2,:is(#winOverlay,#winOv,#loseOverlay,#overOverlay) :is(.sheet):not(#\9#\9).sheet{animation:none}
}

/* ---- short phones: the header and the console tighten up so the board keeps its size ---- */
@media (max-height:740px){
  :is(.topbar):not(#\9#\9).topbar{min-height:calc(46px + calc(env(safe-area-inset-top) + var(--tc-frost, 0px)));border-bottom-width:10px}
  :is(.iconbtn,#clearBtn,#hintBtn):not(#\9#\9).iconbtn{height:34px}
  /* short phones: the strip stays 34 px tall, the tap area is still 40 px (QA, Nov 20) */
  :is(.iconbtn,#clearBtn,#hintBtn):not(#\9#\9).iconbtn::after,html:root .topbar #homeLink::after{content:"";position:absolute;left:0;right:0;top:-3px;bottom:-3px}
  html:root .topbar #homeLink{position:relative}
  html:root .topbar #homeLink{min-height:34px}
  :is(.info):not(#\9#\9):is(.info,.hud){border-width:6px;border-image:var(--ui-img-well) var(--ui-well-slice) fill / var(--ui-well-bw) / 0 round;box-shadow:none;gap:4px 8px;padding:1px 2px}
  :is(.iconbtn,#clearBtn,#hintBtn):not(#\9#\9):is(#undoBtn,#restartBtn,#clearBtn,#hintBtn,#spareBtn,#shufBtn){height:40px}
  :is(#undoBtn,#restartBtn,#clearBtn,#hintBtn,#spareBtn,#shufBtn)::before{font-size:15px}
}

/* ==== this game ==== */
/* console: level name + tools, chips under */
:is(.info):not(#\9#\9).info{display:grid;grid-template-columns:1fr auto;grid-template-areas:"name tools" "chips chips";align-items:center;gap:5px 8px;padding:0 2px 2px;border-width:12px}
.info #lvlLabel{grid-area:name} .info .chips{grid-area:chips;justify-content:flex-start} .info #ui-tools{grid-area:tools}

/* board: the page's frame keeps its 12px edge (the script counts on it); the look becomes a well drawn outwards */
html:root .frame{border:12px solid transparent;padding:0;border-radius:0;background:none;box-shadow:none;
  border-image:var(--ui-img-well) var(--ui-well-slice) fill / var(--ui-well-bw) / 4px round;image-rendering:pixelated}
html:root .frame > *{image-rendering:auto}
.frame .stud{display:none}

/* level nav */
html:root .controls .row .btn.small{min-width:84px}

/* win: the freed tokens line up and hop in */
#winTokens svg{animation:fm-star .4s cubic-bezier(.2,1.3,.4,1) both}
#winTokens svg:nth-child(2){animation-delay:.07s} #winTokens svg:nth-child(3){animation-delay:.14s} #winTokens svg:nth-child(4){animation-delay:.21s}
#winTokens svg:nth-child(5){animation-delay:.28s} #winTokens svg:nth-child(6){animation-delay:.35s} #winTokens svg:nth-child(n+7){animation-delay:.42s}
/* won battles carry one star */
html:root .shield .star{position:static;width:16px;height:16px;font-size:0;text-shadow:none;background:var(--ui-img-star) 0 0/16px 16px no-repeat;image-rendering:pixelated}
html:root #fxText{font-family:var(--ui-font-display)}
@media (prefers-reduced-motion:reduce){ #winTokens svg{animation:none} }
