/* ຊຸມຊົນ — ແບ່ງປັນເລື່ອງ, avatar style, ຄະແນນ, ຄອມເມັນ ແລະ ລາຍງານ. */

.community-page { min-height: 100vh; min-height: 100dvh; background: var(--bg); }
.community-main { width: min(1240px, calc(100% - 28px)); margin: 0 auto; padding: 24px 0 48px; }
.community-hero {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 2px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 10%, rgba(244, 181, 68, 0.3), transparent 34%),
    radial-gradient(circle at 10% 100%, rgba(13, 148, 136, 0.22), transparent 38%),
    var(--paper);
  box-shadow: 0 8px 0 rgba(43, 27, 61, 0.13);
}
.community-hero::after {
  content: "🌍";
  position: absolute;
  right: 26px;
  top: 10px;
  font-size: 92px;
  opacity: 0.12;
  transform: rotate(-8deg);
  pointer-events: none;
}
.community-hero h1 { margin: 0; font-family: var(--font-display); font-size: clamp(28px, 3.6vw, 42px); }
.community-hero p { margin: 5px 0 0; max-width: 76ch; color: var(--ink-2); font-size: 13.5px; }
.community-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; position: relative; z-index: 1; }
.community-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border: 1.5px solid rgba(43, 27, 61, 0.14);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.82);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
}
.community-stat strong { color: var(--ink); font-size: 13px; }
.community-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0 14px;
}
.community-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.community-tab {
  padding: 8px 14px;
  border: 2px solid rgba(43, 27, 61, 0.16);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
}
.community-tab.is-active { border-color: var(--line); background: var(--accent-soft); color: var(--accent-ink); box-shadow: 0 3px 0 rgba(43, 27, 61, 0.1); }
.community-tools { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.community-search {
  min-width: 210px;
  min-height: 39px;
  padding: 8px 12px;
  border: 2px solid rgba(43, 27, 61, 0.18);
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
}
.community-sort {
  min-height: 39px;
  padding: 8px 10px;
  border: 2px solid rgba(43, 27, 61, 0.18);
  border-radius: 12px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}
.community-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.community-card {
  display: grid;
  grid-template-rows: 128px auto;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 6px 0 rgba(43, 27, 61, 0.11);
}
.community-cover {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 24% 30%, rgba(255, 255, 255, 0.32), transparent 30%),
    linear-gradient(135deg, var(--cover-a, #f97316), var(--cover-b, #0d9488));
}
.community-cover-emoji { font-size: 54px; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.18)); }
.community-cover img { width: 100%; height: 100%; object-fit: contain; background: rgba(255, 255, 255, 0.35); padding: 10px; }
.community-kind {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(43, 27, 61, 0.78);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.community-featured {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fbbf24;
  color: #422006;
  font-size: 9.5px;
  font-weight: 800;
}
.community-body { padding: 13px 14px 14px; display: grid; gap: 7px; align-content: start; }
.community-title { margin: 0; font-size: 15px; line-height: 1.35; }
.community-by { color: var(--ink-3); font-size: 10.5px; font-weight: 700; }
.community-desc {
  margin: 0;
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.community-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink-3); font-size: 10px; font-weight: 700; }
.community-rating { display: inline-flex; align-items: center; gap: 3px; color: #b45309; }
.community-stars { display: inline-flex; gap: 1px; }
.star-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d6c8b8;
  font-size: 17px;
  line-height: 1;
}
.star-btn.is-on { color: #f59e0b; }
.star-btn:hover { transform: translateY(-1px); }
.community-card-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding-top: 2px; }
.community-card-actions .btn { min-height: 30px; padding: 5px 9px; font-size: 10.5px; box-shadow: none; }
.community-no-cover img { max-height: 108px; }
.community-video-cover { background: #1f1130; }
.community-video-cover img { object-fit: cover; padding: 0; background: #1f1130; }
.community-play {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: rgba(43, 27, 61, 0.62);
  color: #fff;
  font-size: 17px;
  padding-left: 3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}
.community-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.community-empty { padding: 34px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }
.community-more { display: flex; justify-content: center; margin-top: 18px; }
.community-notice {
  margin: 12px 0;
  padding: 10px 13px;
  border: 1.5px solid #86efac;
  border-radius: 13px;
  background: #f0fdf4;
  color: #166534;
  font-size: 12px;
  font-weight: 600;
}
.community-notice a { font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }

/* detail */
.community-dialog { width: min(820px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.community-detail-body { display: grid; gap: 14px; padding: 18px; overflow-y: auto; }
.community-detail-heading { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.community-detail-heading h2 { margin: 0; font-family: var(--font-display); font-size: 22px; }
.community-detail-meta { color: var(--ink-3); font-size: 11px; font-weight: 700; }
.community-detail-desc { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.community-scenes { display: grid; gap: 8px; }
.community-scene { padding: 10px 12px; border: 1.5px solid rgba(43, 27, 61, 0.12); border-radius: 13px; background: var(--paper-2); }
.community-scene strong { display: block; font-size: 12.5px; }
.community-scene span { color: var(--ink-3); font-size: 10.5px; }
.community-lines { display: grid; gap: 4px; margin-top: 6px; }
.community-line { font-size: 12px; line-height: 1.45; }
.community-line b { color: var(--accent-ink); }
.community-comments { display: grid; gap: 8px; }
.community-comment { padding: 9px 11px; border: 1.5px solid rgba(43, 27, 61, 0.1); border-radius: 12px; background: var(--paper); }
.community-comment strong { font-size: 11.5px; }
.community-comment span { color: var(--ink-3); font-size: 10px; margin-left: 5px; }
.community-comment p { margin: 3px 0 0; font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.community-comment-actions { display: flex; gap: 5px; margin-top: 5px; }
.community-comment-actions button { border: 0; background: transparent; color: var(--ink-3); font-size: 10.5px; padding: 2px 4px; }
.community-comment-actions button:hover { color: var(--danger); }
.community-comment-form { display: grid; gap: 7px; }
.community-section-title { margin: 4px 0 0; font-size: 13px; font-weight: 800; }
.community-report-form { display: grid; gap: 9px; }
.community-report-form select, .community-report-form textarea { width: 100%; }
.community-report-form textarea { min-height: 80px; }
.community-detail-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.community-star-picker { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--ink-2); font-weight: 700; }
.community-video-block { display: grid; gap: 6px; }
.community-video-player {
  width: 100%;
  max-height: min(460px, 58vh);
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #120a1c;
  box-shadow: 0 5px 0 rgba(43, 27, 61, 0.12);
}
.community-video-facts { margin: 0; color: var(--ink-3); font-size: 10.5px; font-weight: 700; }

/* video upload */
.community-upload-dialog { width: min(680px, calc(100vw - 24px)); }
.community-upload-form { display: grid; }
.community-upload-body { display: grid; gap: 11px; padding: 0 18px 18px; overflow-y: auto; }
.community-drop {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 22px 16px;
  border: 2px dashed rgba(43, 27, 61, 0.28);
  border-radius: 16px;
  background: var(--paper-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease;
}
.community-drop:hover, .community-drop.is-drag {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.community-drop-icon { font-size: 30px; line-height: 1; }
.community-drop strong { font-size: 13px; }
.community-upload-hint { color: var(--ink-3); font-size: 10.5px; font-weight: 600; }
.community-upload-preview {
  width: 100%;
  max-height: min(340px, 42vh);
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #120a1c;
}
.community-upload-meta { margin: 0; color: var(--ink-3); font-size: 10.5px; font-weight: 700; }
.community-upload-body .progress { margin: 0; }
.community-upload-body .account-error { margin: 0; }

@media (max-width: 640px) {
  .community-main { width: min(100% - 18px, 1240px); padding-top: 14px; }
  .community-hero { padding: 16px; border-radius: 19px; }
  .community-tools { width: 100%; margin-left: 0; }
  .community-search { flex: 1; min-width: 0; }
  .community-grid { grid-template-columns: 1fr; }
  .community-card { grid-template-rows: 110px auto; }
  .community-dialog { width: calc(100vw - 12px); }
  .community-detail-body { padding: 12px; }
}
