:root {
  color-scheme: dark;
  --bg: #07101d;
  --panel: rgba(15, 27, 46, .92);
  --panel-2: rgba(12, 23, 39, .96);
  --border: #233956;
  --text: #f6f8fc;
  --muted: #8ea0b8;
  --blue: #4f86ff;
  --blue-2: #6ea1ff;
  --green: #40df91;
  --yellow: #f2c14d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 72% 10%, rgba(41, 95, 180, .16), transparent 32%),
    linear-gradient(180deg, #07101d, #050b14);
  color: var(--text);
}

button, a { font: inherit; }

.hidden { display: none !important; }

.background-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 22%, rgba(58, 117, 230, .08), transparent 26%);
}

.screen {
  position: relative;
  min-height: 100vh;
}

.center {
  display: grid;
  place-items: center;
  padding: 24px;
}

.panel {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-radius: 20px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, .24);
}

.auth-card {
  width: min(470px, 100%);
  padding: 44px;
  text-align: center;
}

.logo {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  margin: 0 auto 26px;
  border-radius: 22px;
  font-weight: 900;
  font-size: 24px;
  background: linear-gradient(145deg, #3269db, #6b8cff);
  box-shadow: 0 14px 38px rgba(52, 105, 220, .32);
}

.eyebrow {
  display: block;
  margin-bottom: 9px;
  color: #72a6ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; }
h2 { margin-bottom: 8px; }
p { color: var(--muted); line-height: 1.55; }

.primary-button,
.secondary-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 0;
  border-radius: 12px;
  padding: 13px 19px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 750;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, #3976e9, #6088ef);
}

.secondary-button {
  color: #dce7f7;
  border: 1px solid #30445e;
  background: #111e30;
}

.small {
  margin-top: 14px;
  padding: 10px 14px;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.spinner {
  width: 46px;
  height: 46px;
  margin: 0 auto 24px;
  border: 4px solid #19304f;
  border-top-color: #5b91ff;
  border-radius: 50%;
  animation: spin .9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.topbar {
  max-width: 1240px;
  margin: 0 auto;
  padding: 42px 28px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  border-bottom: 1px solid rgba(55, 77, 105, .42);
}

.userbox {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 27, 46, .82);
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #19365c;
  font-weight: 800;
}

.userbox strong,
.userbox button {
  display: block;
}

.userbox button { margin-top: 4px; }

.content {
  width: min(1240px, calc(100% - 56px));
  margin: 0 auto;
  padding: 34px 0 70px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 22px;
}

.badge,
.status-pill {
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid #29405e;
  background: #102039;
  color: #a9bad1;
  font-size: 12px;
}

.guild-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.guild-card {
  min-height: 190px;
  padding: 24px;
  display: flex;
  gap: 18px;
  transition: transform .18s ease, border-color .18s ease;
}

.guild-card:hover {
  transform: translateY(-2px);
  border-color: #426493;
}

.guild-card.not-installed { opacity: .75; }

.guild-icon {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: #173251;
  background-size: cover;
  background-position: center;
  font-weight: 900;
  font-size: 20px;
}

.guild-icon.large {
  flex-basis: 74px;
  width: 74px;
  height: 74px;
}

.guild-icon.has-image { color: transparent; }

.guild-copy { min-width: 0; }
.guild-copy h3 {
  margin: 7px 0 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  font-size: 12px;
  font-weight: 750;
}

.status.online { color: var(--green); }
.status.pending { color: var(--yellow); }

.empty {
  padding: 38px;
  text-align: center;
}

.guild-title {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-left: auto;
}

.hero {
  min-height: 220px;
  padding: 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  background:
    radial-gradient(circle at 78% 20%, rgba(57, 118, 222, .22), transparent 34%),
    linear-gradient(180deg, rgba(16, 34, 60, .96), rgba(12, 25, 43, .96));
}

.status-pill { color: var(--green); }

.module-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.module { padding: 26px; }
.module > span { font-size: 28px; }
.module h3 { margin: 14px 0 7px; }

@media (max-width: 900px) {
  .guild-grid,
  .module-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 650px) {
  .topbar,
  .section-heading,
  .hero {
    align-items: stretch;
    flex-direction: column;
  }

  .guild-grid,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .content {
    width: min(100% - 28px, 1240px);
  }

  .topbar { padding-inline: 14px; }
  .auth-card { padding: 32px 24px; }
  .guild-title { margin-left: 0; }
}


.primary-button:disabled,
.secondary-button:disabled {
  opacity: .62;
  cursor: wait;
  transform: none;
}

.guild-card.installing {
  border-color: rgba(79, 134, 255, .68);
  box-shadow: 0 0 0 1px rgba(79, 134, 255, .16),
              0 25px 70px rgba(0, 0, 0, .24);
}
