* { box-sizing: border-box; }

:root {
  --text: #171717;
  --muted: #999;
  --line: #bdbdbd;
  --background: #fff;
}

html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--text); font-family: "Inter", Arial, sans-serif; }
button, input { font: inherit; }

.topbar {
  height: 86px; border: 1px solid var(--line); display: flex; align-items: center;
  justify-content: space-between; padding: 0 26px; position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
}
.brand { font-family: "Cormorant Garamond", Georgia, serif; font-size: 54px; font-style: italic; line-height: 1; font-weight: 500; display: inline-flex; align-items: center; }
.brand-logo { display: block; width: 132px; height: 70px; object-fit: contain; object-position: left center; }
.brand-btn { border: 0; padding: 0; background: transparent; cursor: pointer; }
.brand.big { font-size: 76px; }
.menu-btn { width: 42px; height: 42px; border: 0; background: transparent; display: grid; gap: 5px; align-content: center; cursor: pointer; }
.menu-btn span { display: block; width: 31px; height: 6px; border-radius: 8px; background: #aaa; }

.home-view { min-height: calc(100vh - 86px); }
.home-empty { padding: 28px 24px 60px; text-align: center; }
.home-empty h1 { font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(34px, 8vw, 58px); font-weight: 500; line-height: 1.05; margin: 0 0 28px; }
.upload-card {
  width: min(100%, 310px); min-height: 365px; border: 1.5px solid #777; border-radius: 27px;
  background: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 28px; cursor: pointer; margin: 0 auto; font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 31px; line-height: 1.05; transition: transform .2s, background .2s;
}
.upload-card:hover { transform: translateY(-2px); background: #fafafa; }
.upload-card:active { transform: translateY(0); }
.plus { width: 62px; height: 62px; border-radius: 50%; background: #bdbdbd; color: #777; font-family: Arial, sans-serif; font-size: 55px; font-weight: 300; line-height: 58px; }
.small-note { color: #777; font-size: 13px; line-height: 1.5; }
.home-empty .small-note { margin-top: 22px; }

.home-gallery-state { position: relative; padding: 25px 22px 90px; max-width: 1100px; margin: auto; }
.home-gallery-title { margin-bottom: 18px; }
.home-gallery-title h1 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 39px; font-weight: 500; margin: 0; }

.floating-upload {
  position: fixed; right: 18px; bottom: 22px; z-index: 25; border: 1px solid #999; background: #fff;
  border-radius: 18px; min-width: 74px; min-height: 74px; padding: 9px 12px 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.13); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1px; cursor: pointer; color: #222; font-size: 9px; letter-spacing: .08em; font-weight: 600;
}
.floating-plus { font-size: 31px; line-height: 28px; font-weight: 300; }
.floating-upload:hover { transform: translateY(-2px); }

.gallery-view, .profile-view, .more-view, .iconicas-view { padding: 25px 22px 60px; max-width: 1100px; margin: auto; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; margin-bottom: 18px; }
.section-title h2 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 39px; font-weight: 500; margin: 0; }
#photoCount, #galleryPhotoCount { color: #888; font-size: 13px; }
.masonry { columns: 2 170px; column-gap: 12px; }
.photo-card { break-inside: avoid; margin-bottom: 12px; position: relative; border-radius: 18px; overflow: hidden; background: #eee; }
.photo-card img { display: block; width: 100%; height: auto; }
.photo-info { position: absolute; inset: auto 0 0 0; padding: 34px 12px 10px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.62)); display: flex; justify-content: space-between; align-items: end; gap: 10px; }
.photo-name { font-size: 12px; text-shadow: 0 1px 3px #000; }
.photo-actions { display: flex; align-items: center; gap: 5px; }
.star-btn, .delete-btn { border: 0; background: transparent; color: #fff; line-height: 1; cursor: pointer; text-shadow: 0 1px 3px #000; }
.star-btn { font-size: 25px; padding: 2px; }
.star-btn.voted { color: #fff; }
.star-count { font-size: 11px; margin-left: 2px; vertical-align: middle; }
.delete-btn { font-size: 18px; padding: 5px; }
.delete-btn:hover, .star-btn:hover { opacity: .78; }

.more-card { border: 1px solid var(--line); border-radius: 24px; padding: 35px 28px; min-height: 300px; }
.profile-greeting { color: #555; margin-bottom: 20px; }
.empty-state { column-span: all; text-align: center; padding: 50px 20px; color: #777; }

.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.42); display: flex; justify-content: center; align-items: center; padding: 20px; }
.modal-box { width: min(100%, 430px); background: #fff; border-radius: 25px; padding: 32px 25px 26px; position: relative; box-shadow: 0 15px 50px rgba(0,0,0,.18); }
.modal-box h2 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 34px; font-weight: 500; margin: 0 0 10px; }
.modal-box p { color: #555; line-height: 1.45; }
.modal-box input { width: 100%; border: 1px solid #aaa; border-radius: 13px; padding: 14px; font-size: 16px; margin: 12px 0; outline: none; }
.modal-box input:focus { border-color: #555; }
.primary-btn { width: 100%; border: 0; border-radius: 13px; padding: 15px; background: #222; color: #fff; font-weight: 600; cursor: pointer; }
.primary-btn:disabled { opacity: .55; cursor: wait; }
.close { position: absolute; top: 10px; right: 16px; border: 0; background: transparent; font-size: 30px; cursor: pointer; }

.menu-panel { position: fixed; top: 86px; right: 0; z-index: 40; width: min(82vw, 350px); padding: 20px 25px 30px; background: #fff; border: 1px solid var(--line); border-top: 0; transform: translateX(105%); transition: transform .25s ease; box-shadow: 0 15px 35px rgba(0,0,0,.08); }
.menu-panel.open { transform: translateX(0); }
.menu-panel button { display: block; width: 100%; text-align: left; padding: 17px 0; background: transparent; border: 0; border-bottom: 1px solid #ddd; font-family: "Cormorant Garamond", Georgia, serif; font-size: 20px; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: 25px; transform: translate(-50%, 20px); background: #222; color: #fff; padding: 13px 18px; border-radius: 12px; opacity: 0; pointer-events: none; transition: .25s; z-index: 80; font-size: 13px; max-width: min(90vw, 500px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.hidden { display: none !important; }

@media (min-width: 700px) {
  .masonry { columns: 3 210px; }
  .home-empty { padding-top: 42px; }
  .floating-upload { right: 28px; bottom: 28px; }
}


/* Entrada suave de las fotos al hacer scroll */
.photo-reveal {
  opacity: 0;
  transform: translateY(42px);
  transition: opacity .7s ease var(--reveal-delay, 0ms), transform .7s cubic-bezier(.22, .61, .36, 1) var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.photo-reveal.photo-reveal-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .photo-reveal, .photo-reveal.photo-reveal-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.photo-card-clickable { cursor: zoom-in; }
.photo-card-clickable:focus-visible { outline: 2px solid #555; outline-offset: 3px; }
.photo-lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center; padding: 24px; }
.lightbox-content { max-width: 94vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lightbox-content img { max-width: 94vw; max-height: 84vh; width: auto; height: auto; object-fit: contain; border-radius: 10px; box-shadow: 0 18px 60px rgba(0,0,0,.35); }
.lightbox-caption { color: #fff; font-size: 13px; text-align: center; }
.lightbox-close { position: absolute; top: 16px; right: 18px; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 34px; line-height: 1; cursor: pointer; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border: 0; border-radius: 16px; background: rgba(255,255,255,.14); color: #fff; font-size: 46px; line-height: 1; cursor: pointer; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255,255,255,.24); }
.lightbox-open { overflow: hidden; }
@media (max-width: 600px) { .photo-lightbox { padding: 12px; } .lightbox-content img { max-width: 96vw; max-height: 82vh; border-radius: 7px; } .lightbox-nav { width: 42px; height: 54px; font-size: 38px; } .lightbox-prev { left: 7px; } .lightbox-next { right: 7px; } }

.confirm-photo-box { max-width: 440px; }
.confirm-photo-preview-wrap { width: 100%; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: #f2f2f2; margin-bottom: 18px; }
.confirm-photo-preview { width: 100%; height: 100%; object-fit: cover; display: block; }
.confirm-photo-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; margin-top: 16px; }
.secondary-btn { width: 100%; border: 1px solid #bbb; border-radius: 13px; padding: 15px; background: #fff; color: #222; font-weight: 600; cursor: pointer; }
.secondary-btn:hover { background: #f6f6f6; }
@media (max-width: 480px) { .confirm-photo-actions { grid-template-columns: 1fr; } }


/* =========================
   ESTÉTICA MORENA / DISCO
   ========================= */
:root {
  --text: #f4f6f5;
  --muted: rgba(226, 235, 233, .62);
  --line: rgba(197, 224, 221, .30);
  --background: #06100f;
  --panel: rgba(7, 19, 18, .72);
  --teal: #9de7df;
}

html, body { background: var(--background); }
body {
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(93, 180, 171, .12), transparent 34%),
    radial-gradient(circle at 0% 55%, rgba(70, 151, 144, .07), transparent 27%),
    linear-gradient(180deg, #071211 0%, #030908 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .22;
  background-image: radial-gradient(rgba(255,255,255,.11) .7px, transparent .7px);
  background-size: 5px 5px;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

main, .topbar, .menu-panel, .modal, .toast, .photo-lightbox { position: relative; z-index: 1; }

.topbar {
  height: 82px;
  border: 0;
  border-bottom: 1px solid rgba(201, 226, 223, .18);
  padding: 0 22px;
  background: rgba(3, 10, 9, .68);
  backdrop-filter: blur(14px);
}
.brand-logo { width: 142px; height: 68px; }
.menu-btn span { background: rgba(232, 239, 238, .72); height: 4px; width: 30px; }

.party-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.disco-ball {
  position: absolute;
  width: 190px;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: .18;
  filter: blur(.15px);
  background:
    radial-gradient(circle at 32% 25%, rgba(255,255,255,.95) 0 2%, transparent 7%),
    radial-gradient(circle at 62% 18%, rgba(214,255,250,.85) 0 2%, transparent 7%),
    radial-gradient(circle at 74% 43%, rgba(255,255,255,.75) 0 2%, transparent 7%),
    radial-gradient(circle at 28% 63%, rgba(196,239,235,.72) 0 2%, transparent 7%),
    radial-gradient(circle at 58% 72%, rgba(255,255,255,.72) 0 2%, transparent 7%),
    radial-gradient(circle at 48% 48%, rgba(235,250,248,.42), rgba(44,90,86,.18) 46%, rgba(0,0,0,.5) 72%),
    repeating-linear-gradient(0deg, transparent 0 13px, rgba(226,255,251,.22) 14px 15px, transparent 16px 28px),
    repeating-linear-gradient(90deg, transparent 0 13px, rgba(226,255,251,.20) 14px 15px, transparent 16px 28px);
  box-shadow: inset -22px -26px 38px rgba(0,0,0,.48), inset 12px 8px 22px rgba(255,255,255,.18), 0 0 48px rgba(118,224,215,.08);
}
.disco-ball::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 70px;
  left: 50%;
  bottom: 98%;
  background: linear-gradient(rgba(215,238,235,.35), transparent);
  opacity: .45;
}
.disco-ball-a { width: 170px; left: -78px; top: 130px; }
.disco-ball-b { width: 210px; right: -112px; top: 245px; }
.disco-ball-c { width: 145px; left: -72px; bottom: 145px; }
.disco-ball-d { width: 175px; right: -82px; bottom: 40px; }

.light-streak {
  position: absolute;
  width: 420px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(160,239,232,.30), transparent);
  filter: blur(.4px);
  opacity: .28;
}
.streak-a { top: 34%; left: -100px; transform: rotate(62deg); }
.streak-b { right: -110px; top: 66%; transform: rotate(-55deg); }

.home-empty {
  padding: 28px 20px 52px;
  min-height: calc(100vh - 82px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}
.home-empty h1 {
  max-width: 620px;
  margin: 18px 0 22px;
  font-size: clamp(32px, 7vw, 48px);
  color: #f4f6f5;
  text-shadow: 0 2px 18px rgba(100,220,211,.10);
}
.home-empty h1 br { display: none; }

.upload-card {
  width: min(100%, 275px);
  min-height: 285px;
  border: 1px solid rgba(193, 235, 230, .38);
  border-radius: 24px;
  background: rgba(7, 22, 20, .72);
  color: #f4f7f6;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 18px 55px rgba(0,0,0,.22);
  backdrop-filter: blur(12px);
  gap: 18px;
  font-size: 29px;
}
.upload-card:hover { background: rgba(12, 34, 31, .82); border-color: rgba(166, 239, 231, .55); }
.upload-card .plus {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: transparent;
  border: 1px dashed rgba(168, 233, 226, .55);
  color: #fff;
  font-size: 60px;
  line-height: 70px;
}
.small-note { color: var(--muted); }

.home-gallery-state, .gallery-view, .profile-view, .iconicas-view { max-width: 1120px; }
.home-gallery-state { padding-top: 26px; }
.home-gallery-title h1, .section-title h2 { color: #f3f6f5; }
.section-title h2 { font-size: 36px; }

.home-upload-btn {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  min-height: 44px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid rgba(190, 235, 231, .45);
  background: rgba(6, 20, 18, .82); color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.22), inset 0 0 16px rgba(110,220,210,.05);
  backdrop-filter: blur(12px); cursor: pointer;
  font-size: 10px; letter-spacing: .09em; font-weight: 600;
}
.home-upload-btn span { font-size: 25px; line-height: 18px; font-weight: 300; }
.home-upload-btn:hover { transform: translateY(-1px); border-color: rgba(166, 239, 231, .65); }

.masonry { column-gap: 14px; }
.photo-card {
  border: 1px solid rgba(201, 231, 228, .18);
  border-radius: 18px;
  background: #0a1716;
  box-shadow: 0 10px 30px rgba(0,0,0,.20);
}
.photo-card img { filter: saturate(.94) contrast(1.03); }
.photo-info { background: linear-gradient(transparent, rgba(0,0,0,.76)); }

.floating-upload {
  width: 78px;
  height: 78px;
  min-width: 78px;
  min-height: 78px;
  padding: 8px;
  border-radius: 50%;
  border: 1px solid rgba(190, 235, 231, .45);
  background: rgba(6, 20, 18, .82);
  color: #fff;
  box-shadow: 0 10px 34px rgba(0,0,0,.34), inset 0 0 20px rgba(110,220,210,.05);
  backdrop-filter: blur(12px);
}
.floating-plus { font-size: 34px; }

.menu-panel {
  top: 82px;
  color: #f4f6f5;
  background: rgba(5, 16, 15, .94);
  border: 1px solid rgba(198, 229, 226, .20);
  border-top: 0;
  backdrop-filter: blur(18px);
}
.menu-panel button { color: #f4f6f5; border-bottom-color: rgba(206,231,228,.15); }

.modal { background: rgba(0, 0, 0, .66); backdrop-filter: blur(5px); }
.modal-box {
  background: rgba(7, 20, 19, .96);
  border: 1px solid rgba(195, 230, 226, .24);
  color: #f4f6f5;
}
.modal-box p { color: rgba(232, 239, 237, .68); }
.modal-box input { background: rgba(255,255,255,.05); color: #fff; border-color: rgba(205,231,228,.26); }
.modal-box input::placeholder { color: rgba(230,240,238,.42); }
.primary-btn { background: #e9f2f0; color: #07100f; }
.secondary-btn { background: transparent; color: #f4f6f5; border-color: rgba(205,231,228,.28); }
.close { color: #fff; }

.photo-lightbox { background: rgba(0, 5, 5, .92); }

@media (max-width: 600px) {
  .topbar { height: 76px; }
  .home-gallery-title { align-items: center; }
  .home-gallery-title h1 { font-size: 31px; }
  .home-upload-btn { padding: 7px 11px; font-size: 9px; }
  .home-upload-btn span { font-size: 22px; }
  .menu-panel { top: 76px; }
  .brand-logo { width: 128px; height: 62px; }
  .home-empty { padding-top: 20px; }
  .home-empty h1 { margin-top: 10px; margin-bottom: 18px; font-size: 34px; }
  .upload-card { min-height: 255px; width: min(88vw, 270px); }
  .disco-ball-a { width: 130px; left: -65px; top: 105px; }
  .disco-ball-b { width: 150px; right: -82px; top: 260px; }
  .disco-ball-c { width: 120px; left: -68px; bottom: 180px; }
  .disco-ball-d { width: 135px; right: -72px; bottom: 55px; }
}


/* FIXES: keep the hamburger drawer fixed above the page */
.menu-panel { position: fixed !important; z-index: 60 !important; }
.topbar { z-index: 55 !important; }


/* LIGHTBOX DEFINITIVO: la foto ampliada queda centrada en la ventana */
.photo-lightbox {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw;
  height: 100vh;
  z-index: 9999 !important;
  display: flex;
  align-items: center !important;
  justify-content: center !important;
}
.photo-lightbox.hidden { display: none !important; }
.lightbox-content {
  position: relative;
  width: min(94vw, 1000px);
  max-width: 94vw;
  max-height: 90vh;
  margin: auto;
  align-items: center;
  justify-content: center;
}
.lightbox-content img {
  display: block;
  max-width: 94vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: auto;
}

/* FIX DEFINITIVO: los modales deben cubrir toda la pantalla y quedar centrados */
.modal {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw;
  height: 100vh;
  z-index: 9998 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.modal.hidden { display: none !important; }
