/* -------------------------------------------------------------------------
   Komunitas — /community/events|tournaments|creators|top-players/

   Only what theme.css + hero-pages.css do not already give us. The shared
   chrome (page-head, section-tabs, toolbar, chip, pill, card, table-wrap,
   search-input, select) is reused as-is, so the four pages sit inside the
   same visual system as the rest of the site.

   The one idea that repeats on every page is the DATE PLATE: a highlighted
   date range whose colour states whether the thing is live, upcoming or over.
   One component, three states, used by events and tournament seasons alike.
   ------------------------------------------------------------------------- */

/* ---------- date plate ---------- */

.comm-dates {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  min-width: 160px;
}

.comm-dates b {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: .01em;
  color: var(--text);
  font-weight: 500;
}

.comm-dates span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
}

/* Live: the date the reader came for. Amber plate, warm edge, a slow pulse
   so it reads as "now" without moving anything around. */
.comm-dates.is-live {
  border-color: rgba(255, 179, 71, .38);
  border-left-color: var(--amber);
  background: linear-gradient(180deg, rgba(255, 179, 71, .12), rgba(255, 179, 71, .04));
  box-shadow: 0 0 0 1px rgba(255, 179, 71, .06), 0 8px 26px rgba(255, 179, 71, .07);
}
.comm-dates.is-live b { color: var(--amber); }
.comm-dates.is-live span { color: rgba(255, 179, 71, .85); }

/* Upcoming: copper, cooler than amber, no glow. */
.comm-dates.is-upcoming {
  border-left-color: var(--copper);
  background: linear-gradient(180deg, rgba(194, 106, 46, .12), rgba(194, 106, 46, .03));
}
.comm-dates.is-upcoming b { color: #e39b68; }
.comm-dates.is-upcoming span { color: rgba(227, 155, 104, .8); }

/* Finished: present but quiet — it must still be readable. */
.comm-dates.is-ended { opacity: .62; }
.comm-dates.is-ended b { color: var(--text-soft); }

/* ---------- status pills ---------- */

.comm-status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.comm-status--live {
  color: var(--amber);
  border-color: rgba(255, 179, 71, .45);
  background: rgba(255, 179, 71, .1);
}
.comm-status--upcoming {
  color: #e39b68;
  border-color: rgba(194, 106, 46, .5);
  background: rgba(194, 106, 46, .12);
}
.comm-status--ended { color: var(--dim); }
.comm-status--unknown { color: var(--dim); }

/* ---------- events ---------- */

.comm-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.comm-event {
  padding: 18px 20px;
}

.comm-event-top {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.comm-event-main { min-width: 0; flex: 1; }

.comm-event-title {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.25;
  margin: 0 0 6px;
  color: var(--text);
  font-weight: 600;
}

.comm-event-org {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
}

.comm-event-lede {
  margin: 0;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.65;
}

.comm-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.comm-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}

/* Jenis acara (turnamen / meetup / nobar …) — the one tag that is not a
   free-text keyword, so it gets a copper edge. */
.comm-tag--kind {
  color: var(--text-soft);
  border-color: rgba(194, 106, 46, .45);
  background: rgba(194, 106, 46, .1);
}

.comm-event-body {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

.comm-event-body > summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--amber);
  padding: 10px 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.comm-event-body > summary::-webkit-details-marker { display: none; }
.comm-event-body > summary::before {
  content: '+';
  display: inline-block;
  width: 14px;
  color: var(--copper);
}
.comm-event-body[open] > summary::before { content: '−'; }
.comm-event-body > summary:hover { color: var(--text); }

.comm-event-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.comm-event-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--amber);
  border-bottom: 1px dotted rgba(255, 179, 71, .45);
  padding-bottom: 1px;
}
.comm-event-links a:hover { color: var(--text); border-bottom-color: var(--line-strong); }

/* ---------- tournaments ---------- */

.comm-series { padding: 18px 20px; }

.comm-series-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
}

.comm-series-title {
  font-family: var(--font-display);
  font-size: clamp(17px, 2.1vw, 21px);
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.comm-series-org {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 4px 0 0;
}

.comm-series-about {
  margin: 12px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.65;
  max-width: 74ch;
}

.comm-seasons {
  margin: 16px 0 0;
  display: grid;
  gap: 10px;
}

.comm-season {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .022);
}

.comm-season-main { flex: 1; min-width: 220px; }

.comm-season-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}

.comm-season-note {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 66ch;
}

.comm-season-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.comm-season-stats span b { color: var(--text-soft); font-weight: 500; }
.comm-season-stats small { color: var(--dim); }

/* ---------- creators (daftar tipis, bukan grid) ---------- */

/* Satu baris = satu kreator. Namanya satu baris dengan badge-nya, tautan di
   kanan. Tinggi baris sengaja ditekan (~40px): daftar 30 kreator harus bisa
   discan tanpa menggulir halaman. */
.comm-creator-list {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.cc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .03);
  transition: border-color .16s ease, background .16s ease;
}
.cc-row:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.cc-main {
  min-width: 0;
  flex: 1 1 340px;
}

.cc-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.cc-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* Jenis kreator. Tiga warna, bukan satu: "player" paling sering dicari
   (turnamen berbasis kreator butuh pemain), jadi ia yang paling terang. */
.cc-type {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 2px 7px;
}
.cc-type--player {
  color: var(--amber);
  border-color: rgba(255, 179, 71, .45);
  background: rgba(255, 179, 71, .1);
}
.cc-type--organization {
  color: #7aa2ff;
  border-color: rgba(122, 162, 255, .4);
  background: rgba(122, 162, 255, .1);
}
.cc-type--education {
  color: var(--live);
  border-color: rgba(110, 231, 168, .38);
  background: rgba(110, 231, 168, .09);
}
.cc-type--other { color: var(--dim); }

/* Rank hanya dicetak kalau spreadsheet-nya memang berisi rank. */
.cc-rank {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .04em;
  padding: 2px 8px;
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .05);
}

.cc-count {
  font-size: 9.5px;
  padding: 2px 8px;
  letter-spacing: .06em;
  text-transform: none;
}

/* Catatan ikut baris nama (bukan baris kedua) — kalau panjang ia membungkus
   sendiri karena .cc-line sudah flex-wrap, sehingga baris pendek tetap ~40px. */
.cc-note {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted);
  min-width: 0;
  max-width: 100%;
  /* nothing to the right of it may be pushed off the row */
  flex: 0 1 auto;
}

.cc-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.cc-link {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--amber);
  border-bottom: 1px dotted rgba(255, 179, 71, .45);
  padding-bottom: 1px;
  white-space: nowrap;
}
.cc-link:hover {
  color: var(--text);
  border-bottom-color: var(--line-strong);
}

.cc-dir {
  min-width: 34px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  padding: 6px 8px;
}

@media (max-width: 760px) {
  .cc-links { width: 100%; }
}

/* ---------- top players ---------- */

.comm-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--copper);
  border-radius: 10px;
  background: rgba(194, 106, 46, .07);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.65;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.lb-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 500;
  background: #0b0b11;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.lb-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(246, 241, 233, .06);
  vertical-align: middle;
}

.lb-table tbody tr:hover td { background: rgba(255, 179, 71, .045); }

.lb-rank {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  text-align: right;
  width: 64px;
  white-space: nowrap;
}
.lb-table tbody tr:nth-child(-n + 10) .lb-rank { color: var(--amber); }

.lb-name {
  color: var(--text);
  font-weight: 500;
  /* A 40-character nickname must not stretch the table sideways. */
  overflow-wrap: anywhere;
}

.lb-country {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
  white-space: nowrap;
}
.lb-country--none { color: var(--dim); border-style: dashed; }
.lb-country--id {
  color: var(--amber);
  border-color: rgba(255, 179, 71, .4);
  background: rgba(255, 179, 71, .08);
}

.lb-team {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--text-soft);
  white-space: nowrap;
}
.lb-team--none { color: var(--dim); }

.lb-more {
  display: flex;
  justify-content: center;
  padding: 16px 0 4px;
}

/* ---------- shared bits ---------- */

/* `.toolbar-row` is flex, so the UA `[hidden]` rule loses — a row that should
   not exist must be taken out of the layout explicitly. */
.comm-page .toolbar-row {
  flex-wrap: wrap;
}

.comm-page .toolbar-row[hidden] {
  display: none !important;
}

.comm-count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--dim);
}

.comm-empty {
  margin-top: 18px;
}

/* The toolbar rows on these pages hold a label + a long chip list. Below
   720px the label sits above the chips instead of squeezing them. */
@media (max-width: 720px) {
  .comm-event-top { flex-direction: column; gap: 12px; }
  .comm-dates { width: 100%; }
  .lb-table { font-size: 13px; }
  .lb-table thead th, .lb-table tbody td { padding: 8px 8px; }
  .lb-country { font-size: 9.5px; padding: 2px 5px; }
}
