/* ── Dog Savvy Howl-o-ween Contest — Dark Halloween theme ────────────────────
   Deep purples, pumpkin oranges, glassmorphism, spooky vibes. */

:root {
  --bg-dark: #0f0518;
  --bg-med: #221236;
  --bg-card: rgba(30, 15, 45, 0.75);
  --orange: #ff7518;
  --orange-deep: #cc5500;
  --green: #90ee90;
  --purple: #8a2be2;
  --purple-light: #b388ff;
  --text-main: #f5eefc;
  --text-muted: #bfa8d6;
  --white: #ffffff;
  --err: #ff6b6b;
  --font-display: 'Creepster', cursive;
  --font-body: 'Nunito Sans', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-med) 100%);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.page { display: flex; flex-direction: column; min-height: 100vh; }

.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 20px; }

main { flex: 1 0 auto; padding-bottom: 70px; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { 
  position: relative; 
  text-align: center; 
  padding: 100px 20px 80px; 
  background-image: linear-gradient(to bottom, rgba(15, 5, 24, 0.6), rgba(15, 5, 24, 1)), url('https://offertabs.s3.amazonaws.com/offer/bzyh8v/site/media/6ab6c0e2c5c470.42497344.jpg');
  background-size: cover;
  background-position: center;
  border-bottom: 2px solid rgba(255, 117, 24, 0.2);
  margin-bottom: 40px;
}

.badge {
  display: inline-block;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bg-dark);
  background: var(--orange);
  border-radius: 999px;
  padding: 8px 22px;
  margin-bottom: 20px;
  box-shadow: 0 6px 16px rgba(255, 117, 24, 0.55);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3rem, 10vw, 5.5rem);
  line-height: 1.05;
  color: var(--orange);
  text-shadow: 0 0 20px rgba(255, 117, 24, 0.4);
  letter-spacing: 0.02em;
}

.hero h1 .wiggle {
  color: var(--purple-light);
  display: inline-block;
  transform: rotate(-3deg);
  text-shadow: 0 0 20px rgba(179, 136, 255, 0.4);
}

.hero .sub {
  max-width: 600px;
  margin: 20px auto 0;
  color: var(--text-main);
  font-size: 1.15rem;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }

/* ── Prizes ───────────────────────────────────────────────────────── */
.prizes-section {
  text-align: center;
  margin-bottom: 40px;
}

.prizes-heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.5rem;
  color: var(--orange);
  letter-spacing: 0.05em;
  margin-bottom: 24px;
  text-shadow: 0 0 15px rgba(255, 117, 24, 0.3);
}

.prizes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.prize-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.prize-card:hover {
  transform: translateY(-5px);
}

.prize-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
  line-height: 1;
}

.prize-rank {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--purple-light);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.prize-desc {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--white);
  line-height: 1.4;
}

.card-gold { border-top: 4px solid #ffd700; background: linear-gradient(180deg, rgba(255,215,0,0.1) 0%, var(--bg-card) 100%); }
.card-silver { border-top: 4px solid #c0c0c0; background: linear-gradient(180deg, rgba(192,192,192,0.1) 0%, var(--bg-card) 100%); }
.card-bronze { border-top: 4px solid #cd7f32; background: linear-gradient(180deg, rgba(205,127,50,0.1) 0%, var(--bg-card) 100%); }

/* ── Tabs ─────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 6px 0 32px;
}

.tab {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 12px 34px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab:hover {
  background: rgba(255,255,255,0.1);
  color: var(--white);
}

.tab.is-active {
  background: var(--orange);
  color: var(--bg-dark);
  box-shadow: 0 0 15px rgba(255, 117, 24, 0.4);
}

/* ── Cards / form ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 34px 30px;
  max-width: 580px;
  margin: 0 auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.card h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.2rem;
  text-align: center;
  color: var(--purple-light);
  letter-spacing: 0.05em;
}

.card-sub { text-align: center; color: var(--text-muted); font-weight: 600; font-size: 0.95rem; margin: 6px 0 24px; }

/* Drop zone */
.drop {
  position: relative;
  border: 2px dashed rgba(255, 117, 24, 0.5);
  border-radius: 18px;
  background: rgba(255, 117, 24, 0.05);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 20px;
  transition: all 0.2s ease;
}

.drop:hover { 
  border-color: var(--orange); 
  background: rgba(255, 117, 24, 0.1); 
}

.drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

.drop-inner { text-align: center; padding: 26px 16px; }

.drop-icon { font-size: 2.6rem; display: block; margin-bottom: 8px; filter: drop-shadow(0 0 10px rgba(255,117,24,0.5)); }

.drop-text { font-weight: 700; color: var(--orange); }

.drop-hint { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

.preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Fields */
.field { margin-bottom: 18px; }

.field-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 20px; }

@media (min-width: 540px) { .field-grid { grid-template-columns: 1fr 1fr; } }

label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 8px; color: var(--text-main); }

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--white);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  min-height: 48px;
  transition: all 0.2s ease;
}

input:focus {
  outline: none;
  border-color: var(--orange);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 4px rgba(255, 117, 24, 0.2);
}

input::placeholder { color: var(--text-muted); opacity: 0.5; }

input.error { border-color: var(--err); }

.form-error { color: var(--err); font-weight: 700; font-size: 0.9rem; text-align: center; margin-top: 14px; }

/* My entry */
.my-photo-wrap { text-align: center; margin-bottom: 24px; }

.my-photo {
  max-width: 260px;
  width: 100%;
  border-radius: 14px;
  border: 4px solid var(--orange);
  box-shadow: 0 0 30px rgba(255, 117, 24, 0.3);
  transform: rotate(-2deg);
}

.my-caption { font-family: var(--font-display); font-size: 1.6rem; color: var(--orange); margin-top: 16px; letter-spacing: 0.05em; }

.share-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Notes */
.note {
  max-width: 580px;
  margin: 20px auto;
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(255, 117, 24, 0.15);
  border: 1px solid rgba(255, 117, 24, 0.4);
  color: var(--orange);
  font-weight: 700;
  text-align: center;
}

/* ── Gallery ──────────────────────────────────────────────────────── */
.gallery-head { text-align: center; margin-bottom: 30px; }

.gallery-head h2 { font-family: var(--font-display); font-weight: 400; font-size: 2.6rem; color: var(--orange); letter-spacing: 0.05em; text-shadow: 0 0 15px rgba(255,117,24,0.3); }

.gallery-sub { color: var(--text-muted); font-weight: 600; font-size: 1rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.pet-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 12px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.pet-card:hover { 
  transform: translateY(-6px); 
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6); 
  border-color: rgba(255, 117, 24, 0.3);
}

.pet-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: var(--bg-dark);
}

.pet-caption {
  font-weight: 800;
  font-size: 1.05rem;
  margin-top: 14px;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pet-author { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; }

.pet-votes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  gap: 8px;
}

.vote-count { font-weight: 800; font-size: 0.95rem; color: var(--orange); }

.vote-btn {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--bg-dark);
  background: var(--orange);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  min-height: 44px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vote-btn:hover { transform: scale(1.05); box-shadow: 0 0 15px rgba(255,117,24,0.4); }

.vote-btn.is-voted {
  background: rgba(255,255,255,0.1);
  color: var(--text-muted);
  cursor: default;
  transform: none;
  box-shadow: none;
}

/* Empty state */
.empty { text-align: center; padding: 60px 20px; background: rgba(0,0,0,0.2); border-radius: 20px; border: 1px dashed rgba(255,255,255,0.1); }

.empty-icon { font-size: 3.5rem; display: block; margin-bottom: 16px; filter: drop-shadow(0 0 15px rgba(255,255,255,0.2)); }

.empty p { font-size: 1.2rem; font-weight: 800; color: var(--white); }

.empty-sub { color: var(--text-muted); font-weight: 600; font-size: 1rem !important; margin: 8px 0 24px; }

.load-wrap { text-align: center; margin-top: 40px; }

/* ── Lightbox ─────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 5, 20, 0.95);
  backdrop-filter: blur(5px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lb-content {
  background: var(--bg-med);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 60px rgba(0,0,0,0.8);
}

.lb-img { width: 100%; max-height: 60vh; object-fit: contain; background: var(--bg-dark); }

.lb-meta { padding: 20px 24px 24px; }

.lb-caption { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; color: var(--orange); letter-spacing: 0.05em; }

.lb-author { color: var(--text-muted); font-weight: 600; font-size: 0.9rem; margin-top: 4px; }

.lb-actions { display: flex; align-items: center; gap: 16px; margin-top: 16px; }

.lb-votes { font-weight: 800; color: var(--orange); font-size: 1.1rem; }

.lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s;
  z-index: 10;
}
.lb-close:hover { color: var(--white); background: rgba(0,0,0,0.8); }

.lb-nav {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--white);
  font-size: 2.2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0 16px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-nav:hover { background: rgba(255, 117, 24, 0.2); border-color: var(--orange); color: var(--orange); }

/* ── Mobile Optimizations ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero { padding: 60px 16px 40px; }
  .hero h1 { font-size: 3.2rem; }
  .hero-cta { flex-direction: column; align-items: stretch; margin-top: 24px; }
  .hero-cta .btn { width: 100%; }
  
  .tabs { width: 100%; max-width: 100%; gap: 8px; }
  .tab { flex: 1 1 0%; padding: 12px 8px; font-size: 0.95rem; }
  
  .card { padding: 24px 16px; border-radius: 16px; }
  
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
  .pet-card { padding: 10px 10px 16px; }
  .pet-caption { font-size: 0.95rem; margin-top: 10px; }
  .pet-votes { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 10px; }
  .vote-btn { width: 100%; min-height: 48px; padding: 10px; }
  .vote-count { text-align: center; }
  
  .lightbox { padding: 16px 16px 100px 16px; align-items: center; }
  .lb-content { max-height: 100%; overflow-y: auto; display: flex; flex-direction: column; }
  .lb-img { max-height: 40vh; object-fit: contain; flex-shrink: 0; }
  .lb-meta { padding: 20px 16px; flex-shrink: 0; }
  .lb-caption { font-size: 1.3rem; }
  .lb-actions { flex-direction: column; gap: 12px; align-items: stretch; }
  .lb-actions .btn { width: 100%; }
  .lb-votes { text-align: center; }
  
  .lb-nav { position: fixed; bottom: 24px; top: auto; z-index: 250; background: rgba(255, 117, 24, 0.2); backdrop-filter: blur(8px); }
  .lb-prev { left: 24px; }
  .lb-next { right: 24px; }
  
  .lb-close { top: 12px; right: 12px; z-index: 250; }
  
  .share-row { flex-direction: column; gap: 12px; }
  .share-row .btn { width: 100%; }
  
  .drop { min-height: 160px; }
}


/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.05rem;
  padding: 14px 32px;
  min-height: 48px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.25;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none !important; }
.btn:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.btn-primary {
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  color: var(--bg-dark);
  box-shadow: 0 8px 24px rgba(255, 117, 24, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 12px 30px rgba(255, 117, 24, 0.5);
  filter: brightness(1.1);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-block { width: 100%; }

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 0, 0, 0.2);
  border-top-color: var(--bg-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  background: var(--err);
  color: #fff;
  padding: 16px 30px;
  border-radius: 12px;
  font-weight: 800;
  z-index: 300;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  max-width: 92vw;
  text-align: center;
}

.toast.toast-ok { background: var(--green); color: var(--bg-dark); }

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  margin-top: 20px;
}

.footer .disclaimer {
  margin-top: 12px;
  font-size: 0.8rem;
  opacity: 0.8;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.4;
}

#wbx-powered-by-slot { margin-top: 16px; }

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