:root {
  --arena-ink: #080a09;
  --arena-steel: #78847a;
  --arena-steel-bright: #c8d0c6;
  --arena-bronze: #c49a4a;
  --arena-bronze-bright: #f1cb75;
  --arena-player: #65d48a;
  --arena-rival: #ff7878;
}

.home-identity-shell {
  position: relative;
  min-height: 540px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 0;
  overflow: hidden;
  padding: 0;
  border-color: rgba(196, 154, 74, 0.32);
  background:
    radial-gradient(circle at 78% 28%, rgba(196, 154, 74, 0.14), transparent 27%),
    radial-gradient(circle at 22% 0%, rgba(101, 212, 138, 0.08), transparent 34%),
    linear-gradient(135deg, rgba(29, 32, 28, 0.99), rgba(10, 12, 11, 0.99));
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.home-identity-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.26;
  background-image:
    linear-gradient(115deg, transparent 0 48%, rgba(255,255,255,0.025) 49%, transparent 50%),
    linear-gradient(65deg, transparent 0 48%, rgba(255,255,255,0.018) 49%, transparent 50%);
  background-size: 44px 44px;
}

.home-identity-content {
  position: relative;
  z-index: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(22px, 3vw, 38px);
}

.home-identity-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.home-kicker {
  margin-bottom: 7px;
  color: var(--arena-bronze-bright);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.home-identity-heading h2 {
  margin: 0;
  color: #fffdf7;
  font-size: clamp(30px, 4vw, 50px);
  font-weight: 950;
  line-height: 0.96;
  overflow-wrap: anywhere;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.52);
}

.home-character-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.home-character-line > span:not(:last-child) {
  padding-right: 12px;
  border-right: 1px solid rgba(200, 208, 198, 0.18);
  color: var(--arena-steel-bright);
  font-weight: 850;
}

.home-readiness {
  flex: 0 0 auto;
  max-width: 170px;
  padding: 7px 10px;
  overflow: hidden;
  border: 1px solid rgba(101, 212, 138, 0.34);
  border-radius: 999px;
  background: rgba(101, 212, 138, 0.08);
  color: #bff8d0;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.home-vitals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-vital-card,
.home-resource {
  min-width: 0;
  border: 1px solid rgba(200, 208, 198, 0.14);
  border-radius: 10px;
  background: rgba(6, 9, 8, 0.42);
}

.home-vital-card {
  padding: 12px;
}

.home-vital-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.home-vital-top span,
.home-resource span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-vital-top strong {
  color: #fff;
  font-size: 13px;
}

.home-progress-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.48);
}

.home-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 240ms ease;
}

.home-hp-fill {
  background: linear-gradient(90deg, #a92837, #ff7a83);
  box-shadow: 0 0 12px rgba(255, 120, 120, 0.34);
}

.home-exp-fill {
  background: linear-gradient(90deg, #9d741f, var(--arena-bronze-bright));
  box-shadow: 0 0 12px rgba(241, 203, 117, 0.28);
}

.home-resource-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.home-resource {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
}

.home-resource strong {
  overflow: hidden;
  color: #fff;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-resource strong.good {
  color: var(--good);
}

.home-resource strong.bad {
  color: var(--bad);
}

.home-medical-details {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 113, 124, 0.32);
  border-radius: 10px;
  background: rgba(73, 20, 27, 0.22);
}

.home-medical-details[hidden] {
  display: none;
}

.home-medical-injuries,
.home-medical-impact {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  min-width: 0;
}

.home-medical-injuries span {
  color: #ffb4ba;
  font-size: 12px;
  font-weight: 800;
}

.home-medical-impact strong {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-medical-impact span {
  min-width: 0;
  color: #f0d7d9;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.home-medical-need {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 180, 186, 0.18);
}

.home-medical-need > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.home-medical-need strong {
  color: var(--text);
  font-size: 12px;
}

.home-medical-need span {
  color: #f0d7d9;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.home-medical-need button {
  flex: 0 0 auto;
}

.home-combat-record {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(196, 154, 74, 0.22);
  border-radius: 10px;
  background:
    linear-gradient(110deg, rgba(196, 154, 74, 0.07), transparent 42%),
    rgba(6, 9, 8, 0.46);
}

.home-identity-actions,
.fighter-title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-identity-actions {
  flex-direction: column;
  align-items: flex-end;
}

.fighter-profile-button,
.public-profile-name-link {
  border: 1px solid rgba(231, 187, 70, 0.5);
  background: rgba(12, 15, 13, 0.82);
  color: #f0d278;
  font: inherit;
  cursor: pointer;
}

.fighter-profile-button {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 11px;
}

.public-profile-name-link {
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 800;
  text-align: left;
}

.public-profile-name-link:hover,
.public-profile-name-link:focus-visible {
  color: #fff0b2;
  text-decoration: underline;
}

.public-character-profile-dialog {
  width: min(960px, calc(100vw - 32px));
  max-height: min(900px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid rgba(212, 166, 47, 0.65);
  border-radius: 16px;
  background:
    radial-gradient(circle at 85% 8%, rgba(194, 143, 36, 0.14), transparent 38%),
    linear-gradient(145deg, #151a16, #0b0e0c 68%);
  color: #f2f1e9;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.76);
  overflow: hidden;
}

.public-character-profile-dialog::backdrop {
  background: rgba(3, 5, 4, 0.78);
  backdrop-filter: blur(5px);
}

.public-profile-dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(213, 174, 66, 0.28);
  background: rgba(13, 17, 14, 0.96);
}

.public-profile-dialog-head h2 {
  margin: 3px 0 0;
}

.public-profile-dialog-head > button {
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  font-size: 25px;
}

.public-character-profile-content {
  max-height: calc(100vh - 116px);
  padding: 22px;
  overflow: auto;
}

.public-profile-loading,
.public-profile-error {
  padding: 48px 20px;
  color: #c6c9c1;
  text-align: center;
}

.public-profile-error {
  color: #ff8e8e;
}

.public-profile-hero,
.public-profile-facts,
.public-profile-build-columns {
  display: grid;
  gap: 14px;
}

.public-profile-hero {
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 22px;
  border: 1px solid rgba(209, 166, 48, 0.32);
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(35, 47, 37, 0.9), rgba(15, 19, 16, 0.82));
}

.public-profile-hero h3 {
  margin: 5px 0;
  font-size: clamp(27px, 5vw, 48px);
}

.public-profile-hero p {
  margin: 0;
  color: #c3c9bf;
}

.public-profile-power {
  min-width: 112px;
  padding: 14px;
  border: 1px solid rgba(231, 187, 70, 0.5);
  border-radius: 12px;
  text-align: center;
}

.public-profile-power span,
.public-profile-facts span,
.public-profile-stat span {
  display: block;
  color: #aeb5ab;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.public-profile-power strong {
  display: block;
  margin-top: 4px;
  color: #f4d364;
  font-size: 28px;
}

.public-profile-facts {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 14px;
}

.public-profile-facts > div,
.public-profile-section {
  border: 1px solid rgba(125, 140, 125, 0.26);
  border-radius: 12px;
  background: rgba(12, 16, 13, 0.74);
}

.public-profile-facts > div {
  padding: 13px;
}

.public-profile-facts strong {
  display: block;
  margin-top: 5px;
}

.public-profile-section {
  margin-top: 14px;
  padding: 16px;
}

.public-profile-section h4 {
  margin: 0 0 12px;
  color: #f1d270;
}

.public-profile-build-columns {
  grid-template-columns: 1fr 1fr;
}

.public-profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.public-profile-stat-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.public-profile-stat,
.public-profile-record-row,
.public-profile-item,
.public-profile-profession,
.public-profile-milestone {
  padding: 10px;
  border: 1px solid rgba(135, 149, 133, 0.2);
  border-radius: 9px;
  background: rgba(30, 36, 30, 0.64);
}

.public-profile-stat strong {
  display: block;
  margin-top: 4px;
}

.public-profile-record,
.public-profile-equipment,
.public-profile-professions,
.public-profile-milestones {
  display: grid;
  gap: 8px;
}

.public-profile-record {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.public-profile-record-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 10px;
}

.public-profile-record-row.headline {
  border-color: rgba(78, 190, 116, 0.5);
}

.public-profile-record-row small {
  grid-column: 1 / -1;
  color: #aeb5ab;
}

.public-profile-equipment,
.public-profile-professions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.public-profile-item span,
.public-profile-profession span {
  display: block;
  margin-top: 5px;
  color: #aeb5ab;
  font-size: 12px;
}

.public-profile-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.public-profile-item.broken {
  border-color: rgba(218, 94, 94, 0.4);
}

.public-profile-item-visual {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(217, 182, 88, 0.32);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 38%, rgba(219, 179, 73, 0.14), transparent 62%),
    rgba(9, 12, 10, 0.86);
}

.public-profile-item-visual > * {
  grid-area: 1 / 1;
}

.public-profile-item-visual img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.public-profile-item-placeholder {
  color: #c5ab65;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.public-profile-item-copy {
  min-width: 0;
}

.public-profile-item-copy small {
  display: block;
  margin-bottom: 3px;
  color: #d0b765;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.public-profile-item-copy strong {
  overflow-wrap: anywhere;
}

.public-profile-item .public-profile-item-effects {
  color: #e4cf8a;
}

.public-profile-since {
  margin: -3px 0 12px;
  color: #aeb5ab;
}

.public-profile-since strong {
  color: #f2f1e9;
}

.public-profile-milestone {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
}

.public-profile-milestone-mark {
  color: #f1d270;
}

.public-profile-milestone.guild-founder {
  position: relative;
  overflow: hidden;
  border-color: rgba(232, 190, 76, 0.58);
  background:
    radial-gradient(circle at 92% 20%, rgba(230, 184, 62, 0.16), transparent 42%),
    linear-gradient(120deg, rgba(43, 53, 36, 0.96), rgba(22, 27, 22, 0.9));
  box-shadow:
    inset 3px 0 rgba(239, 197, 79, 0.82),
    0 8px 24px rgba(0, 0, 0, 0.18);
}

.public-profile-milestone-mark.guild-founder-mark {
  display: grid;
  width: 36px;
  height: 40px;
  place-items: center;
  color: #1b1d14;
  background: linear-gradient(145deg, #ffe69a, #c7982d);
  clip-path: polygon(8% 0, 92% 0, 92% 72%, 50% 100%, 8% 72%);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-shadow: 0 1px rgba(255, 255, 255, 0.35);
}

.public-profile-milestone.guild-founder strong {
  color: #ffe69a;
}

.public-profile-milestone .public-profile-milestone-kicker {
  margin: 0 0 3px;
  color: #d9b95e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.public-profile-milestone strong,
.public-profile-milestone span,
.public-profile-milestone small {
  display: block;
}

.public-profile-milestone span,
.public-profile-milestone small {
  margin-top: 4px;
  color: #aeb5ab;
  font-size: 12px;
}

@media (max-width: 700px) {
  .home-identity-actions {
    align-items: stretch;
  }

  .public-character-profile-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .public-character-profile-content {
    padding: 14px;
  }

  .public-profile-hero,
  .public-profile-facts,
  .public-profile-build-columns {
    grid-template-columns: 1fr;
  }

  .public-profile-power {
    text-align: left;
  }

  .public-profile-stat-grid,
  .public-profile-stat-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .public-profile-record,
  .public-profile-equipment,
  .public-profile-professions {
    grid-template-columns: 1fr;
  }
}

.home-record-heading,
.home-record-official {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-record-heading > div {
  display: grid;
  gap: 2px;
}

.home-record-heading span,
.home-record-official span,
.home-record-modes span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.home-record-heading > div > span {
  color: var(--arena-bronze-bright);
  font-size: 11px;
}

.home-record-heading small {
  color: var(--muted);
  font-size: 9px;
}

.home-record-badge {
  padding: 4px 7px;
  border: 1px solid rgba(196, 154, 74, 0.28);
  border-radius: 999px;
}

.home-record-official {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(72px, 0.6fr));
  margin-top: 9px;
  padding: 9px 0;
  border-top: 1px solid rgba(200, 208, 198, 0.11);
  border-bottom: 1px solid rgba(200, 208, 198, 0.11);
}

.home-record-official > div,
.home-record-modes > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.home-record-official strong {
  color: #fff;
  font-size: 15px;
}

.home-record-modes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.home-record-modes strong {
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-record-empty {
  color: var(--muted);
  font-size: 11px;
}

.home-recovery-status {
  margin: -2px 0 0;
}

.home-battle-prep {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.home-battle-prep label {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-battle-prep select {
  width: 100%;
  min-width: 0;
}

.home-primary-actions {
  display: flex;
  gap: 8px;
}

.home-find-battle {
  min-width: 132px;
}

.home-matchmaking-status {
  margin: -6px 0 0;
}

.home-route-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.home-route-grid button {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  text-align: left;
}

.home-route-grid span {
  color: var(--text);
  font-weight: 900;
}

.home-route-grid small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-character-stage {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 540px;
  overflow: hidden;
  border-left: 1px solid rgba(196, 154, 74, 0.14);
  background:
    linear-gradient(90deg, rgba(8, 10, 9, 0.58), transparent 28%),
    radial-gradient(circle at 50% 31%, rgba(196, 154, 74, 0.20), transparent 37%);
}

.home-character-stage::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 54px;
  width: 82%;
  height: 36px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0,0,0,0.78), transparent 68%);
}

.home-character-aura {
  position: absolute;
  inset: 12% 7% 12%;
  border: 1px solid rgba(196, 154, 74, 0.14);
  border-radius: 50% 50% 42% 42%;
  box-shadow:
    inset 0 0 70px rgba(196, 154, 74, 0.07),
    0 0 80px rgba(196, 154, 74, 0.05);
}

.home-character-appearance {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.home-character-art,
.home-character-base,
.home-character-attachment {
  position: absolute;
  left: 50%;
  bottom: 20px;
  width: min(118%, 470px);
  height: 540px;
  object-fit: contain;
  object-position: 50% 100%;
}

.home-character-art {
  z-index: 20;
  transform: translateX(-50%);
  filter:
    brightness(1.03)
    saturate(0.9)
    contrast(1.04)
    drop-shadow(0 18px 14px rgba(0,0,0,0.7));
  animation: fighterPortraitIdle 4.4s ease-in-out infinite;
}

.home-character-base[hidden],
.home-character-art[hidden] {
  display: none;
}

.home-character-base {
  z-index: 20;
  transform: translateX(-50%);
  filter:
    brightness(1.03)
    saturate(0.9)
    contrast(1.04)
    drop-shadow(0 18px 14px rgba(0,0,0,0.7));
  animation: homeCharacterBodyIdle 4.4s ease-in-out infinite;
}

.home-character-attachment-stack {
  position: absolute;
  inset: 0;
}

.home-character-attachment {
  transform:
    translateX(-50%)
    translate(var(--layer-x, 0%), var(--layer-y, 0%))
    rotate(var(--layer-rotation, 0deg))
    scale(var(--layer-scale, 1));
  transform-origin: 50% 50%;
  filter:
    brightness(1.02)
    saturate(0.92)
    contrast(1.05)
    drop-shadow(0 12px 8px rgba(0,0,0,0.58));
}

.home-character-attachment.motion-body {
  animation: homeCharacterFittedAttachmentIdle 4.4s ease-in-out infinite;
}

.home-character-attachment.motion-weapon {
  animation: homeCharacterWeaponAttachmentIdle 4.4s ease-in-out infinite;
}

.home-character-caption {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: grid;
  min-width: 130px;
  padding: 9px 11px;
  border: 1px solid rgba(196, 154, 74, 0.28);
  border-radius: 9px;
  background: rgba(7, 9, 8, 0.82);
  text-align: right;
  backdrop-filter: blur(8px);
}

.home-character-caption span {
  color: var(--arena-bronze-bright);
  font-size: 13px;
  font-weight: 950;
}

.home-character-caption small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.home-battle-outcome {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-color: rgba(196, 154, 74, 0.32);
  background:
    radial-gradient(circle at 8% 0%, rgba(101, 212, 138, 0.09), transparent 34%),
    linear-gradient(135deg, rgba(24, 28, 24, 0.98), rgba(10, 12, 11, 0.98));
}

.home-battle-outcome[hidden] {
  display: none;
}

.home-battle-outcome[data-result="defeat"] {
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 120, 120, 0.09), transparent 34%),
    linear-gradient(135deg, rgba(28, 23, 23, 0.98), rgba(10, 12, 11, 0.98));
}

.home-outcome-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.home-outcome-heading h2 {
  margin: 0;
  color: #fffdf7;
  font-size: 26px;
}

.home-outcome-heading p {
  margin: 4px 0 0;
  color: var(--muted);
}

.home-outcome-dismiss {
  flex: 0 0 auto;
}

.home-outcome-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.home-outcome-facts > div {
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(120, 132, 122, 0.22);
  border-radius: 8px;
  background: rgba(5, 8, 7, 0.38);
}

.home-outcome-facts span,
.home-outcome-facts strong {
  display: block;
}

.home-outcome-facts span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-outcome-facts strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 12px;
}

.home-outcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.equipment-care-guide,
.maintenance-supply-guide {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(239, 196, 74, 0.45);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(71, 58, 22, 0.32), rgba(8, 12, 10, 0.72));
}

.equipment-care-guide[hidden] {
  display: none;
}

.equipment-care-copy h3,
.maintenance-supply-guide h3 {
  margin: 2px 0 4px;
}

.equipment-care-copy p,
.maintenance-supply-guide p {
  margin: 0;
  color: var(--muted);
}

.equipment-care-items {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.equipment-care-items li,
.maintenance-supply-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.equipment-care-items li {
  justify-content: space-between;
  padding: 8px 10px;
  border: 1px solid rgba(120, 132, 122, 0.28);
  border-radius: 8px;
  background: rgba(5, 8, 7, 0.45);
}

.equipment-care-items span,
.maintenance-supply-chain i {
  color: var(--muted);
}

.equipment-care-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slot[data-equipment-care-target="true"] {
  border-color: rgba(239, 196, 74, 0.85);
  box-shadow: 0 0 0 2px rgba(239, 196, 74, 0.16);
}

.maintenance-supply-guide {
  margin-top: 14px;
}

.maintenance-supply-chain span {
  padding: 6px 8px;
  border: 1px solid rgba(239, 196, 74, 0.28);
  border-radius: 999px;
  color: var(--text);
}

.home-dev-tools {
  padding: 0;
  border-color: rgba(120, 132, 122, 0.24);
  background: rgba(17, 20, 18, 0.88);
}

.home-dev-tools > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
}

.home-dev-tools > summary::-webkit-details-marker {
  display: none;
}

.home-dev-tools > summary > span:first-child {
  display: grid;
  gap: 3px;
}

.home-dev-tools > summary strong {
  color: var(--text);
  font-size: 13px;
}

.home-dev-tools > summary small {
  color: var(--muted);
  font-size: 10px;
}

.home-dev-toggle {
  flex: 0 0 auto;
  color: var(--arena-bronze-bright);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.home-dev-tools[open] .home-dev-toggle {
  font-size: 0;
}

.home-dev-tools[open] .home-dev-toggle::after {
  content: "Close diagnostics";
  font-size: 10px;
}

.home-dev-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 16px 16px;
  border-top: 1px solid rgba(120, 132, 122, 0.18);
}

.home-dev-section {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(120, 132, 122, 0.18);
  border-radius: 10px;
  background: rgba(6, 9, 8, 0.32);
}

.home-dev-section h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 12px;
}

.home-dev-section h3:not(:first-child) {
  margin-top: 18px;
}

.home-dev-nickname {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 10px;
}

.home-race-catalog {
  grid-column: 1 / -1;
}

.home-race-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.home-race-strip > div {
  position: relative;
  height: 150px;
  overflow: hidden;
  border: 1px solid rgba(196, 154, 74, 0.18);
  border-radius: 9px;
  background:
    radial-gradient(circle at 50% 30%, rgba(196, 154, 74, 0.12), transparent 42%),
    #0c100e;
}

.home-race-strip img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 100%;
  filter: drop-shadow(0 8px 8px rgba(0,0,0,0.58));
}

.home-race-strip strong {
  position: absolute;
  inset: auto 6px 6px;
  padding: 5px 6px;
  border-radius: 6px;
  background: rgba(5, 7, 6, 0.76);
  color: #fff;
  font-size: 10px;
  text-align: center;
}

@media (max-width: 980px) {
  .home-identity-shell {
    grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.65fr);
  }

  .home-identity-content {
    padding: 24px;
  }

  .home-resource-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-record-modes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-battle-prep {
    grid-template-columns: 1fr;
  }

  .home-primary-actions button {
    flex: 1 1 0;
  }

  .home-outcome-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .home-identity-shell {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .home-identity-content {
    grid-row: 1;
    gap: 13px;
    padding: 18px;
  }

  .home-character-stage {
    grid-row: 2;
    min-height: 220px;
    max-height: 220px;
    border-top: 1px solid rgba(196, 154, 74, 0.14);
    border-left: 0;
  }

  .home-character-art,
  .home-character-base,
  .home-character-attachment {
    bottom: -78px;
    width: min(76%, 300px);
    height: 340px;
  }

  .home-character-stage::after {
    bottom: 20px;
  }

  .home-character-caption {
    right: 10px;
    bottom: 10px;
  }

  .home-identity-heading h2 {
    font-size: clamp(28px, 11vw, 42px);
  }

  .home-character-line #overviewHeroSubtitle {
    flex-basis: 100%;
  }

  .home-vitals,
  .home-route-grid {
    grid-template-columns: 1fr;
  }

  .home-primary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-route-grid button {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
  }

  .home-dev-content {
    grid-template-columns: 1fr;
  }

  .home-outcome-actions button {
    flex: 1 1 140px;
  }

  .equipment-care-actions,
  .maintenance-supply-guide .world-action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .equipment-care-actions button,
  .maintenance-supply-guide .world-action-row button {
    width: 100%;
  }

  .home-medical-need {
    align-items: stretch;
    flex-direction: column;
  }

  .home-medical-need button {
    width: 100%;
  }

  .home-race-catalog {
    grid-column: auto;
  }

  .home-race-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .home-identity-heading {
    display: grid;
  }

  .home-readiness {
    max-width: 100%;
    justify-self: start;
  }

  .home-resource-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-dev-tools > summary {
    align-items: flex-start;
  }

  .home-dev-tools > summary small {
    display: none;
  }
}

.battle-shell {
  position: relative;
  overflow: hidden;
  border-color: rgba(196, 154, 74, 0.32);
  background:
    radial-gradient(circle at 50% -20%, rgba(196, 154, 74, 0.16), transparent 40%),
    linear-gradient(180deg, rgba(28, 29, 25, 0.98), rgba(12, 13, 12, 0.99));
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.battle-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(115deg, transparent 0 48%, rgba(255,255,255,0.025) 49%, transparent 50%),
    linear-gradient(65deg, transparent 0 48%, rgba(255,255,255,0.018) 49%, transparent 50%);
  background-size: 44px 44px;
}

.battle-hud-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 2px 2px 12px;
  padding: 0 4px;
}

.battle-hud-heading > div {
  display: grid;
  gap: 3px;
}

.battle-hud-heading strong {
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.battle-hud-kicker {
  color: var(--arena-bronze-bright);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.battle-hud-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(101, 212, 138, 0.34);
  border-radius: 999px;
  background: rgba(101, 212, 138, 0.08);
  color: #bff8d0;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.battle-hud-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--arena-player);
  box-shadow: 0 0 10px rgba(101, 212, 138, 0.72);
}

.battle-top {
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(0, 1fr) 126px minmax(0, 1fr);
  gap: 12px;
}

body.battle-focus .battle-top {
  grid-template-columns: minmax(0, 1fr) 126px minmax(0, 1fr);
}

.fighter {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
}

.fighter-frame {
  position: relative;
  min-height: 164px;
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(120, 132, 122, 0.42);
  border-radius: 14px;
  background:
    linear-gradient(110deg, rgba(255,255,255,0.055), transparent 38%),
    linear-gradient(180deg, rgba(39, 43, 38, 0.98), rgba(20, 22, 20, 0.98));
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.fighter-frame::before,
.fighter-frame::after {
  content: "";
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.fighter-frame::before {
  inset: 5px;
  border: 1px solid rgba(196, 154, 74, 0.14);
  border-radius: 10px;
}

.fighter-frame::after {
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, transparent, var(--arena-player) 28% 72%, transparent);
  filter: drop-shadow(0 0 8px rgba(101, 212, 138, 0.4));
}

.fighter-frame[data-relation="player"]::after {
  left: 0;
}

.fighter-frame[data-relation="opponent"]::after {
  right: 0;
  background: linear-gradient(180deg, transparent, var(--arena-rival) 28% 72%, transparent);
  filter: drop-shadow(0 0 8px rgba(255, 120, 120, 0.42));
}

.fighter-portrait-stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 34%, rgba(196, 154, 74, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(13, 18, 15, 0.72), rgba(4, 7, 5, 0.96));
}

.fighter-portrait-stage::after {
  content: "";
  position: absolute;
  inset: auto 8% 2px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0,0,0,0.72), transparent 68%);
}

.fighter-portrait {
  position: absolute;
  left: 50%;
  bottom: -28px;
  z-index: 1;
  width: 142px;
  height: 206px;
  object-fit: contain;
  object-position: 50% 100%;
  transform: translateX(-50%);
  filter:
    brightness(1.02)
    saturate(0.9)
    contrast(1.05)
    drop-shadow(0 8px 8px rgba(0,0,0,0.68));
  animation: fighterPortraitIdle 3.6s ease-in-out infinite;
}

.fighter-frame[data-relation="opponent"] .fighter-portrait {
  animation-delay: -1.7s;
}

.fighter-side-mark {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  padding: 5px 7px;
  border: 1px solid rgba(101, 212, 138, 0.38);
  border-radius: 999px;
  background: rgba(8, 16, 11, 0.86);
  color: #caffda;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.fighter-frame[data-relation="opponent"] .fighter-side-mark {
  border-color: rgba(255, 120, 120, 0.42);
  background: rgba(25, 8, 8, 0.86);
  color: #ffd0d0;
}

.fighter-frame-content {
  position: relative;
  z-index: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 18px 16px;
}

.fighter-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.fighter-eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fighter-name {
  margin: 0;
  color: #fffdf7;
  font-size: clamp(17px, 2vw, 23px);
  font-weight: 950;
  line-height: 1;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 12px rgba(0,0,0,0.46);
}

.fighter-health-state {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid rgba(101, 212, 138, 0.3);
  border-radius: 999px;
  color: #bff8d0;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fighter-frame[data-health="wounded"] .fighter-health-state,
.fighter-frame[data-health="critical"] .fighter-health-state,
.fighter-frame[data-health="down"] .fighter-health-state {
  border-color: rgba(255, 120, 120, 0.42);
  color: #ffc3c3;
}

.fighter-hp-readout {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}

.fighter-hp-readout span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.14em;
}

.fighter-hp-readout strong {
  color: #fff4f4;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.fighter-hp-track {
  position: relative;
  height: 12px;
  margin-top: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.52);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.55);
}

.fighter-hp-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 18%, rgba(0,0,0,0.24) 18.5% 19%);
}

.fighter-hp-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a5252d, #ef5b5b 58%, #ff9696);
  box-shadow: 0 0 13px rgba(239, 91, 91, 0.46);
  transition: width 280ms ease;
}

.fighter-loadout {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
}

.fighter-weapon,
.fighter-wound-count {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px;
  background: rgba(0,0,0,0.22);
  color: var(--arena-steel-bright);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fighter-weapon {
  flex: 1 1 auto;
}

.fighter-wound-count {
  flex: 0 0 auto;
}

.fighter-frame[data-health="wounded"] .fighter-wound-count,
.fighter-frame[data-health="critical"] .fighter-wound-count,
.fighter-frame[data-health="down"] .fighter-wound-count {
  border-color: rgba(255, 120, 120, 0.28);
  color: #ffc3c3;
}

.vs {
  align-content: center;
  color: var(--arena-bronze-bright);
}

.vs-mark {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(196, 154, 74, 0.58);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(196, 154, 74, 0.18), rgba(8, 10, 9, 0.94) 66%);
  color: var(--arena-bronze-bright);
  font-size: 18px;
  letter-spacing: 0.05em;
  box-shadow:
    0 0 0 5px rgba(196, 154, 74, 0.055),
    0 0 22px rgba(196, 154, 74, 0.14);
}

.battle-meta {
  grid-template-columns: 1fr;
  gap: 4px;
}

.battle-meta .stat {
  min-height: 38px;
  padding: 6px 8px;
  border-color: rgba(196, 154, 74, 0.15);
  background: rgba(0,0,0,0.18);
}

.battle-meta .label {
  font-size: 9px;
}

.battle-meta .value {
  font-size: 14px;
}

@keyframes fighterPortraitIdle {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(1); }
  50% { transform: translateX(-50%) translateY(-3px) scale(1.008); }
}

@keyframes homeCharacterBodyIdle {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(1); }
  50% { transform: translateX(-50%) translateY(-3px) scale(1.008); }
}

@keyframes homeCharacterFittedAttachmentIdle {
  0%, 100% {
    transform: translateX(-50%) translate(var(--layer-x), var(--layer-y)) rotate(var(--layer-rotation)) scale(var(--layer-scale));
  }
  50% {
    transform: translateX(-50%) translate(var(--layer-x), var(--layer-idle-y)) rotate(var(--layer-idle-rotation)) scale(var(--layer-idle-scale));
  }
}

@keyframes homeCharacterWeaponAttachmentIdle {
  0%, 100% {
    transform: translateX(-50%) translate(var(--layer-x), var(--layer-y)) rotate(var(--layer-rotation)) scale(var(--layer-scale));
  }
  50% {
    transform: translateX(-50%) translate(var(--layer-x), var(--layer-idle-y)) rotate(var(--layer-idle-rotation)) scale(var(--layer-idle-scale));
  }
}

@media (prefers-reduced-motion: reduce) {
  .fighter-portrait,
  .home-character-art,
  .home-character-base,
  .home-character-attachment {
    animation: none;
  }
}

@media (max-width: 980px) {
  .battle-top {
    grid-template-columns: minmax(0, 1fr) 88px minmax(0, 1fr);
    gap: 8px;
  }

  body.battle-focus .battle-top {
    grid-template-columns: minmax(0, 1fr) 88px minmax(0, 1fr);
  }

  .fighter-frame {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .fighter-portrait {
    width: 112px;
    height: 180px;
  }

  .fighter-frame-content {
    padding: 14px 12px;
  }

  .fighter-health-state {
    display: none;
  }

  .fighter-loadout {
    align-items: stretch;
    flex-direction: column;
    gap: 5px;
  }

  .fighter-wound-count {
    align-self: flex-start;
  }
}

@media (max-width: 820px) {
  .battle-top {
    grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
  }

  body.battle-focus .battle-top {
    grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
  }

  .fighter-frame {
    min-height: 148px;
    grid-template-columns: 1fr;
  }

  .fighter-portrait-stage {
    position: absolute;
    inset: 0;
    opacity: 0.38;
  }

  .fighter-portrait {
    left: auto;
    right: -16px;
    width: 126px;
    height: 180px;
    transform: none;
    animation-name: fighterPortraitIdleMobile;
  }

  .fighter-frame[data-relation="opponent"] .fighter-portrait {
    left: -16px;
    right: auto;
  }

  .fighter-frame-content {
    min-height: 148px;
    justify-content: flex-end;
    padding: 40px 10px 11px;
    background: linear-gradient(180deg, transparent, rgba(7,9,8,0.84) 46%);
  }

  .fighter-title-row {
    display: block;
  }

  .fighter-name {
    font-size: 15px;
  }

  .fighter-eyebrow {
    font-size: 8px;
  }

  .fighter-hp-readout {
    margin-top: 10px;
  }

  .fighter-loadout {
    display: none;
  }

  .fighter-side-mark {
    font-size: 8px;
  }

  .vs {
    align-content: center;
  }

  .vs-mark {
    width: 42px;
    height: 42px;
    font-size: 14px;
  }

  .battle-meta .stat {
    min-height: 34px;
    padding: 5px 4px;
  }

  .battle-meta .label {
    font-size: 8px;
  }

  .battle-meta .value {
    font-size: 11px;
  }
}

@keyframes fighterPortraitIdleMobile {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.008); }
}

@media (max-width: 520px) {
  .battle-hud-heading strong {
    font-size: 11px;
  }

  .battle-hud-live {
    padding: 6px 8px;
    font-size: 8px;
  }

  .battle-top {
    gap: 5px;
  }

  .fighter-frame {
    min-height: 138px;
  }

  .fighter-frame-content {
    min-height: 138px;
    padding: 37px 8px 9px;
  }

  .fighter-portrait {
    width: 108px;
    height: 162px;
  }

  .fighter-name {
    font-size: 13px;
  }

  .fighter-eyebrow {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .fighter-hp-readout strong {
    font-size: 11px;
  }

  .fighter-hp-track {
    height: 9px;
  }

  .vs-mark {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }

  .battle-meta .stat {
    min-height: 31px;
  }
}

/* Battle Focus Phase B: truthful team rosters and a viewport-owned workspace. */
.battle-shell .team-lanes[hidden] {
  display: none !important;
}

.battle-shell .team-lanes {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.battle-shell .team-stack,
.battle-shell .team-stack.red {
  min-width: 0;
  display: grid;
  grid-column: auto;
  gap: 5px;
}

.team-roster-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.team-roster-heading strong {
  color: var(--text);
  font-size: 11px;
}

.team-stack.blue .team-roster-heading strong {
  color: #bff8d0;
}

.team-stack.red .team-roster-heading strong {
  color: #ffd0d0;
}

.team-roster-scroll {
  min-width: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(156px, 1fr);
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 154, 74, 0.46) rgba(0, 0, 0, 0.18);
  padding: 1px 1px 5px;
}

.battle-shell .team-unit {
  position: relative;
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid rgba(120, 132, 122, 0.34);
  border-radius: 9px;
  background: rgba(15, 17, 15, 0.88);
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.battle-shell .team-unit.blue {
  border-color: rgba(101, 212, 138, 0.32);
}

.battle-shell .team-unit.red {
  border-color: rgba(255, 120, 120, 0.32);
}

.battle-shell .team-unit:hover,
.battle-shell .team-unit:focus-visible {
  background: rgba(42, 44, 39, 0.96);
  outline: none;
}

.battle-shell .team-unit.inspected {
  border-color: var(--arena-bronze-bright);
  box-shadow: 0 0 0 1px rgba(241, 203, 117, 0.22) inset;
}

.battle-shell .team-unit.targeted {
  padding-right: 48px;
}

.battle-shell .team-unit.down {
  opacity: 0.58;
}

.battle-shell .team-unit-copy,
.battle-shell .team-unit-name,
.battle-shell .team-unit-meta,
.battle-shell .team-unit-hp {
  display: block;
  min-width: 0;
}

.battle-shell .team-unit-meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.battle-shell .team-unit-target {
  position: absolute;
  right: 6px;
  top: 6px;
  padding: 2px 4px;
  border: 1px solid rgba(241, 203, 117, 0.4);
  border-radius: 999px;
  color: var(--arena-bronze-bright);
  font-size: 7px;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@media (min-width: 821px) {
  body.battle-focus[data-game-screen="battle"] .app {
    width: min(1760px, calc(100vw - 16px));
    padding: 6px 0 8px;
  }

  body.battle-focus[data-game-screen="battle"] header {
    min-height: 38px;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: nowrap;
  }

  body.battle-focus[data-game-screen="battle"] header h1 {
    margin: 0;
    font-size: 19px;
  }

  body.battle-focus[data-game-screen="battle"] header .screen-tabs,
  body.battle-focus[data-game-screen="battle"] header .version,
  body.battle-focus[data-game-screen="battle"] #identityShell,
  body.battle-focus[data-game-screen="battle"] #battleResultPanel {
    display: none !important;
  }

  body.battle-focus[data-game-screen="battle"] .battle-shell {
    padding: 8px;
  }

  body.battle-focus[data-game-screen="battle"] .battle-hud-heading {
    min-height: 26px;
    margin: 0 2px 7px;
  }

  body.battle-focus[data-game-screen="battle"] .battle-hud-heading strong {
    font-size: 11px;
  }

  body.battle-focus[data-game-screen="battle"] .battle-hud-live {
    padding: 5px 8px;
    font-size: 8px;
  }

  body.battle-focus[data-game-screen="battle"] .fighter-frame {
    min-height: 126px;
    grid-template-columns: 102px minmax(0, 1fr);
  }

  body.battle-focus[data-game-screen="battle"] .fighter-portrait {
    width: 122px;
    height: 176px;
    bottom: -24px;
  }

  body.battle-focus[data-game-screen="battle"] .fighter-frame-content {
    padding: 11px 13px 10px;
  }

  body.battle-focus[data-game-screen="battle"] .fighter-name {
    font-size: clamp(16px, 1.5vw, 21px);
  }

  body.battle-focus[data-game-screen="battle"] .fighter-hp-readout {
    margin-top: 8px;
  }

  body.battle-focus[data-game-screen="battle"] .fighter-loadout {
    margin-top: 7px;
  }

  body.battle-focus[data-game-screen="battle"] .team-lanes {
    margin-top: 7px;
  }

  body.battle-focus[data-game-screen="battle"] .battle-scene {
    height: 418px;
    min-height: 418px;
    margin-top: 7px;
  }

  body.battle-focus[data-game-screen="battle"] .scene-distance {
    top: 9px;
  }

  body.battle-focus[data-game-screen="battle"] .battle-phase {
    top: 25px;
    padding: 5px 10px;
  }

  body.battle-focus[data-game-screen="battle"] .battle-plan {
    top: 54px;
    width: min(650px, calc(100% - 24px));
  }

  body.battle-focus[data-game-screen="battle"] .mode-hint {
    top: 102px;
  }

  body.battle-focus[data-game-screen="battle"] .hex-field {
    top: 118px;
    transform: translateX(-50%) scale(0.76);
    transform-origin: top center;
  }

  body.battle-focus[data-game-screen="battle"] .battle-tabs {
    top: 298px;
  }

  body.battle-focus[data-game-screen="battle"] .combatant {
    top: 174px;
    width: 218px;
  }

  body.battle-focus[data-game-screen="battle"] .combatant.player {
    left: 5%;
  }

  body.battle-focus[data-game-screen="battle"] .combatant.bot {
    right: 5%;
  }

  body.battle-focus[data-game-screen="battle"] .body-figure {
    grid-template-columns: repeat(5, 34px);
    grid-template-rows: repeat(5, 34px);
    gap: 4px;
  }

  body.battle-focus[data-game-screen="battle"] .battle-controls {
    margin-top: 7px;
  }
}

@media (max-width: 820px) {
  .battle-shell .team-lanes {
    grid-template-columns: 1fr;
  }

  .team-roster-scroll {
    grid-auto-columns: minmax(144px, 74vw);
  }
}

.mobile-battle-workspaces,
.mobile-battle-director,
.mobile-sheet-close,
.body-zone-remove {
  display: none;
}

.battle-result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

@media (max-width: 820px) {
  body.mobile-battle-command {
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  body.mobile-battle-command .app {
    width: 100%;
    padding: env(safe-area-inset-top) 8px 0;
  }

  body.mobile-battle-command header,
  body.mobile-battle-command #identityShell {
    display: none !important;
  }

  body.mobile-battle-command .battle-shell {
    min-height: calc(100vh - 78px);
    min-height: calc(100dvh - 78px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    margin: 0;
    padding: 7px;
    border-radius: 12px;
  }

  body.mobile-battle-command .battle-hud-heading {
    min-height: 24px;
    margin: 0 1px 6px;
  }

  body.mobile-battle-command .battle-hud-heading > div > span,
  body.mobile-battle-command .battle-hud-heading > div > strong {
    display: none;
  }

  body.mobile-battle-command .battle-hud-live {
    padding: 5px 8px;
    font-size: 8px;
  }

  body.mobile-battle-command .battle-top {
    grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr);
    gap: 5px;
  }

  body.mobile-battle-command .fighter-frame {
    min-height: 116px;
    grid-template-columns: minmax(0, 1fr);
    border-radius: 11px;
  }

  body.mobile-battle-command .fighter-portrait-stage {
    min-height: 116px;
  }

  body.mobile-battle-command .fighter-portrait {
    width: 82px;
    height: 130px;
    bottom: -10px;
  }

  body.mobile-battle-command .fighter-frame-content {
    min-height: 116px;
    padding: 36px 9px 9px;
    background: linear-gradient(180deg, transparent, rgba(7, 9, 8, 0.88) 45%);
  }

  body.mobile-battle-command .fighter-kicker,
  body.mobile-battle-command .fighter-loadout {
    display: none;
  }

  body.mobile-battle-command .fighter-name {
    margin-top: 0;
    font-size: clamp(13px, 4.2vw, 17px);
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: normal;
  }

  body.mobile-battle-command .fighter-hp-readout {
    margin-top: 8px;
    gap: 4px;
    font-size: 9px;
  }

  body.mobile-battle-command .fighter-hp-track {
    height: 8px;
  }

  body.mobile-battle-command .battle-versus {
    gap: 4px;
  }

  body.mobile-battle-command .versus-medallion {
    width: 42px;
    height: 42px;
    font-size: 14px;
  }

  body.mobile-battle-command .versus-stat {
    min-height: 31px;
    padding: 3px 2px;
    font-size: 8px;
  }

  body.mobile-battle-command .versus-stat strong {
    font-size: 11px;
  }

  body.mobile-battle-command .team-lanes {
    margin-top: 5px;
  }

  body.mobile-battle-command .battle-scene,
  body.mobile-battle-command.display-compact .battle-scene {
    height: 500px;
    min-height: 500px;
    margin-top: 6px;
  }

  body.mobile-battle-command .scene-distance {
    top: 7px;
  }

  body.mobile-battle-command .battle-phase {
    top: 25px;
    padding: 4px 10px;
  }

  body.mobile-battle-command .battle-plan,
  body.mobile-battle-command.display-compact .battle-plan {
    top: 54px;
    width: calc(100% - 12px);
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  body.mobile-battle-command .plan-pill {
    min-height: 31px;
    padding: 4px 6px;
  }

  body.mobile-battle-command .plan-pill .label {
    font-size: 8px;
  }

  body.mobile-battle-command .plan-pill .value {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.mobile-battle-command .mobile-battle-workspaces {
    position: absolute;
    z-index: 8;
    top: 126px;
    left: 6px;
    right: 6px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }

  body.mobile-battle-command .mobile-battle-workspaces button {
    min-width: 0;
    min-height: 44px;
    padding: 7px 5px;
  }

  body.mobile-battle-command .mobile-battle-workspaces button.active {
    border-color: var(--arena-bronze-bright);
    color: var(--arena-bronze-bright);
    box-shadow: 0 0 0 1px rgba(241, 203, 117, 0.2) inset;
  }

  body.mobile-battle-command .mode-hint,
  body.mobile-battle-command.display-compact .mode-hint {
    top: 176px;
    width: calc(100% - 18px);
    font-size: 10px;
    line-height: 1.2;
  }

  body.mobile-battle-command .hex-field,
  body.mobile-battle-command.display-compact .hex-field {
    top: 205px;
    grid-template-columns: repeat(7, 36px);
    grid-auto-rows: 31px;
    gap: 5px;
    padding: 12px 14px;
    transform: translateX(-50%);
  }

  body.mobile-battle-command .battle-tabs,
  body.mobile-battle-command.display-compact .battle-tabs {
    top: 438px;
    width: min(330px, calc(100% - 18px));
    justify-content: center;
  }

  body.mobile-battle-command .battle-tabs button {
    min-height: 44px;
  }

  body.mobile-battle-command .combatant,
  body.mobile-battle-command.display-compact .combatant {
    top: 205px;
    left: 50%;
    right: auto;
    width: 286px;
    transform: translateX(-50%);
  }

  body.mobile-battle-command .body-figure,
  body.mobile-battle-command.display-compact .body-figure {
    grid-template-columns: repeat(5, 44px);
    grid-template-rows: repeat(5, 44px);
    gap: 6px;
  }

  body.mobile-battle-command .combatant-label {
    margin-bottom: 5px;
    font-size: 14px;
  }

  body.mobile-battle-command .body-zone-remove {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    border-radius: 50%;
    font-size: 15px;
    line-height: 1;
    touch-action: manipulation;
  }

  body.mobile-battle-command .body-zone-remove {
    position: absolute;
    z-index: 5;
    left: -31px;
    bottom: -31px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 120, 120, 0.8);
    background: #2a1d1d;
    color: #ff9b9b;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.45);
  }

  body.mobile-battle-command #battleScene:not([data-mobile-workspace]) .combatant,
  body.mobile-battle-command #battleScene[data-mobile-workspace="field"] .combatant,
  body.mobile-battle-command #battleScene[data-mobile-workspace="attack"] .combatant.player,
  body.mobile-battle-command #battleScene[data-mobile-workspace="defense"] .combatant.bot {
    display: none;
  }

  body.mobile-battle-command #battleScene[data-mobile-workspace="attack"] .hex-field,
  body.mobile-battle-command #battleScene[data-mobile-workspace="attack"] .battle-tabs,
  body.mobile-battle-command #battleScene[data-mobile-workspace="defense"] .hex-field,
  body.mobile-battle-command #battleScene[data-mobile-workspace="defense"] .battle-tabs {
    display: none;
  }

  body.mobile-battle-command #battleScene[data-mobile-workspace="attack"] .combatant.bot,
  body.mobile-battle-command #battleScene[data-mobile-workspace="defense"] .combatant.player {
    display: block;
  }

  body.mobile-battle-command #battleScene:not([data-mobile-workspace]) .hex-field,
  body.mobile-battle-command #battleScene[data-mobile-workspace="field"] .hex-field {
    display: grid;
  }

  body.mobile-battle-command #battleScene:not([data-mobile-workspace]) .battle-tabs,
  body.mobile-battle-command #battleScene[data-mobile-workspace="field"] .battle-tabs {
    display: flex;
  }

  body.mobile-battle-command .battle-controls {
    margin-top: 0;
    display: block;
  }

  body.mobile-battle-command .battle-controls .panellet,
  body.mobile-battle-command .desktop-battle-log {
    display: none;
  }

  body.mobile-battle-command .battle-actions {
    position: fixed;
    z-index: 70;
    left: 0;
    right: 0;
    bottom: 0;
    grid-template-columns: 1.35fr 1fr 1fr;
    gap: 6px;
    padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid rgba(196, 154, 74, 0.55);
    background: rgba(12, 14, 12, 0.97);
    box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.48);
  }

  body.mobile-battle-command .battle-actions button {
    min-width: 0;
    min-height: 48px;
    padding: 8px 5px;
    touch-action: manipulation;
  }

  body.mobile-battle-command .battle-actions .primary {
    grid-column: auto;
  }

  body.mobile-battle-command .mobile-battle-director {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body.mobile-battle-command #leavePvpButton[style*="display: none"] {
    display: none !important;
  }

  body.mobile-battle-command #leavePvpButton:not([style*="display: none"]) {
    grid-column: 1 / -1;
  }

  body.mobile-battle-command .zone-equipment-card {
    position: fixed;
    z-index: 90;
    left: 8px;
    right: 8px;
    bottom: calc(70px + env(safe-area-inset-bottom));
    max-height: min(68vh, 68dvh);
    margin: 0;
    overflow: auto;
    border-color: rgba(241, 203, 117, 0.65);
    box-shadow: 0 -12px 38px rgba(0, 0, 0, 0.72);
  }

  body.mobile-battle-command .zone-equipment-close,
  body.mobile-battle-command .mobile-sheet-close {
    min-width: 44px;
    min-height: 44px;
  }

  body.mobile-battle-command #battleResultPanel {
    position: fixed;
    z-index: 100;
    left: 8px;
    right: 8px;
    bottom: calc(70px + env(safe-area-inset-bottom));
    max-height: min(75vh, 75dvh);
    margin: 0;
    overflow: auto;
    border-color: rgba(241, 203, 117, 0.65);
    box-shadow: 0 -14px 44px rgba(0, 0, 0, 0.78);
  }

  body.mobile-battle-command #battleResultPanel:not(.mobile-open) {
    display: none !important;
  }

  body.mobile-battle-command #battleResultPanel.mobile-open {
    display: block !important;
  }

  body.mobile-battle-command .mobile-sheet-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 22px;
  }
}
