:root {
  --bg: #090b18;
  --bg-soft: #11152a;
  --panel: rgba(24, 29, 55, 0.92);
  --panel-solid: #181d37;
  --panel-light: #222948;
  --text: #f7f8ff;
  --muted: #aeb6d7;
  --line: rgba(255, 255, 255, 0.11);
  --primary: #6d5dfc;
  --primary-strong: #8d7cff;
  --accent: #28d8c6;
  --success: #2dd39a;
  --warning: #ffbf4d;
  --danger: #ff5c77;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  --radius: 22px;
  --radius-small: 13px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 4%, rgba(109, 93, 252, 0.24), transparent 31rem),
    radial-gradient(circle at 91% 18%, rgba(40, 216, 198, 0.12), transparent 27rem),
    linear-gradient(145deg, #090b18 0%, #0c1022 48%, #090b18 100%);
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.23;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 92%);
}

::selection {
  background: rgba(109, 93, 252, 0.6);
  color: white;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 76px;
  padding: 12px clamp(18px, 3vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(9, 11, 24, 0.83);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 850;
  letter-spacing: -0.025em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--primary-strong), var(--accent));
  box-shadow: 0 10px 28px rgba(109, 93, 252, 0.34);
  color: white;
  font-weight: 950;
}

.site-nav {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease;
}

.nav-link:hover,
.nav-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.075);
}

.account-actions,
.account-chip,
.button-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.account-chip {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.page-shell {
  width: min(1160px, calc(100% - 32px));
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  padding: clamp(34px, 5vw, 68px) 0 72px;
}

.page-shell-wide {
  width: min(1420px, calc(100% - 32px));
}

.site-footer {
  padding: 28px 20px 38px;
  border-top: 1px solid var(--line);
  color: #7f89ad;
  font-size: 0.86rem;
  text-align: center;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 4.2vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.22rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

p {
  color: var(--muted);
}

code {
  padding: 0.18em 0.42em;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.24);
  color: #e2e5ff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.17em;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
  align-items: center;
  gap: clamp(30px, 7vw, 96px);
  min-height: 520px;
  padding: clamp(28px, 5vw, 70px) 0;
}

.hero-copy p {
  max-width: 700px;
  margin-bottom: 27px;
  font-size: clamp(1rem, 1.7vw, 1.2rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(150deg, rgba(109, 93, 252, 0.16), rgba(24, 29, 55, 0.9));
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
}

.stat-card,
.metric-card,
.feature-card,
.panel,
.wallet-card,
.price-card,
.member-card,
.request-card,
.admin-row {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.16);
}

.stat-card {
  padding: 19px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.stat-card span,
.stat-card small,
.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin: 2px 0;
  font-size: 1.17rem;
}

.feature-grid,
.metric-grid,
.dashboard-grid,
.member-grid,
.price-grid {
  display: grid;
  gap: 18px;
}

.feature-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
}

.feature-card,
.panel {
  padding: clamp(22px, 3vw, 30px);
  border-radius: var(--radius);
}

.feature-card {
  min-height: 180px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.page-heading h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.45rem);
}

.page-heading p {
  max-width: 780px;
  margin-bottom: 0;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric-card {
  padding: 22px;
  border-radius: 18px;
}

.metric-card strong {
  display: block;
  margin: 6px 0 2px;
  overflow-wrap: anywhere;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1;
}

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

.panel > :last-child,
.feature-card > :last-child,
.member-card > :last-child,
.price-card > :last-child {
  margin-bottom: 0;
}

.narrow {
  width: min(560px, 100%);
  margin-inline: auto;
}

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

.action-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
  text-decoration: none;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.action-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(109, 93, 252, 0.55);
  background: rgba(109, 93, 252, 0.1);
}

.detail-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.detail-list > div {
  display: grid;
  grid-template-columns: 1fr minmax(0, 1.6fr);
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.detail-list > div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 750;
  text-align: right;
}

.wallet-card {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 52px);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(109, 93, 252, 0.85), rgba(34, 41, 72, 0.95)),
    var(--panel-solid);
  box-shadow: var(--shadow);
}

.wallet-card::after {
  content: "V";
  position: absolute;
  right: -10px;
  bottom: -74px;
  color: rgba(255, 255, 255, 0.08);
  font-size: 15rem;
  font-weight: 950;
  line-height: 1;
}

.wallet-card > * {
  position: relative;
  z-index: 1;
}

.wallet-card strong {
  display: block;
  margin: 7px 0;
  font-size: clamp(3.4rem, 11vw, 8rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.wallet-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px 30px;
  color: rgba(255, 255, 255, 0.78);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.badge-success {
  border-color: rgba(45, 211, 154, 0.28);
  background: rgba(45, 211, 154, 0.12);
  color: #7ff0c6;
}

.badge-warning {
  border-color: rgba(255, 191, 77, 0.28);
  background: rgba(255, 191, 77, 0.12);
  color: #ffd383;
}

.badge-danger {
  border-color: rgba(255, 92, 119, 0.3);
  background: rgba(255, 92, 119, 0.12);
  color: #ff9daf;
}

.alert {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(109, 93, 252, 0.36);
  border-radius: var(--radius-small);
  background: rgba(109, 93, 252, 0.13);
  color: #dcd8ff;
  font-weight: 700;
}

.alert-success {
  border-color: rgba(45, 211, 154, 0.35);
  background: rgba(45, 211, 154, 0.12);
  color: #9cf4d4;
}

.alert-warning {
  border-color: rgba(255, 191, 77, 0.35);
  background: rgba(255, 191, 77, 0.12);
  color: #ffdc9b;
}

.alert-danger {
  border-color: rgba(255, 92, 119, 0.35);
  background: rgba(255, 92, 119, 0.12);
  color: #ff9daf;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  color: white;
  font-weight: 820;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  transition: transform 140ms ease, filter 140ms ease, border-color 140ms ease, background 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  background: linear-gradient(135deg, var(--primary), #8559f4);
  box-shadow: 0 9px 24px rgba(109, 93, 252, 0.25);
}

.button-secondary {
  border-color: rgba(40, 216, 198, 0.27);
  background: rgba(40, 216, 198, 0.13);
  color: #8cf2e8;
}

.button-success {
  background: rgba(45, 211, 154, 0.17);
  color: #84efc8;
  border-color: rgba(45, 211, 154, 0.3);
}

.button-danger {
  background: rgba(255, 92, 119, 0.14);
  color: #ff9daf;
  border-color: rgba(255, 92, 119, 0.3);
}

.button-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}

.button-small {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 0.82rem;
}

.stack-form {
  display: grid;
  gap: 16px;
}

.inline-form {
  display: inline-flex;
}

label {
  display: grid;
  gap: 7px;
  color: #d8dcf2;
  font-size: 0.88rem;
  font-weight: 760;
}

input,
select {
  width: 100%;
  min-height: 45px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: rgba(7, 9, 20, 0.62);
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input:focus,
select:focus {
  border-color: rgba(109, 93, 252, 0.8);
  background: rgba(10, 12, 28, 0.9);
  box-shadow: 0 0 0 4px rgba(109, 93, 252, 0.13);
}

input::placeholder {
  color: #737d9f;
}

.bundle-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.bundle-input {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.request-list,
.admin-list {
  display: grid;
  gap: 12px;
}

.request-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 19px 21px;
  border-radius: 17px;
}

.request-card-main {
  min-width: 0;
}

.request-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.request-title strong {
  font-size: 1.05rem;
}

.request-card p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.gift-thumb {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 14px;
  object-fit: cover;
  background: var(--panel-light);
}

.wallet-card + .button-row {
  margin-top: 16px;
}

.empty-state {
  padding: 40px 20px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 17px;
  color: var(--muted);
  text-align: center;
}

.shop-toolbar {
  position: sticky;
  top: 88px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(14, 17, 36, 0.9);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(15px);
}

.shop-toolbar > input {
  max-width: 500px;
}

.cart-summary {
  display: flex;
  align-items: center;
  gap: 13px;
  white-space: nowrap;
}

.cart-summary span {
  color: var(--muted);
  font-size: 0.83rem;
}

.cart-summary strong {
  min-width: 112px;
  text-align: right;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 15px;
}

.shop-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.shop-card:hover {
  transform: translateY(-3px);
  border-color: rgba(109, 93, 252, 0.5);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.3);
}

.shop-card.is-filtered {
  display: none;
}

.shop-image {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: linear-gradient(145deg, #202749, #12162c);
}

.shop-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: rgba(255, 255, 255, 0.22);
  font-size: 5rem;
  font-weight: 950;
}

.shop-card-body {
  display: grid;
  gap: 7px;
  padding: 15px;
}

.shop-card-body h2 {
  min-height: 2.5em;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.97rem;
}

.shop-card-body p {
  margin: 0;
  color: #cbc7ff;
  font-size: 0.86rem;
  font-weight: 760;
}

.shop-card-body label {
  margin-top: 4px;
}

.shop-qty {
  min-height: 38px;
}

.giveaway-card {
  display: block;
  cursor: pointer;
}

.giveaway-card > input[type="radio"] {
  position: absolute;
  z-index: 3;
  top: 12px;
  left: 12px;
  width: 21px;
  min-height: 21px;
  accent-color: var(--primary);
}

.giveaway-card:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(40, 216, 198, 0.15), 0 18px 42px rgba(0, 0, 0, 0.3);
}

.giveaway-controls {
  position: sticky;
  top: 88px;
  z-index: 16;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 14px;
  padding: 17px;
  background: rgba(24, 29, 55, 0.94);
  backdrop-filter: blur(15px);
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: #8993b8;
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.numeric {
  text-align: right;
}

.rank {
  color: var(--accent);
  font-weight: 900;
}

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

.member-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 17px;
}

.member-card strong,
.member-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.avatar {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-small {
  width: 31px;
  height: 31px;
}

.avatar-fallback {
  background: linear-gradient(145deg, var(--primary), var(--accent));
  color: white;
  font-weight: 900;
}

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

.price-card {
  padding: 22px;
  border-radius: 18px;
}

.price-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 1.8rem;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 17px;
  padding: 15px 17px;
  border-radius: 14px;
}

.admin-row > div:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.admin-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.83rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: auto 1fr;
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    order: 3;
    padding-bottom: 2px;
  }

  .account-actions,
  .account-chip {
    justify-self: end;
  }

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

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

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-panel {
    transform: none;
  }

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

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

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

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

  .giveaway-controls {
    grid-template-columns: 1fr 1fr;
  }

  .giveaway-controls .button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .site-header {
    gap: 11px;
    padding: 10px 14px;
  }

  .brand > span:last-child,
  .account-chip > span,
  .account-actions .button-ghost {
    display: none;
  }

  .page-shell,
  .page-shell-wide {
    width: min(100% - 22px, 1420px);
    padding-top: 34px;
  }

  .page-heading,
  .request-card,
  .admin-row,
  .shop-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .page-heading {
    display: flex;
  }

  .metric-grid,
  .member-grid,
  .shop-grid,
  .price-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card {
    padding: 17px;
  }

  .shop-toolbar,
  .giveaway-controls {
    position: static;
  }

  .shop-toolbar > input {
    max-width: none;
  }

  .cart-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    width: 100%;
  }

  .cart-summary .button {
    grid-column: 1 / -1;
  }

  .admin-row .button-row,
  .admin-row .button-row form,
  .admin-row .button-row button {
    width: 100%;
  }

  .detail-list > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .detail-list dd {
    text-align: left;
  }
}

@media (max-width: 440px) {
  h1 {
    font-size: 2.25rem;
  }

  .feature-grid,
  .metric-grid,
  .member-grid,
  .shop-grid,
  .price-grid,
  .bundle-grid,
  .giveaway-controls {
    grid-template-columns: 1fr;
  }

  .shop-card-body h2 {
    min-height: auto;
  }

  .button-row {
    flex-wrap: wrap;
  }
}

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