/* === RESET Y BASE === */
html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: 
    radial-gradient(circle at 20% 80%, #1a0033 0%, transparent 40%),
    radial-gradient(circle at 80% 20%, #330066 0%, transparent 40%),
    #0a0a0a;
  background-size: 200% 200%;
  background-attachment: fixed;
  color: #fff;
  font-family: 'Arial', sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

.container {
  width: 90%;
  max-width: 600px;
  text-align: center;
  background: transparent !important;
  padding: 20px;
  margin: 20px auto 100px auto;
  z-index: 2;
  position: relative;
}

h1, h2, h3 { margin: 0; }

/* === TÍTULO GLITCH === */
.glitch-title {
  position: relative;
  font-size: 2.8em !important;
  font-weight: bold;
  color: #ee82ee;
  text-shadow: 
    0 0 10px #ee82ee,
    0 0 20px #ee82ee,
    2px 2px 0 #ff00ff,
    -2px -2px 0 #00ffff;
  animation: glitch 3s infinite alternate-reverse;
}

.glitch-title::before,
.glitch-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
}

.glitch-title::before {
  color: #ff00ff;
  animation: glitch-1 0.5s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.glitch-title::after {
  color: #00ffff;
  animation: glitch-2 0.5s infinite;
  clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
}

@keyframes glitch {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(2px, -2px); }
  60% { transform: translate(-2px, -2px); }
  80% { transform: translate(2px, 2px); }
}

@keyframes glitch-1 {
  0%, 100% { transform: translate(0); }
  50% { transform: translate(-3px, 1px); }
}

@keyframes glitch-2 {
  0%, 100% { transform: translate(0); }
  50% { transform: translate(3px, -1px); }
}

/* === BOTONES TRANSPARENTES === */
button {
  padding: 12px 24px;
  margin: 10px;
  border: 2px solid #ee82ee;
  border-radius: 12px;
  background: transparent;
  color: #ee82ee;
  font-weight: bold;
  cursor: pointer;
  text-shadow: 0 0 8px #ee82ee;
  position: relative;
  overflow: hidden; /* ← CLAVE: CORTA EL RIPPLE */
  z-index: 1;
  transition: all 0.3s ease;
  box-shadow: 0 0 15px rgba(238, 130, 238, 0.4);
}

button:hover {
  background: rgba(238, 130, 238, 0.15);
  box-shadow: 0 0 25px #ee82ee;
  transform: translateY(-3px);
  border-color: #ff00ff;
}

/* === RIPPLE DENTRO DEL BOTÓN (NO SALE) === */
.ripple {
  position: absolute;
  background: rgba(238, 130, 238, 0.6);
  border-radius: 50%;
  pointer-events: none;
  width: 0;
  height: 0;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  animation: rippleAnim 0.6s ease-out;
  z-index: 2;
}

@keyframes rippleAnim {
  to {
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

/* === SECCIONES CON TRANSICIÓN === */
section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

.hidden { display: none; }

/* === JUEGO === */
#playerName { font-size: 2em; margin: 20px 0 10px; }
#categoryBadge { font-size: 1.2em; color: #0ff; text-shadow: 0 0 8px #000; margin: 10px 0; }
#playerRole {
  font-size: 2.2em;
  font-weight: bold;
  margin: 25px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.4s ease;
}

#playerRole.impostor {
  color: #ff0040 !important;
  font-size: 3.2em !important;
  text-shadow: 
    0 0 15px #ff0040,
    0 0 30px #ff0040,
    0 0 50px #ff0040,
    0 0 5px #000;
  animation: pulseImpostor 1.2s infinite alternate, glitchImpostor 2s infinite;
}

@keyframes pulseImpostor {
  from { text-shadow: 0 0 15px #ff0040, 0 0 30px #ff0040, 0 0 50px #ff0040; }
  to   { text-shadow: 0 0 20px #ff0040, 0 0 40px #ff0040, 0 0 70px #ff0040; }
}

@keyframes glitchImpostor {
  0%, 100% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  50% { clip-path: polygon(0 20%, 100% 20%, 100% 80%, 0 80%); }
}

/* === INPUTS === */
input, select {
  padding: 8px;
  margin: 5px;
  border-radius: 8px;
  border: none;
  background: #222;
  color: #ee82ee;
  width: 80px;
}

select { width: 100%; }

/* === BURBUJAS === */
.bubbles {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

.bubbles span {
  position: absolute;
  background: rgba(238, 130, 238, 0.1);
  border-radius: 50%;
  animation: float 15s infinite linear;
  box-shadow: 0 0 15px rgba(238, 130, 238, 0.3);
}

.bubbles span:nth-child(1) { width: 40px; height: 40px; left: 10%; animation-delay: 0s; }
.bubbles span:nth-child(2) { width: 60px; height: 60px; left: 30%; animation-delay: 3s; }
.bubbles span:nth-child(3) { width: 30px; height: 30px; left: 50%; animation-delay: 6s; }
.bubbles span:nth-child(4) { width: 50px; height: 50px; left: 70%; animation-delay: 9s; }
.bubbles span:nth-child(5) { width: 70px; height: 70px; left: 90%; animation-delay: 12s; }

@keyframes float {
  0% { transform: translateY(100vh) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-110vh) translateX(50px); opacity: 0; }
}

/* === FOOTER SUTIL + FIJO + ICONOS IGUALES === */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 12px;
  background: rgba(10, 10, 10, 0.9);
  border-top: 1px solid rgba(238, 130, 238, 0.3);
  color: #ccc;
  text-align: center;
  font-size: 0.7rem;
  z-index: 999;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
  font-family: 'Arial', sans-serif;
  line-height: 1.4;
}

footer a {
  color: #ee82ee;
  text-decoration: none;
  font-weight: normal;
}

footer a:hover {
  color: #ff00ff;
  text-shadow: 0 0 8px #ff00ff;
}

.redes-sociales {
  margin-top: 4px;
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
}

.redes-sociales a {
  color: #ee82ee;
  font-size: 1.15rem; /* ← TODOS IGUALES */
  transition: all 0.3s ease;
  text-shadow: 0 0 5px #ee82ee;
}

.redes-sociales a:hover {
  color: #ff00ff;
  transform: translateY(-2px) scale(1.15);
  text-shadow: 0 0 10px #ff00ff;
}

/* RESPONSIVE */
@media (max-width: 480px) {
  footer {
    padding: 6px 8px;
    font-size: 0.65rem;
  }
  .redes-sociales a {
    font-size: 1.1rem;
  }
}

/* === ESPACIO PARA FOOTER (SIN ESPACIO NEGRO) === */
body {
  padding-bottom: 60px !important;
  box-sizing: border-box;
}

/* === LOADER === */
#loader {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: #0a0a0a;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loader-bubble {
  width: 20px; height: 20px;
  background: #ee82ee;
  border-radius: 50%;
  margin: 0 10px;
  animation: loaderAnim 1.2s infinite;
  box-shadow: 0 0 20px #ee82ee;
}

.loader-bubble:nth-child(2) { animation-delay: 0.2s; }
.loader-bubble:nth-child(3) { animation-delay: 0.4s; }

@keyframes loaderAnim {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-30px); }
}

/* === TÍTULO COMO BOTÓN === */
#titleBtn {
  cursor: pointer !important;
  user-select: none;
  transition: all 0.3s ease;
}

#titleBtn:hover {
  transform: scale(1.05);
  text-shadow: 
    0 0 15px #ee82ee,
    0 0 30px #ee82ee,
    3px 3px 0 #ff00ff,
    -3px -3px 0 #00ffff;
}

/* === RIPPLE SIEMPRE VISIBLE === */
button {
  position: relative;
  overflow: visible !important;
  z-index: 1;
}

.ripple {
  position: absolute;
  background: rgba(238, 130, 238, 0.6);
  border-radius: 50%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  animation: rippleAnim 0.6s ease-out;
  z-index: 2;
}

@keyframes rippleAnim {
  to {
    transform: translate(-50%, -50%) scale(8);
    opacity: 0;
  }
}

/* === MODAL REGLAS === */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
}

.modal-content {
  background: #111;
  border: 2px solid #ee82ee;
  border-radius: 15px;
  padding: 25px;
  max-width: 600px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 0 30px rgba(238, 130, 238, 0.5);
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 2.5rem;
  color: #ee82ee;
  cursor: pointer;
  font-weight: bold;
}

.close-modal:hover {
  color: #ff00ff;
  text-shadow: 0 0 10px #ff00ff;
}

/* === CLASE HIDDEN (NECESARIA PARA CERRAR MODAL) === */
.hidden {
  display: none !important;
}

/* === PANTALLA DE INTRODUCCIÓN === */
#introScreen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #0a0a0a;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
  text-align: center;
}

.intro-content {
  max-width: 600px;
  animation: fadeInUp 1s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === PRÓXIMAMENTE === */
.coming-soon {
  color: #ee82ee;
  font-weight: bold;
  text-shadow: 0 0 10px #ee82ee;
  display: block;
  margin-top: 15px;
  font-size: 1.2rem;
}

.coming-soon em {
  color: #ff00ff;
  font-style: italic;
  text-shadow: 0 0 8px #ff00ff;
}

/* === PRÓXIMAMENTE EN MODAL === */
#rulesModal .coming-soon {
  display: block;
  margin-top: 25px;
  font-size: 1.2rem;
  color: #ee82ee;
  text-shadow: 0 0 10px #ee82ee;
}

#rulesModal .coming-soon em {
  color: #ff00ff;
  font-style: italic;
  text-shadow: 0 0 8px #ff00ff;
}

/* === MODAL REGLAS (FOOTER NO TAPA + COLORES ÉPICOS) === */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.98);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  z-index: 99999 !important;
  padding: 20px 15px 120px 15px; /* +120px para footer */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.modal-content {
  background: #111;
  border: 2px solid #ee82ee;
  border-radius: 18px;
  padding: 30px 22px;
  max-width: 620px;
  width: 95%;
  max-height: calc(100vh - 160px); /* Respeta footer */
  overflow-y: auto;
  text-align: center;
  position: relative;
  box-shadow: 
    0 0 30px rgba(238, 130, 238, 0.6),
    0 0 60px rgba(238, 130, 238, 0.3);
  margin: 20px auto;
  animation: modalFadeIn 0.5s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* SCROLL VIOLETA */
.modal-content::-webkit-scrollbar { width: 10px; }
.modal-content::-webkit-scrollbar-track { 
  background: #222; 
  border-radius: 10px;
}
.modal-content::-webkit-scrollbar-thumb { 
  background: #ee82ee; 
  border-radius: 10px;
  box-shadow: 0 0 15px #ee82ee;
}

/* BOTÓN CERRAR */
.close-modal {
  position: absolute;
  top: 12px;
  right: 18px;
  background: none;
  border: none;
  font-size: 2.4rem;
  color: #ee82ee;
  cursor: pointer;
  font-weight: bold;
  text-shadow: 0 0 15px #ee82ee;
  z-index: 10;
  transition: all 0.3s;
}

.close-modal:hover {
  color: #ff00ff;
  text-shadow: 0 0 20px #ff00ff;
  transform: scale(1.1);
}

/* COLORES ÉPICOS */
#rulesModal h2 {
  color: #ee82ee !important;
  text-shadow: 0 0 15px #ee82ee, 0 0 30px #ee82ee;
  font-size: 2rem !important;
  margin: 0 0 25px 0;
}

#rulesModal strong {
  color: #ff00ff;
  text-shadow: 0 0 10px #ff00ff;
  font-weight: bold;
}

/* NÚMEROS DE PASOS */
#rulesModal p strong:first-of-type {
  color: #00ffff !important;
  font-size: 1.3rem !important;
  text-shadow: 0 0 15px #00ffff;
  display: block;
  margin: 25px 0 8px 0;
}

#rulesModal p {
  font-size: 1.05rem !important;
  line-height: 1.75 !important;
  color: #e0e0e0 !important;
  text-align: left;
}

#rulesModal .coming-soon {
  display: block;
  margin: 30px 0 10px 0;
  font-size: 1.25rem;
  color: #ee82ee !important;
  text-shadow: 0 0 15px #ee82ee;
}

#rulesModal .coming-soon em {
  color: #ff00ff;
  font-style: italic;
  text-shadow: 0 0 12px #ff00ff;
}

/* RESPONSIVE MÓVIL */
@media (max-width: 480px) {
  .modal { 
    padding: 15px 10px 140px 10px; /* + espacio para footer */
  }
  .modal-content { 
    padding: 25px 18px; 
    width: 98%;
    max-height: calc(100vh - 180px);
  }
  #rulesModal h2 { font-size: 1.7rem !important; }
  #rulesModal p { font-size: 0.98rem !important; }
  .close-modal { font-size: 2.1rem; top: 10px; right: 15px; }
}

/* === BOTÓN COMPARTIR SUTIL === */
.subtle-share {
  margin: 15px auto 0 auto !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.85rem !important;
  padding: 8px 16px !important;
  background: rgba(238, 130, 238, 0.15) !important;
  color: #ee82ee !important;
  border: 1px solid rgba(238, 130, 238, 0.3) !important;
  border-radius: 12px !important;
  box-shadow: 0 0 10px rgba(238, 130, 238, 0.2) !important;
  transition: all 0.3s ease !important;
  width: fit-content !important;
  font-weight: normal !important;
}

.subtle-share:hover {
  background: rgba(238, 130, 238, 0.3) !important;
  box-shadow: 0 0 15px rgba(238, 130, 238, 0.4) !important;
  transform: translateY(-1px);
}

.subtle-share i {
  font-size: 0.9rem;
  color: #ee82ee;
}

/* === REVELAR ROLES ANIMACIÓN === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

#revealList > div {
  transition: all 0.3s ease;
}

#revealList > div:hover {
  background: rgba(238,130,238,0.2) !important;
  transform: translateX(5px);
}

/* === PANTALLA INICIO RESPONSIVE + SCROLL === */
#introScreen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #0a0a0a;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  z-index: 9999;
  padding: 20px 15px 120px 15px; /* espacio para footer */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.intro-content {
  max-width: 600px;
  width: 95%;
  text-align: center;
  margin: 20px auto;
  animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === CLASE HIDDEN === */
.hidden { display: none !important; }

/* === SELECT REVELAR === */
#playerSelect {
  background: #111 !important;
  color: #ee82ee !important;
  border: 1px solid #ee82ee !important;
  border-radius: 8px !important;
  padding: 9px !important;
  font-size: 0.85rem !important;
  width: 80% !important;
  max-width: 260px !important;
  margin: 8px auto !important;
  box-shadow: 0 0 8px rgba(238,130,238,0.2) !important;
  appearance: none;
  -webkit-appearance: none;
}

#playerSelect:focus {
  outline: none;
  box-shadow: 0 0 12px rgba(238,130,238,0.5) !important;
}

/* === REVELAR LISTA === */
#revealList > div {
  margin: 10px 0;
  padding: 12px;
  background: rgba(0,0,0,0.6);
  border-radius: 10px;
  border-left: 4px solid;
  animation: fadeIn 0.5s ease;
}

/* === LOADER ÉPICO (SOLO PUNTITOS) === */
#loader {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.6s ease;
}

.dots {
  display: flex;
  gap: 18px;
}

.dots span {
  width: 20px;
  height: 20px;
  background: #ee82ee;
  border-radius: 50%;
  box-shadow: 0 0 20px #ee82ee, 0 0 40px #ff00ff;
  animation: pulse 1.4s infinite ease-in-out;
}

.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 100% { 
    transform: scale(0.7); 
    opacity: 0.7; 
    box-shadow: 0 0 15px #ee82ee;
  }
  50% { 
    transform: scale(1.1); 
    opacity: 1; 
    box-shadow: 0 0 30px #ee82ee, 0 0 60px #ff00ff;
  }
}