:root {
  --bg-0: #0a0417;
  --bg-1: #130826;
  --accent-1: #a855f7;
  --accent-2: #ec4899;
  --accent-3: #38bdf8;
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-strong: rgba(168, 85, 247, 0.35);
  --glow-violet: rgba(168, 85, 247, 0.45);
  --glow-pink: rgba(236, 72, 153, 0.35);
  --text-main: #f3e8ff;
  --text-muted: #c7b7e3;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  min-height: 100%;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background: var(--bg-0);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(1000px 700px at 12% -10%, rgba(168, 85, 247, 0.35), transparent 60%),
    radial-gradient(800px 500px at 110% 10%, rgba(236, 72, 153, 0.30), transparent 55%),
    radial-gradient(900px 700px at 50% 120%, rgba(56, 189, 248, 0.22), transparent 60%),
    linear-gradient(180deg, #0a0417 0%, #130826 40%, #0a0417 100%);
  min-height: 100vh;
  position: relative;
}

.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(168, 85, 247, 0.22), transparent 35%),
    radial-gradient(circle at 80% 40%, rgba(236, 72, 153, 0.2), transparent 35%),
    radial-gradient(circle at 60% 90%, rgba(56, 189, 248, 0.18), transparent 35%);
  filter: blur(60px);
  animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(0, -30px, 0) scale(1.08); }
}

.app {
  position: relative;
  z-index: 2;
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px 28px 80px;
}

header.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-avatar {
  width: 64px;
  height: 64px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow:
    0 10px 40px var(--glow-violet),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.brand-title h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, #e9d5ff 60%, #f9a8d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-title p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  font-size: 13px;
  color: var(--text-muted);
}

.pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 12px currentColor;
}

.pill.online .dot { background: var(--success); color: var(--success); }
.pill.booting .dot { background: var(--warning); color: var(--warning); }
.pill.ready .dot { background: var(--success); color: var(--success); }
.pill.error .dot { background: var(--danger); color: var(--danger); }

.auth-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  max-width: 360px;
  flex: 1;
  justify-content: flex-end;
}

.auth-card input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.auth-card input::placeholder { color: rgba(199, 183, 227, 0.5); }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.18));
  border: 1px solid var(--glass-border-strong);
  color: var(--text-main);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(168, 85, 247, 0.3);
}

.grid {
  display: grid;
  gap: 22px;
}

.grid.stats {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-bottom: 26px;
}

.card {
  position: relative;
  padding: 22px;
  border-radius: 26px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--glass-border-strong);
  box-shadow:
    0 30px 70px rgba(10, 4, 23, 0.6),
    0 0 0 1px rgba(168, 85, 247, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 27px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.55), rgba(236, 72, 153, 0.45), rgba(56, 189, 248, 0.4));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }

.card.kpi h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card.kpi .value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 0%, #e9d5ff 70%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card.kpi .sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(236, 72, 153, 0.25));
  border: 1px solid var(--glass-border-strong);
}

.grid.main {
  grid-template-columns: 1.2fr 1fr;
}

@media (max-width: 960px) {
  .grid.main { grid-template-columns: 1fr; }
  header.hero { flex-direction: column; align-items: stretch; }
  .auth-card { max-width: 100%; justify-content: stretch; }
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
  border: 1px solid var(--glass-border-strong);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.25s ease;
}
.refresh-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(168, 85, 247, 0.25); }
.refresh-btn.spin i { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.status-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.status-row .k {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}
.status-row .v {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.badge-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 520px) { .badge-list { grid-template-columns: 1fr; } }

.badge-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(236, 72, 153, 0.05));
  border: 1px solid var(--glass-border);
  transition: all 0.25s ease;
}
.badge-card:hover { border-color: var(--glass-border-strong); transform: translateY(-1px); }
.badge-card.active {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(16, 185, 129, 0.06));
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow: 0 12px 30px rgba(34, 197, 94, 0.15);
}

.badge-emoji {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.badge-info { min-width: 0; flex: 1; }
.badge-info .name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.badge-info .count {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.badge-info .roleid {
  font-size: 11px;
  color: rgba(199, 183, 227, 0.7);
  margin-top: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.state-chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 700;
}
.state-chip.off { background: rgba(239, 68, 68, 0.14); color: #fca5a5; }
.state-chip.on  { background: rgba(34, 197, 94, 0.16); color: #86efac; }

.lookup {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.lookup input {
  flex: 1;
  min-width: 0;
  padding: 13px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-size: 13.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  outline: none;
  transition: all 0.2s ease;
}
.lookup input:focus {
  border-color: var(--glass-border-strong);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.12);
}

.btn {
  padding: 13px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  border: none;
  color: white;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 14px 36px rgba(168, 85, 247, 0.35);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 20px 50px rgba(168, 85, 247, 0.45); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.result {
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  display: none;
}
.result.show { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.user-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.user-avatar {
  width: 60px; height: 60px;
  border-radius: 20px;
  background: linear-gradient(135deg, #333, #555);
  border: 2px solid var(--glass-border-strong);
  object-fit: cover;
  flex-shrink: 0;
}
.user-meta h4 { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.user-meta p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.user-meta .status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-top: 6px;
}
.status-pill.online  { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.status-pill.idle    { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.status-pill.dnd     { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.status-pill.offline { background: rgba(107, 114, 128, 0.18); color: #cbd5e1; }

.activity-list {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 12px;
}
.activity {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 12.5px;
}
.activity .t { font-weight: 700; margin-bottom: 3px; }
.activity .s { color: var(--text-muted); font-size: 12px; }

.user-badges {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px;
}
.ubadge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(236, 72, 153, 0.16));
  border: 1px solid var(--glass-border-strong);
}
.ubadge .e { filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.5)); }

.error-box {
  padding: 14px; border-radius: 16px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fecaca;
  font-size: 13px;
}

footer.mini {
  margin-top: 50px;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

footer.mini .links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

footer.mini a {
  color: #e9d5ff;
  text-decoration: none;
  border-bottom: 1px dashed rgba(233, 213, 255, 0.35);
  padding-bottom: 1px;
  transition: all 0.2s ease;
}
footer.mini a:hover {
  color: #fff;
  border-color: var(--accent-2);
}

.tiny-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  margin-left: 6px;
}

.spark {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 12px var(--success);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.6; transform: scale(1);} 50% { opacity: 1; transform: scale(1.25);} }

.guild-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: 22px;
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(236, 72, 153, 0.08)),
    radial-gradient(circle at 100% 0%, rgba(56, 189, 248, 0.15), transparent 50%);
  border: 1px solid var(--glass-border-strong);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
}
.guild-icon {
  width: 66px; height: 66px; border-radius: 22px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 30px; overflow: hidden; flex-shrink: 0;
  box-shadow: 0 14px 30px rgba(168, 85, 247, 0.35);
}
.guild-icon img { width: 100%; height: 100%; object-fit: cover; }
.guild-name { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.guild-id { font-size: 12px; color: var(--text-muted); font-family: ui-monospace, monospace; }
.guild-meta { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

.endpoints {
  display: flex; flex-direction: column; gap: 10px; margin-top: 8px;
}
.endpoint {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 12.5px;
}
.endpoint .method {
  font-weight: 800;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 8px;
  text-align: center;
  letter-spacing: 0.06em;
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}
.endpoint .path {
  font-family: ui-monospace, Menlo, monospace;
  color: #e9d5ff;
  word-break: break-all;
}
.endpoint .copy-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s ease;
}
.endpoint .copy-btn:hover { background: rgba(168, 85, 247, 0.16); border-color: var(--glass-border-strong); }
