:root {
  --rdx-ink: #d8e6ff;
  --rdx-muted: #a4b4d3;
  --rdx-surface: #0a1222;
  --rdx-surface-soft: #111d33;
  --rdx-border: #263a5f;
  --rdx-accent: #2ea499;
  --rdx-accent-dark: #3cb8ab;
  --rdx-nav-bg: #0c1424;
  --rdx-nav-border: rgba(255,255,255,0.08);
  --rdx-nav-text: #e8f0ff;
  --rdx-nav-text-muted: rgba(200,216,255,0.55);
  --rdx-nav-hover-bg: rgba(255,255,255,0.07);
  --rdx-profile-bg: #0f1d35;
  --rdx-profile-hover-bg: #142545;
  --rdx-profile-menu-bg: #17243d;
  --rdx-profile-menu-border: rgba(126, 147, 189, 0.25);
  --rdx-profile-menu-shadow: 0 18px 36px rgba(10, 18, 33, 0.35);
  --rdx-profile-title: #f3f7ff;
  --rdx-profile-subtitle: #a5b6d8;
  --rdx-profile-logout-bg: #0d182d;
  --rdx-profile-logout-border: rgba(126, 147, 189, 0.35);
  --rdx-profile-logout-text: #d8e6ff;
  --rdx-profile-logout-hover-bg: #0b1426;
  --rdx-profile-logout-hover-border: rgba(170, 188, 224, 0.6);
  --rdx-team-detail-sprite-height: 96px;
  --rdx-team-detail-sprite-scale: 1;
}

body.theme-dark {
  --rdx-ink: #d8e6ff;
  --rdx-muted: #a4b4d3;
  --rdx-surface: #0a1222;
  --rdx-surface-soft: #111d33;
  --rdx-border: #263a5f;
  --rdx-accent: #2ea499;
  --rdx-accent-dark: #3cb8ab;
  --rdx-nav-bg: #0c1424;
  --rdx-nav-border: rgba(255,255,255,0.08);
  --rdx-nav-text: #e8f0ff;
  --rdx-nav-text-muted: rgba(200,216,255,0.55);
  --rdx-nav-hover-bg: rgba(255,255,255,0.07);
  --rdx-profile-bg: #0f1d35;
  --rdx-profile-hover-bg: #142545;
  --rdx-profile-menu-bg: #17243d;
  --rdx-profile-menu-border: rgba(126, 147, 189, 0.25);
  --rdx-profile-menu-shadow: 0 18px 36px rgba(10, 18, 33, 0.35);
  --rdx-profile-title: #f3f7ff;
  --rdx-profile-subtitle: #a5b6d8;
  --rdx-profile-logout-bg: #0d182d;
  --rdx-profile-logout-border: rgba(126, 147, 189, 0.35);
  --rdx-profile-logout-text: #d8e6ff;
  --rdx-profile-logout-hover-bg: #0b1426;
  --rdx-profile-logout-hover-border: rgba(170, 188, 224, 0.6);
}

html {
  font-size: 15px;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  font-family: "Manrope", sans-serif;
  color: var(--rdx-ink);
  background:
    radial-gradient(circle at 85% -10%, rgba(70, 59, 23, 0.45) 0%, transparent 35%),
    radial-gradient(circle at 0% 0%, rgba(27, 58, 53, 0.45) 0%, transparent 30%),
    var(--rdx-surface);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color-scheme: dark;
}

body.theme-dark {
  background:
    radial-gradient(circle at 85% -10%, rgba(70, 59, 23, 0.45) 0%, transparent 35%),
    radial-gradient(circle at 0% 0%, rgba(27, 58, 53, 0.45) 0%, transparent 30%),
    var(--rdx-surface);
}

h1,
h2,
h3,
.navbar-brand,
.hero-title {
  font-family: "DM Serif Display", serif;
}

.page-wrap {
  flex: 1 0 auto;
}

.footer {
  flex-shrink: 0;
}

/* ── Full-width themed nav ──────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav {
  background: var(--rdx-nav-bg);
  border-bottom: 1px solid var(--rdx-nav-border);
  transition: background 0.2s, border-color 0.2s;
}

.site-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sprite-style-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.sprite-style-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--rdx-nav-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.sprite-style-select {
  min-width: 108px;
  border-radius: 999px;
  border: 1px solid var(--rdx-border);
  background: var(--rdx-surface-soft);
  color: var(--rdx-ink);
  font-size: 0.78rem;
  font-weight: 600;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}

.sprite-style-select:focus {
  border-color: var(--rdx-accent);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--rdx-accent) 24%, transparent);
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.5rem;
}

.site-nav-left {
  display: flex;
  align-items: center;
}

.site-nav-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--rdx-muted);
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.site-nav-link:hover {
  color: var(--rdx-ink);
  background: var(--rdx-hover);
}

.brand-logo {
  height: 36px;
  width: 36px;
  object-fit: contain;
  border-radius: 8px;
}

.brand-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--rdx-nav-text);
  font-family: "DM Serif Display", serif;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.brand-wordmark:hover {
  color: var(--rdx-accent);
}

.brand-mark {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 33%, #61d4c8, #0f766e 70%);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.3);
  flex-shrink: 0;
}

.nav-cta {
  border: none;
  border-radius: 999px;
  color: var(--rdx-nav-text);
  background: transparent;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.35rem 0.9rem;
}

.nav-cta:hover,
.nav-cta:focus {
  color: var(--rdx-accent);
  background: var(--rdx-nav-hover-bg);
}



.navbar-brand {
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

.nav-link {
  color: var(--rdx-ink);
  font-weight: 600;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--rdx-accent-dark);
}

.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--rdx-profile-bg);
  color: var(--rdx-nav-text);
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-weight: 700;
  transition: background 0.2s, color 0.2s;
}

.profile-trigger:hover,
.profile-trigger:focus,
.profile-trigger:active {
  background: var(--rdx-profile-hover-bg);
  color: var(--rdx-nav-text);
}

.profile-dot {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #98b8ff, #3e5ea8 68%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.profile-menu {
  min-width: 220px;
  border-radius: 14px;
  border: 1px solid var(--rdx-profile-menu-border);
  background: var(--rdx-profile-menu-bg);
  box-shadow: var(--rdx-profile-menu-shadow);
}

.profile-title {
  color: var(--rdx-profile-title);
  font-weight: 700;
}

.profile-subtitle {
  color: var(--rdx-profile-subtitle);
  font-size: 0.86rem;
  margin-top: 0.18rem;
}

.btn-profile-logout {
  background: var(--rdx-profile-logout-bg);
  border: 1px solid var(--rdx-profile-logout-border);
  color: var(--rdx-profile-logout-text);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font-weight: 600;
}

.btn-profile-logout:hover,
.btn-profile-logout:focus {
  background: var(--rdx-profile-logout-hover-bg);
  color: var(--rdx-profile-logout-text);
  border-color: var(--rdx-profile-logout-hover-border);
}

.btn-brand {
  background: var(--rdx-accent);
  color: #fff;
  border-color: var(--rdx-accent);
}

.btn-brand:hover,
.btn-brand:focus {
  background: var(--rdx-accent-dark);
  border-color: var(--rdx-accent-dark);
  color: #fff;
}

.hero-panel,
.card-soft,
.auth-card {
  background: var(--rdx-surface-soft);
  border: 1px solid var(--rdx-border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(18, 38, 63, 0.08);
}

body.theme-dark.auth-dark-page .auth-card {
  background: rgba(17, 29, 51, 0.82);
  border-color: rgba(120, 150, 205, 0.35);
  box-shadow: 0 24px 60px rgba(5, 10, 18, 0.55);
}

body.theme-dark.auth-dark-page .text-muted {
  color: #a9bddf !important;
}

body.theme-dark.auth-dark-page .alert-info {
  background: rgba(61, 110, 196, 0.2);
  border-color: rgba(116, 160, 233, 0.35);
  color: #d6e8ff;
}

.hero-panel {
  padding: clamp(1.5rem, 4vw, 3rem);
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: var(--rdx-accent-dark);
  font-size: 0.78rem;
}

.hero-title {
  max-width: 20ch;
}

.feature-grid,
.updates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.feature-card,
.update-card {
  background: #fff;
  border: 1px solid var(--rdx-border);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 6px 20px rgba(18, 38, 63, 0.06);
}

.feature-card h3,
.update-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.feature-card p,
.update-card p {
  margin-bottom: 0;
  color: var(--rdx-muted);
}

.update-date {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--rdx-accent-dark);
  margin-bottom: 0.4rem;
}

.card-soft {
  border-radius: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  background: #eef5ff;
  color: #32445b;
  font-size: 0.85rem;
}

.chip-remove {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 0.8rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.tag-input-wrap {
  min-height: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  cursor: text;
}

.tag-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-entry {
  border: 0;
  outline: none;
  min-width: 170px;
  flex: 1;
  padding: 0.2rem;
  font: inherit;
  background: transparent;
}

.link-strong {
  font-weight: 700;
  color: var(--rdx-accent-dark);
  text-decoration: none;
}

.link-strong:hover,
.link-strong:focus {
  text-decoration: underline;
}

.auth-shell {
  min-height: calc(100vh - 220px);
  display: grid;
  place-items: center;
  padding: 1rem 0;
}

.auth-card {
  width: min(100%, 460px);
  padding: 1.5rem;
}

.auth-switch {
  margin-top: 1rem;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--rdx-ink);
  font-size: 1.01rem;
}

.auth-switch-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.24rem 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(115, 156, 255, 0.52);
  background: rgba(16, 42, 87, 0.5);
  color: #bcd8ff;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.2;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.auth-switch-link:hover,
.auth-switch-link:focus {
  color: #e6f0ff;
  border-color: rgba(143, 183, 255, 0.78);
  background: rgba(26, 59, 112, 0.72);
  text-decoration: none;
}

.form-control,
.form-select {
  border-color: #cfdae8;
}

.modal {
  --bs-modal-header-border-color: #cfdae8;
  --bs-modal-footer-border-color: #cfdae8;
}

.form-control:focus,
.form-select:focus,
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.22);
  border-color: var(--rdx-accent);
}

.reveal-item {
  opacity: 0;
  transform: translateY(8px);
  animation: revealUp 500ms ease-out forwards;
}

.reveal-delay-1 {
  animation-delay: 120ms;
}

.reveal-delay-2 {
  animation-delay: 240ms;
}

.team-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1030;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.28);
}

@media (max-width: 576px) {
  .team-fab {
    right: 0.9rem;
    bottom: 0.9rem;
    padding: 0.58rem 0.88rem;
  }
}

@keyframes revealUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.theme-toggle-btn {
  border-radius: 999px;
  border: none;
  color: var(--rdx-nav-text-muted);
  background: transparent;
  font-size: 1.1rem;
  min-width: 40px;
  padding: 0.35rem 0.5rem;
  transition: color 0.2s, background 0.2s;
}

.theme-toggle-btn:hover,
.theme-toggle-btn:focus {
  color: var(--rdx-nav-text);
  background: var(--rdx-nav-hover-bg);
}

body.theme-dark .feature-card,
body.theme-dark .update-card,
body.theme-dark .table,
body.theme-dark .modal-content,
body.theme-dark .toast {
  background: #111d33;
  color: var(--rdx-ink);
  border-color: var(--rdx-border);
}

body.theme-dark .btn-close {
  filter: invert(1);
}

body.theme-dark dt,
body.theme-dark dd,
body.theme-dark .card,
body.theme-dark .card-body {
  color: var(--rdx-ink);
  --bs-body-color: var(--rdx-ink);
}

body.theme-dark .chip {
  background: rgba(255, 255, 255, 0.08);
  color: var(--rdx-ink);
}

body.theme-dark .table {
  --bs-table-color: var(--rdx-ink);
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
  --bs-table-border-color: var(--rdx-border);
}

body.theme-dark .text-muted,
body.theme-dark .form-text {
  color: var(--rdx-muted) !important;
}

body.theme-dark .footer {
  border-top: 1px solid rgba(76, 103, 148, 0.3);
}

body.theme-dark .form-control,
body.theme-dark .form-select,
body.theme-dark .tag-input-wrap {
  background-color: #0f1a2e;
  color: var(--rdx-ink);
  border-color: #2a4067;
}

body.theme-dark .modal {
  --bs-modal-header-border-color: #2a4067;
  --bs-modal-footer-border-color: #2a4067;
}

body.theme-dark .form-control::placeholder,
body.theme-dark .tag-entry::placeholder {
  color: #6c83ae;
}

body.theme-dark .tag-entry {
  color: var(--rdx-ink);
}

body.theme-dark .profile-menu {
  background: #0f1a30;
}

/* ── Admin panel ─────────────────────────────────────── */
.nav-admin-link {
  color: var(--rdx-accent) !important;
  font-weight: 700;
}

/* ── Dashboard ───────────────────────────────────────── */
.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-count {
  font-size: 0.82rem;
  background: var(--rdx-border);
  color: var(--rdx-muted);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-weight: 600;
  margin-left: 0.4rem;
}

.link-muted {
  color: var(--rdx-muted);
  text-decoration: none;
  font-weight: 600;
}

.link-muted:hover {
  color: var(--rdx-accent);
}

.meta-usage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.meta-usage-item {
  min-width: 0;
}

.meta-usage-card {
  padding: 0.75rem 0.65rem 0.7rem;
  border-radius: 16px;
  overflow: hidden;
}

.meta-usage-sprite-wrap {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.35rem;
  padding-top: 0.1rem;
}

.meta-usage-rank {
  position: absolute;
  top: -0.15rem;
  left: -0.05rem;
  font-size: 0.68rem;
}

.meta-usage-sprite {
  width: 64px;
  height: 64px;
  object-fit: contain;
  object-position: center;
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.22));
}

.meta-usage-name {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  min-height: 2.05em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta-usage-value {
  margin-top: 0.3rem;
  font-size: 0.94rem;
  font-weight: 800;
  color: #8f86ff;
}

.meta-usage-bar {
  margin-top: 0.45rem;
  height: 5px;
  border-radius: 999px;
  background: rgba(188, 201, 228, 0.18);
  overflow: hidden;
}

.meta-usage-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #766df4 0%, #a39cff 100%);
}

.meta-tournament-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 420px));
  gap: 1rem;
  align-items: start;
}

.meta-tournament-link {
  display: block;
  height: 100%;
}

.meta-tournament-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1rem 1.15rem;
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(46, 164, 153, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--rdx-surface-soft);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.meta-tournament-card:hover,
.meta-tournament-link:focus-visible .meta-tournament-card {
  transform: translateY(-2px);
  border-color: rgba(46, 164, 153, 0.45);
  box-shadow: 0 14px 28px rgba(5, 10, 20, 0.2);
}

.meta-tournament-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.meta-tournament-intro {
  min-width: 0;
}

.meta-tournament-location-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.meta-tournament-pennant {
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem 0.9rem 0.4rem 0.9rem;
  background: linear-gradient(145deg, rgba(46, 164, 153, 0.95), rgba(17, 120, 111, 0.95));
  color: #f5fffd;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 18px rgba(9, 30, 28, 0.22);
}

.meta-tournament-location {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--rdx-ink);
}

.meta-tournament-type {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rdx-accent-dark);
  font-weight: 700;
}

.meta-tournament-title {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  line-height: 1.1;
  color: var(--rdx-ink);
}

.meta-tournament-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
  flex: 1 1 auto;
}

.meta-tournament-body > div:first-child {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 0.55rem;
}

.meta-tournament-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  font-size: 0.92rem;
}

.meta-tournament-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(163, 177, 211, 0.18);
  color: var(--rdx-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.meta-tournament-badge {
  flex: 0 0 auto;
  font-size: 0.74rem;
}

.meta-tournament-aside {
  flex: 0 0 auto;
  min-width: 92px;
  text-align: right;
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  background: rgba(7, 14, 29, 0.34);
  border: 1px solid rgba(163, 177, 211, 0.1);
}

.meta-tournament-stat-value {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--rdx-ink);
}

.meta-tournament-stat-label {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rdx-muted);
}

.meta-tournament-footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(163, 177, 211, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.meta-tournament-cta {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--rdx-accent);
}

.meta-tournament-arrow {
  color: var(--rdx-accent);
  font-size: 1rem;
  font-weight: 700;
}

@media (min-width: 576px) {
  .meta-usage-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  .meta-usage-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .meta-usage-card {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  .meta-usage-sprite {
    width: 58px;
    height: 58px;
  }
}

@media (max-width: 767.98px) {
  .meta-tournament-list {
    grid-template-columns: 1fr;
  }

  .meta-tournament-head {
    flex-direction: column;
    gap: 0.7rem;
  }

  .meta-tournament-body {
    grid-template-columns: 1fr;
  }

  .meta-tournament-aside {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .meta-tournament-badge {
    align-self: flex-start;
  }
}

.empty-state {
  background: var(--rdx-surface-soft);
  border: 1px dashed var(--rdx-border);
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.core-pair-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 178px;
}

.core-pair-sprites {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.5rem;
  min-height: 84px;
  margin-bottom: 0.6rem;
}

.core-pair-sprite {
  width: 76px;
  height: 76px;
  object-fit: contain;
  object-position: center bottom;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.25));
}

.core-pair-plus {
  color: #dbe6ff;
  font-weight: 700;
  opacity: 0.85;
  transform: translateY(-3px);
}

.core-pair-name {
  min-height: 2.4em;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  line-height: 1.2;
  font-weight: 700;
  color: var(--rdx-ink);
}

.core-pair-score {
  margin-top: 0.3rem;
  font-size: 0.96rem;
  line-height: 1.1;
  font-weight: 700;
  color: #35bdb1;
}

.core-pair-score-loss {
  color: #f87171;
}

.team-loss-core-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.9rem;
}

.team-loss-core-card {
  min-height: 156px;
}

.team-loss-core-card .core-pair-sprite {
  width: 62px;
  height: 62px;
}

.team-loss-core-card .core-pair-sprites {
  min-height: 72px;
  margin-bottom: 0.45rem;
}

.team-tile {
  background: var(--rdx-surface-soft);
  border: 1px solid var(--rdx-border);
  border-radius: 16px;
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
  cursor: pointer;
}

.team-tile:hover {
  border-color: var(--rdx-accent);
  box-shadow: 0 4px 16px rgba(15, 118, 110, 0.08);
}

.team-tile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.team-tile-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--rdx-ink);
  text-decoration: none;
}

.team-tile-name::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.team-tile:hover .team-tile-name {
  color: var(--rdx-accent);
}

.team-tile-delete {
  background: none;
  border: none;
  padding: 0 2px;
  line-height: 1;
  font-size: 1.1rem;
  color: var(--rdx-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.team-tile:hover .team-tile-delete {
  opacity: 1;
}

.team-tile-delete:hover {
  color: #dc3545;
}

.team-tile-footer {
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px solid var(--rdx-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.team-tile-link {
  position: relative;
  z-index: 1;
}

.team-tile-delete-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #dc3545;
  cursor: pointer;
  transition: opacity 0.15s;
}

.team-tile-delete-link:hover {
  opacity: 0.7;
}

.team-tile-reg {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--rdx-accent);
  background: rgba(15, 118, 110, 0.08);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  white-space: nowrap;
}

.team-tile-users {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.team-tile-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--rdx-accent);
  text-decoration: none;
}

.team-tile-link:hover {
  text-decoration: underline;
}

.team-tile-notes {
  font-size: 0.82rem;
  color: var(--rdx-muted);
  margin: 0.4rem 0 0;
}

/* Sprites */
.team-sprite-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 6px 0 4px;
  overflow: hidden;
}

.team-sprite {
  flex: 1 1 0;
  min-width: 0;
  max-width: 68px;
  height: 64px;
  object-fit: contain;
  image-rendering: pixelated;
}

.team-sprite-sm {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: pixelated;
}

/* Team sprite — responsive sizing */
.team-sprite-lg {
  width: 72px;
  height: 72px;
  object-fit: contain;
  image-rendering: pixelated;
}

@media (min-width: 576px) {
  .team-sprite-lg { width: 88px; height: 88px; }
}

@media (min-width: 992px) {
  .team-sprite-lg { width: 108px; height: 108px; }
}

@media (min-width: 1400px) {
  .team-sprite-lg { width: 128px; height: 128px; }
}

/* Team hero card */
.team-hero-card {
  border-left: 4px solid var(--rdx-accent);
}

.team-hero-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.team-hero-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  margin: 0;
  color: var(--rdx-ink);
}

.team-hero-meta {
  font-size: 0.875rem;
  color: var(--rdx-muted);
}

/* Team details two-column layout */
.team-detail-grid {
  display: grid;
  grid-template-columns: 1fr;        /* mobile: stack */
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
}

.team-detail-grid > .card {
  display: flex;
  flex-direction: column;
}

.team-detail-grid > .card > .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .team-detail-grid {
    grid-template-columns: 2fr 1fr;
  }
}

@media (min-width: 1200px) {
  .team-detail-grid {
    grid-template-columns: 2fr 1fr;
  }
}

.team-pokemon-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  justify-content: space-evenly;
  align-items: flex-end;
  overflow: hidden;
}

.team-pokemon-row > div {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}

.team-pokemon-row .team-sprite-lg {
  width: 100%;
  height: var(--rdx-team-detail-sprite-height);
  max-width: 128px;
  object-fit: contain;
  object-position: center bottom;
  transform: scale(var(--rdx-team-detail-sprite-scale));
  transform-origin: center bottom;
}

body[data-sprite-style="gen5"] {
  --rdx-team-detail-sprite-height: 104px;
  --rdx-team-detail-sprite-scale: 1.05;
}

body[data-sprite-style="dex"] {
  --rdx-team-detail-sprite-height: 118px;
  --rdx-team-detail-sprite-scale: 1.18;
}

@media (min-width: 1200px) {
  body[data-sprite-style="gen5"] {
    --rdx-team-detail-sprite-height: 112px;
    --rdx-team-detail-sprite-scale: 1.1;
  }

  body[data-sprite-style="dex"] {
    --rdx-team-detail-sprite-height: 126px;
    --rdx-team-detail-sprite-scale: 1.24;
  }
}

.team-detail-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rdx-muted);
  margin-bottom: 0.2rem;
  margin-top: 0.9rem;
}

.team-detail-label:first-child {
  margin-top: 0;
}

.team-detail-value {
  margin-bottom: 0;
}

/* Teams table */
.teams-table thead th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rdx-muted);
  border-bottom: 1px solid var(--rdx-border);
  padding: 0.75rem 1rem;
}
.teams-table tbody tr {
  border-bottom: 1px solid var(--rdx-border);
}
.teams-table tbody tr:last-child {
  border-bottom: none;
}
.teams-table tbody td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
}
.teams-table-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--rdx-ink);
  line-height: 1.2;
  text-decoration: none;
  display: block;
}
.teams-table-name:hover {
  color: var(--rdx-accent);
  text-decoration: underline;
}
.teams-table-paste-link {
  font-size: 0.75rem;
  color: var(--rdx-accent);
  text-decoration: none;
  display: block;
  margin-top: 0.15rem;
}
.teams-table-paste-link:hover { text-decoration: underline; }
.teams-table-notes {
  font-size: 0.82rem;
  color: var(--rdx-muted);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Teams filter bar */
.teams-filter-search {
  max-width: 260px;
  background: var(--rdx-card);
  border-color: var(--rdx-border);
  color: var(--rdx-ink);
}
.teams-filter-search:focus {
  border-color: var(--rdx-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rdx-accent) 20%, transparent);
}
.teams-filter-reg {
  max-width: 220px;
  background: var(--rdx-card);
  border-color: var(--rdx-border);
  color: var(--rdx-ink);
}
.teams-filter-reg:focus {
  border-color: var(--rdx-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rdx-accent) 20%, transparent);
}
.teams-filter-count {
  font-size: 0.8rem;
  color: var(--rdx-muted);
  margin-left: auto;
}

.admin-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--rdx-ink);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-count {
  font-size: 0.8rem;
  background: var(--rdx-border);
  color: var(--rdx-muted);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-weight: 600;
}

.admin-card {
  background: var(--rdx-surface-soft);
  border: 1px solid var(--rdx-border);
  border-radius: 12px;
  padding: 1.25rem;
}

.admin-table th {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rdx-muted);
  border-bottom: 1px solid var(--rdx-border);
}

.admin-table td {
  border-color: var(--rdx-border);
  vertical-align: middle;
}

.admin-replays-table {
  width: 100%;
  table-layout: fixed;
}

.admin-replays-table th,
.admin-replays-table td {
  padding-top: 0.42rem;
  padding-bottom: 0.42rem;
}

.admin-replays-row {
  transition: background-color 0.15s ease;
}

.admin-replays-row:hover {
  background: rgba(77, 153, 255, 0.08);
}

.admin-replays-check,
.admin-replays-result,
.admin-replays-date {
  white-space: nowrap;
}

.admin-replays-owner {
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.admin-replays-title,
.admin-replays-format {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-replays-team {
  white-space: nowrap;
}

.admin-replays-team-preview {
  display: flex;
  align-items: center;
  gap: 0.12rem;
  min-width: 0;
}

.admin-replays-team-sprite {
  width: 26px;
  height: 26px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.28));
  flex: 0 0 auto;
}

.admin-replays-title a {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.admin-replays-format {
  color: var(--rdx-ink);
}

.admin-replays-table .result-badge {
  min-width: 3.25rem;
  text-align: center;
}

.admin-replays-range {
  white-space: nowrap;
}

.admin-replays-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-replays-search {
  flex: 1 1 360px;
  min-width: 240px;
}

.admin-replays-page-size {
  width: auto;
  min-width: 120px;
}

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

.admin-replays-page-label {
  font-size: 0.88rem;
  color: var(--rdx-muted);
  font-weight: 600;
}

.admin-replays-page-list {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.role-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.role-badge.role-admin {
  background: rgba(15, 118, 110, 0.12);
  color: var(--rdx-accent-dark);
}

.role-badge.role-user {
  background: var(--rdx-border);
  color: var(--rdx-muted);
}

.chip-sm {
  font-size: 0.72rem;
  padding: 0.1rem 0.5rem;
}