/* System Design System - El Impostor Premium */

:root {
  --color-bg-dark: #08090f;
  --color-bg-card: rgba(18, 20, 36, 0.65);
  --color-border-glass: rgba(255, 255, 255, 0.08);
  --color-border-glow: rgba(0, 243, 255, 0.25);
  
  /* Colores de Marca y Estados */
  --color-neon-cyan: #00f3ff;
  --color-neon-pink: #ff007f;
  --color-neon-green: #39ff14;
  --color-neon-purple: #9d4edd;
  --color-danger: #ff3333;
  --color-text-primary: #ffffff;
  --color-text-secondary: #a0a5c0;
  
  --font-family: 'Outfit', sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset y Reglas Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-drag: none;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg-dark);
  color: var(--color-text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
}

html {
  height: 100%;
}

/* Luces Neón de Fondo */
.background-glows {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  animation: floatGlow 15s infinite alternate ease-in-out;
}

.glow-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background-color: var(--color-neon-cyan);
}

.glow-2 {
  bottom: -10%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background-color: var(--color-neon-pink);
  animation-delay: -5s;
}

@keyframes floatGlow {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(10%, 10%) scale(1.2);
  }
}

/* Contenedor Principal */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
  margin: auto;
}

/* Sistema de Pantallas */
.screen {
  display: none;
  flex-direction: column;
  justify-content: center; /* Centrar verticalmente en el contenedor */
  align-items: stretch;
  flex-grow: 1;
  width: 100%;
  animation: fadeIn 0.4s ease-out forwards;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cabecera de Pantalla */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 2rem;
}

.screen-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ffffff, var(--color-text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-back {
  position: absolute;
  left: 0;
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem 0;
  transition: var(--transition-smooth);
}

.btn-back:hover {
  color: var(--color-neon-cyan);
  transform: translateX(-3px);
}

/* Componente Glassmorphism Card */
.card {
  background: var(--color-bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-border-glass);
  border-radius: 24px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: var(--transition-smooth);
}

.card:hover {
  border-color: var(--color-border-glow);
}

/* Botones Premium */
.btn {
  font-family: var(--font-family);
  font-weight: 800;
  font-size: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: var(--transition-smooth);
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-neon-cyan), #00a8ff);
  color: #000;
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(0, 243, 255, 0.6);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--color-neon-pink), #cc0066);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.25);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(255, 0, 127, 0.5);
}

.btn-tertiary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--color-border-glass);
  color: #ffffff;
}

.btn-tertiary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: linear-gradient(135deg, var(--color-danger), #b30000);
  color: white;
}

.btn-danger:hover {
  box-shadow: 0 0 15px rgba(255, 51, 51, 0.5);
}

.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: skewX(-30deg);
  transition: 0.75s;
  pointer-events: none;
}

.btn-glow:hover::after {
  left: 120%;
}

.btn-block {
  margin-top: 1rem;
}

.btn-large {
  padding: 1.2rem;
  font-size: 1.15rem;
}

.btn-icon-only {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border-glass);
  color: var(--color-text-secondary);
  align-self: center;
}

.btn-icon-only:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: var(--color-neon-cyan);
}

/* Pantalla de Bienvenida */
.welcome-header {
  text-align: center;
  margin-bottom: 3rem;
}

.logo-container {
  display: inline-block;
  background: radial-gradient(circle, rgba(0, 243, 255, 0.15) 0%, transparent 70%);
  padding: 1.5rem;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.app-logo {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 0 15px rgba(0, 243, 255, 0.5));
  animation: logoPulse 4s infinite ease-in-out;
}

@keyframes logoPulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 15px rgba(0, 243, 255, 0.5));
  }
  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 25px rgba(255, 0, 127, 0.7));
  }
}

.game-title {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #ffffff 30%, var(--color-neon-cyan) 60%, var(--color-neon-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
}

.game-subtitle {
  color: var(--color-text-secondary);
  font-size: 1.05rem;
  margin-top: 0.5rem;
  font-weight: 400;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.connection-badge {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  align-self: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.connection-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.connection-badge.online .dot {
  background-color: var(--color-neon-green);
  box-shadow: 0 0 8px var(--color-neon-green);
}

.connection-badge.offline .dot {
  background-color: #8c8c8c;
}

/* Configuración Local & Setup Grid */
.setup-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Tarjeta Jugadores */
.card-players h3, .card-options h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--color-neon-cyan);
}

.player-input-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.player-input-row input, .form-group input, .join-row input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--color-border-glass);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: #fff;
  font-family: var(--font-family);
  font-size: 1rem;
  transition: var(--transition-smooth);
}

.player-input-row input:focus, .form-group input:focus, .join-row input:focus {
  outline: none;
  border-color: var(--color-neon-cyan);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.btn-small {
  padding: 0.75rem 1.2rem;
  border-radius: 12px;
  font-size: 0.95rem;
  width: auto;
}

.players-list-scrollable {
  list-style: none;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* Scrollbar estilizada */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.players-list-scrollable li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border-glass);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  margin-bottom: 0.5rem;
  animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.player-name-text {
  font-weight: 600;
}

.btn-remove-player {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-remove-player:hover {
  color: var(--color-danger);
}

/* Opciones de Partida */
.option-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
}

.toggle-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-toggle {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border-glass);
  color: var(--color-text-secondary);
  font-family: var(--font-family);
  font-weight: 600;
  padding: 0.75rem 0.5rem;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 0.9rem;
}

.btn-toggle small {
  display: block;
  font-size: 0.75rem;
  opacity: 0.7;
  font-weight: 400;
}

.btn-toggle.active {
  background: rgba(0, 243, 255, 0.1);
  border-color: var(--color-neon-cyan);
  color: var(--color-neon-cyan);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.15);
}

.custom-select {
  background: rgba(0, 0, 0, 0.3) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M7 10l5 5 5-5H7z"/></svg>') no-repeat right 1rem center;
  background-size: 1.25rem;
  border: 1px solid var(--color-border-glass);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: #fff;
  font-family: var(--font-family);
  font-size: 1rem;
  appearance: none;
  cursor: pointer;
}

.custom-select option {
  background: #121424;
  color: #fff;
}

.imposter-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--color-border-glass);
  border-radius: 12px;
  padding: 0.5rem 1rem;
}

.btn-counter {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border-glass);
  color: #fff;
  font-size: 1.2rem;
  font-weight: bold;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-smooth);
}

.btn-counter:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--color-neon-cyan);
}

#label-imposters-count, #label-online-imposters-count {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.custom-words-group {
  border-top: 1px solid var(--color-border-glass);
  padding-top: 1rem;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Pantalla de Firebase / Configuración */
.form-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.setup-instructions {
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--color-text-secondary);
  margin-bottom: 1.2rem;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* Pantalla Revelar Carta (Antitrampas) */
.reveal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2rem;
  min-height: 70vh;
}

.reveal-turn-name {
  font-size: 2.2rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--color-neon-cyan);
  text-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}

.reveal-card-wrapper {
  perspective: 1000px;
  width: 280px;
  height: 380px;
}

.reveal-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.reveal-card.flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 28px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

/* Carta Frontal (Oculta) */
.card-front {
  background: linear-gradient(135deg, #16182e 0%, #0d0f1a 100%);
  border: 2px solid var(--color-border-glow);
}

.card-art {
  background: radial-gradient(circle, rgba(0, 243, 255, 0.1) 0%, transparent 70%);
  width: 130px;
  height: 130px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-decor-icon {
  width: 70px;
  height: 70px;
  filter: opacity(0.65) drop-shadow(0 0 5px var(--color-neon-cyan));
}

.tap-hint {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
  margin: 1.5rem 0;
}

.btn-reveal {
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
}

/* Carta Trasera (Revelada) */
.card-back {
  background: linear-gradient(135deg, #10121d 0%, #08090f 100%);
  border: 2px solid var(--color-neon-pink);
  transform: rotateY(180deg);
}

.role-badge {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.role-badge.civil {
  background: rgba(57, 255, 20, 0.15);
  border: 1px solid var(--color-neon-green);
  color: var(--color-neon-green);
}

.role-badge.impostor {
  background: rgba(255, 51, 51, 0.15);
  border: 1px solid var(--color-danger);
  color: var(--color-danger);
  box-shadow: 0 0 10px rgba(255, 51, 51, 0.2);
}

.role-word {
  font-size: 2.2rem;
  font-weight: 900;
  margin: 1rem 0;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.role-hint-text {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
}

.reveal-footer {
  margin-top: 1rem;
  animation: fadeIn 0.4s ease-out forwards;
}

.reveal-footer p {
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.reveal-footer strong {
  color: var(--color-neon-pink);
}

/* Pantalla de Descripción */
.describe-content {
  text-align: center;
}

.describe-intro-text {
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.turns-sequence-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--color-border-glass);
  border-radius: 18px;
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.turns-sequence-box h3 {
  font-size: 1rem;
  color: var(--color-neon-cyan);
  margin-bottom: 0.75rem;
  font-weight: 800;
}

.turns-list {
  list-style-position: inside;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: left;
}

.turns-list li {
  font-size: 1.05rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border-left: 3px solid var(--color-neon-cyan);
}

/* Cronómetro Circular */
.timer-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.timer-circle-container {
  position: relative;
  width: 110px;
  height: 110px;
}

.timer-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 6;
}

.timer-bar {
  fill: none;
  stroke: var(--color-neon-pink);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 283; /* 2 * PI * r (r=45) */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.1s linear, stroke 0.3s ease;
}

.timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.8rem;
  font-weight: 900;
}

.timer-controls {
  display: flex;
  gap: 0.5rem;
}

/* Pantalla Votación */
.vote-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.vote-instruction {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.vote-players-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  list-style: none;
}

.vote-player-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border-glass);
  border-radius: 16px;
  padding: 1.25rem 0.5rem;
  font-family: var(--font-family);
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
}

.vote-player-btn:hover:not(.dead) {
  border-color: var(--color-neon-pink);
  background: rgba(255, 0, 127, 0.05);
  transform: translateY(-2px);
}

.vote-player-btn.dead {
  opacity: 0.3;
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.05);
  color: var(--color-text-secondary);
  cursor: not-allowed;
  text-decoration: line-through;
}

/* Overlay de revelación al eliminar */
.game-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 6, 10, 0.9);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.overlay-content {
  max-width: 400px;
  width: 100%;
  text-align: center;
  animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes zoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.overlay-content h3 {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
}

.role-reveal-animation {
  margin: 2rem 0;
}

.role-reveal-animation .role-badge {
  font-size: 1.8rem;
  padding: 0.6rem 2rem;
  border-radius: 30px;
  animation: pulseNeon 1.5s infinite;
}

@keyframes pulseNeon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

#overlay-result-word-info {
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

/* Fin de Juego */
.game-over-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.trophy-animation {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: trophyFloat 3s infinite ease-in-out;
}

@keyframes trophyFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(5deg); }
}

#game-over-title {
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.neon-text {
  text-shadow: 0 0 10px var(--color-neon-cyan);
}

#game-over-reason {
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
}

.game-details-card {
  width: 100%;
  text-align: left;
}

.game-details-card h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--color-neon-pink);
  border-bottom: 1px solid var(--color-border-glass);
  padding-bottom: 0.5rem;
}

.details-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.details-row span {
  color: var(--color-text-secondary);
}

.word-highlight {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--color-border-glass);
}

.game-over-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* Pantalla de Ranking & Podio */
.ranking-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.podium-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.5rem;
  height: 200px;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border-glass);
}

.podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100px;
  transition: var(--transition-smooth);
}

.podium-block {
  width: 100%;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 900;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.2);
}

.podium-avatar {
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
}

.podium-name {
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 90px;
}

.podium-score {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

/* Alturas y colores de los escalones */
.step-first {
  order: 2;
}
.step-first .podium-block {
  height: 90px;
  background: linear-gradient(to top, #ffd700, #ffae00);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.step-second {
  order: 1;
}
.step-second .podium-block {
  height: 65px;
  background: linear-gradient(to top, #c0c0c0, #909090);
}

.step-third {
  order: 3;
}
.step-third .podium-block {
  height: 45px;
  background: linear-gradient(to top, #cd7f32, #a05a2c);
}

/* Tabla de clasificación */
.ranking-table-card {
  padding: 0.75rem;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.ranking-table th {
  color: var(--color-text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border-glass);
}

.ranking-table td {
  padding: 0.85rem 1rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.ranking-table tr:last-child td {
  border-bottom: none;
}

/* Sala Online */
.online-panels {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.divider {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  position: relative;
}

.divider::before, .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--color-border-glass);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.join-row {
  display: flex;
  gap: 0.5rem;
}

.join-row input {
  max-width: 130px;
  text-align: center;
  font-weight: 800;
  letter-spacing: 2px;
}

.room-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border-glass);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.room-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.players-box h4, .host-controls-box h4 {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 800;
}

.online-players-list {
  list-style: none;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--color-border-glass);
  border-radius: 12px;
  padding: 0.5rem;
  max-height: 140px;
  overflow-y: auto;
}

.online-players-list li {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.25rem;
  display: flex;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
}

.online-players-list li:last-child {
  margin-bottom: 0;
}

.player-status-badge {
  font-size: 0.75rem;
  background: rgba(0, 243, 255, 0.1);
  color: var(--color-neon-cyan);
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  font-weight: 700;
}

.host-controls-box {
  border-top: 1px solid var(--color-border-glass);
  padding-top: 1rem;
}

.wait-message-box {
  text-align: center;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px dashed var(--color-border-glass);
}

/* Helper Utilities */
.hidden {
  display: none !important;
}

/* Pantalla de Reglas */
.rules-card-scrollable {
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.rules-section {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border-glass);
  padding-bottom: 1.25rem;
}

.rules-section:last-child {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.rules-section h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-neon-cyan);
  margin-bottom: 0.5rem;
}

.rules-section p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.rules-section p strong {
  color: #fff;
}

/* Animación del flip al pasar cursor/mantener presionado en mobile */
@media (max-width: 480px) {
  .app-container {
    padding: 1rem;
  }
}

/* Botón de Ajustes Superior */
.btn-settings-top {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border-glass);
  color: var(--color-text-secondary);
  font-size: 1.25rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  z-index: 10;
}

.btn-settings-top:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: var(--color-neon-cyan);
  transform: rotate(45deg);
}

/* Botón de Donación Premium */
.btn-donation {
  border: 1px solid rgba(255, 215, 0, 0.25) !important;
  background: rgba(255, 215, 0, 0.04) !important;
  color: #ffd700 !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.1) !important;
  margin-top: 1.5rem;
}

.btn-donation:hover {
  background: rgba(255, 215, 0, 0.12) !important;
  border-color: rgba(255, 215, 0, 0.6) !important;
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.35) !important;
  transform: translateY(-2px);
}

/* Pie de Página */
.game-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(160, 165, 192, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.creator-link {
  color: #ffd700; /* Dorado para resaltar al creador */
  text-decoration: none;
  font-weight: 800;
  transition: var(--transition-smooth);
}

.creator-link:hover {
  color: #fff;
  text-shadow: 0 0 8px #ffd700;
}

.legal-link {
  color: var(--color-text-secondary);
  text-decoration: underline;
  transition: var(--transition-smooth);
}

.legal-link:hover {
  color: #fff;
}

/* Modal de Privacidad / Aviso Legal */
.legal-overlay-content {
  max-width: 420px;
  text-align: left;
}

.legal-overlay-content h3 {
  font-size: 1.35rem;
  color: var(--color-neon-cyan);
  margin-bottom: 1rem;
  text-align: center;
}

.legal-scroll-box {
  max-height: 250px;
  overflow-y: auto;
  padding-right: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.legal-scroll-box p {
  margin-bottom: 0.75rem;
}

.legal-scroll-box ul {
  padding-left: 1.2rem;
  margin-bottom: 0.75rem;
}

.legal-scroll-box li {
  margin-bottom: 0.4rem;
}

.legal-scroll-box a {
  color: var(--color-neon-pink);
  text-decoration: none;
  font-weight: 600;
}

.legal-scroll-box a:hover {
  text-decoration: underline;
}

/* Animaciones de Eliminación Dramática */
.game-overlay.dramatic-elimination {
  background: rgba(10, 2, 5, 0.95);
  animation: hazardFlash 0.4s infinite alternate;
}

@keyframes hazardFlash {
  0% { background: rgba(5, 6, 10, 0.96); }
  100% { background: rgba(35, 5, 10, 0.98); }
}

.overlay-content.dramatic-content {
  border: 2px solid var(--color-danger);
  box-shadow: 0 0 35px rgba(255, 51, 51, 0.4);
  animation: shakeScreen 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shakeScreen {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-7px, 0, 0); }
  40%, 60% { transform: translate3d(7px, 0, 0); }
}

/* Línea de escaneo láser */
.scanline-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: var(--color-neon-pink);
  box-shadow: 0 0 12px var(--color-neon-pink);
  animation: scanMove 2.5s infinite ease-in-out;
  pointer-events: none;
  z-index: 5;
}

@keyframes scanMove {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

.warning-scanner-text {
  font-family: monospace;
  color: var(--color-danger);
  font-size: 0.85rem;
  letter-spacing: 2px;
  animation: pulseOpacity 0.8s infinite;
  margin-bottom: 0.5rem;
  font-weight: 800;
  text-shadow: 0 0 5px rgba(255, 51, 51, 0.5);
}

@keyframes pulseOpacity {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.role-reveal-animation .role-badge.dramatic-badge {
  font-size: 2.2rem !important;
  font-weight: 900 !important;
  padding: 0.8rem 2.8rem !important;
  border-radius: 40px !important;
  letter-spacing: 3px !important;
  display: inline-block;
  transform: scale(0);
  animation: boomScale 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  animation-delay: 0.6s;
  box-shadow: 0 0 20px currentColor;
}

@keyframes boomScale {
  0% { transform: scale(0); filter: blur(8px); }
  70% { transform: scale(1.1); filter: blur(0px); }
  100% { transform: scale(1); }
}


