/* Arena HUD. Rails sit outside the playable hexes at each viewport width. */
:root {
  --ink: #10171d;
  --cream: #f7f0db;
  --brass: #e4c785;
  --ledge: #524d40;
}
body {
  background: #10171b;
}
.topbar {
  height: 58px;
  min-height: 0;
  padding-inline: clamp(18px, 3.3vw, 64px);
  gap: clamp(30px, 5vw, 80px);
  background: #121b20;
  border-bottom: 1px solid #514c40;
  position: relative;
  z-index: 2;
}
.brand {
  gap: 9px;
}
.brandmark {
  width: 34px;
  height: 34px;
  transform: none;
}
.brand b {
  font-size: 21px;
  letter-spacing: 0.55px;
}
.brand small {
  font-size: 8px;
  letter-spacing: 3.5px;
}
.main-nav {
  gap: 19px;
}
.nav.active {
  color: var(--cream);
}
.nav.active:after {
  height: 2px;
  background: var(--brass);
}
.nav {
  font-size: 14px;
}
.toptools {
  gap: 11px;
}
.toptools .iconbtn {
  background: transparent;
  border-color: transparent;
  color: #b7c5c7;
}
.toptools .userpic {
  height: 31px;
  width: 31px;
}
#arenaView {
  max-width: none;
  padding: 0;
  margin: 0;
  --safe-edge: clamp(14px, 2.7vw, 50px);
}
.arena {
  height: clamp(440px, calc(100svh - 270px), 950px);
  min-height: 0;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #18332e;
  border-bottom: 1px solid #867348;
}
.worldimage,
.worldshade {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.worldimage {
  background-size: cover;
  background-position: 50% 43%;
}
.worldshade {
  background:
    linear-gradient(180deg, #06101695 0%, transparent 20%, transparent 68%, #081316b3 100%),
    linear-gradient(90deg, #06111978, transparent 18%, transparent 81%, #06111983);
}
.arena-heading {
  position: absolute;
  z-index: 3;
  top: 20px;
  left: var(--safe-edge);
  color: #fff8e8;
  text-shadow:
    0 2px 12px #071217,
    0 1px 3px #071217;
}
.arena-heading .maplabel {
  display: flex;
  gap: 7px;
  align-items: center;
  color: #f5db98;
  letter-spacing: 1.8px;
  font:
    700 10px Barlow,
    sans-serif;
}
.arena-heading h1 {
  font: 600 clamp(28px, 2.85vw, 47px) / 1.07 var(--head);
  letter-spacing: 0.2px;
  margin: 4px 0;
}
.phase-hud {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  min-height: 44px;
  padding: 6px 30px 8px;
  background: linear-gradient(125deg, #172427ed, #162024f5 70%, #14242aed);
  clip-path: polygon(0 0, 100% 0, calc(100% - 15px) 100%, 15px 100%);
  border-bottom: 2px solid #bea371;
  color: var(--cream);
}
#roundBadge {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}
#roundBadge small,
.enc-label small,
.rail-title,
.benchlabel span {
  font:
    700 10px Barlow,
    sans-serif;
  letter-spacing: 1.45px;
  text-transform: uppercase;
}
#roundBadge small {
  color: #b9b6a6;
}
#roundBadge b {
  font: 700 24px/1 var(--head);
  font-variant-numeric: tabular-nums;
}
.phase-divider {
  height: 18px;
  width: 1px;
  background: #5b6057;
}
#fieldStatus {
  font:
    600 14px Barlow,
    sans-serif;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.roundpath {
  display: flex;
  gap: 5px;
  align-items: center;
}
.roundpath span {
  width: 6px;
  height: 6px;
  border: 1px solid #81908b;
  transform: rotate(45deg);
  color: transparent;
  overflow: hidden;
}
.roundpath .sel {
  background: #f2d99b;
  border-color: #f2d99b;
}
.roundpath .done {
  background: #709e92;
  border-color: #709e92;
}
.battle-command {
  position: absolute;
  right: var(--safe-edge);
  top: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 4;
}
.enc-label {
  text-align: right;
  text-shadow: 0 1px 5px #000;
}
.enc-label b,
.enc-label small {
  display: block;
}
.enc-label b {
  font: 600 19px var(--head);
  color: #fff8e9;
}
.enc-label small {
  color: #e4d7ab;
  font-size: 9px;
}
.action {
  font:
    700 15px Barlow,
    sans-serif;
  color: #282519;
  padding: 10px 20px;
  border: 1px solid #f6e7bd;
  border-radius: 3px;
  background: linear-gradient(150deg, #f6e4ad, #d8b770);
  box-shadow: 0 3px 12px #09101570;
  min-width: 106px;
}
.field {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(75%, 1120px);
  top: 17%;
  bottom: 14.5%;
  isolation: isolate;
  touch-action: manipulation;
}
.grid,
#fighters,
#effects {
  position: absolute;
  inset: 0;
}
.grid .hex {
  position: absolute;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  padding: 0;
  color: transparent;
  background: none;
  display: block;
}
.hex svg {
  display: block;
  height: 100%;
  width: 100%;
  overflow: visible;
}
.hex polygon {
  fill: #24514729;
  stroke: #b9edc948;
  stroke-width: 1;
  transition:
    fill 0.15s,
    stroke 0.15s;
}
.hex.enemy polygon {
  fill: #162e2d10;
  stroke: #b2d4ce28;
}
.arena.fighting .hex polygon {
  fill: transparent;
  stroke: #b8ddd625;
}
.hex.ally:hover polygon,
.hex.ally:focus-visible polygon,
.arena.placing .hex.ally:hover polygon {
  fill: #a6f5ce55;
  stroke: #beefd4;
  stroke-width: 2;
}
.arena.placing .hex.ally polygon {
  stroke: #bdeccc88;
  fill: #3c71523d;
}
#fighters,
#effects {
  pointer-events: none;
}
#effects {
  height: 100%;
  width: 100%;
  z-index: 101;
  overflow: visible;
}
.unit {
  --body-size: clamp(45px, min(6.65vw, 9vh), 95px);
  --species: 1;
  --size: calc(var(--body-size) * var(--depth, 1) * var(--species));
  position: absolute;
  display: grid;
  place-items: end center;
  justify-content: center;
  transform: translate(-50%, -91%);
  height: var(--size);
  width: var(--size);
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  pointer-events: auto;
  isolation: isolate;
}
.unit[data-form="Botamon"] {
  --species: 0.46;
}
.unit[data-form="Koromon"] {
  --species: 0.66;
}
.unit[data-form="Gotsumon"] {
  --species: 1.24;
}
.unit img {
  position: absolute;
  inset: auto auto 0;
  width: 100%;
  height: 92%;
  object-fit: contain;
  object-position: center bottom;
  image-rendering: pixelated;
  filter: drop-shadow(1px 2px 1px #06110d88);
  pointer-events: none;
}
.unit .shadow {
  position: absolute;
  bottom: -2%;
  height: 14%;
  width: 60%;
  border-radius: 50%;
  background: #08111082;
  filter: blur(2px);
  z-index: -1;
}
.unit.selected .shadow {
  background: #a0e8b69e;
  box-shadow: 0 0 13px #7af5a8;
}
.unit .health {
  position: absolute;
  top: -3px;
  width: clamp(22px, 55%, 48px);
  height: 5px;
  background: #1a2425;
  border: 1px solid #101b1e;
  border-radius: 1px;
  box-shadow: 0 1px 3px #10201d;
  overflow: hidden;
}
.unit .health em {
  display: block;
  height: 100%;
  background: #86dc9b;
}
.unit.foe .health em {
  background: #f18c80;
}
.unit .stars {
  position: absolute;
  top: -13px;
  color: #ffe1a0;
  font:
    700 9px Arial,
    sans-serif;
  text-shadow: 0 1px 2px black;
}
.unit.moving {
  transition:
    top 0.22s,
    left 0.22s,
    opacity 0.2s;
}
.synergy-rail,
.standing-rail {
  position: absolute;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: none;
}
.synergy-rail {
  left: var(--safe-edge);
  top: 47%;
  transform: translateY(-50%);
  max-height: 56%;
  width: clamp(105px, 11vw, 168px);
}
.standing-rail {
  right: var(--safe-edge);
  top: 49%;
  transform: translateY(-50%);
  align-items: flex-end;
}
.rail-title {
  color: #ece5cb;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 25px;
  padding: 0 3px;
  margin-bottom: 5px;
  text-shadow: 0 1px 5px #000;
  pointer-events: auto;
  white-space: nowrap;
}
.rail-title .ico {
  width: 14px;
  height: 14px;
}
.standing-rail .rail-title {
  margin-bottom: 3px;
}
#traits {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #ab957366 transparent;
  max-height: 100%;
  pointer-events: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 2px 0;
}
.trait {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 6px 2px 0;
  width: fit-content;
  max-width: 100%;
  text-align: left;
  min-height: 35px;
  background: linear-gradient(90deg, #08171bee, #0c1a1ede 70%, transparent);
  border-radius: 3px;
  color: #f5f4e9;
  flex-shrink: 0;
}
.crest {
  --facet: polygon(50% 0, 92% 23%, 92% 73%, 50% 100%, 8% 73%, 8% 23%);
  display: grid;
  place-items: center;
  width: 35px;
  height: 37px;
  flex: none;
  clip-path: var(--facet);
  color: var(--crest-ink);
  background: var(--metal);
  position: relative;
}
.crest > span {
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  display: grid;
  place-items: center;
  clip-path: var(--facet);
  background: var(--core);
}
.crest svg {
  height: 17px;
  width: 17px;
  stroke-width: 2;
}
.medal-latente {
  --metal: linear-gradient(135deg, #88a09e, #4a5c5f 48%, #6d8384);
  --core: #263435;
  --crest-ink: #c0cecd;
}
.medal-bronce {
  --metal: linear-gradient(140deg, #ffe0b6, #ab6943 52%, #d39e77);
  --core: linear-gradient(150deg, #734832, #412d27);
  --crest-ink: #ffcca0;
}
.medal-plata {
  --metal: linear-gradient(140deg, #fff, #869ba6 49%, #d3e6ef);
  --core: linear-gradient(150deg, #566e7b, #293943);
  --crest-ink: #eaf7ff;
}
.medal-oro {
  --metal: linear-gradient(140deg, #fff1ba, #b78330 52%, #f4d88a);
  --core: linear-gradient(150deg, #8a621f, #493818);
  --crest-ink: #ffeba7;
}
.medal-prisma {
  --metal: conic-gradient(from 22deg, #d8faff, #c8a8ff, #ffb8cd, #fcde97, #93eee5, #d8faff);
  --core: linear-gradient(140deg, #766da7, #3e6867);
  --crest-ink: #fff;
}
.trait-caption {
  display: grid;
  gap: 0;
  padding-right: 8px;
  line-height: 1.1;
}
.trait-caption b {
  font-weight: 600;
  font-size: 14px;
}
.trait-caption small {
  font:
    600 11px Barlow,
    sans-serif;
  color: #bdccca;
}
#ranks {
  display: grid;
  gap: 3px;
  justify-items: end;
}
.rankrow {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  padding: 0 3px 0 6px;
  height: clamp(33px, 4.95vh, 52px);
  color: #f2efdf;
  pointer-events: auto;
  border-radius: 4px;
}
.avatar-ring {
  width: clamp(30px, 4.7vh, 48px);
  aspect-ratio: 1;
  flex: none;
  position: relative;
  padding: 2px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, #9ab7ac var(--health), #384344 0);
  box-shadow: 0 2px 7px #040d0caa;
}
.face {
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
  border-radius: inherit;
  background: radial-gradient(ellipse at 45% 30%, #465655, #172326 80%);
  border: 2px solid #152328;
}
.face img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(1px 1px 1px #091214);
}
.rankpos {
  position: absolute;
  left: -2px;
  bottom: -1px;
  height: 14px;
  min-width: 14px;
  padding: 0 2px;
  color: #f1f3e7;
  font:
    700 10px/13px Barlow,
    sans-serif;
  text-align: center;
  background: #152125;
  border: 1px solid #63706a;
  border-radius: 3px;
}
.rankname {
  font:
    600 13px Barlow,
    sans-serif;
  background: linear-gradient(90deg, transparent, #0b181cd9 35%, #0b181cdb);
  padding: 3px 7px 3px 15px;
  text-shadow: 0 1px 3px #000;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.rankrow.me .rankname,
.rankrow:focus-visible .rankname,
.rankrow:hover .rankname {
  opacity: 1;
}
.rankrow.me .avatar-ring {
  background: conic-gradient(from 180deg, #f3cd7c var(--health), #384344 0);
}
.life {
  position: absolute;
  bottom: 0;
  right: -6px;
  font:
    700 10px/13px Barlow,
    sans-serif;
  background: #152023;
  color: #cfe5d6;
  padding: 0 3px;
  border: 1px solid #54675e;
  border-radius: 3px;
}
.rankrow.me .life {
  color: #ffde94;
  border-color: #aa8c57;
}
.rankrow.out {
  filter: grayscale(1);
  opacity: 0.5;
}
.field-tools {
  position: absolute;
  left: var(--safe-edge);
  bottom: 19px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 20%;
  flex-wrap: wrap;
}
.team-chip,
.tacticbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid #a4a18477;
  border-radius: 4px;
  background: #122122cb;
  color: #e4eddc;
  font-size: 13px;
  font-weight: 600;
}
.team-chip .ico {
  color: #cfcbac;
}
#fieldHint {
  position: absolute;
  bottom: calc(100% + 5px);
  color: #f9efcb;
  text-shadow: 0 1px 4px black;
  font-size: 12px;
  white-space: nowrap;
}
.benchbar {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: min(65%, 840px);
  z-index: 4;
}
.benchlabel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #e4d6b6;
  font-size: 12px;
  text-shadow: 0 1px 4px #071011;
  margin-bottom: 5px;
}
.benchlabel span {
  font-size: 9px;
  letter-spacing: 1.1px;
}
.benchlabel b {
  color: #fff0ce;
  font-size: 11px;
}
.bench {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 4px;
  filter: drop-shadow(0 3px 3px #08101688);
}
.benchslot {
  min-width: 0;
  height: clamp(30px, 4.2vh, 45px);
  display: grid;
  place-items: center;
  position: relative;
  background: linear-gradient(165deg, #273c3bcb, #152627e8);
  border: 1px solid #b7b9a257;
  border-bottom: 2px solid #899383;
  border-radius: 3px;
}
.benchslot .slotnum {
  color: #93a29999;
  font: 500 10px Barlow;
}
.benchslot.full,
.benchslot:hover {
  border-color: #cfbd8b;
}
.benchslot.selected {
  background: #3b6051;
  border-color: var(--cream);
}
.benchslot img {
  height: 100%;
  width: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}
.benchslot.ball {
  color: #acedff;
}
.shoparea {
  max-width: 1530px;
  margin: 0 auto;
  padding: 12px clamp(16px, 4vw, 70px) 8px;
}
.shophead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}
.shop-title,
.dock-wallet,
.balance,
#inventory,
.trade-button,
.levelrow {
  display: flex;
  align-items: center;
}
.shop-title {
  gap: 8px;
}
.shop-title > i {
  color: #d9c18a;
}
.shop-title h2 {
  font: 600 22px/1 var(--head);
  color: #f2eddd;
  letter-spacing: 0.25px;
}
.quiet-btn {
  display: grid;
  place-items: center;
  color: #a9b6b4;
  padding: 5px;
}
.quiet-btn.on {
  color: #eed087;
}
.dock-wallet {
  gap: 15px;
}
.balance {
  padding-left: 14px;
  border-left: 1px solid #46504c;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.balance .coin {
  gap: 7px;
}
.dock-wallet #inventory {
  gap: 6px;
  color: #c4cbc5;
  font-size: 13px;
}
.dock-wallet #inventory b {
  font-weight: 600;
  color: #eddbb1;
}
.shopbody {
  display: grid;
  grid-template-columns: clamp(142px, 13vw, 190px) minmax(0, 1fr);
  gap: 12px;
}
.economy {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
}
.levelrow {
  justify-content: space-between;
  gap: 6px;
  color: #a9bab8;
  font-size: 12px;
}
.levelrow b {
  font-size: 16px;
  color: #eee8d9;
}
.xpbar {
  height: 3px;
  background: #35423f;
  margin-bottom: 4px;
}
.xpbar span {
  display: block;
  height: 100%;
  background: #87c7bc;
}
.trade-button {
  justify-content: flex-start;
  gap: 7px;
  width: 100%;
  padding: 7px 9px;
  color: #e0e4dc;
  background: linear-gradient(130deg, #253133, #1c282c);
  border: 1px solid #435051;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 600;
}
.trade-button .coin {
  margin-left: auto;
}
.trade-button > svg {
  color: #a6c4bb;
}
.cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}
.card {
  position: relative;
  isolation: isolate;
  min-width: 0;
  overflow: hidden;
  height: clamp(102px, 13.8vh, 154px);
  background: radial-gradient(ellipse at 68% 21%, var(--cardglow), #17252b 100%);
  border: 1px solid #51625d;
  border-bottom: 3px solid var(--rarity);
  border-radius: 4px;
}
.card:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    130deg,
    transparent 46%,
    #e8ede814 46.3%,
    transparent 47%,
    transparent 66%,
    #f7f6df11 66.3%,
    transparent 67%
  );
}
.card img {
  position: absolute;
  right: 2%;
  top: -3%;
  width: 89%;
  height: 110%;
  object-fit: contain;
  object-position: 63% 24%;
  filter: drop-shadow(1px 3px 2px #09141b80);
  transition: transform 0.18s ease;
}
.card:hover img {
  transform: translateY(-2px) scale(1.04);
}
.card:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #091419f5 1%, #0e191fc4 20%, transparent 62%);
  pointer-events: none;
}
.card .price {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  background: #121b1ecc;
  padding: 2px 5px;
  border: 1px solid #ad97615e;
  border-radius: 3px;
  font: 700 12px Barlow;
}
.cardtext {
  z-index: 1;
  position: absolute;
  bottom: 6px;
  left: 9px;
  right: 4px;
}
.cardname {
  display: block;
  font: 600 clamp(18px, 1.65vw, 27px) / 1 var(--head);
  color: #fff9e9;
}
.cardorigin {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: #d1dacf;
  margin-top: 3px;
}
.cardbuy {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.card .info {
  position: absolute;
  z-index: 3;
  left: 5px;
  top: 5px;
  display: grid;
  place-items: center;
  color: #e5ebe5;
  background: #111c20b0;
  border-radius: 3px;
  padding: 4px;
  font-size: 12px;
}
.card:focus-within {
  outline: 2px solid var(--brass);
}
.sold {
  display: grid;
  place-items: center;
  background: #172326;
  color: #a7b6ae;
  border-color: #4b5751;
}
.sold:after {
  display: none;
}
#arenaView footer {
  max-width: 1530px;
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  padding: 3px clamp(16px, 4vw, 70px) 8px;
}
#arenaView footer button {
  font-size: 12px;
  color: #97aaa5;
}
@media (max-width: 900px) {
  .topbar {
    padding-inline: 18px;
    gap: 28px;
    height: 54px;
  }
  .arena {
    height: clamp(441px, calc(100svh - 245px), 750px);
  }
  .arena-heading {
    top: 15px;
  }
  .battle-command {
    top: 15px;
    gap: 7px;
  }
  .action {
    min-width: 90px;
    padding: 8px 13px;
  }
  .phase-hud {
    padding: 5px 17px;
    min-height: 36px;
    gap: 7px;
  }
  .roundpath {
    gap: 3px;
  }
  .field {
    width: 76%;
    top: 20%;
    bottom: 17%;
  }
  .rankname {
    display: none;
  }
  .synergy-rail {
    width: 110px;
  }
  .trait-caption b {
    font-size: 12px;
  }
  .benchbar {
    width: 68%;
  }
  .shoparea {
    padding: 10px 14px 6px;
  }
  .shopbody {
    grid-template-columns: 123px 1fr;
    gap: 8px;
  }
  .trade-button {
    font-size: 12px;
    gap: 3px;
  }
  .cardorigin {
    font-size: 10px;
  }
  .card {
    height: 110px;
  }
  .cards {
    gap: 5px;
  }
  .cardname {
    font-size: 19px;
  }
}
@media (max-width: 640px) {
  .topbar {
    height: 48px;
    gap: 12px;
    padding: 0 10px;
  }
  .brand {
    gap: 4px;
  }
  .brandmark {
    width: 28px;
    height: 28px;
  }
  .brand b {
    font-size: 16px;
  }
  .brand small {
    font-size: 7px;
    letter-spacing: 1.8px;
    margin-top: 3px;
  }
  .nav {
    font-size: 12px;
    gap: 4px;
    padding: 0 3px;
  }
  .main-nav {
    gap: 8px;
  }
  .toptools {
    gap: 3px;
  }
  .toptools .tooldivider,
  .userpic {
    display: none;
  }
  .toptools .iconbtn {
    width: 27px;
    height: 30px;
  }
  #arenaView {
    --safe-edge: 7px;
  }
  .arena {
    height: clamp(430px, 61svh, 610px);
  }
  .arena-heading {
    top: 53px;
    left: 12px;
  }
  .arena-heading h1 {
    font-size: 23px;
    margin-top: 2px;
  }
  .arena-heading .maplabel {
    font-size: 8px;
    letter-spacing: 0.8px;
    gap: 4px;
  }
  .phase-hud {
    min-height: 33px;
    padding: 3px 17px 6px;
    gap: 8px;
    max-width: 95%;
  }
  #roundBadge b {
    font-size: 19px;
  }
  #roundBadge small {
    font-size: 8px;
  }
  #fieldStatus {
    font-size: 12px;
    max-width: 140px;
  }
  .battle-command {
    top: 53px;
    right: 11px;
    gap: 7px;
  }
  .battle-command .enc-label b {
    font-size: 14px;
  }
  .enc-label small {
    font-size: 8px;
    letter-spacing: 0.5px;
  }
  .action {
    font-size: 12px;
    min-width: 0;
    padding: 7px 9px;
    gap: 4px;
  }
  .field {
    width: calc(100% - 85px);
    top: 28%;
    bottom: 19%;
  }
  .unit {
    --body-size: clamp(34px, 8vw, 47px);
  }
  .synergy-rail {
    top: 51%;
    width: 35px;
    max-height: 52%;
  }
  .rail-title {
    min-height: 19px;
    margin: 0;
    justify-content: center;
    width: 100%;
    padding: 0;
  }
  .synergy-rail .rail-title span,
  .standing-rail .rail-title span {
    display: none;
  }
  .trait-caption {
    display: none;
  }
  .crest {
    width: 29px;
    height: 32px;
  }
  .crest svg {
    width: 16px;
    height: 16px;
  }
  .trait {
    background: none;
    min-height: 33px;
    padding: 1px;
    width: 100%;
    justify-content: center;
  }
  #traits {
    gap: 2px;
    scrollbar-width: none;
  }
  .standing-rail {
    top: 52%;
    right: 9px;
  }
  .rankrow {
    height: 29px;
    padding: 0;
  }
  .avatar-ring {
    width: 26px;
  }
  .rankpos {
    font-size: 8px;
    min-width: 10px;
    height: 11px;
    line-height: 9px;
  }
  .rankrow .life {
    font-size: 8px;
    line-height: 10px;
    right: -5px;
  }
  .standing-rail .rail-title {
    margin-bottom: 2px;
  }
  #ranks {
    gap: 1px;
  }
  .benchbar {
    width: calc(100% - 22px);
    bottom: 9px;
  }
  .benchslot {
    height: 29px;
  }
  .benchlabel {
    margin-bottom: 3px;
    font-size: 10px;
  }
  .benchlabel span {
    font-size: 8px;
  }
  .bench {
    gap: 3px;
  }
  .field-tools {
    bottom: 60px;
    left: 11px;
    max-width: 70%;
  }
  .team-chip,
  .tacticbtn {
    font-size: 10px;
    padding: 3px 6px;
  }
  .field-tools #fieldHint {
    left: 52px;
    bottom: 1px;
  }
  .shoparea {
    padding: 10px 8px 4px;
  }
  .shophead {
    margin-bottom: 7px;
  }
  .shop-title {
    gap: 4px;
  }
  .shop-title h2 {
    font-size: 20px;
  }
  .dock-wallet {
    gap: 6px;
  }
  .balance {
    padding-left: 6px;
  }
  .dock-wallet #inventory {
    font-size: 12px;
  }
  .shopbody {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .cards {
    grid-row: 1;
    gap: 3px;
  }
  .card {
    height: clamp(92px, 22vw, 116px);
    border-bottom-width: 2px;
  }
  .cardname {
    font-size: clamp(13px, 3.6vw, 18px);
  }
  .cardtext {
    left: 3px;
    bottom: 4px;
    right: 2px;
  }
  .cardorigin {
    font-size: 9px;
    display: block;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  .cardorigin svg {
    display: none;
  }
  .card .price {
    top: 2px;
    right: 2px;
    padding: 1px 3px;
    font-size: 10px;
  }
  .card .info {
    top: 2px;
    left: 2px;
    padding: 2px;
    font-size: 10px;
  }
  .economy {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1.15fr;
    column-gap: 6px;
    row-gap: 2px;
    align-items: center;
  }
  .levelrow {
    grid-area: 1/1;
    align-self: end;
    font-size: 10px;
  }
  .levelrow b {
    font-size: 13px;
  }
  .xpbar {
    grid-area: 2/1;
    align-self: start;
    width: 100%;
  }
  .trade-button {
    height: 34px;
    grid-row: 1/3;
    padding: 4px 6px;
    font-size: 12px;
  }
  .trade-button:first-of-type {
    grid-column: 2;
  }
  .trade-button:last-of-type {
    grid-column: 3;
  }
  #arenaView footer {
    padding: 5px 9px;
    gap: 10px;
  }
}
@media (max-height: 600px) and (min-width: 641px) {
  .arena {
    height: 385px;
  }
  .synergy-rail {
    top: 48%;
    max-height: 53%;
  }
  .standing-rail {
    top: 51%;
  }
  .rankrow {
    height: 27px;
  }
  .avatar-ring {
    width: 24px;
  }
  .standing-rail .rail-title {
    min-height: 18px;
  }
  .rankname {
    display: none;
  }
  .field {
    top: 18%;
    bottom: 17%;
  }
  .card {
    height: 93px;
  }
}
@media (min-width: 641px) and (max-width: 870px) {
  .synergy-rail {
    width: 45px;
  }
  .synergy-rail .rail-title span,
  .synergy-rail .trait-caption {
    display: none;
  }
  .synergy-rail .rail-title {
    justify-content: center;
    width: 35px;
  }
  .synergy-rail .trait {
    background: transparent;
  }
}
@media (max-width: 640px) {
  .unit {
    min-width: 0;
    min-height: 0;
  }
  .unit::after {
    content: "";
    position: absolute;
    inset: -5px;
  }
  .synergy-rail .trait {
    position: relative;
  }
  .trait::after {
    content: attr(data-count);
    position: absolute;
    right: 0;
    bottom: 0;
    background: #152022;
    color: #efe9d7;
    border: 1px solid #69756c;
    border-radius: 3px;
    font:
      700 9px/11px Barlow,
      sans-serif;
    padding: 0 2px;
  }
}
@media (max-width: 370px) {
  .brand small {
    display: none;
  }
  .brandmark {
    width: 24px;
    height: 24px;
  }
  .brand b {
    font-size: 14px;
  }
  .topbar {
    gap: 6px;
    padding-inline: 6px;
  }
  .main-nav {
    gap: 3px;
  }
  .toptools {
    gap: 0;
  }
  .battle-command .enc-label {
    display: none;
  }
  .shop-title h2 {
    font-size: 17px;
  }
  .dock-wallet {
    gap: 3px;
  }
  .economy {
    column-gap: 4px;
  }
  .trade-button {
    font-size: 10px;
  }
}

/* Read combat resources above each sprite while the body moves independently. */
.unit img {
  transform-origin: 50% 94%;
  animation: unit-breathe 1.9s ease-in-out var(--idle-delay, 0s) infinite;
}
@keyframes unit-breathe {
  0%,
  100% {
    transform: translateY(0) scale(1, 1);
  }
  50% {
    transform: translateY(-2.5%) scale(0.98, 1.035);
  }
}
.unit .vitals {
  position: absolute;
  z-index: 2;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 1px;
  padding: 1px;
  width: clamp(32px, 65%, 54px);
  border-radius: 2px;
  background: #0a151b;
  box-shadow: 0 1px 3px #09100ee6;
}
.unit .vitals .health,
.unit .energy {
  position: static;
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #344846;
  box-shadow: none;
}
.unit .energy {
  height: 4px;
  background: #18354c;
}
.unit .energy i {
  display: block;
  height: 100%;
  background: linear-gradient(#adf8ff, #36beff);
  transition: width 0.12s linear;
}
.unit .stars {
  top: -19px;
}
.bench-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-bottom: 2px solid var(--rarity);
  background: radial-gradient(ellipse at 50% 90%, #849f8d44, transparent 78%);
}
.bench-art img {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  height: 100%;
  width: 90%;
  object-fit: contain;
}
.bench-art.human img,
.bench-art.spirit img {
  top: 0;
  bottom: auto;
  height: 285%;
  width: auto;
  max-width: none;
  image-rendering: auto;
}
.bench-art.spirit img {
  height: 155%;
  max-width: 120%;
  object-fit: contain;
  object-position: top center;
}
.bench-stars {
  position: absolute;
  bottom: 1px;
  left: 3px;
  color: #ffe5a0;
  font: 700 9px/1 Arial;
  text-shadow:
    0 1px 2px #131613,
    1px 0 2px #131613;
}
.aug-rail {
  pointer-events: auto;
  flex: none;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid #a2a98b70;
}
.aug-rail[hidden] {
  display: none;
}
.aug-heading {
  display: block;
  color: #ece5cb;
  text-transform: uppercase;
  font:
    600 10px Barlow,
    sans-serif;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 3px #0d1417;
}
#activeAugments {
  display: flex;
  gap: 4px;
  padding: 3px 1px;
}
.aug-chip {
  display: grid;
  place-items: center;
  border-radius: 5px;
}
.augment-badge {
  display: grid;
  place-items: center;
  width: 31px;
  height: 32px;
  clip-path: polygon(20% 0, 80% 0, 100% 21%, 100% 79%, 80% 100%, 20% 100%, 0 79%, 0 21%);
  background: var(--metal);
  color: var(--crest-ink);
}
.augment-badge > span {
  display: grid;
  place-items: center;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  background: var(--core);
  clip-path: inherit;
}
.aug-chip:hover .augment-badge,
.aug-chip:focus-visible .augment-badge {
  filter: brightness(1.28);
}
.augment-detail {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}
.augment-detail .augment-badge {
  width: 45px;
  height: 46px;
}
.augment-detail small {
  display: block;
  color: var(--muted);
}
.interest-readout {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0;
  color: #d1dcd5;
}
.interest-readout strong {
  font-size: 1.25rem;
  color: #ffda88;
}
.interest-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.interest-track span {
  padding: 5px 0;
  border-top: 3px solid #455250;
  text-align: center;
  color: #a9bab6;
}
.interest-track .earned {
  border-color: #e6c479;
  color: #ffe2a3;
}
.balance:hover,
.balance:focus-visible {
  box-shadow: 0 0 0 1px #d8bb70;
}
@media (max-width: 870px) {
  #activeAugments {
    flex-direction: column;
    gap: 2px;
  }
  .aug-rail {
    align-self: center;
    padding-top: 3px;
    margin-top: 4px;
  }
  .aug-heading {
    display: none;
  }
  .aug-chip {
    width: 30px;
    height: 28px;
  }
  .augment-badge {
    width: 25px;
    height: 25px;
  }
  .augment-badge .ico {
    width: 14px;
    height: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .unit img {
    animation: none;
  }
}

#openingWallet:empty,
#shopArea[hidden] {
  display: none;
}
#openingWallet {
  display: flex;
  justify-content: flex-end;
  padding: 8px var(--safe-edge, 16px);
}
.opening-round .arena {
  height: clamp(440px, calc(100svh - 155px), 1050px);
}

.unit[data-form="Susanoomon"] {
  --species: 1.9;
}
.unit[data-form="Susanoomon"] .shadow {
  background: radial-gradient(ellipse, #ffe6a879, #c6a95735 55%, transparent 72%);
  width: 85%;
  height: 22%;
}
.unit[data-form="Susanoomon"] .vitals {
  width: 64%;
  max-width: 76px;
}
.item-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  line-height: 1.15;
  text-align: left;
}
img.gear-art,
.dexcard img.gear-art {
  flex: none;
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
  background: #152229;
  box-shadow: 0 0 0 1px #536262;
}
.gear-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 4px 0;
}
.gear-stats > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.gear-stats .ico {
  color: #c4debd;
  width: 15px;
  height: 15px;
}
.gear-effect {
  display: block;
  margin-top: 4px;
  line-height: 1.4;
  color: #d1dddc;
}
.menubtn:has(.gear-art) {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.menubtn:has(.gear-art) > span {
  flex: 1 1 220px;
}
.menubtn .item-title {
  color: #f2ead8;
  font-weight: 600;
}
.shop-odds {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d8e4dd;
  min-height: 29px;
  border-radius: 4px;
}
.shop-odds > b {
  color: #aebfb8;
  font-weight: 500;
}
.shop-odds span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}
.shop-odds i {
  font:
    600 11px/1.4 Barlow,
    sans-serif;
  font-style: normal;
  border-bottom: 2px solid var(--rarity);
  color: var(--rarity);
  min-width: 13px;
  text-align: center;
}
.shop-odds:hover {
  background: #273331;
}
.odds-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
}
.odds-table th,
.odds-table td {
  padding: 5px 3px;
  border-bottom: 1px solid #324043;
}
.odds-table tr.current {
  background: #304537;
  color: #fff3c2;
}
@media (max-width: 760px) {
  .shophead {
    flex-wrap: wrap;
    gap: 4px;
  }
  .shop-odds {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 9px;
  }
  .shop-odds i {
    font-size: 10px;
  }
  .shop-odds span {
    font-size: 12px;
  }
}
.unit:active:not(:disabled) {
  transform: translate(-50%, -91%);
}
.arena.fighting #grid {
  pointer-events: none;
}
#fighters {
  z-index: 2;
}

.fusion-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid #e8ca82;
  border-radius: 4px;
  background: #322d21;
  color: #ffe2a4;
  font:
    600 13px Barlow,
    sans-serif;
}
.fusion-chip[hidden] {
  display: none;
}
.fusion-chip .ico {
  width: 15px;
  height: 15px;
}

.recipe-toggle {
  color: #e0c58e;
  flex: none;
}
#modal:has(.recipe-scroll) {
  width: min(960px, 94vw);
  overflow: hidden;
}
#modalBody:has(.recipe-scroll) {
  display: flex;
  flex-direction: column;
  max-height: 82dvh;
}
.recipe-note {
  margin: 0 0 14px;
}
.recipe-scroll {
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #57706c #1b292d;
}
.recipe-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  text-align: left;
  font-size: 15px;
  line-height: 1.4;
}
.recipe-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #263738;
  color: #e6d3a8;
  font-weight: 600;
  padding: 8px;
}
.recipe-table tbody th,
.recipe-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #344648;
  vertical-align: middle;
}
.recipe-table tbody tr:nth-child(even) {
  background: #18262b;
}
.recipe-table tbody th {
  width: 24%;
  color: #f0e4c7;
}
.recipe-ingredients {
  width: 26%;
}
.recipe-ingredients .item-title {
  font-size: 14px;
  gap: 5px;
  line-height: 1.4;
}
.recipe-ingredients .gear-art {
  width: 24px;
  height: 24px;
}
.recipe-plus {
  color: #b5a57f;
}
.recipe-table .gear-stats {
  font-size: 13px;
  color: #b6ccc6;
  margin: 5px 0 0;
}
@media (max-width: 640px) {
  .recipe-toggle {
    width: 29px;
    height: 29px;
  }
  .recipe-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .recipe-table tbody tr {
    display: grid;
    grid-template-columns: 1fr;
    padding: 12px 6px;
    gap: 8px;
    border-bottom: 1px solid #344648;
  }
  .recipe-table tbody th,
  .recipe-table tbody td {
    width: auto;
    padding: 0;
    border: 0;
  }
  .recipe-table tbody th .gear-art {
    width: 32px;
    height: 32px;
  }
  .recipe-table .recipe-plus {
    margin: 0 3px;
  }
}

.gear-target-bar {display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px clamp(10px,3vw,40px);background:#172b2a;border-bottom:1px solid #5b9b8b;color:#eff9eb}
.gear-target-bar[hidden]{display:none}.gear-target-bar>div{display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px;flex:1 1 220px}.gear-target-bar .gear-art,.report-extractor .gear-art{width:28px;height:28px;object-fit:contain}
#gearTargetPrompt{font-size:14px;color:#c5ded6}.unit.gear-eligible .vitals{outline:2px solid #83efd5;outline-offset:2px}.benchslot.gear-eligible{outline:2px solid #83efd5;outline-offset:-2px}.unit.gear-eligible,.benchslot.gear-eligible{cursor:crosshair}
.report-extractor{margin:8px 0;color:#bcf1dc}.menuopts .menubtn:disabled{opacity:.55}

.arena.visiting #tactics{display:none}
.rankrow.watching .avatar-ring{outline:2px solid #f3d59c;outline-offset:2px}
.arena.visiting .maplabel{color:#f4d49b}


@media (prefers-reduced-motion:no-preference){.arena.drafting .field-legend.room-carousel-bot{transition:left .18s linear,top .18s linear}}
.arena.drafting #otherLegends[data-board^="solo/"] .field-legend{transition:none}
@media (prefers-reduced-motion:no-preference){.field-legend.remote.gathering-orbs{transition:left .17s linear,top .17s linear}.field-orb.orb-collected{animation:orb-pickup .32s ease-out forwards}@keyframes orb-pickup{to{opacity:0;scale:1.35}}}
.field-legend .pickup-stack{position:absolute;bottom:calc(var(--legend-badge-height,100%) + 15px);left:50%;translate:-50% 0;display:flex;flex-direction:column;align-items:center;gap:3px;z-index:6;pointer-events:none}
.field-legend .pickup-stack[data-align="left"]{translate:0 0;align-items:flex-start}.field-legend .pickup-stack[data-align="right"]{translate:-100% 0;align-items:flex-end}
.field-legend .pickup-badge{display:flex;align-items:center;gap:5px;white-space:nowrap;padding:4px 8px;border:1px solid #90d5bd;border-radius:6px;background:#102323f5;color:#edfff4;font:650 clamp(10px,1.05vw,14px)/1.15 var(--head);box-shadow:0 2px 7px #06151590}
.field-legend .pickup-badge.premium,.field-legend .pickup-gold{color:#ffe3a1;border-color:#d6ab55}
.field-legend .pickup-data{color:#d5c6ff;border-color:#a592d9}
.field-legend .pickup-badge img,.field-legend .pickup-badge svg{position:static;width:22px;height:22px;max-width:22px;max-height:22px;object-fit:contain;animation:none;scale:1;filter:none}
.field-legend .pickup-badge small{position:static;color:inherit;font:inherit}
@media(prefers-reduced-motion:no-preference){.pickup-badge{animation:pickup-rise .22s ease-out}@keyframes pickup-rise{from{opacity:0;transform:translateY(7px)}}}
.field-orb[aria-disabled="true"]{cursor:default}.orb-collected{pointer-events:none}
.arena.drafting #grid,.arena.drafting #fighters,.arena.drafting #effects,.arena.drafting .benchbar,.arena.drafting .synergy-rail,.arena.drafting .field-tools{visibility:hidden}
#carouselRing{position:absolute;inset:0;z-index:3;pointer-events:none;isolation:isolate}
#carouselRing::before{content:"";position:absolute;inset:26% 18% 24%;border:2px solid #8bd8be80;border-radius:50%;box-shadow:0 0 15px #7fffd63b,inset 0 0 15px #7fffd633;background:radial-gradient(ellipse,#05130f60 45%,#193e3366 74%,#9de6cb5c)}
.carousel-pick{position:absolute;translate:-50% -68%;display:grid;place-items:center;width:clamp(40px,8.4%,82px);height:clamp(38px,12%,68px);padding:0;border:0;background:transparent;color:#edf9ec;pointer-events:auto;cursor:pointer;z-index:1}
.carousel-pick::before{content:"";position:absolute;bottom:0;width:87%;height:30%;border:1px solid #a6e5c3;border-radius:50%;background:#193c32ad;z-index:-1}
.carousel-pick img:first-child{position:absolute;inset:0;min-width:0;min-height:0;width:100%;height:100%;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(0 2px 2px #152623)}
.carousel-pick .pick-item,.field-legend .carried-item{position:absolute;right:-6%;bottom:0;width:clamp(14px,2vw,23px);height:auto;aspect-ratio:1;object-fit:contain;background:#162422;border:1px solid #e1c48b;border-radius:3px}
.carousel-pick .pick-item{top:-8%;right:-4%;bottom:auto;width:clamp(20px,2.1vw,31px);border:2px solid #f3d395;box-shadow:0 2px 5px #0b171acf;pointer-events:auto}
.carousel-pick small{position:absolute;top:100%;padding:1px 3px;border-radius:3px;background:#12261de3;font:600 clamp(8px,.85vw,12px)/1.1 var(--head);white-space:nowrap}
.field-legend .carried-recruit{position:absolute;left:79%;bottom:3%;width:86%;height:86%;display:block}
.field-legend .carried-recruit img{scale:1;animation:none}
.field-legend .carried-recruit .carried-item{width:40%;height:auto}
