@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Creepster&family=Montserrat:wght@400;600;700;800;900&display=swap');

/* ===== CONTENEDOR FLOTANTE HALLOWEEN ===== */
.halloween-widget {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  width: 420px;
  max-width: 92vw;
  height: 580px;
  max-height: 90vh;
  pointer-events: none;
  font-family: 'Montserrat', sans-serif;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  perspective: 1000px;
}

.halloween-widget.closing {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6) rotate(-8deg);
  pointer-events: none;
}

.halloween-widget.opening {
  animation: hwWidgetOpen 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes hwWidgetOpen {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4) rotate(10deg);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
}

/* ===== CANVAS DE PARTÍCULAS HALLOWEEN ===== */
#halloweenCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  border-radius: 24px;
}

/* ===== TARJETA PRINCIPAL DEL WIDGET ===== */
.hw-card-body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 22px 20px 20px 20px;
  z-index: 2;
  pointer-events: auto;
  background: linear-gradient(165deg, rgba(26, 14, 46, 0.95) 0%, rgba(13, 8, 25, 0.98) 50%, rgba(35, 14, 20, 0.96) 100%);
  border: 2px solid rgba(255, 117, 24, 0.6);
  border-radius: 24px;
  box-shadow: 
    0 0 35px rgba(255, 117, 24, 0.35),
    0 0 70px rgba(138, 43, 226, 0.3),
    inset 0 0 25px rgba(255, 117, 24, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  box-sizing: border-box;
}

/* Telaraña decorativa en esquina */
.hw-web-corner {
  position: absolute;
  top: 0;
  left: 0;
  width: 75px;
  height: 75px;
  pointer-events: none;
  opacity: 0.4;
  z-index: 3;
}

/* ===== BOTÓN CERRAR X ===== */
.hw-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  background: rgba(255, 117, 24, 0.18);
  border: 1.5px solid rgba(255, 140, 50, 0.6);
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffb703;
  font-size: 16px;
  transition: all 0.25s ease;
  pointer-events: auto;
  box-shadow: 0 0 12px rgba(255, 117, 24, 0.3);
}

.hw-close-btn:hover {
  background: #ff5500;
  color: #ffffff;
  border-color: #ffffff;
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 0 20px rgba(255, 85, 0, 0.8);
}

/* ===== HEADER DEL WIDGET ===== */
.hw-badge-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(90deg, #ff7518, #d32f2f);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 4px 14px;
  border-radius: 50px;
  box-shadow: 0 0 15px rgba(255, 117, 24, 0.6);
  animation: hwBadgePulse 2.5s infinite;
  z-index: 4;
}

@keyframes hwBadgePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 15px rgba(255, 117, 24, 0.5); }
  50% { transform: scale(1.04); box-shadow: 0 0 25px rgba(255, 117, 24, 0.8); }
}

/* ===== MASCOTA / IMAGEN ===== */
.hw-mascot-container {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 6px 0;
  z-index: 3;
}

.hw-mascot-glow {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 117, 24, 0.45) 0%, rgba(155, 89, 182, 0.25) 50%, transparent 75%);
  animation: hwGlowRotate 4s ease-in-out infinite alternate;
}

@keyframes hwGlowRotate {
  0% { transform: scale(0.95); opacity: 0.6; }
  100% { transform: scale(1.12); opacity: 1; }
}

.hw-mascot-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #ff9f1c;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 117, 24, 0.5);
  animation: hwMascotFloat 3.5s ease-in-out infinite;
}

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

.hw-mini-bat {
  position: absolute;
  font-size: 20px;
  filter: drop-shadow(0 0 5px rgba(255, 117, 24, 0.8));
}
.hw-bat-1 { top: 0px; left: -10px; animation: hwBatFly1 3s ease-in-out infinite; }
.hw-bat-2 { top: 10px; right: -12px; animation: hwBatFly2 3.5s ease-in-out infinite 0.5s; }

@keyframes hwBatFly1 {
  0%, 100% { transform: translate(0, 0) rotate(-10deg); }
  50% { transform: translate(8px, -12px) rotate(15deg); }
}

@keyframes hwBatFly2 {
  0%, 100% { transform: translate(0, 0) rotate(10deg); }
  50% { transform: translate(-10px, -8px) rotate(-15deg); }
}

/* ===== TEXTOS DEL WIDGET ===== */
.hw-info-content {
  text-align: center;
  z-index: 4;
  width: 100%;
}

.hw-contest-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.1rem;
  line-height: 1.05;
  letter-spacing: 1.5px;
  margin: 4px 0 2px 0;
  background: linear-gradient(180deg, #fff7d6 0%, #ffb703 50%, #ff5400 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.8));
}

.hw-contest-sub {
  font-size: 11.5px;
  font-weight: 700;
  color: #e0aaff;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Highlights / Badges */
.hw-pills-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.hw-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 183, 3, 0.35);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hw-pill.highlight {
  background: linear-gradient(135deg, rgba(255, 117, 24, 0.3), rgba(214, 40, 40, 0.3));
  border-color: #ff9f1c;
  color: #ffdd59;
}

/* ===== BOTONES DE ACCIÓN ===== */
.hw-actions-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  z-index: 4;
}

.hw-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #ff7518 0%, #e63946 100%);
  color: #ffffff !important;
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 18px;
  border-radius: 50px;
  text-decoration: none !important;
  box-shadow: 0 4px 18px rgba(255, 117, 24, 0.45);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.hw-btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(255, 117, 24, 0.7);
  background: linear-gradient(135deg, #ff8c32 0%, #f72585 100%);
  color: #ffffff !important;
}

.hw-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: #ffb703 !important;
  font-weight: 600;
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 50px;
  text-decoration: none !important;
  border: 1px solid rgba(255, 183, 3, 0.4);
  transition: all 0.25s ease;
}

.hw-btn-secondary:hover {
  background: rgba(255, 183, 3, 0.2);
  color: #ffffff !important;
  border-color: #ffd166;
}

/* ===== BOTÓN FLOTANTE REABRIR / LAUNCHER ===== */
.halloween-reopen-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 8px 12px;
  background: linear-gradient(135deg, #1b0a2a 0%, #2b0938 50%, #450920 100%);
  border: 2px solid #ff7518;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 
    0 0 20px rgba(255, 117, 24, 0.5),
    0 6px 20px rgba(0, 0, 0, 0.4);
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: hwFloatingPulse 2.8s ease-in-out infinite;
}

.halloween-reopen-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 
    0 0 35px rgba(255, 117, 24, 0.8),
    0 8px 25px rgba(0, 0, 0, 0.6);
  border-color: #ffaa00;
}

.hw-reopen-icon {
  font-size: 26px;
  animation: hwPumpkinBob 2s infinite ease-in-out;
  display: inline-block;
}

@keyframes hwPumpkinBob {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50% { transform: rotate(8deg) scale(1.12); }
}

.hw-reopen-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.hw-reopen-tag {
  font-size: 9.5px;
  color: #ff9f1c;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hw-reopen-title {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
}

@keyframes hwFloatingPulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(255, 117, 24, 0.4), 0 4px 15px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 117, 24, 0.75), 0 6px 22px rgba(138, 43, 226, 0.4);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .halloween-widget {
    width: 320px;
    height: 520px;
    top: 52%;
  }
  .hw-card-body {
    padding: 16px 14px 14px 14px;
  }
  .hw-mascot-container {
    width: 140px;
    height: 140px;
    margin: 4px 0;
  }
  .hw-contest-title {
    font-size: 1.65rem;
  }
  .hw-contest-sub {
    font-size: 10px;
    margin-bottom: 6px;
  }
  .hw-pill {
    font-size: 9.5px;
    padding: 3px 8px;
  }
  .hw-btn-primary {
    font-size: 12.5px;
    padding: 10px 14px;
  }
  .halloween-reopen-btn {
    bottom: 15px;
    left: 15px;
    padding: 6px 14px 6px 10px;
  }
  .hw-reopen-icon {
    font-size: 22px;
  }
  .hw-reopen-title {
    font-size: 11.5px;
  }
  .hw-reopen-tag {
    font-size: 8.5px;
  }
}
