:root {
  --bg: #0b0d12;
  --surface: #141820;
  --surface-2: #1b2230;
  --border: #2a3448;
  --text: #e8edf7;
  --muted: #93a0b8;
  --accent: #5b8cff;
  --accent-2: #7c5cff;
  --patreon: #ff424d;
  --steam: #1b2838;
  --ok: #3ecf8e;
  --warn: #ffb020;
  --danger: #ff5c6c;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(91, 140, 255, 0.18), transparent),
    var(--bg);
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand span { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.nav-link, .btn-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover, .btn-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.is-active {
  color: var(--text);
  background: rgba(91, 140, 255, 0.16);
}

.nav-spacer { flex: 1; min-width: 12px; }

.nav-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 6px;
  flex-shrink: 0;
}

.nav-logout {
  border: 1px solid var(--border);
}

.nav-logout:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 92, 108, 0.1);
  color: #ffc7cd;
}

.content { flex: 1; }

.footer {
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.03em;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  margin: 0;
}

.lead {
  color: var(--muted);
  line-height: 1.6;
  max-width: 62ch;
}

.login-grid {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.login-grid--two {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.nav-admin {
  background: rgba(124, 92, 255, 0.2);
  color: #d4c8ff !important;
}

.nav-admin:hover {
  background: rgba(124, 92, 255, 0.32);
  color: #ebe4ff !important;
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .nav { justify-content: flex-start; }

  .nav-spacer { display: none; }
}

.login-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.login-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.login-card strong { display: block; font-size: 1.05rem; }
.login-card span { color: var(--muted); font-size: 0.88rem; }

.login-card.patreon { background: linear-gradient(90deg, #c13545, var(--patreon)); }
.login-card.steam { background: linear-gradient(90deg, #2a475e, var(--steam)); }
.profile {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 20px;
  row-gap: 8px;
  align-items: center;
  margin-bottom: 24px;
}

.profile img {
  grid-column: 1;
  grid-row: 1;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.profile__tier {
  grid-column: 1;
  grid-row: 2;
  justify-self: center;
  margin: 0;
  text-align: center;
  max-width: 88px;
}

.profile__name {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  line-height: 1.2;
  align-self: center;
}

.meta-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 20px 0;
}

.meta-item {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.meta-item label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0 20px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: #fff; }

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.form-grid {
  display: grid;
  gap: 14px;
  max-width: 520px;
}

label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 0.88rem; }

input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f131a;
  color: var(--text);
}

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  margin: 12px 0;
  border: 1px solid;
}

.alert.ok { background: rgba(62, 207, 142, 0.12); border-color: var(--ok); color: #b8f5d8; }
.alert.err { background: rgba(255, 92, 108, 0.12); border-color: var(--danger); color: #ffc7cd; }

.table-wrap { overflow-x: auto; margin-top: 16px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

th { color: var(--muted); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(91, 140, 255, 0.15);
  color: #b8d0ff;
}

.badge.custom { background: rgba(124, 92, 255, 0.18); color: #d4c8ff; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}

.status-pill__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.72rem;
  line-height: 1;
}

.status-pill--active {
  color: #7dffb8;
}

.status-pill--active .status-pill__icon {
  background: rgba(62, 207, 142, 0.22);
  color: #3ecf8e;
  border: 1px solid rgba(62, 207, 142, 0.45);
}

.status-pill--inactive {
  color: var(--muted);
}

.color-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.color-swatch {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.color-swatch:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.color-swatch:has(input:checked) {
  border-color: var(--accent);
  background: rgba(91, 140, 255, 0.12);
}

.color-swatch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.color-swatch__chip {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.color-swatch__chip--light {
  border-color: rgba(255, 255, 255, 0.45);
}

.color-swatch__chip--rainbow {
  background: linear-gradient(
    135deg,
    #ff3366 0%,
    #ff9933 18%,
    #ffee33 36%,
    #33cc66 54%,
    #3399ff 72%,
    #9933ff 100%
  );
}

.color-swatch__label {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.color-swatch:has(input:checked) .color-swatch__label {
  color: var(--text);
  font-weight: 600;
}

.color-preview {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.color-preview__chip {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
