.drawer.pvp-drawer {
  width: min(calc(720px + var(--ui-nav-rail-size)), 100%);
}
.pvp-drawer .drawer-panel {
  container: pvp / inline-size;
}
.icon-pvp {
  --ui-icon: url("/_assets/b88d45443fa2dbfe501f/icons/swords.svg");
}
.chat-player-profile-actions:has([data-player-profile-challenge]) {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pvp {
  color: var(--ui-color-text);
  font: 14px/1.4 var(--ui-font-body);
}
.pvp [hidden],
.pvp-banner[hidden],
.pvp-banner [hidden],
.pvp-team-dialog [hidden] {
  display: none !important;
}
.pvp h3 {
  margin: 0;
  font: 28px/1.1 var(--ui-font-display);
}
.pvp p {
  margin: var(--ui-space-2) 0;
}
.pvp-topline,
.pvp-search-row,
.pvp-actions {
  display: flex;
  align-items: center;
  gap: var(--ui-space-2);
}
.pvp-topline,
.pvp-search-row {
  justify-content: space-between;
}
.pvp-topline > div {
  min-width: 0;
}
.pvp-actions {
  flex-wrap: wrap;
}
.pvp-status[data-tone="danger"] {
  color: var(--ui-color-danger);
}
.pvp input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--ui-color-border);
  border-radius: var(--ui-radius);
  background: var(--ui-color-surface);
  color: var(--ui-color-text);
  padding: var(--ui-space-2);
  font: inherit;
}
.pvp input:focus-visible,
.pvp button:focus-visible,
.pvp-team-dialog button:focus-visible {
  outline: 2px solid var(--ui-color-primary);
  outline-offset: 2px;
}
.pvp-search-fields {
  display: flex;
  gap: var(--ui-space-2);
  margin-top: var(--ui-space-1);
}
.pvp-search-row {
  padding: var(--ui-space-2) 0;
  border-bottom: 1px solid var(--ui-color-border);
}
.pvp-search-row strong {
  overflow-wrap: anywhere;
}
.pvp-invitation {
  margin: var(--ui-space-3) 0;
}
.pvp-topline > label {
  font-weight: 700;
}
.pvp-search-results-section {
  margin-top: var(--ui-space-4);
}
.pvp .pvp-search-results-section > h3 {
  font: 18px/1.2 var(--ui-font-display);
}
.pvp-friends {
  margin-top: var(--ui-space-5, 24px);
}
.pvp-friends-heading {
  display: flex;
  align-items: center;
  gap: var(--ui-space-2);
  border-bottom: 1px solid var(--ui-color-border);
  padding-bottom: var(--ui-space-2);
}
.pvp .pvp-friends-heading h3 {
  font: 24px/1.1 var(--ui-font-display);
}
.pvp-friends-heading > span {
  color: var(--ui-color-text-muted);
  font-size: 12px;
}
.pvp-friend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-3);
  padding: var(--ui-space-3) 0;
  border-bottom: 1px solid var(--ui-color-border-subtle);
  min-width: 0;
}
.pvp-friend-outfit {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 44px;
}
.pvp-friend-outfit canvas {
  display: block;
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
}
.pvp-friend-outfit canvas[data-ready="false"] {
  visibility: hidden;
}
.pvp-friend-identity {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.pvp-friend-identity > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.pvp-friend-identity > span {
  color: var(--ui-color-text-muted);
  font-size: 12px;
}
.pvp-friend-actions {
  display: flex;
  align-items: center;
  gap: var(--ui-space-2);
  flex-shrink: 0;
}
.pvp-friend-presence {
  min-width: 45px;
  justify-content: center;
}
.pvp-friend-actions > .ui-button {
  min-height: 36px;
}
.pvp-team-dialog {
  width: min(720px, calc(100vw - 24px));
}
.pvp-team-dialog h2 {
  margin: 0;
  font: 28px/1.1 var(--ui-font-display);
}
.pvp-team-selected {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ui-space-2);
  margin: var(--ui-space-3) 0;
}
.pvp-team-picked,
.pvp-team-vacancy {
  display: flex;
  align-items: center;
  gap: var(--ui-space-1);
  min-height: 48px;
  min-width: 0;
  padding: var(--ui-space-1);
  border: 1px solid var(--ui-color-border);
  color: var(--ui-color-text);
  background: var(--ui-color-surface);
  font: 12px/1.3 var(--ui-font-body);
}
.pvp-team-picked > img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
}
.pvp-team-picked > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pvp-team-picked b {
  margin-left: auto;
  color: var(--ui-color-primary);
}
.pvp-team-vacancy {
  color: var(--ui-color-text-muted);
}
.pvp-team-dialog > .pvp-team-choices {
  flex: 0 1 auto;
  max-height: 370px;
}
.pvp-team-choice {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  column-gap: var(--ui-space-2);
  min-width: 0;
  min-height: 78px;
  padding: var(--ui-space-2);
  border-left: 2px solid var(--quality-color, var(--ui-color-border));
}
.pvp-team-choice[data-selected="true"] {
  box-shadow: inset 0 0 0 1px var(--ui-color-primary);
  background: var(--ui-color-surface-control);
}
.pvp-team-choice:focus-within {
  outline: 2px solid var(--ui-color-focus);
}
.pvp-team-choice > input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--ui-color-action);
}
.pvp-team-choice > input:disabled {
  opacity: 0.45;
}
.pvp-team-entry {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--ui-space-2);
  min-width: 0;
}
.pvp-team-entry .depot-sprite {
  display: grid;
  place-items: center;
  width: 40px;
  height: 44px;
}
.pvp-team-entry .depot-sprite img {
  width: 36px;
  height: 36px;
  image-rendering: pixelated;
  object-fit: contain;
}
.pvp-team-entry .depot-identity {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.pvp-team-entry .depot-identity > strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.pvp-team-entry .depot-identity > strong > small {
  color: var(--ui-color-text-muted);
  font-size: 11px;
  white-space: nowrap;
}
.pvp-team-entry .team-quality-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-2);
  font-size: 11px;
}
.pvp-team-entry .depot-metrics {
  font-size: 12px;
  text-align: right;
}
.pvp-team-entry .team-power-metric {
  display: grid;
}
.pvp-team-entry .team-power-metric small {
  font-size: 10px;
  color: var(--ui-color-text-muted);
}
.pvp-team-unavailable {
  grid-column: 2;
  color: var(--ui-color-text-muted);
  font-size: 11px;
}
.pvp-banner {
  position: fixed;
  z-index: 105;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-3);
  width: min(660px, calc(100% - 24px));
  border: 1px solid var(--ui-color-primary);
  border-radius: var(--ui-radius);
  background: var(--ui-color-surface);
  color: var(--ui-color-text);
  padding: var(--ui-space-3);
  box-shadow: 0 8px 24px #0008;
  font: 14px/1.3 var(--ui-font-body);
}
.pvp-banner-copy {
  display: grid;
  gap: var(--ui-space-1);
}

/* One existing chat controller follows the player into a friendly PvP room. */
.chat-room-heading {
  flex: none;
  margin: 0;
  padding: 6px 9px;
  border-bottom: 1px solid var(--ui-color-border-subtle);
  color: var(--ui-color-text-muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}
#game-chat[data-collapsed="true"] .chat-room-heading { display: none; }
:root .pvp-chat-mode #game-shell #game-chat {
  display: flex !important;
  flex-direction: column;
  visibility: visible !important;
  left: auto !important;
  right: 12px !important;
  top: var(--pvp-chat-top, 360px) !important;
  bottom: auto !important;
  width: 320px;
  --chat-expanded-height: max(180px, calc(100dvh - var(--pvp-chat-top, 360px) - 12px)) !important;
  height: var(--chat-expanded-height);
  max-height: calc(100dvh - var(--navbar-height, 76px) - 70px) !important;
  transform: none !important;
  transition: none;
}
:root .pvp-chat-mode #game-shell #game-chat[data-collapsed="true"] {
  height: calc(var(--chat-header-height) + 2px);
}
.pvp-chat-mode #game-chat .hud-drag-handle { display: none; }
.pvp-chat-mode #game-chat .chat-channel-panel { flex: 1; height: auto; }
:root .pvp-chat-mode #game-shell #game-chat[data-picker-open="true"] {
  top: calc(var(--navbar-height, 76px) + 12px) !important;
  bottom: auto !important;
  right: 12px !important;
  width: min(560px, calc(100vw - 24px));
  height: min(640px, calc(100dvh - var(--navbar-height, 76px) - 24px)) !important;
  max-height: calc(100dvh - var(--navbar-height, 76px) - 24px) !important;
  z-index: 60;
}
@media (min-width: 960px) {
  .pvp-chat-mode .gym-status-card {
    top: calc(var(--navbar-height, 76px) + 12px);
    bottom: auto;
    width: 320px;
    max-height: min(46dvh, calc(100dvh - var(--navbar-height, 76px) - 220px));
    overflow-y: auto;
  }
  .pvp-chat-mode .gym-status-card #gym-opponent {
    overflow-wrap: anywhere;
    font-size: 24px;
  }
  .pvp-chat-mode .bottom-tools { right: 344px; }
}
@media (max-width: 959px) {
  :root .pvp-chat-mode #game-shell #game-chat {
    right: 8px !important;
    top: auto !important;
    bottom: 8px !important;
    width: min(380px, calc(100vw - 16px));
    --chat-expanded-height: min(320px, calc(100dvh - var(--navbar-height, 76px) - 90px)) !important;
    z-index: 47;
  }
  .pvp-chat-mode .bottom-tools { bottom: 52px; }
  .pvp-chat-mode .gym-status-card { bottom: calc(60px + var(--gym-hotbar-height, 88px)); }
  .pvp-chat-mode #game-chat button { min-height: 36px; }
}
.pvp-banner-copy span {
  color: var(--ui-color-text-muted);
  font-size: 12px;
}
#nav-pvp {
  position: relative;
}
@media (max-width: 480px) {
  .pvp-topline {
    align-items: flex-start;
  }
  .pvp-team-selected {
    gap: 4px;
  }
  .pvp-team-picked {
    flex-wrap: wrap;
  }
  .pvp-team-picked > span {
    font-size: 11px;
  }
  .pvp-team-vacancy {
    font-size: 11px;
  }
  .pvp-team-entry {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: var(--ui-space-1);
  }
}
