:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b1020;
  color: #f7f9fc;
}

* { box-sizing: border-box; }
.hidden { display: none !important; }
.muted { color: #8f99b5; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(88, 101, 242, .24), transparent 32%),
    radial-gradient(circle at top right, rgba(31, 196, 168, .18), transparent 28%),
    #0b1020;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.55), transparent 85%);
}

button { font: inherit; }
.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 36px;
}
.hero { max-width: 860px; margin-bottom: 48px; }

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-weight: 900;
  font-size: 28px;
  background: linear-gradient(135deg, #7c86ff, #56e0c5);
  color: #08101d;
  box-shadow: 0 16px 50px rgba(88, 101, 242, .35);
}

.eyebrow {
  margin: 22px 0 8px;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 13px;
  color: #9ea8c7;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 76px);
  line-height: .98;
  letter-spacing: -0.045em;
}
.lead {
  max-width: 700px;
  margin: 24px 0 0;
  color: #b9c1d6;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.6;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease, border-color .18s ease;
}
.button:hover { transform: translateY(-2px); }
.button:disabled { cursor: wait; opacity: .6; transform: none; }
.primary {
  background: #5865f2;
  color: white;
  box-shadow: 0 12px 30px rgba(88, 101, 242, .28);
}
.secondary {
  border: 1px solid #2a3450;
  color: #dce2f2;
  background: rgba(255,255,255,.03);
}

.account {
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid #293452;
  border-radius: 16px;
  background: rgba(255,255,255,.035);
}
.account-user { display: flex; align-items: center; gap: 12px; }
.account-user strong, .account-user span { display: block; }
.account-user strong { margin-top: 2px; }
.avatar, .guild-icon {
  overflow: hidden;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #202a45;
  color: #dfe4f6;
  font-weight: 900;
}
.avatar { width: 46px; height: 46px; border-radius: 50%; }
.avatar img, .guild-icon img { width: 100%; height: 100%; object-fit: cover; }
.fallback { background: linear-gradient(135deg, #5865f2, #3bb9a8); }

.guild-section {
  margin: 0 0 34px;
  padding: 24px;
  border: 1px solid #25304d;
  border-radius: 20px;
  background: rgba(11,16,32,.72);
}
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
}
.section-heading .eyebrow { margin-top: 0; }
.section-heading h2 { margin: 0; font-size: 28px; }
.section-heading > p { max-width: 470px; margin: 0; line-height: 1.5; }
.guild-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
}
.guild-actions .button { min-height: 44px; }
#refresh-status { font-size: 13px; }
.guild-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.guild-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  color: #f4f7ff;
  text-decoration: none;
  border: 1px solid #273352;
  border-radius: 14px;
  background: rgba(255,255,255,.035);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.guild-card:hover { transform: translateY(-2px); border-color: #5967dc; background: rgba(88,101,242,.09); }
.guild-icon { width: 48px; height: 48px; border-radius: 14px; }
.guild-card strong, .guild-card span { display: block; }
.guild-card div > span { margin-top: 4px; color: #8893b0; font-size: 13px; }
.guild-arrow { color: #7f8af5; font-size: 24px; }
.empty { margin: 0; color: #9da7c2; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.card {
  padding: 24px;
  border: 1px solid #222c46;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
}
.icon { font-size: 28px; }
.card h2 { margin: 18px 0 8px; font-size: 21px; }
.card p { margin: 0; color: #aeb8d0; line-height: 1.55; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid #1f2942;
  color: #77819b;
  font-size: 13px;
}

@media (max-width: 820px) {
  .shell { padding-top: 48px; }
  .cards, .guild-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
  .account { align-items: stretch; flex-direction: column; }
  .guild-actions { align-items: stretch; flex-direction: column; }
  .guild-actions .button { width: 100%; }
  footer { flex-direction: column; }
}
