/* =========================================================
   Fotos de Cumpleaños — tema fiesta (mobile-first)
   ========================================================= */

:root {
  --green: #0f4433;
  --green-deep: #0b3327;
  --green-dark: #04140e;
  --gold: #d9b45a;
  --gold-bright: #f5d98b;
  --gold-deep: #a8862f;
  --mint: #7fe3c0;
  --forest: #1c7a5b;
  --card: rgba(255, 255, 255, 0.07);
  --card-border: rgba(245, 217, 139, 0.22);
  --text: #f7f3e8;
  --muted: #b3c7ba;
  --danger: #ff5a5f;
  --ok: #3ddc97;
  --radius: 22px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Baloo 2", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 12% -8%, rgba(217, 180, 90, 0.32), transparent 60%),
    radial-gradient(900px 550px at 92% 8%, rgba(28, 122, 91, 0.5), transparent 62%),
    radial-gradient(1000px 700px at 50% 110%, rgba(15, 68, 51, 0.9), transparent 65%),
    linear-gradient(160deg, var(--green-deep), var(--green) 45%, var(--green-dark));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

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

/* ---------- utilidades ---------- */

.wrap {
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: 22px 0 60px;
}

.center { text-align: center; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(217, 180, 90, 0.12);
  border: 1px solid rgba(217, 180, 90, 0.4);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

h1.title {
  font-size: clamp(2rem, 8vw, 3.4rem);
  line-height: 1.05;
  margin: 0 0 10px;
  font-weight: 800;
  background: linear-gradient(92deg, #fff 5%, var(--gold-bright) 45%, var(--gold) 78%, var(--mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(217, 180, 90, 0.3);
}

.subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 auto 26px;
  max-width: 560px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 26px 22px;
}

/* ---------- botones / inputs ---------- */

.btn {
  --btn-bg: rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--btn-bg);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(120deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
  border: none;
  box-shadow: 0 14px 30px rgba(217, 180, 90, 0.32);
  color: #0f3327;
}

.btn-big {
  font-size: 1.15rem;
  padding: 18px 30px;
  width: 100%;
}

.btn-ghost { background: transparent; }

.btn-danger {
  background: rgba(255, 90, 95, 0.16);
  border-color: rgba(255, 90, 95, 0.5);
  color: #ffd7d8;
}

.btn-ok {
  background: rgba(61, 220, 151, 0.16);
  border-color: rgba(61, 220, 151, 0.5);
  color: #c6ffe8;
}

.input {
  width: 100%;
  font: inherit;
  font-size: 1.1rem;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input::placeholder { color: #8fa89a; }
.input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(217, 180, 90, 0.25);
}

.label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 8px 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .btn { flex: 1; }

/* ---------- header compartido ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0 6px;
}

.brand {
  font-weight: 800;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

.pill {
  font-size: 0.82rem;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--card-border);
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- paso de nombre ---------- */

.hero { max-width: 480px; margin: 6vh auto 0; text-align: center; }

.logo-emoji {
  font-size: clamp(3.4rem, 16vw, 5rem);
  display: inline-block;
  animation: float 3.4s ease-in-out infinite;
  filter: drop-shadow(0 12px 24px rgba(217, 180, 90, 0.5));
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-12px) rotate(5deg); }
}

.form { text-align: left; margin-top: 8px; }
.form .btn { margin-top: 16px; }

.hint {
  font-size: 0.86rem;
  color: var(--muted);
  text-align: center;
  margin-top: 14px;
}

/* ---------- zona de subida ---------- */

.dropzone {
  border: 2.5px dashed rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.dropzone:hover,
.dropzone.drag {
  border-color: var(--mint);
  background: rgba(127, 227, 192, 0.12);
  transform: scale(1.01);
}

.dropzone .dz-icon { font-size: 3rem; display: block; margin-bottom: 8px; }
.dropzone .dz-main { font-size: 1.2rem; font-weight: 800; }
.dropzone .dz-sub { color: var(--muted); font-size: 0.92rem; margin-top: 6px; }

input[type="file"] { display: none; }

/* ---------- previews ---------- */

.previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.preview {
  position: relative;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: #000;
  animation: pop 0.3s ease;
}

@keyframes pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.preview .remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.preview .bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 5px;
  width: 0%;
  background: linear-gradient(90deg, var(--mint), var(--gold), var(--gold-bright));
  transition: width 0.25s ease;
}

.preview.done .bar { background: var(--ok); width: 100% !important; }
.preview.failed .bar { background: var(--danger); width: 100% !important; }

.preview .state {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  background: rgba(0, 0, 0, 0.45);
}

.preview.done .state,
.preview.failed .state { display: flex; }

/* ---------- progreso global ---------- */

.progress {
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid var(--card-border);
}

.progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--mint));
  transition: width 0.3s ease;
}

.progress-label {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
}

/* ---------- galería ---------- */

.filters {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 18px 0 20px;
}

.count {
  font-weight: 700;
  color: var(--gold);
}

.masonry {
  column-count: 2;
  column-gap: 14px;
}

@media (min-width: 640px) { .masonry { column-count: 3; } }
@media (min-width: 960px) { .masonry { column-count: 4; } }

.shot {
  break-inside: avoid;
  margin-bottom: 14px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
  cursor: zoom-in;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shot:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.5);
}

.shot img {
  width: 100%;
  display: block;
  background: linear-gradient(100deg, #0c3527, #14523c, #0c3527);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.shot .meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 12px 10px;
  font-size: 0.84rem;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-end;
}

.shot:hover .meta,
.shot:focus-visible .meta { opacity: 1; }

.shot .who { font-weight: 700; }
.shot .when { color: var(--gold); white-space: nowrap; }

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(6, 4, 18, 0.94);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.lightbox.open { display: flex; animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.lightbox img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 16px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7);
}

.lightbox .lb-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

.lightbox .lb-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.lightbox .lb-info {
  position: absolute;
  top: 18px;
  left: 18px;
  font-weight: 700;
  color: var(--gold);
}

/* ---------- estados ---------- */

.empty {
  text-align: center;
  padding: 50px 18px;
  color: var(--muted);
  border: 2px dashed var(--card-border);
  border-radius: var(--radius);
}

.empty .big { font-size: 3rem; display: block; margin-bottom: 10px; }

.toast-zone {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(430px, 92vw);
}

.toast {
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(20, 12, 48, 0.96);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  font-size: 0.95rem;
  animation: up 0.25s ease;
  display: flex;
  gap: 10px;
  align-items: center;
}

.toast.error { border-color: rgba(255, 90, 95, 0.6); }
.toast.ok { border-color: rgba(61, 220, 151, 0.6); }

@keyframes up {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---------- admin ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 18px 16px;
  text-align: center;
}

.stat .n {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(120deg, var(--gold), var(--gold-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat .l { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; }

.admin-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.admin-actions .btn { flex: 1; min-width: 170px; }

.shot .actions {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: none;
  gap: 8px;
  justify-content: flex-end;
}

.shot:hover .actions,
.shot:focus-within .actions { display: flex; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: rgba(10, 6, 30, 0.85);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.icon-btn.del:hover { background: var(--danger); }

/* ---------- confeti canvas ---------- */

#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 110;
  display: none;
}

#confetti.on { display: block; }

/* ---------- dispositivos táctiles: sin hover ---------- */

@media (hover: none) {
  .shot .meta { opacity: 1; }
  .shot .actions { display: flex; }
}

/* ---------- footer ---------- */

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
  padding: 30px 0 10px;
}

/* ---------- responsive ---------- */

@media (min-width: 720px) {
  .card { padding: 34px 32px; }
  .dropzone { padding: 56px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
