/* Panels: one frame for all (levels, heroes, upgrades, how to play, pause, sound, settings, victory, defeat, new hero).
   Straight title band on the top edge (one size), X centered on the top-right corner, centered on both axes;
   when it does not fit, src/ui/panel.js shrinks it evenly (scale). */
/* the padding holds what sticks out of the panel (X: half a touch above and to the right; band: less), so the whole
   panel, band and X included, is always inside the screen with a margin. Portrait: the top also keeps the corner row
   (sound + gear stay above the dim layer) so the X never lands under them. */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  background: rgba(8, 16, 20, 0.62);
  --ov: calc(var(--touch) / 2 + 6px);
  padding: calc(env(safe-area-inset-top) + var(--ov)) calc(env(safe-area-inset-right) + var(--ov))
    calc(env(safe-area-inset-bottom) + var(--ov)) calc(env(safe-area-inset-left) + var(--ov));
}
@media (max-aspect-ratio: 4/3) {
  .modal {
    padding-top: calc(env(safe-area-inset-top) + var(--u) * 10 + var(--touch) + var(--ov) + 4px);
  }
}
@media (min-aspect-ratio: 4/3) {
  .modal {
    padding-left: max(calc(env(safe-area-inset-left) + var(--ov)), var(--cpad, 0px));
    padding-right: max(calc(env(safe-area-inset-right) + var(--ov)), var(--cpad, 0px));
  }
}
.modal.on {
  display: flex;
}
.modal.on .panel {
  animation: pop 180ms cubic-bezier(0.2, 0.8, 0.3, 1.1);
}
@keyframes pop {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
}
.modal.closing {
  display: flex;
  pointer-events: none;
  animation: fadeOut 120ms forwards;
}
.modal.closing .panel {
  animation: popOut 120ms forwards;
}
@keyframes popOut {
  to {
    transform: scale(0.96);
    opacity: 0;
  }
}
@keyframes fadeOut {
  to {
    opacity: 0;
  }
}
.panel {
  position: relative;
  width: min(100%, calc(var(--u) * 360));
  flex: none;
  display: flex;
  flex-direction: column;
  border-style: solid;
  border-color: transparent;
  border-image: url(../assets/ui/panel.webp) 60 fill;
  border-width: calc(var(--u) * 20);
  padding: calc(var(--u) * 34) calc(var(--u) * 4) calc(var(--u) * 6);
  transform-origin: center;
}
.panel.wide {
  width: min(100%, calc(var(--u) * 470));
}
.panel .band {
  position: absolute;
  left: 50%;
  top: calc(var(--u) * -30);
  width: min(88%, calc(var(--u) * 300));
  height: calc(var(--u) * 54);
  translate: -50% 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: solid;
  border-color: transparent;
  border-image: url(../assets/ui/band.webp) 40 50 fill;
  border-width: calc(var(--u) * 12) calc(var(--u) * 15) calc(var(--u) * 14);
}
.panel .band h2 {
  margin: 0;
  font-size: calc(var(--u) * 24);
  font-weight: 600;
  white-space: nowrap;
  padding-top: var(--cap);
  translate: 0 calc(var(--u) * -2.1);
} /* the band's face is rows 8.5..109.5 of 125 (its lip is under it): measured by the ruler */
.panel > .x {
  position: absolute;
  top: calc(var(--u) * -20);
  right: calc(var(--u) * -20);
  width: var(--touch);
  height: var(--touch);
  translate: 50% -50%;
  background: url(../assets/ui/x.webp) center / contain no-repeat;
}
.panel > .x[hidden] {
  display: none;
}
.panel > .x:active {
  scale: 0.94;
}
.panel .body {
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 10);
  align-items: stretch;
  text-align: center;
}
.panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
  font-size: calc(var(--u) * 15);
  line-height: 1.3;
}
.panel .btns {
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 8);
  margin-top: calc(var(--u) * 4);
}
.panel .btns .btn {
  width: 100%;
}
.panel .btns.two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* rows with an icon, a name and a control (sound, settings) */
.srow {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: calc(var(--u) * 10);
  min-height: var(--touch);
  text-align: left;
  font-size: calc(var(--u) * 17);
}
.srow > .ic {
  width: calc(var(--u) * 30);
  height: calc(var(--u) * 30);
}
.srow > b {
  white-space: nowrap;
  padding-top: var(--cap);
}
.srow.slider {
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.3fr);
}
/* toggle: the two pieces stacked, swapped by opacity (never flickers) */
.toggle {
  position: relative;
  width: calc(var(--u) * 66);
  height: calc(var(--u) * 30);
  min-height: 44px;
  min-width: 66px;
}
.toggle img {
  position: absolute;
  left: 0;
  top: 50%;
  translate: 0 -50%;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 120ms;
}
.toggle .on {
  opacity: 0;
}
.toggle[aria-checked='true'] .on {
  opacity: 1;
}
.toggle[aria-checked='true'] .off {
  opacity: 0;
}
/* the switch slides with a spring: each piece comes in from its side (only transform/opacity) */
.toggle img {
  transition:
    opacity 0.14s,
    translate 0.32s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.toggle .on {
  translate: -10% -50%;
}
.toggle[aria-checked='true'] .on {
  translate: 0 -50%;
}
.toggle[aria-checked='true'] .off {
  translate: 0 -50%;
} /* (not to the right: that overflowed the row and fit.js shrank its label) */
/* volume: track, fill and knob are art; an invisible range input on top does the work */
.vol {
  position: relative;
  height: 44px;
  display: flex;
  align-items: center;
  --v: 0.8;
}
.vol .track,
.vol .vfill {
  position: absolute;
  left: 0;
  right: 0;
  height: calc(var(--u) * 12);
  border-style: solid;
  border-color: transparent;
  border-width: calc(var(--u) * 5) calc(var(--u) * 6);
}
.vol .track {
  border-image: url(../assets/ui/slider-track.webp) 24 28 fill;
}
.vol .vfill {
  border-image: url(../assets/ui/slider-fill.webp) 26 28 fill;
  clip-path: inset(0 calc((1 - var(--v)) * 100%) 0 0);
}
.vol .knob {
  position: absolute;
  left: calc(var(--v) * (100% - var(--u) * 26));
  width: calc(var(--u) * 26);
  height: calc(var(--u) * 26);
  background: url(../assets/ui/knob.webp) center / contain no-repeat;
  pointer-events: none;
}
.vol input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.difficulty-choice {
  display: grid;
  gap: 4px;
}
.difficulty-choice p {
  font-size: clamp(12px, calc(var(--u) * 13), 17px);
}

/* Language sits under the switches and uses the platform picker on touch devices. */
.panel[data-id='settings'] {
  width: min(100%, calc(var(--u) * 340));
}
.language-row {
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.65fr);
}
.language-row label {
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.lang-select {
  min-width: 0;
  min-height: 44px;
  border: 2px solid #52717e;
  border-radius: 8px;
  padding: 0 calc(var(--u) * 7);
  background: #142d38;
  color: #f1f7f7;
  color-scheme: dark;
  font:
    600 max(14px, calc(var(--u) * 15)) / 1.2 system-ui,
    sans-serif;
  text-shadow: none;
  cursor: pointer;
}
.lang-select:focus-visible {
  outline: 2px solid #78e4b5;
  outline-offset: 2px;
}
@media (max-width: 360px) {
  .language-row {
    grid-template-columns: auto 1fr;
  }
  .lang-select {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* heroes: two columns of cards (inner piece), name, level, damage, health, price */
/* every card the same size; a last row that is not full is centered (2+2+1 portrait, 3+2 landscape) */
.hgrid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(var(--u) * 8);
  --cols: 2;
}
.hgrid > .hcard {
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--u) * 8) / var(--cols));
  min-width: 0;
}
@media (min-aspect-ratio: 4/3) {
  .hgrid {
    --cols: 5;
  }
  .panel.wide[data-id='heroes'] {
    width: min(100%, calc(var(--u) * 640));
  }
}
/* round 3: a bigger portrait: the card is one column (name, portrait the card's whole width, damage and health side by
   side, level pips, price); landscape shows the 5 heroes in one row */
.hcard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: calc(var(--u) * 2) calc(var(--u) * 4);
  border-style: solid;
  border-color: transparent;
  border-image: url(../assets/ui/inner.webp) 36 fill;
  border-width: calc(var(--u) * 8);
  padding: calc(var(--u) * 2);
}
.hcard > h3 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: calc(var(--u) * 15);
  font-weight: 600;
  white-space: nowrap;
  padding-top: var(--cap);
}
.hcard .pic {
  height: calc(var(--u) * 78);
  background: center bottom / contain no-repeat;
}
@media (max-aspect-ratio: 4/3) and (max-height: 720px) {
  .hcard .pic {
    height: calc(var(--u) * 64);
  }
} /* short phones: the panel keeps its text size */
.hcard > .pips {
  justify-content: center;
  margin: calc(var(--u) * 1) 0 calc(var(--u) * 3);
}
.hcard .stats {
  display: flex;
  justify-content: center;
  gap: calc(var(--u) * 6);
  font-size: calc(var(--u) * 14);
}
.hcard .stats span {
  display: flex;
  align-items: center;
  gap: 0.25em;
  white-space: nowrap;
}
.hcard .stats .ic {
  width: calc(var(--u) * 15);
  height: calc(var(--u) * 15);
}
.hcard .stats b {
  padding-top: var(--cap);
}
.hcard .btn {
  grid-column: 1 / -1;
  height: calc(var(--u) * 42);
  font-size: calc(var(--u) * 16);
  padding: 0;
}
.hcard .btn .ic {
  width: 1.05em;
  height: 1.05em;
}
.hcard.locked .pic {
  filter: grayscale(1) brightness(0.55);
}
.coinline {
  display: flex;
  justify-content: center;
}
.coinline[hidden] {
  display: none;
}
.coinline .art-pill {
  font-size: calc(var(--u) * 20);
  transition:
    opacity 0.2s,
    scale 0.3s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.coinline .art-pill.wait {
  opacity: 0;
  scale: 0.85;
} /* end card: comes in when the count starts (menus.js) */

/* upgrades: one column in portrait, two in landscape (6 rows fit the phone on its side); one line of text each */
.ugrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: calc(var(--u) * 8);
}
@media (min-aspect-ratio: 4/3) {
  .ugrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .panel.wide[data-id='upgrades'] {
    width: min(100%, calc(var(--u) * 620));
  }
}
.urow {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: 'ic nm btn' 'ic pp btn' 'ds ds ds';
  align-items: center;
  gap: calc(var(--u) * 3) calc(var(--u) * 8);
  text-align: left;
  border-style: solid;
  border-color: transparent;
  border-image: url(../assets/ui/inner.webp) 36 fill;
  border-width: calc(var(--u) * 8);
}
.urow > .ic {
  grid-area: ic;
  width: calc(var(--u) * 32);
  height: calc(var(--u) * 32);
}
.urow > b {
  grid-area: nm;
  display: block;
  font-size: calc(var(--u) * 16);
  padding-top: var(--cap);
  white-space: nowrap;
  min-width: 0;
}
.urow small {
  grid-area: ds;
  display: block;
  color: var(--muted);
  font-weight: 500;
  font-size: calc(var(--u) * 12.5);
  text-shadow: none;
  white-space: nowrap;
  min-width: 0;
  padding-left: calc(var(--u) * 2);
}
.urow .pips {
  grid-area: pp;
  margin-top: 0;
}
.pips {
  display: flex;
  gap: calc(var(--u) * 3);
  margin-top: calc(var(--u) * 4);
}
.pips i {
  width: calc(var(--u) * 14);
  height: calc(var(--u) * 6);
  border-radius: 3px;
  background: #0d1a20;
}
.pips i.on {
  background: var(--em);
}
.urow .btn {
  grid-area: btn;
  height: calc(var(--u) * 44);
  min-width: calc(var(--u) * 80);
  font-size: calc(var(--u) * 15);
  padding: 0;
  border-left-width: calc(var(--u) * 9);
  border-right-width: calc(var(--u) * 9);
}

/* how to play, new hero, end cards */
.how {
  display: grid;
  grid-template-columns: calc(var(--u) * 64) minmax(0, 1fr);
  gap: calc(var(--u) * 10);
  align-items: center;
  text-align: left;
}
.how .pic {
  height: calc(var(--u) * 58);
  background: center / contain no-repeat;
}
.how p {
  color: var(--text);
  font-size: calc(var(--u) * 14);
}
.hero-big {
  height: calc(var(--u) * 130);
  background: center bottom / contain no-repeat;
}
.stars {
  display: flex;
  justify-content: center;
  gap: calc(var(--u) * 8);
}
.stars img {
  width: calc(var(--u) * 58);
  height: calc(var(--u) * 58);
}
.stars img:nth-child(2) {
  translate: 0 calc(var(--u) * -8);
}
.modal.on .stars img {
  animation: starIn 320ms cubic-bezier(0.3, 1.5, 0.5, 1) backwards;
}
.modal.on .stars img:nth-child(2) {
  animation-delay: 160ms;
}
.modal.on .stars img:nth-child(3) {
  animation-delay: 320ms;
}
@keyframes starIn {
  from {
    scale: 0.3;
    opacity: 0;
  }
}
.big-line {
  font-size: calc(var(--u) * 20);
}
/* round 4: the help said plainly (defeat: what the next try brings; victory under help: the star cap) */
.panel p.cap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: calc(var(--u) * 6);
  font-size: calc(var(--u) * 13);
}
.panel p.cap > span {
  padding-top: var(--cap);
}
.panel p.cap .st {
  display: flex;
  gap: calc(var(--u) * 2);
}
.panel p.cap .st img {
  width: calc(var(--u) * 18);
  height: calc(var(--u) * 18);
}
.helpnext {
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 4);
}
.helpnext > p:first-child {
  color: var(--text);
  font-size: calc(var(--u) * 14);
}
/* round 4b: "try without reinforcement" (quiet, secondary) and the small notes of the victory card */
.helpnext > .btn.lite {
  align-self: center;
  width: auto;
  min-width: 70%;
  height: max(44px, calc(var(--u) * 44));
  font-size: calc(var(--u) * 15);
}
.panel p.note {
  color: var(--muted);
  font-size: calc(var(--u) * 13);
}
@media (max-height: 500px) {
  .panel {
    padding-top: calc(var(--u) * 30);
  }
  .hcard .pic {
    height: calc(var(--u) * 50);
  }
}
/* ---- block 4: the end card. Victory: the band comes in with a spring and a light passes over it once (stars one by
   one above); defeat: the card rises calmly; a tap finishes every entry at once (.skip) */
/* (the light sweep over the band was cut: caught halfway it read as a pale rectangle at the right of the title) */
.modal.on .panel[data-id='victory'] .band {
  animation: bandIn 420ms cubic-bezier(0.3, 1.5, 0.5, 1) 60ms backwards;
}
@keyframes bandIn {
  from {
    scale: 0.6;
    opacity: 0;
  }
}
.modal.on .panel[data-id='victory'] .stars img {
  animation-delay: 380ms;
}
.modal.on .panel[data-id='victory'] .stars img:nth-child(1) {
  animation-delay: 380ms;
}
.modal.on .panel[data-id='victory'] .stars img:nth-child(3) {
  animation-delay: 560ms;
}
.modal.on .panel[data-id='victory'] .stars img:nth-child(2) {
  animation-delay: 740ms;
}
.modal.on .panel[data-id='defeat'] {
  animation: rise 520ms cubic-bezier(0.2, 0.9, 0.3, 1.04);
}
@keyframes rise {
  from {
    translate: 0 calc(var(--u) * 48);
    opacity: 0;
  }
}
/* the tap that skipped the ceremony (or the last tap of the battle) never lands on a button of the new card */
.modal .panel.guard .btn {
  pointer-events: none;
} /* round 4b: every button (also "try without reinforcement") */
.modal.skip *,
.modal.skip *::after,
.modal.skip .panel {
  animation-duration: 1ms !important;
  animation-delay: 0ms !important;
}
/* new hero card: the hero cheers with a small hop from the feet (a loop: stops with less motion) */
.modal.on .hero-big {
  transform-origin: 50% 100%;
  animation: cheerHop 0.5s cubic-bezier(0.3, 0, 0.5, 1) infinite alternate;
}
@keyframes cheerHop {
  from {
    scale: 1 1;
    translate: 0 0;
  }
  to {
    scale: 1.03 1.05;
    translate: 0 calc(var(--u) * -6);
  }
}
.calm .hero-big {
  animation-name: none !important;
}
/* End of panels.css */
/* H84: the pip just bought fills like a liquid: from the left with a moving surface, then settles (calm: at once) */
.pips i.fill {
  position: relative;
  overflow: hidden;
  background: #0d1a20;
}
.pips i.fill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--em);
  border-radius: inherit;
  transform-origin: left;
  animation: pipFill 0.55s ease-out both;
}
@keyframes pipFill {
  0% {
    transform: scaleX(0);
  }
  60% {
    transform: scaleX(1.06) skewX(-10deg);
  }
  100% {
    transform: none;
  }
}
.calm .pips i.fill::before {
  animation: none;
}

.shop-note {
  max-width: 58ch;
  margin: 0 auto;
  color: #c5d9df;
  text-align: center;
  font-size: clamp(13px, calc(var(--u) * 12), 17px);
  line-height: 1.35;
}

.badge-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: calc(var(--u) * 5);
}
.badge-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: calc(var(--u) * 8);
  text-align: left;
  padding: calc(var(--u) * 5);
  border: 1px solid #3e5c6a;
  border-radius: 8px;
  background: #152d38;
}
.badge-row .badge {
  width: calc(var(--u) * 40);
  height: calc(var(--u) * 40);
}
.badge-row[data-earned='false'] .badge {
  filter: grayscale(1);
  opacity: 0.55;
}
.badge-row b {
  font-size: calc(var(--u) * 15);
}
.badge-row p,
.badge-row small {
  font-size: calc(var(--u) * 11);
}
.badge-row small {
  color: #85ebbb;
}
.badge-row[data-earned='false'] small {
  color: var(--muted);
}

.defeat-threat {
  display: flex;
  align-items: center;
  gap: 0.65em;
  text-align: left;
  padding: 0.4em 0.65em;
  background: #2e3037;
  border: 1px solid #81564c;
  border-radius: 8px;
}
.defeat-threat img {
  width: 2.4em;
  height: 2.4em;
  object-fit: contain;
}
.defeat-threat > div {
  flex: 1;
}
.defeat-threat p {
  font-size: 0.82em;
}
.defeat-threat .threat-arrow {
  font: 700 1.55em/1 system-ui;
  color: #ffd691;
}
.threat-guide {
  min-height: 44px;
  padding: 0 0.5em;
  border: 0;
  background: transparent;
  color: #a4efdb;
  font: inherit;
  font-size: 0.84em;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.threat-guide:is(:focus-visible, :hover) {
  color: #f3fffc;
}
@media (max-width: 480px) {
  .defeat-threat {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 0.6em;
    row-gap: 0;
  }
  .threat-guide {
    grid-column: 2 / -1;
    justify-self: start;
    padding-inline: 0;
  }
}
.panel .btns.defeat-actions {
  width: min(100%, 680px);
  margin: 0 auto;
}
.panel .btns.main.defeat-actions.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.panel .defeat-actions .btn {
  height: clamp(44px, var(--u) * 47, 64px);
}
.panel .defeat-actions .retry-no-help {
  border-width: 0;
  padding: 0 14px 3px;
  font-size: clamp(14px, var(--u) * 14, 20px);
}
@media (max-width: 560px), (max-aspect-ratio: 4/3) {
  .panel .btns.main.defeat-actions.two {
    grid-template-columns: minmax(0, 1fr);
  }
}

.panel.wide[data-id='bestiary'] {
  width: min(100%, 840px);
}
.panel[data-id='bestiary'] .band {
  width: min(68%, 330px);
}
.bestiary-layout {
  display: grid;
  grid-template-columns: minmax(130px, 0.74fr) minmax(0, 1.6fr);
  height: clamp(260px, 53dvh, 410px);
  gap: clamp(12px, 2vw, 24px);
  text-align: left;
}
.bestiary-index {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 9px;
  padding-right: 12px;
  border-right: 1px solid #45606b;
}
.panel .bestiary-count {
  color: #b8d1ce;
  font-weight: 700;
  font-size: 14px;
  text-align: left;
}
.bestiary-grid,
.bestiary-detail {
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #6c9592 #132d37;
}
.bestiary-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 4px;
}
.bestiary-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  flex: none;
  padding: 4px 9px;
  text-align: left;
  border-left: 3px solid transparent;
  border-bottom: 1px solid #385763;
  color: #f0f7f5;
  font-size: clamp(13px, 1.5vw, 18px);
}
.bestiary-tile img {
  width: 30px;
  height: 28px;
  object-fit: contain;
  flex: none;
}
.bestiary-tile[aria-pressed='true'] {
  border-left-color: #8ee8bd;
  background: #244850;
}
.bestiary-tile:focus:not(:focus-visible) {
  outline: none;
}
.bestiary-detail {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}
.bestiary-showcase {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1px;
  min-height: 0;
  padding: 5px 8px 9px;
  border-radius: 12px;
  background: radial-gradient(ellipse at 50% 60%, #527047, #263f36 68%, #192e37);
}
.bestiary-showcase[data-role='air'] {
  background: radial-gradient(ellipse at 50% 60%, #4e6585, #283d59 68%, #172b41);
}
.bestiary-showcase[data-role='boss'] {
  background: radial-gradient(ellipse at 50% 60%, #835647, #483645 68%, #242b40);
}
.bestiary-showcase h3 {
  margin: 0;
  text-align: center;
  font-size: clamp(16px, 2.3vw, 29px);
}
.bestiary-portrait {
  width: min(70%, 255px);
  height: clamp(84px, 20dvh, 164px);
  object-fit: contain;
}
.bestiary-facts {
  display: grid;
  gap: 9px;
}
.bestiary-facts section + section {
  border-top: 1px solid #45606b;
  padding-top: 8px;
}
.bestiary-facts b {
  color: #e3f2ed;
  font-size: clamp(13px, 1.4vw, 17px);
}
.bestiary-facts p {
  text-align: left;
  margin-top: 2px;
  font-size: clamp(13px, 1.35vw, 17px);
}
.bestiary-empty {
  align-self: center;
}
@media (max-width: 580px) {
  .bestiary-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    height: clamp(295px, 58dvh, 396px);
    gap: 7px;
  }
  .bestiary-index {
    padding: 0;
    border: 0;
    gap: 4px;
  }
  .bestiary-grid {
    flex-direction: row;
    overflow-x: auto;
  }
  .bestiary-tile {
    white-space: nowrap;
  }
  .bestiary-showcase {
    padding-bottom: 5px;
  }
}

.formation-map {
  position: relative;
  aspect-ratio: 1.22;
  overflow: hidden;
  border: 1px solid #52745e;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 54%, #6c8956, #426449 72%, #2c493c);
}
.formation-map > .ic {
  position: absolute;
  width: 12%;
  height: 15%;
  left: 50%;
  top: 53%;
  translate: -50% -50%;
}
.formation-tile {
  position: absolute;
  width: 16%;
  height: 17%;
  translate: -50% -50%;
  isolation: isolate;
}
.formation-tile::before {
  position: absolute;
  content: '';
  inset: 20%;
  rotate: 45deg;
  background: #243f36;
  border: 1px solid #7ba574;
  border-radius: 4px;
  z-index: -1;
}
.formation-tile .formation-hero {
  position: absolute;
  inset: -18% 0 15%;
}
.formation-tile small {
  position: absolute;
  bottom: 0;
  left: 50%;
  translate: -50% 0;
  color: #fff;
  border-radius: 100%;
  min-width: 1.4em;
  background: #163542;
  font: 700 11px/1.4 system-ui;
}

.panel .body.panel-scroll {
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #709c9d #142c37;
}
.panel .body.panel-scroll > * {
  flex-shrink: 0;
}

.panel-actions {
  flex: none;
  padding-top: 6px;
}
.panel-actions[hidden] {
  display: none;
}
.selection-status {
  min-height: 1.25em;
  color: #ffd879;
}
/* End of css/panels.css (complete file). */
