/* ============ The 150 Club Gallery — liquid glass ============ */

:root {
  --ink: #07090f;
  --text: #f4f1ea;
  --text-dim: rgba(244, 241, 234, 0.55);
  --gold: #f0c474;
  --gold-deep: #b87d1e;
  --glass-border: rgba(255, 255, 255, 0.16);
  --radius: 24px;
  --font-display: 'Unbounded', sans-serif;
  --font-body: 'Albert Sans', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* author display rules (e.g. .lb-btn { display: grid }) must not defeat the hidden attribute */
[hidden] { display: none !important; }
html { color-scheme: dark; }

body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- aurora background ---- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 70% 0%, #11162b 0%, var(--ink) 60%);
}
.aurora i {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.55;
  animation: drift 28s ease-in-out infinite alternate;
}
.aurora i:nth-child(1) { width: 55vmax; height: 55vmax; background: #38246b; top: -22%; left: -18%; }
.aurora i:nth-child(2) { width: 46vmax; height: 46vmax; background: #6b4a17; bottom: -28%; right: -12%; animation-duration: 34s; animation-delay: -9s; }
.aurora i:nth-child(3) { width: 34vmax; height: 34vmax; background: #0e4f4a; top: 28%; left: 44%; animation-duration: 40s; animation-delay: -18s; }
@keyframes drift {
  to { transform: translate(7vmax, -5vmax) scale(1.18) rotate(18deg); }
}
@media (prefers-reduced-motion: reduce) {
  .aurora i { animation: none; }
}

/* ---- giant 150 watermark ---- */
.watermark {
  position: fixed;
  z-index: -1;
  right: -4vmin;
  bottom: -10vmin;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 52vmin;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.07);
  user-select: none;
}

/* ---- glass panel primitive ---- */
.glass {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.04));
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* ---- welcome pages (code / name / admin) ---- */
.welcome {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.card {
  width: min(420px, 100%);
  padding: 40px 32px;
  text-align: center;
  animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
}
.card > * { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.card > *:nth-child(2) { animation-delay: 0.08s; }
.card > *:nth-child(3) { animation-delay: 0.16s; }
.card > *:nth-child(4) { animation-delay: 0.24s; }

.brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.6rem, 6vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.brand em {
  display: block;
  font-style: normal;
  font-weight: 400;
  font-size: 0.45em;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 10px;
}
.lead { color: var(--text-dim); margin: 18px 0 26px; font-size: 1.05rem; }

input[type='text'], input[type='password'] {
  width: 100%;
  padding: 16px 20px;
  font: inherit;
  font-size: 1.1rem;
  text-align: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(240, 196, 116, 0.15);
}
input::placeholder { color: rgba(244, 241, 234, 0.35); }

.btn {
  display: inline-block;
  width: 100%;
  margin-top: 14px;
  padding: 16px 24px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: #1d1405;
  background: linear-gradient(160deg, #ffe1a4, var(--gold) 45%, var(--gold-deep));
  border: none;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(240, 196, 116, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }

.error {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 92, 92, 0.12);
  border: 1px solid rgba(255, 92, 92, 0.35);
  color: #ffb4b4;
  font-size: 0.95rem;
}

/* ---- gallery ---- */
.topbar {
  position: sticky;
  top: 12px;
  z-index: 10;
  margin: 12px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.topbar .brand { font-size: 1.05rem; }
.topbar .brand em { display: inline; margin: 0 0 0 8px; font-size: 0.6em; }
.who { color: var(--text-dim); font-size: 0.9rem; white-space: nowrap; }
.who strong { color: var(--gold); font-weight: 700; }

main.gallery { padding: 8px 12px 140px; }

/* JS-distributed masonry: CSS multicol mispaints dynamically inserted,
   animated tiles in Chromium, so gallery.js fills flex columns instead. */
.grid {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.grid-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tile {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.tile.pop {
  animation: pop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.92) translateY(14px); }
}
.tile img { display: block; width: 100%; height: auto; }
.tile figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 22px 12px 9px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.74rem;
  background: linear-gradient(transparent, rgba(5, 7, 12, 0.75));
}
.tile .up { font-weight: 700; color: var(--gold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .t { color: var(--text-dim); white-space: nowrap; }
.tile .del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 92, 92, 0.85);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

.empty {
  text-align: center;
  color: var(--text-dim);
  padding: 80px 24px;
  font-size: 1.1rem;
}

/* ---- upload dock ---- */
.dock {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 28px;
}
.dock-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.dock-btn:active { transform: scale(0.94); }
.dock-btn.primary {
  color: #1d1405;
  background: linear-gradient(160deg, #ffe1a4, var(--gold) 45%, var(--gold-deep));
  border-color: transparent;
}
.dock-btn .ico { font-size: 1.2rem; line-height: 1; }

/* ---- lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: rgba(5, 7, 12, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.lightbox[hidden] { display: none; }
.lb-stage {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 12px;
}
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
.lb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 12px max(12px, env(safe-area-inset-bottom));
  padding: 12px 16px;
}
.lb-meta { font-size: 0.9rem; color: var(--text-dim); }
.lb-meta strong { color: var(--gold); }
.lb-actions { display: flex; gap: 8px; }
.lb-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}
.lb-btn.danger { background: rgba(255, 92, 92, 0.18); border-color: rgba(255, 92, 92, 0.4); }

/* ---- toasts ---- */
#toasts {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  width: min(380px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 14px 16px;
  font-size: 0.92rem;
  border-radius: 18px;
  animation: rise 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.toast .bar {
  height: 4px;
  margin-top: 10px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.toast .bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold), #ffe1a4);
  transition: width 0.2s;
}
.toast.ok { border-color: rgba(116, 240, 168, 0.35); }
.toast.fail { border-color: rgba(255, 92, 92, 0.4); }
