.bug-battle-offer-slot {
  min-height: 66px;
  margin: 4px 0;
}
.bug-battle-offer-slot[hidden],
.profile-view > .bug-battle-offer-slot,
.bug-battle-offer[hidden],
.bug-battle-dialog [hidden] {
  display: none !important;
}
.bug-battle-offer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 6px 10px;
  border: 1px solid #db797b;
  border-radius: 14px;
  background: #301f30;
}
.bug-battle-offer div {
  flex: 1;
  min-width: 0;
}
.battle-offer-bug {
  display: flex;
  flex-direction: column;
  flex: none;
  gap: 5px;
  padding-top: 6px;
}
.battle-offer-health {
  display: flex;
  gap: 2px;
}
.battle-offer-health i {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #ff6877;
}
.bug-battle-offer strong {
  display: block;
  font-size: 13px;
  color: #ffe5af;
}
.bug-battle-offer small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #d2bfcb;
}
.bug-battle-offer button,
.battle-controls button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #ffe49e;
  border-radius: 12px;
  background: #ffe49e;
  color: #192c3a;
  font: 700 14px/1.3 inherit;
  cursor: pointer;
}
.bug-battle-offer button:disabled,
.battle-controls button:disabled {
  opacity: 0.55;
  cursor: default;
}
.battle-bug {
  display: inline-block;
  flex: none;
  width: 32px;
  height: 30px;
  border-radius: 45% 45% 42% 42%;
  background: #f4505b;
  box-shadow: inset -5px -4px #b52948;
  position: relative;
}
.battle-bug::before,
.battle-bug::after {
  content: "";
  position: absolute;
  top: -6px;
  width: 3px;
  height: 10px;
  background: #ffb0ad;
  border-radius: 2px;
}
.battle-bug::before {
  left: 6px;
  rotate: -30deg;
}
.battle-bug::after {
  right: 6px;
  rotate: 30deg;
}
.battle-bug i {
  position: absolute;
  left: 7px;
  top: 9px;
  width: 5px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 11px 0 #fff;
}
.bug-battle-dialog {
  width: min(520px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  box-sizing: border-box;
  overflow: auto;
  padding: 20px;
  border: 1px solid #9a6577;
  border-radius: 24px;
  background: #102736;
  color: #eaffff;
  box-shadow: 0 20px 90px #000b;
  font-family: inherit;
}
.bug-battle-dialog::backdrop {
  background: #03131ce6;
}
.battle-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}
.battle-heading div {
  flex: 1;
}
.battle-heading p {
  margin: 0 0 5px;
  color: #f5a9b5;
  font-size: 10px;
  letter-spacing: 0.12em;
}
.battle-heading h2 {
  margin: 0;
  font-size: clamp(19px, 5vw, 25px);
  line-height: 1.15;
}
#bugBattleTimer {
  white-space: nowrap;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.battle-health {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}
.battle-health span {
  flex: 1;
  height: 9px;
  background: #ff6877;
  border-radius: 5px;
}
.battle-health .lost {
  background: #2c4350;
}
#bugBattleHits {
  margin: 12px 0;
  color: #9cf3d2;
  font-weight: 700;
  min-height: 24px;
}
.hit-accepted #bugBattleHits {
  color: #fff;
  background: #267451;
  box-shadow: 0 0 0 4px #267451;
  border-radius: 4px;
}
.battle-intro strong {
  color: #ffe49e;
  font-size: 16px;
}
.battle-intro p {
  font-size: 14px;
  line-height: 1.5;
  color: #bdd0d9;
}
.battle-intro label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.battle-intro select {
  min-height: 44px;
  border: 1px solid #718b98;
  border-radius: 8px;
  background: #1d3949;
  color: #fff;
  padding: 8px;
  font: inherit;
}
.battle-pad {
  width: 100%;
  min-height: 160px;
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  background: #1d3949;
  border: 3px solid #647686;
  border-radius: 22px;
  cursor: grab;
}
.battle-pad.is-open {
  border-color: #ffe891;
  background: #345440;
}
.battle-arrow {
  font: 700 74px/0.95 system-ui;
  color: #d2deea;
}
.is-open .battle-arrow {
  color: #fff0ae;
}
#bugBattleCue {
  font-size: 15px;
  padding: 0 10px;
  text-align: center;
}
.battle-beat {
  height: 4px;
  width: calc(100% - 40px);
  background: #0004;
  margin-top: 12px;
}
.battle-beat i {
  display: block;
  width: calc(var(--beat-progress, 0) * 100%);
  height: 100%;
  background: #ffe49e;
}
#bugBattleBalance {
  margin: 14px 0;
  font-size: 13px;
  color: #bfd2da;
  min-height: 20px;
}
.battle-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.battle-controls button {
  flex: 1;
}
#bugBattleDecline {
  color: #cce8ed;
  background: #1d3949;
  border-color: #607f8d;
}
.bug-battle-dialog :focus-visible,
.bug-battle-offer :focus-visible {
  outline: 3px solid #8eeefe;
  outline-offset: 3px;
}
@media (max-width: 360px) {
  .bug-battle-dialog {
    padding: 12px;
  }
  .bug-battle-offer {
    gap: 7px;
    padding: 6px;
  }
  .bug-battle-offer strong {
    font-size: 12px;
  }
  .bug-battle-offer .battle-bug {
    width: 26px;
  }
}
@media (max-height: 450px) {
  .bug-battle-dialog {
    padding: 12px;
  }
  .battle-health {
    margin-top: 10px;
  }
  .battle-pad {
    min-height: 128px;
  }
  .battle-arrow {
    font-size: 54px;
  }
  #bugBattleHits,
  #bugBattleBalance {
    margin: 6px 0;
  }
}
@media (min-width: 600px) and (max-height: 500px) {
  .coach-card:not(.profile-view) > .bug-battle-offer-slot {
    grid-area: 5 / 1;
  }
}
