/* ===== Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #eee;
  background-color: #000;
}

::selection {
  background: rgba(16, 185, 129, 0.4);
}

/* Slim dark scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #0a070d; }
::-webkit-scrollbar-thumb {
  background: #2b2438;
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover { background: #3d3352; }

/* ===== Geoblock screen ===== */
.geoblock-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d0d0d;
  padding: 20px;
}

.geoblock-box {
  max-width: 420px;
  text-align: center;
  border: 1px solid #2a2a38;
  border-radius: 8px;
  background: #0d0d0d;
  padding: 36px 28px;
}

.geoblock-box h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #eee;
  margin-bottom: 12px;
}

.geoblock-box p {
  color: #999;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ===== 18+ age gate ===== */
.agegate-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.agegate-box {
  width: 100%;
  max-width: 480px;
  background: #121016;
  border: 1px solid #2a2a38;
  color: #ddd;
  border-radius: 8px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.agegate-box h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #eee;
  margin-bottom: 14px;
}

.agegate-warn {
  color: #999;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 14px;
}

.agegate-req {
  color: #ddd;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 22px;
}

.agegate-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.agegate-btn {
  border: none;
  border-radius: 4px;
  padding: 12px 18px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  cursor: pointer;
  transition: filter 0.15s;
}

.agegate-btn:hover {
  filter: brightness(1.1);
}

.agegate-ok {
  background: #10b981;
}

.agegate-no {
  background: #ef4444;
}

/* ===== Navbar ===== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 28px;
  border-bottom: 1px solid #242424;
  background: #0d0d0d;
}

/* Centers the title (used on the upload page) */
.navbar-center {
  justify-content: center;
  position: relative;
}

/* Nav buttons pinned right on centered-title pages */
.nav-actions {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 10px;
}

.site-name {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #8b5cf6;
  text-decoration: none;
}

.site-name-tld {
  color: #eee;
}

/* The signature XXX: hot pink with a subtle glow */
/* The signature xxx: purple fill with a white outline */
.site-name-dot {
  color: #eee;
}

/* Each x individually: white halo only on the OUTSIDE of the letter —
   the purple fill stays clean (text-shadow never covers the glyph) */
.site-name-xxx {
  color: #8b5cf6;
  /* Layered halo: a dark drop-shadow below for lift, plus a soft glow
     that follows the exact letter shapes */
  filter:
    drop-shadow(0 3px 2px rgba(20, 5, 50, 0.9))
    drop-shadow(0 0 5px rgba(167, 139, 250, 0.55));
}

.btn-upload {
  margin-left: auto;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background: #8b5cf6;
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: filter 0.15s;
}

.btn-upload:hover {
  background: #7c3aed;
}

/* ===== Remove post page ===== */
.remove-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 60px 20px;
  text-align: center;
  /* Same shared sizing vars as the upload page */
  --slot-size: 72px;
  --slot-gap: 10px;
}

.remove-page h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.remove-page .hint {
  color: #999;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 28px;
}

/* ===== Upload page ===== */
.upload-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 60px 20px;
  text-align: center;
  /* Shared sizing so the box and thumbnail row line up */
  --slot-size: 72px;
  --slot-gap: 10px;
}

.upload-page h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}

/* Upload box with a classic file button */
.upload-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: calc(var(--slot-size) * 6 + var(--slot-gap) * 5);
  margin: 0 auto;
  border: 1px solid #2a2a38;
  border-radius: 8px;
  background: #111;
  padding: 16px 22px;
}

.upload-hint {
  color: #999;
  font-size: 0.95rem;
}

/* Preview slots */
.preview-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--slot-gap);
  margin-top: 24px;
}

.slot {
  position: relative;
  width: var(--slot-size);
  height: var(--slot-size);
  border: 1px solid #2a2a38;
  border-radius: 6px;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.slot-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.85);
  color: #eee;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.slot-remove:hover {
  background: #7f1d1d;
  color: #fff;
}

/* "Set as thumbnail" hover button — pops up below the pic, black with white text */
.slot-thumb-btn {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 3px;
  padding: 5px 0;
  background: #000;
  color: #fff;
  border: 1px solid #2a2a38;
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  border-radius: 3px;
  z-index: 2;
}

.slot:hover .slot-thumb-btn {
  opacity: 1;
}

.slot-thumb-btn.current {
  color: #a78bfa;
}

.slot .placeholder {
  color: #444;
  font-size: 1.1rem;
}

.slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Description box */
.description-box {
  display: block;
  width: calc(var(--slot-size) * 6 + var(--slot-gap) * 5);
  margin: 36px auto 0;
  min-height: 90px;
  padding: 12px 14px;
  border: 1px solid #2a2a38;
  border-radius: 8px;
  background: #111;
  color: #eee;
  font-size: 0.95rem;
  font-family: inherit;
  resize: none;
}

.description-box:focus {
  outline: none;
  border-color: #8b5cf6;
}

/* Upload button */
.btn-post {
  display: block;
  margin: 20px auto 0;
  padding: 11px 34px;
  border: none;
  border-radius: 6px;
  background: #8b5cf6;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
}

.btn-post:hover {
  background: #7c3aed;
}

.upload-msg {
  margin-top: 14px;
  color: #a78bfa;
  font-size: 0.95rem;
}

/* Remove post button */
.btn-remove {
  display: block;
  width: calc(var(--slot-size) * 6 + var(--slot-gap) * 5);
  margin: 12px auto 0;
  padding: 10px 0;
  border: none;
  border-radius: 6px;
  background: #8b5cf6;
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
}

.btn-remove:hover {
  background: #7c3aed;
}

/* Back to main page button */
.btn-back {
  display: block;
  width: calc(var(--slot-size) * 6 + var(--slot-gap) * 5);
  margin: 12px auto 0;
  padding: 10px 0;
  border: 1px solid #2a2a38;
  border-radius: 8px;
  background: #111;
  color: #eee;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}

.btn-back:hover {
  background: #1b1b26;
  transform: translateY(-1px);
}

/* Removal key input + display */
.key-input {
  display: block;
  width: calc(var(--slot-size) * 6 + var(--slot-gap) * 5);
  margin: 16px auto 0;
  padding: 10px 14px;
  border: 1px solid #2a2a38;
  border-radius: 8px;
  background: #111;
  color: #eee;
  font-size: 0.9rem;
  text-align: center;
  letter-spacing: 0.05em;
}

.key-input:focus {
  outline: none;
  border-color: #8b5cf6;
}

.key-box {
  width: calc(var(--slot-size) * 6 + var(--slot-gap) * 5);
  margin: 18px auto 0;
  padding: 14px 16px;
  border: 1px solid #8b5cf6;
  border-radius: 8px;
  background: #151021;
  text-align: center;
}

.key-label {
  color: #a78bfa;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.key-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.key-value {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  color: #fff;
}

.btn-copy {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: #8b5cf6;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-copy:hover {
  background: #7c3aed;
}

/* ===== Posts feed (main page) ===== */
/* "Most Exxxposed" filter button: solid green like Upload, sits next to the
   site name; darker green while the filter is active */
#exxxposedBtn {
  margin-left: 24px;
}

/* Keep Remove Post right next to the filter button */
a[href="remove.html"] {
  margin-left: 10px;
}

#exxxposedBtn.active {
  background: #7c3aed;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 20px 28px;
}

.page-btn {
  padding: 8px 16px;
  border: 1px solid #2a2a38;
  border-radius: 6px;
  background: #121016;
  color: #ddd;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s;
}

.page-btn:hover:not(:disabled) {
  border-color: #4a4a5a;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.page-info {
  color: #999;
  font-size: 0.85rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: #0d0d0d;
  border: 1px solid #3a3a3a; /* slight light-gray border to separate cards */
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}

.post-card:hover {
  border-color: #555;
}

.post-image {
  max-width: 100%;
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
  background: #000;
  cursor: pointer;
}

/* Thumbnails under the picture in the popup */
.lb-thumbs {
  display: flex;
  gap: 6px;
  padding: 0 8px;
  max-width: 100%;
  overflow-x: auto; /* scroll sideways when there are many images */
}

.lb-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  display: block;
  opacity: 0.75;
  flex: 0 0 auto; /* never shrink — scroll instead */
  transition: border-color 0.15s, opacity 0.15s;
}

.lb-thumb:hover {
  opacity: 1;
}

.lb-thumb.active {
  border-color: #a78bfa;
  opacity: 1;
}

.post-description {
  padding: 10px 12px;
  color: #ddd;
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.post-meta {
  margin-top: auto;
  display: flex;
  flex-direction: column; /* timer row above, stats row below */
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  border-top: 1px solid #242424;
  font-size: 0.85rem;
}

.post-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.timer-text {
  color: #38bdf8;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.timer-text svg {
  stroke-width: 2;
}

.views-text {
  color: #999;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ext-text {
  color: #777;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* On the card: numbers regular, slightly tinted gray */
.post-meta .views-text > span,
.post-meta .ext-text > span,
.post-meta .dl-text > span,
.post-meta .pic-text > span,
.post-meta .comment-stat > span {
  color: #d6d6d6;
  font-weight: 400;
}

.post-meta .timer-text > span {
  color: #38bdf8;
  font-weight: 400;
}

.post-meta .views-text svg {
  stroke: #a855f7;
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.post-meta .views-text svg circle {
  fill: #a855f7;
}

.post-meta .ext-text svg {
  stroke: #4d9fff;
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.post-meta .dl-text svg {
  stroke: #1d7a4f;
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.dl-text {
  color: #777;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pic-text {
  color: #777;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dl-text svg,
.ext-text svg,
.views-text svg,
.pic-text svg,
.comment-stat svg {
  display: block;
  stroke: #d946ef;
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

/* Comment counter: red bold bubble, gray bold number */
.comment-stat {
  color: #777;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.post-meta .comment-stat svg {
  stroke: #ef4444;
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.empty-feed {
  text-align: center;
  padding: 80px 20px;
  color: #666;
  font-size: 1.1rem;
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  padding: 20px;
  overflow-y: auto; /* the whole popup scrolls Reddit-style when long */
}

/* The boxed popup that contains the image and all its features */
.lightbox-box {
  position: relative;
  margin: auto; /* centered when short, top-aligned + scrollable when long */
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: #000;
  border: 1px solid #2a2a38;
  border-radius: 8px;
  /* Tight frame around the picture; extra room at the bottom for the info */
  padding: 4px 4px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Brand name at the top of the popup box */
.lightbox-brand {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #8b5cf6;
  padding-top: 2px;
}

.lightbox-brand .site-name-dot {
  color: #eee;
}

/* Fixed-size stage: every image sits in the same frame */
/* Stage is sized by JS to exactly match each image's shape — no black space */
/* Fixed-size stage: stable on every image, every device — the picture is
   contained inside, never stretched, and no JS resizing means no glitches */
.lightbox-stage {
  position: relative;
  width: min(88vw, 520px);
  height: 52vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: #999;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 2;
}

.lightbox-close:hover {
  color: #fff;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #3a3a4c;
  background: rgba(0, 0, 0, 0.6);
  color: #eee;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.lightbox-nav:hover {
  background: #2a2a38;
}

/* Just outside the picture's edges — never on top of it.
   On phones the arrows sit ON the picture edges so they stay in frame. */
.lightbox-nav.prev { left: -50px; }
.lightbox-nav.next { right: -50px; }

@media (max-width: 600px) {
  .lightbox-nav {
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
  }
  .lightbox-nav.prev { left: 6px; }
  .lightbox-nav.next { right: 6px; }
}

.lightbox-info {
  width: 100%;
  padding: 2px 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.lightbox-counter {
  color: #777;
  font-size: 0.85rem;
}

.lightbox-timer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.lightbox-timer {
  color: #38bdf8;
  font-size: 0.95rem;
  font-weight: 400;
}

.lightbox-views {
  color: #999;
  font-size: 0.85rem;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lightbox-views svg {
  display: block;
  width: 15px;
  height: 15px;
}

/* Popup stat icons match the card colors */
.lb-icon {
  display: flex;
  align-items: center;
}

.lb-icon.eye svg {
  stroke: #a855f7;
  stroke-width: 2;
}

.lb-icon.eye svg circle {
  fill: #a855f7;
}

.lb-icon.ext svg {
  stroke: #4d9fff;
  stroke-width: 2;
}

.lb-icon.dl svg {
  stroke: #1d7a4f;
  stroke-width: 2;
}

.lb-icon.share svg {
  stroke: #e8862c;
}

.lb-num {
  font-weight: 400;
  color: #d6d6d6;
}

.lb-num.dl-num {
  font-weight: 400;
  color: #d6d6d6;
}

.lightbox-timer svg {
  stroke-width: 2;
}

.extend-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.lightbox-desc {
  color: #ddd;
  font-size: 0.95rem;
  max-width: 420px;
  text-align: center;
  margin: 0 auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.btn-extend {
  padding: 7px 12px;
  border: none;
  border-radius: 8px;
  background: #8b5cf6;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
}

.btn-extend:hover {
  background: #7c3aed;
}

/* Share button + popup */
.btn-share {
  padding: 8px 22px;
  border: 1px solid #2a2a38;
  border-radius: 6px;
  background: #121016;
  color: #eee;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s;
}

.btn-share:hover {
  border-color: #4a4a5a;
}

/* ===== Comments ===== */
.comments-section {
  width: 100%;
  border-top: 1px solid #2a2a38;
  margin-top: 10px;
  padding: 10px 10px 4px;
  text-align: left;
}

.comments-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #ddd;
  margin-bottom: 10px;
}

.comment-sort {
  margin-left: auto;
  background: #000;
  border: 1px solid #2a2a38;
  border-radius: 4px;
  color: #999;
  font-size: 0.65rem;
  padding: 3px 6px;
  cursor: pointer;
}

.comment-sort:focus {
  outline: none;
  border-color: #4a4a5a;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0 10px;
}

/* Each comment in its own box, slightly lighter than the post background */
.comment-item {
  background: #141414;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
}

/* Button that shows/hides a comment's replies */
.replies-toggle {
  background: none;
  border: none;
  color: #999;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.replies-toggle:hover {
  color: #ddd;
}

.comment-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.comment-name {
  color: #9a9a9a;
  font-size: 0.72rem;
  font-weight: 700;
}

.comment-time {
  color: #666;
  font-size: 0.62rem;
}

.comment-body {
  color: #ddd;
  font-size: 0.78rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  display: flow-root; /* contains the floated like/reply row */
  padding-left: 16px; /* one indent */
}

.comment-actions {
  float: right; /* like + Reply at the right; text stops before them and wraps below */
  margin-left: 12px;
}

.comment-text {
  /* the wrapped text node — measured to align the float with its last line */
}

.comment-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* both buttons on the right of the comment */
  gap: 16px;
}

.comment-like {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #999;
  font-size: 0.7rem;
  align-self: flex-end; /* pushes the heart to the right edge of the comment */
}

/* Un-liked heart: light gray outline so it's visible on the dark card.
   (Only when NOT liked — a liked heart stays pink.) */
.comment-like:not(.active) svg path {
  stroke: #9a9a9a;
}

.comment-like svg {
  display: block;
}

.comment-like.active {
  color: #ec4899;
}

.comment-like.active svg path {
  fill: #ec4899;
}

.comment-like-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
}

.comment-reply-btn {
  background: none;
  border: none;
  color: #999;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.comment-reply-btn:hover {
  color: #ddd;
}

/* Collapse button: on-theme (dark with purple accent) */
.comment-gutter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.comment-collapse-btn {
  width: 22px;
  height: 22px;
  border: 1px solid #2a2a38;
  border-radius: 5px;
  background: #141414;
  color: #a78bfa;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.comment-collapse-btn:hover {
  color: #ddd;
  border-color: #4a4a5a;
  background: #1c1c24;
}

.comment-threadline {
  flex: 1 0 auto;
  width: 2px;
  background: #2a2a38;
  margin-top: 4px;
}

/* Nested replies: indented with a thread line */
.comment-replies {
  margin-top: 8px;
  padding-left: 12px;
  border-left: 2px solid #2a2a38;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Reply form */
.reply-form {
  width: 100%;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reply-name-input {
  font-size: 0.7rem;
  padding: 6px 8px;
}

.reply-textarea {
  min-height: 40px;
  font-size: 0.75rem;
}

.reply-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reply-actions .btn-comment {
  width: auto;
  padding: 6px 14px;
  font-size: 0.72rem;
}

.reply-cancel {
  background: none;
  border: none;
  color: #999;
  font-size: 0.7rem;
  cursor: pointer;
}

.reply-cancel:hover {
  color: #eee;
}

/* Main comment box + button at the bottom */
.comment-input,
.comment-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #2a2a38;
  border-radius: 6px;
  background: #141414;
  color: #eee;
  font-size: 0.8rem;
  font-family: inherit;
}

/* Space between name box / comment box / button */
.comment-input {
  margin-bottom: 10px;
}

.comment-textarea {
  margin-bottom: 10px;
}

.comment-input:focus,
.comment-textarea:focus {
  outline: none;
  border-color: #4a4a5a;
}

.comment-textarea {
  min-height: 52px;
  resize: none;
}

.btn-comment {
  width: 100%;
  padding: 8px 14px;
  margin-bottom: 14px; /* gap between the form and the comment list */
  border: 1px solid #2a2a38;
  border-radius: 6px;
  background: #141414;
  color: #ddd;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s;
}

.btn-comment:hover {
  border-color: #4a4a5a;
}

/* Post age next to the Share button in the popup */
.post-age {
  color: #9a9a9a;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  margin-left: 14px; /* slightly further right of the share counter */
}

/* LIVE badge: shown when shared comments are connected */
.comments-live {
  color: #34d399;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-left: 6px;
}

.btn-ico {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
}

.btn-ico svg {
  display: block;
}

.btn-row .btn-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Share + Download side by side, right next to each other */
.btn-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-box {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(80vw, 300px);
  background: #121016;
  border: 1px solid #2a2a38;
  border-radius: 8px;
  padding: 18px;
}

.share-box h3 {
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 6px;
}

.share-option {
  padding: 10px 12px;
  border: 1px solid #2a2a38;
  border-radius: 6px;
  background: #000;
  color: #eee;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s;
}

.share-option:hover {
  border-color: #4a4a5a;
}

.share-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: #999;
  font-size: 1rem;
  cursor: pointer;
}

.share-close:hover {
  color: #fff;
}

/* Anything with [hidden] must actually disappear, even with display set */
[hidden] {
  display: none !important;
}

.char-count {
  margin-top: 6px;
  color: #666;
  font-size: 0.85rem;
  text-align: right;
  width: calc(var(--slot-size) * 6 + var(--slot-gap) * 5);
  margin-left: auto;
  margin-right: auto;
}

/* Duration selector */
.duration-label {
  display: block;
  width: calc(var(--slot-size) * 6 + var(--slot-gap) * 5);
  margin: 16px auto 6px;
  color: #999;
  font-size: 0.9rem;
  text-align: left;
}

.duration-box {
  display: block;
  width: calc(var(--slot-size) * 6 + var(--slot-gap) * 5);
  margin: 0 auto;
  padding: 11px 14px;
  border: 1px solid #2a2a38;
  border-radius: 8px;
  background: #111;
  color: #eee;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
}

.duration-box:focus {
  outline: none;
  border-color: #8b5cf6;
}

/* Turnstile (human verification) */
.turnstile-wrap {
  width: calc(var(--slot-size) * 6 + var(--slot-gap) * 5);
  margin: 20px auto 0;
  display: flex;
  justify-content: center;
}

/* ===== Mobile: phones (both pages adapt, desktop unchanged) ===== */
@media (max-width: 600px) {
  /* Navbar: one row, all buttons visible — button text wraps internally */
  .navbar {
    flex-wrap: nowrap;
    padding: 10px 10px;
    gap: 6px;
  }
  .site-name {
    font-size: 1.02rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .btn-upload {
    padding: 6px 8px;
    font-size: 0.58rem;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
  }
  #exxxposedBtn,
  a[href="remove.html"] {
    margin-left: 0;
  }
  .nav-actions {
    right: 10px;
    gap: 6px;
  }

  /* Upload page */
  .upload-page {
    padding: 32px 14px;
  }
  .upload-page h1 {
    font-size: 1.5rem;
  }
  .upload-box {
    width: 100%;
    padding: 12px;
    flex-direction: column;
    gap: 8px;
  }
  .upload-box input[type="file"] {
    width: 100%;
    min-width: 0;
  }
  /* The Turnstile wrap had a fixed desktop width — this was overflowing */
  .turnstile-wrap {
    width: 100%;
  }
  .description-box,
  .char-count,
  .duration-label,
  .duration-box,
  .key-input,
  .key-box,
  .btn-back,
  .btn-post {
    width: 100%;
  }
  .description-box {
    margin-top: 28px;
  }
  .description-box,
  .key-box {
    min-height: 0;
  }
  .btn-post {
    padding: 12px 0;
  }

  /* Preview thumbnails: 4 per row */
  .preview-grid {
    gap: 8px;
  }
  .slot {
    width: calc((100% - 3 * 8px) / 4);
    height: auto;
    aspect-ratio: 1 / 1;
  }

  /* Remove page */
  .remove-page {
    padding: 32px 14px;
  }
  .remove-page h1 {
    font-size: 1.5rem;
  }
  .remove-page .hint {
    margin-bottom: 20px;
  }
  .key-input,
  .btn-remove {
    width: 100%;
  }

  /* Main page feed: 3 posts per row, compact cards */
  .posts-grid {
    padding: 8px;
    gap: 4px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .post-description {
    font-size: 0.62rem;
    padding: 6px 5px;
    line-height: 1.3;
  }
  .post-meta {
    flex-wrap: wrap;
    gap: 3px;
    padding: 5px 3px;
    /* This scales the NUMBERS — they inherit it */
    font-size: 0.55rem;
  }
  .stat-value {
    font-size: 0.4rem;
    gap: 1px;
  }
  .stat-label {
    font-size: 0.32rem;
    letter-spacing: 0.03em;
  }
  .stat-dot {
    font-size: 0.35rem;
  }
  .post-meta svg {
    width: 9px !important;
    height: 9px !important;
  }

  /* Lightbox popup */
  .lightbox-stage {
    width: 92vw;
    height: 45vh;
  }
  .lightbox-info {
    padding: 2px 6px 0;
  }
  .extend-options {
    flex-wrap: nowrap; /* all extension buttons on one line on mobile */
    gap: 8px;
    padding: 0 4px;
  }
  .lightbox-timer {
    font-size: 0.82rem; /* slightly smaller timer on mobile popup */
  }
  .lightbox-views {
    font-size: 0.82rem; /* stats match the timer size on mobile */
  }
  .btn-extend {
    padding: 7px 6px;
    font-size: 0.66rem;
    flex: 1 1 0; /* equal widths, stretched to fill the screen width */
    min-width: 0;
    white-space: nowrap;
  }
  .btn-row {
    gap: 6px;
  }
  .btn-share {
    padding: 9px 14px;
    font-size: 0.8rem;
  }
  .share-box {
    width: 92vw;
  }
}
