:root {
  --bg: #0b1020;
  --bg-2: #121a2f;
  --ink: #edf2ff;
  --muted: #9aa8c7;
  --line: #243152;
  --accent: #5865f2;
  --accent-2: #57f287;
  --card: rgba(18, 26, 47, 0.88);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 45% at 15% 0%, rgba(88, 101, 242, 0.28), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 90%, rgba(87, 242, 135, 0.12), transparent 50%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
}

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

.wrap {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #7289da);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
}

.nav-actions { display: flex; gap: 0.7rem; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.8rem 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-discord {
  background: var(--accent);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-green {
  background: color-mix(in srgb, var(--accent-2) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line));
  color: var(--accent-2);
}

.hero {
  padding: 4.5rem 0 3rem;
  display: grid;
  gap: 1.2rem;
  max-width: 720px;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 54ch;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 0.6rem; }

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1rem 0 4rem;
}
.feature {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.2rem;
}
.feature h3 { margin: 0 0 0.45rem; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 0.95rem; }

.panel-shell { padding: 2rem 0 3rem; }
.panel-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.5rem;
}
.user-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.user-row img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--line);
}
.user-row h1 { margin: 0 0 0.25rem; font-size: 1.55rem; }
.user-row p { margin: 0; color: var(--muted); }
.meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}
.meta .item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}
.meta .label { color: var(--muted); font-size: 0.8rem; margin-bottom: 0.25rem; }
.meta .value { font-weight: 700; word-break: break-all; }

.flash {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, #ed4245 40%, var(--line));
  background: color-mix(in srgb, #ed4245 14%, transparent);
  color: #ffb4b8;
}
.flash-ok {
  border-color: color-mix(in srgb, var(--accent-2) 40%, var(--line));
  background: color-mix(in srgb, var(--accent-2) 14%, transparent);
  color: #b8f5cb;
}
.flash a { text-decoration: underline; }

.discord-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.legend-item { display: inline-flex; align-items: center; gap: 0.45rem; }
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot-on { background: var(--accent-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 25%, transparent); }
.dot-off { background: #f0b232; box-shadow: 0 0 0 3px color-mix(in srgb, #f0b232 20%, transparent); }

.guild-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1.2rem;
}
.guild-stats span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.guild-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.9rem;
}
.guild-card {
  display: grid;
  gap: 0.55rem;
  justify-items: center;
  text-align: center;
  padding: 1rem 0.75rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(10, 14, 28, 0.45);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
a.guild-card:hover {
  transform: translateY(-2px);
}
.guild-card.is-present {
  border-color: color-mix(in srgb, var(--accent-2) 55%, var(--line));
  background: color-mix(in srgb, var(--accent-2) 8%, rgba(10, 14, 28, 0.45));
}
.guild-card.is-missing {
  border-color: color-mix(in srgb, #f0b232 45%, var(--line));
  background: color-mix(in srgb, #f0b232 7%, rgba(10, 14, 28, 0.45));
}
.guild-card.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
}
.guild-icon {
  position: relative;
  width: 72px;
  height: 72px;
  margin-bottom: 0.55rem;
  border-radius: 22px;
  background: #1b243b;
  display: grid;
  place-items: center;
  font-weight: 700;
  border: 2px solid transparent;
}
.guild-icon.large {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  margin-bottom: 0;
}
.guild-card.is-present .guild-icon {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 22%, transparent);
}
.guild-card.is-missing .guild-icon {
  border-color: #f0b232;
  filter: grayscale(0.35);
  box-shadow: 0 0 0 3px color-mix(in srgb, #f0b232 18%, transparent);
}
.guild-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.guild-badge {
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: #0d1322;
  border: 1px solid var(--line);
  z-index: 1;
}
.is-present .guild-badge { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 50%, var(--line)); }
.is-missing .guild-badge { color: #f0b232; border-color: color-mix(in srgb, #f0b232 50%, var(--line)); }
.guild-name {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.guild-action {
  color: var(--muted);
  font-size: 0.78rem;
}
.empty-state { color: var(--muted); }

.settings-form {
  display: grid;
  gap: 1rem;
  margin-top: 0.5rem;
}
.settings-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.settings-form label.check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
}
.settings-form input[type="text"],
.settings-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0c1016;
  color: var(--ink);
  padding: 0.8rem 0.9rem;
  font: inherit;
}
.settings-form small { color: var(--muted); }
.settings-form .btn { width: fit-content; }

@media (max-width: 800px) {
  .features { grid-template-columns: 1fr; }
  .meta { grid-template-columns: 1fr; }
}
