:root {
  color-scheme: dark;
  --bg: #030712;
  --panel: rgba(3, 10, 24, 0.86);
  --panel-strong: rgba(4, 8, 18, 0.96);
  --cyan: #10e8ff;
  --green: #4dffaf;
  --magenta: #ff3ed0;
  --gold: #ffda6b;
  --text: #eefaff;
  --muted: #9eb4c5;
  font-family: Inter, ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(3, 7, 18, 0.12), rgba(3, 7, 18, 0.96)),
    url("/assets/neon_table_v1.png") center / cover fixed,
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 62, 208, 0.24), transparent 34%),
    radial-gradient(circle at 86% 18%, rgba(16, 232, 255, 0.22), transparent 30%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 6px);
  mix-blend-mode: screen;
}

a {
  color: inherit;
  text-decoration: none;
}

.profile-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.profile-header,
.hero-panel,
.panel {
  border: 1px solid rgba(16, 232, 255, 0.36);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 0 28px rgba(16, 232, 255, 0.14), inset 0 0 22px rgba(255, 62, 208, 0.05);
  backdrop-filter: blur(16px);
}

.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 18px;
}

.brand {
  font-weight: 950;
  text-transform: uppercase;
}

nav {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-weight: 850;
}

nav a:hover {
  color: var(--green);
}

.hero-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(18px, 4vw, 42px);
  align-items: center;
  margin-top: 22px;
  padding: clamp(18px, 5vw, 44px);
}

.avatar-orbit {
  width: clamp(118px, 18vw, 188px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgba(77, 255, 175, 0.24), transparent 42%),
    linear-gradient(135deg, rgba(255, 62, 208, 0.28), rgba(16, 232, 255, 0.18)),
    #040914;
  color: white;
  font-size: clamp(34px, 6vw, 70px);
  font-weight: 1000;
  text-shadow: 0 0 18px rgba(16, 232, 255, 0.72);
  box-shadow: 0 0 38px rgba(16, 232, 255, 0.32), 0 0 54px rgba(255, 62, 208, 0.22);
  background-position: center;
  background-size: cover;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

h1,
h2,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 86px);
  line-height: 0.9;
  text-transform: uppercase;
}

h2 {
  margin: 0 0 16px;
  font-size: 21px;
}

.muted {
  color: var(--muted);
  font-weight: 700;
}

.xp-track {
  width: min(520px, 100%);
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(16, 232, 255, 0.44);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
}

.xp-track > div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--magenta));
  box-shadow: 0 0 18px rgba(77, 255, 175, 0.36);
}

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

.panel {
  padding: 18px;
}

.panel--wide {
  grid-column: 1 / -1;
}

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

.stat-grid div {
  min-height: 86px;
  padding: 14px;
  border: 1px solid rgba(16, 232, 255, 0.22);
  border-radius: 7px;
  background: rgba(0, 4, 12, 0.42);
}

.stat-grid span {
  display: block;
  color: white;
  font-size: 25px;
  font-weight: 1000;
}

.stat-grid small {
  color: var(--muted);
  font-weight: 800;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 850;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(16, 232, 255, 0.32);
  border-radius: 7px;
  background: rgba(0, 4, 12, 0.68);
  color: var(--text);
  font: inherit;
  padding: 12px;
}

input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--green);
}

select {
  min-height: 44px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.field-help {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.check-row {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.companion-line {
  margin: 10px 0 18px;
  color: var(--gold);
  font-weight: 850;
}

.button {
  min-height: 44px;
  border: 1px solid var(--green);
  border-radius: 7px;
  background: rgba(4, 14, 32, 0.96);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 950;
  padding: 0 18px;
}

.button:hover {
  color: var(--green);
}

.button--quiet {
  min-height: 40px;
  border-color: rgba(158, 180, 197, 0.44);
  color: var(--muted);
  font-size: 13px;
  padding-inline: 12px;
}

.button--small {
  min-height: 40px;
  width: 100%;
  margin-top: auto;
  padding-inline: 10px;
  font-size: 13px;
}

.progression-panel h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

.notification-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 30px;
  margin: 4px 0 16px;
}

.notification {
  border: 1px solid rgba(255, 218, 107, 0.5);
  border-radius: 6px;
  background: rgba(255, 218, 107, 0.08);
  color: var(--gold);
  font-size: 13px;
  font-weight: 850;
  padding: 7px 10px;
}

.notification--title {
  border-color: rgba(77, 255, 175, 0.5);
  color: var(--green);
}

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

.challenge-group {
  min-width: 0;
}

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

.challenge-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 170px;
  padding: 12px;
  border: 1px solid rgba(16, 232, 255, 0.24);
  border-radius: 7px;
  background: rgba(0, 4, 12, 0.48);
}

.challenge-card strong {
  color: var(--text);
}

.challenge-card small {
  min-height: 36px;
  color: var(--muted);
  font-weight: 760;
  line-height: 1.35;
}

.challenge-card > span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 850;
}

.challenge-card.is-complete {
  border-color: var(--green);
  box-shadow: 0 0 18px rgba(77, 255, 175, 0.14);
}

.challenge-card.is-claimed {
  opacity: 0.62;
}

.challenge-track {
  height: 7px;
  overflow: hidden;
  border: 1px solid rgba(16, 232, 255, 0.34);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
}

.challenge-track div {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  box-shadow: 0 0 12px rgba(77, 255, 175, 0.34);
}

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

.pill {
  border: 1px solid rgba(255, 62, 208, 0.5);
  border-radius: 999px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 950;
  padding: 6px 10px;
}

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

.avatar-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.avatar-card,
.match-row {
  border: 1px solid rgba(16, 232, 255, 0.24);
  border-radius: 7px;
  background: rgba(0, 4, 12, 0.48);
  padding: 12px;
}

.avatar-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  column-gap: 10px;
  align-content: center;
  min-height: 78px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.avatar-card strong,
.avatar-card small {
  grid-column: 2;
}

.cosmetic-art {
  width: 56px;
  height: 56px;
  grid-row: span 2;
  border: 1px solid rgba(16, 232, 255, 0.42);
  border-radius: 6px;
  background: #050b18;
  object-fit: cover;
}

.avatar-card[aria-pressed="true"] {
  border-color: var(--green);
  box-shadow: 0 0 20px rgba(77, 255, 175, 0.18);
}

.avatar-card:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  filter: saturate(0.45);
}

.avatar-card:not(:disabled):hover,
.cosmetic-card:hover,
.title-card:hover,
.achievement-card:hover {
  border-color: var(--cyan);
}

.cosmetic-grid,
.title-grid,
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.cosmetic-card,
.title-card,
.achievement-card {
  min-height: 92px;
  padding: 12px;
  border: 1px solid rgba(16, 232, 255, 0.24);
  border-radius: 7px;
  background: rgba(0, 4, 12, 0.48);
  transition: border-color 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
}

.cosmetic-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  column-gap: 12px;
  align-content: center;
}

.cosmetic-card strong,
.cosmetic-card small {
  grid-column: 2;
}

.cosmetic-card .cosmetic-art {
  width: 64px;
  height: 64px;
}

.cosmetic-card.is-selected,
.title-card.is-selected,
.achievement-card.is-unlocked {
  border-color: var(--green);
  box-shadow: 0 0 18px rgba(77, 255, 175, 0.14);
}

.cosmetic-card strong,
.title-card strong,
.achievement-card strong {
  display: block;
  margin-bottom: 8px;
}

.cosmetic-card small,
.title-card small,
.achievement-card small {
  color: var(--muted);
  font-weight: 760;
  line-height: 1.35;
}

.achievement-card:not(.is-unlocked) {
  opacity: 0.72;
}

.achievement-card.is-deferred {
  border-style: dashed;
  opacity: 0.55;
}

.avatar-card strong,
.match-row strong {
  display: block;
}

.avatar-card small,
.match-row small {
  color: var(--muted);
  font-weight: 760;
}

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

  .avatar-orbit {
    width: 132px;
  }

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

  .profile-shell {
    width: min(100% - 20px, 620px);
    padding-top: 10px;
  }

  .profile-header {
    min-height: 54px;
    padding-inline: 12px;
  }

  nav {
    gap: 10px;
    font-size: 13px;
  }

  h1 {
    font-size: clamp(34px, 13vw, 58px);
  }

  .hero-panel,
  .panel {
    padding: 14px;
  }

  .cosmetic-grid,
  .title-grid,
  .achievement-grid {
    grid-template-columns: 1fr;
  }

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

  .button--quiet {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.profile-build-info {
  max-width: 1180px;
  margin: 18px auto 26px;
  padding: 0 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
