/* The dock (hand of cards), 01/12: the design notes (reference design 4, top version).
   Card = green band with the short name, a LIGHT window with the hero big inside it, the crystal and the cost under it.
   The window color is one variable (--card-window); html[data-card=warm|cool|light] switches it in one line.
   Composition: portrait = mana bar on the top line, 5 cards + the Flare as a sixth piece; computer/ultrawide = mana
   left, cards, Flare right, centered and capped; phone landscape = HORIZONTAL cards (portrait left, name over cost).
   Between waves "Next wave" and "Repair" live in #between, ABSOLUTE (above the hand in portrait, beside the Flare in
   landscape): the hand's box never changes during a match (main.js layout() reads it for the camera). */
:root {
  --card-window: #f3dfb8;
  --card-window-edge: rgba(80, 52, 24, 0.55);
  --card-ink: #2b3a40;
}
html[data-card='cool'] {
  --card-window: #cdeee6;
  --card-window-edge: rgba(24, 70, 66, 0.55);
}
html[data-card='light'] {
  --card-window: #f3dfb8;
  --card-window-edge: rgba(80, 52, 24, 0.4);
}

#hand {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 6);
  border-width: calc(var(--u) * 8) calc(var(--u) * 8) calc(var(--u) * 9);
  margin-bottom: 0;
  transition:
    box-shadow 140ms,
    filter 140ms;
}

/* ---- mana: crystal, the biggest number of the dock, a bar with a mark every 5 */
#energy {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 6);
  height: calc(var(--u) * 24);
  padding: 0 calc(var(--u) * 2);
}
#energy > .ic {
  width: calc(var(--u) * 26);
  height: calc(var(--u) * 26);
}
#energy > b {
  min-width: 1.3em;
  font-size: calc(var(--u) * 24);
  line-height: 1;
  padding-top: var(--cap);
}
#energy .bar {
  flex: 1;
  height: calc(var(--u) * 20);
}
#energy .fill {
  border-image-source: url(../assets/ui/bar-mana.webp);
  transition: none;
} /* A5: the edge is a wave set every frame (hand-juice.js) */
#energy.full .fill {
  filter: brightness(1.12);
}
#energy .ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 calc(100% / var(--n, 4) - 1.5px),
    rgba(6, 16, 20, 0.55) calc(100% / var(--n, 4) - 1.5px) calc(100% / var(--n, 4))
  );
  -webkit-mask: linear-gradient(90deg, #000 0 calc(100% - 3px), transparent 0);
  mask: linear-gradient(90deg, #000 0 calc(100% - 3px), transparent 0);
}

/* ---- cards */
#hand .row {
  display: flex;
  gap: calc(var(--u) * 5);
  min-height: 0;
  align-items: stretch;
}
.card-stack {
  display: flex;
  flex: 5 1 0;
  min-width: 0;
  align-items: center;
}
#hand .row #pulseBtn {
  align-self: flex-end;
}
#cards {
  flex: 1 1 auto;
  display: flex;
  gap: calc(var(--u) * 5);
  min-width: 0;
  justify-content: center;
}
.card-stack.has-scroll #cards {
  flex: 1 1 0;
  position: relative;
  justify-content: flex-start;
  overflow-x: auto;
  scrollbar-width: none;
}
.card-stack.has-scroll #cards .card {
  flex: 0 0 calc((100% - 5 * var(--card-gap)) / 5.5);
  max-width: none;
}
.card-stack.has-scroll #cards {
  --card-gap: calc(var(--u) * 5);
  gap: var(--card-gap);
}
#cards.can-scroll-left {
  --cards-fade-left: 15px;
  --cards-edge-left: transparent;
}
#cards.can-scroll-right {
  --cards-fade-right: 15px;
  --cards-edge-right: transparent;
}
#cards:is(.can-scroll-left, .can-scroll-right) {
  mask-image: linear-gradient(
    to right,
    var(--cards-edge-left, #000),
    #000 var(--cards-fade-left, 0px),
    #000 calc(100% - var(--cards-fade-right, 0px)),
    var(--cards-edge-right, #000)
  );
}
.cards-nav {
  flex: none;
  min-width: 25px;
  height: 44px;
  padding: 0;
  border: 1px solid #ffc65b;
  border-radius: 7px;
  color: #2f210e;
  background: linear-gradient(#ffcb55, #ef8e17);
  font: 700 28px/1 system-ui;
  cursor: pointer;
}
.cards-nav:disabled {
  opacity: 0.42;
  cursor: default;
}
.cards-nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}
@media (min-aspect-ratio: 4/3) {
  .card-stack {
    flex: none;
  }
  .card-stack.has-scroll {
    flex: 0 1 calc(var(--u) * 404);
  }
}
.card {
  --H: calc(var(--u) * 100);
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: calc(var(--u) * 86);
  height: var(--H);
  cursor: grab;
  touch-action: none;
  transition: transform 120ms;
}
.card > .fr,
#pulseBtn > .fr {
  position: absolute;
  inset: 0;
  border-style: solid;
  border-color: transparent;
  border-image-slice: 56 24 50 24 fill;
  border-width: calc(var(--H) * 0.187) calc(var(--u) * 7) calc(var(--H) * 0.167);
  transition: opacity 120ms;
}
.card > .fr.n,
#pulseBtn > .fr.n {
  border-image-source: url(../assets/ui/card.webp);
}
.card > .fr.s {
  border-image-source: url(../assets/ui/card-pick.webp);
  opacity: 0;
}
.card .nm,
#pulseBtn .nm {
  position: absolute;
  left: calc(var(--u) * 3);
  right: calc(var(--u) * 3);
  top: 0;
  height: calc(var(--H) * 0.187);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--u) * 11.5);
  white-space: nowrap;
  padding-top: var(--cap);
}
/* the window: the one light area of the interface; the hero fills it (feet on its floor) */
.card .win {
  position: absolute;
  left: calc(var(--u) * 4.5);
  right: calc(var(--u) * 4.5);
  top: calc(var(--H) * 0.2);
  bottom: calc(var(--H) * 0.19);
  border-radius: calc(var(--u) * 5);
  background: var(--card-window);
  box-shadow:
    inset 0 0 0 calc(var(--u) * 1) var(--card-window-edge),
    inset 0 calc(var(--u) * 2) 0 rgba(255, 255, 255, 0.35);
  overflow: hidden;
  transition: filter 160ms;
}
.card .pic {
  position: absolute;
  inset: 0 -16% -3%;
  background: center bottom / contain no-repeat;
}
@media (max-aspect-ratio: 4/3) {
  .card .pic {
    inset: 0 -30% -2%;
    background-size: auto 84%;
  }
} /* portrait: tall windows, the hero by its height */
.card .cost {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--H) * 0.01);
  height: calc(var(--H) * 0.17);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 3);
  font-size: calc(var(--u) * 15);
  padding-top: var(--cap);
}
.card .cost .ic {
  width: calc(var(--u) * 13);
  height: calc(var(--u) * 13);
}
/* no mana: the portrait darkens, name and cost stay readable, the window says how much is missing */
.card.off .win {
  background: color-mix(in srgb, var(--card-window) 42%, #1c2a31);
}
.card.off .pic {
  filter: brightness(0.6) saturate(0.55);
}
.card.off .cost b {
  color: #b9c8cc;
}
.card .need {
  position: absolute;
  left: 50%;
  bottom: 6%;
  translate: -50% 0;
  padding: calc(var(--u) * 1) calc(var(--u) * 5) 0;
  border-radius: calc(var(--u) * 6);
  background: rgba(8, 18, 24, 0.78);
  color: #e8f6ff;
  font-size: calc(var(--u) * 10.5);
  line-height: 1.3;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}
.card .need:empty {
  display: none;
}
/* selected / dragged: a continuous green border */
.card.sel,
.card.drag {
  transform: translateY(calc(var(--u) * -4));
}
.card.sel > .fr.s,
.card.drag > .fr.s {
  opacity: 1;
}
.card.sel > .fr.n,
.card.drag > .fr.n {
  opacity: 0;
}
.card.deny,
#energy.deny,
#pulseBtn.deny,
#between .btn.deny {
  animation: deny 0.25s;
}
.card.drag {
  filter: drop-shadow(0 calc(var(--u) * 5) calc(var(--u) * 4) rgba(6, 16, 20, 0.5));
  z-index: 2;
}
@keyframes deny {
  25% {
    translate: calc(var(--u) * -4) 0;
  }
  75% {
    translate: calc(var(--u) * 4) 0;
  }
}
/* the whole card light (option 3) */
html[data-card='light'] .card > .fr.n {
  opacity: 0;
}
html[data-card='light'] .card {
  background: var(--card-window);
  border-radius: calc(var(--u) * 8);
  box-shadow: inset 0 0 0 calc(var(--u) * 2) #1b2a33;
}
html[data-card='light'] .card .nm {
  left: calc(var(--u) * 4);
  right: calc(var(--u) * 4);
  top: calc(var(--u) * 4);
  background: #1f8a58;
  border-radius: calc(var(--u) * 4);
  height: calc(var(--H) * 0.16);
}
html[data-card='light'] .card .win {
  box-shadow: none;
}
html[data-card='light'] .card .cost b {
  color: var(--card-ink);
  text-shadow: none;
}

/* ---- the Flare: round, with its recharge ring and cost. Portrait: the sixth piece, with the card's band */
#pulseBtn {
  --H: calc(var(--u) * 100);
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  max-width: calc(var(--u) * 86);
  height: var(--H);
  touch-action: none;
  transition: transform 280ms cubic-bezier(0.3, 1.7, 0.5, 1);
  --fs: calc(var(--u) * 50);
  --fy: calc(var(--H) * 0.54);
}
#pulseBtn > img {
  position: absolute;
  left: 50%;
  top: var(--fy);
  width: var(--fs);
  height: var(--fs);
  translate: -50% -50%;
  display: block;
}
#pulseBtn .cd {
  position: absolute;
  left: 50%;
  top: var(--fy);
  width: calc(var(--fs) * 0.8);
  height: calc(var(--fs) * 0.8);
  border-radius: 50%;
  translate: -50% -50%;
  background: conic-gradient(rgba(8, 16, 20, 0.62) calc(var(--cd, 0) * 1turn), transparent 0);
  pointer-events: none;
}
#pulseBtn small {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--H) * 0.01);
  height: calc(var(--H) * 0.17);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 3);
  font-size: calc(var(--u) * 15);
  padding-top: var(--cap);
}
#pulseBtn small .ic {
  width: calc(var(--u) * 13);
  height: calc(var(--u) * 13);
}
#pulseBtn::before {
  top: var(--fy) !important;
  width: calc(var(--fs) * 1.18) !important;
  translate: -50% -50% !important;
}
#pulseBtn.off > img {
  filter: grayscale(0.6) brightness(0.8);
}
#pulseBtn:active {
  transform: translateY(3px) scale(0.97);
  transition-duration: 60ms;
}

/* ---- recall: a hero dragged from the field onto the hand goes back for part of its mana */
#hand.recall {
  box-shadow:
    0 0 0 calc(var(--u) * 2) rgba(90, 230, 160, 0.75),
    0 0 calc(var(--u) * 14) rgba(90, 230, 160, 0.35);
  border-radius: calc(var(--u) * 12);
}
#hand.recall.over {
  box-shadow:
    0 0 0 calc(var(--u) * 3) #5ae6a0,
    0 0 calc(var(--u) * 22) rgba(90, 230, 160, 0.6);
}
#hand.recall #cards,
#hand.recall #pulseBtn {
  filter: brightness(0.7);
}
#recallTip {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  z-index: 3;
  display: flex;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  border-width: calc(var(--u) * 7) calc(var(--u) * 10);
  font-size: calc(var(--u) * 16);
  transition:
    opacity 120ms,
    scale 120ms;
  scale: 0.94;
  white-space: nowrap;
}
#recallTip > span {
  display: flex;
  align-items: center;
  gap: 0.35em;
  padding-top: var(--cap);
}
#recallTip .ic {
  width: 1.2em;
  height: 1.2em;
}
#hand.recall.over #recallTip {
  opacity: 1;
  scale: 1;
}
#hand.recall.over #recallTip b {
  color: #9ff5c8;
}

/* ---- between waves: Next wave (with the mana it gives) and Repair (with its cost). Off during a wave. */
#between {
  position: absolute;
  z-index: 2;
  display: flex;
  gap: calc(var(--u) * 6);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 160ms,
    visibility 0s 160ms,
    translate 160ms;
  translate: 0 calc(var(--u) * 6);
}
#between.on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  translate: 0 0;
  transition:
    opacity 160ms,
    visibility 0s,
    translate 160ms;
}
#between .btn {
  height: var(--touch);
  font-size: calc(var(--u) * 17);
  padding: 0 calc(var(--u) * 6);
  min-width: var(--touch);
  --bt: calc(var(--u) * 9);
  --bb: calc(var(--u) * 11);
  border-width: var(--bt) calc(var(--u) * 11) var(--bb);
}
#between .btn .ic {
  width: 1.15em;
  height: 1.15em;
}
#between .cost {
  display: inline-flex;
  align-items: center;
  gap: 0.15em;
  font-style: normal;
  margin-left: 0.2em;
  color: #bfeaff;
}
#between .cost .ic {
  width: 0.95em;
  height: 0.95em;
}
#nextBtn {
  flex: 1 1 auto;
}
#repairBtn {
  flex: none;
}
#between #repairBtn {
  font-size: calc(var(--u) * 13);
}
#between #nextBtn {
  font-weight: 700;
}
#repairBtn.full {
  filter: saturate(0.5) brightness(0.85);
}
/* portrait: a band right above the hand */
#hand {
  max-width: calc(var(--u) * 470);
}
#between {
  left: calc(var(--u) * 4);
  right: calc(var(--u) * 4);
  bottom: calc(100% + var(--u) * 14);
} /* 100% is the padding box: + the dock's frame */

/* ---- the small "progress saved" (once per wave cleared, then fades) */
#saved {
  position: absolute;
  left: calc(var(--u) * 10);
  top: calc(100% + var(--u) * 4);
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 4);
  pointer-events: none !important;
  opacity: 0;
  font-size: calc(var(--u) * 11);
  color: var(--muted);
  white-space: nowrap;
  transition: opacity 260ms;
}
#saved .ic {
  width: calc(var(--u) * 14);
  height: calc(var(--u) * 14);
}
#saved small {
  padding-top: var(--cap);
  font-weight: 600;
}
#saved.on {
  opacity: 0.9;
}

@media (max-aspect-ratio: 4/3) and (max-width: 490px) {
  #hand {
    gap: 4px;
    border-block-width: 5px 6px;
  }
  #energy {
    height: 20px;
  }
  #energy > .ic {
    width: 20px;
    height: 20px;
  }
  #energy > b {
    font-size: 20px;
  }
  #energy .bar {
    height: 15px;
  }
  .card,
  #pulseBtn {
    --H: calc(var(--u) * 86);
  }
}

/* ======== landscape (computer, ultrawide): mana left, cards, Flare right; actions in a column beside the Flare */
@media (min-aspect-ratio: 4/3) {
  #hand {
    width: auto;
    max-width: min(100%, calc(var(--u) * 680));
    margin: 0 auto calc(var(--u) * 3);
    flex-direction: row;
    align-items: center;
    gap: calc(var(--u) * 10);
    border-width: calc(var(--u) * 6) calc(var(--u) * 8) calc(var(--u) * 7);
  }
  #energy {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-content: center;
    width: calc(var(--u) * 100);
    height: auto;
    gap: calc(var(--u) * 5) calc(var(--u) * 6);
    flex: none;
  }
  #energy > .ic {
    width: calc(var(--u) * 28);
    height: calc(var(--u) * 28);
  }
  #energy > b {
    font-size: calc(var(--u) * 30);
  }
  #energy .bar {
    grid-column: 1 / -1;
    width: 100%;
    height: calc(var(--u) * 16);
  }
  #hand .row {
    flex: 1;
    gap: calc(var(--u) * 8);
  }
  #cards {
    justify-content: flex-start;
  }
  .card {
    --H: calc(var(--u) * 74);
    width: calc(var(--u) * 70);
    flex: none;
    max-width: none;
  }
  .card .nm {
    font-size: calc(var(--u) * 10.5);
  }
  .card .win {
    left: calc(var(--u) * 4);
    right: calc(var(--u) * 4);
  }
  .card .cost {
    font-size: calc(var(--u) * 13);
  }
  .card .need {
    font-size: calc(var(--u) * 9);
  }
  #pulseBtn {
    --H: calc(var(--u) * 74);
    --fs: calc(var(--u) * 52);
    --fy: calc(var(--H) * 0.4);
    flex: none;
    width: calc(var(--u) * 62);
  }
  #pulseBtn > .fr,
  #pulseBtn > .nm {
    display: none;
  }
  #pulseBtn small {
    font-size: calc(var(--u) * 13);
  }
  #between {
    left: calc(100% + var(--u) * 8);
    right: auto;
    bottom: 0;
    top: auto;
    translate: calc(var(--u) * -6) 0;
    flex-direction: column;
    width: calc(var(--u) * 142);
  }
  #between:not(.up) {
    top: calc(var(--u) * -6);
    bottom: calc(var(--u) * -7);
    left: calc(100% + var(--u) * 16);
  }
  #between:not(.up) .btn {
    flex: 1 1 0;
    min-height: 0;
    height: auto;
    width: 100%;
  }
  #between.on {
    translate: 0 0;
  }
  /* not enough room beside the Flare (dock.js place): a row right above the dock's right end */
  #between.up {
    left: auto;
    right: 0;
    top: auto;
    bottom: calc(100% + var(--u) * 12);
    flex-direction: row;
    width: auto;
    translate: 0 calc(var(--u) * 6);
  }
  #between.up.on {
    translate: 0 0;
  }
  #between .btn {
    height: max(44px, calc(var(--u) * 40));
    font-size: calc(var(--u) * 15);
  }
}
/* ======== phone landscape: horizontal cards (portrait left, name over cost), dock 62-70 px tall, left-aligned so the
   actions fit beside the Flare (dock.js moves them above it, .up, when the screen is too narrow) */
@media (min-aspect-ratio: 4/3) and (max-height: 500px) {
  #hand {
    align-self: flex-start;
    margin: 0 0 1px 8px;
    border-width: 5px 6px 6px;
    gap: 7px;
    max-width: calc(100% - 16px);
  }
  #energy {
    width: 68px;
    gap: 3px 4px;
  }
  #energy > .ic {
    width: 20px;
    height: 20px;
  }
  #energy > b {
    font-size: 21px;
  }
  #energy .bar {
    height: 12px;
    border-width: 3px 5px;
  }
  #hand .row {
    gap: 6px;
  }
  #cards,
  .card-stack.has-scroll #cards {
    --card-gap: 6px;
    gap: var(--card-gap);
  }
  .card {
    --H: 52px;
    --k: calc(52px / 260);
    width: 90px;
    height: var(--H);
  }
  .card > .fr.n,
  .card > .fr.s {
    border-image-slice: 22 26 26 232 fill;
    border-width: calc(var(--k) * 22) calc(var(--k) * 26) calc(var(--k) * 26) calc(var(--k) * 232);
  }
  .card > .fr.n {
    border-image-source: url(../assets/ui/card-h.webp);
  }
  .card > .fr.s {
    border-image-source: url(../assets/ui/card-h.webp);
    outline: 2px solid #4fe39b;
    outline-offset: -1px;
    border-radius: 9px;
  }
  .card .win {
    left: 4px;
    top: calc(var(--k) * 21);
    width: min(34%, 33px);
    right: auto;
    bottom: auto;
    height: calc(var(--k) * 218);
    border-radius: 6px;
  }
  .card .pic {
    inset: 4% -4% 0;
  }
  .card .nm {
    left: 39%;
    right: 3px;
    top: 4px;
    height: 19px;
    font-size: 13px;
  }
  .card .cost {
    left: 39%;
    right: 3px;
    top: calc(var(--k) * 112);
    bottom: calc(var(--k) * 22);
    height: auto;
    font-size: 16px;
    gap: 3px;
  }
  .card .cost .ic {
    width: 13px;
    height: 13px;
  }
  .card .need {
    font-size: 8.5px;
    padding: 0 3px;
    bottom: 3px;
  }
  .card.sel,
  .card.drag {
    transform: translateY(-2px);
  }
  #pulseBtn {
    --H: 52px;
    --fs: 40px;
    --fy: 20px;
    width: 48px;
  }
  #pulseBtn small {
    font-size: 12px;
    height: 12px;
    bottom: 0;
  }
  #pulseBtn small .ic {
    width: 11px;
    height: 11px;
  }
  #between {
    left: calc(100% + 6px);
    flex-direction: row;
    top: 50%;
    bottom: auto;
    width: auto;
    translate: -6px -50%;
  }
  #between.on {
    translate: 0 -50%;
  }
  #between:not(.up) {
    left: calc(100% + 14px);
    top: 50%;
    bottom: auto;
  }
  #between:not(.up) .btn {
    flex: none;
    height: 46px;
    width: auto;
  }
  #between.up {
    left: auto;
    right: 0;
    top: auto;
    bottom: calc(100% + 6px);
    translate: 0 6px;
  }
  #between.up.on {
    translate: 0 0;
  }
  #between .btn {
    height: 46px;
    font-size: 13.5px;
    padding: 0 2px;
    --bt: 8px;
    --bb: 10px;
    border-width: var(--bt) 9px var(--bb);
  }
  #repairBtn > span > b {
    display: none;
  } /* the icon and the cost say it here (aria-label keeps the word) */
  #saved {
    left: auto;
    right: 8px;
  }
}
/* portrait: the tutorial hint moves up while the actions band shows (never behind it) */
@media (max-aspect-ratio: 4/3) {
  #battle:has(#between.on) #hint {
    bottom: calc(var(--touch) + var(--u) * 16);
  }
}
#battle:has(#between.on.up) #hint {
  bottom: calc(max(44px, var(--u) * 40) + var(--u) * 14);
}
.calm #between,
.calm #saved,
.calm #recallTip {
  transition-duration: 1ms !important;
}

/* ---- group A (src/ui/hand-juice.js): the hand's juice. Loops stop and one-shots take 1 ms with less motion */
#ghost {
  rotate: var(--lean, 0deg);
} /* A1: leans with the finger's speed */
.card.drag {
  opacity: 0.35;
  filter: grayscale(0.6);
} /* A2: the card left behind is a gap */
.card.near:not(.drag) {
  transform: translateY(calc(var(--u) * -2));
} /* A4: one mana short, it peeks */
#energy .bar.slosh .fill {
  animation: slosh 0.42s ease-out;
} /* A5: spent mana sloshes */
@keyframes slosh {
  30% {
    transform: skewX(-6deg) scaleY(0.92);
  }
  65% {
    transform: skewX(3deg);
  }
}
#energy .fill::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.35;
  pointer-events: none; /* A5: the wave inside */
  background: repeating-linear-gradient(
    100deg,
    transparent 0 14px,
    rgba(255, 255, 255, 0.45) 14px 18px,
    transparent 18px 32px
  );
  background-size: 64px 100%;
  animation: manaWave 2.4s linear infinite;
}
@keyframes manaWave {
  to {
    background-position: 64px 0;
  }
}
.calm #energy .fill::before {
  animation-name: none !important;
}
#cardInfo {
  position: absolute;
  bottom: calc(100% + var(--u) * 8);
  translate: -50% 6px;
  z-index: 4;
  max-width: calc(var(--u) * 200);
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 140ms,
    translate 140ms;
  border-width: calc(var(--u) * 6) calc(var(--u) * 9);
  text-align: center;
} /* A6 */
#cardInfo.on {
  opacity: 1;
  translate: -50% 0;
}
#cardInfo b {
  display: block;
  font-size: calc(var(--u) * 13);
  color: #ffd66b;
  padding-top: var(--cap);
}
#cardInfo small {
  display: block;
  font-size: calc(var(--u) * 11.5);
  line-height: 1.2;
}
.flyCard {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 25;
  width: 44px;
  height: 52px;
  margin: -26px 0 0 -22px;
  pointer-events: none;
} /* A3, A7 */
.flyCard > i {
  position: absolute;
  inset: 0;
}
.flyCard.recall {
  filter: drop-shadow(0 0 6px rgba(90, 230, 160, 0.7));
}
.hammer {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 25;
  pointer-events: none;
} /* A9 */
.hammer .ham {
  position: absolute;
  width: 34px;
  left: 4px;
  top: -66px;
  transform-origin: 80% 80%;
  animation: knock 0.8s ease-in-out both;
}
.hammer .plank {
  position: absolute;
  width: 46px;
  left: -23px;
  top: -34px;
  rotate: -8deg;
  opacity: 0;
  animation: plank 1.25s ease-out 0.2s both;
}
.hammer .chip {
  position: absolute;
  width: 11px;
  left: -5px;
  top: -24px;
  opacity: 0;
  animation: dust 0.6s ease-out 0.28s both;
}
.hammer .chip:nth-of-type(3) {
  --dx: -18px;
  --r: -120deg;
}
.hammer .chip:nth-of-type(4) {
  --dx: 16px;
  --r: 140deg;
  animation-delay: 0.62s;
}
.hammer .chip:nth-of-type(5) {
  --dx: 4px;
  --r: 90deg;
  animation-delay: 0.45s;
}
@keyframes knock {
  0% {
    opacity: 0;
    rotate: 30deg;
  }
  15% {
    opacity: 1;
  }
  30%,
  70% {
    rotate: -25deg;
  }
  50%,
  90% {
    rotate: 20deg;
  }
  100% {
    opacity: 0;
  }
}
@keyframes plank {
  0% {
    opacity: 0;
    translate: 0 -8px;
  }
  12% {
    opacity: 1;
    translate: 0 0;
    scale: 1.06 0.94;
  }
  22% {
    scale: 1;
  }
  50% {
    scale: 0.97 1.03;
  }
  58%,
  80% {
    scale: 1;
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes dust {
  0% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    translate: var(--dx, 0) -16px;
    rotate: var(--r, 60deg);
  }
}
.card.flipIn {
  animation: flipIn 0.7s cubic-bezier(0.3, 1.3, 0.5, 1) both;
} /* A10 */
@keyframes flipIn {
  from {
    transform: perspective(300px) rotateY(180deg) scale(0.8);
    opacity: 0.3;
  }
  55% {
    opacity: 1;
  }
}
.card.flipIn::after {
  content: '';
  position: absolute;
  inset: 6%;
  border-radius: 8px;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.5) 50%, transparent 60%) no-repeat;
  background-size: 250% 100%;
  animation: cardGlint 0.6s ease-out 0.45s both;
}
#pulseBtn .cd {
  background: linear-gradient(to bottom, rgba(8, 16, 20, 0.62) calc(var(--cd, 0) * 100%), transparent 0);
} /* A11: fills from below */
#pulseBtn.ready > img {
  animation: crackle 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes crackle {
  25% {
    scale: 1.12;
    rotate: -4deg;
  }
  55% {
    scale: 0.97;
    rotate: 3deg;
  }
}
/* End of dock.css */
/* regra-chefes (src/ui/alerts.js): the Flare breathes while a warned blow it can call off is on; calm: still */
#pulseBtn.answer > img {
  animation: answer 0.9s ease-in-out infinite;
}
@keyframes answer {
  50% {
    scale: 1.08;
  }
}
.calm #pulseBtn.answer > img {
  animation: none;
}
.calm .hammer {
  display: none;
} /* less motion: the repair shows only in the bar */

.card .card-key {
  position: absolute;
  z-index: 2;
  inset-inline-start: calc(var(--u) * 7);
  top: calc(var(--H) * 0.23);
  display: grid;
  place-items: center;
  width: 1.55em;
  height: 1.55em;
  color: #f4f8f9;
  background: #253b46;
  border: 1px solid #66808a;
  border-bottom: 2px solid #10242e;
  border-radius: 4px;
  pointer-events: none;
  font:
    700 clamp(10px, calc(var(--u) * 9), 14px) / 1 system-ui,
    sans-serif;
}
@media (hover: none) {
  .card .card-key {
    display: none;
  }
}

#repairBtn[hidden] {
  display: none;
}

.card {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-shadow: inherit;
}
.card .nm {
  white-space: normal;
  line-height: 1;
  overflow-wrap: anywhere;
  text-align: center;
  font-size: clamp(12px, calc(var(--u) * 12), 16px);
}
.card:focus-visible {
  outline: 2px solid #a3eaff;
  outline-offset: 1px;
  border-radius: 6px;
}
@media (max-width: 490px) and (max-aspect-ratio: 4/3) {
  .card .nm {
    min-height: 22px;
    background: #176949;
    border-radius: 4px 4px 0 0;
  }
  .card .win {
    top: 22px;
  }
}

@media (max-width: 450px) and (max-aspect-ratio: 4/3) {
  .card {
    container-type: inline-size;
  }
  .card .nm {
    font-size: min(calc(var(--u) * 11.5), 18cqi);
  }
}

.card-stack.has-scroll .card {
  container-type: inline-size;
}
.card-stack.has-scroll .card .nm {
  font-size: min(calc(var(--u) * 11), 16cqi);
  white-space: nowrap;
  overflow: hidden;
}
#nextBtn .next-time,
#nextBtn .next-bonus {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.78em;
  white-space: nowrap;
}
#nextBtn .next-time {
  padding: 0.13em 0.36em;
  border-radius: 0.4em;
  color: #fff5d7;
  background: #734411;
}
#nextBtn .next-bonus {
  padding: 0.13em 0.32em;
  border-radius: 0.4em;
  color: #e6fbff;
  background: #164755;
  text-shadow: none;
}
#nextBtn .next-bonus .ic {
  width: 0.85em;
  height: 0.85em;
}
#nextBtn .next-bonus i {
  font-style: normal;
}
#nextBtn .next-bonus[hidden] {
  display: none;
}

@media (max-width: 480px) and (max-aspect-ratio: 4/3) {
  .card-stack.has-scroll #cards .card {
    flex-basis: calc((100% - 3 * var(--card-gap)) / 3.5);
  }
  .card-stack .card .pic {
    inset: 0;
  }
  .card-stack .card .pic.hbox > img.hp {
    max-width: 100%;
    max-height: 100%;
    left: 50% !important;
    top: auto !important;
    bottom: 0;
    translate: -50% 0 !important;
    object-fit: contain;
    object-position: center bottom;
  }
}
/* End of css/dock.css (complete file). */
