/* Flat shared gallery — curated + everyone's uploads, uncategorized. */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.4rem 0;
}
.sharedTitle { color: var(--garnet); }

/* upload panel */
.panel {
  margin: 0 0 1.6rem;
}
.panelRow { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.pwInput {
  font-family: var(--serif-stack);
  font-size: clamp(16px, 1.8vw, 19px);
  color: #4f3528;
  background: rgba(255, 252, 245, 0.92);
  border: 1px solid rgba(199, 154, 85, 0.5);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  outline: none;
  flex: 1;
  min-width: 180px;
}
.pwInput:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(199, 154, 85, 0.18); }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  border: 1.5px dashed rgba(199, 154, 85, 0.65);
  border-radius: 14px;
  padding: 1.8rem;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 252, 245, 0.6);
  transition: background 0.15s ease, border-color 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}
.drop:hover { background: rgba(255, 250, 238, 0.95); border-color: var(--gold); }
.dropIcon { font-size: 2.2rem; }
.dropHint { color: var(--muted); font-size: 0.9rem; }
.hiddenInput { display: none; }
.progress { margin-top: 0.8rem; color: var(--garnet); font-style: italic; }
.bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(199, 154, 85, 0.25);
  overflow: hidden;
  margin-top: 0.5rem;
}
.barFill { height: 100%; background: linear-gradient(90deg, var(--warm-red), var(--gold)); transition: width 0.2s ease; }
.msgOk { color: var(--garnet-bright); font-style: italic; margin-top: 0.6rem; }
.msgErr { color: var(--lotus-red); margin-top: 0.6rem; }

/* grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
}
.tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #2a1a12;
  box-shadow: 0 0 0 3px var(--wood-1), 0 4px 14px rgba(20, 8, 10, 0.22);
  cursor: pointer;
  border: 0;
  padding: 0;
}
.tile img,
.tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.tile:hover img,
.tile:hover video { transform: scale(1.05); }
.badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(18, 7, 9, 0.6);
  color: #f3ddc3;
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 8px;
}
.yours {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(185, 38, 58, 0.85);
  color: #fff7ec;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 7px;
}
/* Red ✕ delete control — clearly visible at the corner when you can delete. */
.delBtn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--lotus-red);
  color: #fff;
  border: 1.5px solid #fff7ec;
  border-radius: 999px;
  font-size: 17px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  opacity: 1;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.38);
}
.delBtn:hover { background: #d4212f; transform: scale(1.06); }
.caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.6rem 0.5rem 0.4rem;
  font-size: 12px;
  color: #fff7ec;
  background: linear-gradient(180deg, transparent, rgba(18, 7, 9, 0.7));
  pointer-events: none;
}
.empty { color: var(--muted); font-style: italic; text-align: center; padding: 2rem 1rem; }

/* lightbox */
.lb {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 120% at 50% 30%, rgba(40, 16, 22, 0.92), rgba(12, 5, 7, 0.97));
  padding: 4vmin;
  animation: lbIn 0.2s ease;
}
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lbMedia {
  max-width: 92vw;
  max-height: 84vh;
  border-radius: 4px;
  background: #2a1a12;
  box-shadow: 0 0 0 4px var(--wood-1), 0 0 0 9px var(--wood-2), 0 0 0 12px var(--wood-3), 0 18px 50px rgba(0,0,0,0.6);
}
.lbMedia img,
.lbMedia video { display: block; max-width: 92vw; max-height: 84vh; object-fit: contain; border-radius: 4px; }
.lbBtn {
  position: absolute;
  background: rgba(255, 248, 232, 0.14);
  color: #fff7ec;
  border: 1px solid rgba(255, 248, 232, 0.3);
  border-radius: 999px;
  width: 52px;
  height: 52px;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lbBtn:hover { background: rgba(255, 248, 232, 0.28); }
.lbClose { top: 4vmin; right: 4vmin; }
.lbPrev { left: 3vmin; top: 50%; transform: translateY(-50%); }
.lbNext { right: 3vmin; top: 50%; transform: translateY(-50%); }
.lbCap {
  position: absolute;
  bottom: 3vmin;
  left: 0;
  right: 0;
  text-align: center;
  color: #f3ddc3;
  font-style: italic;
  padding: 0 2rem;
}

@media (prefers-reduced-motion: reduce) {
  .lb { animation: none; }
  .tile img, .tile video { transition: none; }
}
