*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: 'Poppins', sans-serif; background: #08081a; color: #e8e4ff; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

/* ── Canvas thumbnail system ──────────────────────────────────── */
.card-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
  border-radius: 0.875rem;
  background: #0d0d28;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.card-thumb:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 0 1.5px rgba(255,107,53,0.4);
}
.card-thumb canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.4s ease;
  display: block;
}
.card-thumb canvas.fg-loaded { opacity: 1; }
.card-thumb__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.card-thumb--shimmer {
  background: linear-gradient(90deg, #0d0d28 25%, #1c1c4a 50%, #0d0d28 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
.card-thumb__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.22s ease;
  z-index: 2;
}
.card-thumb:hover .card-thumb__overlay { opacity: 1; }
.card-thumb__cta {
  color: #FF6B35;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1.1rem;
  border-radius: 9999px;
  border: 1px solid rgba(255,107,53,0.55);
  background: rgba(8,8,26,0.6);
  backdrop-filter: blur(4px);
  letter-spacing: 0.02em;
}
.card-thumb__label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 2rem 0.75rem 0.55rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.82));
  color: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  z-index: 1;
}

/* ── Nav dropdown (aria-expanded toggled by JS) ───────────────── */
.nav__dropdown { position: relative; }
.nav__dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.625rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 215px;
  background: rgba(6,6,20,0.97);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255,215,0,0.12);
  border-radius: 0.875rem;
  padding: 0.5rem;
  z-index: 300;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
}
.nav__dropdown-btn[aria-expanded="true"] + .nav__dropdown-menu { display: block; }
.nav__dropdown-item {
  display: block;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  color: rgba(255,255,255,0.72);
  font-size: 0.84rem;
  transition: background 0.12s, color 0.12s;
}
.nav__dropdown-item:hover { background: rgba(255,215,0,0.1); color: #FFD700; }

/* ── Mobile nav ───────────────────────────────────────────────── */
@media (max-width: 767px) {
  #nav-links {
    display: none;
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: rgba(6,6,20,0.98);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255,215,0,0.1);
    padding: 1rem 1.25rem 1.5rem;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 200;
  }
  #main-nav.nav-open #nav-links { display: flex; }
  .nav__dropdown-menu {
    position: static;
    transform: none;
    background: rgba(255,255,255,0.04);
    border: none;
    border-radius: 0.5rem;
    box-shadow: none;
    backdrop-filter: none;
    margin-top: 0.25rem;
  }
  .nav__hamburger-line {
    display: block;
    width: 22px; height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.2s;
  }
}
@media (min-width: 768px) {
  #nav-links { display: flex !important; align-items: center; gap: 1.75rem; position: static; background: none; border: none; padding: 0; flex-direction: row; }
}

/* ── Buttons (used in main.js and static HTML) ────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.625rem 1.4rem;
  border-radius: 9999px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
  border: none;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, #FF6B35, #E85D00);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255,107,53,0.4);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(255,107,53,0.55); }
.btn-outline {
  background: transparent;
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-outline:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,215,0,0.4); color: #FFD700; }
.btn-whatsapp {
  background: linear-gradient(135deg, #25D366, #1DA851);
  color: #fff;
  font-size: 1rem;
  padding: 0.75rem 1.75rem;
  box-shadow: 0 4px 20px rgba(37,211,102,0.35);
}
.btn-whatsapp:hover { box-shadow: 0 6px 28px rgba(37,211,102,0.5); }
.btn-download {
  background: linear-gradient(135deg, #3a3a6a, #1a1a40);
  color: #fff;
  font-size: 1rem;
  padding: 0.75rem 1.75rem;
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-copy {
  background: linear-gradient(135deg, #1a3a4a, #0a1e2a);
  color: #fff;
  font-size: 1rem;
  padding: 0.75rem 1.75rem;
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-copy:hover { box-shadow: 0 6px 28px rgba(79,195,247,0.35); }

/* ── Field clear button ───────────────────────────────────────── */
.field-wrap { position: relative; }
.clear-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.25);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  transition: color 0.15s;
}
.clear-btn:hover { color: rgba(255,255,255,0.65); }

/* ── Upcoming section (main.js injected HTML) ─────────────────── */
.upcoming-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,215,0,0.1);
  border-radius: 1.25rem;
  padding: 1.5rem;
  max-width: 680px;
  margin: 0 auto;
}
@media (max-width: 540px) {
  .upcoming-feature { grid-template-columns: 1fr; }
}
.upcoming-feature__thumb {
  aspect-ratio: 1;
  border-radius: 0.875rem;
  overflow: hidden;
  width: 100%;
}
.upcoming-feature__info { display: flex; flex-direction: column; gap: 0.625rem; }
.upcoming-feature__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent, #FFD700);
}
.upcoming-feature__name {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.upcoming-feature__days {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.2rem 0.75rem;
  border-radius: 9999px;
  background: rgba(255,215,0,0.1);
  color: #FFD700;
  border: 1px solid rgba(255,215,0,0.2);
}
.upcoming-feature__desc { font-size: 0.875rem; color: rgba(255,255,255,0.55); line-height: 1.6; }
.upcoming-feature__actions { display: flex; gap: 0.625rem; flex-wrap: wrap; margin-top: 0.25rem; }

.upcoming-banner {
  display: flex;
  gap: 0.625rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.upcoming-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4rem 0.875rem;
  border-radius: 9999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.upcoming-pill:hover { background: rgba(255,215,0,0.1); border-color: rgba(255,215,0,0.25); color: #FFD700; }
.days-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,215,0,0.7);
}

/* ── Festival card badge (main.js injected) ───────────────────── */
.festival-card__badge {
  position: absolute;
  top: 0.625rem; right: 0.625rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background: rgba(255,215,0,0.2);
  color: #FFD700;
  border: 1px solid rgba(255,215,0,0.3);
}
.festival-card__badge--trending { background: rgba(255,107,53,0.2); color: #FF6B35; border-color: rgba(255,107,53,0.35); }
.festival-card__badge--new { background: rgba(39,174,96,0.2); color: #2ecc71; border-color: rgba(39,174,96,0.35); }

/* ── Animate on scroll ────────────────────────────────────────── */
.animate-on-scroll { opacity: 0; transform: translateY(24px); transition: opacity 0.5s ease, transform 0.5s ease; }
.animate-on-scroll.visible { opacity: 1; transform: none; }

/* ── Festival grid card gloss & glow ──────────────────────────── */
.festival-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 55%;
  background: linear-gradient(180deg, rgba(255,255,255,0.14) 0%, transparent 100%);
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
}
.festival-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), inset 0 -1px 0 rgba(0,0,0,0.35);
  pointer-events: none;
  z-index: 1;
}
.festival-card > div { position: relative; z-index: 2; }
.festival-card:hover {
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,215,0,0.3) !important;
}

/* ── Ad unit placeholder — hidden until AdSense approved ─────── */
.ad-unit {
  display: none;
}

/* ── Editor-specific ──────────────────────────────────────────── */
#card-canvas { width: 100%; height: auto; display: block; border-radius: 0.875rem; }
.text-pos-track { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.text-pos-vertical { writing-mode: vertical-lr; height: 200px; accent-color: #FF6B35; cursor: pointer; }
.pos-icon { font-size: 0.65rem; color: rgba(255,255,255,0.3); }
.pos-value { font-size: 0.7rem; color: rgba(255,255,255,0.4); }
.format-toggle { display: flex; gap: 0.5rem; }
.format-btn {
  flex: 1;
  padding: 0.5rem 0.625rem;
  border-radius: 0.5rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: all 0.14s;
  font-family: 'Poppins', sans-serif;
}
.format-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.format-btn.active { background: rgba(255,107,53,0.14); border-color: rgba(255,107,53,0.45); color: #FF6B35; }
.color-picker-row { display: flex; align-items: center; gap: 0.625rem; flex-wrap: wrap; }
.color-swatch { width: 2rem; height: 2rem; border-radius: 9999px; border: 2px solid rgba(255,255,255,0.15); cursor: pointer; transition: transform 0.14s, border-color 0.14s; }
.color-swatch:hover, .color-swatch.active { transform: scale(1.2); border-color: #FF6B35; }
.share-hint {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.75rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.5;
}
.format-hint { font-size: 0.75rem; color: rgba(255,255,255,0.35); margin-top: 0.35rem; }

/* ── Tap-to-type canvas hint ──────────────────────────────────── */
.tap-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8,8,26,0.82);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,215,0,0.25);
  color: rgba(255,255,255,0.8);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.3s;
}
.tap-hint.is-hidden { opacity: 0; }

/* ── Bottom sheet ────────────────────────────────────────────── */
.tap-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 299;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s;
}
.tap-sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.tap-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  background: #0f0f2a;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px 20px 0 0;
  padding: 0 16px 32px;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.34,1.2,0.64,1);
  max-height: 85vh;
  overflow-y: auto;
}
.tap-sheet.is-open { transform: translateY(0); }
.tap-sheet__handle {
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,0.18);
  border-radius: 2px;
  margin: 12px auto 16px;
}
.tap-sheet__inner { display: flex; flex-direction: column; gap: 10px; }
.tap-sheet__input {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 12px 14px;
  color: #fff;
  font-size: 1rem;
  font-family: 'Poppins', sans-serif;
  resize: none;
  outline: none;
  transition: border-color 0.15s;
}
.tap-sheet__input:focus { border-color: rgba(255,107,53,0.5); }
.tap-sheet__input--message { font-size: 0.9rem; }
.tap-sheet__done {
  width: 100%;
  background: linear-gradient(135deg, #FF6B35, #C0392B);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  margin-top: 4px;
  transition: opacity 0.15s;
}
.tap-sheet__done:active { opacity: 0.85; }
