/* ─── Attachment Viewer ─────────────────────────────────── */
.attachment-viewer {
  width: 100%;
  flex: none;
  position: relative;
  min-height: 0;
}


.attachment-main {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bg-raised);
  overflow: hidden;
}


.attachment-display {
  width: 100%;
  aspect-ratio: 5 / 4;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.attachment-form-display {
  width: 100%;
  aspect-ratio: 5 / 4;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: -0.15rem;
}
.attachment-display img,
.attachment-form-display img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}
.attachment-display video, 
.attachment-form-display video{
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}
.attachment-display audio,
.attachment-form-display audio {
  width: 80%;
  padding: 1rem;
}
.attachment-display pre,
.attachment-display .attachment-markdown {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 3rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  line-height: 1.7;
  text-align: left;
  white-space: pre-wrap;  /* for pre, wraps long lines instead of horizontal scroll */
}


.attachment-prev-btn,
.attachment-next-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.75rem 0.5rem;
  z-index: 1;
  transition: color 0.15s, background 0.15s;
}
.attachment-prev-btn { left: 0; }
.attachment-next-btn { right: 0; }
.attachment-prev-btn:hover,
.attachment-next-btn:hover {
  color: var(--gold);
  background: rgba(0, 0, 0, 0.7);
}



.attachment-actions {
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 8.5rem;
  flex-shrink: 0;
}

div[data-attachment-picker-target="list"] {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.attachment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-muted);
}



/* ─── Lightbox ──────────────────────────────────────────── */
.attachment-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.attachment-lightbox.open {
  display: flex;
}

.attachment-lightbox-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
}

.attachment-lightbox-media {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.attachment-lightbox-media img,
.attachment-lightbox-media video {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}
.attachment-lightbox-media audio {
  width: 60vw;
  padding: 1rem;
}
.attachment-lightbox-media pre,
.attachment-lightbox-media .attachment-markdown {
  width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 3rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  line-height: 1.7;
  text-align: left;
  white-space: pre-wrap;
  background: var(--bg-card);
}



/* ─── Quest_show Participants ──────────────────────────────────────── */
.participants-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.5rem;
  height: 8.3rem;
  overflow-y: auto;
}

.participants-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  position: sticky;
  top: 0;
  z-index: 1;
}

.participants-join {
  font-family: var(--font-head);
  font-size: 1.2rem;
  color: var(--gold-dim);
  transition: color 0.15s;
}
.participants-join:hover { color: var(--gold); }

.participant-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.participant-row:hover { 
 animation: stats-box-bleed 1.2s ease-out forwards;
}


.participant-name {
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.participant-title {
  font-family: var(--font-head);
  font-size: 0.9rem;
  color: var(--red);
  animation: kind-flame 3s ease-in-out infinite;
}

.participant-role {
  font-family: var(--font-head);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}





/* ─── Post Comments ──────────────────────────────────────────── */
.comments-section {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  max-height: 15.3rem;
  overflow-y: auto;
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  position: sticky;
  top: 0;
  z-index: 1;
}

.comment-new-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
}

.comment-new-identity {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.comment-body-input {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.4rem;
  resize: none;
  height: 2.5rem;
}
.comment-body-input:focus { outline: none; border-color: var(--gold-dim); }

.comment-row {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  padding: 0.5rem;
}

.comment-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.comment-adventurer {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  color: var(--text);
}

.comment-body {
  font-family: var(--font-body);
  background-color: var(--gold-shadow);
  font-size: 1rem;
  color: var(--text);
  padding: 0.25rem 0 0 0;
  margin-left: calc(4rem + 0.5rem);
  display: flex;
  align-items: flex-end;
}


.comment-form-body {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin-left: calc(4rem + 0.5rem);
  padding-top: 0.25rem;
}
.comment-form-body .normal-btn {
  background-color: none;
  border-color: var(--gold-dim);
  color: var(--gold-dim);
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.comment-form-body .normal-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}