/* ==========================================
   DISCORD COMMUNITY SECTION (homepage)
   Big icon + online members orbiting it +
   member cards with Pink & Purple theme.
   ========================================== */

.discord-section {
  position: relative;
  padding-top: 30px;
}

/* ---------- Heading ---------- */

.discord-heading {
  text-align: center;
}

.discord-heading h2 {
  margin: 12px 0 14px;

  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 900;
  letter-spacing: -1.6px;
  line-height: 1.05;
}

.discord-heading p {
  margin: 0 auto;
  max-width: 560px;

  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

/* ---------- Stage: the big icon ---------- */

.discord-stage {
  position: relative;

  display: grid;
  place-items: center;

  min-height: 330px;
  margin: 34px 0 26px;

  overflow: hidden;

  border: 1px solid rgba(216, 180, 254, .25);
  border-radius: 26px;

  background:
    radial-gradient(circle at 50% 50%, rgba(217, 70, 239, .2), transparent 62%),
    linear-gradient(180deg, rgba(168, 85, 247, .12), rgba(15, 6, 26, .75));
}

/* The subtle purple/pink grid behind the icon */

.discord-stage-grid {
  position: absolute;
  inset: 0;

  background-image:
    linear-gradient(rgba(217, 70, 239, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217, 70, 239, .12) 1px, transparent 1px);

  background-size: 34px 34px;

  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 12%, transparent 72%);
  mask-image: radial-gradient(circle at 50% 50%, #000 12%, transparent 72%);

  pointer-events: none;
}

.discord-logo-wrap {
  position: relative;

  display: grid;
  place-items: center;
}

.discord-logo {
  position: relative;
  z-index: 2;

  display: block;

  width: 168px;
  height: 168px;

  border-radius: 34px;

  box-shadow:
    0 24px 60px rgba(192, 132, 252, .45),
    0 0 0 1px rgba(255, 255, 255, .15) inset;

  animation: discord-float 6s ease-in-out infinite;
}

/* Soft pulse behind the icon */

.discord-ping {
  position: absolute;
  z-index: 1;

  width: 168px;
  height: 168px;

  border: 1px solid rgba(244, 114, 182, .6);
  border-radius: 34px;

  animation: discord-ping 3.2s ease-out infinite;
  pointer-events: none;
}

@keyframes discord-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes discord-ping {
  0% { transform: scale(1); opacity: .55; }
  70% { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* ---------- Members orbiting the icon ---------- */

.discord-orbit {
  position: absolute;
  inset: 0;

  pointer-events: none;
}

.orbit-avatar {
  position: absolute;

  width: 46px;
  height: 46px;

  border-radius: 50%;
  overflow: hidden;

  border: 2px solid rgba(232, 121, 249, .8);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .5);

  transform: translate(-50%, -50%);
  animation: orbit-bob 5s ease-in-out infinite;
}

.orbit-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.orbit-avatar::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;

  width: 11px;
  height: 11px;

  border: 2px solid #220b24;
  border-radius: 50%;

  background: #50dfa0;
}

@keyframes orbit-bob {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.08); }
}

/* ---------- Counts ---------- */

.discord-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: center;
  gap: 14px;

  margin-bottom: 26px;
}

.discord-stat {
  padding: 16px 18px;

  border: 1px solid var(--border);
  border-radius: 14px;

  background: linear-gradient(145deg, #200d36, #11051e);
}

body.light-theme .discord-stat-label {
  color: var(--muted);
}

.discord-stat-label {
  display: flex;
  align-items: center;
  gap: 8px;

  color: var(--muted);

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.discord-stat-label img {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.discord-stat-label .ic {
  width: 14px;
  height: 14px;
  color: var(--pink, #f472b6);
}

.discord-stat strong {
  display: block;
  margin-top: 9px;

  font-size: 26px;
  font-weight: 900;
  letter-spacing: -.8px;
  line-height: 1;
}

.discord-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;

  background: #50dfa0;
  box-shadow: 0 0 10px #50dfa0aa;

  animation: discord-blink 1.6s ease-in-out infinite;
}

@keyframes discord-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

.discord-join {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  min-height: 62px;
  padding: 0 24px;

  border: 1px solid transparent;
  border-radius: 14px;

  background: linear-gradient(135deg, #f472b6, #a855f7);
  color: #fff;

  text-decoration: none;
  white-space: nowrap;

  font-size: 14px;
  font-weight: 800;

  box-shadow: 0 12px 32px rgba(217, 70, 239, .35);

  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
}

.discord-join img {
  border-radius: 6px;
}

.discord-join:hover {
  transform: translateY(-3px);
  filter: brightness(1.08);
  box-shadow: 0 18px 44px rgba(244, 114, 182, .55);
}

.discord-join.is-hidden {
  display: none;
}

/* ---------- Member grid ---------- */

.member-grid {
  position: relative;

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;

  padding: 18px;

  border: 1px solid rgba(216, 180, 254, .2);
  border-radius: 20px;

  background-color: rgba(14, 6, 24, .65);
  background-image:
    linear-gradient(rgba(217, 70, 239, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217, 70, 239, .08) 1px, transparent 1px);

  background-size: 26px 26px;
  background-position: -1px -1px;
}

.member-empty {
  grid-column: 1 / -1;

  padding: 26px 10px;

  color: var(--muted);
  text-align: center;

  font-size: 14px;
  line-height: 1.7;
}

.member-empty strong {
  display: block;
  margin-bottom: 6px;

  color: #f4c46a;
  font-size: 15px;
  font-weight: 800;
}

.member-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;

  padding: 14px;

  border: 1px solid rgba(216, 180, 254, .2);
  border-radius: 14px;

  background: rgba(22, 10, 36, .85);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);

  transition: transform .25s ease, border-color .25s ease,
    box-shadow .25s ease;
}

.member-card:hover {
  transform: translateY(-3px);
  border-color: rgba(244, 114, 182, .6);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .4), 0 0 20px rgba(217, 70, 239, .2);
}

.member-avatar {
  position: relative;

  display: block;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;

  border-radius: 50%;
  overflow: hidden;

  border: 1px solid rgba(232, 121, 249, .6);
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.member-avatar .member-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;

  width: 12px;
  height: 12px;

  border: 2px solid #220b24;
  border-radius: 50%;

  background: #50dfa0;
}

.member-avatar .member-dot.idle { background: #f4c46a; }
.member-avatar .member-dot.dnd { background: #ff727e; }
.member-avatar .member-dot.offline { background: #85618a; }

.member-info {
  flex: 1;
  min-width: 0;
}

/* Bold name beside the profile */

.member-name {
  display: block;

  color: var(--text, var(--white, #faf5ff));

  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.1px;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-game {
  display: block;
  margin-top: 3px;

  color: #e879f9;

  font-size: 11px;
  font-weight: 700;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Their message, at the bottom of the card */

.member-message {
  margin: 10px 0 0;
  padding-top: 10px;

  min-width: 0;

  border-top: 1px solid rgba(216, 180, 254, .18);

  color: #ebdff7;

  font-size: 12.5px;
  line-height: 1.45;

  overflow-wrap: anywhere;
  word-break: break-word;
}

.member-message .member-channel {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.member-message.is-typing {
  color: #f472b6;
  font-style: italic;
}

.member-message.is-quiet {
  color: var(--muted);
  font-style: normal;
}

.discord-footnote {
  margin: 16px 0 0;

  color: var(--muted);
  text-align: center;

  font-size: 11.5px;
  letter-spacing: .3px;
}

/* ---------- Light theme ---------- */

body.light-theme .discord-stage {
  background:
    radial-gradient(circle at 50% 50%, rgba(217, 70, 239, .15), transparent 62%),
    linear-gradient(180deg, rgba(168, 85, 247, .06), rgba(255, 255, 255, .8));
}

body.light-theme .discord-stat {
  background: rgba(255, 255, 255, .78);
}

body.light-theme .member-grid {
  background-color: rgba(255, 255, 255, .6);
  background-image:
    linear-gradient(rgba(217, 70, 239, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217, 70, 239, .09) 1px, transparent 1px);
}

body.light-theme .member-card {
  background: rgba(255, 255, 255, .9);
}

body.light-theme .member-message {
  color: #623c68;
}

body.light-theme .orbit-avatar::after,
body.light-theme .member-avatar .member-dot {
  border-color: #fef3ff;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .discord-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .discord-join {
    grid-column: 1 / -1;
    min-height: 52px;
  }
}

@media (max-width: 640px) {
  .discord-stage {
    min-height: 260px;
    border-radius: 20px;
  }

  .discord-logo {
    width: 124px;
    height: 124px;
    border-radius: 26px;
  }

  .discord-ping {
    width: 124px;
    height: 124px;
    border-radius: 26px;
  }

  .orbit-avatar {
    width: 36px;
    height: 36px;
  }

  .discord-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .member-grid {
    padding: 14px;
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .discord-logo,
  .discord-ping,
  .orbit-avatar,
  .discord-live-dot {
    animation: none;
  }
}