.community {
  scroll-margin-top: 100px;
}
.community-lead {
  color: var(--muted);
}
.community-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0;
}
.community label {
  display: block;
  font-size: 13px;
  color: var(--muted);
}
.community select,
.community input,
.community textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}
.community input,
.community textarea {
  display: block;
  width: 100%;
  margin: 6px 0 16px;
}
.community textarea {
  resize: vertical;
  min-height: 130px;
}
.community-card,
.community-form {
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  margin: 18px 0;
  box-shadow: 3px 3px 0 var(--green-light);
}
.community-card h3 {
  margin: 6px 0 12px;
  font-size: 18px;
}
.community-card-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.community-meta,
.community-notice {
  color: var(--muted);
  font-size: 12px;
}
.community-badge {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--green-light);
  font-size: 11px;
  white-space: nowrap;
}
.community-card-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.community-card details > summary {
  cursor: pointer;
  color: var(--green);
  padding: 8px 0;
}
.community-replies {
  padding-left: 16px;
  border-left: 2px solid var(--line);
}
.community-replies .community-card {
  box-shadow: none;
  padding: 16px;
}
.community [hidden] {
  display: none !important;
}
.community button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.community-form {
  border-top: 3px solid var(--green);
}
.community-form:focus-within {
  box-shadow: 4px 4px 0 var(--green-light);
}
.community [data-community-form-status] {
  white-space: pre-wrap;
}
.community [data-community-entries] {
  min-height: 20px;
}
.community-card {
  animation: community-arrive 0.22s ease-out;
}
@keyframes community-arrive {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .community-card {
    animation: none;
  }
}
@media (max-width: 540px) {
  .community-card,
  .community-form {
    padding: 16px;
  }
  .community-replies {
    padding-left: 8px;
  }
}
.community-game-link {
  display: inline-block;
  margin: 10px 0;
  color: var(--green);
  font-size: 13px;
}
.cookie-panel {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 3px 3px 0 var(--green-light);
}
.cookie-panel .cookie-ack {
  display: flex;
  align-items: start;
  gap: 10px;
}
.cookie-panel .cookie-ack input {
  width: auto;
  margin-top: 3px;
  flex: 0 0 auto;
}
.cookie-panel [data-cookie-backup] {
  padding: 16px;
  border: 2px solid var(--green);
  border-radius: 8px;
}
.cookie-panel [data-cookie-backup-code] {
  font-family: ui-monospace, monospace;
}
.cookie-panel p {
  overflow-wrap: anywhere;
}
.cookie-session {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 16px;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.cookie-session p {
  margin: 0;
  overflow-wrap: anywhere;
}
.cookie-session [data-cookie-summary] {
  flex: 1 1 200px;
}
.cookie-session [data-cookie-status]:empty {
  display: none;
}
.cookie-session [data-cookie-status] {
  flex-basis: 100%;
}
.cookie-center .cookie-panel {
  margin-bottom: 48px;
}
.cookie-entry .button {
  margin-top: 8px;
}
.cookie-center .page-intro h1 .icon {
  width: 36px;
  height: 36px;
  margin-right: 12px;
}
.cookie-center [data-cookie-current-avatar] {
  width: 64px;
  height: 64px;
}

/* Original re-ocd-inspired avatars: square tiles, inset borders, restrained palettes. */
.community-avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  border-radius: 4px;
}
.cookie-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.cookie-avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
}
.cookie-avatar-option img {
  image-rendering: pixelated;
}
.cookie-avatar-option:hover {
  transform: translateY(-3px);
}
.cookie-avatar-option[aria-pressed="true"] {
  border-color: var(--green);
  box-shadow: 3px 3px 0 var(--green);
  background: var(--green-light);
}
.cookie-avatar-option:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}
[data-cookie-avatars] > summary {
  cursor: pointer;
  padding: 12px 0;
  color: var(--green);
}
.community-id-op {
  color: #674119;
  background: #f2dfb2;
  border-color: #ad8245;
}
.community-id-reply {
  color: #245b64;
  background: #d3e9e7;
  border-color: #6b9c9b;
}
.community-owner-name {
  color: #8d587d;
  font-weight: 800;
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .community-owner-name {
    background: linear-gradient(
      100deg,
      #916128,
      #a75565,
      #715aa2,
      #357c85,
      #577f38,
      #916128
    );
    background-size: 220% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: community-owner-hue 9s linear infinite;
  }
}
@keyframes community-owner-hue {
  to {
    background-position: 220% 0;
  }
}
[data-theme="dark"] .community-owner-name {
  background-image: linear-gradient(
    100deg,
    #e3bf70,
    #e9a7bc,
    #bba5e1,
    #8ad1d4,
    #b9d789,
    #e3bf70
  );
}
@media (prefers-reduced-motion: reduce) {
  .community-owner-name {
    animation: none;
  }
  .cookie-avatar-option {
    transition: none;
  }
  .cookie-avatar-option:hover {
    transform: none;
  }
}
@media (forced-colors: active) {
  .community-owner-name {
    color: CanvasText;
    background: none;
  }
}

.community-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 14px 0;
}
.community-reaction {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 56px;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  isolation: isolate;
}
.community-reaction[aria-pressed="true"] {
  background: var(--green-light);
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}
.community-reaction:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
.reaction-emoji {
  font-size: 20px;
  line-height: 1;
}
.reaction-count {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.community-reaction-status {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  min-height: 0;
}
.community-reaction-status:empty {
  display: none;
}
.reaction-pop > .reaction-emoji {
  animation: reaction-pop 0.5s cubic-bezier(0.2, 0.8, 0.25, 1);
}
.reaction-particle {
  position: absolute;
  left: calc(50% - 10px);
  top: 5px;
  pointer-events: none;
  font-size: 18px;
  z-index: 2;
  animation: reaction-scatter 0.7s ease-out forwards;
}
@keyframes reaction-pop {
  0%,
  100% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.45) rotate(-12deg);
  }
  65% {
    transform: scale(0.92) rotate(5deg);
  }
}
@keyframes reaction-scatter {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.5);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) rotate(var(--spin)) scale(0.7);
  }
}
@media (prefers-reduced-motion: reduce) {
  .reaction-pop > .reaction-emoji,
  .reaction-particle {
    animation: none;
  }
  .reaction-particle {
    display: none;
  }
}

.community-reactions {
  position: relative;
}
.reaction-add {
  min-width: 44px;
  border-style: dashed;
}
.reaction-picker {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(6, 44px);
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 5px 18px #0002;
  max-width: 100%;
  box-sizing: border-box;
}
.reaction-picker .reaction-option {
  min-width: 0;
  min-height: 44px;
  width: 44px;
  padding: 6px;
  border-radius: 10px;
}
.reaction-picker .reaction-option:hover {
  background: var(--green-light);
}
.reaction-audience-link {
  grid-column: 1 / -1;
  font: inherit;
  font-size: 12px;
  padding: 6px;
  border: 0;
  color: var(--green);
  background: transparent;
  cursor: pointer;
}
.reaction-audience {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 6;
  width: 280px;
  max-width: 100%;
  max-height: min(320px, 50vh);
  overflow: auto;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 5px 18px #0002;
  font-size: 13px;
}
.reaction-audience-close {
  float: right;
}
.reaction-audience-close,
.reaction-audience-more {
  font: inherit;
  color: var(--green);
  background: var(--green-light);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
}
.reaction-audience-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  clear: both;
}
.reaction-audience-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  justify-content: space-between;
  padding: 6px 0;
  overflow-wrap: anywhere;
}
.reaction-audience-list small,
.reaction-audience-status {
  color: var(--muted);
}
.reaction-audience-status:empty {
  display: none;
}
.reaction-status-quiet {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 540px) {
  .reaction-picker {
    grid-template-columns: repeat(3, 44px);
  }
}
.cookie-notifications {
  margin-top: 36px;
  scroll-margin-top: 100px;
}
.cookie-notification[data-unread="true"] {
  border-inline-start: 4px solid var(--green);
}
.cookie-notification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
@media (prefers-reduced-motion: no-preference) {
  .cookie-notification {
    animation: cookie-notice-in 0.22s ease-out;
  }
  @keyframes cookie-notice-in {
    from {
      opacity: 0.4;
      transform: translateY(5px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
