:root {
  --bg: #06101d;
  --bg-2: #0a1424;
  --panel: rgba(13, 21, 38, 0.9);
  --panel-2: rgba(16, 25, 45, 0.95);
  --panel-hover: rgba(20, 31, 56, 0.98);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(99, 102, 241, 0.3);
  --text: #edf2ff;
  --text-soft: #a8b5cf;
  --text-dim: #7d89a3;
  --primary: #5865f2;
  --primary-2: #7c3aed;
  --primary-soft: rgba(88, 101, 242, 0.16);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.38);
  --shadow-md: 0 16px 36px rgba(0, 0, 0, 0.26);
  --shadow-sm: 0 10px 20px rgba(0, 0, 0, 0.18);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --sidebar-width: 300px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; scroll-behavior: smooth; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(88, 101, 242, 0.18), transparent 24%),
    radial-gradient(circle at 85% 18%, rgba(124, 58, 237, 0.16), transparent 20%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.10), transparent 16%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.layout { display: grid; grid-template-columns: var(--sidebar-width) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 24px 18px; background: rgba(7, 12, 23, 0.84);
  border-right: 1px solid var(--border); backdrop-filter: blur(18px); overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 14px; padding: 14px; margin-bottom: 18px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(10, 18, 32, 0.96));
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.sidebar-brand-mark {
  width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: white; font-size: 1.25rem;
  box-shadow: 0 12px 24px rgba(88, 101, 242, 0.28);
}
.sidebar-brand-text h2 { margin: 0; font-size: 1.15rem; line-height: 1.1; }
.sidebar-brand-text p { margin: 4px 0 0; color: var(--text-soft); font-size: 0.9rem; }
.user-card {
  display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 18px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(16, 24, 42, 0.98), rgba(10, 18, 32, 0.98));
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.avatar {
  width: 46px; height: 46px; border-radius: 999px; object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.user-name { font-weight: 700; }
.small { font-size: 0.9rem; }
.sidebar-section-label {
  margin: 18px 10px 10px; color: var(--text-dim); font-size: 0.8rem;
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.nav-group { display: grid; gap: 8px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 16px;
  color: var(--text-soft); transition: 0.18s ease; border: 1px solid transparent; background: transparent;
}
.nav-link:hover {
  color: var(--text); background: rgba(88, 101, 242, 0.08); border-color: rgba(88, 101, 242, 0.16);
  transform: translateX(2px);
}
.nav-link.active {
  color: #fff; background: linear-gradient(135deg, rgba(88, 101, 242, 0.20), rgba(124, 58, 237, 0.16));
  border-color: rgba(99, 102, 241, 0.30); box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 12px 28px rgba(31, 41, 55, 0.24);
}
.nav-link.active::before {
  content: ""; position: absolute; left: -2px; top: 10px; bottom: 10px; width: 4px; border-radius: 999px;
  background: linear-gradient(180deg, #93c5fd, #818cf8);
}
.nav-icon {
  width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.04); font-size: 1rem; flex: 0 0 auto;
}
.nav-link.active .nav-icon { background: rgba(255, 255, 255, 0.10); }
.nav-text { display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-weight: 700; line-height: 1.1; }
.nav-subtitle { font-size: 0.82rem; color: var(--text-dim); line-height: 1.1; }
.sidebar-footer { margin-top: 18px; }
.content { padding: 30px; }
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px;
}
.page-header-left { display: flex; flex-direction: column; gap: 8px; }
.page-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 7px 12px; border-radius: 999px;
  background: rgba(88, 101, 242, 0.12); border: 1px solid rgba(88, 101, 242, 0.24); color: #dbe4ff; font-size: 0.85rem; font-weight: 700;
}
.page-title { margin: 0; font-size: 2.2rem; line-height: 1.04; letter-spacing: -0.03em; }
.page-subtitle { margin: 0; max-width: 760px; color: var(--text-soft); line-height: 1.55; }
.page-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.space-between { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.grid { display: grid; gap: 18px; }
.cards-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  position: relative; overflow: hidden; background: linear-gradient(180deg, rgba(14, 22, 38, 0.95), rgba(11, 18, 32, 0.98));
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-md);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease; animation: fadeUp 0.35s ease;
}
.card:hover { transform: translateY(-2px); border-color: rgba(99, 102, 241, 0.22); box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28); }
.card::before {
  content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 1px;
  background: linear-gradient(90deg, rgba(88,101,242,0), rgba(88,101,242,0.42), rgba(88,101,242,0));
}
.panel-title { margin: 0 0 8px; font-size: 2rem; letter-spacing: -0.02em; }
.muted { color: var(--text-soft); }
.kpi-label { color: var(--text-dim); font-size: 0.92rem; margin-bottom: 8px; }
.kpi { font-size: 2rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.kpi-sub { margin-top: 8px; font-size: 0.92rem; color: var(--text-soft); }
.badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; font-size: 0.88rem; font-weight: 700;
  background: rgba(148, 163, 184, 0.12); border: 1px solid rgba(255, 255, 255, 0.06);
}
.badge.health { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.28); }
.badge.degraded { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.28); }
.badge.starting { background: rgba(148, 163, 184, 0.14); border-color: rgba(148, 163, 184, 0.22); }
.badge.error { background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.28); }
.live-dot {
  width: 9px; height: 9px; border-radius: 999px; background: var(--success);
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.1); display: inline-block;
}
button, .oauth-button {
  appearance: none; border: none; border-radius: 14px; padding: 11px 16px; font-weight: 700; color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); cursor: pointer; transition: 0.16s ease;
  box-shadow: 0 10px 24px rgba(88, 101, 242, 0.22);
}
button:hover, .oauth-button:hover { transform: translateY(-1px); filter: brightness(1.03); }
button:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
button.secondary { background: linear-gradient(180deg, #243247, #182538); box-shadow: none; }
button.danger { background: linear-gradient(180deg, #b91c1c, #7f1d1d); }
input, select, textarea {
  width: 100%; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(7, 13, 24, 0.96);
  color: var(--text); padding: 12px 14px; outline: none; transition: 0.16s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(88, 101, 242, 0.46); box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.12);
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 0.9rem; color: var(--text-dim); font-weight: 700; padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
tbody td { padding: 14px 10px; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: top; }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; color: #dbe5f8; }
.flash {
  display: none; margin: 0 0 18px; padding: 14px 16px; border-radius: 14px;
  border: 1px solid rgba(88,101,242,0.3); background: rgba(88,101,242,0.14); color: #eef2ff;
}
.flash.show { display: block; }
.alert { border-radius: 14px; padding: 12px 14px; margin: 12px 0; font-weight: 600; }
.alert.error { background: rgba(127, 29, 29, 0.5); border: 1px solid rgba(239, 68, 68, 0.3); }
.alert.success { background: rgba(20, 83, 45, 0.5); border: 1px solid rgba(34, 197, 94, 0.3); }
.timeline { position: relative; display: grid; gap: 14px; }
.timeline-item { position: relative; padding-left: 22px; }
.timeline-item::before {
  content: ""; position: absolute; left: 5px; top: 8px; width: 10px; height: 10px; border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.timeline-item::after {
  content: ""; position: absolute; left: 9px; top: 22px; bottom: -18px; width: 2px; background: rgba(255,255,255,0.08);
}
.timeline-item:last-child::after { display: none; }
.metric-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.metric-pill { padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); }
.metric-pill strong { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.divider {
  display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-dim);
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.08);
}
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 26px; }
.login-card {
  width: min(460px, 94vw); padding: 30px; border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(10, 18, 32, 0.98));
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.login-card-wide { width: min(560px, 94vw); }
.login-header { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 16px; }
.login-header h1 { margin: 0 0 8px; font-size: 2.4rem; letter-spacing: -0.03em; }
.login-header p { margin: 0; color: var(--text-soft); }
.login-hint { margin-top: 14px; line-height: 1.5; }
.stack { display: grid; gap: 12px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: translateY(0);} }
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .content { padding: 20px; }
  .page-header, .space-between { align-items: flex-start; flex-direction: column; }
}


/* UX final additions */
.page-grid {
  display: grid;
  gap: 18px;
}

.panel-stack {
  display: grid;
  gap: 18px;
}

.card-accent {
  background:
    radial-gradient(circle at top right, rgba(88, 101, 242, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(14, 22, 38, 0.95), rgba(11, 18, 32, 0.98));
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.card-title-row h3,
.card-title-row h2 {
  margin: 0;
}

.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1000;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
}

.toast {
  display: none;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(88,101,242,0.28);
  background: rgba(15, 23, 42, 0.96);
  box-shadow: var(--shadow-md);
  color: var(--text);
}

.toast.show {
  display: block;
  animation: fadeUp 0.2s ease;
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.28);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.28);
}

.status-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(34,197,94,0.35);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.35); }
  70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 17, 0.72);
  backdrop-filter: blur(6px);
  z-index: 1100;
  display: none;
  place-items: center;
  padding: 20px;
}

.modal-backdrop.show {
  display: grid;
}

.modal {
  width: min(520px, 100%);
  border-radius: 22px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(10, 18, 32, 0.99));
  box-shadow: var(--shadow-lg);
  padding: 22px;
}

.modal h3 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.modal p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}

.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0) 100%);
  animation: shimmer 1.1s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-30%); }
  100% { transform: translateX(30%); }
}

.input-help {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 6px;
}

.form-actions-sticky {
  position: sticky;
  bottom: 16px;
  z-index: 5;
}

.soft-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 14px 0 0;
}

.empty-state {
  padding: 24px;
  border-radius: 18px;
  border: 1px dashed rgba(255,255,255,0.1);
  text-align: center;
  color: var(--text-soft);
}

@media (max-width: 980px) {
  .toast-stack {
    right: 12px;
    left: 12px;
    width: auto;
  }
}


/* V6.3 public + admin members */
.public-shell {
  min-height: 100vh;
}

.public-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  background: rgba(7, 12, 23, 0.82);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(14px);
}

.public-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.public-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 24px rgba(88, 101, 242, 0.26);
  font-size: 1.1rem;
}

.public-brand h1 {
  margin: 0;
  font-size: 1.05rem;
}

.public-brand p {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: 0.85rem;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.public-nav a {
  padding: 10px 13px;
  border-radius: 12px;
  color: var(--text-soft);
  border: 1px solid transparent;
  transition: 0.16s ease;
}

.public-nav a:hover,
.public-nav a.active {
  color: var(--text);
  background: rgba(88,101,242,0.10);
  border-color: rgba(88,101,242,0.18);
}

.public-container {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
  align-items: stretch;
}

.hero-card {
  min-height: 280px;
}

.hero-title {
  margin: 0 0 12px;
  font-size: 3rem;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero-subtitle {
  margin: 0;
  max-width: 720px;
  color: var(--text-soft);
  line-height: 1.65;
  font-size: 1.02rem;
}

.public-section-title {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.search-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-bar > * {
  flex: 1 1 220px;
}

.table-rank td:first-child {
  font-weight: 800;
}

.tag {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.82rem;
  color: var(--text-soft);
}

.empty-hero {
  display: grid;
  place-items: center;
  min-height: 220px;
}

@media (max-width: 980px) {
  .public-topbar {
    padding: 14px 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .public-container {
    width: min(1240px, calc(100vw - 24px));
    padding-top: 18px;
  }

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

  .hero-title {
    font-size: 2.25rem;
  }
}


/* V6.3.2 ranking improvements */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sort-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sort-pill {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text-soft);
  cursor: pointer;
  transition: 0.16s ease;
}

.sort-pill:hover,
.sort-pill.active {
  color: var(--text);
  background: rgba(88,101,242,0.12);
  border-color: rgba(88,101,242,0.2);
}

.pagination {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.pagination-info {
  color: var(--text-soft);
  font-size: 0.92rem;
}

.table-sticky thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(11,18,32,0.98);
  backdrop-filter: blur(8px);
}

.link-clean {
  color: inherit;
  text-decoration: none;
}

.player-name-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.player-subline {
  color: var(--text-dim);
  font-size: 0.84rem;
}

.stat-highlight {
  font-weight: 800;
  color: #fff;
}

.filter-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text-soft);
  font-size: 0.92rem;
}


/* V6.3.3 public player profile */
.profile-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.profile-badge {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 24px rgba(88,101,242,0.28);
  font-size: 1.4rem;
}

.progress-block {
  display: grid;
  gap: 8px;
}

.progress-row {
  display: grid;
  gap: 6px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.04);
}

.progress-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

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

.insight-item {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.insight-item strong {
  display: block;
  margin-bottom: 4px;
}

.stat-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.kpi-compact {
  font-size: 1.45rem;
  font-weight: 800;
}

@media (max-width: 980px) {
  .profile-hero {
    grid-template-columns: 1fr;
  }
}


/* V6.4 mobile full responsive */
img { max-width: 100%; }

.sidebar-shell {
  display: grid;
  gap: 14px;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-toggle,
.public-nav-toggle {
  display: none;
  white-space: nowrap;
}

.sidebar-mobile-panel,
.public-nav {
  min-width: 0;
}

.sidebar-logout {
  width: 100%;
}

.page-title,
.hero-title,
.panel-title,
.kpi,
.login-header h1 {
  overflow-wrap: anywhere;
}

.card h1,
.card h2,
.card h3,
.card p,
.page-subtitle,
.hero-subtitle,
.kpi-sub,
.muted,
.badge,
.tag,
.input-help {
  overflow-wrap: anywhere;
}

.table-wrap table {
  min-width: 720px;
}

.table-wrap::-webkit-scrollbar {
  height: 10px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
}

@media (max-width: 1200px) {
  :root {
    --sidebar-width: 270px;
  }

  .content {
    padding: 24px;
  }

  .page-title {
    font-size: 1.95rem;
  }
}

@media (max-width: 980px) {
  body {
    overflow-x: hidden;
  }

  .sidebar {
    padding: 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-toggle,
  .public-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-mobile-panel.is-collapsed,
  .public-nav.is-collapsed {
    display: none;
  }

  .sidebar-mobile-panel.is-open,
  .public-nav.is-open {
    display: grid;
  }

  .sidebar-brand {
    margin-bottom: 0;
    flex: 1 1 auto;
  }

  .sidebar-section-label {
    margin-top: 4px;
  }

  .content {
    padding: 18px 14px 28px;
  }

  .page-header {
    gap: 14px;
    margin-bottom: 18px;
  }

  .page-header-actions {
    width: 100%;
  }

  .page-header-actions > * {
    flex: 1 1 220px;
  }

  .page-title {
    font-size: 1.8rem;
  }

  .page-subtitle {
    font-size: 0.96rem;
  }

  .card {
    padding: 16px;
    border-radius: 16px;
  }

  .cards-2,
  .cards-3,
  .metric-strip,
  .stat-grid-4 {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .card-title-row,
  .space-between,
  .login-header,
  .public-topbar,
  .profile-identity,
  .progress-label {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-bar,
  .sort-pills,
  .pagination,
  .row {
    width: 100%;
  }

  .search-bar > *,
  .sort-pills > *,
  .pagination > *,
  .row > *,
  .page-header-actions > *,
  .public-nav > *,
  .nav-group > *,
  .modal-actions > * {
    width: 100%;
  }

  button,
  .oauth-button {
    width: 100%;
    justify-content: center;
  }

  .public-topbar {
    padding: 14px 16px;
  }

  .public-nav {
    width: 100%;
    display: grid;
    gap: 8px;
  }

  .public-nav a {
    width: 100%;
    text-align: center;
  }

  .public-container {
    width: min(1240px, calc(100vw - 20px));
    padding: 16px 0 28px;
  }

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

  .hero-title {
    font-size: 2rem;
    line-height: 1.02;
  }

  .panel-title,
  .kpi {
    font-size: 1.6rem;
  }

  .login-body {
    padding: 16px;
  }

  .login-card,
  .login-card-wide {
    width: min(100%, 560px);
    padding: 22px 18px;
  }

  .table-wrap {
    margin: 0 -4px;
  }

  .table-wrap table {
    min-width: 640px;
  }

  thead th,
  tbody td {
    padding: 12px 8px;
  }

  .toast-stack {
    top: 12px;
  }

  .modal {
    padding: 18px;
  }

  .form-actions-sticky {
    position: static;
  }
}

@media (max-width: 640px) {
  :root {
    --radius-xl: 20px;
    --radius-lg: 16px;
    --radius-md: 12px;
  }

  .sidebar {
    padding: 12px;
  }

  .sidebar-brand,
  .user-card {
    padding: 12px;
  }

  .sidebar-brand-mark,
  .avatar,
  .public-brand-mark,
  .profile-badge {
    width: 42px;
    height: 42px;
  }

  .sidebar-brand-mark,
  .public-brand-mark {
    border-radius: 14px;
  }

  .page-eyebrow,
  .badge,
  .tag,
  .sort-pill {
    font-size: 0.8rem;
  }

  .page-title {
    font-size: 1.55rem;
  }

  .hero-title {
    font-size: 1.7rem;
  }

  .kpi,
  .panel-title,
  .login-header h1 {
    font-size: 1.4rem;
  }

  .public-brand h1,
  .sidebar-brand-text h2 {
    font-size: 1rem;
  }

  .public-brand p,
  .sidebar-brand-text p,
  .small,
  .pagination-info,
  .filter-meta,
  .player-subline {
    font-size: 0.82rem;
  }

  .card,
  .modal {
    padding: 14px;
  }

  .metric-pill,
  .insight-item {
    padding: 10px 12px;
  }

  .table-wrap table {
    min-width: 560px;
  }
}

/* V6.5 backend filters + member actions */
.filters-form {
  display: grid;
  gap: 14px;
}

.search-bar-wide {
  flex: 1 1 100%;
}

.filters-grid-admin,
.filters-grid-ranking {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  width: 100%;
  align-items: end;
}

.filters-grid-admin label,
.filters-grid-ranking label {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.filters-grid-admin select,
.filters-grid-ranking select,
.inline-form select {
  width: 100%;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 0 12px;
}

.inline-form {
  margin: 0;
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.page-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.page-chip.active {
  background: rgba(88,101,242,0.16);
  border-color: rgba(88,101,242,0.24);
}

.page-chip.disabled {
  pointer-events: none;
  opacity: 0.45;
}

.notice-card {
  margin-bottom: 18px;
}

.notice-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge-ok {
  background: rgba(46, 204, 113, 0.16);
  border-color: rgba(46, 204, 113, 0.28);
  color: #d7ffe7;
}

.badge-danger {
  background: rgba(231, 76, 60, 0.16);
  border-color: rgba(231, 76, 60, 0.28);
  color: #ffdcd7;
}

.badge-admin {
  background: rgba(88,101,242,0.16);
  border-color: rgba(88,101,242,0.24);
  color: #e4e7ff;
}

.badge-user {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
}

button.danger {
  background: rgba(231, 76, 60, 0.18);
  border-color: rgba(231, 76, 60, 0.32);
}

button.danger:hover {
  background: rgba(231, 76, 60, 0.24);
}

@media (max-width: 980px) {
  .row-actions {
    min-width: 220px;
  }

  .page-chip {
    min-width: 36px;
    min-height: 36px;
    padding: 0 10px;
  }
}


.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 11px 16px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 24px rgba(88, 101, 242, 0.22);
}
.button-link.secondary {
  background: linear-gradient(180deg, #243247, #182538);
  box-shadow: none;
}
.button-link:hover { transform: translateY(-1px); }

.notice-card { margin-bottom: 18px; }
.notice-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.badge-ok { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.28); }
.badge-danger { background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.28); }
.badge-admin { background: rgba(88, 101, 242, 0.18); border-color: rgba(88, 101, 242, 0.3); }
.badge-user { background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.22); }

.filters-form { display: grid; gap: 14px; }
.filters-grid-admin,
.filters-grid-ranking {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}
.search-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.search-bar input { flex: 1 1 260px; }
.search-bar-wide { width: 100%; }
.filter-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--text-soft);
}
.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.inline-form {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.empty-state {
  padding: 18px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.08);
  text-align: center;
  color: var(--text-soft);
}
.pagination {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.page-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.page-chip.active {
  background: rgba(88,101,242,0.18);
  border-color: rgba(88,101,242,0.32);
}
.page-chip.disabled {
  opacity: 0.45;
  pointer-events: none;
}
.pagination-info { color: var(--text-soft); }
.player-name-cell { display: grid; gap: 4px; }
.player-subline { color: var(--text-dim); font-size: 0.88rem; }
.stat-highlight { font-weight: 800; }
.table-sticky { overflow-x: auto; }
.link-clean { color: inherit; text-decoration: none; }
.link-clean:hover { text-decoration: underline; }

.public-shell { min-height: 100vh; }
.public-container {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 32px;
}
.public-topbar {
  width: min(1200px, calc(100vw - 32px));
  margin: 20px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(14, 22, 38, 0.95), rgba(11, 18, 32, 0.98));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.public-brand { display: flex; align-items: center; gap: 14px; }
.public-brand-mark,
.sidebar-brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 28px rgba(88,101,242,0.28);
}
.public-brand h1 { margin: 0; font-size: 1.15rem; }
.public-brand p { margin: 4px 0 0; color: var(--text-soft); font-size: 0.9rem; }
.public-nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.public-nav a {
  color: var(--text-soft);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.public-nav a.active,
.public-nav a:hover {
  color: var(--text);
  background: rgba(88,101,242,0.12);
  border-color: rgba(88,101,242,0.22);
}
.public-nav-toggle,
.sidebar-toggle { display: none; }
.hero-card { padding: 28px; }
.hero-title { margin: 10px 0 12px; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.02; }
.hero-subtitle { margin: 0; color: var(--text-soft); line-height: 1.6; max-width: 860px; }
.command-highlight-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.command-step-card { position: relative; padding-top: 56px; }
.step-number {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: rgba(88,101,242,0.16);
  border: 1px solid rgba(88,101,242,0.32);
}
.command-code {
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(7, 13, 24, 0.96);
  border: 1px solid rgba(255,255,255,0.08);
  overflow-x: auto;
}
.command-list,
.faq-list,
.action-stack,
.detail-list,
.guide-flow {
  display: grid;
  gap: 12px;
}
.command-list-item,
.faq-item,
.guide-flow-item,
.detail-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}
.command-list-item code,
.faq-item code,
.guide-flow-item code { font-weight: 800; }
.detail-list > div { flex-direction: column; }
.member-identity {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.member-identity h2 { margin: 10px 0 8px; }
.member-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.compact-form { gap: 10px; }
.wrap-gap { gap: 10px; flex-wrap: wrap; }

@media (max-width: 980px) {
  .public-topbar { align-items: flex-start; flex-direction: column; }
  .public-nav-toggle,
  .sidebar-toggle { display: inline-flex; }
  .public-nav,
  .sidebar-mobile-panel {
    width: 100%;
  }
  .public-nav.is-collapsed,
  .sidebar-mobile-panel.is-collapsed {
    display: none;
  }
  .public-nav.is-open,
  .sidebar-mobile-panel.is-open {
    display: flex;
    flex-direction: column;
  }
  .public-nav { gap: 8px; }
  .public-nav a { width: 100%; }
  .command-list-item,
  .faq-item,
  .guide-flow-item { flex-direction: column; }
}

@media (max-width: 720px) {
  .public-container,
  .public-topbar { width: min(100vw - 20px, 1200px); }
  .content { padding: 14px; }
  .card { padding: 16px; }
  .filters-grid-admin,
  .filters-grid-ranking { grid-template-columns: 1fr; }
  .search-bar { flex-direction: column; align-items: stretch; }
  .row-actions,
  .inline-form { width: 100%; }
  .row-actions > *,
  .inline-form > * { flex: 1 1 auto; }
}

/* V6.7 player experience */
.match-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.match-card {
  display: grid;
  gap: 14px;
  text-decoration: none;
}

.match-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.match-card-top h3 {
  margin: 4px 0 0;
}

.match-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.match-card-cta {
  color: #eef2ff;
  font-weight: 700;
}

.compact-strip {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.placement-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  font-weight: 800;
}

.delta-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  border: 1px solid rgba(255,255,255,0.08);
}

.delta-chip.positive {
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
}

.delta-chip.negative {
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
}

.action-card-small {
  padding: 14px;
  display: grid;
  gap: 6px;
}

.action-card-small strong {
  font-size: 1rem;
}

@media (max-width: 760px) {
  .match-card-top,
  .match-card-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .placement-badge,
  .delta-chip {
    min-width: 0;
  }
}


.public-brand-logo,
.sidebar-brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 8px 20px rgba(0,0,0,0.24);
  flex: 0 0 auto;
}

.join-hero {
  text-align: left;
}

.join-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.join-card,
.discord-cta-card {
  min-height: 100%;
}

.join-benefits {
  display: grid;
  gap: 14px;
}

.join-benefit-item,
.guide-flow-item,
.command-list-item,
.faq-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.join-benefit-item strong,
.guide-flow-item strong,
.faq-item strong {
  display: block;
  margin-bottom: 6px;
}

.discord-badge-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.discord-logo-mark {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: var(--shadow-md);
}

.discord-link-box {
  padding: 16px 18px;
  margin: 18px 0 16px;
  border-radius: 18px;
  border: 1px solid rgba(88, 101, 242, 0.22);
  background: linear-gradient(180deg, rgba(88, 101, 242, 0.10), rgba(15, 23, 42, 0.92));
  font-weight: 800;
  letter-spacing: 0.02em;
  word-break: break-word;
}

.join-discord-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  width: 100%;
  border-radius: 16px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 24px rgba(88, 101, 242, 0.22);
}

.join-discord-link:hover {
  transform: translateY(-1px);
}

@media (max-width: 980px) {
  .public-brand-logo,
  .sidebar-brand-logo {
    width: 40px;
    height: 40px;
  }

  .discord-logo-mark {
    width: 60px;
    height: 60px;
  }
}


/* V6.8.1 premium visual polish */
.card,
.public-topbar,
.sidebar-brand,
.user-card {
  backdrop-filter: blur(18px);
}

.card-accent,
.hero-card,
.podium-card,
.player-premium-banner {
  position: relative;
  overflow: hidden;
}

.card-accent::after,
.hero-card::after,
.podium-card::after,
.player-premium-banner::after {
  content: "";
  position: absolute;
  inset: auto -15% -40% auto;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 221, 87, 0.14), rgba(255, 221, 87, 0));
  pointer-events: none;
}

.public-brand,
.sidebar-brand {
  position: relative;
}

.public-brand::after,
.sidebar-brand::after {
  content: "";
  position: absolute;
  inset: -10px auto auto -10px;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,255,255,0.10), rgba(255,255,255,0));
  pointer-events: none;
}

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

.podium-card {
  display: grid;
  gap: 14px;
  min-height: 220px;
  background:
    radial-gradient(circle at top right, rgba(255, 214, 102, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(14, 22, 38, 0.98), rgba(11, 18, 32, 1));
}

.podium-1 { border-color: rgba(255, 215, 0, 0.28); }
.podium-2 { border-color: rgba(203, 213, 225, 0.26); }
.podium-3 { border-color: rgba(205, 127, 50, 0.28); }

.podium-rank {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
  font-weight: 800;
}

.podium-name {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.15;
}

.podium-meta,
.podium-stats,
.rank-mmr-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.premium-pill {
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.tier-challenger { background: rgba(250, 204, 21, 0.18); color: #fff5b8; border-color: rgba(250, 204, 21, 0.34); }
.tier-grandmaster { background: rgba(244, 114, 182, 0.16); color: #ffd1ea; border-color: rgba(244, 114, 182, 0.28); }
.tier-master { background: rgba(192, 132, 252, 0.16); color: #eed7ff; border-color: rgba(192, 132, 252, 0.28); }
.tier-diamond { background: rgba(96, 165, 250, 0.16); color: #dceeff; border-color: rgba(96, 165, 250, 0.28); }
.tier-platinum { background: rgba(45, 212, 191, 0.16); color: #ccfbf1; border-color: rgba(45, 212, 191, 0.28); }
.tier-gold { background: rgba(245, 158, 11, 0.16); color: #fde7b0; border-color: rgba(245, 158, 11, 0.28); }
.tier-silver { background: rgba(148, 163, 184, 0.16); color: #e8eef7; border-color: rgba(148, 163, 184, 0.24); }
.tier-bronze { background: rgba(180, 83, 9, 0.16); color: #fed7aa; border-color: rgba(180, 83, 9, 0.28); }

.profile-badge-premium {
  background: linear-gradient(135deg, #f59e0b, var(--primary-2));
  box-shadow: 0 14px 28px rgba(124, 58, 237, 0.28);
}

.player-premium-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.player-premium-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
  width: min(560px, 100%);
}

.premium-stat {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.premium-stat span {
  display: block;
  color: var(--text-dim);
  font-size: 0.84rem;
  margin-bottom: 6px;
}

.premium-stat strong {
  font-size: 1.12rem;
}

.premium-list-card {
  background:
    radial-gradient(circle at top right, rgba(255, 214, 102, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(14, 22, 38, 0.95), rgba(11, 18, 32, 0.98));
}

.table-rank tbody tr {
  transition: transform 0.16s ease, background 0.16s ease;
}

.table-rank tbody tr:hover {
  transform: translateX(2px);
}

@media (max-width: 980px) {
  .podium-grid,
  .player-premium-metrics {
    grid-template-columns: 1fr;
  }

  .player-premium-banner {
    flex-direction: column;
    align-items: stretch;
  }
}


.public-footer {
  margin-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(10, 14, 24, 0.98), rgba(7, 10, 18, 1)),
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.08), transparent 32%);
  padding: 24px clamp(18px, 3vw, 32px) 18px;
}

.public-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(160px, 1fr));
  gap: 22px;
  align-items: start;
}

.public-footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.public-footer-brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}

.public-footer h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.public-footer p {
  color: var(--text-dim);
  margin: 6px 0 0;
}

.public-footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.public-footer-links a,
.public-footer a {
  color: var(--text-dim);
  text-decoration: none;
}

.public-footer-links a:hover,
.public-footer a:hover {
  color: var(--text-main);
}

.public-footer-bottom {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.legal-card h2,
.contact-card h2 {
  margin-top: 0;
}

.login-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.login-links a {
  color: var(--text-dim);
  text-decoration: none;
}

.login-links a:hover {
  color: var(--text-main);
}

@media (max-width: 980px) {
  .public-footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .public-footer-grid {
    grid-template-columns: 1fr;
  }
}

.public-nav-inline-form {
  margin: 0;
}

.public-nav-inline-button {
  padding: 8px 12px;
}

.account-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

.account-avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.12);
}

.account-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  font-size: 1.5rem;
}

.account-display-name {
  font-size: 1.1rem;
  font-weight: 800;
}

.account-form {
  gap: 14px;
}

.account-form-actions {
  display: flex;
  align-items: end;
}

.compact-timeline .timeline-item {
  padding-bottom: 10px;
}

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

.tiny-kpi-card {
  padding: 16px;
}

.compact-card {
  padding: 18px;
}

.alert.success {
  background: rgba(74, 222, 128, 0.14);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #d1fae5;
}

@media (max-width: 980px) {
  .public-nav-inline-form {
    width: 100%;
  }

  .public-nav-inline-button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .account-identity {
    align-items: flex-start;
  }

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

.notice {
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.12);
}

.notice.success {
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.3);
  color: #d1fae5;
}

.notice.error {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.28);
  color: #fee2e2;
}

.player-banner.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
}

.play-status-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.tag-success {
  background: rgba(74, 222, 128, 0.16);
  border-color: rgba(74, 222, 128, 0.3);
  color: #d1fae5;
}

.tag-danger {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.3);
  color: #fee2e2;
}

.tag-warning {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.28);
  color: #fde68a;
}

.lobby-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

@media (max-width: 640px) {
  .player-banner.compact,
  .status-line,
  .lobby-row {
    flex-direction: column;
    align-items: flex-start;
  }
}


.home-launch {
  overflow: hidden;
  position: relative;
}

.home-launch::after {
  content: "";
  position: absolute;
  inset: auto -8% -40% auto;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(199, 164, 92, 0.18) 0%, rgba(199, 164, 92, 0) 70%);
  pointer-events: none;
}

.home-launch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  gap: 22px;
  align-items: center;
}

.home-launch-title {
  margin: 10px 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.05;
}

.home-launch-text {
  margin: 0;
  max-width: 760px;
  color: var(--text-soft);
  line-height: 1.65;
}

.home-launch-steps {
  display: grid;
  gap: 14px;
}

.home-step {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(103, 130, 214, 0.2);
  background: rgba(8, 16, 42, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.home-step strong {
  font-size: 1rem;
}

.home-step span {
  color: var(--text-soft);
  line-height: 1.55;
}

@media (max-width: 980px) {
  .home-launch-grid {
    grid-template-columns: 1fr;
  }
}


/* V7.5.1 dual-mode polish */
.public-nav-mode-pill {
  display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.04); color: var(--text-dim);
  font-size: 0.82rem; font-weight: 700;
}
.mode-panel {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(9, 15, 27, 0.98));
}
.mode-panel-pbe::after, .mode-panel-live::after, .account-mode-card::after {
  content: ""; position: absolute; inset: auto 20px 0 20px; height: 2px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(88,101,242,0.0), rgba(88,101,242,0.75), rgba(124,58,237,0.75), rgba(88,101,242,0.0));
}
.mode-panel-top { display:flex; justify-content:space-between; gap:14px; align-items:flex-start; margin-bottom:10px; }
.mode-feature-list { display:grid; gap:10px; margin-top:14px; }
.mode-feature-item {
  display:flex; justify-content:space-between; gap:14px; padding:12px 14px; border-radius:14px;
  background: rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.06);
}
.mode-feature-item strong { min-width: 90px; }
.mode-feature-item span { color: var(--text-soft); }
.dual-match-card { display:flex; justify-content:space-between; align-items:center; gap:14px; }
.account-mode-card { min-height: 100%; }
.tag-soft { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); }
@media (max-width: 980px) {
  .public-nav-mode-pill { order: 99; }
  .mode-panel-top, .mode-feature-item, .dual-match-card { flex-direction: column; align-items: flex-start; }
}
