.portal-community {
  width: 100%;
  max-width: 1580px;
  margin: 0 auto;
  padding-bottom: 55px;
  display: grid;
  gap: 18px;
}


/* HERO */

.community-hero {
  min-height: 490px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns:
    minmax(0, .95fr)
    minmax(370px, .65fr);
  align-items: center;
  padding: clamp(38px, 5vw, 72px);
  border: 1px solid var(--border-luminous);
  border-radius: 28px;
  background:
    radial-gradient(
      circle at 73% 38%,
      color-mix(
        in srgb,
        var(--region-accent) 24%,
        transparent
      ),
      transparent 35%
    ),
    radial-gradient(
      circle at 12% 14%,
      color-mix(
        in srgb,
        var(--region-secondary) 10%,
        transparent
      ),
      transparent 32%
    ),
    linear-gradient(
      135deg,
      color-mix(
        in srgb,
        var(--region-atmosphere) 45%,
        var(--surface-elevated)
      ),
      var(--surface-inset)
    );
}

.community-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .15;
  pointer-events: none;
  background-image:
    linear-gradient(
      color-mix(
        in srgb,
        var(--region-accent) 15%,
        transparent
      ) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      color-mix(
        in srgb,
        var(--region-accent) 15%,
        transparent
      ) 1px,
      transparent 1px
    );
  background-size:
    var(--region-grid)
    var(--region-grid);
}

.community-hero__copy {
  position: relative;
  z-index: 4;
}

.community-region-line {
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-muted);
  font-size: .62rem;
  letter-spacing: .1em;
}

.community-region-line b {
  color: var(--region-accent);
}

.community-region-line i {
  width: 1px;
  height: 12px;
  background: var(--border);
}

.community-hero h1 {
  margin: 10px 0 15px;
  max-width: 760px;
  font-size: clamp(3.8rem, 6vw, 6.8rem);
  line-height: .85;
  letter-spacing: -.06em;
}

.community-hero h1 strong {
  display: block;
  color: var(--region-accent);
}

.community-hero__copy > p {
  max-width: 680px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.7;
}

.community-hero-stats {
  margin-top: 27px;
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.community-hero-stats article {
  padding: 12px;
  border: 1px solid
    color-mix(
      in srgb,
      var(--region-accent) 25%,
      var(--border)
    );
  border-radius: 13px;
  background:
    color-mix(
      in srgb,
      var(--surface-inset) 85%,
      transparent
    );
}

.community-hero-stats strong {
  display: block;
  font-size: 1.3rem;
}

.community-hero-stats span {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: .53rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.community-hero__stage {
  min-height: 330px;
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.community-hero-orbit {
  width: 285px;
  height: 285px;
  position: absolute;
  border: 1px solid
    color-mix(
      in srgb,
      var(--region-accent) 30%,
      transparent
    );
  border-radius: 50%;
  box-shadow:
    0 0 75px
      color-mix(
        in srgb,
        var(--region-accent) 13%,
        transparent
      );
}

.community-hero-orbit i {
  position: absolute;
  inset: 42px;
  border: 1px solid
    color-mix(
      in srgb,
      var(--region-secondary) 18%,
      transparent
    );
  border-radius: 50%;
}

.community-hero-orbit i + i {
  inset: 88px;
}

.community-hero-pokemon {
  width: min(350px, 80%);
  max-height: 350px;
  position: relative;
  z-index: 3;
  object-fit: contain;
  filter:
    drop-shadow(
      0 30px 28px rgba(0,0,0,.5)
    );
}

.community-region-word {
  position: absolute;
  right: -12px;
  bottom: -16px;
  color:
    color-mix(
      in srgb,
      var(--region-accent) 13%,
      transparent
    );
  font-size: clamp(4rem, 8vw, 8rem);
  font-weight: 950;
  letter-spacing: -.08em;
}


/* EVENT */

.community-goal {
  min-height: 245px;
  position: relative;
  overflow: hidden;
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr 260px;
  align-items: center;
  border: 1px solid
    color-mix(
      in srgb,
      var(--region-accent) 34%,
      var(--border)
    );
  border-radius: 22px;
  background:
    radial-gradient(
      circle at 90% 45%,
      color-mix(
        in srgb,
        var(--region-accent) 17%,
        transparent
      ),
      transparent 40%
    ),
    var(--surface-elevated);
}

.community-goal__copy {
  position: relative;
  z-index: 3;
}

.community-goal h2 {
  margin: 6px 0;
  font-size: clamp(2rem, 3.5vw, 3.2rem);
}

.community-goal p {
  color: var(--text-secondary);
}

.community-goal-meter {
  max-width: 760px;
  height: 7px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.community-goal-meter i {
  width: 0;
  height: 100%;
  display: block;
  background: var(--region-accent);
  box-shadow:
    0 0 16px
    color-mix(
      in srgb,
      var(--region-accent) 50%,
      transparent
    );
}

.community-goal-numbers {
  max-width: 760px;
  margin-top: 9px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  color: var(--text-muted);
  font-size: .62rem;
}

.community-goal-numbers a {
  color: var(--region-accent);
  font-weight: 950;
  text-decoration: none;
}

.community-goal__art {
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.community-goal-pokemon {
  width: 190px;
  max-height: 200px;
  object-fit: contain;
  filter:
    drop-shadow(
      0 20px 20px rgba(0,0,0,.48)
    );
}


/* COMMON PANEL */

.trainer-radar,
.boomtown-chat,
.community-pulse,
.community-spotlight {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface-elevated);
}

.trainer-radar,
.community-spotlight {
  padding: 26px;
}

.community-section-header {
  min-height: 120px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.community-section-header h2 {
  margin: 6px 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.community-section-header p {
  margin: 0;
  color: var(--text-secondary);
}

.community-section-pokemon {
  width: 145px;
  max-height: 145px;
  object-fit: contain;
  filter:
    drop-shadow(
      0 17px 17px rgba(0,0,0,.42)
    );
}


/* RADAR */

.community-search {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.community-search input,
.community-write input {
  min-width: 0;
  min-height: 45px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-inset);
  color: var(--text-primary);
  font: inherit;
}

.community-search input:focus,
.community-write input:focus {
  outline: 2px solid var(--region-accent);
  outline-offset: 2px;
}

.community-search button,
.community-write button {
  min-height: 45px;
  padding: 0 18px;
  border: 1px solid var(--region-accent);
  border-radius: 11px;
  background:
    color-mix(
      in srgb,
      var(--region-accent) 16%,
      var(--surface-inset)
    );
  color: var(--text-primary);
  font-weight: 950;
  cursor: pointer;
}

.community-search-results {
  margin-top: 9px;
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.community-subheading {
  margin: 24px 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: .6rem;
  font-weight: 950;
  letter-spacing: .08em;
}

.community-subheading > span {
  color: var(--region-accent);
}

.community-subheading i {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 10px var(--positive);
}

.community-subheading--new {
  margin-top: 28px;
}

.community-trainer-rail {
  display: grid;
  grid-template-columns:
    repeat(
      auto-fit,
      minmax(170px, 1fr)
    );
  gap: 7px;
}

.community-trainer {
  min-width: 0;
  padding: 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-inset);
  color: var(--text-primary);
  text-decoration: none;
  transition:
    transform var(--motion-fast),
    border-color var(--motion-fast);
}

.community-trainer:hover {
  transform: translateY(-2px);
  border-color: var(--region-accent);
}

.community-avatar {
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  display: grid;
  place-items: center;
  border: 2px solid
    color-mix(
      in srgb,
      var(--region-accent) 55%,
      var(--border)
    );
  border-radius: 50%;
  background: var(--surface-elevated);
  color: var(--region-accent);
  object-fit: cover;
  font-size: .7rem;
  font-weight: 950;
}

.community-trainer > div {
  min-width: 0;
}

.community-trainer strong,
.community-trainer span {
  display: block;
}

.community-trainer strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .77rem;
}

.community-trainer span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: .6rem;
}

.community-active-dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--positive);
}


/* CHAT + PULSE */

.community-live-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 1.45fr)
    minmax(330px, .55fr);
  gap: 12px;
}

.boomtown-chat {
  min-height: 650px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.boomtown-chat > header,
.community-pulse > header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 15px;
  border-bottom: 1px solid var(--border);
}

.boomtown-chat h2,
.community-pulse h2 {
  margin: 5px 0 0;
  font-size: 2rem;
}

.community-live-status {
  color: var(--positive);
  font-size: .6rem;
  font-weight: 950;
}

.community-live-status i {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 10px var(--positive);
}

.community-messages {
  height: 430px;
  padding: 16px;
  overflow: auto;
  scroll-behavior: smooth;
}

.community-message {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 39px 1fr;
  gap: 9px;
  animation: community-message-in .2s ease;
}

@keyframes community-message-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

.community-message .community-avatar {
  width: 39px;
  height: 39px;
  flex-basis: 39px;
}

.community-message__bubble {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 5px 14px 14px 14px;
  background: var(--surface-inset);
}

.community-message.is-me
.community-message__bubble {
  border-color:
    color-mix(
      in srgb,
      var(--region-accent) 35%,
      var(--border)
    );
  background:
    color-mix(
      in srgb,
      var(--region-accent) 7%,
      var(--surface-inset)
    );
}

.community-message.is-vip
.community-message__bubble {
  border-color: #f6ca52;
}

.community-message__meta {
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  gap: 9px;
}

.community-message__meta a {
  color: var(--region-accent);
  font-size: .69rem;
  font-weight: 950;
  text-decoration: none;
}

.community-message__meta time {
  color: var(--text-muted);
  font-size: .57rem;
}

.community-message__text {
  overflow-wrap: anywhere;
  color: var(--text-secondary);
  font-size: .76rem;
}

.community-vip {
  margin-left: 5px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #f6ca52;
  color: #161208;
  font-size: .47rem;
}

.community-compose {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-inset);
}

.community-login-state {
  padding: 20px;
  color: var(--text-secondary);
  text-align: center;
}

.community-login-state a {
  margin-left: 8px;
  color: var(--region-accent);
  font-weight: 950;
  text-decoration: none;
}

.community-reactions {
  margin-bottom: 8px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.community-reactions button {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-elevated);
  color: var(--text-primary);
  cursor: pointer;
}

.community-write {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
}

.community-chat-note {
  margin-top: 7px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: .56rem;
}


/* PULSE */

.community-pulse {
  overflow: hidden;
}

.community-activity {
  max-height: 575px;
  padding: 8px 16px 16px;
  overflow: auto;
}

.community-event {
  padding: 12px 0;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.community-event > i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background:
    color-mix(
      in srgb,
      var(--region-accent) 9%,
      var(--surface-inset)
    );
  font-style: normal;
  font-size: 1.2rem;
}

.community-event a {
  color: var(--region-accent);
  font-size: .7rem;
  font-weight: 950;
  text-decoration: none;
}

.community-event p {
  margin: 3px 0;
  color: var(--text-secondary);
  font-size: .69rem;
}

.community-event time {
  color: var(--text-muted);
  font-size: .56rem;
}


/* SPOTLIGHT */

.community-spotlight {
  background:
    radial-gradient(
      circle at 90% 5%,
      color-mix(
        in srgb,
        var(--region-accent) 9%,
        transparent
      ),
      transparent 35%
    ),
    var(--surface-elevated);
}


/* EMPTY / LOADING */

.community-empty {
  padding: 18px;
  color: var(--text-muted);
  text-align: center;
  font-size: .7rem;
}

.community-loading,
.community-error {
  min-height: 55vh;
  display: grid;
  place-content: center;
  text-align: center;
}

.community-loading {
  grid-auto-flow: column;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
}

.community-loading span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--region-accent);
  box-shadow:
    0 0 14px
    var(--region-accent);
}

.community-error h1 {
  margin: 7px 0;
}

.community-error p {
  color: var(--text-secondary);
}


/* RESPONSIVE */

@media (max-width: 1050px) {
  .community-hero {
    grid-template-columns: 1fr;
  }

  .community-live-grid {
    grid-template-columns: 1fr;
  }

  .community-activity {
    max-height: 400px;
  }
}

@media (max-width: 760px) {
  .community-hero {
    padding: 38px 18px 24px;
    border-radius: 18px;
  }

  .community-hero h1 {
    font-size: 3.5rem;
  }

  .community-region-line {
    flex-wrap: wrap;
  }

  .community-hero-stats {
    grid-template-columns: 1fr 1fr;
  }

  .community-goal {
    grid-template-columns: 1fr;
  }

  .community-goal__art {
    display: none;
  }

  .community-search-results {
    grid-template-columns: 1fr;
  }

  .community-section-header {
    align-items: flex-start;
  }

  .community-section-pokemon {
    width: 100px;
  }
}

@media (max-width: 480px) {
  .community-hero-stats {
    grid-template-columns: 1fr;
  }

  .community-search {
    grid-template-columns: 1fr;
  }

  .community-write {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-community * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ================================================================
   PBO COMMUNITY GOALS WEB V1
   Portal version of the in-game PBO CommunityGoalData presentation.
   ================================================================ */
.community-goal.pbo-community-web{
  min-height:260px;padding:0;display:block;overflow:hidden;
  border:1px solid color-mix(in srgb,#6ee8ed 42%,var(--border));border-radius:12px;
  background:radial-gradient(circle at 82% 40%,rgba(44,218,230,.13),transparent 33%),linear-gradient(180deg,rgba(18,48,53,.96),rgba(7,20,24,.98));
  box-shadow:0 18px 45px rgba(0,0,0,.3),inset 0 1px rgba(255,255,255,.08)
}
.pbo-community-web__head{
  min-height:62px;padding:12px 20px;display:flex;align-items:center;gap:16px;position:relative;
  border-bottom:1px solid rgba(91,162,165,.5);background:linear-gradient(180deg,rgba(39,82,86,.96),rgba(20,52,56,.96))
}
.pbo-community-web__head::after{content:'';position:absolute;inset:0;background:repeating-linear-gradient(135deg,rgba(255,255,255,.025) 0 4px,transparent 4px 9px);pointer-events:none}
.pbo-community-web__head>div{min-width:0;position:relative;z-index:1}.pbo-community-web__head .portal-kicker{color:#43e0e8}.pbo-community-web__head h2{margin:3px 0 0;font-size:clamp(1.2rem,2.3vw,1.8rem);color:#ffd827;text-shadow:0 2px #000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pbo-community-web__status{margin-left:auto;position:relative;z-index:1;padding:6px 11px;border:1px solid #687477;border-radius:999px;background:#202b2e;color:#cdd5d5;font-size:.62rem;font-weight:950;letter-spacing:.08em}
.pbo-community-web__status.is-active{border-color:#2d8e59;background:#103a26;color:#a8f6c5}.pbo-community-web__status.is-completed{border-color:#92751d;background:#48390d;color:#ffe885}.pbo-community-web__status.is-ended{border-color:#5f686a;background:#252d2f;color:#c8cecf}
.pbo-community-web__body{display:grid;grid-template-columns:1fr 180px;gap:20px;align-items:center;padding:24px 28px}
.pbo-community-web .community-goal__copy{z-index:2}.pbo-community-web .community-goal__copy p{margin:0;color:#bdcecc;font-size:.82rem;line-height:1.5}
.pbo-community-web__counter{display:flex;align-items:baseline;gap:9px;margin-top:14px;color:#ffe273;text-shadow:0 2px #000}.pbo-community-web__counter strong{font-size:clamp(2.1rem,4vw,3.4rem);line-height:1;font-weight:950}.pbo-community-web__counter span{color:#aebebd;font-weight:900}.pbo-community-web__counter b{color:#d5dfdc}
.pbo-community-web .community-goal-meter{position:relative;max-width:none;height:20px;margin-top:10px;border:2px solid #081114;border-radius:12px;background:#071113;box-shadow:inset 0 0 9px #000;overflow:hidden}.pbo-community-web .community-goal-meter i{width:0;height:100%;display:block;background:linear-gradient(90deg,#d47a13,#ffd52e 55%,#3fd8e4);box-shadow:0 0 15px rgba(255,224,64,.38)}.pbo-community-web .community-goal-meter em{position:absolute;inset:0;display:grid;place-items:center;color:#fff;font-size:.58rem;font-weight:950;font-style:normal;text-shadow:0 1px 2px #000}
.pbo-community-web .community-goal-numbers{max-width:none;margin-top:9px;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:14px;color:#83cfd3;font-size:.61rem;font-weight:900}.pbo-community-web .community-goal-numbers span:nth-child(2){text-align:center;color:#a8b8b6}.pbo-community-web .community-goal-numbers a{color:#ffe06d}
.pbo-community-web__sigil{min-height:0!important;width:148px;height:148px;justify-self:center;display:flex!important;flex-direction:column;align-items:center!important;justify-content:center!important;border:3px solid #255e67;border-radius:50%;background:radial-gradient(circle,#15424b,#092128 60%,#041014 73%);box-shadow:0 0 0 5px #07171b,0 0 25px rgba(64,222,233,.24),inset 0 0 25px #000;text-shadow:0 2px #000}.pbo-community-web__sigil span{font-size:3.3rem;line-height:.9;color:#54e2ea}.pbo-community-web__sigil b{margin-top:9px;color:#ffd926;font-size:.82rem}.pbo-community-web__sigil small{margin-top:2px;color:#8ec7ca;font-size:.52rem;letter-spacing:.15em;font-weight:950}
@media(max-width:720px){.pbo-community-web__body{grid-template-columns:1fr 98px;padding:18px 16px}.pbo-community-web__sigil{width:88px;height:88px}.pbo-community-web__sigil span{font-size:2.1rem}.pbo-community-web__sigil b{font-size:.62rem;margin-top:4px}.pbo-community-web__sigil small{font-size:.42rem}.pbo-community-web .community-goal-numbers{grid-template-columns:1fr auto}.pbo-community-web .community-goal-numbers span:nth-child(2){display:none}}
