:root {
  --bg: #110608;
  --panel: rgba(31, 12, 15, 0.94);
  --panel-soft: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 100, 116, 0.24);
  --line-strong: rgba(255, 92, 104, 0.48);
  --text: #fff6f6;
  --muted: #d2a8ad;
  --purple: #7f1d1d;
  --purple-bright: #ff6b6b;
  --cyan: #ff4d5f;
  --pink: #ff2e63;
  --gold: #ffc857;
  --ember: #ff8a3d;
  --good: #82f7bf;
  --danger: #ff8ea9;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --max: 1480px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.2, 0.8, 0.2, 1);
  --banner-filter: hue-rotate(118deg) saturate(1.22) brightness(0.76) contrast(1.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Space Grotesk", "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(255, 46, 99, 0.16), transparent 38%),
    linear-gradient(225deg, rgba(255, 138, 61, 0.1), transparent 42%),
    linear-gradient(180deg, #1b080c 0%, #100508 56%, #070204 100%);
}

body.modal-open {
  overflow: hidden;
}

.page-transitioning main,
.page-transitioning .app-top,
.page-transitioning .footer {
  opacity: 0.72;
  transform: translateY(3px);
  transition: opacity 120ms var(--ease-out), transform 120ms var(--ease-out);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.22;
}

a, button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button, input, select { appearance: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.container {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.app-top {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 18px 0 0;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(8, 4, 15, 0.9), rgba(8, 4, 15, 0));
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 22px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(22, 8, 12, 0.9);
  box-shadow: var(--shadow);
  transition: border-color 220ms var(--ease-out), box-shadow 220ms var(--ease-out), transform 220ms var(--ease-out);
  animation: rise-in 620ms var(--ease-smooth) both;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 12%, rgba(197, 143, 255, 0.12) 44%, transparent 76%);
  opacity: 0.42;
  mix-blend-mode: screen;
  transform: translateX(-10%);
  transition: opacity 220ms var(--ease-out), transform 280ms var(--ease-out);
}

.topbar:hover {
  border-color: var(--line-strong);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.48);
}

.topbar:hover::after {
  opacity: 0.6;
  transform: translateX(8%);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 77, 95, 0.34), transparent 58%),
    linear-gradient(145deg, rgba(55, 10, 14, 0.96), rgba(18, 4, 8, 0.98));
  box-shadow: 0 12px 30px rgba(255, 46, 99, 0.2);
  overflow: hidden;
}

.brand-mark img {
  width: 82%;
  height: 82%;
  object-fit: cover;
  object-position: center;
  border-radius: 9px;
  filter: saturate(1.12) contrast(1.05);
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-kicker {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-name {
  font-family: "Outfit", "Space Grotesk", sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  column-gap: 14px;
  row-gap: 14px;
  min-width: 0;
}

.nav-links a,
.status-pill,
.ghost-btn,
.primary-btn,
.tab,
.footer-links a,
.static-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  transition:
    transform 180ms var(--ease-out),
    border-color 180ms var(--ease-out),
    color 180ms var(--ease-out),
    background 180ms var(--ease-out),
    box-shadow 180ms var(--ease-out);
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 100%;
}

.nav-links a,
.status-pill,
.ghost-btn,
.tab,
.footer-links a,
.static-back-link {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.nav-links a:hover,
.nav-links a[aria-current="page"],
.ghost-btn:hover,
.tab:hover,
.footer-links a:hover,
.static-back-link:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.nav-links a[aria-current="page"],
.tab.active {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.icon-btn {
  width: 46px;
  min-width: 46px;
  padding: 0;
  gap: 0;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn .icon-check {
  display: none;
}

.icon-btn.copied .icon-copy {
  display: none;
}

.icon-btn.copied .icon-check {
  display: block;
}

.status-pill {
  gap: 8px;
  text-transform: uppercase;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 14px currentColor;
}

.status-pill.online { color: var(--good); }
.status-pill.offline { color: var(--danger); }
.status-pill.checking { color: var(--cyan); }

.page {
  padding: 30px 0 56px;
}

.hero-panel,
.panel,
.metric-card,
.banner-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(33, 13, 17, 0.98), rgba(13, 5, 8, 0.98));
  box-shadow: var(--shadow);
  transition:
    transform 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out),
    border-color 220ms var(--ease-out),
    background 220ms var(--ease-out);
  animation: rise-in 700ms var(--ease-smooth) both;
}

.panel::before,
.metric-card::before,
.banner-panel::before,
.profile-render-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 77, 95, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(255, 138, 61, 0.08), transparent 48%);
  opacity: 0.5;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}

.leaderboard-banner {
  overflow: hidden;
  height: clamp(220px, 23vw, 310px);
  min-height: 0;
  margin-bottom: 0;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}

.leaderboard-banner::before {
  background:
    linear-gradient(180deg, rgba(12, 2, 5, 0.14) 0%, rgba(85, 10, 16, 0.36) 46%, rgba(13, 2, 5, 0.88) 100%),
    linear-gradient(135deg, rgba(255, 46, 99, 0.28), transparent 42%),
    linear-gradient(315deg, rgba(220, 38, 38, 0.24), transparent 48%);
  opacity: 0.96;
  mix-blend-mode: color;
}

.leaderboard-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.1) 38%, rgba(255, 77, 95, 0.14) 50%, transparent 64%);
  mix-blend-mode: screen;
  opacity: 0.22;
  transform: translateX(-12%);
  transition: opacity 260ms var(--ease-out), transform 520ms var(--ease-out);
}

.leaderboard-banner:hover::after {
  opacity: 0.5;
  transform: translateX(12%);
}

.leaderboard-panel {
  position: relative;
  z-index: 2;
  margin-top: -26px;
  padding-top: 28px;
  backdrop-filter: blur(18px);
  background:
    linear-gradient(180deg, rgba(33, 13, 17, 0.96), rgba(13, 5, 8, 0.98));
}

.leaderboard-panel .panel-head {
  gap: 18px;
  margin-bottom: 24px;
}

.leaderboard-panel .panel-head > div:first-child {
  display: grid;
  gap: 10px;
}

.leaderboard-panel .panel-subtitle {
  max-width: 680px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  gap: 22px;
  padding: 26px;
  margin-bottom: 20px;
}

.hero-copy,
.hero-side {
  display: flex;
  flex-direction: column;
}

.hero-copy {
  justify-content: center;
  gap: 18px;
}

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

.hero-title,
h2 {
  margin: 0;
  font-family: "Outfit", "Space Grotesk", sans-serif;
  letter-spacing: -0.03em;
}

.hero-title {
  font-size: clamp(2.8rem, 8vw, 5.4rem);
  line-height: 0.96;
  max-width: 10ch;
}

.hero-description,
.panel-subtitle,
.footer span,
.story-text,
.loading,
.loading-card,
.table-subline,
.player-meta small,
.subtle,
.featured-card small,
.mode-card small,
.mini-mode-card small,
.metric-card small {
  color: var(--muted);
  line-height: 1.6;
}

.hero-actions,
.hero-highlights,
.panel-actions,
.tabs,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  column-gap: 14px;
  row-gap: 14px;
}

.primary-btn {
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--cyan), var(--purple-bright) 58%, var(--pink));
  color: #150a1f;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 0 12px 30px rgba(156, 99, 255, 0.28);
}

.primary-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 24%, rgba(255, 255, 255, 0.28) 48%, transparent 72%);
  opacity: 0;
  transform: translateX(-135%);
}

.primary-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(156, 99, 255, 0.34);
}

.primary-btn:hover::after {
  opacity: 1;
  animation: sheen-sweep 900ms var(--ease-out) both;
}

.banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
  filter: var(--banner-filter);
}

.hero-highlights span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.hero-highlights span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--cyan));
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric-card {
  padding: 20px;
}

.metric-card span,
.field span,
.profile-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.metric-card strong,
.profile-stats strong {
  display: block;
  margin-top: 10px;
  font-size: 34px;
  line-height: 1;
}

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

.panel {
  padding: 26px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.panel-head-stack {
  flex-direction: column;
}

h2 {
  font-size: clamp(2rem, 5vw, 3.05rem);
  line-height: 1;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.mode-card-grid,
.rank-grid {
  display: grid;
  gap: 16px;
}

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

.featured-card,
.mode-card,
.rank-card,
.mini-mode-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  transition:
    transform 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out),
    border-color 220ms var(--ease-out),
    background 220ms var(--ease-out);
  animation: rise-in 760ms var(--ease-smooth) both;
}

.featured-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  cursor: pointer;
}

.mode-card,
.rank-card,
.mini-mode-card {
  padding: 16px;
}

.featured-place,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.featured-place {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.place-1 .featured-place { color: var(--gold); }
.place-2 .featured-place { color: #f0e8ff; }
.place-3 .featured-place { color: #ffb692; }

.featured-face,
.skin-face {
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  image-rendering: pixelated;
}

.featured-card strong,
.mode-card strong,
.rank-card strong,
.mini-mode-card strong {
  display: block;
}

.featured-card b,
.mode-card b,
.elo {
  color: var(--cyan);
  font-weight: 900;
}

.elo-hidden {
  color: #ffd58a;
  font-style: italic;
}

.mode-card span,
.rank-card span,
.mini-mode-card span {
  display: block;
  margin-top: 8px;
  color: var(--purple-bright);
  font-weight: 800;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(170px, 220px) minmax(130px, 160px);
  gap: 16px;
  align-items: end;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid rgba(190, 143, 255, 0.16);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.018));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 36px rgba(0, 0, 0, 0.16);
}

.field {
  display: grid;
  gap: 8px;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  outline: none;
}

.field select {
  padding-right: 48px;
  color-scheme: dark;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--cyan) 50%),
    linear-gradient(135deg, var(--cyan) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 2px),
    calc(100% - 16px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.field select option {
  background: #230b10;
  color: var(--text);
}

.field select option:checked,
.field select option:hover,
.field select option:focus {
  background: #461219;
  color: var(--text);
}

.field input:focus,
.field select:focus {
  border-color: rgba(255, 77, 95, 0.56);
  box-shadow: 0 0 0 3px rgba(255, 77, 95, 0.1);
}

.sort-field {
  position: relative;
}

.native-sort-select {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.sort-picker {
  position: relative;
  z-index: 12;
}

.sort-picker-button {
  position: relative;
  width: 100%;
  min-height: 50px;
  padding: 0 48px 0 15px;
  border: 1px solid rgba(255, 77, 95, 0.44);
  border-radius: 12px;
  color: #fff8f8;
  text-align: left;
  font-weight: 900;
  background:
    linear-gradient(135deg, rgba(255, 77, 95, 0.14), transparent 52%),
    linear-gradient(180deg, rgba(50, 14, 18, 0.96), rgba(28, 7, 10, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 26px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.sort-picker-button::before,
.sort-picker-button::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transition: transform 180ms ease;
}

.sort-picker-button::before {
  right: 23px;
  transform: translateY(-50%) rotate(45deg);
}

.sort-picker-button::after {
  right: 18px;
  transform: translateY(-50%) rotate(-45deg);
}

.sort-picker.open .sort-picker-button {
  border-color: rgba(255, 77, 95, 0.78);
  box-shadow:
    0 0 0 3px rgba(255, 77, 95, 0.13),
    0 18px 38px rgba(0, 0, 0, 0.24);
}

.sort-picker.open .sort-picker-button::before {
  transform: translateY(-50%) rotate(-45deg);
}

.sort-picker.open .sort-picker-button::after {
  transform: translateY(-50%) rotate(45deg);
}

.sort-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  gap: 4px;
  padding: 7px;
  border: 1px solid rgba(255, 77, 95, 0.48);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(49, 12, 17, 0.98), rgba(22, 5, 8, 0.99));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 24px 44px rgba(0, 0, 0, 0.34);
  animation: menu-rise 160ms ease both;
}

.sort-picker-menu[hidden] {
  display: none;
}

.sort-picker-option {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #fff6f6;
  text-align: left;
  font-weight: 850;
  background: transparent;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.sort-picker-option:hover,
.sort-picker-option:focus-visible {
  border-color: rgba(255, 77, 95, 0.34);
  background: rgba(255, 77, 95, 0.14);
  outline: none;
  transform: translateX(2px);
}

.sort-picker-option[aria-selected="true"] {
  color: #160407;
  border-color: transparent;
  background: linear-gradient(135deg, #ff4d5f, #ffc857);
  box-shadow: 0 8px 18px rgba(255, 77, 95, 0.22);
}

.tab.active {
  color: #150a1f;
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), var(--purple-bright));
}

.tabs {
  align-items: center;
  row-gap: 14px;
}

.leaderboard-panel .tabs {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(190, 143, 255, 0.16);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.038), rgba(255, 255, 255, 0.02));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 18px 34px rgba(0, 0, 0, 0.14);
}

.leaderboard-panel .tab {
  min-height: 44px;
  padding: 0 20px;
  border-color: rgba(190, 143, 255, 0.26);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(242, 236, 255, 0.82);
}

.leaderboard-panel .tab:hover {
  border-color: rgba(190, 143, 255, 0.42);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.leaderboard-panel .tab.active {
  color: #160b22;
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), var(--purple-bright) 72%);
  box-shadow:
    0 14px 28px rgba(99, 72, 180, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.status-row {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.016));
  width: 100%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 20px 40px rgba(0, 0, 0, 0.18);
}

.leaderboard-table {
  display: block;
  width: 100%;
  min-width: 920px;
  border-collapse: separate;
  table-layout: auto;
}

.leaderboard-table colgroup {
  display: none;
}

.leaderboard-table thead,
.leaderboard-table tbody {
  display: block;
}

.leaderboard-table tbody {
  background: rgba(255, 255, 255, 0.01);
}

.leaderboard-table tr {
  display: grid;
  grid-template-columns: 82px minmax(320px, 1fr) 104px 84px 120px 92px 100px;
  align-items: center;
}

.leaderboard-table .col-rank {
  width: 74px;
}

.leaderboard-table .col-player {
  width: auto;
}

.leaderboard-table .col-elo {
  width: 104px;
}

.leaderboard-table .col-games {
  width: 82px;
}

.leaderboard-table .col-record {
  width: 118px;
}

.leaderboard-table .col-streak {
  width: 92px;
}

.leaderboard-table .col-winrate {
  width: 96px;
}

th, td {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 15px 12px;
  border-bottom: 0;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  position: static;
  background: transparent;
  backdrop-filter: blur(14px);
}

.leaderboard-table th:first-child,
.leaderboard-table td:first-child,
.leaderboard-table th:nth-child(n + 3),
.leaderboard-table td:nth-child(n + 3) {
  justify-content: center;
}

.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) {
  justify-content: flex-start;
}

.leaderboard-table th:nth-child(1),
.leaderboard-table th:nth-child(3),
.leaderboard-table th:nth-child(4),
.leaderboard-table th:nth-child(5),
.leaderboard-table th:nth-child(6),
.leaderboard-table th:nth-child(7),
.leaderboard-table td:nth-child(1),
.leaderboard-table td:nth-child(3),
.leaderboard-table td:nth-child(4),
.leaderboard-table td:nth-child(5),
.leaderboard-table td:nth-child(6),
.leaderboard-table td:nth-child(7) {
  text-align: center;
}

.player-row {
  position: relative;
  cursor: pointer;
  min-height: 82px;
  background: rgba(255, 255, 255, 0.018);
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  animation: rise-in 560ms var(--ease-smooth) both;
  transition:
    transform 180ms var(--ease-out),
    background 180ms var(--ease-out),
    box-shadow 180ms var(--ease-out),
    border-color 180ms var(--ease-out);
}

.leaderboard-table thead tr {
  background: rgba(22, 8, 12, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}

.player-row::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cyan), var(--purple-bright));
  opacity: 0;
  transform: scaleY(0.4);
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.player-row:hover {
  background: rgba(255, 255, 255, 0.045);
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

.player-row:hover::before,
.player-row:focus-visible::before {
  opacity: 1;
  transform: scaleY(1);
}

.player-row:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}

.rank-pos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(197, 143, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 20px;
  font-weight: 900;
  color: var(--purple-bright);
}

.champion .rank-pos { color: var(--gold); }
.runner-up .rank-pos { color: #f0e8ff; }
.third-place .rank-pos { color: #ffb692; }

.player-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  width: 100%;
  justify-content: flex-start;
}

.player-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
  width: 100%;
}

.player-meta strong {
  font-size: 20px;
  letter-spacing: -0.03em;
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  overflow-wrap: normal;
  line-height: 1.1;
}

.player-subline {
  display: block;
}

.placement-subline {
  width: fit-content;
  margin-top: 2px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 200, 87, 0.28);
  border-radius: 999px;
  color: #ffd58a;
  background: rgba(255, 200, 87, 0.09);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table-subline {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.table-value {
  font-weight: 800;
}

.elo {
  font-family: "Outfit", "Space Grotesk", sans-serif;
  font-size: 20px;
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(197, 143, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.streak-badge-good {
  border-color: rgba(130, 247, 191, 0.24);
  background: rgba(130, 247, 191, 0.08);
  color: var(--good);
}

.streak-badge-bad {
  border-color: rgba(255, 133, 173, 0.2);
  background: rgba(255, 133, 173, 0.08);
  color: #ff9bbf;
}

.streak-badge-neutral {
  border-color: rgba(255, 138, 61, 0.22);
  background: rgba(255, 138, 61, 0.08);
  color: rgba(255, 218, 186, 0.94);
}

.winrate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(130, 247, 191, 0.24);
  border-radius: 999px;
  background: rgba(130, 247, 191, 0.08);
  color: var(--good);
  font-weight: 900;
}

.champion {
  background:
    linear-gradient(90deg, rgba(255, 216, 107, 0.08), transparent 30%),
    rgba(255, 255, 255, 0.012);
}

.runner-up {
  background:
    linear-gradient(90deg, rgba(240, 232, 255, 0.06), transparent 28%),
    rgba(255, 255, 255, 0.01);
}

.third-place {
  background:
    linear-gradient(90deg, rgba(255, 182, 146, 0.06), transparent 28%),
    rgba(255, 255, 255, 0.01);
}

.pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.pill.ban { color: var(--danger); }
.pill.mute { color: var(--gold); }
.pill.warn { color: var(--cyan); }
.pill.unban,
.pill.unmute { color: var(--good); }

.loading-card {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.025);
}

.loading-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

.static-back-link {
  gap: 8px;
  margin-bottom: 16px;
}

.static-back-link::before {
  content: "<";
  color: var(--cyan);
}

.player-shell {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.player-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.profile-summary-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex-shrink: 0;
}

.player-identity {
  display: grid;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.player-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.player-identity h2 {
  max-width: 100%;
  font-size: clamp(1.75rem, 3.2vw, 2.95rem);
  line-height: 0.98;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  transform-origin: left center;
}

.profile-rank {
  margin-top: 2px;
  color: var(--purple-bright);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-render-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 390px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 77, 95, 0.11), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.profile-render {
  max-width: 86%;
  max-height: 340px;
  object-fit: contain;
  opacity: 0;
  filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.42));
}

.profile-render.loaded {
  opacity: 1;
}

.render-loader {
  position: absolute;
  display: grid;
  place-items: center;
  gap: 8px;
  min-width: 220px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(10, 7, 18, 0.84);
}

.loader-ring {
  width: 46px;
  height: 46px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--cyan);
  border-right-color: var(--purple-bright);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.player-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-self: start;
}

.player-summary {
  align-self: start;
}

.profile-overview {
  grid-column: 1 / -1;
  background:
    linear-gradient(135deg, rgba(255, 77, 95, 0.12), transparent 45%),
    linear-gradient(180deg, rgba(33, 13, 17, 0.98), rgba(13, 5, 8, 0.98));
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.profile-stat-card {
  min-height: 142px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.profile-stat-card.feature {
  background:
    linear-gradient(135deg, rgba(255, 77, 95, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  border-color: rgba(255, 77, 95, 0.24);
}

.profile-stat-card strong {
  font-family: "Outfit", "Space Grotesk", sans-serif;
  font-size: 30px;
  line-height: 1.02;
}

.profile-modes-panel,
.profile-matches-panel {
  min-height: 100%;
}

.profile-subpanel .panel-head {
  margin-bottom: 18px;
}

.profile-modes-panel .mode-card-grid {
  grid-template-columns: 1fr;
}

.profile-modes-panel .mini-mode-card {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025));
}

.profile-modes-panel .mini-mode-card strong {
  font-size: 24px;
  line-height: 1;
}

.profile-modes-panel .mini-mode-card span {
  font-size: 18px;
}

.profile-modes-panel .mini-mode-card small {
  font-size: 14px;
}

.recent-match-list {
  display: grid;
  gap: 10px;
}

.recent-match-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  row-gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03));
  transition:
    transform 220ms var(--ease-out),
    box-shadow 220ms var(--ease-out),
    border-color 220ms var(--ease-out),
    background 220ms var(--ease-out);
  min-width: 0;
  animation: rise-in 560ms var(--ease-smooth) both;
  cursor: pointer;
}

.recent-match-opponent {
  min-width: 0;
  font-size: 15px;
  line-height: 1.2;
}

.match-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
}

.match-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 3, 9, 0.74);
  backdrop-filter: blur(12px);
}

.match-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(1480px, calc(100vw - 40px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  padding: 24px;
}

.match-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.match-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.035);
}

.match-hero-player {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.match-hero-player.opponent {
  flex-direction: row-reverse;
  text-align: right;
}

.match-hero-render {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.34));
}

.match-hero-player.opponent .match-hero-render {
  transform: scaleX(-1);
}

.match-hero-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.match-hero-copy strong {
  font-family: "Outfit", "Space Grotesk", sans-serif;
  font-size: 28px;
  line-height: 1;
}

.match-hero-copy span,
.match-hero-center span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.match-hero-center {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.match-hero-center strong {
  font-family: "Outfit", "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
}

.match-duel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
  min-width: 0;
}

.match-side-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.04);
}

.match-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.match-side-head strong {
  font-family: "Outfit", "Space Grotesk", sans-serif;
  font-size: 24px;
  line-height: 1;
}

.match-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.match-stat-card,
.match-summary-card {
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.035);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.match-stat-card span,
.match-summary-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.match-stat-card strong,
.match-summary-card strong {
  font-family: "Outfit", "Space Grotesk", sans-serif;
  font-size: 26px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.match-rating-card {
  grid-column: 1 / -1;
  min-height: 96px;
  border-color: rgba(255, 77, 95, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 77, 95, 0.18), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
}

.match-rating-card strong {
  color: #fff8f8;
  font-size: clamp(1.55rem, 2vw, 2rem);
}

.match-loadout-wrap {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(11, 7, 19, 0.74);
}

.match-loadout-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 6px;
}

.match-slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
}

.match-slot.spacer {
  border-color: transparent;
  background: transparent;
}

.match-slot.filled {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.045));
}

.match-slot.weapon { background: linear-gradient(180deg, rgba(156, 99, 255, 0.22), rgba(255, 255, 255, 0.05)); }
.match-slot.armor { background: linear-gradient(180deg, rgba(255, 77, 95, 0.2), rgba(255, 255, 255, 0.05)); }
.match-slot.utility { background: linear-gradient(180deg, rgba(255, 216, 107, 0.2), rgba(255, 255, 255, 0.05)); }

.match-slot-label {
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.match-slot-count {
  position: absolute;
  right: 4px;
  bottom: 3px;
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
}

.match-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.panel:hover,
.metric-card:hover,
.banner-panel:hover,
.featured-card:hover,
.mode-card:hover,
.rank-card:hover,
.mini-mode-card:hover,
.profile-stat-card:hover,
.recent-match-card:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
}

.featured-card:hover,
.mode-card:hover,
.rank-card:hover,
.mini-mode-card:hover,
.profile-stat-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

.panel:hover::before,
.metric-card:hover::before,
.banner-panel:hover::before,
.profile-render-wrap:hover::before {
  opacity: 0.88;
  transform: scale(1.015);
}

.leaderboard-banner:hover .banner-image,
.profile-render-wrap:hover .profile-render {
  transform: scale(1.035);
  filter: saturate(1.06) drop-shadow(0 28px 34px rgba(0, 0, 0, 0.42));
}

.leaderboard-banner:hover .banner-image {
  filter: var(--banner-filter) saturate(1.06) drop-shadow(0 28px 34px rgba(0, 0, 0, 0.42));
}

.banner-image,
.profile-render {
  transition: transform 320ms var(--ease-out), filter 320ms var(--ease-out), opacity 240ms var(--ease-out);
}

.profile-render-wrap:hover {
  border-color: var(--line-strong);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.3);
}

body[data-page="player"] .player-summary:hover,
body[data-page="player"] .profile-overview:hover,
body[data-page="player"] .profile-subpanel:hover {
  transform: translateY(-2px);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.24),
    0 0 22px rgba(255, 46, 99, 0.07);
}

body[data-page="player"] .profile-render-wrap:hover .profile-render {
  transform: scale(1.018);
  filter:
    brightness(1.08)
    contrast(1.08)
    saturate(1.04)
    drop-shadow(0 30px 34px rgba(0, 0, 0, 0.46))
    drop-shadow(0 0 22px rgba(255, 77, 95, 0.22));
}

.match-result {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.match-result.win {
  border-color: rgba(130, 247, 191, 0.28);
  background: rgba(130, 247, 191, 0.08);
  color: var(--good);
}

.match-result.loss {
  border-color: rgba(255, 142, 169, 0.24);
  background: rgba(255, 142, 169, 0.08);
  color: var(--danger);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  padding: 0 0 46px;
  color: var(--muted);
}

.footer strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes menu-rise {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sheen-sweep {
  from {
    transform: translateX(-135%);
  }
  to {
    transform: translateX(135%);
  }
}

@keyframes arena-scan {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 90px 0, 0 80px;
  }
}

@keyframes profile-border-surge {
  0%, 100% {
    opacity: 0.12;
    transform: translateX(-58%) skewX(-18deg);
  }
  48% {
    opacity: 0.38;
    transform: translateX(58%) skewX(-18deg);
  }
}

@keyframes render-float {
  0%, 100% {
    transform: translateY(0) rotate(-0.35deg) scale(1);
  }
  50% {
    transform: translateY(-5px) rotate(0.35deg) scale(1.006);
  }
}

@keyframes ember-pulse {
  0%, 100% {
    opacity: 0.22;
    filter: blur(0);
  }
  50% {
    opacity: 0.46;
    filter: blur(1px);
  }
}

@keyframes stat-pop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body[data-page="player"] {
  background:
    linear-gradient(90deg, rgba(255, 77, 95, 0.032) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 77, 95, 0.028) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 46, 99, 0.12), transparent 34%),
    linear-gradient(225deg, rgba(255, 138, 61, 0.08), transparent 42%),
    linear-gradient(180deg, #1c0508 0%, #100307 50%, #050102 100%);
  background-size: 180px 180px, 180px 180px, auto, auto, auto;
  animation: arena-scan 70s linear infinite;
}

body[data-page="player"] .page {
  padding-top: 24px;
}

body[data-page="duel"] .page {
  padding-top: 24px;
}

body[data-page="player"] .static-back-link {
  width: fit-content;
  margin-bottom: 18px;
  border-color: rgba(255, 77, 95, 0.36);
  background:
    linear-gradient(135deg, rgba(255, 77, 95, 0.14), rgba(255, 255, 255, 0.035));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

body[data-page="duel"] .static-back-link {
  width: fit-content;
  margin-bottom: 18px;
  border-color: rgba(255, 77, 95, 0.36);
  background:
    linear-gradient(135deg, rgba(255, 77, 95, 0.14), rgba(255, 255, 255, 0.035));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

body[data-page="duel"] .duel-detail-panel {
  width: 100%;
  max-height: none;
  overflow: visible;
  border-color: rgba(255, 77, 95, 0.32);
  background:
    linear-gradient(135deg, rgba(255, 77, 95, 0.13), transparent 34%),
    linear-gradient(180deg, rgba(40, 9, 14, 0.98), rgba(12, 3, 6, 0.98));
}

body[data-page="duel"] .match-id-line {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}

body[data-page="duel"] #copyDuelLink {
  width: 46px;
  min-width: 46px;
  min-height: 46px;
  border-radius: 12px;
  border-color: rgba(255, 200, 87, 0.3);
  color: #ffd58a;
  background:
    linear-gradient(135deg, rgba(255, 77, 95, 0.14), rgba(255, 200, 87, 0.08));
}

body[data-page="duel"] #copyDuelLink:hover {
  transform: translateY(-1px);
}

body[data-page="duel"] #copyDuelLink.copied {
  border-color: rgba(130, 247, 191, 0.42);
  color: var(--good);
  background:
    linear-gradient(135deg, rgba(130, 247, 191, 0.16), rgba(255, 255, 255, 0.035));
}

body[data-page="duel"] .match-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

body[data-page="player"] .player-shell {
  grid-template-columns: minmax(350px, 430px) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

body[data-page="player"] .player-summary,
body[data-page="player"] .profile-overview,
body[data-page="player"] .profile-subpanel {
  overflow: hidden;
  border-color: rgba(255, 77, 95, 0.32);
  background:
    linear-gradient(135deg, rgba(255, 77, 95, 0.13), transparent 34%),
    linear-gradient(180deg, rgba(40, 9, 14, 0.98), rgba(12, 3, 6, 0.98));
}

body[data-page="player"] .player-summary::after,
body[data-page="player"] .profile-overview::after,
body[data-page="player"] .profile-subpanel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(100deg, transparent 0%, rgba(255, 77, 95, 0.08) 42%, rgba(255, 200, 87, 0.06) 50%, transparent 58%);
  opacity: 0.16;
  transform: translateX(-58%) skewX(-18deg);
  animation: profile-border-surge 18s var(--ease-smooth) infinite;
}

body[data-page="player"] .player-summary {
  display: flex;
  flex-direction: column;
  min-height: 690px;
  padding: 26px;
}

body[data-page="player"] .player-summary-head {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

body[data-page="player"] .player-identity {
  gap: 12px;
}

body[data-page="player"] .player-identity h2 {
  max-width: 100%;
  font-size: clamp(1.8rem, 3.15vw, 3.7rem);
  line-height: 0.9;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  text-shadow:
    0 0 26px rgba(255, 77, 95, 0.26),
    0 8px 32px rgba(0, 0, 0, 0.36);
}

body[data-page="player"] .profile-rank {
  width: fit-content;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 77, 95, 0.35);
  border-radius: 10px;
  background: rgba(255, 77, 95, 0.09);
  color: #ff7b86;
}

body[data-page="player"] .profile-rank.rank-placement {
  border-color: rgba(255, 200, 87, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 200, 87, 0.18), rgba(255, 77, 95, 0.1));
  color: #ffd58a;
  box-shadow:
    0 0 0 3px rgba(255, 200, 87, 0.06),
    0 14px 30px rgba(255, 77, 95, 0.12);
}

body[data-page="player"] .profile-rank.rank-copper {
  border-color: rgba(205, 127, 50, 0.5);
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(92, 42, 21, 0.18));
  color: #f0ae6d;
}

body[data-page="player"] .profile-rank.rank-iron {
  border-color: rgba(205, 214, 224, 0.45);
  background: linear-gradient(135deg, rgba(205, 214, 224, 0.16), rgba(78, 86, 96, 0.14));
  color: #dbe4ec;
  box-shadow: 0 12px 26px rgba(180, 196, 210, 0.08);
}

body[data-page="player"] .profile-rank.rank-gold {
  border-color: rgba(255, 200, 87, 0.54);
  background: linear-gradient(135deg, rgba(255, 200, 87, 0.22), rgba(160, 101, 16, 0.15));
  color: #ffd46f;
}

body[data-page="player"] .profile-rank.rank-emerald {
  border-color: rgba(95, 236, 171, 0.48);
  background: linear-gradient(135deg, rgba(95, 236, 171, 0.18), rgba(24, 104, 74, 0.14));
  color: #83f5bd;
}

body[data-page="player"] .profile-rank.rank-diamond {
  border-color: rgba(118, 221, 255, 0.5);
  background: linear-gradient(135deg, rgba(118, 221, 255, 0.2), rgba(36, 94, 135, 0.15));
  color: #9de9ff;
}

body[data-page="player"] .profile-rank.rank-netherite {
  border-color: rgba(184, 143, 255, 0.52);
  background: linear-gradient(135deg, rgba(184, 143, 255, 0.2), rgba(78, 48, 104, 0.18));
  color: #d8c0ff;
}

body[data-page="player"] .profile-rank.rank-elytra {
  border-color: rgba(110, 255, 222, 0.5);
  background: linear-gradient(135deg, rgba(110, 255, 222, 0.18), rgba(255, 200, 87, 0.13));
  color: #a7ffe9;
  box-shadow:
    0 0 0 3px rgba(110, 255, 222, 0.06),
    0 16px 32px rgba(110, 255, 222, 0.1);
}

body[data-page="player"] .profile-rank.rank-unranked {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
}

body[data-page="player"] #copyProfileLink {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 11px;
  border-color: rgba(255, 200, 87, 0.3);
  color: #ffd58a;
  background:
    linear-gradient(135deg, rgba(255, 77, 95, 0.14), rgba(255, 200, 87, 0.08));
}

body[data-page="player"] #copyProfileLink:hover {
  transform: translateY(-1px);
}

body[data-page="player"] #copyProfileLink.copied {
  border-color: rgba(130, 247, 191, 0.42);
  color: var(--good);
  background:
    linear-gradient(135deg, rgba(130, 247, 191, 0.16), rgba(255, 255, 255, 0.035));
}

body[data-page="player"] .profile-render-wrap {
  flex: 1;
  min-height: 430px;
  border-color: rgba(255, 77, 95, 0.42);
  background:
    linear-gradient(90deg, rgba(255, 77, 95, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 77, 95, 0.05) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 74%, rgba(255, 46, 99, 0.3), transparent 42%),
    linear-gradient(180deg, rgba(64, 12, 17, 0.88), rgba(16, 4, 7, 0.96));
  background-size: 36px 36px, 36px 36px, auto, auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -80px 120px rgba(255, 46, 99, 0.09),
    0 28px 70px rgba(0, 0, 0, 0.32);
}

body[data-page="player"] .profile-render-wrap::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 32px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, rgba(255, 77, 95, 0.36), rgba(255, 200, 87, 0.18), transparent);
  filter: blur(12px);
  animation: ember-pulse 8s ease-in-out infinite;
}

body[data-page="player"] .profile-render.loaded {
  animation: render-float 10s ease-in-out infinite;
  opacity: 1;
  max-height: 410px;
  filter:
    brightness(1.08)
    contrast(1.08)
    drop-shadow(0 30px 34px rgba(0, 0, 0, 0.46))
    drop-shadow(0 0 18px rgba(255, 77, 95, 0.18));
}

body[data-page="player"] .player-details {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-content: start;
  gap: 24px;
}

body[data-page="player"] .profile-overview {
  padding: 28px;
}

body[data-page="player"] .profile-overview .panel-head h2,
body[data-page="player"] .profile-subpanel .panel-head h2 {
  font-size: clamp(2rem, 4vw, 3.45rem);
  line-height: 0.95;
}

body[data-page="player"] .profile-stats {
  gap: 14px;
}

body[data-page="player"] .profile-stat-card {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  border-color: rgba(255, 77, 95, 0.26);
  background:
    linear-gradient(135deg, rgba(255, 77, 95, 0.14), transparent 58%),
    rgba(255, 255, 255, 0.036);
  animation: stat-pop 520ms var(--ease-smooth) both;
}

body[data-page="player"] .profile-stat-card:nth-child(2) { animation-delay: 70ms; }
body[data-page="player"] .profile-stat-card:nth-child(3) { animation-delay: 140ms; }
body[data-page="player"] .profile-stat-card:nth-child(4) { animation-delay: 210ms; }
body[data-page="player"] .profile-stat-card:nth-child(5) { animation-delay: 280ms; }

body[data-page="player"] .profile-stat-card::after {
  content: "";
  position: absolute;
  inset: auto -20% 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--gold), transparent);
  opacity: 0.64;
}

body[data-page="player"] .profile-stat-card strong {
  font-size: clamp(2rem, 3vw, 3.15rem);
  color: #fff8f8;
  text-shadow: 0 0 22px rgba(255, 77, 95, 0.22);
}

body[data-page="player"] .profile-stat-card.feature {
  border-color: rgba(255, 200, 87, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 200, 87, 0.18), transparent 48%),
    linear-gradient(180deg, rgba(255, 77, 95, 0.16), rgba(255, 255, 255, 0.035));
}

body[data-page="player"] .profile-modes-panel .mini-mode-card,
body[data-page="player"] .recent-match-card {
  border-color: rgba(255, 77, 95, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 77, 95, 0.12), transparent 62%),
    rgba(255, 255, 255, 0.035);
}

body[data-page="player"] .profile-modes-panel .mini-mode-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px 14px;
}

body[data-page="player"] .profile-modes-panel .mini-mode-card strong {
  grid-column: 1 / -1;
  color: #fff6f6;
}

body[data-page="player"] .profile-modes-panel .mini-mode-card span {
  color: var(--cyan);
}

body[data-page="player"] .profile-modes-panel .mini-mode-card small {
  justify-self: end;
  text-align: right;
}

body[data-page="player"] .recent-match-list {
  gap: 12px;
}

body[data-page="player"] .recent-match-card {
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 58px;
}

body[data-page="player"] .recent-match-card:hover,
body[data-page="player"] .profile-modes-panel .mini-mode-card:hover,
body[data-page="player"] .profile-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 77, 95, 0.44);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.26),
    0 0 20px rgba(255, 46, 99, 0.08);
}

body[data-page="player"] .player-summary:hover::after,
body[data-page="player"] .profile-overview:hover::after,
body[data-page="player"] .profile-subpanel:hover::after {
  opacity: 0.36;
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="player"],
  body[data-page="player"] .player-summary::after,
  body[data-page="player"] .profile-overview::after,
  body[data-page="player"] .profile-subpanel::after,
  body[data-page="player"] .profile-render-wrap::after,
  body[data-page="player"] .profile-render.loaded,
  body[data-page="player"] .profile-stat-card {
    animation: none;
  }
}

@media (max-width: 1100px) {
  .leaderboard-hero,
  .home-hero,
  .section-grid,
  .player-shell {
    grid-template-columns: 1fr;
  }

  .player-details,
  .overview-grid,
  .featured-grid,
  .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-overview {
    grid-column: 1 / -1;
  }

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

  .leaderboard-panel {
    margin-top: -22px;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(170px, 220px) minmax(130px, 160px);
  }

  .toolbar > .ghost-btn {
    width: 100%;
  }
}

@media (max-width: 800px) {
  .container {
    width: min(var(--max), calc(100% - 22px));
  }

  .topbar,
  .player-summary-head,
  .footer {
    flex-direction: column;
    align-items: stretch;
  }

  .tabs,
  .footer-links,
  .hero-actions,
  .panel-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .topbar {
    gap: 14px;
    padding: 14px;
  }

  .brand {
    justify-content: flex-start;
  }

  .nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: 0 1 auto;
    justify-content: stretch;
  }

  .nav-links .status-pill {
    grid-column: 1 / -1;
  }

  .nav-links a,
  .status-pill,
  .ghost-btn,
  .primary-btn,
  .tab,
  .footer-links a,
  .static-back-link {
    width: 100%;
  }

  .toolbar,
  .overview-grid,
  .featured-grid,
  .mode-card-grid,
  .rank-grid,
  .player-details,
  .profile-stats,
  .recent-match-grid {
    grid-template-columns: 1fr;
  }

  .profile-overview {
    grid-column: auto;
  }

  .recent-match-card {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .leaderboard-banner {
    height: 150px;
    min-height: 0;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
  }

  .leaderboard-panel {
    margin-top: -16px;
    padding-top: 22px;
  }

  .match-modal {
    padding: 12px;
  }

  .match-modal-dialog {
    width: min(100vw - 16px, 1480px);
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

  .match-hero,
  .match-duel-grid,
  .match-stat-grid {
    grid-template-columns: 1fr;
  }

  .match-hero-player,
  .match-hero-player.opponent,
  .match-side-head {
    justify-content: flex-start;
    text-align: left;
    flex-direction: row;
  }

  .nav-links,
  .footer-links,
  .tabs {
    gap: 10px;
  }

  table, thead, tbody, tr, td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  .table-wrap {
    border: 0;
    background: transparent;
  }

  .player-row,
  tbody tr {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
  }

  td {
    padding: 6px 0;
    border-bottom: 0;
  }

  td[data-label="Player"]::before {
    display: none;
  }

  .player-meta strong,
  .match-hero-copy strong,
  .recent-match-opponent {
    overflow-wrap: anywhere;
    white-space: normal;
  }

  td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
}

@media (max-width: 480px) {
  .container {
    width: min(var(--max), calc(100% - 16px));
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .brand-kicker {
    font-size: 10px;
  }

  .brand-name {
    font-size: 18px;
  }

  .nav-links a,
  .status-pill,
  .ghost-btn,
  .primary-btn,
  .tab,
  .footer-links a,
  .static-back-link {
    min-height: 42px;
    padding: 0 12px;
    font-size: 12px;
  }

  .panel {
    padding: 18px;
  }

  h2 {
    font-size: clamp(1.55rem, 10vw, 2.2rem);
  }

  .profile-render-wrap {
    min-height: 300px;
  }

  .profile-render {
    max-height: 270px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
