/* Portrait field and the two management rails */
html,
body,
#app {
  height: 100%;
  width: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  min-height: 0;
  color: #27364a;
  background: #a9e6e2 url('../assets/interface/miami-lobby.webp') center/cover fixed no-repeat;
}
body::before {
  background:
    linear-gradient(90deg, #fff5dc43, #fffafd24 46%, #defeff54),
    linear-gradient(0deg, #f2fcf84a, transparent 58%);
  opacity: 1;
}
.app-shell {
  --paper: #fffdf3f0;
  --ink: #233342;
  --line: #31495538;
  --gap: clamp(6px, 1.15vh, 12px);
  --rail: clamp(180px, 17vw, 256px);
  --trade: clamp(225px, 24vw, 354px);
  --pad: clamp(8px, 2.4vw, 32px);
  --head: clamp(44px, 7vh, 66px);
  max-width: 1540px;
  padding: 0 var(--pad) var(--gap);
  height: 100dvh;
  display: grid;
  grid-template-rows: var(--head) minmax(0, 1fr);
  color: var(--ink);
}
.top {
  min-height: 0;
  height: 100%;
  max-width: none;
  align-items: center;
}
.brand {
  gap: 9px;
}
.brand-skull {
  width: clamp(33px, 4.75vh, 47px);
  height: auto;
  transform: rotate(-8deg);
  filter: drop-shadow(0 2px 1px #183d503f);
}
.brand h1 {
  color: #21374a;
  text-shadow: 0 1px #fffcdb;
  -webkit-text-stroke: 0;
  font-size: clamp(20px, 3.1vh, 31px);
}
.brand h1 span {
  color: #9b490d;
  text-shadow: 0 1px #fff3a4;
}
.wordmark > span {
  color: #23475d;
  font-size: clamp(8px, 1.25vh, 12px);
  text-shadow: none;
  letter-spacing: 1.65px;
}
.app-shell .btn {
  border: 1px solid #41607048;
  background: #eef6f2;
  color: #253c49;
  box-shadow:
    inset 0 1px #ffffffa8,
    0 1px 2px #20395522;
  border-radius: 7px;
}
.app-shell .mode-button,
.app-shell .primary {
  background: #ffcb55;
  color: #382c18;
  border-color: #80653278;
}
.app-shell .primary {
  min-height: 30px;
  min-width: 96px;
  box-shadow:
    inset 0 1px #fff5a2,
    0 2px #8c622d4a;
  font-size: 15px;
}
.top .btn {
  background: #fffdf2df;
  min-height: 29px;
  font-size: 12px;
  padding: 4px 9px;
}
.top .mode-button {
  background: #ffe69c;
}
.dashboard {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr) var(--trade);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: 'left center right';
  gap: clamp(7px, 1.3vw, 19px);
  align-items: start;
}
.left-column,
.right-column,
.center-column {
  min-height: 0;
  max-height: 100%;
  gap: var(--gap);
}
.left-column,
.right-column {
  display: flex;
  flex-direction: column;
}
.center-column {
  display: grid;
  height: 100%;
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
}
.right-column {
  height: 100%;
}
.right-column > .bench {
  margin-top: auto;
  flex-shrink: 0;
}
.roster-info {
  display: grid;
  gap: var(--gap);
  min-width: 0;
}
.app-shell .panel {
  border: 1px solid #29485451;
  border-radius: 13px;
  background: var(--paper);
  box-shadow:
    0 5px 18px #314d5136,
    inset 0 1px #ffffffb0;
  color: var(--ink);
}
.app-shell .panel h2 {
  text-shadow: none;
  color: #293e4b;
  font-size: clamp(13px, 1.65vh, 17px);
}
.app-shell .panel h2 .icon {
  color: #4d7380;
}
.players,
.traits,
.upcoming,
.damage,
.warehouse,
.shop {
  padding: clamp(7px, 1.35vh, 14px);
}
.team-card,
.team-card.bot {
  background: #d7e9e7;
  border: 0;
  border-radius: 8px;
  border-left: 3px solid #389dba;
  min-height: 47px;
}
.team-card.bot {
  background: #f0e2d8;
  border-left-color: #dc826c;
}
.team-hp small {
  color: #65777c;
}
.team-summary > i,
.damage-body > i {
  background: #627b862e;
}
.team-summary > i::before {
  background: #37a685;
}
.avatar {
  border: 0;
  border-radius: 6px;
  background: #829aab;
}
.avatar .team-badge {
  background: #bdd2d0;
}
.team-card.bot .avatar .team-badge {
  background: #cdac9a;
}
.team-summary strong {
  color: #203b49;
}
.traits {
  max-height: none;
  overflow: visible;
}
.trait-list {
  display: grid;
  gap: 4px;
}
.trait-list:has(> .trait-row:nth-child(7)) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
}
.trait-list:has(> .trait-row:nth-child(7)) .trait-row {
  min-height: 25px;
  column-gap: 2px;
  padding: 2px;
}
.trait-list:has(> .trait-row:nth-child(7)) .trait-row i,
.trait-list:has(> .trait-row:nth-child(7)) .trait-row i img {
  width: 17px;
  height: 17px;
}
.trait-row,
.role-tile {
  background: #e4edeb;
  color: #263e49;
  border: 1px solid #94adb762;
}
.trait-row.active {
  background: #ffe7a7;
  border-color: #c69c45;
  color: #433614;
}
.trait-row {
  margin: 0;
  min-width: 0;
  gap: 4px;
  padding: 3px 4px;
}
.trait-row b,
.trait-row b small {
  color: #3d6271;
}
.trait-row i {
  background: transparent;
  width: 24px;
  height: 24px;
  flex: none;
}
.trait-row .trio-art,
.trait-row .role-art {
  width: 23px;
  height: 23px;
  object-fit: contain;
}
.trait-list:has(> .trait-row:nth-child(7)) .trait-row span:not(.trait-faces) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}
.trait-list:has(> .trait-row:nth-child(7)) .trait-row b {
  font-size: 12px;
}
.role-grid {
  gap: 4px;
}
.role-tile {
  padding: 5px 1px;
}
.round-track > div {
  background: #edf2e7;
  border: 1px solid #b8c3ae;
}
.round-track b {
  color: #455965;
}
.panel.upcoming {
  margin: 0;
}
.arena.panel {
  width: 100%;
  height: 100%;
  align-self: center;
  justify-self: center;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  background: #edf3ec;
}
.map-head {
  min-height: 0;
  height: clamp(38px, 5.6vh, 59px);
  padding: 3px 10px;
  gap: 8px;
  border: 0;
  color: #fff;
  background-color: #354e59;
}
.app-shell .map-name h2 {
  font-size: clamp(17px, 2.5vh, 26px);
  color: #fff;
  text-shadow: 0 2px 2px #253744;
}
.map-english {
  display: none;
}
.map-insignia,
.map-badge {
  width: clamp(23px, 3.65vh, 37px);
  height: clamp(23px, 3.65vh, 37px);
}
.round {
  padding: 2px 6px;
}
.round b {
  font-size: clamp(17px, 2.45vh, 25px);
}
.arena-stage,
.field {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  position: relative;
}
.field {
  touch-action: none;
}
.arena-interaction {
  pointer-events: none;
}
.deploy-grid {
  pointer-events: none;
  inset: 62.5% 0 0;
  justify-items: center;
  align-items: center;
}
.drop-cell {
  pointer-events: auto;
  background: #eefffc32;
  border: 1.5px solid #fff9e2b8;
  border-radius: 50%;
  width: 65%;
  height: auto;
  max-height: 88%;
  aspect-ratio: 1;
  align-self: center;
  box-shadow:
    0 1px 3px #33493d5c,
    inset 0 0 0 1px #3b534c25;
  touch-action: none;
}
.drop-cell:disabled {
  visibility: hidden;
  pointer-events: none;
}
.drop-cell:hover,
.field.moving .drop-cell:hover,
.drop-cell:focus-visible {
  border-radius: 50%;
  background: #fff1a575;
  border: 2px solid #fff2a2;
}
.unit-hit {
  width: 12%;
  height: 9%;
  min-width: 18px;
  touch-action: none;
  border-radius: 50%;
}
.unit-hit:hover {
  outline: none;
  box-shadow: none;
  background: transparent;
}
.arena-bottom {
  min-height: 0;
  height: clamp(34px, 5.1vh, 46px);
  padding: 3px 8px;
  background: #edf3ed;
  border-top: 1px solid #768d8757;
  color: #294754;
}
.battle-status {
  font-size: 11px;
  color: #445e67;
}
.battle-status b {
  color: #274451;
  font-size: 13px;
  text-shadow: none;
}
.battle-status i {
  background: #36a683;
}
.battle-status small {
  display: none;
}
.app-shell[data-phase='battle'] .battle-status i {
  background: #c98620;
  box-shadow: none;
}
.arena-bottom[data-paused='true'] .battle-status > b {
  color: #744c0f;
}
.arena-bottom[data-paused='true'] .battle-status i {
  width: 7px;
  height: 9px;
  border-radius: 0;
  background: linear-gradient(90deg, #a86b12 0 31%, transparent 31% 69%, #a86b12 69%);
}
.arena-bottom:has(> .result-badge) {
  container: receipt / inline-size;
  background: #f3f5e9;
}
.arena-bottom .result-badge {
  --outcome: #3d5364;
  position: static;
  transform: none;
  min-width: 0;
  display: flex;
  flex: 1;
  align-items: center;
  gap: clamp(5px, .8vw, 11px);
  padding: 0;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
  text-align: left;
  color: #354d55;
}
.result-badge[data-outcome='win'] {
  --outcome: #256148;
}
.result-badge[data-outcome='loss'] {
  --outcome: #944534;
}
.result-badge[data-outcome='win']::before {
  content: '';
  flex: none;
  width: 25px;
  height: 25px;
  background: url('../assets/interface/trophy.webp') center / contain no-repeat;
}
.round-verdict {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: none;
  padding-left: 7px;
  border-left: 3px solid var(--outcome);
}
.result-badge[data-outcome='win'] .round-verdict {
  padding-left: 0;
  border: 0;
}
.result-badge .round-verdict strong {
  font: 900 clamp(13px, 1.75vh, 18px)/1.05 var(--font);
  color: var(--outcome);
}
.round-verdict small {
  display: block;
  color: #52656c;
  font: 700 10px/1 var(--font);
}
.round-payout {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 5px;
}
.result-badge .round-payout > span {
  margin: 0;
  font-size: 11px;
  line-height: 1.1;
  color: #354d55;
}
.round-gold {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #695019;
  font: 14px/1 Lilita, sans-serif;
}
.round-gold .coin, .round-payout .reward-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
@container receipt (max-width: 425px) {
  .result-badge[data-outcome='win']::before {
    width: 19px;
    height: 19px;
  }
  .round-verdict small {
    font-size: 8px;
  }
  .result-badge .round-payout > span {
    font-size: 9px;
  }
  .round-gold {
    font-size: 12px;
  }
  .round-gold .coin, .round-payout .reward-icon {
    width: 13px;
    height: 13px;
  }
}
@container receipt (max-width: 305px) {
  .result-badge[data-outcome='win']::before {
    display: none;
  }
  .round-payout {
    gap: 1px 3px;
  }
  .result-badge .round-verdict strong {
    font-size: 11px;
  }
}
@media (orientation: landscape) and (max-height: 560px) {
  .arena-bottom .round-verdict small {
    display: none;
  }
}
.range-key,
.range-legend {
  display: flex;
  align-items: center;
  gap: 5px;
}
.range-key {
  position: absolute;
  bottom: 3px;
  left: 8px;
  padding: 2px 5px;
  border-radius: 5px;
  color: white;
  background: #334d52b8;
  font-size: 9px;
  pointer-events: none;
}
.range-key i,
.range-legend i {
  width: 8px;
  height: 8px;
  border: 1.4px solid white;
  border-radius: 50%;
  display: inline-block;
}
.range-key i:nth-of-type(2),
.range-legend i:nth-of-type(2) {
  border-color: #ffe25c;
  border-style: dashed;
}
.bench.panel {
  display: block;
  width: 100%;
  padding: clamp(7px, 1.15vh, 13px);
  margin: auto 0 0;
  max-width: none;
}
.bench-info {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-bottom: 8px;
}
.bench-info h2 {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.bench-info h2 small {
  font: 700 11px/1.4 var(--font);
  color: #47625e;
  background: #e4ece1;
  padding: 1px 6px;
  border-radius: 9px;
}
.reserve-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.bench-info .btn,
.trash-target {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 3px 5px;
  min-width: 0;
  min-height: 22px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid #bdcfc3;
  color: #345450;
  background: #f3f6eb;
  box-shadow: none;
}
.trash-target {
  color: #89584a;
  background: #fcf2e5;
  border-color: #dac2b0;
}
.reserve-actions .icon {
  width: 13px;
  height: 13px;
}
.dragging .trash-target {
  outline: 2px solid #b94a2e;
  background: #ffbf9d;
  color: #56281e;
}
.bench-slots {
  --seat-h: clamp(48px, 8.6vh, 88px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px 0;
  padding: 4px 5px 6px;
  isolation: isolate;
  position: relative;
  overflow: hidden;
  border: 1px solid #496a68;
  border-radius: 9px;
  background:
    repeating-linear-gradient(0deg, transparent 0 48%, #ffffff45 49%, #6c918556 50%, transparent 51%),
    linear-gradient(123deg, #cce1c5, #a8c9b7 62%, #98b9ac);
  box-shadow:
    inset 0 2px 0 #f0f0cd,
    inset 0 -4px 0 #59827c;
}
.bench-slot,
.bench-slot.filled,
.bench-slot.selected {
  height: var(--seat-h);
  max-height: none;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 5px;
  overflow: visible;
  touch-action: none;
  display: grid;
  place-items: center;
}
.bench-slot:not(.filled)::before {
  display: none;
}
.bench-slot .reserve-pad {
  display: block;
  position: absolute;
  left: 11%;
  bottom: 12%;
  width: 78%;
  height: 38%;
  background: url('../assets/interface/reserve-pad.webp') center / 100% 100% no-repeat;
  opacity: 0.53;
  filter: saturate(0.42);
  pointer-events: none;
}
.bench-slot.filled .reserve-pad {
  opacity: 1;
  filter: saturate(1.15) drop-shadow(0 2px 1px #41625788);
}
.bench-slot.filled.selected,
.bench-slot:focus-visible {
  outline: 2px solid #ffcf59;
  outline-offset: -2px;
  background: #fff2b73a;
}
.bench-slot:not(:disabled):hover .reserve-pad {
  opacity: 0.88;
  filter: brightness(1.08);
}
.bench-actor {
  position: absolute;
  width: 100%;
  height: 90%;
  inset: 0 auto auto 0;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px #325d6260);
}
.reserve-name {
  position: absolute;
  bottom: -1px;
  inset-inline: 0;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  color: #24443d;
  font-size: 11px;
  line-height: 14px;
  text-shadow: 0 1px #ebf2d9;
}
.reserve-stars {
  position: absolute;
  left: 3px;
  top: 1px;
  font: 900 9px/1 var(--font);
  color: #ffe36f;
  text-shadow:
    -1px 0 #795821,
    0 1px #795821,
    1px 0 #795821,
    0 -1px #795821;
}
.drag-hidden {
  visibility: hidden;
}
.shop-head {
  margin: 0;
  justify-content: space-between;
  gap: 8px;
}
.shop-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wallet {
  background: #fff0c2;
  border: 1px solid #d2b170;
  border-radius: 15px;
  color: #664419;
  padding: 2px 8px;
  min-height: 24px;
}
.wallet b {
  font-size: 17px;
}
.shop-rack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  margin: 9px 0;
}
.shop-card {
  height: clamp(40px, 7vh, 70px);
  border: 1px solid #3e536556;
  border-radius: 8px;
  background: linear-gradient(
    110deg,
    color-mix(in srgb, var(--rarity) 25%, #fffcea),
    color-mix(in srgb, var(--rarity) 42%, #fff8ec) 47%,
    color-mix(in srgb, var(--rarity) 83%, #fdfff2)
  );
  box-shadow: none;
}
.shop-card:not(.sold)::before {
  background: linear-gradient(
    124deg,
    transparent 59%,
    #fff5 59% 60%,
    transparent 60% 65%,
    #fff3 65% 68%,
    transparent 68%
  );
}
.shop-card:not(.sold)::after {
  display: none;
}
.shop-card:not(:disabled):hover {
  border-color: #476a71;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px #354f593b;
}
.shop-picture img {
  height: 175%;
  width: 57%;
  right: 1%;
  top: -6%;
  object-position: center 8%;
  filter: drop-shadow(0 2px 1px #33485552);
}
.card-role,
.card-trio {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  top: auto;
  bottom: 5px;
  left: 9px;
  width: 17px;
  height: 17px;
  background: none;
  border: 0;
  box-shadow: none;
}
.card-trio {
  left: 30px;
}
.card-trio img,
.card-role .role-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.card-meta {
  top: 5px;
  bottom: auto;
  left: 9px;
  color: #203448;
}
.card-meta strong {
  font: 900 clamp(13px, 1.95vh, 19px)/1.12 var(--font);
  color: #23374b;
  text-shadow: 0 1px #fffc;
  -webkit-text-stroke: 0;
}
.card-price {
  top: 4px;
  right: 5px;
  background: #fff2cded;
  color: #443b21;
  border: 1px solid #9f8d6c77;
  border-radius: 9px;
  padding: 1px 5px;
  gap: 2px;
}
.card-price b {
  font-size: 12px;
  color: #463822;
  text-shadow: none;
}
.card-price .coin {
  width: 11px;
  height: 11px;
}
.copy-count {
  bottom: 3px;
  right: 7px;
  color: white;
  font-size: 11px;
}
.shop-card.sold {
  height: clamp(40px, 7vh, 70px);
  background: #dce5dc;
  border: 1px dashed #a9bab1;
  box-shadow: none;
  color: #688078;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.shop-card.sold img {
  position: static;
  width: 21px;
  height: 21px;
  opacity: 0.35;
}
.shop-card.sold span {
  position: static;
  font-size: 10px;
}
.shop-actions {
  justify-content: space-between;
  margin: 0;
}
.shop-actions > .btn {
  flex: 1;
}
.btn.reroll {
  background: #ffdb77;
}
.commander {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid #677f782e;
}
.commander > div {
  display: grid;
  gap: 1px;
}
.commander strong {
  font-size: 12px;
}
.commander small {
  font-size: 10px;
  color: #5e777b;
}
.commander > .btn {
  margin-left: auto;
  font-size: 11px;
}
.level-ring {
  flex: none;
  border: 0;
  cursor: pointer;
  padding: 3px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #e59c23 var(--progress), #c3d3cf 0);
  display: grid;
  place-items: stretch;
  box-shadow: 0 0 0 1px #68827e55;
}
.level-ring span {
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #f9efce;
  background: #42616b;
  font: 19px Lilita;
}
.shop-chances table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.shop-chances caption { text-align: left; padding: 0 0 12px; color: #526a6d; }
.shop-chances th, .shop-chances td { padding: 8px 6px; text-align: right; border-bottom: 1px solid #d5ded1; }
.shop-chances th:first-child { text-align: left; }
.shop-chances thead { color: #526a6d; font-size: 12px; }
.shop-chances td strong { color: #245c52; }
.shop-example { display: flex; align-items: center; gap: 9px; margin: 14px 0 7px; }
.shop-example img { width: 35px; height: 35px; object-fit: cover; border-radius: 7px; }
.shop-example div { flex: 1; display: grid; }
.shop-example small, .shop-chances p { color: #526a6d; }
.shop-example > b { font-size: 20px; }
.shop-chances p { margin: 0; line-height: 1.5; }
.online-entry, .room-join { display: grid; gap: 12px; }
.online-entry { max-width: 390px; margin: 4px auto; }
.online-entry > .primary { justify-content: center; min-height: 44px; }
.room-join { padding-top: 14px; border-top: 1px solid #abbfb7; gap: 7px; }
.room-join label { font-size: 13px; color: #425d60; }
.room-join > div, .room-ticket { display: flex; align-items: center; gap: 9px; }
.room-join input {
  flex: 1; min-width: 0; height: 42px; padding: 4px 10px; border: 1px solid #829f99;
  border-radius: 8px; color: #263d46; background: #fffdf4; font: 18px var(--font);
}
.room-join .btn {
  min-height: 42px; padding-inline: 13px; white-space: nowrap; font-size: 15px;
  color: #fffdf2; background: #286252; border: 1px solid #214c42; border-radius: 8px;
  box-shadow: 0 2px 0 #183e35;
}
.room-join .btn:enabled:hover { background: #235648; }
.room-error { margin: 0; color: #9d4236; }
.room-error:empty { display: none; }
.network-lobby { display: grid; place-content: center; }
.room-card {
  box-sizing: border-box; width: min(360px, 82vw); display: grid; justify-items: center;
  gap: 13px; padding: 20px; color: #283e49; background: #f7f5e8; border-radius: 14px;
  box-shadow: 0 6px 22px #193b4029; margin: auto; text-align: center;
}
.room-card > .icon { width: 30px; height: 30px; color: #397d78; }
.room-card h2, .room-card p { margin: 0; }
.room-card p { color: #526766; font-size: 13px; line-height: 1.55; }
.room-ticket { flex-wrap: wrap; justify-content: center; background: #e1ecdd; padding: 10px; border-radius: 9px; }
.room-ticket > span { font-size: 12px; }
.room-ticket strong { font: 26px Lilita, var(--font); letter-spacing: 2px; user-select: all; }
.room-ticket .btn { color: #285648; background: #f8fff5; border: 1px solid #99b3a6; box-shadow: none; }
.room-card .room-leave { color: #614b40; background: #efe5d6; border-color: #c9bba5; }
.warehouse-guide {
  background: transparent;
  border: 0;
  display: grid;
  place-items: center;
  padding: 3px;
  color: #50716e;
  border-radius: 4px;
}
.warehouse-guide:hover {
  background: #deebe4;
}
.warehouse-guide .icon {
  width: 14px;
  height: 14px;
}
.gear-tile {
  position: relative;
}
.gear-tile b {
  position: absolute;
  right: -2px;
  bottom: -2px;
  background: #385561;
  color: white;
  border-radius: 4px;
  padding: 0 2px;
  font:
    10px/12px Lilita,
    sans-serif;
}
.damage-row .damage-body > div > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.damage-row .damage-body > div > b {
  flex: none;
}
#damage-rows:has(> .damage-row:nth-child(5)) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 6px;
}
#damage-rows:has(> .damage-row:nth-child(5)) .damage-row {
  min-width: 0;
  gap: 3px;
}
#damage-rows:has(> .damage-row:nth-child(5)) .damage-face img {
  width: 17px;
  height: 17px;
}
#damage-rows:has(> .damage-row:nth-child(5)) .damage-body > div {
  gap: 1px;
}
.gear-pile {
  margin: 0;
}
.gear-tile {
  background: #e3eeea;
  border-color: #a2b9b6;
  width: 26px;
  height: 26px;
}
.damage .panel-title {
  margin: 0;
}
.damage .segmented {
  margin: 0;
  min-width: 68px;
  background: #d8e5e0;
}
.segmented button {
  color: #637776;
  padding: 3px;
  font-size: 10px;
}
.segmented button[aria-pressed='true'] {
  background: #47727d;
  color: white;
}
.segmented button:disabled {
  opacity: 0.45;
}
.damage-body b {
  color: #775224;
  font-size: 13px;
}
.empty-damage {
  min-height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 10px;
  padding: 6px 0 0;
  color: #648084;
}
.empty-damage .icon {
  width: 18px;
  height: 18px;
}
.damage-face img {
  width: 22px;
  height: 22px;
}
.damage-row {
  margin-top: 4px;
}
.damage-body > i > b {
  background: #d3a13c;
}
.piece-menu {
  position: fixed;
  z-index: 22;
  width: 215px;
  padding: 8px;
  background: #fffdf4fa;
  color: #28424d;
  border: 1px solid #5678788c;
  box-shadow: 0 6px 23px #2038415c;
  border-radius: 11px;
  display: grid;
  gap: 6px;
}
.piece-title,
.piece-gear,
.piece-hyper,
.piece-group > div {
  display: flex;
  align-items: center;
  gap: 5px;
}
.piece-title strong {
  font: 900 16px var(--font);
}
.piece-title em {
  color: #aa6c0e;
  font-size: 12px;
}
.piece-title button {
  border: 0;
  background: none;
  margin-left: auto;
  padding: 0;
}
.piece-title .icon {
  width: 15px;
  height: 15px;
}
.piece-locked {
  font-size: 11px;
  color: #687a7b;
}
.piece-locked .icon,
.range-legend .icon {
  width: 12px;
  height: 12px;
  vertical-align: middle;
  margin-right: 3px;
}
.piece-group > b,
.piece-gear > b {
  font-size: 10px;
  color: #5a7477;
}
.piece-group > div > button {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  text-align: left;
  font-size: 10px;
  border-radius: 5px;
  padding: 2px;
  background: #edf3ea;
  border: 1px solid #b9cbc1;
}
.piece-group button[aria-pressed='true'] {
  background: #ffebae;
  border-color: #c8a152;
}
.piece-group img,
.piece-gear img,
.piece-hyper img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.piece-gear button {
  padding: 1px;
  background: #e5efeb;
  border: 1px solid #b7c9c5;
  border-radius: 4px;
}
.piece-hyper {
  font-size: 10px;
  color: #754487;
}
.range-legend {
  font-size: 10px;
  background: #48616b;
  color: white;
  padding: 3px 5px;
  border-radius: 4px;
}
.range-legend small {
  margin-left: auto;
  color: #ffe39a;
}
.mobile-tools {
  display: none;
}
@media (min-width: 761px) and (max-height: 760px) {
  .shop-rack {
    gap: 3px;
    margin: 5px 0;
  }
  .shop-card,
  .shop-card.sold {
    height: clamp(33px, 6.5vh, 48px);
  }
  .damage-row {
    margin-top: 2px;
  }
  .damage-face img {
    height: 17px;
    width: 17px;
  }
  .left-column #damage-rows:has(.damage-row:nth-child(5)) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 5px;
  }
  .card-role,
  .card-trio {
    width: 14px;
    height: 14px;
    bottom: 3px;
  }
  .card-trio {
    left: 27px;
  }
  .card-meta {
    top: 3px;
  }
  .commander {
    margin-top: 4px;
    padding-top: 4px;
  }
}
@media (max-width: 1100px) and (orientation: portrait) {
  .app-shell {
    --head: 43px;
    --gap: 4px;
    --pad: 5px;
    grid-template-rows: var(--head) minmax(0, 1fr);
    padding-bottom: max(3px, env(safe-area-inset-bottom));
  }
  .top nav .btn {
    font-size: 10px;
    gap: 3px;
    padding: 3px 5px;
    min-height: 24px;
  }
  .brand-skull {
    width: 30px;
  }
  .brand h1 {
    font-size: 19px;
  }
  .wordmark > span {
    font-size: 8px;
  }
  .dashboard {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto auto auto;
    grid-template-areas: 'center' 'bench' 'shop' 'gear';
    gap: 4px;
  }
  .center-column {
    gap: 3px;
  }
  .map-head {
    height: 32px;
  }
  .arena-bottom {
    height: 31px;
  }
  .battle-status b {
    font-size: 11px;
  }
  .app-shell .primary {
    font-size: 12px;
    min-width: 75px;
    min-height: 23px;
    padding: 2px 7px;
  }
  .left-column {
    display: contents;
  }
  .left-column > .roster-info,
  .left-column > .upcoming,
  .left-column > .damage {
    display: none;
  }
  .left-column > .warehouse {
    grid-area: gear;
  }

  .right-column {
    display: contents;
  }
  .right-column > .shop,
  .right-column > .bench {
    width: 100%;
  }
  .shop.panel,
  .warehouse.panel {
    padding: 4px 6px;
    border-radius: 8px;
  }
  .right-column .shop {
    grid-area: shop;
    position: relative;
    display: grid;
    grid-template-columns: max-content minmax(max-content, 1fr) max-content;
    align-items: center;
    gap: 3px 6px;
    grid-template-areas: 'head level actions' 'cards cards cards';
  }
  .shop-head {
    grid-area: head;
    justify-content: space-between;
    gap: 8px;
  }
  .shop-head h2 { flex: 1; }
  .shop-rack {
    grid-area: cards;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    margin: 0;
  }
  .shop-card,
  .shop-card.sold {
    height: clamp(48px, 7dvh, 72px);
  }
  .shop-picture img {
    width: 110%;
    height: 118%;
    right: -14%;
    top: 2%;
  }
  .card-meta {
    top: auto;
    left: 3px;
    bottom: 2px;
  }
  .card-meta strong {
    font-size: 12px;
    color: white;
    text-shadow:
      0 1px 3px #122735,
      1px 0 1px #0b2737;
  }
  .card-role,
  .card-trio {
    top: 3px;
    left: 2px;
    bottom: auto;
    width: 13px;
    height: 13px;
  }
  .card-trio {
    top: 18px;
  }
  .card-price {
    right: 2px;
    top: 2px;
    padding: 0 2px;
  }
  .card-price b {
    font-size: 10px;
  }
  .card-price .coin {
    width: 8px;
    height: 8px;
  }
  .shop-card.sold {
    flex-direction: column;
  }
  .shop-actions {
    grid-area: actions;
    gap: 3px;
  }
  .shop-actions .btn {
    font-size: 10px;
    min-height: 27px;
    padding: 2px 6px;
  }
  .shop-actions [aria-pressed='true'] { background: #ffe5a1; border-color: #bd9453; }
  .shop-actions > .btn { flex: none; }
  .shop-actions [data-act='lock'] { min-width: 28px; }
  .shop-actions [data-act='lock'] .shop-action-name,
  .shop .xp-word { display: none; }
  .wallet {
    min-height: 16px;
    padding: 0 4px;
  }
  .wallet b {
    font-size: 12px;
  }
  .wallet .coin {
    width: 10px;
    height: 10px;
  }
  .commander {
    grid-area: level;
    position: static;
    padding: 0;
    margin: 0;
    border: 0;
    gap: 6px;
    justify-content: center;
  }
  .shop .commander > div { display: grid; line-height: 1; gap: 2px; white-space: nowrap; }
  .shop .commander > .btn { flex: none; white-space: nowrap; }
  .level-ring {
    width: 26px;
    height: 26px;
    padding: 2px;
  }
  .level-ring span {
    font-size: 12px;
  }
  .commander strong {
    display: none;
  }
  .commander small {
    font-size: 9px;
  }
  .commander > .btn {
    min-height: 27px;
    margin-left: 2px;
    font-size: 10px;
    padding: 2px 5px;
  }
  .warehouse.panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 23px;
    gap: 2px;
  }
  .warehouse-head .mobile-tools { margin-left: auto; }
  .gear-tile {
    width: 19px;
    height: 19px;
  }
  .gear-pile {
    gap: 2px;
  }

  .mobile-tools {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
  }
  .mobile-tools .btn {
    min-height: 26px;
    padding: 2px 5px;
    font-size: 10px;
  }
  .mobile-tools .btn[aria-pressed='true'] { background: #d4e8de; border-color: #799e92; }
  .mobile-tools .icon {
    width: 12px;
  }
  .app-shell[data-panel='mobile-traits'] .roster-info,
  .app-shell[data-panel='mobile-damage'] .damage {
    display: flex;
    flex-direction: column;
    position: fixed;
    z-index: 15;
    width: min(246px, 78vw);
    bottom: calc(58px + env(safe-area-inset-bottom));
    right: 6px;
    gap: 4px;
  }
  .app-shell[data-panel='mobile-traits'] .upcoming {
    display: none;
  }
  .app-shell[data-panel='mobile-traits'] .panel,
  .app-shell[data-panel='mobile-damage'] .damage {
    background: #fffdf4;
  }
  .right-column > .bench {
    grid-area: bench;
    margin-top: 0;
  }
  .bench.panel {
    padding: 3px 5px 4px;
    order: -1;
    border-radius: 8px;
  }
  .bench-info {
    margin: 0 0 2px;
    gap: 4px;
  }
  .bench-info h2 {
    font-size: 12px !important;
  }
  .bench-info h2 small {
    font-size: 9px;
  }
  .reserve-actions .btn,
  .reserve-actions .trash-target {
    min-height: 17px;
    font-size: 9px;
    padding: 0 4px;
  }
  .bench-slots {
    --seat-h: clamp(34px, 5.3vh, 53px);
    grid-template-columns: repeat(8, minmax(0, 1fr));
    padding: 1px 2px 4px;
    gap: 0;
  }
  .bench-slot .reserve-pad {
    height: 33%;
    bottom: 15%;
  }
  .reserve-name {
    font-size: 8px;
    line-height: 9px;
  }
  .reserve-stars {
    font-size: 7px;
    left: 1px;
    top: 0;
  }
  .range-key {
    font-size: 8px;
  }
}
@media (orientation: landscape) and (max-height: 560px) {
  .app-shell {
    --head: 32px;
    --gap: 3px;
    --pad: 5px;
    --rail: clamp(120px, 20vw, 175px);
    --trade: clamp(165px, 28vw, 245px);
  }
  .dashboard {
    grid-template-areas: 'left center right';
    grid-template-columns: var(--rail) minmax(0, 1fr) var(--trade);
    grid-template-rows: minmax(0, 1fr);
    gap: 5px;
  }
  .brand-skull {
    width: 26px;
  }
  .brand h1 {
    font-size: 17px;
  }
  .wordmark > span {
    font-size: 7px;
  }
  .arena.panel {
    max-width: 100%;
  }
  .map-head {
    height: 24px;
    min-height: 0;
  }
  .map-name small,
  .round > small,
  .round > span {
    display: none;
  }
  .app-shell .panel .map-name h2 {
    font-size: 14px;
  }
  .map-insignia,
  .map-badge {
    width: 19px;
    height: 19px;
  }
  .arena-bottom {
    height: 24px;
    padding: 1px 3px;
  }
  .battle-status span {
    font-size: 9px;
  }
  .battle-status b {
    font-size: 10px;
  }
  .app-shell .primary,
  .app-shell .mini {
    font-size: 9px;
    min-height: 18px;
    min-width: 0;
    padding: 0 3px;
  }
  .arena-tools {
    gap: 2px;
  }
  .bench.panel {
    padding: 3px 5px;
  }
  .bench-info {
    margin-bottom: 2px;
  }
  .bench-info h2 {
    font-size: 11px !important;
  }
  .bench-info .btn,
  .reserve-actions .trash-target {
    min-height: 15px;
    font-size: 9px;
    padding: 0 3px;
  }
  .bench-slots {
    --seat-h: clamp(32px, 9.5vh, 52px);
    padding: 2px 3px 4px;
  }
  .reserve-name {
    font-size: 8px;
    line-height: 10px;
  }
  .reserve-stars {
    font-size: 7px;
  }
  .players,
  .traits,
  .upcoming,
  .shop,
  .warehouse,
  .damage {
    padding: 4px 6px;
  }
  .team-card {
    min-height: 30px;
    padding: 2px;
  }
  .avatar {
    width: 24px;
    height: 24px;
  }
  .players h2,
  .traits h2,
  .upcoming h2 {
    margin-bottom: 2px;
  }
  .app-shell .panel h2 {
    font-size: 12px;
  }
  .shop-rack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
    margin: 3px 0;
  }
  .shop-card,
  .shop-card.sold {
    height: 29px;
  }
  .shop-card:last-child {
    grid-column: span 2;
  }
  .shop-actions .btn,
  .commander .btn {
    min-height: 16px;
    padding: 0 4px;
    font-size: 9px;
  }
  .commander {
    margin-top: 2px;
    padding-top: 2px;
  }
  .level-ring {
    width: 24px;
    height: 24px;
  }
  .commander strong {
    font-size: 9px;
  }
  .card-role,
  .card-trio {
    width: 11px;
    height: 11px;
    bottom: 1px;
    left: 3px;
  }
  .card-trio {
    left: 15px;
  }
  .card-meta {
    left: 3px;
    top: 1px;
  }
  .card-meta strong {
    font-size: 11px;
  }
  .damage-face img {
    width: 14px;
    height: 14px;
  }
  .damage-body b {
    font-size: 10px;
  }
  .damage-row {
    margin: 0;
  }
  .damage .empty-damage {
    min-height: 18px;
  }
  .round-track img {
    height: 16px;
  }
  .trait-row {
    padding: 1px;
  }
  .trait-row i,
  .trait-row .trio-art,
  .trait-row .role-art {
    height: 16px;
    width: 16px;
  }
}
#board.field {
  max-height: none;
  min-height: 0;
}
.bench-slot .bench-badges {
  position: absolute;
  right: 0;
  top: 0;
  left: auto;
  bottom: auto;
  width: auto;
  height: auto;
  background: transparent;
  box-shadow: none;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  max-width: 100%;
  gap: 0;
}
.bench-slot .bench-badges img {
  position: static;
  width: clamp(7px, 1.2vh, 12px);
  height: clamp(7px, 1.2vh, 12px);
  object-fit: contain;
  inset: auto;
}
.card-pair {
  position: absolute;
  z-index: 1;
  left: 51px;
  bottom: 5px;
  width: 18px;
  height: 18px;
  pointer-events: auto;
}
.card-pair img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid #fff8;
  object-fit: cover;
}
.card-pair .icon {
  position: absolute;
  width: 8px;
  height: 8px;
  right: -2px;
  bottom: -1px;
  color: white;
  background: #714e66;
  border-radius: 50%;
}
.trait-list:has(> .trait-row) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}
.trait-list .trait-row {
  justify-content: center;
  gap: 4px;
  min-height: 32px;
}
.trait-list .trait-row > span {
  display: none;
}
.trait-list .trait-row b {
  font-size: 13px;
}
.trait-list .trait-row b small {
  font-size: 10px;
}
.trait-list .trait-row i {
  width: 22px;
  height: 22px;
}
.trait-list .trait-row .trait-faces {
  display: flex;
}
@media (max-width: 1100px) and (orientation: portrait) {
  .card-pair {
    top: 33px;
    bottom: auto;
    left: 3px;
    width: 12px;
    height: 12px;
  }
  .card-pair .icon {
    width: 6px;
    height: 6px;
  }
}
@media (orientation: landscape) and (max-height: 560px) {
  .card-pair {
    width: 11px;
    height: 11px;
    left: 28px;
    bottom: 1px;
  }
  .card-pair .icon {
    display: none;
  }
  .trait-list .trait-row {
    min-height: 20px;
  }
  .trait-list .trait-row i {
    width: 16px;
    height: 16px;
  }
}
@media (orientation: landscape) and (max-height: 760px) {
  .players {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
  }
  .players h2 {
    grid-column: 1/-1;
    margin: 0;
  }
  .team-card,
  .team-card.bot {
    min-height: 30px;
    margin: 0;
    padding: 3px;
    gap: 3px;
  }
  .team-card .avatar {
    width: 22px;
    height: 24px;
    flex: none;
  }
  .team-summary strong {
    font-size: 10px;
    line-height: 13px;
    white-space: nowrap;
  }
  .team-hp {
    font-size: 9px;
    line-height: 11px;
    white-space: nowrap;
  }
  .team-hp small {
    font-size: 8px;
  }
  .team-hp b {
    font-size: 11px;
  }
  .team-hp .icon {
    width: 8px;
    height: 8px;
    margin: 0;
  }
  .team-summary > i {
    height: 2px;
  }
  .round-track > div {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
    padding: 3px 0;
  }
  .round-track img {
    width: 16px;
    height: 16px;
    margin: 0;
  }
  .round-track b {
    font-size: 10px;
  }
  .damage .panel-title {
    gap: 2px;
  }
  .left-column .gear-pile {
    gap: 4px;
  }
}
@media (orientation: landscape) and (max-height: 560px) {
  .app-shell .left-column {
    gap: 3px;
  }
  .left-column .panel {
    padding: 3px 5px;
  }
  .players h2 .panel-emblem {
    height: 15px;
    width: 16px;
  }
  .left-column .team-card .avatar {
    width: 16px;
    height: 18px;
  }
  .left-column .team-card {
    gap: 2px;
    padding: 2px;
    min-height: 25px;
  }
  .left-column .traits h2,
  .left-column .upcoming h2 {
    margin-bottom: 2px;
  }
  .left-column .trait-list:has(> .trait-row:nth-child(7)) {
    gap: 2px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .left-column .trait-list:has(> .trait-row) .trait-row {
    min-height: 16px;
    gap: 1px;
    padding: 1px;
  }
  .left-column .trait-list .trait-row i,
  .left-column .trait-list .trait-row i img {
    width: 12px;
    height: 12px;
  }
  .left-column .trait-list .trait-row b,
  .left-column .trait-list .trait-row small {
    font-size: 8px;
  }
  .left-column .role-tile {
    padding: 1px;
  }
  .left-column .role-art {
    width: 14px;
    height: 14px;
  }
  .left-column .gear-tile {
    width: 19px;
    height: 19px;
  }
  .left-column .damage-body > div {
    font-size: 9px;
    line-height: 10px;
  }
  .left-column #damage-rows:has(.damage-row:nth-child(5)) .damage-face img {
    width: 13px;
    height: 13px;
  }
  .left-column .damage-body > i {
    height: 2px;
    margin-top: 1px;
  }
  .left-column .round-track > div {
    padding: 1px 0;
  }
  .left-column .empty-damage {
    padding: 1px 0;
    min-height: 14px;
  }
  .left-column .panel h2 {
    white-space: nowrap;
    align-items: center;
    line-height: 15px;
    font-size: 11px;
    gap: 3px;
  }
  .left-column .panel h2 > .icon {
    width: 13px;
    height: 13px;
  }
  .left-column .players {
    grid-template-rows: 15px 26px;
    gap: 2px;
  }
  .left-column .team-card {
    height: 26px;
    overflow: hidden;
  }
  .left-column .traits .trait-list:has(.trait-row) .trait-row {
    min-height: 0;
    height: 16px;
    line-height: 12px;
  }
  .left-column .traits .trait-row b {
    line-height: 12px;
  }
  .left-column .traits .trait-row > i {
    height: 12px;
  }
  .left-column .warehouse-guide {
    padding: 1px;
  }
  .left-column .panel-title {
    height: 16px;
    align-items: center;
  }
  .left-column .segmented {
    min-width: 45px;
    gap: 0;
  }
  .left-column .segmented button {
    font-size: 9px;
    line-height: 13px;
    padding: 0 2px;
    min-height: 14px;
  }
  .left-column .upcoming {
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .left-column .upcoming h2 {
    font-size: 10px;
    margin: 0;
  }
  .left-column .upcoming h2 .icon {
    display: none;
  }
  .left-column .round-track {
    flex: 1;
    gap: 1px;
  }
  .left-column .round-track > div {
    display: grid;
    justify-items: center;
    gap: 0;
    border: 0;
    padding: 0;
  }
  .left-column .round-track img {
    height: 12px;
    width: 12px;
  }
  .left-column .round-track b {
    line-height: 9px;
    font-size: 9px;
  }
}
#dialog {
  color: #273d48;
  background: #fffdf3;
  border: 1px solid #526c72;
  border-radius: 15px;
  box-shadow: 0 10px 40px #1f3d4e66;
  width: min(610px, 94vw);
  max-height: 94dvh;
}
#dialog::backdrop {
  background: #24425465;
  backdrop-filter: blur(3px);
}
.dialog-head {
  background: #e3eee8;
  color: #294450;
  border: 0;
  border-bottom: 1px solid #b6c7bf;
  padding: 9px 12px;
}
.dialog-head h2 {
  color: #293f4b;
  text-shadow: none;
}
.dialog-head .btn,
.star-tabs .btn {
  color: #2e4b55;
  background: #f6f8ed;
  border: 1px solid #b4c8bf;
  box-shadow: none;
}
.dialog-body {
  color: #29404b;
  background: #fffdf3;
  padding: 12px;
}
.family-tabs,
.guide-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 10px;
}
.family-tabs button,
.guide-tabs button {
  border: 1px solid #b2c6be;
  border-radius: 8px;
  background: #edf2e9;
  color: #3e575e;
  padding: 4px 8px;
  font-size: 12px;
}
.family-tabs button[aria-pressed='true'],
.guide-tabs button[aria-pressed='true'],
.star-tabs .btn.chosen {
  background: #ffe7a2;
  border-color: #caa14a;
  color: #5f4720;
}
.family-tabs img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.codex-groups section,
.rules-list > section,
.codex-hero,
.gear-guide > div,
.match-mode,
.stat-grid > div,
.super-info,
.trait-banner {
  background: #e9f0e8;
  border: 1px solid #c0cec4;
  color: #29434e;
  box-shadow: none;
}
.codex-hero small,
.gear-guide p,
.match-mode small,
.rules-list p,
.attack-detail,
.hero-summary p,
.dialog-body .super-info p,
.stat-grid small {
  color: #526a6d;
}
.dialog-body h3,
.gear-guide b,
.stat-grid b,
.rules-list h3,
.match-mode b,
.codex-hero b {
  color: #293f49;
  text-shadow: none;
}
.hero-intro {
  background: linear-gradient(115deg, color-mix(in srgb, var(--rarity) 36%, #fbf9eb), #f4f5e8);
  border: 1px solid #c3d1c4;
  margin-bottom: 9px;
}
.hero-summary small {
  color: #455c65;
}
.hero-intro .hero-render {
  max-height: 100px;
}
.hero-summary h3 {
  font-size: 24px;
}
.hero-summary p .role-art {
  height: 17px;
  width: 17px;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hero-actions .try-hero {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 25px;
  padding: 2px 7px;
  border: 1px solid #b3c6af;
  border-radius: 6px;
  background: #edf3df;
  color: #365444;
  font-size: 12px;
  box-shadow: none;
}
.try-hero .icon {
  height: 14px;
  width: 14px;
}
.training-range {
  display: grid;
  gap: 8px;
}
.training-head,.training-transport,.training-modes {
  display: flex;
  align-items: center;
}
.training-head {
  gap: 8px;
  justify-content: space-between;
}
.training-modes {
  flex: none;
  border: 1px solid #b8c9c0;
  border-radius: 8px;
  background: #e8eeea;
  padding: 2px;
}
.training-modes button {
  min-height: 27px;
  border: 0;
  padding: 3px 9px;
  border-radius: 5px;
  color: #415754;
  background: transparent;
  font: 800 12px/1.2 var(--font);
}
.training-modes button[aria-pressed='true'] {
  color: #fff;
  background: #3c6163;
  box-shadow: 0 1px 2px #18363235;
}
.training-head > strong {
  font-size: clamp(12px,2vw,16px);
  color: #2b444e;
  text-align: right;
}
.training-powers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}
.training-powers button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 3px 5px;
  min-height: 31px;
  border: 1px solid #bfcab9;
  border-radius: 7px;
  background: #f0f3e6;
  color: #50635e;
  font: 750 12px/1.1 var(--font);
}
.training-powers button[aria-pressed='true'] {
  border-color: #a47932;
  background: #ffe6a3;
  color: #63441f;
}
.training-powers img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}
.training-powers[hidden] {
  display: none;
}
.training-powers[data-training-choices='gadget'] button[aria-pressed='true'] {
  color: #194c39;
  border-color: #629779;
  background: #c8e7c8;
}
@media (max-width: 550px) {
  .training-head:has([data-training-mode='gadget']) {
    display: grid;
    gap: 4px;
  }
  .training-head:has([data-training-mode='gadget']) .training-modes button {
    flex: 1 1 0;
    padding-inline: 3px;
  }
  .training-head:has([data-training-mode='gadget']) > strong {
    text-align: left;
  }
}
.training-window {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: clamp(155px, 34dvh, 280px);
  border: 1px solid #5b665866;
  border-radius: 9px;
  background: #ce9860;
}
.training-window[data-map-edges]::before,
.training-window[data-map-edges]::after {
  content: "";
  pointer-events: none;
  position: absolute;
  top: var(--map-top);
  left: calc(var(--map-left) - var(--map-width));
  width: var(--map-width);
  height: var(--map-height);
  background: var(--practice-surround) center / 100% 100% no-repeat;
  transform: scaleX(-1);
  filter: brightness(.86) saturate(.84);
}
.training-window[data-map-edges]::after {
  left: calc(var(--map-left) + var(--map-width));
}
.training-canvas {
  display: block;
  position: absolute;
  z-index: 1;
  left: 50%;
  top: var(--practice-ground, 52%);
  width: max(114%, 332px);
  height: auto;
  aspect-ratio: .9;
  transform: translate(var(--practice-x,-50%),var(--practice-centre, -50%));
}
.training-transport {
  gap: 8px;
  color: #38535a;
}
.training-transport button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 29px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #adc4b8;
  color: #284749;
  background: #eaf1e8;
  font: 800 12px/1.2 var(--font);
}
.training-transport .icon {
  width: 14px;
  height: 14px;
}
.training-transport button:disabled {
  opacity: .5;
}
.training-transport input {
  flex: 1;
  min-width: 24px;
  height: 24px;
  margin: 0;
  accent-color: #4d806d;
  cursor: pointer;
}
.training-transport output {
  white-space: nowrap;
  min-width: 5.6em;
  font: 12px/1 Lilita,var(--font);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
@media (max-height: 540px) and (orientation: landscape) {
  .training-window {height: clamp(110px,36dvh,176px);}
}
@media (max-width: 420px) {
  .training-window {height:clamp(166px,28dvh,230px);}
  .training-canvas {width:148%;}
  .training-head,.training-transport,.hero-actions {gap: 5px;}
  .training-transport button {padding: 3px 5px;}
  .training-transport output {min-width: 4.6em;font-size: 11px;}
}
.hero-intro > div:first-child {
  height: 108px;
}
.guide-page {
  min-height: 115px;
}
.codex-ability {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
}
.codex-ability + .codex-ability {
  border-top: 1px solid #d8e2d9;
}
.codex-ability img {
  width: 35px;
  height: 35px;
  object-fit: contain;
}
.codex-ability strong {
  font-size: 14px;
}
.codex-ability p,
.rules-list p {
  font-size: 12px;
  line-height: 1.6;
}
.gear-guide img,
.super-info img {
  object-fit: contain;
}
.trait-banner img.trio-art {
  width: 47px;
  height: 47px;
  object-fit: contain;
}
.role-tile span {
  display: none;
}
@media (max-width: 550px), (max-height: 510px) {
  .dialog-body {
    padding: 8px;
  }
  .dialog-head {
    padding: 5px 8px;
  }
  .dialog-head h2 {
    font-size: 17px;
  }
  .family-tabs,
  .guide-tabs {
    gap: 3px;
    margin: 0 0 5px;
  }
  .family-tabs button,
  .guide-tabs button {
    padding: 2px 5px;
    font-size: 10px;
  }
  .family-tabs img {
    width: 24px;
    height: 24px;
  }
  .codex-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .codex-row .codex-hero {
    flex-direction: column;
    padding: 5px;
  }
  .hero-intro > div:first-child {
    height: 68px;
  }
  .hero-intro .hero-render {
    max-height: 64px;
  }
  .hero-summary h3 {
    font-size: 18px;
  }
  .hero-intro {
    padding: 3px 7px;
  }
  .codex-ability {
    padding: 4px 0;
  }
  .guide-page {
    min-height: 80px;
  }
  .target-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
  }
  .target-list .codex-hero {
    min-height: 28px;
    padding: 1px;
    gap: 2px;
  }
  .target-list img {
    width: 18px;
    height: 18px;
  }
  .codex-groups section,
  .rules-list section {
    padding: 6px;
  }
  .match-mode {
    min-height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
