/* The card frame (js/ui/cards.js; art's spec labs/audits/card-frame-2026-10-25/README.md, its .hs CSS in proto/card.html).
   Engine's file. Every box is in art px times --u, the CSS px an art pixel takes: --hs-rest (2) at rest, --hs-focus (3) lifted
   and at a choice carousel's centre, whole pixels on any screen (both set from js/ui/cards.js's HS, one place for the
   numbers). A fight card is 48 x 68 art (96 x 136 at rest, 144 x 204 lifted), a choice card 52 x 76 (104 x 152, 156 x 228).
   The fonts scale with it (Monogram at 5.333 art px for names and rules, 10.67 for numbers), so words wrap the same at any u.
   Where a card stands (position, margins, transforms) stays the hand's (style.css, js/ui/hand.js).
   (:not(#_#_#_#_#_) lifts these over the hands' own sizes in style.css, whose most particular rules carry four ids) */
.fcard.hs:not(#_#_#_#_#_) {
  --u: var(--hs-rest, 2);
  display: block; box-sizing: border-box; width: calc(48px * var(--u)); min-width: 0; max-width: none;
  height: calc(68px * var(--u)); min-height: 0; max-height: none; padding: 0; overflow: visible; border: 0; border-image: none;
  outline: 0; background: none; box-shadow: none; color: var(--bone); font-family: var(--pix); font-weight: 400;
  font-size: calc(5.333px * var(--u)); line-height: calc(5.333px * var(--u)); letter-spacing: 0; text-align: center;
  image-rendering: pixelated; aspect-ratio: auto;
}
.fcard.hs.readied:not(#_#_#_#_#_), .hand.carousel.ch-hand > .fcard.hs.hand-centre:not(#_#_#_#_#_) { --u: var(--hs-focus, 3); }
.fcard.hs.hs-choice:not(#_#_#_#_#_) { width: calc(52px * var(--u)); height: calc(76px * var(--u)); }
.fcard.hs:not(#_#_#_#_#_) > * { position: absolute; margin: 0; }
.fcard.hs img { image-rendering: pixelated; display: block; }
.fcard.hs:not(#_#_#_#_#_) > .ch-head { display: contents; }
.fcard.hs:not(#_#_#_#_#_) > .ch-head > * { position: absolute; margin: 0; }
/* the frame over the portrait, under everything else */
.fcard.hs .hs-frame { inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
/* the portrait window: 40 x 30 at 4, 4 (choice 44 x 32): art's portrait, else the twilight with the old 32 x 32 picture */
.fcard.hs:not(#_#_#_#_#_) .fcard-art { left: calc(4px * var(--u)); top: calc(4px * var(--u)); width: calc(40px * var(--u)); height: calc(30px * var(--u));
  min-height: 0; padding: 0; overflow: hidden; z-index: 0; display: block; flex: none; background: #16141c; border: 0; box-shadow: none;
  font-size: calc(13px * var(--u)); line-height: calc(30px * var(--u)); }
.fcard.hs.hs-choice:not(#_#_#_#_#_) .fcard-art { width: calc(44px * var(--u)); height: calc(32px * var(--u)); line-height: calc(32px * var(--u)); }
.fcard.hs .fcard-art img.hs-pic, .fcard.hs .fcard-art img.hs-dusk { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; }
.fcard.hs .fcard-art .hs-old { position: absolute; left: calc(4px * var(--u)); top: calc(-1px * var(--u)); width: calc(32px * var(--u)); height: calc(32px * var(--u));
  display: flex; align-items: center; justify-content: center; }
.fcard.hs.hs-choice .fcard-art .hs-old { left: calc(6px * var(--u)); top: 0; }
.fcard.hs .fcard-art .hs-old :is(img, svg) { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; }
.fcard.hs .fcard-art .hs-old > :not(img, svg) { max-width: 100%; max-height: 100%; }
/* the cost gem: -3, -3, 14 x 14 (choice 16 x 16); the number Monogram at 10.67, white, outlined in ink */
.fcard.hs:not(#_#_#_#_#_) .fcard-cost { left: calc(-3px * var(--u)); top: calc(-3px * var(--u)); right: auto; width: calc(14px * var(--u)); height: calc(14px * var(--u));
  z-index: 3; display: flex; align-items: center; justify-content: center; padding: 0 0 calc(1px * var(--u)); box-sizing: border-box; border: 0; border-radius: 0;
  background-color: transparent; background-size: 100% 100%; box-shadow: none; font-family: var(--pix); font-size: calc(10.67px * var(--u)); line-height: 1; color: #fff;
  text-shadow: calc(1px * var(--u)) 0 0 var(--ink), calc(-1px * var(--u)) 0 0 var(--ink), 0 calc(1px * var(--u)) 0 var(--ink), 0 calc(-1px * var(--u)) 0 var(--ink); }
.fcard.hs.hs-choice:not(#_#_#_#_#_) .fcard-cost { width: calc(16px * var(--u)); height: calc(16px * var(--u)); }
.fcard.hs:not(#_#_#_#_#_) .fcard-cost.fcard-cost-free { color: #d4b060; }
/* an ability's uses where the gem is: its pips on a dark gem */
.fcard.hs:not(#_#_#_#_#_) .fcard-uses { display: none; }
.fcard.hs:not(#_#_#_#_#_) .fcard-use-pips { left: calc(-2px * var(--u)); top: calc(-2px * var(--u)); z-index: 3; display: flex; gap: var(--u); padding: calc(1.5px * var(--u));
  background: #1c1a24; border: 2px solid var(--ink); }
/* the name ribbon: -2, 28, 52 x 12 (choice top 31, 56 wide); one line, a long name a step smaller (cards.js hsFit) */
.fcard.hs:not(#_#_#_#_#_) .fcard-name { left: calc(-2px * var(--u)); top: calc(28px * var(--u)); width: calc(52px * var(--u)); height: calc(12px * var(--u)); z-index: 2;
  display: flex; align-items: center; justify-content: center; padding: 0 calc(5px * var(--u)) calc(2px * var(--u)); box-sizing: border-box; white-space: nowrap;
  overflow: hidden; text-overflow: clip; background-size: 100% 100%; font-family: var(--pix); font-weight: 400;
  font-size: calc(var(--hs-nf, 5.333px) * var(--u)); line-height: 1; letter-spacing: 0; color: var(--bone); text-shadow: 1px 1px 0 var(--ink); max-height: none; }
.fcard.hs.hs-choice:not(#_#_#_#_#_) .fcard-name { top: calc(31px * var(--u)); width: calc(56px * var(--u)); }
/* the rarity gem under the ribbon: 21, 38, 6 x 5 (choice 23, 41) */
.fcard.hs .hs-rar { left: calc(21px * var(--u)); top: calc(38px * var(--u)); width: calc(6px * var(--u)); height: calc(5px * var(--u)); z-index: 3; }
.fcard.hs.hs-choice .hs-rar { left: calc(23px * var(--u)); top: calc(41px * var(--u)); }
/* the rules panel: 4, 41, 40 x 17, three lines (choice top 45, 44 x 21: its body, scrolled when focused); keywords gold */
.fcard.hs:not(#_#_#_#_#_) .hs-panel { left: calc(4px * var(--u)); top: calc(41px * var(--u)); width: calc(40px * var(--u)); height: calc(17px * var(--u)); z-index: 2;
  box-sizing: border-box; padding: 0 calc(1px * var(--u)); display: flex; flex-direction: column; justify-content: center; overflow: hidden;
  overscroll-behavior: contain; scrollbar-width: none; color: var(--bone); flex: none; text-align: center;
  font-size: calc(var(--hs-fs, 5.333px) * var(--u)); line-height: calc(var(--hs-fs, 5.333px) * var(--u)); }
.fcard.hs .hs-panel::-webkit-scrollbar { display: none; }
.fcard.hs .hs-panel b { font-weight: 400; }
.fcard.hs .hs-panel b.hs-kw { color: #d4b060; } /* (a fixed gold, art: the theme's --glim is blue in the Gloaming) */
.fcard.hs .hs-panel b.hs-up, .fcard.hs .hs-up { color: #f8e8b0; }
.fcard.hs .hs-panel .hs-flav { display: none; font-style: normal; color: var(--bone2); margin-top: calc(2px * var(--u)); }
/* lifted: the flavour under the rules, and the panel scrolls when they don't fit (cardScroll) */
.fcard.hs.readied:not(#_#_#_#_#_) .hs-panel { justify-content: flex-start; overflow: hidden auto; }
.fcard.hs.readied .hs-panel .hs-flav { display: block; }
.fcard.hs.readied .hs-panel > :first-child { margin-top: auto; }
.fcard.hs.readied .hs-panel > :last-child { margin-bottom: auto; }
.fcard.hs.hs-choice:not(#_#_#_#_#_) .hs-panel { top: calc(45px * var(--u)); width: calc(44px * var(--u)); height: calc(21px * var(--u)); justify-content: flex-start;
  gap: var(--u); padding: 0 calc(1px * var(--u)); }
.fcard.hs.hs-choice:is(.readied, .cf-focus, .hand-centre):not(#_#_#_#_#_) .hs-panel { overflow: hidden auto; }
.fcard.hs.hs-choice:not(#_#_#_#_#_) .hs-panel > :first-child { margin-top: auto; }
.fcard.hs.hs-choice:not(#_#_#_#_#_) .hs-panel > :last-child { margin-bottom: auto; }
/* (a choice's body in the panel: its boxes and lines at the panel's size, flat; costs red, gains green) */
.fcard.hs.hs-choice:not(#_#_#_#_#_) .hs-panel :is(*, *::before) { font-family: var(--pix); font-size: calc(5.333px * var(--u)); line-height: calc(5.333px * var(--u));
  letter-spacing: 0; text-transform: none; }
.fcard.hs.hs-choice:not(#_#_#_#_#_) .hs-panel > * { position: static; display: block; flex: none; padding: 0; border: 0; background: none; box-shadow: none;
  max-width: none; width: auto; min-height: 0; }
.fcard.hs.hs-choice:not(#_#_#_#_#_) .hs-panel .ch-box { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 var(--u); }
.fcard.hs.hs-choice .hs-panel .ch-box-w { color: var(--bone2); }
.fcard.hs.hs-choice .hs-panel :is(.ch-box-cost, .ch-box-failure) { color: #e08a8a; }
.fcard.hs.hs-choice .hs-panel :is(.ch-box-gain, .ch-box-success) { color: #a8d890; }
.fcard.hs.hs-choice:not(#_#_#_#_#_) .hs-panel :is(img.px, .mini-face) { height: calc(5px * var(--u)); width: auto; vertical-align: -1px; }
/* the type plate: 12, 59, 24 x 7 (choice 10, 67, 32 wide: its category) */
.fcard.hs:not(#_#_#_#_#_) .hs-type { left: calc(12px * var(--u)); top: calc(59px * var(--u)); width: calc(24px * var(--u)); height: calc(7px * var(--u)); z-index: 2;
  display: flex; align-items: center; justify-content: center; padding: 0 0 1px; box-sizing: border-box; font-family: var(--pix); font-weight: 400;
  font-size: calc(5.333px * var(--u)); line-height: 1; letter-spacing: 0; text-transform: none; color: var(--bone); text-shadow: 1px 1px 0 var(--ink);
  background: none; border: 0; opacity: 1; white-space: nowrap; }
.fcard.hs.hs-choice:not(#_#_#_#_#_) .hs-type { left: calc(10px * var(--u)); top: calc(67px * var(--u)); width: calc(32px * var(--u)); }
/* the badges: blade (damage) -2, shield (block) 37, top 56, 13 x 13; past two characters the small size */
.fcard.hs .hs-hit, .fcard.hs .hs-block { top: calc(56px * var(--u)); width: calc(13px * var(--u)); height: calc(13px * var(--u)); z-index: 3; display: flex;
  align-items: center; justify-content: center; padding: 0 0 calc(1px * var(--u)); box-sizing: border-box; background-size: 100% 100%;
  font-size: calc(10.67px * var(--u)); line-height: 1; color: #fff;
  text-shadow: calc(1px * var(--u)) 0 0 var(--ink), calc(-1px * var(--u)) 0 0 var(--ink), 0 calc(1px * var(--u)) 0 var(--ink), 0 calc(-1px * var(--u)) 0 var(--ink); }
.fcard.hs .hs-hit { left: calc(-2px * var(--u)); }
.fcard.hs .hs-block { left: calc(37px * var(--u)); }
.fcard.hs .hs-hit.hs-up, .fcard.hs .hs-block.hs-up { color: #f8e8b0; }
.fcard.hs .hs-hit.hs-small, .fcard.hs .hs-block.hs-small { font-size: calc(5.333px * var(--u)); }
/* kept from today's card: the level pips over the top right rivet; the weak tag in the arch's top right; the weapon's mark and
   its mods on the portrait's bottom left; a raised reward's ribbon under it (fight.js's), its glow around the frame; a tilt's
   mark in the arch's top left */
.fcard.hs:not(#_#_#_#_#_) .fcard-lv { top: calc(-1px * var(--u)); right: calc(-1px * var(--u)); left: auto; z-index: 4; }
.fcard.hs:not(#_#_#_#_#_) .fcard-tag { top: calc(8px * var(--u)); right: calc(5px * var(--u)); left: auto; z-index: 3; }
.fcard.hs:not(#_#_#_#_#_) .fcard-wmark { left: calc(5px * var(--u)); top: calc(23px * var(--u)); right: auto; bottom: auto; z-index: 3; }
.fcard.hs:not(#_#_#_#_#_) .fcard-mods { left: calc(15px * var(--u)); top: calc(23px * var(--u)); right: auto; bottom: auto; z-index: 3; display: flex; gap: 2px; }
.fcard.hs.rw-up:not(#_#_#_#_#_) { outline: 0; filter: drop-shadow(0 0 1px #f4d27a) drop-shadow(0 0 6px rgba(244, 210, 122, .45)); }
.fcard.hs:not(#_#_#_#_#_) .rw-ribbon { top: auto; bottom: calc(-4px * var(--u)); z-index: 4; }
.fcard.hs:not(#_#_#_#_#_) .rw-tag { top: calc(8px * var(--u)); left: calc(7px * var(--u)); bottom: auto; z-index: 3; }
.fcard.hs:not(#_#_#_#_#_) .cant-why { left: calc(2px * var(--u)); right: calc(2px * var(--u)); top: calc(43px * var(--u)); z-index: 5; }
.fcard.hs:not(#_#_#_#_#_) :is(.token-tag, .rarity-only) { top: calc(-4px * var(--u)); right: calc(-2px * var(--u)); left: auto; z-index: 4; }
/* the deck view and the pick hands: where it's from, and what raising it gives, under the card */
.fcard.hs:not(#_#_#_#_#_) :is(.fcard-from, .fcard-next) { left: 0; right: 0; top: calc(70px * var(--u)); z-index: 2; margin: 0; }
.fcard.hs:not(#_#_#_#_#_) .fcard-next { top: calc(77px * var(--u)); }
.deck-grid:has(> .fcard.hs) { grid-template-columns: repeat(auto-fill, calc(48px * var(--hs-rest, 2))); justify-content: center; gap: 30px 10px; }
.deck-grid:has(> .fcard.hs .fcard-next) { row-gap: 46px; }
/* a lifted card glows around its frame, not its box; a card you can't play greys */
.fcard.hs.readied:not(#_#_#_#_#_), .fcard.hs:hover:not(#_#_#_#_#_) { box-shadow: none; filter: drop-shadow(0 0 5px rgba(244, 210, 122, .6)); }
.fcard.hs.cant:not(#_#_#_#_#_) { filter: grayscale(.7) brightness(.6); }
.fcard.hs.cant.readied:not(#_#_#_#_#_) { filter: grayscale(.7) brightness(.75); }
/* lifted in the fan: it grows to --hs-focus (no scale: whole pixels), its extra width taken back by its margins so the fan
   doesn't move; it rises a little */
.hand.fanned > .fcard.hs.readied:not(#_#_#_#_#_) { transform: translateY(-16px); scale: none;
  margin-right: calc(-24px * (var(--hs-focus, 3) - var(--hs-rest, 2))); margin-left: calc(-24px * (var(--hs-focus, 3) - var(--hs-rest, 2)) - var(--hand-ov, 0px)); }
.hand.fanned > .fcard.hs.readied:first-child:not(#_#_#_#_#_) { margin-left: calc(-24px * (var(--hs-focus, 3) - var(--hs-rest, 2))); }
/* the carousel: its cards keep their sizes (no scale: u 3 at the centre of a choice hand, 2 to the sides, lifted 3) */
.hand.carousel > .fcard.hs.readied:not(#_#_#_#_#_) { scale: none; translate: 0 -3px; }
.hand.carousel.ch-hand:has(> .fcard.hs-choice):not(#_#_#_#_#_) { height: calc(76px * var(--hs-focus, 3) + 34px); }
.hand.carousel:has(> .fcard.hs:not(.hs-choice)):not(#_#_#_#_#_) { height: calc(68px * var(--hs-focus, 3) + 34px); }
/* (in a carousel only the centre card says where it's from and what raising it gives, with room for them under it) */
.hand.carousel > .fcard.hs:not(.hand-centre):not(#_#_#_#_#_) :is(.fcard-from, .fcard-next) { display: none; }
.hand.carousel:has(> .fcard.hs .fcard-from):not(#_#_#_#_#_) { margin-bottom: 18px; }
.hand.carousel:has(> .fcard.hs .fcard-next):not(#_#_#_#_#_) { margin-bottom: 40px; }
