/* ============================================================
   beadart.online — artsy, playful, mobile-first
   ============================================================ */

/* The HTML `hidden` attribute is meant to hide elements, but it only sets
   `display: none` at the user-agent stylesheet level. Any element with an
   explicit `display:` rule (flex, inline-flex, etc.) overrides it — meaning
   the lightbox + native share button would show on first load. This forces
   the intended behavior across the whole site. */
[hidden] { display: none !important; }

:root {
  --bg: #1a0b2e;
  --bg-2: #241340;
  --card: rgba(255,255,255,0.06);
  --card-border: rgba(255,255,255,0.12);
  --ink: #fef6ff;
  --muted: #b4a8d6;
  --pink: #ff5fa2;
  --pink-2: #ff8bbf;
  --yellow: #ffd86b;
  --teal: #63e6e2;
  --purple: #c084fc;
  --green: #7cf2a3;
  --danger: #ff7676;
  --ring: 0 0 0 4px rgba(255, 95, 162, 0.35);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.45);
  --font-display: "Bagel Fat One", "Fredoka", system-ui, sans-serif;
  --font-body: "Fredoka", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-script: "Caveat", cursive;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(255,95,162,0.35), transparent 60%),
    radial-gradient(800px 600px at 95% -15%, rgba(99,230,226,0.28), transparent 60%),
    radial-gradient(700px 700px at 50% 110%, rgba(192,132,252,0.25), transparent 65%),
    linear-gradient(180deg, #1a0b2e 0%, #110820 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Floating background beads ---------- */
.bg-beads {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bead {
  position: absolute;
  width: 30px; height: 30px;
  border-radius: 50%;
  opacity: 0.18;
  filter: blur(0.5px);
  animation: float 16s ease-in-out infinite;
}
.bead::after {
  content: "";
  position: absolute;
  top: 18%; left: 22%;
  width: 30%; height: 30%;
  background: rgba(255,255,255,0.6);
  border-radius: 50%;
  filter: blur(2px);
}
.b1  { top: 8%;  left: 5%;  background: var(--pink);   animation-duration: 14s; }
.b2  { top: 22%; left: 88%; background: var(--yellow); animation-duration: 18s; width: 22px; height: 22px; }
.b3  { top: 55%; left: 3%;  background: var(--teal);   animation-duration: 20s; width: 40px; height: 40px; }
.b4  { top: 70%; left: 92%; background: var(--purple); animation-duration: 16s; }
.b5  { top: 38%; left: 50%; background: var(--pink);   animation-duration: 22s; width: 16px; height: 16px; }
.b6  { top: 85%; left: 20%; background: var(--yellow); animation-duration: 19s; }
.b7  { top: 15%; left: 70%; background: var(--teal);   animation-duration: 17s; width: 26px; height: 26px; }
.b8  { top: 92%; left: 70%; background: var(--pink);   animation-duration: 21s; width: 34px; height: 34px; }
.b9  { top: 48%; left: 78%; background: var(--green);  animation-duration: 15s; width: 18px; height: 18px; }
.b10 { top: 30%; left: 25%; background: var(--purple); animation-duration: 23s; width: 28px; height: 28px; }
.b11 { top: 65%; left: 40%; background: var(--yellow); animation-duration: 18s; width: 20px; height: 20px; }
.b12 { top: 5%;  left: 45%; background: var(--teal);   animation-duration: 24s; width: 24px; height: 24px; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25%      { transform: translate(20px, -30px) rotate(90deg); }
  50%      { transform: translate(-15px, 25px) rotate(180deg); }
  75%      { transform: translate(25px, 15px) rotate(270deg); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 56px 20px 64px;
  text-align: center;
  z-index: 1;
}
.hero-inner {
  max-width: 760px;
  margin: 0 auto;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  text-decoration: none;
  color: inherit;
}
.logo:hover { text-decoration: none; }
.logo-grid {
  width: 44px; height: 44px;
  filter: drop-shadow(0 4px 14px rgba(255,95,162,0.5));
  animation: spin-soft 18s linear infinite;
}
@keyframes spin-soft { to { transform: rotate(360deg); } }
.logo-word {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #fff 0%, #ffd86b 50%, #ff5fa2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  line-height: 1.05;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
  text-shadow: 0 4px 30px rgba(0,0,0,0.4);
}
.grad-text {
  background: linear-gradient(120deg, var(--pink) 0%, var(--yellow) 45%, var(--teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  animation: hue-shift 8s ease-in-out infinite;
}
@keyframes hue-shift {
  0%, 100% { filter: hue-rotate(0deg); }
  50%      { filter: hue-rotate(-25deg); }
}
.tagline {
  margin: 0 auto;
  max-width: 580px;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 400;
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}
.chip {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  backdrop-filter: blur(6px);
}

.wave {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  width: 100%;
  height: 60px;
  display: block;
}

/* ---------- Layout ---------- */
.container {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 36px 18px 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 26px 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.08);
  animation: card-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card h2 {
  font-family: var(--font-display);
  font-weight: 400;
  margin: 0 0 18px;
  font-size: 1.5rem;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 12px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--yellow));
  color: #1a0b2e;
  font-family: var(--font-display);
  font-size: 1.2rem;
  box-shadow: 0 4px 14px rgba(255,95,162,0.4);
}

/* ---------- Form fields ---------- */
.field { margin-bottom: 20px; }
.field-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 10px;
  opacity: 0.92;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.num-wrap {
  display: flex;
  align-items: stretch;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.num-wrap:focus-within {
  border-color: var(--pink);
  box-shadow: var(--ring);
}
.num-step {
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 1.4rem;
  font-weight: 700;
  padding: 0 16px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
.num-step:hover { background: rgba(255,255,255,0.08); color: var(--pink); }
.num-step:active { background: rgba(255,255,255,0.15); }
.num-wrap input {
  flex: 1;
  width: 100%;
  padding: 14px 8px;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  font-family: var(--font-body);
  appearance: textfield;
  -moz-appearance: textfield;
}
.num-wrap input:focus { outline: none; }
.num-wrap input::-webkit-outer-spin-button,
.num-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ---------- Presets ---------- */
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 22px;
}
.presets-label {
  font-family: var(--font-script);
  font-size: 1.4rem;
  color: var(--yellow);
  margin-right: 6px;
  transform: rotate(-3deg);
  display: inline-block;
}
.presets button {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform 0.18s cubic-bezier(0.2,0.8,0.2,1), background 0.18s, border-color 0.18s, color 0.18s;
}
.presets button:hover {
  background: linear-gradient(135deg, var(--pink), var(--yellow));
  border-color: transparent;
  color: #1a0b2e;
  transform: translateY(-2px) rotate(-1.5deg);
}
.presets button:active { transform: translateY(0); }

/* ---------- Count callout ---------- */
.count-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255,216,107,0.12), rgba(255,95,162,0.08));
  border: 1px dashed rgba(255,216,107,0.45);
  color: #ffe9a8;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  margin-bottom: 20px;
}
.count-callout .callout-emoji {
  font-size: 1.8rem;
  line-height: 1;
  animation: wiggle 2.5s ease-in-out infinite;
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(8deg); }
  75% { transform: rotate(-8deg); }
}
.count-callout strong { color: #fff; }

/* ---------- Drop zone ---------- */
.drop {
  display: block;
  position: relative;
  padding: 28px 22px;
  border: 2px dashed rgba(255,255,255,0.22);
  border-radius: 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  background: rgba(0,0,0,0.2);
  overflow: hidden;
  color: var(--muted);
}
.drop:hover, .drop.dragover, .drop:focus-visible {
  border-color: var(--pink);
  background: rgba(255,95,162,0.08);
  color: var(--pink-2);
  outline: none;
  transform: translateY(-2px);
}
.drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}
.drop-icon { display: flex; justify-content: center; margin-bottom: 8px; }
.drop-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
  font-weight: 400;
}
.drop-sub { font-size: 0.85rem; margin-top: 4px; opacity: 0.7; }
.drop img {
  display: none;
  max-width: 100%;
  max-height: 320px;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.drop.has-image .drop-inner { display: none; }
.drop.has-image img { display: block; }
.drop.has-image::after {
  content: "tap to change";
  position: absolute;
  bottom: 8px; right: 12px;
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  pointer-events: none;
}

/* ---------- Live grid preview ---------- */
.preview-field {
  animation: card-in 0.4s ease both;
}
.grid-preview-wrap {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
}
#gridPreview {
  display: block;
  margin: 0 auto;
  width: 260px;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-radius: 8px;
  background: #000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.preview-hint {
  margin-top: 12px;
  font-family: var(--font-script);
  font-size: 1.3rem;
  color: var(--teal);
  line-height: 1.2;
}

/* ---------- Buttons ---------- */
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-2) 60%, var(--yellow) 130%);
  background-size: 200% 100%;
  background-position: 0% 50%;
  color: #1a0b2e;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.05rem;
  padding: 14px 22px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s cubic-bezier(0.2,0.8,0.2,1), box-shadow 0.2s, background-position 0.6s;
  box-shadow: 0 10px 30px rgba(255, 95, 162, 0.45);
  letter-spacing: 0.01em;
}
.primary:hover {
  transform: translateY(-2px) scale(1.02);
  background-position: 100% 50%;
  text-decoration: none;
  box-shadow: 0 14px 40px rgba(255, 95, 162, 0.55);
}
.primary:active { transform: translateY(0) scale(1); }
.primary.big { width: 100%; padding: 18px 24px; font-size: 1.25rem; }
.primary[disabled] { opacity: 0.7; cursor: not-allowed; transform: none; }

.ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid rgba(255,255,255,0.25);
  padding: 14px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.05rem;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.ghost:hover { background: rgba(255,255,255,0.08); border-color: var(--teal); transform: translateY(-2px); }

.primary.loading .btn-label::after {
  content: "";
  display: inline-block;
  width: 16px; height: 16px;
  margin-left: 8px;
  border: 2.5px solid rgba(26,11,46,0.2);
  border-top-color: #1a0b2e;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.shake {
  animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

.status {
  margin-top: 14px;
  min-height: 1.2em;
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
}
.status.err { color: var(--danger); }
.status.ok  { color: var(--green); }

/* ---------- Result card ---------- */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.result-grid figure { margin: 0; }
.result-grid figcaption {
  font-family: var(--font-script);
  font-size: 1.4rem;
  color: var(--yellow);
  margin-bottom: 6px;
  text-align: center;
}
.result-grid img {
  display: block;
  width: 100%;
  border-radius: 14px;
  background: #000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  transition: transform 0.3s;
}
.result-grid img:hover { transform: scale(1.02); }
.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- Gallery ---------- */
.gallery-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.gallery-controls { display: flex; gap: 8px; }
.gallery-controls button {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: var(--ink);
  font-size: 1.4rem;
  cursor: pointer;
  font-family: var(--font-display);
  transition: background 0.15s, transform 0.15s, color 0.15s;
}
.gallery-controls button:hover {
  background: linear-gradient(135deg, var(--pink), var(--yellow));
  color: #1a0b2e;
  transform: translateY(-2px) scale(1.05);
  border-color: transparent;
}

.gallery {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 6px 4px 14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.gallery::-webkit-scrollbar { height: 8px; }
.gallery::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--pink), var(--teal));
  border-radius: 999px;
}
.gallery-item {
  flex: 0 0 240px;
  scroll-snap-align: start;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.2,0.8,0.2,1), box-shadow 0.25s, border-color 0.25s;
  position: relative;
  animation: pop 0.5s ease both;
}
.gallery-item:hover {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: 0 16px 40px rgba(255,95,162,0.3);
  border-color: var(--pink);
}
.gallery-item img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
  background: #000;
}
.gallery-item .meta {
  padding: 12px 14px;
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}
.gallery-item .meta .size-pill {
  background: linear-gradient(135deg, var(--pink), var(--yellow));
  color: #1a0b2e;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.gallery-item .meta .dl {
  color: var(--teal);
  text-decoration: none;
  font-size: 1.2rem;
  transition: transform 0.15s;
}
.gallery-item .meta .dl:hover { transform: translateY(2px); }
.worn-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.55);
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform 0.18s cubic-bezier(0.2,0.8,0.2,1), background 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  z-index: 2;
}
.worn-badge:hover {
  transform: scale(1.12) rotate(-8deg);
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 6px 20px rgba(255,95,162,0.45);
}
.gallery-empty {
  color: var(--muted);
  padding: 30px 24px;
  text-align: center;
  width: 100%;
  font-family: var(--font-script);
  font-size: 1.5rem;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ---------- Share buttons ---------- */
.share-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.share-label {
  font-family: var(--font-script);
  font-size: 1.3rem;
  color: var(--yellow);
  margin-right: 4px;
  transform: rotate(-3deg);
  display: inline-block;
}
.share-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.2,0.8,0.2,1), background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.share-btn:hover {
  transform: translateY(-3px) rotate(-3deg) scale(1.08);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}
.share-btn[data-net="instagram"]:hover {
  background: linear-gradient(135deg, #f58529 0%, #dd2a7b 50%, #8134af 100%);
}
.share-btn[data-net="x"]:hover {
  background: #000;
  border-color: #000;
}
.share-btn[data-net="pinterest"]:hover {
  background: #e60023;
}
.share-btn[data-net="native"]:hover {
  background: linear-gradient(135deg, var(--teal), var(--purple));
}
.share-btn svg { display: block; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 10, 35, 0.95);
  color: var(--ink);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: opacity 0.25s, transform 0.25s;
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10,4,20,0.92);
  backdrop-filter: blur(10px);
  z-index: 100;
  animation: fade 0.25s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.lightbox-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 70px 20px 30px;
}

.lightbox-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 28px;
  max-width: 1280px;
  margin: 0 auto;
  align-items: start;
}

.lightbox-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: pop 0.35s ease both;
}
.lightbox-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  margin: 0;
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.01em;
}
.lightbox-slide img {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.1);
  background: #000;
}
.lightbox-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.lightbox-close {
  position: fixed;
  top: 18px; right: 22px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: white;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  z-index: 101;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); transform: rotate(90deg); }

.lightbox-permalink-row {
  margin: 32px auto 0;
  max-width: 1280px;
  display: flex;
  justify-content: center;
}
.permalink-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--ink);
  background: rgba(255,255,255,0.06);
  border: 1px dashed rgba(255,255,255,0.18);
  border-radius: 16px;
  padding: 14px 22px;
  transition: transform 0.18s cubic-bezier(0.2,0.8,0.2,1), background 0.2s, border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
  max-width: 96vw;
  text-align: center;
}
.permalink-link:hover {
  text-decoration: none;
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(255,95,162,0.18), rgba(99,230,226,0.10));
  border-color: var(--pink);
  box-shadow: 0 12px 28px rgba(255,95,162,0.25);
}
.permalink-emoji { font-size: 1.3rem; }
.permalink-label {
  font-family: var(--font-display);
  font-size: 1rem;
}
.permalink-url {
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-all;
  max-width: 100%;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ---------- Gallery CTA on homepage ---------- */
.gallery-cta {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}
.gallery-cta .ghost {
  font-size: 0.98rem;
  padding: 12px 22px;
}

/* ---------- /gallery page ---------- */
.hero-compact { padding: 36px 20px 40px; }
.hero-compact .hero-title { font-size: clamp(1.8rem, 4.5vw, 2.8rem); }
.chip-link {
  text-decoration: none;
  color: var(--ink);
}
.chip-link:hover {
  text-decoration: none;
  background: rgba(255,255,255,0.18);
}
.all-page { padding-top: 28px; }
.all-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.all-card {
  position: relative;
  display: block;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.2,0.8,0.2,1), box-shadow 0.25s, border-color 0.25s;
  animation: pop 0.5s ease both;
}
.all-card:hover {
  text-decoration: none;
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: 0 16px 40px rgba(255,95,162,0.3);
  border-color: var(--pink);
}
.all-card-img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #000;
}
.all-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.all-card-img-wrap .worn-badge {
  pointer-events: none;
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.all-card-meta {
  padding: 12px 14px;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}
.all-card-date {
  font-family: var(--font-script);
  font-size: 1.15rem;
  color: var(--yellow);
}
@media (max-width: 560px) {
  .all-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}

/* ---------- Confetti ---------- */
#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
}

/* ---------- Footer ---------- */
footer {
  position: relative;
  z-index: 1;
  padding: 32px 24px 36px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: transform 0.18s cubic-bezier(0.2,0.8,0.2,1), background 0.2s, border-color 0.2s, color 0.2s;
  backdrop-filter: blur(6px);
}
.social:hover {
  text-decoration: none;
  transform: translateY(-2px) rotate(-1.5deg);
  background: linear-gradient(135deg, var(--pink), var(--yellow));
  color: #1a0b2e;
  border-color: transparent;
}
.social svg { display: block; }
.footer-tag { margin: 0; }
@media (max-width: 480px) {
  .social { font-size: 0.85rem; padding: 8px 13px; }
  .social svg { width: 18px; height: 18px; }
}
.heart {
  color: var(--pink);
  display: inline-block;
  animation: beat 1.4s ease-in-out infinite;
}
@keyframes beat {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.25); }
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .hero { padding: 40px 16px 60px; }
  .logo-word { font-size: 1.7rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .gallery-item { flex-basis: 80vw; }
  .gallery-item img { height: 80vw; max-height: 320px; }
  .card { padding: 22px 18px; border-radius: 18px; }
  .card h2 { font-size: 1.3rem; }
  .step-num { width: 32px; height: 32px; font-size: 1rem; }
  .hero-chips .chip { font-size: 0.8rem; padding: 6px 12px; }
  #gridPreview { width: 220px; }
  .primary.big { font-size: 1.1rem; padding: 16px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
