/* Duel screen pieces (src/battle/hud.js, bell.js, swap.js): fox power, undo, 2x, discard piles, the recap of the
   rival's turn, the swap screen, the bell preview and ring, terrain marks. Every visible piece is an art; posed pieces
   (placed by a transform) only have their children animated. */
.hud-btn {
  width: var(--pbd);
  height: var(--pbd);
  margin: calc(var(--pbd) * -0.5) 0 0 calc(var(--pbd) * -0.5);
  z-index: 6;
  touch-action: none;
}
.hud-btn:active .ic {
  scale: 0.9;
}
.hud-btn.off {
  filter: grayscale(0.85) brightness(0.72);
}
.hud-btn.armed,
#boost.on {
  filter: brightness(1.12) drop-shadow(0 0 calc(var(--pbd) * 0.14) rgba(255, 214, 90, 0.95));
}
#power .pw-cost {
  position: absolute;
  right: -16%;
  top: -16%;
  width: 44%;
  aspect-ratio: 1;
}
#power .pw-cost img {
  position: absolute;
  left: calc(50% - var(--seal) * 50%);
  top: calc(50% - var(--seal) * 50%);
  width: calc(var(--seal) * 100%);
  height: calc(var(--seal) * 100%);
  max-width: none;
}
#power .pw-cost b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: calc(var(--pbd) * 0.3);
  padding-bottom: 0.04em;
}

/* discard piles: the last critter that fell, face up and a little turned, with the count under it */
.grave {
  width: var(--pw);
  height: calc(var(--pw) * 1.4);
  margin: calc(var(--pw) * -0.7) 0 0 calc(var(--pw) * -0.5);
  z-index: 3;
  cursor: pointer;
}
.grave::before {
  content: '';
  position: absolute;
  inset: min(0px, calc(50% - 22.5px));
} /* a tap area of 45 px around the small pile */
/* a short standing window (layout.js L.tight): the counts beside the piles, not under them */
body.tight .pile.me b,
body.tight .grave.me > b {
  left: 112%;
  right: auto;
  top: 50%;
  translate: 0 -50%;
  text-align: left;
}
.grave .gcard {
  position: absolute;
  inset: 0;
  pointer-events: none;
  rotate: -7deg;
  --cw: var(--pw);
} /* the card is drawn at the size of the pile (never scaled: it is a .card) */
.grave .gcard .card {
  position: absolute;
  left: 50%;
  top: 50%;
  filter: saturate(0.75) brightness(0.85);
}
.grave .card :is(.c-cost, .c-atk, .c-hp, .c-ab, .c-fam, .c-fx) {
  display: none;
} /* only the picture: the count under the pile is the one number */
.grave > b {
  position: absolute;
  left: -30%;
  right: -30%;
  top: 102%;
  text-align: center;
  font-size: calc(var(--pw) * 0.58);
}
.pile.low b {
  color: #ffc49a;
}
#acorns i.on.spend {
  filter: grayscale(0.6) brightness(0.55);
}
#energy.rt {
  translate: -100% -50%;
} /* lying: anchored by its right edge (layout.js), so more acorns grow it to the left only */

/* the notice of a refused play (hud.js notice): one line on the pill art, centred on its point (layout.js L.note), never wider
   than its free place (the text shrinks first); placed by left/top, so only its scale and opacity animate */
#note {
  position: absolute;
  left: 0;
  top: 0;
  translate: -50% -50%;
  --h: calc(var(--u) * 7.2);
  width: max-content;
  max-width: var(--nw, 60%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 44;
  pointer-events: none;
}
#note > b {
  font-size: calc(var(--u) * 3.4);
  white-space: nowrap;
  padding-bottom: var(--cap);
  --o: 0.13em;
}

/* the mark of the terrain on its lane (mud, sand, ice, sparks): still art over the slot, under the cards */
.terrain {
  width: calc(var(--cw) * 0.98);
  height: calc(var(--cw) * 1.372);
  margin: calc(var(--cw) * -0.686) 0 0 calc(var(--cw) * -0.49);
  z-index: 2;
  pointer-events: none;
  opacity: 0.82;
}

/* the recap of the rival's turn: a small panel where the tips go; it never covers a number */
#recap {
  position: absolute;
  left: var(--tip-x, 50%);
  top: var(--tip-y, 30%);
  width: var(--tip-w, 80%);
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 44;
  pointer-events: none;
}
#recap .panel {
  --k: calc(var(--u) * 0.03);
  width: max-content;
  max-width: 100%;
}
#recap p {
  white-space: normal;
  text-wrap: balance;
  margin: calc(var(--ft) - var(--bt)) calc(var(--fr) - var(--br)) calc(var(--fb) - var(--bb))
    calc(var(--fl) - var(--bl));
  padding: calc(var(--u) * 0.4) calc(var(--u) * 0.6);
  font-size: calc(var(--u) * 3.3);
  text-align: center;
  --o: 0.13em;
  line-height: 1.16;
}

/* the swap screen: the title over the big hand, Ready under it */
#swap {
  position: absolute;
  inset: 0;
  z-index: 41;
  pointer-events: none;
}
body.swapping .in-hand:hover .c-in {
  translate: none !important;
  scale: none !important;
} /* the swap grid: the mouse never lifts a card under the title */
body.swapping #power {
  visibility: hidden;
} /* the duel has not begun: the fox power would peek from under Ready */
#swap .sw-title {
  position: absolute;
  left: var(--cx);
  top: var(--top);
  translate: -50% -100%;
  --h: calc(var(--u) * 10);
  white-space: nowrap;
}
#swap .sw-title b {
  font-size: calc(var(--u) * 4.6);
}
#swap .btn {
  position: absolute;
  left: var(--cx);
  top: var(--bot);
  translate: -50% 0;
  --h: calc(var(--u) * 12);
  min-width: calc(var(--u) * 42);
  pointer-events: auto;
}
#swap .btn span {
  font-size: calc(var(--u) * 5);
}
.card .swap-seal {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 50%;
  translate: -50% -50%;
  z-index: 4;
  pointer-events: none;
}
.swap-seal img {
  width: 100%;
  height: auto;
  display: block;
}
.swap-seal b {
  position: absolute;
  left: 14%;
  right: 14%;
  top: 31%;
  height: 26%;
  display: grid;
  place-items: center;
  font-size: calc(var(--cw) * 0.11);
  white-space: nowrap;
}
.card.swap .c-in {
  filter: brightness(0.72);
}

/* the preview of the bell: arrows, damage, skulls (placed by left/top, centred by translate) */
#preview {
  width: 0;
  height: 0;
  z-index: 35;
  pointer-events: none;
}
#preview > * {
  position: absolute;
  translate: -50% -50%;
  pointer-events: none;
}
.pv-arrow,
.pv-ic {
  height: auto;
  filter: drop-shadow(0 calc(var(--u) * 0.3) calc(var(--u) * 0.35) rgba(0, 20, 10, 0.55));
}
.pv-n {
  font-size: calc(var(--u) * 7.5);
  color: #ffd9cf;
  white-space: nowrap;
}
.hero.aimed .face {
  filter: brightness(0.42) saturate(0.8);
}
.pv-n.pv-hero {
  font-size: calc(var(--u) * 8.5);
}
.pv-n.lethal {
  font-size: calc(var(--u) * 9.5);
  color: var(--gold);
}
#preview > .pv-n.ghost {
  font-size: calc(var(--u) * 4.2);
  translate: 0 -50%;
  color: #fff3b0;
}
.pv-skull {
  position: absolute;
  left: 50%;
  top: 22%;
  width: calc(var(--cw) * 0.38);
  translate: -50% -50%;
  z-index: 4;
  pointer-events: none;
  filter: drop-shadow(0 calc(var(--cw) * 0.015) calc(var(--cw) * 0.02) rgba(0, 0, 0, 0.55));
}

/* the bell: art and clapper rock together */
#bell {
  touch-action: none;
}
#bell .rock {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform-origin: 50% 96%;
} /* it rocks on its base: a round button turning on its own centre would look still */
#bell .clap {
  position: absolute;
  left: 30%;
  width: 40%;
  top: calc(33.5% + var(--bdy));
  height: 12%;
  overflow: hidden;
  pointer-events: none;
}
#bell .clapper {
  position: absolute;
  left: 29.4%;
  width: 41.2%;
  height: 183%;
  top: -112%;
  transform-origin: 50% 4%;
  pointer-events: none;
}

/* the boss acts (its power): the angry pose beside its medallion with the name of the power */
.boss-act {
  position: absolute;
  z-index: 44;
  pointer-events: none;
  translate: 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: 0 50%;
}
.boss-act.left {
  translate: -100% 0;
  transform-origin: 100% 50%;
}
.boss-act .boss-pose {
  margin-bottom: calc(var(--u) * 0.3);
}
.boss-act .tag {
  --h: calc(var(--u) * 8.5);
  white-space: nowrap;
}
.boss-act .tag b {
  font-size: calc(var(--u) * 3.8);
}
.boss-intro .bp-line {
  --k: calc(var(--u) * 0.034);
  width: var(--bw);
  margin-top: calc(var(--u) * 1.2);
}
.boss-intro .bp-line p {
  margin: calc(var(--ft) - var(--bt)) calc(var(--fr) - var(--br)) calc(var(--fb) - var(--bb))
    calc(var(--fl) - var(--bl));
  padding: calc(var(--u) * 0.5) calc(var(--u) * 0.6);
  font-size: calc(var(--u) * 3.6);
  text-align: center;
  --o: 0.13em;
  line-height: 1.18;
}
.boss-intro .bp-line b {
  color: var(--gold);
}

/* the list of fallen cards */
.grave-grid {
  --cw: calc(var(--u) * 15);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(var(--u) * 2);
  max-width: calc(var(--u) * 80);
  max-height: 56vh;
  overflow-y: auto;
  scrollbar-width: none;
}
.gcell {
  position: relative;
  width: var(--cw);
  height: calc(var(--cw) * 1.4);
  flex: none;
}
.gcell .card {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
}
/* End of css/hud.css (complete file). */
