/* css/community.css — Outpost grid and public profiles */

/* Section: shared */

.hidden { display: none !important; }

.community-page {
  width: 100%;
  max-width: 96rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3.5rem;
}

.community-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.community-hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.community-hero p {
  margin: 0;
  color: #94a3b8;
  line-height: 1.5;
}

@media (min-width: 900px) {
  .community-hero p {
    white-space: nowrap;
  }
}

.community-search {
  display: flex;
  gap: 0.5rem;
  width: min(22rem, 100%);
}

.community-search input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(10, 15, 30, 0.7);
  color: #f8fafc;
}

.community-search button,
.profile-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.outpost-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1.15rem;
}

.outpost-filters button {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.7);
  color: #cbd5e1;
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}

.outpost-filters button:hover {
  border-color: #818cf8;
  color: #f8fafc;
}

.outpost-filters button.is-on {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.22);
  color: #e0e7ff;
}

.outpost-filters select {
  min-width: 11rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(10, 15, 30, 0.8);
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.78rem;
}

.outpost-actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.outpost-handoff {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.55rem;
  border: 0;
  border-radius: 6px;
  overflow: visible;
  background-color: transparent;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.12) 16%, transparent 40%, transparent 62%, rgba(255, 255, 255, 0.1) 84%, rgba(255, 255, 255, 0.28) 100%),
    linear-gradient(105deg, #6366f1 0%, #a78bfa 50%, #fb7185 100%);
  background-repeat: no-repeat;
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.28);
}

.outpost-handoff:hover {
  color: #fff;
  filter: brightness(1.08);
}

.outpost-tip {
  position: fixed;
  z-index: 140;
  transform: translate(-50%, -100%);
  padding: 0.28rem 0.5rem;
  border-radius: 0.3rem;
  background: #0b1220;
  color: #e2e8f0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.outpost-tip[hidden] {
  display: none;
}

.outpost-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.55rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 0.85rem;
  background: rgba(127, 29, 29, 0.25);
  color: #fecaca;
  font-weight: 700;
  cursor: pointer;
}

.outpost-remove[hidden] {
  display: none;
}

.outpost-report {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.55rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0.85rem;
  background: transparent;
  color: #94a3b8;
  font-weight: 700;
  cursor: pointer;
}

.outpost-report:hover:not(:disabled) {
  color: #e2e8f0;
  border-color: rgba(248, 113, 113, 0.4);
}

.outpost-report:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.outpost-report-panel {
  margin-top: 0.45rem;
  display: grid;
  gap: 0.4rem;
}

.outpost-report-panel[hidden] {
  display: none;
}

.outpost-report-panel p {
  margin: 0;
  color: #94a3b8;
  font-size: 0.78rem;
}

.outpost-report-panel button {
  padding: 0.55rem 0.75rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  text-align: left;
}

.outpost-report-panel button:hover {
  border-color: rgba(248, 113, 113, 0.45);
}

.outpost-remove:hover:not(:disabled) {
  background: rgba(185, 28, 28, 0.45);
}

.outpost-remove:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.community-status {
  color: #94a3b8;
  margin: 0 0 1rem;
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.75rem;
}

#community-grid.community-grid {
  display: block;
  columns: 2;
  column-gap: 4px;
}

#community-grid .community-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 4px;
  break-inside: avoid;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#community-grid .community-card__frame {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: #0b1220;
}

#community-grid .community-card img,
#community-grid .community-card video {
  height: auto;
}

@media (min-width: 700px) {
  #community-grid.community-grid { columns: 3; }
}

@media (min-width: 980px) {
  #community-grid.community-grid { columns: 4; }
}

@media (min-width: 1240px) {
  #community-grid.community-grid { columns: 5; }
}

@media (min-width: 1500px) {
  #community-grid.community-grid { columns: 6; }
}

.community-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: #0b1220;
  cursor: pointer;
  padding: 0;
  text-align: left;
  color: inherit;
}

.community-card img,
.community-card video {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transform: scale(1);
  transition: transform 0.45s ease;
}

.community-card__play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 1.85rem;
  height: 1.85rem;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.62);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.community-card__play::before {
  content: '';
  position: absolute;
  left: 0.72rem;
  top: 0.52rem;
  border-style: solid;
  border-width: 0.4rem 0 0.4rem 0.58rem;
  border-color: transparent transparent transparent #fff;
}

#community-grid .community-card:hover img,
#community-grid .community-card:hover video,
#community-grid .community-card:focus-visible img,
#community-grid .community-card:focus-visible video {
  transform: scale(1.08);
}

.community-card__meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.6rem 0.55rem 0.5rem;
  background: linear-gradient(transparent, rgba(2, 6, 23, 0.92));
  font-size: 0.72rem;
  font-weight: 700;
}

.community-card__meta a {
  color: #e2e8f0;
  text-decoration: none;
}

.community-card__meta a:hover {
  color: #c4b5fd;
}

.community-card__pin {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.78);
  color: #e2e8f0;
  cursor: pointer;
}

.community-card__pin:hover {
  background: rgba(30, 41, 59, 0.95);
}

.community-card__pin svg {
  width: 0.85rem;
  height: 0.85rem;
}

.community-card.is-pinned {
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.7);
}

.community-card.is-pinned .community-card__pin,
.community-card__pin.is-on {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.32);
}

.profile-pin-count {
  margin-left: 0.25rem;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

.community-lightbox .gen-inspect__share {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.15rem 0 0.7rem;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.community-lightbox .gen-inspect__share.hidden {
  display: none;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.profile-action {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.7);
  color: #cbd5e1;
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}

.profile-action:hover:not(:disabled) {
  border-color: #818cf8;
  color: #f8fafc;
}

.profile-action.is-pinned,
.profile-action.is-on {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.22);
  color: #e0e7ff;
}

.profile-action--danger {
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.profile-action--danger:hover:not(:disabled) {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(127, 29, 29, 0.28);
  color: #fecaca;
}

.profile-action[hidden],
.profile-action.hidden {
  display: none;
}

.profile-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.community-lightbox .outpost-report-panel button {
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.community-more {
  display: none;
  margin: 1.25rem auto 0;
  padding: 0.7rem 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.9rem;
  background: transparent;
  color: #cbd5e1;
  font-weight: 700;
  cursor: pointer;
}

.community-more.is-on {
  display: inline-flex;
}

.profile-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
}

.profile-avatar,
.profile-avatar-fallback {
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(165, 180, 252, 0.35);
  flex-shrink: 0;
}

.profile-avatar-fallback {
  display: grid;
  place-items: center;
  background: #1e1b4b;
  color: #c4b5fd;
  font-weight: 800;
  font-size: 1.6rem;
}

.profile-head h1 {
  margin: 0 0 0.2rem;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.profile-realm {
  margin: 0 0 0.55rem;
  color: #a5b4fc;
  font-weight: 700;
}

.profile-bio {
  margin: 0;
  color: #cbd5e1;
  max-width: 38rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.profile-empty,
.community-empty {
  color: #64748b;
  padding: 2.5rem 0;
}

.community-lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  background: rgba(2, 6, 23, 0.94);
}

.community-lightbox.open {
  display: flex;
  align-items: stretch;
}

.community-lightbox__layout {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
}

.community-lightbox .gen-inspect {
  width: 19.25rem;
  max-width: 100%;
  min-width: 0;
  flex: 0 0 19.25rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  border-left: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(8, 12, 20, 0.96);
  padding: 0.9rem 1.35rem 1rem 1rem;
}

.community-lightbox .gen-inspect__title {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background-image: linear-gradient(to right, #a5b4fc, #d8b4fe);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.community-lightbox .gen-inspect__body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.community-lightbox .gen-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.community-lightbox .gen-inspect__prompt-wrap {
  position: relative;
  background: rgba(10, 15, 30, 0.72);
  border: 1px solid rgba(165, 180, 252, 0.16);
  border-radius: 0.9rem;
  padding: 0.7rem 0.75rem 2.15rem;
  margin-bottom: 0.35rem;
}

.community-lightbox .gen-inspect__prompt {
  margin: 0.35rem 0 0;
  max-height: 14rem;
  overflow: auto;
  color: #e2e8f0;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.community-lightbox .gen-inspect__copy {
  position: absolute;
  right: 0.45rem;
  bottom: 0.4rem;
  border: 0;
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.community-lightbox .gen-inspect__copy:hover {
  background: rgba(99, 102, 241, 0.32);
  color: #eef2ff;
}

.community-lightbox .gen-inspect__copy[hidden] {
  display: none;
}

.community-lightbox .gen-inspect__rows {
  margin: 0;
  overflow: visible;
  min-height: 0;
  padding-right: 1.15rem;
}

.community-lightbox .gen-inspect__row {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  align-items: baseline;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.58rem 0.05rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.community-lightbox .gen-inspect__row dt {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  -webkit-text-fill-color: #64748b;
}

.community-lightbox .gen-inspect__row dd {
  margin: 0;
  min-width: 0;
  text-align: right;
  color: #f1f5f9;
  -webkit-text-fill-color: #f1f5f9;
  font-size: 0.8rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
  padding-right: 0.15rem;
}

.community-lightbox .gen-inspect__row a {
  color: #c4b5fd;
  -webkit-text-fill-color: #c4b5fd;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.community-lightbox .gen-inspect__row a:hover {
  color: #e9d5ff;
}

.community-lightbox__media {
  flex: 1;
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 2.5rem 1.5rem 1.5rem;
}

.community-lightbox__media img,
.community-lightbox__media video {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 3.5rem);
  width: auto;
  height: auto;
  object-fit: contain;
}

.media-view {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  max-height: 100%;
}

.media-tools {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 2;
  display: flex;
  gap: 0.35rem;
}

.media-tools__btn {
  display: grid;
  place-items: center;
  width: 2.05rem;
  height: 2.05rem;
  padding: 0;
  border: 0;
  border-radius: 0.45rem;
  background: rgba(8, 12, 20, 0.72);
  color: #e2e8f0;
  cursor: pointer;
}

.media-tools__btn:hover {
  background: rgba(30, 41, 59, 0.92);
  color: #fff;
}

.media-tools__btn svg {
  width: 1.05rem;
  height: 1.05rem;
}

.community-lightbox__close {
  position: absolute;
  top: 0.65rem;
  right: calc(19.25rem + 0.65rem);
  z-index: 2;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 860px) {
  .community-lightbox__layout {
    flex-direction: column;
  }

  .community-lightbox .gen-inspect {
    width: 100%;
    flex: 1 1 auto;
    max-height: 42vh;
    border-left: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
  }

  .community-lightbox__close {
    right: 1rem;
  }

  .community-lightbox__media {
    padding: 3rem 0.75rem 0.75rem;
  }

  .community-lightbox__media img,
  .community-lightbox__media video {
    max-height: 48dvh;
  }

  .community-lightbox .gen-inspect__prompt {
    max-height: 8rem;
  }
}
