/* Fuentes mágicas de Harry Potter */
.font-cinzel {
  font-family: 'Cinzel', serif;
}

.font-uncial {
  font-family: 'Uncial Antiqua', cursive;
}

/* Configuración general */
* {
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  font-family: 'Cinzel', serif;
  overflow-x: hidden;
}

/* Fondo del castillo de Hogwarts */
.hogwarts-bg {
  background: url('https://images.unsplash.com/photo-1578662996442-48f60103fc96?w=1200') center/cover no-repeat;
  background-blend-mode: overlay;
  background-color: rgba(0, 0, 0, 0.4);
  animation: backgroundFloat 20s ease-in-out infinite;
}

@keyframes backgroundFloat {

  0%,
  100% {
    transform: scale(1.05) rotate(0deg);
  }

  50% {
    transform: scale(1.1) rotate(0.5deg);
  }
}

/* Pergamino de la invitación */
.invitation-scroll {
  position: relative;
  background: linear-gradient(145deg, #f7f3e9 0%, #ede4d3 50%, #e8dcc0 100%);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  animation: scrollFloat 6s ease-in-out infinite;
  backdrop-filter: blur(10px);
}

@keyframes scrollFloat {

  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }

  50% {
    transform: translateY(-10px) rotate(0.5deg);
  }
}

/* Título mágico con efectos especiales */
.title-magic {
  background: linear-gradient(45deg, #8b5a2b, #d4af37, #8b5a2b);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: magicShimmer 3s ease-in-out infinite, titleBounce 2s ease-in-out infinite;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes magicShimmer {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes titleBounce {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* Escudo de Hogwarts */
.hogwarts-crest {
  background: radial-gradient(circle, #d4af37 0%, #b8860b 50%, #8b5a2b 100%);
  border-radius: 50%;
  position: relative;
  animation: crestRotate 8s linear infinite, crestGlow 2s ease-in-out infinite alternate;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

.hogwarts-crest::before {
  content: "🏰";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  animation: crownSpin 3s ease-in-out infinite;
}

@keyframes crestRotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes crestGlow {
  0% {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
  }

  100% {
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.9);
  }
}

@keyframes crownSpin {

  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }

  50% {
    transform: rotate(180deg) scale(1.1);
  }
}

/* Varita flotante */
.floating-wand {
  width: 30px;
  height: 4px;
  background: linear-gradient(45deg, #8b4513, #d2b48c);
  border-radius: 2px;
  animation: wandFloat 4s ease-in-out infinite, wandRotate 6s linear infinite;
  box-shadow: 0 0 10px rgba(139, 69, 19, 0.5);
}

.floating-wand::before {
  content: "✨";
  position: absolute;
  left: -8px;
  top: -8px;
  animation: sparkleFloat 2s ease-in-out infinite;
}

@keyframes wandFloat {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-15px);
  }
}

@keyframes wandRotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes sparkleFloat {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(1.2);
  }
}

/* Efectos en los detalles del evento */
.detail-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 12px;
  border-radius: 15px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  transition: all 0.3s ease;
  animation: detailGlow 3s ease-in-out infinite;
}

.detail-item:hover {
  background: rgba(212, 175, 55, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

@keyframes detailGlow {

  0%,
  100% {
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.2);
  }

  50% {
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
  }
}

.icon {
  animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {

  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }

  50% {
    transform: scale(1.2) rotate(5deg);
  }
}

/* Nombre de la cumpleañera */
.birthday-girl-name {
  background: linear-gradient(45deg, #dc143c, #ff69b4, #dc143c);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: nameGlow 2s ease-in-out infinite, nameFloat 3s ease-in-out infinite;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes nameGlow {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes nameFloat {

  0%,
  100% {
    transform: translateY(0px) scale(1);
  }

  50% {
    transform: translateY(-8px) scale(1.05);
  }
}

/* Nombre especial de Fiorella */
.fiorella-name {
  background: linear-gradient(45deg, #ff1493, #ffd700, #ff69b4, #9370db, #ff1493);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fiorellaShine 3s ease-in-out infinite, fiorellaBounce 2s ease-in-out infinite, fiorellaGlow 4s ease-in-out infinite;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
  position: relative;
  font-weight: 700;
}

.fiorella-name::before {
  content: "👑";
  position: absolute;
  left: -50px;
  top: -10px;
  font-size: 2rem;
  animation: crownFloat 3s ease-in-out infinite;
}

.fiorella-name::after {
  content: "🌟";
  position: absolute;
  right: -50px;
  top: -10px;
  font-size: 2rem;
  animation: starTwinkle 2s ease-in-out infinite;
}

@keyframes fiorellaShine {

  0%,
  100% {
    background-position: 0% 50%;
    filter: hue-rotate(0deg);
  }

  25% {
    background-position: 100% 50%;
    filter: hue-rotate(90deg);
  }

  50% {
    background-position: 200% 50%;
    filter: hue-rotate(180deg);
  }

  75% {
    background-position: 300% 50%;
    filter: hue-rotate(270deg);
  }
}

@keyframes fiorellaBounce {

  0%,
  100% {
    transform: translateY(0px) scale(1) rotate(0deg);
  }

  50% {
    transform: translateY(-12px) scale(1.08) rotate(1deg);
  }
}

@keyframes fiorellaGlow {

  0%,
  100% {
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 20, 147, 0.6);
  }

  50% {
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 105, 180, 0.6);
  }
}

@keyframes crownFloat {

  0%,
  100% {
    transform: translateY(0px) rotate(0deg) scale(1);
  }

  50% {
    transform: translateY(-15px) rotate(15deg) scale(1.2);
  }
}

@keyframes starTwinkle {

  0%,
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.3) rotate(180deg);
    opacity: 1;
  }
}

/* Sección de invitación al juego */
.game-invitation {
  animation: sectionFloat 6s ease-in-out infinite;
}

.game-invitation>div {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.1) !important;
}

.magical-character {
  text-shadow: 0 0 20px rgba(147, 112, 219, 0.8);
  animation: characterBounce 3s ease-in-out infinite;
}

.magical-message h3 {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.magical-message p {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes characterBounce {

  0%,
  100% {
    transform: translateY(0px) scale(1) rotate(0deg);
  }

  50% {
    transform: translateY(-10px) scale(1.1) rotate(5deg);
  }
}

.spell-scroll {
  animation: scrollGlow 4s ease-in-out infinite;
  box-shadow: 0 5px 20px rgba(245, 158, 11, 0.4);
}

@keyframes scrollGlow {

  0%,
  100% {
    box-shadow: 0 5px 20px rgba(245, 158, 11, 0.4);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.6);
    transform: scale(1.02);
  }
}

.icon-float {
  animation: iconFloat 2s ease-in-out infinite;
}

@keyframes iconFloat {

  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.6));
  }

  50% {
    transform: translateY(-8px) rotate(10deg);
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 1));
  }
}

.magical-message h3 {
  animation: titleShimmer 3s ease-in-out infinite;
}

@keyframes titleShimmer {

  0%,
  100% {
    text-shadow: 0 0 10px rgba(139, 69, 19, 0.6);
  }

  50% {
    text-shadow: 0 0 20px rgba(139, 69, 19, 0.9), 0 0 30px rgba(147, 112, 219, 0.6);
  }
}

@keyframes sectionFloat {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* Área del juego */
.game-area {
  border: 3px solid rgba(255, 215, 0, 0.8);
  background: radial-gradient(circle at center, rgba(25, 25, 112, 0.2) 0%, rgba(72, 61, 139, 0.3) 100%);
  animation: gameAreaPulse 4s ease-in-out infinite;
  min-height: 200px;
  box-shadow:
    0 0 20px rgba(255, 215, 0, 0.4),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
}

#game-message {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  font-weight: bold;
}

#score-display {
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 215, 0, 0.5);
}

@keyframes gameAreaPulse {

  0%,
  100% {
    border-color: rgba(255, 215, 0, 0.8);
    box-shadow:
      0 0 20px rgba(255, 215, 0, 0.4),
      inset 0 0 20px rgba(255, 255, 255, 0.1);
  }

  50% {
    border-color: rgba(255, 215, 0, 1);
    box-shadow:
      0 0 30px rgba(255, 215, 0, 0.6),
      inset 0 0 30px rgba(255, 255, 255, 0.2);
  }
}

/* Snitches doradas */
.snitch {
  position: absolute;
  width: 30px;
  height: 30px;
  background: radial-gradient(circle, #ffd700 0%, #ffb347 50%, #ff8c00 100%);
  border-radius: 50%;
  cursor: pointer;
  animation: snitchFly 3s ease-in-out infinite, snitchGlow 2s ease-in-out infinite alternate;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
  z-index: 10;
}

.snitch::before {
  content: "⚡";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  animation: snitchSpark 1.5s ease-in-out infinite;
}

.snitch::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -20px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid #ffd700;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  animation: wingFlap 0.5s ease-in-out infinite alternate;
}

@keyframes snitchFly {

  0%,
  100% {
    transform: translateY(0px) translateX(0px) rotate(0deg);
  }

  33% {
    transform: translateY(-20px) translateX(15px) rotate(15deg);
  }

  66% {
    transform: translateY(-10px) translateX(-10px) rotate(-10deg);
  }
}

@keyframes snitchGlow {
  0% {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
  }

  100% {
    box-shadow: 0 0 25px rgba(255, 215, 0, 1);
  }
}

@keyframes snitchSpark {

  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }

  50% {
    transform: scale(1.1) rotate(180deg);
  }
}

@keyframes wingFlap {
  0% {
    transform: translateY(-50%) rotateY(0deg);
  }

  100% {
    transform: translateY(-50%) rotateY(30deg);
  }
}

/* Partículas mágicas de fondo */
.magical-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #ffd700;
  border-radius: 50%;
  animation: particleFloat 6s ease-in-out infinite;
  box-shadow: 0 0 6px #ffd700;
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) translateX(0px) scale(0);
    opacity: 0;
  }

  10% {
    opacity: 1;
    transform: translateY(90vh) translateX(10px) scale(1);
  }

  90% {
    opacity: 1;
    transform: translateY(10vh) translateX(-10px) scale(1);
  }

  100% {
    transform: translateY(-10vh) translateX(20px) scale(0);
    opacity: 0;
  }
}

/* Mensaje mágico */
.magical-text {
  animation: magicTextGlow 4s ease-in-out infinite;
  position: relative;
}

.magical-text::before {
  content: "✨";
  position: absolute;
  left: -30px;
  animation: leftSparkle 2s ease-in-out infinite;
}

.magical-text::after {
  content: "✨";
  position: absolute;
  right: -30px;
  animation: rightSparkle 2s ease-in-out infinite 1s;
}

@keyframes magicTextGlow {

  0%,
  100% {
    text-shadow: 0 0 5px rgba(75, 0, 130, 0.5);
    transform: scale(1);
  }

  50% {
    text-shadow: 0 0 20px rgba(75, 0, 130, 0.8);
    transform: scale(1.02);
  }
}

@keyframes leftSparkle {

  0%,
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.5) rotate(180deg);
    opacity: 1;
  }
}

@keyframes rightSparkle {

  0%,
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.5) rotate(-180deg);
    opacity: 1;
  }
}

/* Efectos de explosión para cuando se atrapa una snitch */
.explosion-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #ffd700;
  border-radius: 50%;
  pointer-events: none;
  animation: explode 1s ease-out forwards;
}

@keyframes explode {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: scale(3) rotate(360deg);
    opacity: 0;
  }
}

/* Responsividad */
@media (max-width: 768px) {
  .invitation-scroll {
    margin: 1rem;
  }

  .title-magic {
    font-size: 2.5rem;
  }

  .fiorella-name {
    font-size: 4rem;
  }

  .fiorella-name::before,
  .fiorella-name::after {
    font-size: 1.5rem;
    left: -35px;
    right: -35px;
  }

  .birthday-girl-name {
    font-size: 2.5rem;
  }

  /* Sección de invitación en tablet */
  .game-invitation {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .magical-character {
    font-size: 2.5rem;
  }

  .magical-message h3 {
    font-size: 1.2rem;
  }

  .magical-message p {
    font-size: 0.9rem;
  }

  /* Área del juego en tablet */
  .game-area {
    height: 240px;
    min-height: 240px;
  }

  /* Revelación en tablet */
  #invitation-reveal h4 {
    font-size: 1rem;
    line-height: 1.3;
  }

  #invitation-reveal .space-y-1 span {
    font-size: 0.85rem;
  }

  #invitation-reveal button {
    font-size: 0.85rem;
  }
}

/* Efectos de hover para interactividad */
.invitation-scroll:hover {
  transform: scale(1.02);
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.4),
    0 0 50px rgba(212, 175, 55, 0.3);
}

/* Confetti canvas styling */
#confetti-canvas {
  pointer-events: none;
  z-index: 1000;
}

/* Efectos adicionales para mayor magia */
@keyframes sparkleRotate {
  0% {
    transform: rotate(0deg) scale(1);
  }

  50% {
    transform: rotate(180deg) scale(1.2);
  }

  100% {
    transform: rotate(360deg) scale(1);
  }
}

/* Efecto de respiración para elementos mágicos */
@keyframes breathe {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

.invitation-scroll {
  animation: scrollFloat 6s ease-in-out infinite, breathe 4s ease-in-out infinite;
}

/* Mejoras en la responsividad */
@media (max-width: 480px) {
  .invitation-scroll {
    max-width: 95%;
    margin: 0.5rem;
  }

  .title-magic {
    font-size: 2rem;
  }

  .fiorella-name {
    font-size: 3.5rem;
  }

  .fiorella-name::before,
  .fiorella-name::after {
    font-size: 1.2rem;
    left: -25px;
    right: -25px;
    top: -5px;
  }

  .birthday-girl-name {
    font-size: 2rem;
  }

  /* Sección de invitación más compacta en móvil */
  .game-invitation {
    padding-left: 1rem;
    padding-right: 1rem;
    margin-bottom: 1rem;
  }

  .game-invitation>div {
    padding: 0.75rem;
  }

  .magical-character {
    font-size: 2rem;
    margin: 0 0.5rem;
  }

  .magical-message h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }

  .magical-message p {
    font-size: 0.8rem;
    line-height: 1.2;
  }

  /* Área del juego más pequeña en móvil */
  .game-area {
    height: 200px;
    min-height: 200px;
  }

  /* Revelación mejorada para móvil */
  #invitation-reveal {
    padding: 0.5rem !important;
  }

  #invitation-reveal h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
  }

  #invitation-reveal .space-y-1 {
    gap: 0.25rem;
  }

  #invitation-reveal .space-y-1 span {
    font-size: 0.75rem;
    line-height: 1.2;
  }

  #invitation-reveal .space-y-1 .text-lg {
    font-size: 1rem;
  }

  #invitation-reveal button {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    margin-top: 0.5rem;
  }

  .snitch {
    width: 25px;
    height: 25px;
  }

  .detail-item {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .detail-item .icon {
    font-size: 1.5rem;
  }
}

/* Efecto de carga inicial */
@keyframes fadeInMagic {
  0% {
    opacity: 0;
    transform: translateY(50px) scale(0.8);
  }

  100% {
    opacity: 1;
    transform: translateY(0px) scale(1);
  }
}

.invitation-scroll {
  animation: fadeInMagic 1.5s ease-out, scrollFloat 6s ease-in-out infinite 1.5s, breathe 4s ease-in-out infinite 1.5s;
}

/* Mejora en el hover del área de juego */
.game-area:hover {
  background: radial-gradient(circle at center, rgba(212, 175, 55, 0.2) 0%, rgba(72, 61, 139, 0.3) 100%);
  transform: scale(1.02);
  transition: all 0.3s ease;
}

/* Revelación de la invitación */
#invitation-reveal {
  animation: revealMagic 1s ease-out;
  background: linear-gradient(135deg, rgba(75, 0, 130, 0.95) 0%, rgba(138, 43, 226, 0.95) 50%, rgba(72, 61, 139, 0.95) 100%) !important;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 215, 0, 0.6);
}

@keyframes revealMagic {
  0% {
    opacity: 0;
    transform: scale(0.8) rotateY(90deg);
  }

  50% {
    opacity: 0.7;
    transform: scale(1.05) rotateY(45deg);
  }

  100% {
    opacity: 1;
    transform: scale(1) rotateY(0deg);
  }
}

#invitation-reveal h4 {
  animation: titleSparkle 2s ease-in-out infinite;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

#invitation-reveal .space-y-2 {
  gap: 0.5rem;
}

#invitation-reveal .space-y-2 span {
  font-size: 1rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

@keyframes titleSparkle {

  0%,
  100% {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    transform: scale(1);
  }

  50% {
    text-shadow: 0 0 20px rgba(255, 215, 0, 1), 0 0 30px rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
  }
}

#invitation-reveal .space-y-2>div {
  animation: slideInRight 0.6s ease-out forwards;
  opacity: 0;
  transform: translateX(50px);
}

#invitation-reveal .space-y-2>div:nth-child(1) {
  animation-delay: 0.2s;
}

#invitation-reveal .space-y-2>div:nth-child(2) {
  animation-delay: 0.4s;
}

#invitation-reveal .space-y-2>div:nth-child(3) {
  animation-delay: 0.6s;
}

#invitation-reveal .space-y-2>div:nth-child(4) {
  animation-delay: 0.8s;
}

@keyframes slideInRight {
  0% {
    opacity: 0;
    transform: translateX(50px);
  }

  100% {
    opacity: 1;
    transform: translateX(0px);
  }
}