/* MEGA PÁGINA MEME DIRECTA - SIN BLOQUES */
:root {
  --chaos-red: #ff0040;
  --chaos-orange: #ff6b00;
  --chaos-yellow: #ffff00;
  --chaos-green: #00ff40;
  --chaos-cyan: #00ffff;
  --chaos-blue: #4000ff;
  --chaos-purple: #ff00ff;
  --chaos-pink: #ff69b4;
  --white: #ffffff;
  --black: #000000;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Hide scrollbars globally but keep scrolling functionality */
* {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

*::-webkit-scrollbar {
  display: none; /* WebKit browsers (Chrome, Safari, Edge) */
}

/* BODY ES LA PÁGINA DIRECTAMENTE CON FONDO EXTREMO */
.mega-page {
  font-family: 'Bangers', 'Comic Neue', 'Fredoka', cursive;
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for mobile */
  padding: 4rem 1rem 2rem 1rem;
  position: relative;
  overflow-x: hidden;
  
  /* FONDO CON COLORES MÁS VIBRANTES - OPTIMIZADO */
  background: linear-gradient(
    135deg,
    rgba(255, 0, 64, 0.25),
    rgba(255, 107, 0, 0.25),
    rgba(255, 255, 0, 0.25),
    rgba(0, 255, 64, 0.25),
    rgba(0, 255, 255, 0.25),
    rgba(64, 0, 255, 0.25),
    rgba(255, 0, 255, 0.25)
  );
  backdrop-filter: blur(2px);
  box-shadow: 
    0 0 20px rgba(255, 255, 0, 0.15),
    inset 0 0 20px rgba(255, 0, 255, 0.05);
  
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  
  /* Efectos de texto global mejorados */
  text-shadow: 
    2px 2px 0 rgba(0, 0, 0, 0.8),
    4px 4px 8px rgba(0, 0, 0, 0.5);
  
  /* Optimizaciones de rendimiento */
  will-change: transform;
  contain: layout style paint;
  
  /* Ensure consistent mobile experience */
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Enhanced mobile experience - maintain desktop quality */
@media (max-width: 768px) {
  .mega-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: -1;
    pointer-events: none;
  }
  
  /* Ensure smooth scrolling and touch interactions */
  .mega-page {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
  
  /* Maintain desktop-level hover effects on mobile */
  .character-card:active {
    transform: perspective(1000px) rotateX(10deg) translateY(-15px) scale(1.02);
    border-color: var(--chaos-yellow);
    box-shadow: 
      0 25px 50px rgba(0, 0, 0, 0.7),
      0 0 40px rgba(255, 255, 0, 0.5),
      inset 0 0 30px rgba(255, 255, 255, 0.2);
  }
  
  .chat-button:active {
    transform: translateY(-5px) scale(1.05);
    background: linear-gradient(
      45deg,
      var(--chaos-purple),
      var(--chaos-pink),
      var(--chaos-cyan)
    );
    border-color: var(--chaos-yellow);
    box-shadow: 
      0 15px 35px rgba(0, 0, 0, 0.8),
      0 0 40px rgba(255, 255, 0, 0.6),
      inset 0 0 30px rgba(255, 255, 255, 0.3);
  }
  
  /* Ensure text remains readable and impactful */
  .mega-title,
  .characters-title {
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.3);
  }
  
  /* Maintain desktop-level animations on mobile */
  .chaos-emoji {
    animation: chaos-float-simple 15s linear infinite;
    will-change: transform;
  }
  
  /* Ensure proper touch targets */
  .chat-button,
  .back-link,
  .send-btn {
    min-height: 44px;
    min-width: 44px;
  }
}

/* FONDO ARCOÍRIS SIMPLIFICADO - SIN ANIMACIÓN */
.rainbow-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: linear-gradient(
    135deg,
    var(--chaos-red),
    var(--chaos-orange),
    var(--chaos-yellow),
    var(--chaos-green),
    var(--chaos-cyan),
    var(--chaos-blue),
    var(--chaos-purple)
  );
  opacity: 0.2;
  /* Removed animation for better performance */
}


/* EMOJIS FLOTANTES SIMPLIFICADOS - MEJOR RENDIMIENTO */
.floating-chaos {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  contain: layout style paint;
}

.chaos-emoji {
  position: absolute;
  font-size: clamp(1.5rem, 3vw, 3rem);
  animation: chaos-float-simple 15s linear infinite;
  opacity: 0.15;
  transform: translate3d(0, 100vh, 0);
  will-change: transform;
  contain: layout;
}

.chaos-emoji:nth-child(1) { left: 10%; animation-delay: 0s; }
.chaos-emoji:nth-child(2) { left: 25%; animation-delay: 3s; }
.chaos-emoji:nth-child(3) { left: 40%; animation-delay: 6s; }
.chaos-emoji:nth-child(4) { left: 55%; animation-delay: 1.5s; }
.chaos-emoji:nth-child(5) { left: 70%; animation-delay: 4.5s; }
.chaos-emoji:nth-child(6) { left: 85%; animation-delay: 7.5s; }
.chaos-emoji:nth-child(7) { left: 15%; animation-delay: 9s; }
.chaos-emoji:nth-child(8) { left: 75%; animation-delay: 10.5s; }

@keyframes chaos-float-simple {
  0% { 
    transform: translate3d(0, 100vh, 0);
    opacity: 0;
  }
  10%, 90% {
    opacity: 0.15;
  }
  50% { 
    transform: translate3d(0, 50vh, 0);
    opacity: 0.2;
  }
  100% { 
    transform: translate3d(0, -10vh, 0);
    opacity: 0;
  }
}

/* TÍTULO ÉPICO MEGA */
.epic-title-section {
  text-align: center;
  position: relative;
  z-index: 10;
  margin-bottom: 1rem;
}

.mega-title {
  font-family: 'Bangers', cursive;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.9;
  margin: 0;
  position: relative;
  animation: title-chaos 3s ease-in-out infinite;
}

.title-line-1 {
  display: block;
  color: var(--white);
  text-shadow: 
    4px 4px 0 var(--chaos-yellow),
    -4px -4px 0 var(--chaos-cyan),
    8px 8px 0 rgba(0, 0, 0, 0.3),
    0 0 30px var(--chaos-red);
  animation: line1-shake 0.5s ease-in-out infinite alternate;
}

.title-line-2 {
  display: block;
  color: var(--white);
  text-shadow: 
    5px 5px 0 var(--chaos-purple),
    -5px -5px 0 var(--chaos-green),
    10px 10px 0 rgba(0, 0, 0, 0.3),
    0 0 40px var(--chaos-orange);
  animation: line2-bounce 1s ease-in-out infinite;
  font-size: 1.2em;
}

.title-line-3 {
  display: block;
  color: var(--white);
  text-shadow: 
    3px 3px 0 var(--chaos-pink),
    -3px -3px 0 var(--chaos-blue),
    6px 6px 0 rgba(0, 0, 0, 0.3),
    0 0 35px var(--chaos-green);
  animation: line3-wiggle 2s ease-in-out infinite;
}

@keyframes title-chaos {
  0%, 100% { transform: perspective(1000px) rotateX(0deg); }
  50% { transform: perspective(1000px) rotateX(5deg); }
}

@keyframes line1-shake {
  0% { transform: translateX(0px); }
  100% { transform: translateX(-2px); }
}

@keyframes line2-bounce {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-10px) scale(1.05); }
}

@keyframes line3-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-1deg); }
  75% { transform: rotate(1deg); }
}

.title-effects {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  z-index: 10;
  position: relative;
}

.effect-text {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(1rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--white);
  text-shadow: 
    3px 3px 0 var(--chaos-purple),
    6px 6px 0 rgba(0, 0, 0, 0.3),
    0 0 20px var(--chaos-yellow);
  animation: effect-glow 2s ease-in-out infinite alternate;
  background: linear-gradient(45deg, var(--chaos-yellow), var(--chaos-orange), var(--chaos-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.5));
}

@keyframes effect-glow {
  0% { 
    filter: brightness(1) drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.5));
    transform: scale(1);
  }
  100% { 
    filter: brightness(1.3) drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.7));
    transform: scale(1.05);
  }
}

/* SECCIÓN DE PERSONAJES */
.characters-section {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1400px;
}

.characters-title {
  text-align: center;
  font-family: 'Bangers', cursive;
  font-size: clamp(2rem, 6vw, 4rem);
  margin-bottom: 2rem;
  line-height: 0.9;
}

.chars-line-1 {
  display: block;
  color: var(--white);
  text-shadow: 
    4px 4px 0 var(--chaos-red),
    -3px -3px 0 var(--chaos-yellow),
    8px 8px 0 rgba(0, 0, 0, 0.3),
    0 0 25px var(--chaos-cyan);
  animation: chars1-pulse 1.5s ease-in-out infinite;
}

.chars-line-2 {
  display: block;
  color: var(--white);
  text-shadow: 
    4px 4px 0 var(--chaos-green),
    -3px -3px 0 var(--chaos-blue),
    8px 8px 0 rgba(0, 0, 0, 0.3),
    0 0 30px var(--chaos-pink);
  animation: chars2-wobble 2s ease-in-out infinite;
}

@keyframes chars1-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

@keyframes chars2-wobble {
  0%, 100% { transform: skew(0deg); }
  25% { transform: skew(-1deg); }
  75% { transform: skew(1deg); }
}

/* GRID DE PERSONAJES */
.unified-character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  padding: 1rem 0;
  position: relative;
  z-index: 10;
}

/* CARDS DE PERSONAJES */
.character-card {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  border: 4px solid var(--white);
  border-radius: 25px;
  overflow: hidden;
  position: relative;
  transform: perspective(1000px) rotateX(0deg);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.4),
    0 0 15px rgba(255, 255, 255, 0.15),
    inset 0 0 15px rgba(255, 255, 255, 0.08);
  will-change: transform;
  /* Make all cards the same height */
  height: 100%;
  display: flex;
  flex-direction: column;
}


.character-card::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: linear-gradient(
    45deg,
    var(--chaos-red),
    var(--chaos-orange),
    var(--chaos-yellow),
    var(--chaos-green),
    var(--chaos-cyan),
    var(--chaos-blue),
    var(--chaos-purple)
  );
  background-size: 300% 300%;
  animation: card-border-flow 3s ease infinite;
  border-radius: 25px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

@keyframes card-border-flow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.character-card:hover {
  transform: perspective(1000px) rotateX(10deg) translateY(-15px) scale(1.02);
  border-color: var(--chaos-yellow);
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.7),
    0 0 40px rgba(255, 255, 0, 0.5),
    inset 0 0 30px rgba(255, 255, 255, 0.2);
}

.character-card:hover::before {
  opacity: 1;
}

.character-image {
  width: 100%;
  height: 280px;
  object-fit: cover;
  transition: all 0.4s ease;
  filter: contrast(1.1) saturate(1.2) brightness(1.1);
  border-bottom: 4px solid var(--white);
  contain: paint;
}

.character-card:hover .character-image {
  transform: scale(1.05);
  filter: contrast(1.3) saturate(1.5) brightness(1.2);
}

.character-content {
  padding: 1.5rem;
  position: relative;
  background: rgba(0, 0, 0, 0.6);
  /* Use flexbox to push button to bottom */
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  gap: 1rem; /* Add space between text content and button */
}

/* Text content wrapper */
.character-text-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.character-name {
  font-family: 'Bangers', cursive;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  margin-bottom: 0.5rem;
  color: var(--white);
  text-shadow: 
    3px 3px 0 var(--chaos-yellow),
    6px 6px 0 rgba(0, 0, 0, 0.5),
    0 0 20px var(--chaos-orange);
  animation: name-glow 2s ease-in-out infinite alternate;
}

@keyframes name-glow {
  0% { 
    filter: brightness(1);
    text-shadow: 
      3px 3px 0 var(--chaos-yellow),
      6px 6px 0 rgba(0, 0, 0, 0.5),
      0 0 20px var(--chaos-orange);
  }
  100% { 
    filter: brightness(1.2);
    text-shadow: 
      3px 3px 0 var(--chaos-cyan),
      6px 6px 0 rgba(0, 0, 0, 0.7),
      0 0 30px var(--chaos-pink);
  }
}

.character-tagline {
  color: var(--white);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  margin-bottom: 0;
  font-style: italic;
  font-weight: 600;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7);
  opacity: 0.9;
  animation: tagline-shimmer 3s ease-in-out infinite;
  /* Allow tagline to grow and fill available space */
  flex: 1;
}

@keyframes tagline-shimmer {
  0%, 100% { 
    opacity: 0.9;
    color: var(--white);
  }
  50% { 
    opacity: 1;
    color: var(--chaos-cyan);
  }
}

.chat-button {
  width: 100%;
  padding: 15px 20px;
  background: linear-gradient(
    45deg,
    var(--chaos-red),
    var(--chaos-orange),
    var(--chaos-yellow)
  );
  border: 3px solid var(--white);
  border-radius: 50px;
  color: var(--white);
  font-family: 'Bangers', cursive;
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  overflow: hidden;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
  box-shadow: 
    0 5px 15px rgba(0, 0, 0, 0.5),
    inset 0 0 20px rgba(255, 255, 255, 0.2);
  animation: button-energy 2s ease-in-out infinite;
}

@keyframes button-energy {
  0%, 100% { 
    box-shadow: 
      0 5px 15px rgba(0, 0, 0, 0.5),
      inset 0 0 20px rgba(255, 255, 255, 0.2);
  }
  50% { 
    box-shadow: 
      0 8px 25px rgba(0, 0, 0, 0.7),
      inset 0 0 30px rgba(255, 255, 0, 0.3);
  }
}

.chat-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.6s ease;
}

.chat-button:hover {
  transform: translateY(-5px) scale(1.05);
  background: linear-gradient(
    45deg,
    var(--chaos-purple),
    var(--chaos-pink),
    var(--chaos-cyan)
  );
  border-color: var(--chaos-yellow);
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(255, 255, 0, 0.6),
    inset 0 0 30px rgba(255, 255, 255, 0.3);
}

.chat-button:hover::before {
  left: 100%;
}

.chat-button:active {
  transform: translateY(-2px) scale(1.02);
}

/* DECORACIONES INTEGRADAS */
.integrated-decorations {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 5;
}

.deco-left,
.deco-right {
  position: absolute;
  top: 50%;
  font-size: clamp(3rem, 8vw, 6rem);
  animation: deco-spin 6s linear infinite;
  opacity: 0.3;
  filter: drop-shadow(0 0 20px rgba(255, 255, 0, 0.5));
}

.deco-left {
  left: 1rem;
  animation-direction: normal;
}

.deco-right {
  right: 1rem;
  animation-direction: reverse;
}

.deco-bottom {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Bangers', cursive;
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: var(--white);
  text-shadow: 
    3px 3px 0 var(--chaos-purple),
    6px 6px 0 rgba(0, 0, 0, 0.5),
    0 0 20px var(--chaos-yellow);
  animation: bottom-pulse 2s ease-in-out infinite;
  opacity: 0.8;
}

@keyframes deco-spin {
  0% { transform: translateY(-50%) rotate(0deg); }
  100% { transform: translateY(-50%) rotate(360deg); }
}

@keyframes bottom-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.1); }
}

/* RESPONSIVE DESIGN - MOBILE FIRST APPROACH */
@media (max-width: 768px) {
  .mega-page {
    padding: 2rem 1rem 1.5rem 1rem;
    gap: 2.5rem;
    /* Keep the same visual impact as desktop */
    backdrop-filter: blur(3px);
    min-height: 100vh;
    min-height: 100dvh;
  }
  
  /* Maintain desktop-level text effects on mobile */
  .mega-page {
    text-shadow: 
      2px 2px 0 rgba(0, 0, 0, 0.8),
      4px 4px 8px rgba(0, 0, 0, 0.5);
  }
  
  /* Keep full desktop text effects on mobile */
  .title-line-1,
  .title-line-2,
  .title-line-3 {
    text-shadow: 
      3px 3px 0 var(--chaos-yellow),
      -3px -3px 0 var(--chaos-cyan),
      6px 6px 0 rgba(0, 0, 0, 0.3),
      0 0 25px var(--chaos-red);
  }
  
  .chars-line-1,
  .chars-line-2 {
    text-shadow: 
      3px 3px 0 var(--chaos-red),
      -2px -2px 0 var(--chaos-yellow),
      6px 6px 0 rgba(0, 0, 0, 0.3),
      0 0 20px var(--chaos-cyan);
  }
  
  .character-name {
    text-shadow: 
      2px 2px 0 var(--chaos-yellow),
      4px 4px 0 rgba(0, 0, 0, 0.5),
      0 0 15px var(--chaos-orange);
  }
  
  .character-tagline {
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.7);
  }
  
  .effect-text {
    text-shadow: 
      2px 2px 0 var(--chaos-purple),
      4px 4px 0 rgba(0, 0, 0, 0.5),
      0 0 15px var(--chaos-yellow);
  }
  
  /* Better grid layout for mobile - maintain visual impact */
  .unified-character-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem 0;
  }
  
  /* Keep title effects horizontal on mobile for better visual impact */
  .title-effects {
    flex-direction: row;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  /* Maintain emoji effects */
  .chaos-emoji {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
  }
  
  .deco-left,
  .deco-right {
    font-size: clamp(2.5rem, 6vw, 4rem);
  }
  
  .deco-bottom {
    bottom: 1.5rem;
    font-size: clamp(1rem, 3vw, 1.3rem);
  }
  
  /* Ensure character cards maintain desktop quality */
  .character-card {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    border: 4px solid var(--white);
    border-radius: 25px;
    box-shadow: 
      0 8px 20px rgba(0, 0, 0, 0.4),
      0 0 15px rgba(255, 255, 255, 0.15),
      inset 0 0 15px rgba(255, 255, 255, 0.08);
  }
  
  .character-image {
    height: 300px;
    filter: contrast(1.1) saturate(1.2) brightness(1.1);
  }
  
  .character-content {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.6);
  }
  
  .chat-button {
    padding: 15px 20px;
    font-size: clamp(1rem, 3vw, 1.3rem);
    border: 3px solid var(--white);
    border-radius: 50px;
  }
}

@media (max-width: 480px) {
  .mega-page {
    padding: 2rem 0.75rem 1.5rem 0.75rem;
    gap: 2rem;
    /* Maintain visual impact even on small screens */
    backdrop-filter: blur(3px);
    min-height: 100vh;
    min-height: 100dvh;
  }
  
  /* Maintain desktop-level visual impact on small screens */
  .mega-title {
    font-size: clamp(2.8rem, 12vw, 4.5rem);
    line-height: 0.9;
  }
  
  .characters-title {
    font-size: clamp(2rem, 10vw, 3.5rem);
    line-height: 0.9;
  }
  
  .character-name {
    font-size: clamp(1.4rem, 6vw, 2rem);
  }
  
  .character-tagline {
    font-size: clamp(1rem, 4vw, 1.2rem);
  }
  
  .effect-text {
    font-size: clamp(1rem, 5vw, 1.3rem);
  }
  
  .chat-button {
    font-size: clamp(1rem, 4vw, 1.3rem);
    padding: 15px 20px;
    border: 3px solid var(--white);
    border-radius: 50px;
  }
  
  .character-image {
    height: 280px;
    filter: contrast(1.1) saturate(1.2) brightness(1.1);
  }
  
  .character-content {
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.6);
  }
  
  .unified-character-grid {
    gap: 1.75rem;
    padding: 1.25rem 0;
  }
  
  .deco-left {
    left: 0.75rem;
    font-size: clamp(2rem, 8vw, 3rem);
  }
  
  .deco-right {
    right: 0.75rem;
    font-size: clamp(2rem, 8vw, 3rem);
  }
  
  .deco-bottom {
    bottom: 1.25rem;
    font-size: clamp(0.9rem, 3vw, 1.1rem);
  }
  
  .chaos-emoji {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }
}

/* Extra small screens - maintain desktop quality */
@media (max-width: 360px) {
  .mega-page {
    padding: 1.75rem 0.5rem 1.25rem 0.5rem;
    gap: 1.75rem;
    backdrop-filter: blur(3px);
    min-height: 100vh;
    min-height: 100dvh;
  }
  
  .mega-title {
    font-size: clamp(2.2rem, 14vw, 3.8rem);
    line-height: 0.85;
  }
  
  .characters-title {
    font-size: clamp(1.8rem, 12vw, 3rem);
    line-height: 0.85;
  }
  
  .character-name {
    font-size: clamp(1.2rem, 7vw, 1.7rem);
  }
  
  .character-tagline {
    font-size: clamp(0.9rem, 5vw, 1.1rem);
  }
  
  .effect-text {
    font-size: clamp(0.9rem, 6vw, 1.1rem);
  }
  
  .chat-button {
    font-size: clamp(0.9rem, 6vw, 1.1rem);
    padding: 12px 16px;
    border: 3px solid var(--white);
    border-radius: 50px;
  }
  
  /* Maintain desktop-level character card quality */
  .character-card {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    border: 4px solid var(--white);
    border-radius: 25px;
    box-shadow: 
      0 8px 20px rgba(0, 0, 0, 0.4),
      0 0 15px rgba(255, 255, 255, 0.15),
      inset 0 0 15px rgba(255, 255, 255, 0.08);
  }
  
  .character-content {
    background: rgba(0, 0, 0, 0.6);
    padding: 1.25rem;
  }
  
  .character-image {
    height: 260px;
    filter: contrast(1.1) saturate(1.2) brightness(1.1);
  }
  
  .unified-character-grid {
    gap: 1.5rem;
    padding: 1rem 0;
  }
  
  .deco-left,
  .deco-right {
    font-size: clamp(1.8rem, 10vw, 2.5rem);
  }
  
  .deco-bottom {
    font-size: clamp(0.8rem, 4vw, 1rem);
  }
  
  .chaos-emoji {
    font-size: clamp(1.3rem, 6vw, 1.8rem);
  }
}

/* Additional mobile optimizations for perfect desktop-like experience */
@media (max-width: 768px) {
  /* Ensure proper touch interactions */
  .character-card,
  .chat-button,
  .back-link,
  .send-btn {
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    touch-action: manipulation;
  }
  
  /* Maintain desktop-level visual hierarchy */
  .mega-title {
    font-size: clamp(3.5rem, 10vw, 6rem);
    line-height: 0.9;
  }
  
  .characters-title {
    font-size: clamp(2.5rem, 8vw, 4rem);
    line-height: 0.9;
  }
  
  /* Ensure character cards maintain desktop proportions */
  .character-card {
    min-height: 400px;
    display: flex;
    flex-direction: column;
  }
  
  .character-image {
    flex-shrink: 0;
    height: 300px;
  }
  
  .character-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  /* Maintain desktop-level button interactions */
  .chat-button {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    user-select: none;
  }
  
  /* Ensure proper text rendering on mobile */
  .mega-page * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
  
  /* Maintain desktop-level backdrop effects */
  .character-card,
  .chat-page,
  .chat-header,
  .chat-footer,
  .input-container {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }
}

/* Ultra-wide mobile screens (landscape phones) */
@media (max-width: 768px) and (orientation: landscape) {
  .mega-page {
    padding: 2rem 1rem 1.5rem 1rem;
    gap: 2rem;
  }
  
  .unified-character-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
  }
  
  .character-image {
    height: 200px;
  }
}

/* COMPATIBILIDAD CHAT */
.chat {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px;
  display: none;
}

.chat.visible {
  display: block;
}

/* ===============================================
   CHAT FULLSCREEN OSCURO (tipo ChatGPT)
   =============================================== */

.chat-page {
  font-family: 'Fredoka', 'Comic Neue', sans-serif;
  height: 100vh; /* Fixed height */
  height: 100dvh; /* Dynamic viewport height for mobile browsers */
  background: linear-gradient(
    135deg,
    rgba(255, 0, 64, 0.15),
    rgba(255, 107, 0, 0.15),
    rgba(255, 255, 0, 0.15),
    rgba(0, 255, 64, 0.15),
    rgba(0, 255, 255, 0.15),
    rgba(64, 0, 255, 0.15),
    rgba(255, 0, 255, 0.15)
  );
  backdrop-filter: blur(4px);
  box-shadow: 
    0 0 40px rgba(255, 255, 0, 0.2),
    inset 0 0 40px rgba(255, 0, 255, 0.06);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden; /* Prevent any overflow */
  width: 100%;
  max-width: 100%;
}

.chat-shell {
  display: flex;
  flex-direction: column;
  height: 100vh; /* Fixed height instead of min-height */
  height: 100dvh; /* Dynamic viewport height for mobile browsers */
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  overflow: hidden; /* Prevent body scroll */
}

.chat-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0; /* Prevent header from shrinking */
}

.header-left { justify-self: start; }
.header-center { justify-self: center; }
.header-right { justify-self: end; }

.back-link {
  color: var(--chaos-cyan);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 255, 255, 0.15), rgba(0, 255, 255, 0.05));
  transition: all 0.3s ease;
  border: 2px solid var(--chaos-cyan);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.back-link:hover {
  color: var(--white);
  background: linear-gradient(135deg, var(--chaos-cyan), var(--chaos-blue));
  border-color: var(--chaos-yellow);
  transform: translateX(-2px) scale(1.05);
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.5);
}

.back-arrow {
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.chat-title {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.title-line {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(0.8rem, 1.8vw, 1rem);
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

.char-name {
  font-family: 'Bangers', cursive;
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  color: var(--white);
  text-shadow: 2px 2px 0 var(--chaos-purple), 4px 4px 0 rgba(0,0,0,0.5), 0 0 15px var(--chaos-yellow);
  line-height: 1;
}

.adult-toggle { position: relative; }
.adult-toggle input[type="checkbox"] { display: none; }

.compact-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, rgba(255, 0, 255, 0.2), rgba(255, 107, 0, 0.15));
  border: 2px solid var(--chaos-pink);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}

.toggle-icon {
  font-family: 'Bangers', cursive;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--chaos-pink);
  transition: all 0.3s ease;
  z-index: 2;
  position: relative;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.compact-toggle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--chaos-pink), var(--chaos-purple));
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.adult-toggle input[type="checkbox"]:checked + .compact-toggle {
  background: linear-gradient(135deg, var(--chaos-yellow), var(--chaos-orange));
  border-color: var(--chaos-yellow);
  transform: scale(1.1);
  box-shadow: 0 0 25px rgba(255, 255, 0, 0.5);
}

.adult-toggle input[type="checkbox"]:checked + .compact-toggle::before {
  opacity: 1;
  background: linear-gradient(135deg, var(--chaos-red), var(--chaos-orange));
}

.adult-toggle input[type="checkbox"]:checked + .compact-toggle .toggle-icon {
  color: var(--white);
  transform: scale(1.1);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7);
}

.compact-toggle:hover {
  transform: scale(1.05);
  border-color: var(--chaos-cyan);
  box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
}

.adult-toggle input[type="checkbox"]:checked + .compact-toggle:hover {
  transform: scale(1.15);
  box-shadow: 0 0 30px rgba(255, 255, 0, 0.7);
}

.messages-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  min-height: 0; /* Allow flex item to shrink */
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: transparent;
  scroll-behavior: smooth;
  /* Ensure messages don't go behind header/footer */
  margin-top: 0;
  margin-bottom: 0;
}

/* Scrollbar styling removed - using global hidden scrollbars */

.msg {
  padding: 1rem 1.25rem;
  border-radius: 14px;
  line-height: 1.6;
  max-width: 900px;
  word-wrap: break-word;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--chaos-purple), var(--chaos-pink));
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: var(--white);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
  box-shadow: 
    0 5px 15px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(255, 0, 255, 0.2);
}

.msg.bot {
  align-self: flex-start;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.7);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.msg.bot.thinking {
  background: rgba(255, 255, 0, 0.2);
  border: 1px solid rgba(255, 255, 0, 0.3);
  color: var(--white);
  font-style: italic;
  opacity: 0.9;
  animation: thinking-pulse 1.5s ease-in-out infinite;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.7);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@keyframes thinking-pulse { 0%,100%{opacity:0.7} 50%{opacity:1} }

.chat-footer {
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  bottom: 0;
  flex-shrink: 0; /* Prevent footer from shrinking */
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.input-container:focus-within {
  border-color: var(--chaos-cyan);
  box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.15);
}

.chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  outline: none;
  background: transparent;
  color: var(--white);
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 4px;
}

.chat-input::placeholder { color: rgba(255,255,255,0.55); }

.send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(45deg, var(--chaos-yellow), var(--chaos-orange));
  color: var(--black);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  margin-left: 0.5rem;
  flex-shrink: 0;
  padding: 0;
}

.send-btn:hover { 
  background: linear-gradient(45deg, var(--chaos-orange), var(--chaos-red)); 
  transform: translateY(-1px); 
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.send-btn:active { 
  transform: translateY(0); 
}

.send-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.send-btn:hover .send-icon {
  transform: translateX(2px);
}

/* Scroll to bottom button */
.scroll-to-bottom-btn {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(45deg, var(--chaos-purple), var(--chaos-pink));
  border: 2px solid var(--white);
  border-radius: 25px;
  color: var(--white);
  font-family: 'Bangers', cursive;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-transform: uppercase;
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(255, 0, 255, 0.3);
  z-index: 10;
  backdrop-filter: blur(5px);
}

.scroll-to-bottom-btn:hover {
  background: linear-gradient(45deg, var(--chaos-pink), var(--chaos-cyan));
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(0, 255, 255, 0.4);
}

.scroll-to-bottom-btn:active {
  transform: translateY(0) scale(1.02);
}

/* Prefer desktop layout; keep usable on smaller screens without going mobile-first */
@media (max-width: 1024px) {
  .messages { padding: 1.25rem; }
  .msg { max-width: 85%; }
}

@media (max-width: 768px) {
  .chat-page {
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    /* Maintain desktop visual quality */
    backdrop-filter: blur(4px);
  }
  
  .chat-shell {
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    width: 100%;
    max-width: 100%;
  }
  
  .chat-header { 
    padding: 1rem 1.25rem; 
    gap: 0.75rem;
    min-height: 70px;
    /* Maintain desktop header quality */
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
  }
  
  .back-link { 
    font-size: 1.1rem; 
    padding: 8px 12px; 
    width: 36px;
    height: 36px;
    /* Maintain desktop button quality */
    border: 2px solid var(--chaos-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
  }
  
  #charName { 
    font-size: clamp(1.2rem, 4vw, 1.6rem); 
    /* Maintain desktop text effects */
    text-shadow: 2px 2px 0 var(--chaos-purple), 4px 4px 0 rgba(0,0,0,0.5), 0 0 15px var(--chaos-yellow);
  }
  
  .title-line {
    font-size: clamp(0.8rem, 2vw, 1rem);
    /* Maintain desktop text quality */
    text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
  }
  
  .messages { 
    padding: 1rem; 
    gap: 1rem;
  }
  
  .msg {
    padding: 1rem 1.25rem;
    font-size: 1rem;
    max-width: 90%;
    /* Maintain desktop message quality */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  }
  
  .msg.user {
    /* Maintain desktop user message effects */
    box-shadow: 
      0 5px 15px rgba(0, 0, 0, 0.3),
      0 0 20px rgba(255, 0, 255, 0.2);
  }
  
  .chat-footer { 
    padding: 1rem 1.25rem; 
    min-height: 80px;
    /* Maintain desktop footer quality */
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
  }
  
  .input-container {
    padding: 0.5rem;
    gap: 0.5rem;
    /* Maintain desktop input quality */
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
  }
  
  .chat-input {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    /* Maintain desktop input quality */
    color: var(--white);
    font-family: 'Fredoka', sans-serif;
    font-weight: 500;
  }
  
  .send-btn { 
    width: 40px; 
    height: 40px; 
    min-width: 40px;
    min-height: 40px;
    margin-left: 0.5rem;
    /* Maintain desktop button quality */
    background: linear-gradient(45deg, var(--chaos-yellow), var(--chaos-orange));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  
  .send-icon {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .chat-header { 
    padding: 0.875rem 1rem; 
    gap: 0.5rem;
    min-height: 65px;
    /* Maintain desktop header quality */
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
  }
  
  .back-link { 
    width: 34px;
    height: 34px;
    padding: 6px 10px;
    /* Maintain desktop button quality */
    border: 2px solid var(--chaos-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
  }
  
  .messages { 
    padding: 0.875rem; 
    gap: 0.875rem;
  }
  
  .msg {
    padding: 0.875rem 1.125rem;
    font-size: 0.95rem;
    max-width: 92%;
    /* Maintain desktop message quality */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  }
  
  .msg.user {
    /* Maintain desktop user message effects */
    box-shadow: 
      0 5px 15px rgba(0, 0, 0, 0.3),
      0 0 20px rgba(255, 0, 255, 0.2);
  }
  
  .chat-footer { 
    padding: 0.875rem 1rem; 
    min-height: 75px;
    /* Maintain desktop footer quality */
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
  }
  
  .input-container {
    padding: 0.375rem;
    gap: 0.375rem;
    /* Maintain desktop input quality */
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
  }
  
  .chat-input {
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    /* Maintain desktop input quality */
    color: var(--white);
    font-family: 'Fredoka', sans-serif;
    font-weight: 500;
  }
  
  .send-btn { 
    width: 38px; 
    height: 38px; 
    min-width: 38px;
    min-height: 38px;
    margin-left: 0.375rem;
    /* Maintain desktop button quality */
    background: linear-gradient(45deg, var(--chaos-yellow), var(--chaos-orange));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  
  .send-icon {
    width: 18px;
    height: 18px;
  }
}

/* Modal de Invitación */
.invitation-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: modalBackgroundFadeIn 0.4s ease-out forwards;
}

@keyframes modalBackgroundFadeIn {
  0% { 
    opacity: 0; 
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
  }
  50% {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
  }
  100% { 
    opacity: 1; 
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
  }
}

.invitation-content {
  background: linear-gradient(135deg, rgba(255, 0, 64, 0.9), rgba(255, 107, 0, 0.9), rgba(255, 255, 0, 0.9));
  border: 3px solid var(--white);
  border-radius: 20px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.5),
    0 0 50px rgba(255, 0, 255, 0.3);
  animation: modalContentSlideIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s both;
  transform: translateY(100px) scale(0.8);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Efecto de pulso sutil después de que aparece el modal */
.invitation-content.visible {
  animation: modalContentSlideIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s both,
             modalPulse 0.8s ease-out 0.8s both;
}

@keyframes modalContentSlideIn {
  0% { 
    transform: translateY(100px) scale(0.8) rotateX(15deg); 
    opacity: 0;
    box-shadow: 
      0 0 0 rgba(0, 0, 0, 0),
      0 0 0 rgba(255, 0, 255, 0);
  }
  50% {
    transform: translateY(-10px) scale(1.02) rotateX(-2deg);
    box-shadow: 
      0 20px 40px rgba(0, 0, 0, 0.6),
      0 0 60px rgba(255, 0, 255, 0.4);
  }
  100% { 
    transform: translateY(0) scale(1) rotateX(0deg); 
    opacity: 1;
    box-shadow: 
      0 10px 30px rgba(0, 0, 0, 0.5),
      0 0 50px rgba(255, 0, 255, 0.3);
  }
}

@keyframes modalPulse {
  0%, 100% { 
    box-shadow: 
      0 10px 30px rgba(0, 0, 0, 0.5),
      0 0 50px rgba(255, 0, 255, 0.3);
  }
  50% { 
    box-shadow: 
      0 15px 40px rgba(0, 0, 0, 0.6),
      0 0 70px rgba(255, 0, 255, 0.5);
  }
}

.invitation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 1rem;
}

.invitation-header h3 {
  font-family: 'Bangers', cursive;
  font-size: 1.8rem;
  color: var(--white);
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.7);
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--white);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7);
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.invitation-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.invitation-message {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.1rem;
  color: var(--white);
  text-align: center;
  line-height: 1.6;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7);
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.invitation-character {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 1rem;
  border-radius: 15px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.invitation-character-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid var(--white);
  object-fit: cover;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.invitation-character-info h4 {
  font-family: 'Bangers', cursive;
  font-size: 1.3rem;
  color: var(--white);
  margin: 0 0 0.5rem 0;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7);
}

.invitation-character-info p {
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.7);
}

.invitation-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.accept-btn, .decline-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 25px;
  font-family: 'Bangers', cursive;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.accept-btn {
  background: linear-gradient(45deg, var(--chaos-green), var(--chaos-cyan));
  color: var(--black);
  border: 2px solid var(--white);
}

.accept-btn:hover {
  background: linear-gradient(45deg, var(--chaos-cyan), var(--chaos-blue));
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.decline-btn {
  background: linear-gradient(45deg, var(--chaos-red), var(--chaos-orange));
  color: var(--white);
  border: 2px solid var(--white);
}

.decline-btn:hover {
  background: linear-gradient(45deg, var(--chaos-orange), var(--chaos-yellow));
  color: var(--black);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Responsive para el modal */
@media (max-width: 768px) {
  .invitation-content {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .invitation-header h3 {
    font-size: 1.5rem;
  }
  
  .invitation-character {
    flex-direction: column;
    text-align: center;
  }
  
  .invitation-actions {
    flex-direction: column;
  }
  
  .accept-btn, .decline-btn {
    width: 100%;
  }
}

/* Animaciones de salida del modal */
.invitation-modal.closing {
  animation: modalBackgroundFadeOut 0.3s ease-in forwards;
}

.invitation-modal.closing .invitation-content {
  animation: modalContentSlideOut 0.3s ease-in forwards;
}

@keyframes modalBackgroundFadeOut {
  0% { 
    opacity: 1; 
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
  }
  100% { 
    opacity: 0; 
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
  }
}

@keyframes modalContentSlideOut {
  0% { 
    transform: translateY(0) scale(1) rotateX(0deg); 
    opacity: 1;
  }
  100% { 
    transform: translateY(50px) scale(0.9) rotateX(10deg); 
    opacity: 0;
  }
}

/* ===============================================
   CONFIGURACIÓN MODAL Y BOTÓN
   =============================================== */

/* Botón de configuración */
.config-button {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--chaos-purple), var(--chaos-pink));
  border: 3px solid var(--white);
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 
    0 5px 15px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(255, 0, 255, 0.3);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.config-button:hover {
  transform: translateY(-3px) scale(1.1);
  background: linear-gradient(135deg, var(--chaos-pink), var(--chaos-cyan));
  border-color: var(--chaos-yellow);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(0, 255, 255, 0.5);
}

.config-button:active {
  transform: translateY(-1px) scale(1.05);
}

/* En el chat, ajustar posición del botón de configuración */
.chat-page .config-button {
  position: relative;
  top: auto;
  right: auto;
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
  margin-right: 0.5rem;
}

/* Contenedor de controles del header del chat */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Modal de configuración */
.config-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: configModalBackgroundFadeIn 0.4s ease-out forwards;
}

@keyframes configModalBackgroundFadeIn {
  0% { 
    opacity: 0; 
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
  }
  50% {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
  }
  100% { 
    opacity: 1; 
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
  }
}

.config-content {
  background: linear-gradient(135deg, rgba(255, 0, 64, 0.9), rgba(255, 107, 0, 0.9), rgba(255, 255, 0, 0.9));
  border: 3px solid var(--white);
  border-radius: 20px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.5),
    0 0 50px rgba(255, 0, 255, 0.3);
  animation: configContentSlideIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s both;
  transform: translateY(100px) scale(0.8);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes configContentSlideIn {
  0% { 
    transform: translateY(100px) scale(0.8) rotateX(15deg); 
    opacity: 0;
    box-shadow: 
      0 0 0 rgba(0, 0, 0, 0),
      0 0 0 rgba(255, 0, 255, 0);
  }
  50% {
    transform: translateY(-10px) scale(1.02) rotateX(-2deg);
    box-shadow: 
      0 20px 40px rgba(0, 0, 0, 0.6),
      0 0 60px rgba(255, 0, 255, 0.4);
  }
  100% { 
    transform: translateY(0) scale(1) rotateX(0deg); 
    opacity: 1;
    box-shadow: 
      0 10px 30px rgba(0, 0, 0, 0.5),
      0 0 50px rgba(255, 0, 255, 0.3);
  }
}

.config-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 1rem;
}

.config-header h3 {
  font-family: 'Bangers', cursive;
  font-size: 1.8rem;
  color: var(--white);
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.7);
  margin: 0;
}

.config-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7);
}

.form-group input[type="text"] {
  padding: 0.75rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--white);
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}

.form-group input[type="text"]:focus {
  outline: none;
  border-color: var(--chaos-cyan);
  box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.4);
}

.form-group input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.form-group select {
  padding: 0.75rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--white);
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
  cursor: pointer;
}

.form-group select:focus {
  outline: none;
  border-color: var(--chaos-cyan);
  box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.4);
}

.form-group select option {
  background: rgba(0, 0, 0, 0.9);
  color: var(--white);
  padding: 0.5rem;
}

/* Toggle switch para modo 18+ */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.3);
  transition: 0.3s;
  border-radius: 24px;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: var(--white);
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch.active .toggle-slider {
  background: linear-gradient(135deg, var(--chaos-yellow), var(--chaos-orange));
  border-color: var(--chaos-yellow);
}

.toggle-switch.active .toggle-slider:before {
  transform: translateX(26px);
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.toggle-label {
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.7);
}

.config-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.save-btn, .cancel-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 25px;
  font-family: 'Bangers', cursive;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.save-btn {
  background: linear-gradient(45deg, var(--chaos-green), var(--chaos-cyan));
  color: var(--black);
  border: 2px solid var(--white);
}

.save-btn:hover {
  background: linear-gradient(45deg, var(--chaos-cyan), var(--chaos-blue));
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.cancel-btn {
  background: linear-gradient(45deg, var(--chaos-red), var(--chaos-orange));
  color: var(--white);
  border: 2px solid var(--white);
}

.cancel-btn:hover {
  background: linear-gradient(45deg, var(--chaos-orange), var(--chaos-yellow));
  color: var(--black);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Responsive para el modal de configuración */
@media (max-width: 768px) {
  .config-content {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .config-header h3 {
    font-size: 1.5rem;
  }
  
  .config-actions {
    flex-direction: column;
  }
  
  .save-btn, .cancel-btn {
    width: 100%;
  }
  
  .config-button {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }
  
  .chat-page .config-button {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
}

/* Animaciones de salida del modal de configuración */
.config-modal.closing {
  animation: configModalBackgroundFadeOut 0.3s ease-in forwards;
}

.config-modal.closing .config-content {
  animation: configContentSlideOut 0.3s ease-in forwards;
}

@keyframes configModalBackgroundFadeOut {
  0% { 
    opacity: 1; 
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
  }
  100% { 
    opacity: 0; 
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
  }
}

@keyframes configContentSlideOut {
  0% { 
    transform: translateY(0) scale(1) rotateX(0deg); 
    opacity: 1;
  }
  100% { 
    transform: translateY(50px) scale(0.9) rotateX(10deg); 
    opacity: 0;
  }
}