/* Player-event DB: restrained cards, clear evidence labels, 390px safe layout. */
.community-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 1.5rem;
  align-items: center;
  margin: 1rem 0;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  background: linear-gradient(135deg, #ffffff, #edf4f3);
  border: 1px solid #d8e3e2;
  border-radius: 8px;
}

.community-hero h2 {
  margin: 0.35rem 0 0.75rem;
  color: #27333b;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.45;
}

.community-hero p:not(.section-eyebrow),
.community-source-intro {
  max-width: 48rem;
  color: #4e5c64;
  line-height: 1.75;
}

.community-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.25rem;
  align-items: center;
  margin-top: 1.15rem;
}

.community-hero-mark {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: center;
  justify-items: center;
  min-height: 150px;
  padding: 1rem;
  color: #1f6570;
  border: 1px solid #c7dedb;
  border-radius: 8px;
  background: #f8fbfb;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
}

.community-hero-mark b {
  color: #a16f3b;
  font-family: sans-serif;
  font-size: 1.5rem;
}

.community-notice,
.community-controls,
.community-sources {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid #dfe5e7;
  border-radius: 8px;
  background: #ffffff;
}

.community-notice {
  border-left: 4px solid #2b8187;
}

.community-notice strong {
  color: #245e67;
}

.community-notice p {
  margin: 0.4rem 0 0;
  color: #4f5b62;
  line-height: 1.65;
}

.community-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.community-summary > div {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid #dfe5e7;
  border-radius: 8px;
  background: #ffffff;
}

.community-summary span,
.community-filter-grid span,
.community-card-meta,
.community-detail-meta,
.community-source-meta {
  color: #66747b;
  font-size: 0.82rem;
}

.community-summary strong {
  color: #27333b;
  font-size: 1.45rem;
}

.community-date-note {
  margin: 0.35rem 0 0;
  padding: 0.55rem 0.7rem;
  border-left: 3px solid #c88a36;
  background: #fff8ed;
  color: #6d532f;
  font-size: 0.88rem;
}

.community-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
}

.community-search-form input,
.community-filter-grid select {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 1px solid #cbd5d8;
  border-radius: 6px;
  background: #fff;
  color: #263238;
  font: inherit;
}

.community-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 0.75rem;
  align-items: end;
  margin-top: 0.75rem;
}

.community-filter-grid label {
  display: grid;
  gap: 0.3rem;
}

.community-filter-grid .secondary-button {
  min-height: 44px;
  white-space: nowrap;
}

.community-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  margin-top: 0.8rem;
  color: #536168;
}

.community-active-filters strong {
  color: #245e67;
}

.community-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(280px, 0.82fr);
  gap: 1rem;
  align-items: start;
}

.community-list {
  display: grid;
  gap: 0.75rem;
}

.community-year-group,
.community-source-group {
  overflow: hidden;
  border: 1px solid #dfe5e7;
  border-radius: 8px;
  background: #ffffff;
}

.community-year-group.is-archive {
  background: #fbfcfc;
}

.community-year-summary,
.community-source-summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 0.55rem 0.8rem;
  padding: 0.65rem 0.85rem 0.65rem 2.35rem;
  cursor: pointer;
  list-style: none;
  position: relative;
}

.community-year-summary::-webkit-details-marker,
.community-source-summary::-webkit-details-marker {
  display: none;
}

.community-year-summary::before,
.community-source-summary::before {
  position: absolute;
  left: 0.85rem;
  color: #2b8187;
  content: "+";
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}

.community-year-group[open] > .community-year-summary::before,
.community-source-group[open] > .community-source-summary::before {
  content: "−";
}

.community-year-group[open] > .community-year-summary,
.community-source-group[open] > .community-source-summary {
  border-bottom: 1px solid #dfe5e7;
  background: #f6fbfa;
}

.community-year-title,
.community-source-summary strong {
  color: #245e67;
}

.community-year-count,
.community-source-group-count {
  color: #66747b;
  font-size: 0.84rem;
  white-space: nowrap;
}

.community-year-state {
  margin-left: auto;
  color: #66747b;
  font-size: 0.78rem;
  text-align: right;
}

.community-year-cards {
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem;
}

.community-card {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
  border: 1px solid #dfe5e7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 3px 12px rgba(39, 51, 59, 0.04);
}

.community-card.is-selected {
  border-color: #2b8187;
  box-shadow: 0 0 0 2px rgba(43, 129, 135, 0.12);
}

.community-card-top,
.community-detail-meta,
.community-card-footer,
.community-source-head,
.section-heading-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.community-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
}

.community-status,
.community-evidence,
.community-source-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.community-status {
  background: #e4f2ef;
  color: #1e6b70;
}

.community-status.is-history {
  background: #f3eee7;
  color: #835c32;
}

.community-status.is-upcoming {
  background: #fff0d8;
  color: #875b1f;
}

.community-evidence,
.community-source-status {
  background: #f3f5f6;
  color: #5b6870;
}

.community-card-title {
  color: #245e67;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.45;
  text-decoration: none;
}

.community-card-title:hover,
.community-card-title:focus-visible {
  text-decoration: underline;
}

.community-card-series,
.community-card-summary,
.community-card-location,
.community-detail p {
  margin: 0;
  color: #4f5b62;
  line-height: 1.6;
}

.community-card-series {
  font-size: 0.87rem;
  color: #66747b;
}

.community-card-location {
  font-size: 0.9rem;
}

.community-card-tags,
.community-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.community-tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border: 1px solid #c9dedc;
  border-radius: 999px;
  background: #f4fbfa;
  color: #286c72;
  font-size: 0.78rem;
  text-decoration: none;
}

.community-tag:hover,
.community-tag:focus-visible {
  background: #e4f2ef;
}

.community-card-footer {
  justify-content: flex-start;
  margin-top: 0.15rem;
}

.community-detail {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid #d8e3e2;
  border-radius: 8px;
  background: #f8fbfb;
}

.community-detail h2 {
  margin: 0;
  color: #27333b;
  font-size: 1.25rem;
  line-height: 1.45;
}

.community-detail h3 {
  margin: 0;
  color: #356b71;
  font-size: 0.9rem;
}

.community-detail-block {
  display: grid;
  gap: 0.35rem;
  padding-top: 0.7rem;
  border-top: 1px solid #dce7e6;
}

.community-detail-list,
.community-detail-links {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding-left: 1.1rem;
}

.community-detail a,
.community-source-card a {
  color: #246b74;
}

.community-sources {
  margin-top: 1rem;
}

.community-sources h2 {
  margin: 0.25rem 0 0;
  color: #27333b;
  font-size: 1.25rem;
}

.community-source-count {
  color: #66747b;
  font-size: 0.9rem;
}

.community-source-groups {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.community-source-group-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0.75rem;
}

.community-source-card {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem;
  border: 1px solid #e0e6e8;
  border-radius: 8px;
  background: #fbfcfc;
}

.community-source-card strong {
  color: #33434b;
}

.community-source-meta {
  line-height: 1.5;
}

.community-empty {
  padding: 1.2rem;
  border: 1px dashed #cbd5d8;
  border-radius: 8px;
  background: #ffffff;
  color: #536168;
}

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

  .community-hero-mark {
    min-height: 92px;
    justify-self: stretch;
  }

  .community-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .community-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .community-filter-grid .secondary-button {
    width: 100%;
  }

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

  .community-source-group-cards {
    grid-template-columns: 1fr;
  }

  .community-detail {
    position: static;
  }
}

@media (max-width: 480px) {
  .community-hero,
  .community-notice,
  .community-controls,
  .community-sources {
    padding: 0.85rem;
  }

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

  .community-summary > div {
    padding: 0.7rem;
  }

  .community-summary strong {
    font-size: 1.25rem;
  }

  .community-year-summary,
  .community-source-summary {
    align-items: flex-start;
    flex-wrap: wrap;
    padding-right: 0.7rem;
  }

  .community-year-state {
    flex-basis: 100%;
    margin-left: 0;
    text-align: left;
  }
}
