/* UI v2 kit for "fog-of-war" (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(:not(*),:is(.stat):not(#\9#\9),:is(#newBtn,#againBtn,#helpClose):not(#\9#\9),:is(#homeLink,#changeBtn):not(#\9#\9),:not(*),:is(.iconbtn):not(#\9#\9),:not(*),:not(*),:is(.size:not(.on)):not(#\9#\9),:is(.size.on):not(#\9#\9),:is(.sheet):not(#\9#\9),:not(*),:not(*),:not(*)) > *{image-rendering:auto}
:where(:is(#newBtn,#againBtn,#helpClose):not(#\9#\9),:is(#homeLink,#changeBtn):not(#\9#\9),:not(*),:is(.iconbtn):not(#\9#\9),:is(.sheet):not(#\9#\9),:is(.size:not(.on)):not(#\9#\9),:is(.size.on):not(#\9#\9)){position:relative}

/* ------------------------------------------------------------------ panel / well / bar / modal */
:not(*),: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)}
:is(.stat):not(#\9#\9),: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)}
:not(*){
  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(#newBtn,#againBtn,#helpClose):not(#\9#\9),:is(#homeLink,#changeBtn):not(#\9#\9),:not(*),:is(.size:not(.on)):not(#\9#\9),:is(.size.on):not(#\9#\9){
  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(#newBtn,#againBtn,#helpClose):not(#\9#\9),:is(.size.on):not(#\9#\9){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(#homeLink,#changeBtn):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)}
:is(.size:not(.on)):not(#\9#\9){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)}
:is(.size.on):not(#\9#\9){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(#newBtn,#againBtn,#helpClose):not(#\9#\9):active,:is(#newBtn,#againBtn,#helpClose):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(#homeLink,#changeBtn):not(#\9#\9):active,:is(#homeLink,#changeBtn):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(#newBtn,#againBtn,#helpClose):not(#\9#\9):active,:is(#homeLink,#changeBtn):not(#\9#\9):active,:not(*):active,:is(.iconbtn):not(#\9#\9):active,:is(#newBtn,#againBtn,#helpClose):not(#\9#\9).ui-press,:is(#homeLink,#changeBtn):not(#\9#\9).ui-press,:not(*).ui-press,:is(.iconbtn):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(#newBtn,#againBtn,#helpClose):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(#newBtn,#againBtn,#helpClose):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(#newBtn,#againBtn,#helpClose):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):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):not(#\9#\9):active,:is(.iconbtn):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(#newBtn,#againBtn,#helpClose):not(#\9#\9),:is(#homeLink,#changeBtn):not(#\9#\9),:not(*),:is(.iconbtn):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(#newBtn,#againBtn,#helpClose):not(#\9#\9),:not(*)):is(:disabled,[disabled],[aria-disabled="true"],.dis,.disabled,.locked)::before,
:is(:is(#newBtn,#againBtn,#helpClose):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}
:not(*){
  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 */
:is(.topbar h1):not(#\9#\9){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)}
:is(.stat small):not(#\9#\9){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 */
:not(*){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(#newBtn,#againBtn,#helpClose):not(#\9#\9)::after,:is(#newBtn,#againBtn,#helpClose):not(#\9#\9)::before,:not(*)::before{animation:none}
  :is(#newBtn,#againBtn,#helpClose):not(#\9#\9)::after{display:none}
  :is(.sheet):not(#\9#\9),:is(.topbar h1):not(#\9#\9){animation:none}
  .ui-pop,.ui-flank::before,.ui-flank::after{animation:none}
}

/* ---- fog-of-war.css ---- */
/* Fog of War — memory match. Skin-neutral: tokens only.
   RULE: the page sizes the tiles from #gridWrap, so every strip keeps its live height: top bar 40, HUD 48, best line 15, controls 100. */
html:root #app{background:none;box-shadow:none}
.mist{opacity:.38}

/* ---- top bar (40px) ---- */
.topbar h1{font-size:21px;line-height:40px}
:is(#homeLink,#changeBtn):not(#\9#\9)#homeLink{min-height:40px;height:40px;font-size:13.5px;padding:0 2px;border-radius:0;box-sizing:border-box;display:inline-flex;align-items:center}
:is(.iconbtn):not(#\9#\9).iconbtn{width:40px;height:40px;border-radius:0;font-size:16px}
.iconbtn.off{opacity:.5}

/* ---- HUD: three read-outs (48px) ---- */
.hud{height:48.14px;gap:6px}
:is(.stat):not(#\9#\9).stat{border-radius:0;padding:0;height:100%;box-sizing:border-box;border-width:5px 6px;display:flex;flex-direction:column;justify-content:center}
:is(.stat small):not(#\9#\9).stat small{font-size:9px;letter-spacing:.16em;line-height:1.1}
.stat b{font-family:var(--ui-font-display);color:var(--ui-accent);text-shadow:var(--ui-shadow-text);font-size:20px;line-height:1.1}
.best{color:var(--ui-ink-dim);text-shadow:var(--ui-shadow-text)} .best b{color:var(--ui-ink)}

/* ---- controls (100px): the deal button and the three sizes as tabs ---- */
:is(#newBtn,#againBtn,#helpClose):not(#\9#\9)#newBtn{min-height:48px;height:48px;font-size:17px;padding:0}
.sizes{gap:6px}
.size{min-height:50px;height:50px;box-sizing:border-box;border-radius:0;line-height:1.1}   /* 50: both lines (name + "4×3 · 6 pairs") sit inside the plate (QA Nov 20) */
.size b{font-family:var(--ui-font-display);font-size:13.5px;color:inherit}
:is(.size:not(.on)):not(#\9#\9).size span{color:var(--ui-ink-dim);text-transform:none;letter-spacing:0;font-family:system-ui,sans-serif;font-weight:500;text-shadow:none}
:is(.size.on):not(#\9#\9).size span{color:inherit;opacity:.8;text-transform:none;letter-spacing:0;font-family:system-ui,sans-serif;font-weight:600;text-shadow:none}
:is(.size.on):not(#\9#\9).size b{color:inherit}

/* ---- pop-ups ---- */
.overlay{background:rgba(4,3,2,.74);backdrop-filter:none;-webkit-backdrop-filter:none}
:is(.sheet):not(#\9#\9).sheet{border-radius:0;padding:4px 4px calc(6px + env(safe-area-inset-bottom));gap:10px}
.sheet h2{font-family:var(--ui-font-display);color:var(--ui-accent);text-shadow:0 2px 0 rgba(0,0,0,.8);font-size:23px;padding:3px 38px 0}
.howl{color:var(--ui-ink);text-shadow:var(--ui-shadow-text)} .howl b{color:var(--ui-accent)}
.sheet .btn{min-height:52px}
.rowbtns .btn{font-size:15px;padding:0 2px}

/* ---- the win: stars land one by one on the victory banner (no banner image in the pack = stars alone) ---- */
.stars{height:96px;display:flex;align-items:center;justify-content:center;gap:10px;font-size:0;letter-spacing:0;margin:-4px 0;
  background:var(--ui-img-victory,none) 50% 50%/320px 96px no-repeat;image-rendering:pixelated}
.stars span{width:48px;height:48px;background:var(--ui-img-star-empty) 50% 50%/48px 48px no-repeat;image-rendering:pixelated;text-shadow:none}
.stars span.on{background-image:var(--ui-img-star);filter:drop-shadow(0 0 8px var(--ui-accent-glow))}
.res{gap:8px}
.res :is(.stat):not(#\9#\9).stat{height:auto;padding:1px 0}
.res .stat b{font-size:26px}
.res .stat em{color:var(--ui-ok)}

#fxText{font-family:var(--ui-font-display);font-size:clamp(30px,9.4vw,52px)}
@media (prefers-reduced-motion:reduce){.stars .on{animation:none}}
