:root {
  color-scheme: dark;
  --bg: #080604;
  --bg-soft: rgba(24, 16, 10, 0.88);
  --panel: rgba(18, 13, 10, 0.94);
  --panel-strong: rgba(13, 9, 6, 0.98);
  --panel-border: rgba(181, 132, 57, 0.22);
  --panel-border-soft: rgba(255, 219, 153, 0.08);
  --text: #f5efe4;
  --muted: #bca98d;
  --primary: #f0c06b;
  --primary-soft: rgba(240, 192, 107, 0.16);
  --secondary: #7a5a34;
  --gold: #f1c46c;
  --silver: #d2cbc1;
  --bronze: #bf8650;
  --danger: #d66a6a;
  --success: #d3b479;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(164, 97, 30, 0.15), transparent 30%),
    radial-gradient(circle at 78% 12%, rgba(232, 182, 87, 0.08), transparent 24%),
    linear-gradient(180deg, #060403 0%, #0c0907 38%, #050302 100%);
}

body.profile-open {
  overflow: hidden;
}

.page-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero,
.toolbar,
.table-card,
.summary-card {
  backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(360px, 1fr) minmax(190px, auto);
  align-items: center;
  gap: 24px;
  padding: 30px;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 202, 112, 0.06), transparent 24%, transparent 76%, rgba(255, 202, 112, 0.04)),
    radial-gradient(circle at 20% 0%, rgba(183, 108, 33, 0.16), transparent 35%);
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.server-logo {
  width: clamp(150px, 14vw, 224px);
  height: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.42));
}

.hero-content {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: 0.01em;
}

.hero h1 span {
  display: block;
}

.hero-copy {
  margin: 14px 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 16px;
}

.hero-copy code {
  color: var(--gold);
}

.hero-action {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.main-site-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid rgba(240, 192, 107, 0.42);
  background:
    linear-gradient(180deg, rgba(240, 192, 107, 0.2), rgba(122, 85, 37, 0.16)),
    rgba(18, 13, 10, 0.9);
  color: #ffe4a8;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.main-site-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 216, 143, 0.68);
  background:
    linear-gradient(180deg, rgba(255, 209, 118, 0.28), rgba(122, 85, 37, 0.22)),
    rgba(22, 15, 9, 0.96);
}

.toolbar {
  margin-top: 22px;
  padding: 20px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(180deg, rgba(22, 16, 12, 0.96), rgba(15, 11, 8, 0.96));
}

.tab-group {
  display: inline-flex;
  gap: 10px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 244, 222, 0.03);
  border: 1px solid var(--panel-border-soft);
}

.tab-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.tab-button:hover,
.tab-button:focus-visible {
  color: var(--text);
  outline: none;
}

.tab-button.active {
  color: #1d1206;
  background: linear-gradient(135deg, #f2cd82 0%, #c48d3b 100%);
  box-shadow: inset 0 1px 0 rgba(255, 240, 207, 0.3);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.search-field,
.select-field {
  display: grid;
  gap: 8px;
  min-width: 180px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

body[data-active-tab="guild"] .select-field {
  display: none;
}

.search-field input,
.select-field select {
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(193, 141, 63, 0.22);
  background: rgba(8, 6, 5, 0.92);
  color: var(--text);
  padding: 0 14px;
  font-size: 14px;
}

.search-field input::placeholder {
  color: #8d7760;
}

.summary-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.summary-card {
  border-radius: var(--radius-lg);
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(31, 22, 17, 0.94), rgba(18, 13, 10, 0.94));
}

.summary-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-value {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  font-weight: 800;
}

.summary-note {
  display: block;
  margin-top: 8px;
  color: #d3b989;
  font-size: 13px;
}

.table-card {
  margin-top: 22px;
  border-radius: var(--radius-xl);
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(20, 14, 10, 0.96), rgba(14, 10, 8, 0.96));
}

.table-headline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.table-headline h2 {
  margin: 0;
  font-size: 26px;
}

.table-headline p {
  margin: 8px 0 0;
  color: var(--muted);
}

.data-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  letter-spacing: 0.03em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 224, 168, 0.14);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill.online {
  background: rgba(115, 191, 120, 0.16);
  border-color: rgba(115, 191, 120, 0.34);
  color: #9fe0a5;
}

.status-pill.offline {
  background: rgba(214, 106, 106, 0.14);
  border-color: rgba(214, 106, 106, 0.32);
  color: #efaaaa;
}

.status-time {
  color: var(--muted);
  font-weight: 600;
}

.results-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  border: 1px solid rgba(240, 192, 107, 0.24);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.table-wrapper {
  margin-top: 18px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  min-width: 1120px;
}

thead th {
  color: #d6b37a;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: left;
  padding: 0 16px 10px;
}

thead th.sortable {
  cursor: pointer;
  user-select: none;
}

thead th.sortable:hover {
  color: var(--text);
}

tbody tr {
  background: linear-gradient(180deg, rgba(22, 16, 12, 0.96), rgba(18, 13, 10, 0.96));
  box-shadow: inset 0 0 0 1px rgba(192, 147, 77, 0.08);
}

tbody tr[data-profile-role],
.mobile-rank-card[data-profile-role] {
  cursor: pointer;
}

tbody td {
  padding: 18px 16px;
  vertical-align: middle;
}

tbody tr td:first-child {
  border-radius: 16px 0 0 16px;
}

tbody tr td:last-child {
  border-radius: 0 16px 16px 0;
}

.mobile-rank-row {
  display: none;
}

.row-top-1 {
  box-shadow:
    inset 3px 0 0 #f0c06b,
    inset 0 0 0 1px rgba(192, 147, 77, 0.12);
}

.row-top-2 {
  box-shadow:
    inset 3px 0 0 #c9b798,
    inset 0 0 0 1px rgba(192, 147, 77, 0.12);
}

.row-top-3 {
  box-shadow:
    inset 3px 0 0 #bf8650,
    inset 0 0 0 1px rgba(192, 147, 77, 0.12);
}

.position-pill,
.elo-badge,
.stat-chip,
.cultivation-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

.position-pill {
  min-width: 64px;
  height: 36px;
  padding: 0 12px;
  background: rgba(255, 248, 235, 0.04);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.position-pill.gold {
  color: #231300;
  background: linear-gradient(135deg, #ffd874 0%, #f0b93c 100%);
}

.position-pill.silver {
  color: #1d1710;
  background: linear-gradient(135deg, #e0d6cb 0%, #a79f96 100%);
}

.position-pill.bronze {
  color: #2d1200;
  background: linear-gradient(135deg, #efb16d 0%, #bf6e27 100%);
}

.character-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.guild-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.guild-trigger {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.guild-trigger:hover .name-block strong,
.guild-trigger:focus-visible .name-block strong,
.inline-profile-link:hover,
.inline-profile-link:focus-visible {
  color: var(--primary);
}

.guild-trigger:focus-visible,
.inline-profile-link:focus-visible {
  outline: 2px solid rgba(240, 192, 107, 0.45);
  outline-offset: 3px;
  border-radius: 8px;
}

.inline-profile-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.guild-mark {
  color: var(--primary);
  font-size: 12px;
}

.guild-position {
  display: inline-grid;
  place-items: center;
  width: 76px;
  height: 48px;
}

.guild-position img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.38));
}

.guild-position.top-1 img {
  width: 66px;
  height: 66px;
}

.profile-trigger {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.profile-trigger:hover .name-block strong,
.profile-trigger:focus-visible .name-block strong {
  color: var(--primary);
}

.profile-trigger:focus-visible {
  outline: 2px solid rgba(240, 192, 107, 0.5);
  outline-offset: 4px;
  border-radius: 10px;
}

.star-mark {
  color: var(--gold);
  font-size: 16px;
}

.name-block strong {
  display: block;
  font-size: 16px;
}

.name-block span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.class-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
}

.class-badge img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: contain;
  background: rgba(255, 247, 230, 0.03);
  border: 1px solid rgba(255, 224, 168, 0.08);
}

.gender-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 247, 230, 0.04);
  font-size: 16px;
}

.gender-badge.male {
  color: #49a4ff;
}

.gender-badge.female {
  color: #ff68a3;
}

.elo-badge {
  min-width: 146px;
  padding: 8px 12px 8px 10px;
  gap: 10px;
  justify-content: flex-start;
  border: 1px solid rgba(255, 226, 169, 0.12);
  background: linear-gradient(180deg, rgba(255, 247, 228, 0.05), rgba(255, 197, 82, 0.08));
  color: var(--text);
}

.elo-badge img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
}

.elo-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.elo-copy strong {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.elo-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.elo-unranked {
  background: linear-gradient(180deg, rgba(177, 177, 177, 0.08), rgba(97, 97, 97, 0.08));
}

.elo-ferro {
  background: linear-gradient(180deg, rgba(121, 86, 71, 0.18), rgba(72, 47, 36, 0.2));
}

.elo-bronze {
  background: linear-gradient(180deg, rgba(191, 134, 80, 0.18), rgba(123, 73, 30, 0.18));
}

.elo-prata {
  background: linear-gradient(180deg, rgba(210, 203, 193, 0.18), rgba(125, 126, 130, 0.16));
}

.elo-ouro {
  background: linear-gradient(180deg, rgba(241, 196, 108, 0.2), rgba(156, 115, 38, 0.2));
}

.elo-platina {
  background: linear-gradient(180deg, rgba(103, 201, 177, 0.16), rgba(38, 104, 93, 0.18));
}

.elo-diamante {
  background: linear-gradient(180deg, rgba(114, 164, 255, 0.18), rgba(43, 80, 150, 0.18));
}

.elo-mestre {
  background: linear-gradient(180deg, rgba(196, 102, 255, 0.18), rgba(97, 37, 131, 0.18));
}

.elo-desafiante {
  background: linear-gradient(180deg, rgba(120, 203, 255, 0.2), rgba(36, 116, 175, 0.2));
}

.cultivation-chip {
  min-width: 92px;
  padding: 8px 12px;
  background: rgba(145, 104, 46, 0.14);
  color: #f0d09a;
}

.stat-chip {
  min-width: 68px;
  height: 34px;
  padding: 0 12px;
}

.stat-chip.neutral {
  background: rgba(255, 247, 230, 0.05);
  color: var(--text);
}

.stat-chip.success {
  background: rgba(211, 180, 121, 0.12);
  color: var(--success);
}

.stat-chip.danger {
  background: rgba(214, 106, 106, 0.12);
  color: var(--danger);
}

.empty-state {
  padding: 54px 16px;
  text-align: center;
  color: var(--muted);
}

.profile-modal[hidden] {
  display: none;
}

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
}

.profile-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 3, 2, 0.78);
  backdrop-filter: blur(12px);
}

.profile-panel {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: calc(100vh - 36px);
  overflow: visible;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(240, 192, 107, 0.22);
  background:
    linear-gradient(135deg, rgba(20, 14, 10, 0.98), rgba(7, 13, 18, 0.98));
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.62);
}

.profile-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 224, 168, 0.16);
  border-radius: 10px;
  background: rgba(12, 8, 6, 0.88);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
}

.profile-close:hover,
.profile-close:focus-visible {
  border-color: rgba(240, 192, 107, 0.44);
  color: var(--primary);
  outline: none;
}

.profile-content {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1fr);
  gap: 18px;
  padding: 26px;
}

.profile-card,
.profile-fights {
  border: 1px solid rgba(255, 224, 168, 0.12);
  background: rgba(255, 247, 230, 0.035);
  border-radius: var(--radius-lg);
}

.profile-card {
  padding: 22px;
}

.profile-crest {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.profile-crest .elo-badge {
  min-width: 190px;
  justify-content: center;
  padding: 12px 18px;
}

.profile-rank-mark {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(240, 192, 107, 0.13);
  font-size: 42px;
}

.profile-nameplate {
  text-align: center;
}

.profile-kicker {
  display: block;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-nameplate h3,
.profile-fights h3 {
  margin: 6px 0 0;
  font-size: 27px;
}

.profile-position {
  display: inline-flex;
  margin-top: 9px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(240, 192, 107, 0.12);
  color: #f6d79a;
  font-size: 13px;
  font-weight: 800;
}

.profile-score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}

.profile-score-grid div,
.profile-info-list div,
.profile-fight-item {
  border: 1px solid rgba(255, 224, 168, 0.09);
  background: rgba(0, 0, 0, 0.16);
  border-radius: 14px;
}

.profile-score-grid div {
  padding: 11px 8px;
  text-align: center;
}

.profile-score-grid span,
.profile-info-list dt {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-score-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.profile-info-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.profile-info-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
}

.profile-info-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 800;
  text-align: right;
}

.profile-info-list .class-badge {
  min-width: 0;
  justify-content: flex-end;
}

.profile-fights {
  padding: 16px;
  min-height: 0;
}

.profile-fights-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.16);
}

.profile-toggle {
  display: inline-flex;
  gap: 8px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 247, 230, 0.04);
}

.profile-toggle button {
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.profile-toggle button.active {
  color: #171008;
  background: linear-gradient(135deg, #f2cd82 0%, #c48d3b 100%);
}

.profile-fight-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  max-height: min(410px, calc(100vh - 360px));
  overflow: auto;
  padding-right: 4px;
}

.profile-fight-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.fight-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.fight-icon img {
  width: 39px;
  height: 39px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.34));
}

.fight-icon.elo-icon img {
  width: 40px;
  height: 40px;
}

.fight-icon.class-icon img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.profile-fight-item strong,
.profile-fight-item span {
  display: block;
}

.profile-fight-item span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.profile-empty {
  padding: 32px 16px;
  color: var(--muted);
  text-align: center;
}

.guild-detail-card .guild-position {
  width: 96px;
  height: 72px;
}

.guild-detail-card .guild-position img {
  width: 76px;
  height: 76px;
}

.guild-member-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  max-height: min(410px, calc(100vh - 360px));
  overflow: auto;
  padding-right: 4px;
}

.guild-member-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 224, 168, 0.09);
  background: rgba(0, 0, 0, 0.16);
}

.guild-member-item img,
.guild-member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: contain;
  background: rgba(255, 247, 230, 0.04);
}

.guild-member-avatar {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.guild-member-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.member-status {
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.member-status.online {
  color: #9fe0a5;
  background: rgba(115, 191, 120, 0.14);
}

.member-status.offline {
  color: var(--muted);
  background: rgba(255, 247, 230, 0.04);
}

@media (max-width: 1080px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .hero-action {
    justify-content: flex-start;
  }

  .profile-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1440px);
    padding-top: 16px;
  }

  .toolbar,
  .table-card,
  .hero {
    padding: 18px;
  }

  .hero-brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .server-logo {
    width: 166px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    width: 100%;
  }

  .search-field,
  .select-field {
    width: 100%;
  }

  .table-card {
    border-radius: 18px;
  }

  .table-headline {
    align-items: stretch;
    flex-direction: column;
  }

  .table-headline h2 {
    font-size: 28px;
  }

  .results-badge {
    align-self: flex-start;
  }

  .table-wrapper {
    overflow: visible;
  }

  table {
    min-width: 0;
    width: 100%;
    border-spacing: 0 12px;
  }

  thead,
  tbody > tr:not(.mobile-rank-row) {
    display: none;
  }

  .mobile-rank-row {
    display: table-row;
    background: transparent;
    box-shadow: none;
  }

  .mobile-rank-row > td {
    display: block;
    padding: 0;
    border-radius: 0;
  }

  .mobile-rank-card {
    padding: 16px;
    border-radius: 18px;
    background:
      linear-gradient(180deg, rgba(24, 17, 12, 0.98), rgba(15, 10, 8, 0.98));
    border: 1px solid rgba(192, 147, 77, 0.16);
    box-shadow: inset 3px 0 0 rgba(240, 192, 107, 0.45);
  }

  .mobile-rank-top,
  .mobile-rank-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-rank-top {
    margin-bottom: 14px;
  }

  .mobile-rank-name {
    margin: 0 0 14px;
  }

  .mobile-rank-name .character-cell {
    align-items: flex-start;
  }

  .mobile-rank-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-bottom: 14px;
  }

  .mobile-rank-meta .class-badge {
    min-width: 0;
  }

  .mobile-rank-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
  }

  .mobile-rank-stats div {
    min-width: 0;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 247, 230, 0.035);
    border: 1px solid rgba(255, 224, 168, 0.07);
  }

  .mobile-rank-stats dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .mobile-rank-stats dd {
    margin: 6px 0 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    overflow-wrap: anywhere;
  }

  .elo-badge {
    min-width: 128px;
  }

  .profile-modal {
    padding: 10px;
    align-items: stretch;
  }

  .profile-panel {
    max-height: calc(100vh - 20px);
    overflow: auto;
    border-radius: 18px;
  }

  .profile-content {
    padding: 16px;
    gap: 14px;
  }

  .profile-card,
  .profile-fights {
    padding: 16px;
  }

  .profile-fight-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .profile-fights-head,
  .profile-info-list div {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-toggle {
    width: 100%;
  }

  .profile-toggle button {
    flex: 1;
  }

  .profile-score-grid {
    grid-template-columns: 1fr;
  }

  .profile-info-list dd {
    text-align: left;
  }
}

@media (max-width: 420px) {
  .page-shell {
    width: min(100% - 12px, 1440px);
  }

  .toolbar,
  .table-card,
  .hero {
    padding: 14px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero-copy,
  .table-headline p {
    font-size: 14px;
  }

  .mobile-rank-card {
    padding: 14px;
  }

  .mobile-rank-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .mobile-rank-stats {
    grid-template-columns: 1fr;
  }
}
