@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

/* ===== MÓDULO FLOTANTE CENTRADO ===== */
  .mundial-widget {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    width: 420px;
    height: 560px;
    pointer-events: none;
    font-family: 'Bebas Neue', sans-serif;
    transition: opacity 0.5s ease, transform 0.5s ease;
  }

  .mundial-widget.closing {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5) rotate(10deg);
    pointer-events: none;
  }

  .mundial-widget.opening {
    animation: widgetOpen 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  }

  @keyframes widgetOpen {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(-10deg); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  }

  /* ===== CANVAS PARTÍCULAS ===== */
  #widgetCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
  }

  /* ===== CONTENEDOR PRINCIPAL ===== */
  .widget-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 20px;
    z-index: 2;
    pointer-events: auto;
  }

  /* ===== BOTÓN CERRAR X ===== */
  .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 0, 0, 0.15);
    border: 2px solid rgba(255, 100, 100, 0.5);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: auto;
    backdrop-filter: blur(5px);
  }

  .close-btn:hover {
    background: rgba(255, 0, 0, 0.4);
    border-color: rgba(255, 100, 100, 0.8);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
  }

  .close-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
  }

  .close-btn:hover svg {
    transform: rotate(90deg);
  }

  .close-btn .x-line {
    stroke: #ff6666;
    stroke-width: 3;
    stroke-linecap: round;
    transition: all 0.3s ease;
  }

  .close-btn:hover .x-line {
    stroke: #ffffff;
    stroke-width: 3.5;
  }

  /* Animación de la X */
  .close-btn .x-line-1 {
    animation: xPulse1 2s ease-in-out infinite;
  }

  .close-btn .x-line-2 {
    animation: xPulse2 2s ease-in-out infinite 0.1s;
  }

  @keyframes xPulse1 {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
  }

  @keyframes xPulse2 {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
  }

  /* ===== BOTÓN REABRIR ===== */
  .reopen-btn {
    position: fixed;
    /* bottom: 20px;
    right: 20px; */
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0066cc, #004499);
    border: 3px solid #ffd700;
    border-radius: 50%;
    cursor: pointer;
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 30px rgba(0,100,200,0.5);
    animation: reopenPulse 2s ease-in-out infinite;
  }

  .reopen-btn.visible {
    display: flex;
  }

  .reopen-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 50px rgba(0,100,200,0.8), 0 0 80px rgba(255,215,0,0.3);
  }

  .reopen-btn svg {
    width: 30px;
    height: 30px;
  }

  @keyframes reopenPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(0,100,200,0.5); }
    50% { box-shadow: 0 0 50px rgba(0,100,200,0.8), 0 0 80px rgba(255,215,0,0.3); }
  }

  /* ===== MASCOTA ===== */
  .mascot-wrapper {
    position: relative;
    width: 240px;
    height: 340px;
    animation: mascotFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(0,100,255,0.4));
  }

  @keyframes mascotFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-12px) rotate(-1deg); }
    50% { transform: translateY(-20px) rotate(0deg); }
    75% { transform: translateY(-12px) rotate(1deg); }
  }

  .mascot-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  /* ===== BALÓN ===== */
  .ball-wrapper {
    position: absolute;
    bottom: 30px;
    right: -10px;
    width: 95px;
    height: 95px;
    animation: ballBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 5px 15px rgba(0,150,255,0.5));
  }

  @keyframes ballBounce {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
    25% { transform: translateY(-30px) rotate(90deg) scale(1.1); }
    50% { transform: translateY(0) rotate(180deg) scale(1); }
    75% { transform: translateY(-15px) rotate(270deg) scale(1.05); }
  }

  .ball-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  /* ===== TROFEO FLOTANTE ===== */
  .trophy-wrapper {
    position: absolute;
    top: 10px;
    left: 20px;
    width: 55px;
    height: 75px;
    animation: trophyGlow 2.5s ease-in-out infinite;
  }

  @keyframes trophyGlow {
    0%, 100% { transform: scale(1) rotate(-5deg); filter: drop-shadow(0 0 10px rgba(255,215,0,0.6)); }
    50% { transform: scale(1.15) rotate(5deg); filter: drop-shadow(0 0 25px rgba(255,215,0,1)); }
  }

  /* ===== TEXTO ANIMADO ===== */
  .widget-title {
    font-size: 2rem;
    color: #ffd700;
    text-shadow: 
      0 0 10px rgba(255,215,0,0.8),
      0 0 20px rgba(255,215,0,0.4),
      2px 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 4px;
    text-align: center;
    margin-bottom: 5px;
    animation: titlePulse 2s ease-in-out infinite;
  }

  @keyframes titlePulse {
    0%, 100% { text-shadow: 0 0 10px rgba(255,215,0,0.8), 0 0 20px rgba(255,215,0,0.4); }
    50% { text-shadow: 0 0 20px rgba(255,215,0,1), 0 0 40px rgba(255,215,0,0.6), 0 0 60px rgba(255,215,0,0.3); }
  }

  .widget-subtitle {
    font-size: 1.1rem;
    color: #00bfff;
    text-shadow: 0 0 10px rgba(0,191,255,0.6), 2px 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 5px;
    text-align: center;
    animation: subtitleGlow 3s ease-in-out infinite;
  }

  @keyframes subtitleGlow {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
  }

  /* ===== ESTRELLAS SVG DECORATIVAS ===== */
  .deco-star {
    position: absolute;
    pointer-events: none;
    z-index: 3;
  }

  .star-1 {
    top: 20px;
    right: 30px;
    width: 28px;
    animation: starSpin 3s linear infinite, starPulse 2s ease-in-out infinite;
  }

  .star-2 {
    top: 60px;
    left: 10px;
    width: 22px;
    animation: starSpin 4s linear infinite reverse, starPulse 2.5s ease-in-out infinite 0.5s;
  }

  .star-3 {
    bottom: 100px;
    right: 20px;
    width: 20px;
    animation: starSpin 3.5s linear infinite, starPulse 1.8s ease-in-out infinite 1s;
  }

  .star-4 {
    top: 100px;
    right: 50px;
    width: 17px;
    animation: starSpin 2.5s linear infinite reverse, starPulse 2.2s ease-in-out infinite 0.3s;
  }

  .star-5 {
    bottom: 150px;
    left: 30px;
    width: 24px;
    animation: starSpin 4.5s linear infinite, starPulse 2.8s ease-in-out infinite 0.7s;
  }

  .star-6 {
    top: 180px;
    left: 15px;
    width: 16px;
    animation: starSpin 3.2s linear infinite, starPulse 2s ease-in-out infinite 1.2s;
  }

  @keyframes starSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }

  @keyframes starPulse {
    0%, 100% { opacity: 0.6; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.3); }
  }

  /* ===== DESTELLOS SVG ===== */
  .sparkle {
    position: absolute;
    pointer-events: none;
    z-index: 3;
  }

  .sparkle-1 {
    top: 40px;
    left: 60px;
    width: 32px;
    animation: sparkleAnim 2s ease-in-out infinite;
  }

  .sparkle-2 {
    top: 80px;
    right: 60px;
    width: 27px;
    animation: sparkleAnim 2.5s ease-in-out infinite 0.5s;
  }

  .sparkle-3 {
    bottom: 80px;
    left: 50px;
    width: 30px;
    animation: sparkleAnim 1.8s ease-in-out infinite 1s;
  }

  .sparkle-4 {
    top: 150px;
    left: 20px;
    width: 22px;
    animation: sparkleAnim 2.2s ease-in-out infinite 0.8s;
  }

  .sparkle-5 {
    bottom: 120px;
    right: 40px;
    width: 25px;
    animation: sparkleAnim 2.8s ease-in-out infinite 1.3s;
  }

  @keyframes sparkleAnim {
    0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
    50% { opacity: 1; transform: scale(1) rotate(180deg); }
  }

  /* ===== LÍNEAS DE ENERGÍA ===== */
  .energy-ring {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    height: 220px;
    border: 2px solid rgba(255,215,0,0.3);
    border-radius: 50%;
    animation: ringPulse 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
  }

  .energy-ring:nth-child(2) {
    width: 280px;
    height: 280px;
    border-color: rgba(0,191,255,0.2);
    animation-delay: 1s;
  }

  .energy-ring:nth-child(3) {
    width: 340px;
    height: 340px;
    border-color: rgba(255,69,0,0.15);
    animation-delay: 2s;
  }

  @keyframes ringPulse {
    0%, 100% { transform: translateX(-50%) scale(0.8); opacity: 0.3; }
    50% { transform: translateX(-50%) scale(1.15); opacity: 0.7; }
  }

  /* ===== RESPONSIVE ===== */
  @media (max-width: 480px) {
    .mundial-widget {
      width: 300px;
      height: 420px;
    }
    .mascot-wrapper {
      width: 170px;
      height: 250px;
    }
    .ball-wrapper {
      width: 75px;
      height: 75px;
    }
    .widget-title { font-size: 1.4rem; letter-spacing: 2px; }
    .widget-subtitle { font-size: 0.85rem; letter-spacing: 3px; }
    .energy-ring { width: 160px; height: 160px; }
    .energy-ring:nth-child(2) { width: 210px; height: 210px; }
    .energy-ring:nth-child(3) { width: 260px; height: 260px; }
    .close-btn { width: 35px; height: 35px; top: 10px; right: 10px; }
    .close-btn svg { width: 16px; height: 16px; }
  }