/* ==========================================================================
   PIÑATA PUEBLO — SITE OFFICIEL TEMPORAIRE (COMING SOON)
   Design System & Styling Festif Mexicain Premium
   ========================================================================== */

:root {
  /* Palette de couleurs mexicaine authentique */
  --fiesta-pink: #ff2a7a;
  --fiesta-yellow: #feca57;
  --fiesta-orange: #ff9f43;
  --fiesta-cyan: #00d2d3;
  --fiesta-green: #2ed573;
  --fiesta-purple: #9b59b6;
  --fiesta-red: #ff4757;

  /* Teintes d'ambiance et surfaces */
  --bg-dark-base: #120c1a;
  --card-bg: rgba(22, 15, 32, 0.82);
  --card-border: rgba(254, 202, 87, 0.38);
  --card-border-glow: rgba(254, 202, 87, 0.22);
  --text-main: #fdfbf7;
  --text-muted: #dcd6cd;
  --text-gold: #ffd369;

  /* Typographie */
  --font-display: 'Fredoka', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Élévations et ombres */
  --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 40px rgba(255, 159, 67, 0.15);
  --shadow-piñata: 0 15px 35px rgba(0, 0, 0, 0.5);

  /* Transitions */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.25, 1, 0.5, 1);
}

/* Reset & Normalisation */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-dark-base);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ==========================================================================
   ARRIÈRE-PLAN PUEBLO & AMBIANCE FESTIVE
   ========================================================================== */

.pueblo-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/assets/bg_pueblo.webp');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  z-index: -2;
  filter: brightness(0.65) saturate(1.25) contrast(1.05);
  transform: scale(1.02);
  transition: transform 12s ease-out;
}

.fiesta-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at 50% 35%,
    rgba(255, 159, 67, 0.15) 0%,
    rgba(18, 12, 26, 0.55) 60%,
    rgba(12, 8, 18, 0.92) 100%
  );
  z-index: -1;
  pointer-events: none;
}

/* ==========================================================================
   GUIRLANDE PAPEL PICADO (FANIONS ARTISANAUX)
   ========================================================================== */

.papel-picado-garland {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.garland-rope {
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #b07d4b, #e0a96d, #8d5c32, #e0a96d, #b07d4b);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  border-radius: 2px;
}

.flags-container {
  display: flex;
  justify-content: space-around;
  width: 102%;
  margin-left: -1%;
  padding-top: 1px;
}

.papel-flag {
  flex: 0 1 110px;
  max-width: 110px;
  min-width: 55px;
  transform-origin: top center;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.flag-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Animations de balancement naturel au gré du vent */
.sway-1 {
  animation: flagSway1 4.2s ease-in-out infinite alternate;
}
.sway-2 {
  animation: flagSway2 3.8s ease-in-out infinite alternate 0.6s;
}
.sway-3 {
  animation: flagSway3 4.6s ease-in-out infinite alternate 1.2s;
}

@keyframes flagSway1 {
  0% { transform: rotate(0deg) skewX(0deg); }
  50% { transform: rotate(3.5deg) skewX(2deg); }
  100% { transform: rotate(-2.5deg) skewX(-1.5deg); }
}

@keyframes flagSway2 {
  0% { transform: rotate(-2deg) skewX(-1deg); }
  50% { transform: rotate(3deg) skewX(2.5deg); }
  100% { transform: rotate(0.5deg) skewX(-0.5deg); }
}

@keyframes flagSway3 {
  0% { transform: rotate(1.5deg) skewX(1deg); }
  50% { transform: rotate(-3.5deg) skewX(-2deg); }
  100% { transform: rotate(2deg) skewX(1.5deg); }
}

/* ==========================================================================
   EN-TÊTE & SÉLECTEUR DE LANGUE DISCRET
   ========================================================================== */

.fiesta-header {
  position: relative;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) 1.5rem 0.5rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.brand-capsule {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(22, 15, 32, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  border: 1px solid rgba(254, 202, 87, 0.3);
  box-shadow: 0 4px 15px rgba(0,0,0,0.35);
}

.brand-icon {
  font-size: 1.25rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #fff, var(--fiesta-yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lang-selector-pills {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(22, 15, 32, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.25rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 15px rgba(0,0,0,0.35);
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s var(--ease-smooth);
}

.lang-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--fiesta-yellow);
  outline-offset: 2px;
}

.lang-btn.active {
  background: linear-gradient(135deg, var(--fiesta-pink), var(--fiesta-orange));
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(255, 42, 122, 0.45);
}

.lang-sep {
  color: rgba(255, 255, 255, 0.28);
  font-size: 0.78rem;
  font-weight: 600;
  user-select: none;
  pointer-events: none;
  line-height: 1;
  padding: 0 0.1rem;
}

/* ==========================================================================
   ZONE PRINCIPALE & HERO STAGE
   ========================================================================== */

.fiesta-main {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.25rem 2rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  gap: 1.5rem;
}

/* Scène de la Piñata suspendue */
.hero-stage {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0.5rem;
  min-height: 240px;
}

.piñata-rig {
  position: relative;
  width: 260px;
  height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  touch-action: manipulation;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}

.piñata-rig:focus-visible {
  border-radius: 20px;
  outline: 3px dashed var(--fiesta-yellow);
  outline-offset: 8px;
}

/* Corde tressée suspendue */
.hanging-rope {
  position: absolute;
  top: -80px;
  width: 5px;
  height: 100px;
  background: repeating-linear-gradient(
    45deg,
    #d1a054,
    #d1a054 6px,
    #7a4d1e 6px,
    #7a4d1e 12px
  );
  box-shadow: 1px 2px 4px rgba(0,0,0,0.5);
  border-radius: 2px;
  z-index: 1;
}

/* Pendule de la piñata */
.piñata-pendulum {
  position: relative;
  width: 220px;
  height: 220px;
  margin-top: 15px;
  transform-origin: 50% -20px;
  animation: piñataFloat 4.8s ease-in-out infinite alternate;
  transition: transform 0.2s var(--ease-bounce);
  z-index: 2;
}

/* Halo festif doré derrière la piñata */
.piñata-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(254, 202, 87, 0.45) 0%, rgba(255, 42, 122, 0.2) 50%, transparent 75%);
  filter: blur(16px);
  border-radius: 50%;
  pointer-events: none;
  animation: glowPulse 3.5s ease-in-out infinite alternate;
}

.piñata-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.65));
  pointer-events: none;
}

/* Petit sombrero festif posé sur la corne supérieure */
.piñata-sombrero-accent {
  position: absolute;
  top: 5px;
  left: 55%;
  transform: translate(-50%, -40%) rotate(18deg);
  width: 80px;
  height: auto;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.55));
  pointer-events: none;
}

/* Ombre au sol */
.piñata-shadow {
  position: absolute;
  bottom: 0;
  width: 130px;
  height: 20px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6) 0%, transparent 70%);
  border-radius: 50%;
  animation: shadowScale 4.8s ease-in-out infinite alternate;
  z-index: 0;
}

/* Bulle d'indication tactile */
.tap-hint {
  position: absolute;
  bottom: -15px;
  background: rgba(22, 15, 32, 0.9);
  border: 1px solid var(--fiesta-yellow);
  color: var(--fiesta-yellow);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  pointer-events: none;
  animation: hintBounce 2.5s ease-in-out infinite;
  white-space: nowrap;
}

/* Animation lors du clic sur la piñata */
.piñata-rig.hit .piñata-pendulum {
  animation: none;
  transform: scale(0.92) rotate(8deg);
  transition: transform 0.08s ease-in;
}

.piñata-rig.hit-release .piñata-pendulum {
  transform: scale(1.1) rotate(-6deg);
  transition: transform 0.25s var(--ease-bounce);
}

@keyframes piñataFloat {
  0% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(1deg) translateY(-6px); }
  100% { transform: rotate(4deg) translateY(0); }
}

@keyframes shadowScale {
  0% { transform: scale(0.9) translateX(-10px); opacity: 0.5; }
  50% { transform: scale(1.05) translateX(0); opacity: 0.7; }
  100% { transform: scale(0.9) translateX(10px); opacity: 0.5; }
}

@keyframes glowPulse {
  0% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.95); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}

@keyframes hintBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ==========================================================================
   CARTE DE PRÉSENTATION CENTRALE
   ========================================================================== */

.fiesta-card {
  position: relative;
  background: var(--card-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 2.2rem 2rem 1.8rem;
  max-width: 620px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

/* Capsule de Statut "Bientôt disponible" */
.status-capsule {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(46, 213, 115, 0.12);
  border: 1px solid rgba(46, 213, 115, 0.45);
  color: #3ae374;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.35rem 0.95rem;
  border-radius: 9999px;
  box-shadow: 0 0 16px rgba(46, 213, 115, 0.2);
}

.pulse-beacon {
  position: relative;
  width: 9px;
  height: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.beacon-core {
  width: 7px;
  height: 7px;
  background-color: #2ed573;
  border-radius: 50%;
  box-shadow: 0 0 8px #2ed573;
}

.beacon-wave {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #2ed573;
  animation: beaconPulse 2s infinite cubic-bezier(0, 0, 0.2, 1);
  opacity: 0.75;
}

@keyframes beaconPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* Titre & Logo */
.card-hero-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.fiesta-logo {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 6.5vw, 3.4rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.5px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.logo-word-1 {
  background: linear-gradient(135deg, #ff2a7a 0%, #ff9f43 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 12px rgba(255, 42, 122, 0.45));
}

.logo-word-2 {
  background: linear-gradient(135deg, #feca57 0%, #ff6b6b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 12px rgba(254, 202, 87, 0.45));
}

.fiesta-subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.5vw, 1.6rem);
  font-weight: 700;
  color: var(--text-gold);
  letter-spacing: 0.3px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Séparateur festif */
.festive-separator {
  display: flex;
  align-items: center;
  width: 80%;
  gap: 0.75rem;
}

.sep-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(254, 202, 87, 0.5), transparent);
}

.sep-ornament {
  font-size: 0.9rem;
  letter-spacing: 3px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* Description principale */
.card-body {
  max-width: 520px;
}

.fiesta-description {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.65;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* Bouton d'accès Découvrir le jeu / Discover the game */
.card-cta-container {
  margin: 0.5rem 0 0.25rem;
  width: 100%;
  display: flex;
  justify-content: center;
}

.fiesta-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.85rem 1.85rem;
  min-height: 48px;
  background: linear-gradient(115deg, #ffd776 0%, #ff9f43 50%, #ff2a7a 100%);
  color: #1a0f1c;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(255, 159, 67, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.25s var(--ease-bounce);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.fiesta-cta-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 28px rgba(255, 42, 122, 0.5), 0 4px 10px rgba(0, 0, 0, 0.4);
  color: #000;
}

.fiesta-cta-btn:focus-visible {
  outline: 3px solid #feca57;
  outline-offset: 3px;
}

.fiesta-cta-btn:active {
  transform: translateY(1px) scale(0.98);
}

.cta-sparkle {
  font-size: 1.1rem;
  color: #fff;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.cta-arrow {
  font-size: 1.15rem;
  transition: transform 0.2s ease;
}

.fiesta-cta-btn:hover .cta-arrow {
  transform: translateX(4px);
}

/* Barre de célébrations confettis */
.fiesta-counter-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.4rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.counter-value {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--fiesta-yellow);
  font-size: 0.95rem;
}

/* ==========================================================================
   PIED DE PAGE (FOOTER)
   ========================================================================== */

.fiesta-footer {
  position: relative;
  z-index: 60;
  padding: 1rem 1.5rem calc(1rem + env(safe-area-inset-bottom, 0px));
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: #9f96a8;
  text-align: center;
}

.footer-tags {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-tag-dot {
  opacity: 0.4;
}

/* ==========================================================================
   CANVAS DE CONFETTIS
   ========================================================================== */

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

/* ==========================================================================
   ACCESSIBILITÉ & PREFERS-REDUCED-MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .piñata-pendulum {
    animation: none !important;
    transform: none !important;
  }

  .papel-flag {
    animation: none !important;
    transform: none !important;
  }

  .pueblo-backdrop {
    transition: none !important;
  }

  .beacon-wave {
    display: none !important;
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & PETITS ÉCRANS)
   ========================================================================== */

@media (max-width: 640px) {
  .fiesta-header {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .brand-text {
    display: none; /* Simplifier la barre mobile pour laisser place aux langues */
  }

  .brand-capsule {
    padding: 0.35rem 0.6rem;
  }

  .hero-stage {
    min-height: 200px;
    margin-top: 0;
  }

  .piñata-rig {
    width: 200px;
    height: 190px;
  }

  .piñata-pendulum {
    width: 170px;
    height: 170px;
    margin-top: 10px;
  }

  .piñata-sombrero-accent {
    width: 65px;
  }

  .hanging-rope {
    top: -60px;
    height: 80px;
  }

  .fiesta-card {
    padding: 1.6rem 1.25rem 1.4rem;
    border-radius: 22px;
    gap: 1rem;
  }

  .papel-flag {
    min-width: 42px;
  }
}
