:root {
  --bg: #0b0a18;
  --panel: rgba(18, 16, 38, 0.8);
  --panel-strong: rgba(22, 19, 48, 0.94);
  --line: rgba(220, 218, 255, 0.16);
  --line-strong: rgba(181, 142, 255, 0.46);
  --text: #fbfaff;
  --muted: #bcb6d8;
  --accent: #b58eff;
  --accent-2: #76f4ff;
  --accent-3: #ffd36f;
  --danger: #ff8c8c;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Manrope", Arial, sans-serif;
  background:
    linear-gradient(115deg, rgba(181, 142, 255, 0.2), transparent 31%),
    linear-gradient(245deg, rgba(118, 244, 255, 0.14), transparent 34%),
    radial-gradient(circle at 48% 8%, rgba(181, 142, 255, 0.26), transparent 28%),
    linear-gradient(145deg, #080713 0%, #15132e 46%, #0b0a18 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: -18% -14%;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1900 1300' preserveAspectRatio='none'%3E%3Cg fill='none' stroke-linecap='round'%3E%3Cpath d='M1960 40C1660 210 1510 20 1230 190S760 480 520 360 130 260-170 460' stroke='%23b58eff' stroke-opacity='.23' stroke-width='3.2'/%3E%3Cpath d='M2010 180C1700 350 1500 170 1240 330S800 610 545 505 145 430-210 620' stroke='%2376f4ff' stroke-opacity='.17' stroke-width='2.8'/%3E%3Cpath d='M1980 330C1640 505 1450 340 1185 500S780 760 500 675 90 605-240 800' stroke='%23fbfaff' stroke-opacity='.10' stroke-width='2.4'/%3E%3Cpath d='M2040 500C1730 660 1475 530 1210 690S765 940 485 855 95 800-250 990' stroke='%23b58eff' stroke-opacity='.18' stroke-width='3'/%3E%3Cpath d='M2020 690C1690 850 1455 700 1160 870S730 1110 430 1025 55 980-260 1160' stroke='%2376f4ff' stroke-opacity='.13' stroke-width='2.6'/%3E%3Cpath d='M1960 875C1655 1035 1390 910 1115 1060S710 1260 390 1210 90 1180-220 1310' stroke='%23ffd36f' stroke-opacity='.10' stroke-width='2.2'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
  opacity: 0.88;
  transform: rotate(-8deg) scale(1.05);
  transform-origin: center;
  mask-image: linear-gradient(135deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.64) 58%, transparent 96%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(8, 7, 19, 0.74));
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.admin-button {
  font-family: inherit;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 10, 28, 0.66);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}

.social-link {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(181, 142, 255, 0.13), rgba(118, 244, 255, 0.07)),
    rgba(255, 255, 255, 0.045);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.social-link img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  filter: invert(1) drop-shadow(0 0 10px rgba(118, 244, 255, 0.18));
  opacity: 0.9;
}

.social-link:hover,
.social-link:focus-visible {
  border-color: var(--line-strong);
  background:
    linear-gradient(135deg, rgba(181, 142, 255, 0.22), rgba(118, 244, 255, 0.12)),
    rgba(255, 255, 255, 0.07);
  outline: none;
  transform: translateY(-1px);
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(181, 142, 255, 0.32));
}

.brand span {
  display: grid;
  gap: 2px;
}

.brand strong,
h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", Arial, sans-serif;
  letter-spacing: 0;
}

.brand small,
.eyebrow,
.status-pill,
label span,
.rank-badge small,
article span,
.invite-list__head span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(181, 142, 255, 0.1);
}

.status-pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(181, 142, 255, 0.88);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.72fr);
  gap: 24px;
  align-items: center;
  min-height: calc(100vh - 112px);
  padding: 28px 0;
}

.hero-copy {
  display: grid;
  gap: 24px;
}

.eyebrow {
  margin: 0;
  color: var(--accent-2);
}

h1 {
  max-width: 760px;
  color: var(--text);
  font-size: clamp(3.2rem, 8vw, 7.6rem);
  line-height: 0.92;
}

.lead {
  max-width: 650px;
  margin: 0;
  color: #d7d2ee;
  font-size: 1.08rem;
  line-height: 1.8;
}

.reward-strip,
.score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 720px;
}

.reward-strip article,
.score-grid article,
.leaderboard li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.reward-strip article,
.score-grid article {
  display: grid;
  gap: 6px;
  min-height: 108px;
  padding: 18px;
}

.reward-strip strong,
.score-grid strong {
  color: var(--accent);
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 2rem;
}

.reward-strip small {
  color: var(--muted);
}

.access-panel,
.member-panel,
.leaderboard {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.access-panel {
  display: grid;
  gap: 22px;
  padding: 24px;
  align-self: start;
  margin-top: 28px;
}

.panel-head,
.member-panel,
.leaderboard {
  display: flex;
  justify-content: space-between;
  gap: 22px;
}

.panel-head {
  align-items: flex-start;
}

.panel-head h2,
.member-summary h2,
.leaderboard h2 {
  margin-top: 6px;
  font-size: 2rem;
}

.rank-badge {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  min-width: 118px;
  min-height: 72px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(181, 142, 255, 0.16), rgba(118, 244, 255, 0.08)),
    rgba(255, 255, 255, 0.04);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.rank-badge span {
  color: var(--accent-2);
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1;
}

.rank-badge small {
  line-height: 1.1;
  text-align: center;
}

form {
  display: grid;
  gap: 15px;
}

label {
  display: grid;
  gap: 8px;
}

input {
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(220, 218, 255, 0.18);
  border-radius: 8px;
  outline: none;
  padding: 0 16px;
  color: var(--text);
  background: rgba(7, 6, 18, 0.52);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input::placeholder {
  color: rgba(188, 182, 216, 0.66);
}

input:focus {
  border-color: var(--accent);
  background: rgba(13, 11, 31, 0.74);
  box-shadow: 0 0 0 4px rgba(181, 142, 255, 0.12);
}

.field-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 0.78rem;
}

.submit-button,
.copy-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  color: #0b0a18;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 18px 48px rgba(181, 142, 255, 0.2);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.form-message {
  min-height: 24px;
  color: #e4e0ff;
  line-height: 1.5;
}

.form-message.is-error {
  color: var(--danger);
}

.member-panel {
  align-items: stretch;
  margin-top: 8px;
  padding: 22px;
}

.member-summary,
.referral-card {
  flex: 1;
}

.member-summary,
.referral-card,
.leaderboard {
  display: grid;
  gap: 18px;
}

.referral-card {
  border-left: 1px solid var(--line);
  padding-left: 22px;
}

.copy-row {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 10px;
}

.copy-row button {
  min-height: 52px;
}

.invite-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.invite-list__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.invite-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  color: #eeeaff;
  border-top: 1px solid var(--line);
}

.invite-list .empty {
  color: var(--muted);
}

.leaderboard {
  align-items: start;
  margin-top: 24px;
  padding: 22px;
}

.leaderboard ol {
  display: grid;
  gap: 10px;
  min-width: min(100%, 520px);
}

.leaderboard-panel {
  display: grid;
  gap: 12px;
  min-width: min(100%, 560px);
}

.leaderboard-search {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 10px;
}

.leaderboard-search input {
  min-height: 48px;
}

.leaderboard-search button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #0b0a18;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.leaderboard-search-result {
  min-height: 0;
  color: var(--muted);
}

.leaderboard-search-result.is-error {
  color: var(--danger);
}

.leaderboard li,
.leaderboard-search-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.leaderboard-search-card {
  border-color: rgba(118, 244, 255, 0.26);
  background:
    linear-gradient(135deg, rgba(181, 142, 255, 0.12), rgba(118, 244, 255, 0.07)),
    rgba(255, 255, 255, 0.045);
}

.leaderboard b,
.leaderboard-search-card b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #0b0a18;
  background: var(--accent);
}

.leaderboard strong {
  color: #fbfaff;
}

.twitter-profile-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s ease, text-shadow 0.18s ease;
}

.twitter-profile-link:hover,
.twitter-profile-link:focus-visible {
  color: var(--accent-2);
  outline: none;
  text-shadow: 0 0 18px rgba(118, 244, 255, 0.28);
}

.leaderboard span,
.leaderboard-search-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-shell {
  width: min(1320px, calc(100vw - 32px));
}

.admin-main {
  display: grid;
  gap: 24px;
  padding-top: 34px;
}

.admin-login-view {
  display: grid;
  min-height: calc(100vh - 120px);
  place-items: center;
  padding: 34px 0;
}

.admin-login-card {
  display: grid;
  gap: 18px;
  width: min(520px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.admin-login-card h1 {
  font-size: clamp(2.8rem, 8vw, 4.8rem);
}

.admin-login-form {
  display: grid;
  gap: 14px;
}

.admin-hero {
  display: grid;
  gap: 14px;
}

.admin-hero h1 {
  font-size: clamp(3rem, 7vw, 6.4rem);
}

.admin-stats,
.admin-lists {
  display: grid;
  gap: 14px;
}

.admin-stats {
  grid-template-columns: repeat(3, 1fr);
}

.admin-lists {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-stats article,
.admin-lists article,
.admin-table-card,
.admin-control-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.admin-stats article {
  display: grid;
  gap: 8px;
  min-height: 120px;
  padding: 20px;
}

.admin-control-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 20px;
}

.admin-control-card h2 {
  margin-top: 6px;
  font-size: 1.5rem;
}

.admin-control-card p:not(.eyebrow) {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.toggle-button {
  min-width: 132px;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.toggle-button[data-state="live"] {
  color: #0b0a18;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 18px 48px rgba(181, 142, 255, 0.2);
}

.admin-stats strong {
  color: var(--accent-2);
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 2.4rem;
}

.admin-lists article,
.admin-table-card {
  overflow: hidden;
}

.admin-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.admin-list-head h2 {
  font-size: 1.1rem;
}

.admin-list-head span {
  color: var(--accent-2);
  font-weight: 900;
}

.admin-action-message {
  min-height: 42px;
  padding: 12px 18px;
  color: #e4e0ff;
  border-bottom: 1px solid var(--line);
}

.admin-action-message:empty {
  display: none;
}

.admin-action-message.is-error {
  color: var(--danger);
}

.admin-lists ul {
  display: grid;
  max-height: 300px;
  overflow: auto;
}

.admin-lists li {
  padding: 13px 18px;
  color: #eeeaff;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.admin-lists li:last-child {
  border-bottom: 0;
}

.admin-lists .empty {
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1240px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

td {
  color: #f5f2ff;
}

.mono {
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.delete-member {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 140, 140, 0.34);
  border-radius: 8px;
  color: #ffd8d8;
  background: rgba(255, 140, 140, 0.08);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.delete-member:hover,
.delete-member:focus-visible {
  border-color: rgba(255, 140, 140, 0.74);
  background: rgba(255, 140, 140, 0.16);
  outline: none;
}

@media (max-width: 900px) {
  .hero,
  .member-panel,
  .leaderboard,
  .admin-control-card,
  .admin-stats,
  .admin-lists {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .hero {
    min-height: auto;
  }

  .referral-card {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 22px;
  }

  h1 {
    font-size: clamp(3rem, 16vw, 5.8rem);
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding-top: 12px;
  }

  .topbar,
  .panel-head,
  .leaderboard {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    align-items: stretch;
  }

  .nav-link,
  .social-link,
  .status-pill {
    justify-content: center;
  }

  .social-link {
    width: 100%;
  }

  .reward-strip,
  .score-grid,
  .copy-row,
  .leaderboard-search {
    grid-template-columns: 1fr;
  }

  .access-panel,
  .member-panel,
  .leaderboard {
    padding: 16px;
  }
}
