#community {
  --community-edge: clamp(.85rem, 4vw, 3.75rem);
  --community-scene-height: clamp(25rem, calc(100svh - 9rem), 51rem);
  position: relative;
  isolation: isolate;
  width: 100%;
  margin: 0;
  scroll-margin-top: 0;
  background: #183d49;
}

#community .community-heading {
  position: absolute;
  z-index: 3;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: .9rem;
  margin: 0;
  padding: clamp(.9rem, 2.5vw, 2rem) var(--community-edge) clamp(2rem, 4.5vw, 4rem);
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #0a2739d6, #103e5277 58%, transparent);
  pointer-events: none;
}

#community .community-intro {
  display: grid;
  gap: .38rem;
  min-width: 0;
}

#community .community-heading h1 {
  margin: 0;
  color: #fff9e9;
  font-family: 'Songti SC', 'Noto Serif CJK SC', var(--display-font);
  font-size: clamp(2.15rem, 4.2vw, 4.5rem);
  font-weight: 740;
  line-height: 1.04;
  letter-spacing: -.045em;
  text-shadow: 0 .12rem .85rem #062430ad;
}

:lang(en) #community .community-heading h1 {
  font-family: var(--display-font);
  font-weight: 580;
}

#community .community-heading p {
  margin: 0;
  color: #f7f9f2;
  font-size: clamp(.83rem, 1.2vw, 1rem);
  line-height: 1.5;
  text-shadow: 0 .1rem .35rem #062430;
}

#community .island-clock {
  display: grid;
  gap: .16rem;
  min-width: 0;
  padding: .47rem .66rem;
  border: 1px solid #fff5da62;
  border-radius: .64rem;
  background: #102f3ce6;
  color: #fff9e9;
  box-shadow: 0 .2rem .85rem #08263342;
}

#community .island-clock-zone {
  color: #e0eeea;
  font-size: .72rem;
  line-height: 1.24;
}

#community .island-clock-readout {
  display: flex;
  align-items: center;
  gap: .32rem;
  white-space: nowrap;
}

#community .island-clock time {
  font-size: 1.03rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.25;
}

#community #island-clock-period {
  padding: .12rem .36rem;
  border: 0;
  border-radius: 999px;
  background: #dff7ef;
  color: #135749;
  font-size: .68rem;
  font-weight: 660;
}

#community #island-clock-period:empty {
  display: none;
}

body[data-island-period="night"] #community #island-clock-period {
  background: #e5ecff;
  color: #243b6b;
}

#community .community-stage {
  display: block;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#community .community-viewport {
  overflow: auto hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: #a9ddd0 #183d49;
}

#community .community-viewport:focus-visible {
  position: relative;
  z-index: 2;
  outline: 3px solid #ffe9b8;
  outline-offset: -3px;
}

@media (hover: hover) and (pointer: fine) {
  #community[data-pannable="true"] .community-viewport,
  #community .community-stage[data-pannable="true"] .community-viewport {
    cursor: grab;
  }

  #community[data-dragging="true"] .community-viewport,
  #community .community-viewport[data-dragging="true"] {
    cursor: grabbing;
    user-select: none;
  }
}

#community .community-map {
  --map-ratio: 2.3;
  position: relative;
  isolation: isolate;
  width: max(100%, calc(var(--community-scene-height) * var(--map-ratio)));
  aspect-ratio: var(--map-ratio);
  background: #235868;
}

#community .community-map::after {
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(0deg, #0b334073, transparent 24%);
  box-shadow: none;
  content: "";
  pointer-events: none;
}

#community .community-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

body[data-island-period="night"] #community .community-art[data-day-only] {
  filter: brightness(.61) saturate(.87) hue-rotate(14deg);
}

#community .map-pin {
  position: absolute;
  z-index: 1;
  top: var(--y, var(--pin-y));
  left: var(--x, var(--pin-x));
  display: grid;
  justify-items: center;
  gap: .24rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  transform: translate(-50%, -1.375rem);
  border: 0;
  border-radius: .5rem;
  background: transparent;
  text-align: center;
}

#community .map-pin:is(:hover, :focus-visible, [aria-current="location"], [aria-pressed="true"]) {
  z-index: 2;
}

#community .map-pin:focus-visible,
#community .community-controls button:focus-visible {
  outline: 2px solid #ffe9b8;
  outline-offset: 4px;
}

#community .map-pin-icon {
  display: grid;
  justify-items: center;
  align-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 2px solid #fff9e9;
  border-radius: 50%;
  background: #144c55;
  box-shadow: 0 .27rem .8rem #103845ad;
  color: #fff9e9;
  font-size: 1.26rem;
  font-weight: 740;
  line-height: 1;
  transition: transform .16s ease, background .16s ease;
}

#community .map-pin-label {
  display: block;
  padding: .19rem .49rem;
  border: 1px solid #fff5dfa6;
  border-radius: .33rem;
  background: #fff8e9;
  box-shadow: 0 .18rem .52rem #143e5470;
  color: #21444a;
  font-size: clamp(.76rem, 1vw, .88rem);
  font-weight: 700;
  line-height: 1.22;
  white-space: nowrap;
}

#community .map-pin:is(:hover, :focus-visible) .map-pin-icon {
  transform: translateY(-.16rem) scale(1.05);
  background: #0c7165;
}

#community .map-pin:is([aria-current="location"], [aria-pressed="true"]) .map-pin-icon {
  background: #ac503d;
  box-shadow: 0 0 0 .22rem #ffdfaa96, 0 .27rem .8rem #103845ad;
}

#community .community-controls {
  position: relative;
  padding: .62rem var(--community-edge) .68rem;
  border-top: 1px solid #a6d5ca63;
  background: linear-gradient(105deg, #183c47, #1a5056);
}

#community .community-pan-buttons {
  position: absolute;
  z-index: 2;
  inset: auto var(--community-edge) calc(100% + .76rem) auto;
  display: none;
  gap: .43rem;
}

#community[data-pannable="true"] .community-pan-buttons:not([hidden]),
#community .community-stage[data-pannable="true"] .community-pan-buttons:not([hidden]) {
  display: flex;
}

#community .community-pan-buttons button {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid #fff8e0ad;
  border-radius: 50%;
  background: #143e4be8;
  box-shadow: 0 .2rem .7rem #0b334073;
  color: #fff8e5;
  font-size: 1.26rem;
  line-height: 1;
}

#community .community-pan-buttons button:hover:not(:disabled) {
  background: #0c6a62;
}

#community .community-pan-buttons button:disabled {
  opacity: .52;
  cursor: default;
}

#community .community-locations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(.38rem, 1vw, .82rem);
  width: min(100%, 70rem);
  margin-inline: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

#community .community-locations:empty {
  display: none;
}

#community .map-location-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .35rem;
  min-height: 2.6rem;
  padding: .3rem clamp(.64rem, 1.6vw, 1.18rem);
  border: 1px solid #afd8c873;
  border-radius: .56rem;
  background: #224a53;
  color: #fff8e6;
  font-size: .86rem;
  font-weight: 650;
  line-height: 1.22;
  text-align: center;
}

#community .map-location-button:is(:hover, [aria-current="location"], [aria-pressed="true"]) {
  border-color: #f2dbab;
  background: #f6e4bd;
  color: #2e494c;
}

@media (max-width: 56rem) {
  #community {
    --community-scene-height: clamp(23rem, calc(100svh - 11rem), 42rem);
  }
}

@media (max-width: 39rem) {
  #community {
    --community-edge: .75rem;
    --community-scene-height: clamp(20rem, calc(100svh - 13rem), 37rem);
  }

  #community .community-heading {
    gap: .45rem;
    padding: .8rem var(--community-edge) 2.1rem;
  }

  #community .community-intro {
    gap: .24rem;
  }

  #community .community-heading h1 {
    font-size: clamp(1.72rem, 6.1vw, 2.75rem);
  }

  #community .community-heading p {
    font-size: .76rem;
    line-height: 1.35;
  }

  #community .island-clock {
    gap: .1rem;
    padding: .35rem .4rem;
  }

  #community .island-clock-zone,
  #community #island-clock-period {
    font-size: .63rem;
  }

  #community .island-clock time {
    font-size: .86rem;
  }

  #community .community-locations {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: .32rem;
  }

  #community .map-location-button {
    grid-column: span 2;
    min-height: 2.75rem;
    padding: .26rem .22rem;
    font-size: .76rem;
  }

  #community .map-location-button:nth-child(5):nth-last-child(3) {
    grid-column: 2 / span 2;
  }
}
