:root {
  --bg: #FDFBF7;
  --surface: #F6F2EA;
  --white: #FFFFFF;
  --gold: #C59B38;
  --gold-light: #E3C578;
  --gold-dark: #9E7627;
  --ink: #2B2621;
  --muted: #6E655B;
  --pine: #2F4F3E;
  --danger: #B43E3E;
  --border: rgba(197, 155, 56, 0.28);
  --shadow: 0 10px 30px rgba(43, 38, 33, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Montserrat', system-ui, sans-serif;
  background: radial-gradient(circle at top, #FFFDF9 0%, var(--bg) 55%, #F2ECE0 100%);
  color: var(--ink);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* Fondo sutil invernal */
.snow-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(197, 155, 56, 0.12) 0 2px, transparent 3px),
    radial-gradient(circle at 80% 15%, rgba(197, 155, 56, 0.1) 0 3px, transparent 4px),
    radial-gradient(circle at 50% 70%, rgba(197, 155, 56, 0.08) 0 2px, transparent 3px);
  z-index: 0;
}

/* Barra superior */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(253, 251, 247, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-snowflake { font-size: 1.6rem; color: var(--gold); }
.brand-title {
  display: block;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold-dark);
}
.brand-sub { display: block; font-size: 0.72rem; color: var(--muted); }

.nav-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-btn {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.nav-btn.active, .nav-btn:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--white);
  border-color: transparent;
}

.user-pill { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--gold-light);
}
.user-name { font-size: 0.85rem; font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.container {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

/* Tarjeta Hero + Contador */
.hero-card {
  text-align: center;
  padding: 32px 20px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--white) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.hero-kicker {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dark);
}
.hero-script {
  margin: 6px 0 8px;
  font-family: 'Great Vibes', cursive;
  font-size: clamp(2.8rem, 7vw, 4.4rem);
  font-weight: 400;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light), var(--gold-dark));
  -webkit-background-clip: text;
  color: transparent;
  line-height: 1.1;
}
.hero-desc { max-width: 620px; margin: 0 auto 20px; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

.countdown {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid var(--border);
}
.cd-unit { min-width: 54px; text-align: center; }
.cd-unit span {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-dark);
}
.cd-unit small { font-size: 0.68rem; text-transform: uppercase; color: var(--muted); }
.cd-sep { font-weight: 700; color: var(--gold); font-size: 1.2rem; }

.reveal-banner {
  margin: 14px auto 0;
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pine), #213B2D);
  color: var(--white);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Tarjetas y botones */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.login-card { max-width: 480px; margin: 24px auto; text-align: center; }
.google-slot { display: flex; justify-content: center; margin-top: 18px; min-height: 44px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.98); }

.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: var(--white); }
.btn-pine { background: var(--pine); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--ink); }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; border-radius: 8px; }

/* Barra de cuota y subida */
.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.panel-header h2 { margin: 0; font-family: 'Cinzel', serif; color: var(--gold-dark); font-size: 1.3rem; }

.quota-badge {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gold-dark);
}

.upload-zone {
  border: 2px dashed var(--gold);
  border-radius: 14px;
  padding: 20px;
  background: var(--surface);
  margin-bottom: 22px;
  display: grid;
  gap: 12px;
}
.upload-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

input[type="text"], input[type="search"], textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--white);
  color: var(--ink);
}
input:focus, textarea:focus { outline: 2px solid var(--gold-light); border-color: var(--gold); }

/* Cuadrículas de fotos (Mis Fotos y Moderación) */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.photo-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 14px rgba(43, 38, 33, 0.05);
}
.photo-thumb-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
}
.photo-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}
.photo-thumb-wrap:hover img { transform: scale(1.04); }

.photo-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.photo-caption { margin: 0; font-size: 0.86rem; color: var(--ink); word-break: break-word; }
.photo-meta { font-size: 0.75rem; color: var(--muted); word-break: break-all; }
.photo-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }

.badge-featured {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(197, 155, 56, 0.92);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}
.badge-blocked {
  display: inline-block;
  background: #FDECEC;
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

/* Tabla de usuarios Admin */
.admin-subtabs { display: flex; gap: 8px; margin-bottom: 16px; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.admin-table th { color: var(--gold-dark); font-family: 'Cinzel', serif; font-size: 0.8rem; }

/* Modales y Lightbox */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(20, 17, 14, 0.8); backdrop-filter: blur(4px); }
.modal-box, .lightbox-content {
  position: relative;
  z-index: 2;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  max-width: 520px;
  width: 100%;
  padding: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.lightbox-content {
  max-width: 920px;
  background: #171411;
  color: var(--white);
  padding: 14px;
  text-align: center;
}
.lightbox-content img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 10px;
  object-fit: contain;
}
.lightbox-meta { padding: 10px 6px 4px; }
.lightbox-caption { margin: 0; font-size: 0.96rem; }
.lightbox-extra { color: var(--gold-light); font-size: 0.78rem; }

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: var(--white);
  font-size: 1rem;
  cursor: pointer;
}

.error-text { color: var(--danger); font-size: 0.85rem; font-weight: 600; }
.empty-state { text-align: center; padding: 36px 16px; color: var(--muted); }

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--pine); }

@media (max-width: 640px) {
  .topbar { padding: 10px 14px; }
  .hero-card { padding: 24px 14px; }
  .cd-unit { min-width: 44px; }
  .cd-unit span { font-size: 1.25rem; }
}