.brawler-page {
  --brawler-panel: #fff;
  --brawler-soft: #f3f4f6;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

:root[data-theme="dark"] .brawler-page {
  --brawler-panel: rgba(255, 255, 255, .06);
  --brawler-soft: rgba(255, 255, 255, .06);
}

.brawler-head {
  display: grid;
  gap: 5px;
}

.brawler-head h1 {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 900;
  letter-spacing: 0;
}

.brawler-head p {
  margin: 0;
  color: var(--text-sub);
  font-size: 13px;
}

.brawler-page .card {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: var(--brawler-panel);
}

.brawler-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 116px 140px auto;
  align-items: end;
  gap: 12px;
  padding: 12px;
}

.brawler-controls label,
.brawler-level-control label,
.brawler-sort-control label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 700;
}

.brawler-search-row {
  position: relative;
}

.brawler-search-row i {
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--text-sub);
  transform: translateY(-50%);
}

.brawler-search-row .ui-input {
  width: 100%;
  min-height: 40px;
  padding-left: 36px;
}

.brawler-level-control,
.brawler-sort-control {
  margin: 0;
}

.brawler-level-control .ui-input,
.brawler-sort-control .ui-input {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
}

#brawlerResultCount {
  align-self: center;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.brawler-groups {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brawler-groups[hidden],
.brawler-rarity-group[hidden],
.brawler-sorted-group[hidden] {
  display: none !important;
}

.brawler-rarity-group {
  display: grid;
  gap: 10px;
}

.brawler-group-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.brawler-group-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
}

.brawler-group-title span {
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 700;
}

.brawler-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}

.brawler-tile {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 9px;
  min-height: 72px;
  padding: 6px 9px 6px 6px;
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  background: var(--brawler-panel);
  color: var(--text-main);
  text-decoration: none;
  transition: border-color .12s ease, background .12s ease;
}

.brawler-tile:hover {
  border-color: #9ca3af;
  background: var(--brawler-soft);
  text-decoration: none;
}

.brawler-tile.has-buffie {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 0;
  background: var(--brawler-panel);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .65);
}

.brawler-tile.has-buffie::before {
  content: "";
  position: absolute;
  inset: -120%;
  z-index: -2;
  background: conic-gradient(
    #b9ecff 0deg,
    #e8fbff 36deg,
    #fff67a 78deg,
    #ffd1b5 112deg,
    #ff9bed 160deg,
    #d7b7ff 215deg,
    #afeaff 270deg,
    #fff67a 318deg,
    #b9ecff 360deg
  );
  animation: brawler-buffie-border-spin 2.4s linear infinite;
  will-change: transform;
}

.brawler-tile.has-buffie::after {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: -1;
  border-radius: 10px;
  background: var(--brawler-panel);
}

.brawler-tile.has-buffie:hover::after {
  background: var(--brawler-soft);
}

@keyframes brawler-buffie-border-spin {
  to {
    transform: rotate(360deg);
  }
}

.brawler-tile-image {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  background: var(--brawler-soft);
  object-fit: contain;
}

.brawler-tile-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brawler-tile-main strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brawler-tile-main small {
  overflow: hidden;
  color: var(--text-sub);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brawler-tile-class {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.brawler-tile-class img {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brawler-tile-stats {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
}

.brawler-page[data-sort-mode="hp"] .brawler-tile-stats,
.brawler-page[data-sort-mode="range"] .brawler-tile-stats,
.brawler-page[data-sort-mode="damage"] .brawler-tile-stats {
  display: flex;
}

.brawler-tile-stats [data-sort-stat] {
  display: none;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--brawler-soft);
  color: var(--text-sub);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.35;
}

.brawler-page[data-sort-mode="hp"] .brawler-tile-stats [data-sort-stat="hp"],
.brawler-page[data-sort-mode="range"] .brawler-tile-stats [data-sort-stat="range"],
.brawler-page[data-sort-mode="damage"] .brawler-tile-stats [data-sort-stat="damage"] {
  display: inline-flex;
}

.brawler-tile-arrow {
  color: var(--text-sub);
  font-size: 16px;
}

.brawler-empty {
  padding: 30px;
  color: var(--text-sub);
  font-weight: 700;
  text-align: center;
}

.brawler-detail-top {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.brawler-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.brawler-detail-actions .brawler-level-control {
  width: 112px;
}

.brawler-ownership-control {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
}

.brawler-ownership-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 8px 0 12px;
  border: 1px solid rgba(148, 163, 184, .4);
  border-radius: 999px;
  background: var(--brawler-panel);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
  white-space: nowrap;
}

.brawler-ownership-toggle:hover {
  border-color: rgba(34, 197, 94, .55);
}

.brawler-ownership-toggle-label {
  line-height: 1;
}

.brawler-ownership-toggle-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #22c55e;
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}

.brawler-ownership-toggle.is-off {
  color: var(--text-main);
}

.brawler-ownership-toggle.is-off .brawler-ownership-toggle-state {
  background: #e2e8f0;
  color: #475569;
}

.brawler-ownership-message {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 2;
  width: max-content;
  max-width: min(320px, calc(100vw - 32px));
  padding: 7px 9px;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .12);
}

.brawler-ownership-message[hidden],
.brawler-owned-badge[hidden] {
  display: none !important;
}

.brawler-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 11px;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.brawler-back:hover {
  color: var(--accent);
}

.brawler-page .brawler-detail-hero {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  padding: 16px;
  border-color: var(--brawler-rarity-color, var(--border-soft));
  border-width: 2px;
  box-shadow: inset 0 0 0 2px var(--brawler-rarity-color, transparent);
}

.brawler-portrait-frame {
  display: flex;
  align-items: end;
  justify-content: center;
  height: 148px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--brawler-soft);
}

.brawler-portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brawler-detail-copy {
  display: grid;
  gap: 9px;
}

.brawler-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.brawler-trait-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--brawler-soft);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
}

.brawler-trait-chip b {
  color: var(--accent);
  font-size: 10px;
  font-weight: 950;
}

.brawler-trait-chip img {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brawler-trait-chip .brawler-trait-type-icon {
  width: 16px;
  height: 16px;
}

.brawler-trait-chip .brawler-trait-effect-icon {
  width: 22px;
  height: 22px;
}

.brawler-buffie-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fce7f3;
  color: #a21caf;
  font-size: 10px;
  font-weight: 800;
}

.brawler-buffie-tag img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.brawler-detail-copy h1 {
  margin: 0;
  font-size: clamp(27px, 3vw, 35px);
  font-weight: 950;
  line-height: 1.08;
  letter-spacing: 0;
}

.brawler-detail-rarity {
  margin: -4px 0 0;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 900;
}

.brawler-desc {
  max-width: 760px;
  margin: 0;
  color: var(--text-sub);
  font-size: 13px;
  line-height: 1.65;
}

.brawler-titles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.brawler-titles div {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--brawler-soft);
}

.brawler-titles .is-mastery img,
.brawler-titles .is-prestige img {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brawler-titles span {
  color: var(--text-sub);
  font-size: 10px;
  font-weight: 700;
}

.brawler-titles strong {
  font-size: 12px;
  font-weight: 900;
}

.brawler-stats,
.brawler-equipment,
.brawler-damage-variants,
.brawler-skins,
.brawler-pins {
  padding: 14px;
  border-radius: 0;
}

.brawler-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.brawler-section-title h2 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 16px;
  font-weight: 900;
}

.brawler-section-title h2 img {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brawler-section-title span {
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 700;
}

.brawler-stat-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 7px;
}

.brawler-stat {
  display: grid;
  gap: 4px;
  min-height: 57px;
  align-content: center;
  padding: 7px;
  border-radius: 9px;
  background: var(--brawler-soft);
  text-align: center;
}

.brawler-stat span {
  color: var(--text-sub);
  font-size: 9px;
  font-weight: 800;
}

.brawler-stat .brawler-stat-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.brawler-stat .brawler-stat-label img {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brawler-stat strong {
  overflow-wrap: anywhere;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
}

.brawler-stat strong em {
  display: block;
  margin-top: 2px;
  color: var(--text-sub);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.brawler-stat strong.is-text {
  font-size: 12px;
}

.brawler-equipment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.brawler-equipment-grid.is-gears {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.brawler-damage-variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 7px;
}

.brawler-damage-variant {
  display: grid;
  gap: 3px;
  min-height: 58px;
  align-content: center;
  padding: 8px;
  border-radius: 9px;
  background: var(--brawler-soft);
  text-align: center;
}

.brawler-damage-variant span {
  color: var(--text-sub);
  font-size: 10px;
  font-weight: 800;
}

.brawler-damage-variant strong {
  font-size: 17px;
  font-weight: 950;
}

.brawler-skin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
}

.brawler-skin {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--brawler-soft);
}

.brawler-skin.is-owned,
.brawler-item.is-owned {
  border-color: #22c55e;
  background: #dcfce7;
}

.brawler-skin.is-not-owned,
.brawler-item.is-not-owned {
  opacity: .74;
  border-color: rgba(148, 163, 184, .35);
}

.brawler-skin.is-ownership-loading,
.brawler-item.is-ownership-loading {
  border-color: rgba(59, 130, 246, .22);
}

.brawler-skin > img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  filter:
    drop-shadow(1px 0 0 #000)
    drop-shadow(-1px 0 0 #000)
    drop-shadow(0 1px 0 #000)
    drop-shadow(0 -1px 0 #000);
}

.brawler-skin h3 {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

.brawler-owned-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 10px;
  font-weight: 950;
  line-height: 1.1;
}

.brawler-owned-badge.is-owned {
  background: #dcfce7;
  color: #166534;
}

.brawler-owned-badge.is-not-owned {
  background: #f1f5f9;
  color: #64748b;
}

.brawler-skin p {
  margin: 4px 0 0;
  color: var(--text-sub);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}

.brawler-skin-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}

.brawler-skin-rarity {
  width: auto;
  height: 22px;
  max-width: 96px;
  object-fit: contain;
}

.brawler-skin-themes {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.brawler-skin-themes img {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brawler-pin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 8px;
}

.brawler-pin {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  min-width: 0;
  padding: 8px;
  border-radius: 10px;
  background: var(--brawler-soft);
}

.brawler-pin img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

/* ===== Brawler detail ranking ===== */

.brawler-ranking {
  padding: 16px;
  border-radius: var(--radius-card, 16px);
  background: var(--bg-card, var(--brawler-panel));
  box-shadow: var(--shadow-card, 0 4px 12px rgba(0, 0, 0, .03));
  overflow: hidden;
}

.brawler-ranking-controls {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(260px, 1fr);
  align-items: end;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(248, 250, 252, .86);
}

.brawler-ranking-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.brawler-ranking-field > span {
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 800;
}

.brawler-ranking-field .ui-input {
  width: 100%;
  min-height: 40px;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.brawler-ranking-scope {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  min-width: 0;
  padding: 3px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: #f3f4f6;
}

.brawler-ranking-tab {
  position: relative;
  min-width: 0;
}

.brawler-ranking-tab input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.brawler-ranking-tab span {
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.brawler-ranking-tab span:hover {
  background: rgba(15, 23, 42, .06);
  color: var(--text-main);
}

.brawler-ranking-tab input:checked + span {
  border-color: var(--text-main);
  background: var(--text-main);
  color: #fff;
}

.brawler-ranking-tab input:focus-visible + span {
  outline: 2px solid rgba(79, 70, 229, .35);
  outline-offset: 2px;
}

.brawler-ranking-list {
  display: grid;
  gap: 8px;
  max-height: min(720px, 72vh);
  overflow: auto;
  padding: 2px 3px 2px 0;
  scrollbar-gutter: stable;
}

.brawler-ranking-row {
  display: grid;
  grid-template-columns: 44px 48px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}

.brawler-ranking-row:hover {
  border-color: rgba(37, 99, 235, .34);
  background: #fbfdff;
}

.brawler-ranking-row:active {
  transform: translateY(1px);
}

.brawler-ranking-row.is-top {
  border-color: rgba(15, 23, 42, .12);
  background: #fff;
}

.brawler-ranking-rank {
  display: grid;
  place-items: center;
  width: 100%;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-main);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-shadow: none;
}

.brawler-ranking-row.is-rank-1 .brawler-ranking-rank,
.brawler-ranking-row.is-rank-2 .brawler-ranking-rank,
.brawler-ranking-row.is-rank-3 .brawler-ranking-rank {
  border: 0;
  background: transparent;
  color: var(--text-main);
}

.brawler-ranking-avatar {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}

.brawler-ranking-player {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.brawler-ranking-player strong,
.brawler-ranking-player small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brawler-ranking-player strong {
  color: var(--text-main) !important;
  -webkit-text-fill-color: var(--text-main) !important;
  background: none !important;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.12;
}

.brawler-ranking-player strong.has-gradient {
  color: var(--text-main) !important;
  -webkit-text-fill-color: var(--text-main) !important;
  background: none !important;
  background-clip: border-box;
  -webkit-background-clip: border-box;
}

.brawler-ranking-player small {
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 800;
  text-shadow: none;
}

.brawler-ranking-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  gap: 6px;
  width: max-content;
  min-width: 0;
  margin-right: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-main);
  text-shadow: none;
}

.brawler-ranking-score img {
  display: block;
  width: 30px;
  height: 30px;
  margin-left: 0;
  object-fit: contain;
}

.brawler-ranking-score strong {
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
}

.brawler-ranking-prestige {
  display: none;
}

.brawler-ranking-prestige.is-empty {
  display: none;
}

/* ===== Equipment items ===== */

.brawler-item {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--brawler-soft);
}

.brawler-item-image {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.brawler-item-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.brawler-item-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 7px;
}

.brawler-item-heading h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
}

.brawler-item-heading .brawler-owned-badge {
  flex: 0 0 auto;
  margin-top: 0;
  margin-left: auto;
}

.brawler-item-heading span {
  color: var(--text-sub);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.brawler-item-heading .brawler-owned-badge {
  color: #334155;
  font-size: 10px;
  font-weight: 950;
}

.brawler-item-heading .brawler-owned-badge.is-owned {
  color: #166534;
}

.brawler-item-heading .brawler-owned-badge.is-not-owned {
  color: #64748b;
}

.brawler-item-cooldown {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  padding: 3px 6px;
  border-radius: 7px;
  background: rgba(59, 130, 246, .1);
  color: var(--text-sub);
  font-size: 10px;
  font-weight: 800;
}

.brawler-item-cooldown img {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brawler-item-cooldown strong {
  color: var(--text-main);
  font-weight: 950;
}

.brawler-item-body > p,
.brawler-buffie-desc p {
  margin: 0;
  color: var(--text-sub);
  font-size: 11px;
  line-height: 1.55;
}

.brawler-buffie-desc {
  display: grid;
  gap: 3px;
  padding: 6px 7px;
  border-left: 2px solid #db2777;
  background: rgba(236, 72, 153, .06);
}

.brawler-buffie-desc strong {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #a21caf;
  font-size: 10px;
  font-weight: 900;
}

.brawler-buffie-desc strong img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.brawler-no-items {
  margin: 0;
  color: var(--text-sub);
  font-size: 12px;
}

/* ===== Dark theme ===== */

:root[data-theme="dark"] .brawler-ranking-controls {
  background: rgba(255, 255, 255, .045);
}

:root[data-theme="dark"] .brawler-ranking-scope {
  background: rgba(255, 255, 255, .06);
}

:root[data-theme="dark"] .brawler-ranking-tab span:hover {
  background: rgba(255, 255, 255, .08);
}

:root[data-theme="dark"] .brawler-ranking-tab input:checked + span {
  border-color: rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .92);
}

:root[data-theme="dark"] .brawler-ranking-row,
:root[data-theme="dark"] .brawler-ranking-row.is-top {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .055);
}

:root[data-theme="dark"] .brawler-ranking-row:hover {
  border-color: rgba(129, 140, 248, .38);
  background: rgba(255, 255, 255, .075);
}

:root[data-theme="dark"] .brawler-ranking-avatar {
  background: transparent;
}

:root[data-theme="dark"] .brawler-ownership-message {
  border-color: rgba(255, 255, 255, .12);
  background: #111827;
  color: #cbd5e1;
}

:root[data-theme="dark"] .brawler-ranking-player strong,
:root[data-theme="dark"] .brawler-ranking-player strong.has-gradient {
  color: var(--text-main) !important;
  -webkit-text-fill-color: var(--text-main) !important;
}

/* ===== Responsive ===== */

@media (max-width: 920px) {
  .brawler-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .brawler-equipment-grid.is-gears {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .brawler-page {
    gap: 13px;
  }

  .brawler-controls {
    grid-template-columns: minmax(0, 1fr) 95px;
    gap: 9px;
  }

  .brawler-sort-control,
  #brawlerResultCount {
    grid-column: 1 / -1;
  }

  .brawler-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brawler-tile {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 7px;
    min-height: 60px;
    padding: 5px;
  }

  .brawler-tile-image {
    width: 48px;
    height: 48px;
  }

  .brawler-tile-arrow {
    display: none;
  }

  .brawler-page .brawler-detail-hero {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px 14px;
    padding: 14px;
  }

  .brawler-portrait-frame {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 112px;
    height: 112px;
  }

  .brawler-detail-copy {
    display: contents;
  }

  .brawler-detail-copy h1 {
    grid-column: 2;
    align-self: end;
    margin: 2px 0 0;
    font-size: 28px;
  }

  .brawler-detail-rarity {
    grid-column: 2;
    align-self: start;
    margin: 0;
  }

  .brawler-traits {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
  }

  .brawler-trait-chip {
    width: 100%;
    align-items: flex-start;
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.45;
  }

  .brawler-trait-chip .brawler-trait-type-icon {
    width: 18px;
    height: 18px;
  }

  .brawler-trait-chip .brawler-trait-effect-icon {
    width: 24px;
    height: 24px;
  }

  .brawler-desc,
  .brawler-titles {
    grid-column: 1 / -1;
  }

  .brawler-desc {
    max-width: none;
    font-size: 13px;
    line-height: 1.7;
  }

  .brawler-titles {
    display: grid;
    gap: 8px;
  }

  .brawler-titles div {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 2px 8px;
    padding: 10px;
  }

  .brawler-titles .is-mastery img,
  .brawler-titles .is-prestige img {
    grid-row: 1 / span 2;
    align-self: center;
    width: 22px;
    height: 22px;
  }

  .brawler-titles span,
  .brawler-titles strong {
    grid-column: 2;
  }

  .brawler-titles strong {
    font-size: 13px;
    line-height: 1.25;
  }

  .brawler-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .brawler-stat {
    min-height: 66px;
    padding: 9px 8px;
  }

  .brawler-equipment-grid,
  .brawler-equipment-grid.is-gears {
    grid-template-columns: 1fr;
  }

  .brawler-ranking {
    padding: 12px;
  }

  .brawler-ranking-controls {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  .brawler-ranking-row {
    grid-template-columns: 44px 42px minmax(0, 1fr) max-content;
    gap: 7px;
    min-height: 60px;
    padding: 7px;
    border-radius: 11px;
  }

  .brawler-ranking-rank {
    font-size: 16px;
  }

  .brawler-ranking-avatar {
    width: 42px;
    height: 42px;
  }

  .brawler-ranking-player strong {
    font-size: 14px;
  }

  .brawler-ranking-player small {
    font-size: 10px;
  }

  .brawler-ranking-score {
    gap: 5px;
    margin-right: 6px;
    padding: 0;
  }

  .brawler-ranking-score img {
    width: 26px;
    height: 26px;
  }

  .brawler-ranking-score strong {
    font-size: 14px;
  }

  .brawler-ranking-prestige {
    display: none;
  }
}

@media (max-width: 380px) {
  .brawler-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .brawler-tile {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .brawler-tile-image {
    width: 42px;
    height: 42px;
  }

  .brawler-page .brawler-detail-hero {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 12px;
  }

  .brawler-portrait-frame {
    width: 96px;
    height: 96px;
  }

  .brawler-detail-copy h1 {
    font-size: 24px;
  }

  .brawler-ranking-row {
    grid-template-columns: 40px 38px minmax(0, 1fr) max-content;
    gap: 6px;
  }

  .brawler-ranking-rank {
    font-size: 15px;
  }

  .brawler-ranking-avatar {
    width: 38px;
    height: 38px;
  }

  .brawler-ranking-score {
    margin-right: 2px;
    padding: 0;
  }

  .brawler-ranking-prestige {
    display: none;
  }
}

.brawler-ranking-avatar-link {
  display: block;
  width: 48px;
  height: 48px;
  text-decoration: none;
}

.brawler-ranking-player.is-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.brawler-ranking-player.is-link:hover strong {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .brawler-ranking-avatar-link {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 380px) {
  .brawler-ranking-avatar-link {
    width: 38px;
    height: 38px;
  }
}
