.community-main {
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 8%, rgba(211, 79, 47, .16), transparent 28rem),
    radial-gradient(circle at 12% 34%, rgba(143, 231, 224, .08), transparent 24rem),
    var(--coal);
}

.community-hero {
  position: relative;
  min-height: 54svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 40px;
  padding: 118px clamp(18px, 6vw, 84px) 46px;
  isolation: isolate;
}

.community-hero::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(13, 16, 20, .97), rgba(13, 16, 20, .68) 55%, rgba(13, 16, 20, .38)),
    url("/assets/screenshots/updated_map.jpg") center 42% / cover;
  filter: saturate(.65) contrast(1.08);
}

.community-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(0deg, var(--coal), transparent 52%), linear-gradient(110deg, rgba(211, 79, 47, .14), transparent 48%);
}

.community-hero-grid {
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .16;
  background-image: linear-gradient(rgba(143, 231, 224, .3) 1px, transparent 1px), linear-gradient(90deg, rgba(143, 231, 224, .3) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(90deg, transparent, #000 54%, transparent);
}

.community-hero-copy { max-width: 880px; }
.community-hero h1 { max-width: 820px; margin-bottom: 18px; font-size: clamp(3.4rem, 7vw, 6.4rem); line-height: .86; letter-spacing: -.06em; }
.community-hero-copy > p:not(.eyebrow) { max-width: 660px; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.18rem); }
.community-live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 6px rgba(143, 231, 224, .1), 0 0 18px var(--cyan); }
.community-hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 22px; }
.community-text-link { color: var(--ink); font-weight: 800; text-decoration: none; }
.community-text-link span { color: var(--cyan); margin-left: 5px; }

.community-signal {
  width: min(310px, 32vw);
  border: 1px solid rgba(143, 231, 224, .28);
  border-radius: 10px;
  padding: 20px;
  background: rgba(13, 16, 20, .72);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .35);
  backdrop-filter: blur(16px);
}
.community-signal::before { content: ""; display: block; width: 100%; height: 3px; margin-bottom: 18px; background: linear-gradient(90deg, var(--cyan), transparent); }
.community-signal span, .community-signal small { display: block; color: var(--subtle); font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; }
.community-signal strong { display: block; margin: 5px 0 16px; font-size: 1.25rem; }

.community-dashboard, .community-event-shell, .community-history, .community-cta { padding: clamp(52px, 6.5vw, 84px) clamp(18px, 6vw, 84px); }
.community-section-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 430px); align-items: end; gap: 28px; margin-bottom: 28px; }
.community-section-heading h2 { margin-bottom: 0; }
.community-section-heading > p { margin: 0; color: var(--muted); }

.community-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.community-stat-card { position: relative; min-height: 0; display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-areas: "index label" "index value" "index change"; align-content: center; column-gap: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; background: linear-gradient(145deg, rgba(30, 31, 33, .95), rgba(18, 18, 20, .74)); box-shadow: 0 20px 48px rgba(0, 0, 0, .2); }
.community-stat-card::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 100% 0, rgba(244, 179, 95, .12), transparent 44%); pointer-events: none; }
.community-stat-card > span { grid-area: index; width: 32px; height: 32px; display: grid; place-items: center; align-self: start; border: 1px solid rgba(244, 179, 95, .2); border-radius: 50%; color: var(--amber); background: rgba(244, 179, 95, .06); font-size: .65rem; font-weight: 850; letter-spacing: .06em; }
.community-stat-card p { grid-area: label; align-self: end; margin: 0 0 4px; color: var(--muted); font-size: .74rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.community-stat-card strong { grid-area: value; font-size: clamp(2rem, 3vw, 3rem); line-height: .95; letter-spacing: -.045em; }
.community-stat-card small { grid-area: change; margin-top: 7px; color: var(--green); font-size: .78rem; font-weight: 800; }
.community-stat-card.is-loading { opacity: .72; }
.community-dashboard-note { display: flex; align-items: center; justify-content: flex-end; gap: 7px; margin: 13px 2px 0; color: var(--subtle); font-size: .72rem; }
.community-dashboard-note span { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px rgba(143, 231, 224, .6); }

.community-event-shell { position: relative; }
.community-event-shell::before { content: ""; position: absolute; inset: 3% 0 auto; height: 60%; z-index: 0; background: linear-gradient(90deg, rgba(211, 79, 47, .09), rgba(244, 179, 95, .04), transparent); border-block: 1px solid rgba(211, 79, 47, .1); transform: skewY(-2deg); pointer-events: none; }
.community-event-shell > * { position: relative; z-index: 1; }
.community-event-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 26px; margin-bottom: 24px; }
.community-event-header h2 { margin-bottom: 9px; font-size: clamp(2.5rem, 4.7vw, 4.2rem); letter-spacing: -.05em; }
.community-event-header > div:first-child > p:last-child { max-width: 700px; margin: 0; color: var(--muted); }
.community-event-window { min-width: 230px; border-left: 2px solid var(--rust); padding-left: 16px; }
.community-event-window span { display: block; color: var(--amber); font-size: .76rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.community-event-window strong { display: block; margin-top: 5px; font-size: .95rem; }

.community-event-layout { display: grid; grid-template-columns: minmax(250px, .46fr) minmax(0, 1.54fr); gap: 16px; }
.community-event-score, .community-leaderboard-wrap { border: 1px solid var(--line); border-radius: 10px; background: rgba(19, 20, 22, .92); box-shadow: 0 28px 70px rgba(0, 0, 0, .28); }
.community-event-score { min-height: 300px; display: flex; flex-direction: column; justify-content: center; padding: clamp(22px, 3vw, 34px); background: radial-gradient(circle at 30% 0, rgba(211, 79, 47, .2), transparent 44%), rgba(19, 20, 22, .94); }
.community-event-score > span, .community-event-score > small { color: var(--muted); font-size: .75rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.community-event-score > strong { margin: 8px 0 7px; color: var(--amber); font-size: clamp(2.8rem, 4.5vw, 4.5rem); line-height: .88; letter-spacing: -.055em; }
.community-event-mini-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); }
.community-event-mini-stats span { display: block; color: var(--subtle); font-size: .72rem; }
.community-event-mini-stats strong { display: block; margin-top: 3px; font-size: 1.3rem; }
.community-leaderboard-wrap { min-width: 0; padding: 20px; }
.community-table-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 14px; padding: 0 4px; }
.community-table-heading span, .community-table-heading small { color: var(--subtle); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.community-table-heading h3 { margin: 2px 0 0; font-size: 1.45rem; }
.community-table-scroll { overflow-x: auto; }
.community-leaderboard { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.community-leaderboard th { padding: 10px 12px; color: var(--subtle); font-size: .66rem; text-align: left; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
.community-leaderboard td { padding: 12px; border-top: 1px solid rgba(247, 239, 226, .08); color: var(--muted); font-size: .86rem; white-space: nowrap; }
.community-leaderboard tbody tr { transition: background .15s ease; }
.community-leaderboard tbody tr:hover { background: rgba(143, 231, 224, .035); }
.community-leaderboard tr.is-top-1 { background: linear-gradient(90deg, rgba(244, 179, 95, .12), transparent); }
.community-leaderboard tr.is-top-2, .community-leaderboard tr.is-top-3 { background: linear-gradient(90deg, rgba(143, 231, 224, .06), transparent); }
.community-rank-cell, .community-result-cell { color: var(--ink) !important; font-weight: 900; }
.community-result-cell { text-align: right; }
.community-player-cell { min-width: 170px; color: var(--ink) !important; font-weight: 750; }
.community-player-cell span { vertical-align: middle; }
.community-flag { width: 22px; height: 16px; margin-right: 9px; object-fit: cover; border-radius: 2px; vertical-align: middle; }
.community-flag-placeholder { display: inline-flex; width: 22px; margin-right: 9px; justify-content: center; color: var(--subtle); }
.community-table-empty { height: 180px; text-align: center !important; white-space: normal !important; }

.community-history { border-top: 1px solid rgba(247, 239, 226, .08); }
.community-history-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.community-history-card, .community-history-empty { border: 1px solid var(--line); border-radius: 10px; padding: clamp(22px, 3vw, 32px); background: linear-gradient(145deg, rgba(28, 28, 30, .94), rgba(17, 18, 20, .9)); }
.community-history-card > span, .community-history-empty > span { color: var(--rust); font-size: .72rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.community-history-card h3, .community-history-empty h3 { max-width: 560px; margin-top: 18px; font-size: clamp(1.6rem, 2.2vw, 2.25rem); }
.community-history-card p, .community-history-empty p { color: var(--muted); }
.community-history-summary { color: var(--ink) !important; font-size: 1.05rem; font-weight: 700; }
.community-history-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 22px 0; }
.community-history-facts div { padding-top: 12px; border-top: 1px solid var(--line); }
.community-history-facts dt { color: var(--subtle); font-size: .68rem; text-transform: uppercase; }
.community-history-facts dd { margin: 4px 0 0; font-weight: 850; }
.community-history-card time { color: var(--subtle); font-size: .78rem; }

.community-cta { text-align: center; background: radial-gradient(circle at 50% 100%, rgba(211, 79, 47, .2), transparent 42rem); }
.community-cta h2 { margin-inline: auto; font-size: clamp(2.6rem, 4.5vw, 4.2rem); }
.community-cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; }

@media (max-width: 980px) {
  .community-hero { grid-template-columns: 1fr; }
  .community-signal { width: min(100%, 430px); }
  .community-stat-grid { grid-template-columns: 1fr; }
  .community-stat-card { min-height: 0; }
  .community-event-layout { grid-template-columns: 1fr; }
  .community-event-score { min-height: 300px; }
}

@media (max-width: 720px) {
  .community-hero { min-height: 88svh; padding-top: 126px; }
  .community-hero h1 { font-size: clamp(3.8rem, 18vw, 6.4rem); }
  .community-section-heading, .community-event-header { grid-template-columns: 1fr; align-items: start; }
  .community-event-window { min-width: 0; }
  .community-history-grid { grid-template-columns: 1fr; }
  .community-device-cell, .community-leaderboard th:nth-child(3) { display: none; }
  .community-history-facts { grid-template-columns: 1fr; }
  .community-dashboard-note { justify-content: flex-start; line-height: 1.4; }
}

@media (max-width: 520px) {
  .community-dashboard, .community-event-shell, .community-history, .community-cta { padding-inline: 14px; }
  .community-event-header { padding-inline: 4px; }
  .community-event-score, .community-leaderboard-wrap { border-radius: 8px; }
  .community-leaderboard-wrap { padding: 12px 8px; }
  .community-leaderboard th, .community-leaderboard td { padding: 10px 7px; }
  .community-player-cell { min-width: 138px; max-width: 164px; overflow: hidden; text-overflow: ellipsis; }
  .community-terraform-cell, .community-leaderboard th:nth-child(5) { display: none; }
  .community-event-mini-stats { margin-top: 34px; }
  .community-cta-actions { flex-direction: column; }
  .community-cta-actions .button { width: 100%; }
}
