:root {
  --theme-bg: #f6f6f6;
  --theme-text: #000000;
  --theme-progress-bg: #ffffff;
  --theme-nav-button-color: #000000;
  --theme-card-bg: #ffffff;
  --theme-inactive-bg: #f6f6f6;
  --theme-inactive-text: #000000;
  --theme-active-bg: #1e1e1e;
  --theme-active-text: #ffffff;
  --theme-social-button-bg: #ffffff;
  --theme-divider: #ededed;
  --theme-muted-text: #3a3a3a;
  --theme-server-status-bg: #1e1e1e;
  --theme-server-card-bg: #272727;
  --theme-server-card-ring: #3a3a3a;
  --bg: var(--theme-bg);
  --surface-1: var(--theme-card-bg);
  --surface-2: #f8fbff;
  --surface-3: #edf2fa;
  --text: var(--theme-text);
  --muted: var(--theme-muted-text);
  --accent: #35a7ff;
  --accent-2: #00bcd4;
  --accent-3: #5b7dff;
  --danger: #ef4444;
  --border: rgba(15, 23, 42, 0.08);
  --card-border: rgba(15, 23, 42, 0.08);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 14px 34px rgba(15, 23, 42, 0.08);
  --page-bg: linear-gradient(180deg, #eef3fb 0%, #f7f9fc 45%, #f6f6f6 100%);
  --bg-accent-color: oklch(50.8% 0 0);
  --bg-opacity: 0.7;
  --background-image: url('9f00f554-d572-4081-96a3-d070a0e52540');
  --additional-image: url('2e915727-254e-4426-a6c9-36a0a89b5ed5');
  --faded-accent-color: rgba(53, 167, 255, 0.1);
  --topbar-bg: rgba(255, 255, 255, 0.96);
  --card-bg: #ffffff;
  --modal-bg: #ffffff;
  --btn-ghost-bg: rgba(255, 255, 255, 0.5);
  --btn-ghost-color: #000000;
  --nav-button-bg: rgba(255, 255, 255, 0.5);
  --nav-button-active-bg: rgba(53, 167, 255, 0.14);
  --hover-bg: rgba(53, 167, 255, 0.14);
  --input-border: rgba(15, 23, 42, 0.08);
  --input-bg: rgba(255, 255, 255, 0.9);
  --input-placeholder: rgba(32, 41, 56, 0.45);
  --avatar-frame-border: rgba(15, 23, 42, 0.08);
  --avatar-frame-bg: rgba(255, 255, 255, 0.92);
  --surface-highlight: rgba(255, 255, 255, 0.85);
  --tab-bg: rgba(255, 255, 255, 0.5);
  --tab-active-bg: rgba(53, 167, 255, 0.14);
  --btn-primary-text: #07101d;
  --main-background: radial-gradient(circle at 12% 14%, rgba(255, 255, 255, 0.08), transparent 15%),
    radial-gradient(circle at 86% 18%, rgba(98, 214, 255, 0.14), transparent 14%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 65%);
  --secondary-background: radial-gradient(circle at 34% 30%, rgba(111, 183, 255, 0.06), transparent 20%),
    radial-gradient(circle at 78% 36%, rgba(110, 226, 198, 0.05), transparent 18%);
  --overlay-bg: rgba(4, 10, 22, 0.88);
  --theme-divider-color: var(--theme-divider);
  --transition-fast: 180ms;
  --transition-base: 260ms;
  font-family: 'Unbounded', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html[data-theme='dark'] {
  --theme-bg: #040712;
  --theme-text: #e9f3f7;
  --theme-progress-bg: #0c1220;
  --theme-nav-button-color: #a8c4dd;
  --theme-card-bg: rgba(15, 22, 37, 0.96);
  --theme-inactive-bg: #090f18;
  --theme-inactive-text: #9fb0bf;
  --theme-active-bg: #16203a;
  --theme-active-text: #ffffff;
  --theme-social-button-bg: rgba(255, 255, 255, 0.04);
  --theme-divider: rgba(255, 255, 255, 0.08);
  --theme-muted-text: #9fb0bf;
  --bg: #040712;
  --surface-1: rgba(15, 22, 37, 0.95);
  --surface-2: rgba(12, 18, 33, 0.95);
  --surface-3: rgba(10, 14, 26, 0.95);
  --text: #e9f3f7;
  --muted: #9fb0bf;
  --page-bg: radial-gradient(circle at 10% 10%, rgba(96, 176, 255, 0.12), transparent 16%),
    radial-gradient(circle at 90% 12%, rgba(67, 170, 255, 0.10), transparent 14%),
    var(--bg);
  --topbar-bg: rgba(7, 12, 24, 0.92);
  --card-bg: rgba(15, 22, 37, 0.95);
  --modal-bg: rgba(11, 17, 33, 0.98);
  --btn-ghost-bg: rgba(255, 255, 255, 0.06);
  --btn-ghost-color: #e9f3f7;
  --nav-button-bg: rgba(255, 255, 255, 0.06);
  --nav-button-active-bg: rgba(53, 167, 255, 0.14);
  --hover-bg: rgba(53, 167, 255, 0.14);
  --input-border: rgba(255, 255, 255, 0.12);
  --input-bg: rgba(255, 255, 255, 0.06);
  --input-placeholder: rgba(233, 243, 247, 0.32);
  --avatar-frame-border: rgba(255, 255, 255, 0.08);
  --avatar-frame-bg: rgba(255, 255, 255, 0.04);
  --surface-highlight: rgba(255, 255, 255, 0.04);
  --tab-bg: rgba(255, 255, 255, 0.05);
  --tab-active-bg: rgba(53, 167, 255, 0.14);
  --btn-primary-text: #ffffff;
  --main-background: radial-gradient(circle at 12% 14%, rgba(53, 167, 255, 0.12), transparent 14%),
    radial-gradient(circle at 86% 18%, rgba(98, 214, 255, 0.10), transparent 12%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 65%);
  --secondary-background: radial-gradient(circle at 34% 30%, rgba(110, 226, 198, 0.08), transparent 18%),
    radial-gradient(circle at 78% 36%, rgba(111, 183, 255, 0.06), transparent 16%);
  --theme-divider-color: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

#main-background,
#secondary-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

#main-background {
  background: var(--main-background);
}

#secondary-background {
  background: var(--secondary-background);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100vw - 40px));
  margin: 0 auto 32px;
  padding: 20px 0 32px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-radius: 28px;
  background: var(--topbar-bg);
  border: 1px solid var(--theme-divider);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 24px 68px rgba(53, 167, 255, 0.16);
}

.brand-name {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
}

.brand-tag {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-link {
  border: 1px solid transparent;
  background: var(--nav-button-bg);
  color: var(--theme-nav-button-color);
  padding: 10px 14px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 700;
  transition: background var(--transition-fast), transform var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.nav-link.active,
.nav-link:hover {
  color: var(--text);
  background: var(--hover-bg);
  border-color: rgba(53, 167, 255, 0.22);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.site-grid {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(420px, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 24px;
}

.profile-column,
.content-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-card,
.leaders-panel {
  background: var(--theme-card-bg);
  border: 1px solid var(--theme-divider);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.profile-card {
  padding: 26px 24px 24px;
}

.profile-visual {
  width: 142px;
  height: 142px;
  margin: 0 auto;
}

.avatar-frame {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--avatar-frame-border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 20%, rgba(98, 214, 255, 0.18), transparent 40%),
    var(--avatar-frame-bg);
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  transition: opacity var(--transition-fast) ease;
}

.avatar-image.loading {
  opacity: 0;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin-top: 16px;
}

.profile-meta .eyebrow {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.profile-meta h1 {
  margin: 0;
  font-size: 2.25rem;
  letter-spacing: -0.04em;
}

.profile-meta .muted.small {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.lookup-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
}

.input-row {
  display: flex;
  gap: 12px;
  width: 100%;
  align-items: center;
}

input[type='text'] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  outline: none;
  font-size: 0.98rem;
  font-weight: 600;
}

input::placeholder {
  color: var(--input-placeholder);
}

.btn {
  padding: 14px 18px;
  border-radius: 18px;
  border: 0;
  cursor: pointer;
  font-weight: 800;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--btn-primary-text);
}

.btn.ghost {
  background: var(--btn-ghost-bg);
  color: var(--btn-ghost-color);
  border: 1px solid var(--theme-divider-color);
}

#themeToggle {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--hover-bg);
}

.theme-icon {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.btn.ghost:hover {
  background: var(--hover-bg);
}

.btn.primary:hover {
  filter: brightness(1.05);
}

.error-message {
  min-height: 22px;
  margin: 0;
  color: var(--danger);
  font-size: 0.95rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 160ms ease;
}

.error-message.visible {
  opacity: 1;
}

.overview-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 16px;
}

.overview-card {
  position: relative;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--theme-divider-color);
  background: var(--card-bg);
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.overview-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--accent);
  border-radius: 12px 0 0 12px;
}

.overview-card--green::before {
  background: #34d399;
}

.overview-card--cyan::before {
  background: #38bdf8;
}

.overview-card--red::before {
  background: #fb7185;
}

.overview-card--yellow::before {
  background: #facc15;
}

.overview-card--purple::before {
  background: #a78bfa;
}

.overview-card * {
  position: relative;
  z-index: 1;
}

.card-title {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.card-value {
  font-weight: 900;
  font-size: 2.5rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.leaders-panel {
  padding: 22px;
}

.leaders-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.leaders-header h2 {
  margin: 4px 0 0;
  font-size: 1.8rem;
}

.category-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.category-tab {
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--theme-divider-color);
  background: var(--tab-bg);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  transition: transform var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.category-tab.active,
.category-tab:hover {
  background: var(--hover-bg);
  color: var(--text);
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  background: var(--surface-highlight);
  border: 1px solid var(--theme-divider-color);
  transition: transform var(--transition-base) ease, box-shadow var(--transition-base) ease;
}

.leaderboard-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 62px rgba(0, 0, 0, 0.16);
}

.leaderboard-rank {
  width: 36px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

.leaderboard-avatar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  object-fit: cover;
  image-rendering: pixelated;
}

.leaderboard-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.leaderboard-body strong {
  font-size: 1rem;
}

.leaderboard-body span {
  color: var(--muted);
  font-size: 0.92rem;
}

.leaderboard-value {
  margin-left: auto;
  font-weight: 900;
  color: var(--text);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--overlay-bg);
  backdrop-filter: blur(12px);
  z-index: 1200;
}

.modal-overlay:not([hidden]) {
  display: flex;
}

.modal {
  width: min(520px, calc(100% - 32px));
  background: var(--modal-bg);
  border-radius: 26px;
  padding: 26px;
  border: 1px solid var(--theme-divider-color);
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.12);
  position: relative;
}

.modal-close {
  position: absolute;
  right: 18px;
  top: 18px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}

.modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.modal-avatar {
  width: 112px;
  height: 112px;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--theme-divider-color);
}

.modal-stats {
  display: flex;
  gap: 18px;
  width: 100%;
  justify-content: center;
}

.modal-stats .muted {
  display: block;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 6px;
}

button,
.category-tab,
.nav-link {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

button:hover,
.category-tab:hover,
.nav-link:hover {
  transform: translateY(-1px);
}

:focus-visible {
  outline: 3px solid rgba(98, 214, 255, 0.18);
  outline-offset: 4px;
}

@media (max-width: 980px) {
  .site-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .overview-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw, calc(100vw - 24px));
  }

  .overview-cards {
    grid-template-columns: 1fr;
  }

  .input-row {
    flex-direction: column;
  }

  .btn.primary {
    width: 100%;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .nav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stat-card {
  display: block;
}
