.community-profile,
.community-players,
.community-chat {
  display: grid;
  gap: 10px;
  padding: 16px 0;
  border-bottom: 1px solid #e5e8df;
}
.community-profile h2,
.community-players h2,
.community-chat h2 {
  margin: 0;
  color: #294834;
  font-family: Georgia, "Yu Mincho", serif;
  font-size: 20px;
}
.community-profile label {
  color: #687664;
  font-size: 12px;
  font-weight: 650;
}
.community-profile input,
.community-profile select,
#chat-input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #d4dece;
  border-radius: 12px;
  background: #fff;
  color: #294834;
  font: inherit;
}
.community-profile wa-button::part(base),
#chat-send::part(base) {
  min-height: 40px;
  border-radius: 12px;
  background: #315c40;
  color: #fff;
  border-color: #315c40;
}
.community-players h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#online-count {
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 99px;
  background: #e7eddf;
  font:
    700 12px Inter,
    sans-serif;
}
#online-list {
  display: grid;
  gap: 7px;
  max-height: 116px;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}
#online-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 10px;
  background: #f3f5ef;
  color: #415b46;
  font-size: 13px;
}
.player-presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #75a86c;
}
#chat-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 90px;
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding: 0 4px 0 0;
  list-style: none;
}
#chat-messages li {
  overflow-wrap: anywhere;
  color: #536451;
  font-size: 13px;
  line-height: 1.5;
}
#chat-messages strong {
  color: #294834;
}
#chat-form {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 8px;
}
#chat-send::part(base) {
  width: 46px;
  padding: 0;
}
#community-status {
  margin: 0;
  color: #7b8875;
  font-size: 11px;
}

#chat-bubbles {
  position: absolute;
  z-index: 5;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.chat-bubble {
  position: absolute;
  display: grid;
  gap: 3px;
  width: max-content;
  max-width: min(270px, 72vw);
  padding: 9px 13px;
  border: 1px solid #e9dec5;
  border-radius: 15px;
  background: #fffdf3f2;
  color: #344b39;
  box-shadow: 0 5px 18px #18332535;
  font:
    500 13px/1.45 Inter,
    "Segoe UI",
    system-ui,
    sans-serif;
  overflow-wrap: anywhere;
  transform: translate(-50%, calc(-100% - 12px));
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.chat-bubble::after {
  position: absolute;
  bottom: -7px;
  left: calc(50% - 6px);
  width: 12px;
  height: 12px;
  border-right: 1px solid #e9dec5;
  border-bottom: 1px solid #e9dec5;
  background: #fffdf3f2;
  content: "";
  transform: rotate(45deg);
}
.chat-bubble.visible {
  opacity: 1;
}
.chat-bubble strong {
  color: #58714d;
  font-size: 11px;
  font-weight: 750;
}
.touch-controls .touch-action {
  right: max(108px, calc(env(safe-area-inset-right) + 102px));
  bottom: max(34px, env(safe-area-inset-bottom));
}
.touch-controls .touch-jump {
  right: max(38px, env(safe-area-inset-right));
  bottom: max(116px, calc(env(safe-area-inset-bottom) + 112px));
}
