/* League ladder — poe.ninja-inspired: relic tiles on top, region bars on left */

.ladder-shell {
  min-height: calc(100vh - 3.5rem);
  min-height: calc(100dvh - 3.5rem);
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(var(--accent-bright-rgb),  0.08), transparent 55%),
    linear-gradient(180deg, var(--page-base-top) 0%, var(--page-base-bot) 100%);
}

/* Top toolbar */
.ladder-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 1rem clamp(1rem, 3vw, 2rem) 0.85rem;
  border-bottom: 1px solid rgba(var(--accent-rgb),  0.14);
}

.ladder-toolbar__primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.25rem;
}

.ladder-toolbar__title {
  margin: 0;
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-bright);
}

.ladder-select {
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(var(--accent-rgb),  0.28);
  background: rgba(var(--panel-rgb),  0.85);
  color: var(--text);
  font-size: 0.85rem;
}

.ladder-search {
  width: min(100%, 14rem);
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(var(--accent-rgb),  0.28);
  background: rgba(var(--panel-rgb),  0.85);
  color: var(--text-bright);
  font-size: 0.85rem;
}

.ladder-search::placeholder {
  color: rgba(var(--text-dim-rgb),  0.5);
}

.ladder-search:focus {
  outline: 2px solid rgba(var(--accent-rgb),  0.45);
  outline-offset: 1px;
}

/* Top relic filter bar — poe.ninja class grid */
.pick-filter-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.14);
}

.pick-filter-bars .relic-filter-bar {
  border-bottom: 0;
  min-width: 0;
}

.pick-filter-bars .blessing-filter-bar {
  border-left: 1px solid rgba(var(--accent-rgb), 0.14);
}

@media (max-width: 1100px) {
  .pick-filter-bars {
    grid-template-columns: 1fr;
  }

  .pick-filter-bars .blessing-filter-bar {
    border-left: 0;
    border-top: 1px solid rgba(var(--accent-rgb), 0.14);
  }
}

.relic-filter-bar {
  padding: 0.75rem clamp(1rem, 3vw, 2rem) 0.85rem;
  border-bottom: 1px solid rgba(var(--accent-rgb),  0.14);
  background: rgba(var(--header-rgb),  0.45);
}

.relic-filter-bar__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1rem;
  margin-bottom: 0.65rem;
}

.relic-filter-bar__title {
  margin: 0;
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(var(--text-dim-rgb),  0.85);
}

.relic-filter-bar__grid {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.35rem;
  overflow: visible;
}

.relic-filter-tier {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1 1 0;
  min-width: 4.15rem;
}

.relic-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  min-height: 5.85rem;
  padding: 0.42rem 0.26rem 0.4rem;
  border-radius: 6px;
  border: 1px solid rgba(var(--accent-rgb),  0.2);
  background: rgba(var(--panel-rgb),  0.65);
  color: rgba(212, 200, 184, 0.9);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.12s;
}

.relic-tile:hover:not(.relic-tile--dimmed) {
  border-color: rgba(var(--accent-rgb),  0.45);
  background: rgba(var(--panel-rgb),  0.85);
  transform: translateY(-1px);
}

.relic-tile--active {
  border-color: rgba(var(--accent-rgb),  0.65);
  background: rgba(var(--accent-rgb),  0.12);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-bright-rgb),  0.1), 0 0 0 1px rgba(var(--accent-rgb),  0.15);
}

.relic-tile--dimmed {
  opacity: 0.38;
  filter: grayscale(0.55);
}

.relic-tile--dimmed:hover {
  opacity: 0.58;
  filter: grayscale(0.35);
  border-color: rgba(var(--accent-rgb),  0.35);
}

.relic-tile--active.relic-tile--dimmed {
  opacity: 1;
  filter: none;
}

.relic-tile__tier {
  position: absolute;
  top: 0.22rem;
  left: 0.2rem;
  z-index: 1;
  padding: 0.08rem 0.28rem;
  border-radius: 3px;
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: rgba(232, 220, 196, 0.92);
  background: rgba(var(--header-rgb),  0.82);
  border: 1px solid rgba(var(--accent-rgb),  0.28);
  pointer-events: none;
}

.relic-tile--active .relic-tile__tier {
  border-color: rgba(var(--accent-rgb),  0.45);
  color: rgba(200, 255, 220, 0.95);
}

.relic-tile__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  height: 2.85rem;
  margin-bottom: 0.24rem;
}

.relic-tile__icon img {
  width: 2.85rem;
  height: 2.85rem;
  object-fit: contain;
  image-rendering: auto;
}

.relic-tile__name {
  display: block;
  overflow: hidden;
  width: 100%;
  font-size: 0.66rem;
  line-height: 1.25;
  font-weight: 600;
  color: rgba(212, 200, 184, 0.92);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.relic-tile__pct {
  position: absolute;
  top: 0.22rem;
  right: 0.22rem;
  font-size: 0.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(var(--text-dim-rgb),  0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.relic-tile[data-style="melee"].relic-tile--active {
  border-color: rgba(255, 120, 80, 0.55);
  background: rgba(120, 30, 10, 0.35);
}

.relic-tile[data-style="magic"].relic-tile--active {
  border-color: rgba(120, 160, 255, 0.55);
  background: rgba(30, 50, 120, 0.35);
}

.relic-tile[data-style="ranged"].relic-tile--active {
  border-color: rgba(120, 200, 120, 0.55);
  background: rgba(30, 80, 40, 0.35);
}

.relic-tile[data-style="necromancy"].relic-tile--active {
  border-color: rgba(180, 120, 255, 0.55);
  background: rgba(60, 30, 100, 0.35);
}

/* Main split layout */
.ladder-layout {
  display: grid;
  grid-template-columns: minmax(14.7rem, 17.85rem) minmax(0, 1fr);
  align-items: start;
  gap: 0;
  min-height: calc(100vh - 14rem);
}

/* Left region sidebar — poe.ninja item filters */
.region-sidebar {
  position: sticky;
  top: 3.25rem;
  max-height: calc(100vh - 3.5rem);
  overflow-y: auto;
  padding: 0.85rem 0.75rem 1.5rem 1rem;
  border-right: 1px solid rgba(var(--accent-rgb),  0.14);
  background: rgba(var(--header-rgb),  0.55);
}

.region-sidebar__search {
  width: 100%;
  margin-bottom: 0.79rem;
  padding: 0.47rem 0.68rem;
  border-radius: 5px;
  border: 1px solid rgba(var(--accent-rgb),  0.22);
  background: rgba(var(--panel-rgb),  0.85);
  color: var(--text-bright);
  font-size: 0.82rem;
}

.region-sidebar__search::placeholder {
  color: rgba(var(--text-dim-rgb),  0.45);
}

.region-sidebar__search:focus {
  outline: 2px solid rgba(var(--accent-rgb),  0.4);
  outline-offset: 1px;
}

.region-sidebar__head {
  padding: 0 0.15rem 0.55rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid rgba(var(--accent-rgb),  0.12);
}

.region-sidebar__section + .region-sidebar__section {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(var(--accent-rgb),  0.12);
}

.region-sidebar__title {
  margin: 0;
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(var(--text-dim-rgb),  0.85);
}

.region-sidebar__hint {
  margin: 0.21rem 0 0;
  font-size: 0.71rem;
  color: rgba(var(--text-dim-rgb),  0.5);
}

.region-sidebar__list {
  display: flex;
  flex-direction: column;
  gap: 0.21rem;
}

.region-sidebar__empty {
  margin: 0.53rem 0;
  font-size: 0.79rem;
  color: rgba(var(--text-dim-rgb),  0.55);
  font-style: italic;
}

.region-filter {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.53rem;
  width: 100%;
  min-height: 1.73rem;
  padding: 0.29rem 0.47rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: rgba(var(--panel-rgb),  0.35);
  color: rgba(212, 200, 184, 0.92);
  font-size: 0.94rem;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}

.region-filter:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb),  0.35);
}

.region-filter--active {
  border-color: rgba(var(--accent-rgb),  0.55);
  background: rgba(var(--accent-rgb),  0.1);
}

.region-filter--starter,
.region-filter--forced {
  cursor: default;
  opacity: 0.72;
}

.region-filter__bar {
  position: absolute;
  inset: 0 auto 0 0;
  max-width: 100%;
  background: linear-gradient(90deg, rgba(201, 168, 72, 0.28), rgba(201, 168, 72, 0.12));
  border-radius: 3px;
  pointer-events: none;
  transition: width 0.2s ease;
}

.region-filter--active .region-filter__bar {
  background: linear-gradient(90deg, rgba(var(--accent-rgb),  0.32), rgba(var(--accent-rgb),  0.14));
}

.region-filter--starter .region-filter__bar,
.region-filter--forced .region-filter__bar {
  background: linear-gradient(90deg, rgba(var(--text-dim-rgb),  0.22), rgba(var(--text-dim-rgb),  0.08));
}

.region-filter__name {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  font-weight: 600;
  color: rgba(232, 220, 196, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.region-filter__tag {
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(var(--text-dim-rgb),  0.7);
}

.region-filter__pct {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(var(--text-dim-rgb),  0.88);
}

/* Trophy tier filter bars — match account name colors */
.trophy-filter--none .region-filter__bar {
  background: linear-gradient(90deg, rgba(var(--accent-mid-rgb),  0.28), rgba(var(--accent-mid-rgb),  0.1));
}

.trophy-filter--bronze .region-filter__bar {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.32), rgba(205, 127, 50, 0.12));
}

.trophy-filter--iron .region-filter__bar {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.28), rgba(192, 192, 192, 0.1));
}

.trophy-filter--steel .region-filter__bar {
  background: linear-gradient(90deg, rgba(184, 192, 204, 0.28), rgba(184, 192, 204, 0.1));
}

.trophy-filter--mithril .region-filter__bar {
  background: linear-gradient(90deg, rgba(107, 163, 232, 0.3), rgba(107, 163, 232, 0.12));
}

.trophy-filter--adamant .region-filter__bar {
  background: linear-gradient(90deg, rgba(60, 184, 142, 0.3), rgba(60, 184, 142, 0.12));
}

.trophy-filter--rune .region-filter__bar {
  background: linear-gradient(90deg, rgba(95, 212, 200, 0.3), rgba(95, 212, 200, 0.12));
}

.trophy-filter--dragon .region-filter__bar {
  background: linear-gradient(90deg, rgba(232, 93, 76, 0.32), rgba(232, 93, 76, 0.12));
}

.trophy-filter--active.trophy-filter--none {
  border-color: rgba(var(--accent-mid-rgb),  0.45);
  background: rgba(var(--accent-mid-rgb),  0.08);
}

.trophy-filter--active.trophy-filter--bronze {
  border-color: rgba(205, 127, 50, 0.5);
  background: rgba(205, 127, 50, 0.1);
}

.trophy-filter--active.trophy-filter--iron {
  border-color: rgba(192, 192, 192, 0.45);
  background: rgba(192, 192, 192, 0.08);
}

.trophy-filter--active.trophy-filter--steel {
  border-color: rgba(184, 192, 204, 0.45);
  background: rgba(184, 192, 204, 0.08);
}

.trophy-filter--active.trophy-filter--mithril {
  border-color: rgba(107, 163, 232, 0.5);
  background: rgba(107, 163, 232, 0.1);
}

.trophy-filter--active.trophy-filter--adamant {
  border-color: rgba(60, 184, 142, 0.5);
  background: rgba(60, 184, 142, 0.1);
}

.trophy-filter--active.trophy-filter--rune {
  border-color: rgba(95, 212, 200, 0.5);
  background: rgba(95, 212, 200, 0.1);
}

.trophy-filter--active.trophy-filter--dragon {
  border-color: rgba(232, 93, 76, 0.55);
  background: rgba(232, 93, 76, 0.1);
}

.trophy-filter--active .region-filter__name {
  color: rgba(240, 232, 216, 0.96);
}

/* Player panel */
.player-panel {
  padding: 0.85rem clamp(0.75rem, 2vw, 1.5rem) 2rem;
  min-width: 0;
}

.player-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}

.player-panel__head-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
}

.player-panel__title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--text-dim-rgb),  0.75);
}

.player-panel__meta {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(var(--text-dim-rgb),  0.6);
}

.player-panel__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.player-panel__actions .ladder-search {
  width: min(100%, 12rem);
}

.player-panel__reset {
  padding: 0.35rem 0.65rem;
  border-radius: 5px;
  border: 1px solid rgba(var(--accent-rgb),  0.25);
  background: transparent;
  color: rgba(var(--text-dim-rgb),  0.85);
  font-size: 0.72rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.player-panel__reset:hover {
  border-color: rgba(var(--accent-rgb),  0.45);
  color: var(--text-bright);
}

.player-panel__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem 1rem;
  margin-top: 0.75rem;
}

.player-panel__page-size {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.player-panel__page-size-label,
.player-panel__page-size-suffix {
  font-size: 0.72rem;
  color: rgba(var(--text-dim-rgb),  0.65);
}

.ladder-select--compact {
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
}

.player-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.player-pagination__btn {
  padding: 0.35rem 0.75rem;
  border-radius: 5px;
  border: 1px solid rgba(var(--accent-rgb),  0.25);
  background: rgba(var(--panel-rgb),  0.55);
  color: rgba(var(--text-dim-rgb),  0.9);
  font-size: 0.72rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.player-pagination__btn:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb),  0.45);
  color: var(--text-bright);
}

.player-pagination__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.player-pagination__status {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: rgba(var(--text-dim-rgb),  0.7);
  white-space: nowrap;
}

.player-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid rgba(var(--accent-rgb),  0.18);
  background: rgba(var(--panel-rgb),  0.45);
}

.player-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.player-table thead {
  background: rgba(var(--header-rgb),  0.75);
}

.player-table th {
  padding: 0;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(var(--text-dim-rgb),  0.7);
  border-bottom: 1px solid rgba(var(--accent-rgb),  0.14);
  white-space: nowrap;
}

.player-table__head--numeric {
  text-align: right;
}

.player-table__sort {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-align: inherit;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.player-table__head--numeric .player-table__sort {
  justify-content: flex-end;
}

.player-table__sort:hover {
  color: var(--text-bright);
  background: rgba(var(--accent-rgb),  0.06);
}

.player-table__sort--active {
  color: var(--text-bright);
}

.player-table__sort-indicator {
  font-size: 0.68rem;
  line-height: 1;
  color: rgba(var(--accent-mid-rgb),  0.9);
}

.player-table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid rgba(var(--accent-rgb),  0.08);
  vertical-align: middle;
}

.player-row:hover td {
  background: rgba(var(--accent-rgb),  0.05);
}

.player-row--empty td {
  text-align: center;
  padding: 2rem 1rem;
  color: rgba(var(--text-dim-rgb),  0.65);
}

.col-rank {
  width: 3.5rem;
  font-variant-numeric: tabular-nums;
  color: rgba(var(--text-dim-rgb),  0.85);
}

.col-points,
.col-meta {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.col-meta {
  width: 4rem;
  text-align: right;
}

.meta-pick-rate {
  display: inline-block;
  min-width: 2.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.meta-pick-rate--high {
  color: rgb(var(--accent-mid-rgb));
}

.meta-pick-rate--mid {
  color: rgba(201, 184, 120, 0.95);
}

.meta-pick-rate--low {
  color: rgba(196, 160, 140, 0.85);
}

.player-link {
  color: rgb(var(--accent-mid-rgb));
  text-decoration: none;
  font-weight: 600;
}

/* Trophy tier colors — match tasks page trophy bar fills */
.player-link--none {
  color: rgb(var(--accent-mid-rgb));
}

.player-link--bronze {
  color: #cd7f32;
}

.player-link--iron {
  color: #c0c0c0;
}

.player-link--steel {
  color: #b8c0cc;
}

.player-link--mithril {
  color: #6ba3e8;
}

.player-link--adamant {
  color: #3cb88e;
}

.player-link--rune {
  color: #5fd4c8;
}

.player-link--dragon {
  color: #e85d4c;
}

.player-link--none:hover {
  color: rgb(var(--accent-soft-rgb));
}

.player-link--bronze:hover {
  color: #e8a55a;
}

.player-link--iron:hover {
  color: #e0e0e0;
}

.player-link--steel:hover {
  color: #d4dce8;
}

.player-link--mithril:hover {
  color: #8fc0ff;
}

.player-link--adamant:hover {
  color: #5fd4a8;
}

.player-link--rune:hover {
  color: #8ae8dc;
}

.player-link--dragon:hover {
  color: #ff8a7a;
}

.player-link:hover {
  text-decoration: underline;
}

.relic-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 22rem;
}

.relic-chip {
  display: inline-block;
  max-width: 5.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.65rem;
  letter-spacing: 0.02em;
  background: rgba(var(--accent-rgb),  0.1);
  border: 1px solid rgba(var(--accent-rgb),  0.22);
  color: rgba(212, 200, 184, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.relic-chip--empty {
  opacity: 0.35;
}

.player-panel__note {
  margin: 1rem 0 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: rgba(var(--text-dim-rgb),  0.55);
}

.player-panel__note a {
  color: rgba(var(--accent-mid-rgb),  0.85);
}

.player-panel__note a:hover {
  color: rgb(var(--accent-soft-rgb));
}

/* Responsive */
@media (max-width: 900px) {
  .ladder-layout {
    grid-template-columns: 1fr;
  }

  .region-sidebar {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid rgba(var(--accent-rgb),  0.14);
  }
}

@media (max-width: 640px) {
  .relic-filter-tier {
    min-width: 3.5rem;
  }

  .relic-tile {
    min-height: 5.2rem;
  }

  .player-table thead {
    display: none;
  }

  .player-table tr {
    display: block;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(var(--accent-rgb),  0.1);
  }

  .player-table td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.3rem 0.85rem;
    border: 0;
  }

  .player-table td::before {
    content: attr(data-label);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(var(--text-dim-rgb),  0.55);
  }

  .col-relics {
    flex-direction: column;
    align-items: flex-start;
  }

  .relic-chip-row {
    max-width: none;
  }
}
