/* =============================================
   EL IMPOSTOR - ESTILOS
   ============================================= */

:root {
  --primary: #6C5CE7;
  --primary-dark: #5A4BD1;
  --primary-light: #A29BFE;
  --secondary: #00CEC9;
  --secondary-dark: #00B5B0;
  --accent: #FD79A8;
  --danger: #E17055;
  --warning: #FDCB6E;
  --success: #00B894;
  --dark: #2D3436;
  --dark-light: #3D4448;
  --gray: #636E72;
  --gray-light: #B2BEC3;
  --light: #DFE6E9;
  --white: #FFFFFF;
  --bg-gradient: linear-gradient(135deg, #0c0c1d 0%, #1a1a3e 50%, #2d1b4e 100%);
  --card-bg: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.1);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-gradient);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

#app {
  position: relative;
  min-height: 100vh;
}

/* Partículas de fondo */
#particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  animation: float linear infinite;
}

@keyframes float {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.15; }
  90% { opacity: 0.15; }
  100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

/* Pantallas */
.screen {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 20px 0;
  animation: fadeIn 0.4s ease;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.container {
  max-width: 500px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =============================================
   PANTALLA INICIO
   ============================================= */
.logo-section {
  text-align: center;
  padding: 40px 0 30px;
}

.logo-icon {
  font-size: 80px;
  line-height: 1;
  margin-bottom: 10px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.logo-title {
  font-size: 2.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary-light), var(--accent), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.logo-subtitle {
  font-size: 1rem;
  color: var(--gray-light);
  font-weight: 300;
  margin-top: 5px;
}

.home-actions {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 30px 25px;
  backdrop-filter: blur(10px);
}

/* Inputs */
.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-light);
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--card-border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--white);
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  transition: var(--transition);
  outline: none;
}

.input-group input::placeholder {
  color: var(--gray);
}

.input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  font-size: 1.2rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 25px rgba(108, 92, 231, 0.5);
  transform: translateY(-2px);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: var(--dark);
  box-shadow: 0 4px 15px rgba(0, 206, 201, 0.3);
}

.btn-secondary:hover:not(:disabled) {
  box-shadow: 0 6px 25px rgba(0, 206, 201, 0.4);
  transform: translateY(-2px);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning), #e7b84d);
  color: var(--dark);
  box-shadow: 0 4px 15px rgba(253, 203, 110, 0.3);
}

.btn-warning:hover:not(:disabled) {
  box-shadow: 0 6px 25px rgba(253, 203, 110, 0.4);
  transform: translateY(-2px);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 2px solid var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--gray-light);
  border: 2px solid var(--card-border);
}

.btn-outline:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.85rem;
  width: auto;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.9rem;
  margin-top: 20px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.1rem;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

.divider span {
  padding: 0 15px;
  color: var(--gray);
  font-size: 0.85rem;
}

/* Error message */
.error-message {
  background: rgba(225, 112, 85, 0.15);
  border: 1px solid rgba(225, 112, 85, 0.3);
  color: var(--danger);
  padding: 12px 18px;
  border-radius: var(--radius-xs);
  margin-top: 15px;
  font-size: 0.9rem;
  text-align: center;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* Selector de aforo */
.capacity-selector {
  margin-top: 12px;
  text-align: center;
}

.capacity-selector label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-light);
  margin-bottom: 8px;
}

.capacity-control {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  border: 2px solid var(--card-border);
  overflow: hidden;
}

.capacity-btn {
  background: none;
  border: none;
  color: var(--primary-light);
  font-size: 1.3rem;
  font-weight: 700;
  width: 44px;
  height: 44px;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Poppins', sans-serif;
}

.capacity-btn:hover {
  background: rgba(108, 92, 231, 0.2);
}

.capacity-btn:active {
  background: rgba(108, 92, 231, 0.3);
}

.capacity-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--white);
  min-width: 40px;
  text-align: center;
}

.capacity-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--gray);
  margin-top: 6px;
}

/* Salas disponibles */
.available-rooms-section {
  margin-top: 25px;
  padding-bottom: 30px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.available-rooms {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.no-rooms {
  text-align: center;
  padding: 30px 20px;
  background: var(--card-bg);
  border: 1px dashed var(--card-border);
  border-radius: var(--radius);
}

.no-rooms-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.no-rooms p {
  color: var(--gray);
  font-size: 0.9rem;
}

.room-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  backdrop-filter: blur(5px);
  transition: var(--transition);
  animation: slideIn 0.3s ease;
}

.room-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-1px);
}

.room-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.room-card-code {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--secondary);
  letter-spacing: 3px;
}

.room-card-host {
  font-size: 0.78rem;
  color: var(--gray-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-card-capacity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.capacity-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  max-width: 100px;
}

.capacity-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.capacity-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-light);
}

.btn-join-room {
  flex-shrink: 0;
  margin-left: 12px;
}

/* =============================================
   SALA DE ESPERA
   ============================================= */
.lobby-header {
  text-align: center;
  padding: 30px 0 20px;
}

.lobby-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.room-code-display {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(10px);
}

.room-code-label {
  display: block;
  font-size: 0.8rem;
  color: var(--gray-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.room-code-value {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--secondary);
  text-shadow: 0 0 20px rgba(0, 206, 201, 0.3);
  margin-bottom: 10px;
}

/* Players */
.players-section {
  margin: 25px 0;
}

.players-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  background: var(--primary);
  color: var(--white);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.players-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  backdrop-filter: blur(5px);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.player-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.player-name {
  font-weight: 500;
  font-size: 0.95rem;
}

.player-badge {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.player-badge.host {
  background: rgba(253, 203, 110, 0.2);
  color: var(--warning);
  border: 1px solid rgba(253, 203, 110, 0.3);
}

.player-badge.you {
  background: rgba(108, 92, 231, 0.2);
  color: var(--primary-light);
  border: 1px solid rgba(108, 92, 231, 0.3);
}

/* Badges de orden de turno */
.order-badge {
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  animation: badgePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgePop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.order-badge.order-speaker {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
  border: 1px solid #e74c3c;
  box-shadow: 0 2px 10px rgba(231, 76, 60, 0.45);
  font-size: 0.75rem;
  padding: 4px 12px;
}

.order-badge.order-double {
  background: linear-gradient(135deg, #f1c40f, #d4a500);
  color: #1a1a2e;
  border: 1px solid #f1c40f;
  box-shadow: 0 2px 10px rgba(241, 196, 15, 0.45);
  font-size: 0.75rem;
  padding: 4px 12px;
}

.order-badge.order-normal {
  background: rgba(255, 255, 255, 0.08);
  color: var(--gray-light);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-kick {
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition);
}

.btn-kick:hover {
  background: rgba(225, 112, 85, 0.2);
  color: var(--danger);
}

/* Host controls */
.host-controls {
  margin: 25px 0;
}

.host-controls h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.themes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.theme-card {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(5px);
}

.theme-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.theme-card.selected {
  border-color: var(--primary);
  background: rgba(108, 92, 231, 0.15);
  box-shadow: 0 0 20px rgba(108, 92, 231, 0.2);
}

.theme-card .theme-icon {
  font-size: 2rem;
  margin-bottom: 6px;
}

.theme-card .theme-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.hint {
  text-align: center;
  color: var(--gray);
  font-size: 0.85rem;
  margin-top: 10px;
}

/* QR Code */
.qr-section {
  margin-top: 20px;
  text-align: center;
}

.qr-code {
  display: inline-block;
  padding: 12px;
  background: var(--white);
  border-radius: var(--radius-sm);
  line-height: 0;
}

.qr-code img,
.qr-code canvas {
  width: 180px !important;
  height: 180px !important;
}

.qr-hint {
  font-size: 0.8rem;
  color: var(--gray);
  margin-top: 10px;
}

/* Pantalla de unión directa via QR */
.join-direct-info {
  background: rgba(0, 206, 201, 0.1);
  border: 1px solid rgba(0, 206, 201, 0.3);
  border-radius: var(--radius-sm);
  padding: 15px;
  margin-bottom: 20px;
  text-align: center;
}

.join-direct-info .join-room-code {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--secondary);
  letter-spacing: 4px;
}

.join-direct-info .join-label {
  font-size: 0.8rem;
  color: var(--gray-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

/* Guest waiting */
.guest-waiting {
  text-align: center;
  padding: 40px 0;
}

.guest-waiting p {
  color: var(--gray-light);
  font-size: 0.95rem;
  margin-top: 15px;
}

.waiting-animation {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.waiting-animation .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-light);
  animation: bounce 1.4s ease-in-out infinite;
}

.waiting-animation .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.waiting-animation .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* =============================================
   PANTALLA DE JUEGO
   ============================================= */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

.game-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.game-theme {
  font-size: 1.2rem;
  font-weight: 700;
}

.game-round {
  font-size: 0.85rem;
  color: var(--gray-light);
}

.room-code-mini {
  font-size: 0.85rem;
  color: var(--gray-light);
}

.room-code-mini strong {
  color: var(--secondary);
}

/* Carta del juego */
.card-container {
  perspective: 1000px;
  margin: 30px auto;
  max-width: 320px;
}

.game-card {
  width: 100%;
  aspect-ratio: 3/4;
  cursor: pointer;
  position: relative;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.game-card[data-flipped="true"] .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.card-front {
  background: linear-gradient(135deg, #1e1e3f, #2d1b4e);
  border: 3px solid var(--card-border);
  box-shadow: var(--shadow);
}

.card-front-icon {
  font-size: 4rem;
  margin-bottom: 15px;
  animation: pulse 2s ease-in-out infinite;
}

.card-front p {
  color: var(--gray-light);
  font-size: 0.95rem;
  text-align: center;
}

.card-back {
  transform: rotateY(180deg);
  border: 3px solid;
  box-shadow: var(--shadow);
}

.card-back.card-normal {
  background: linear-gradient(135deg, #1a3a2a, #0d4a3a);
  border-color: var(--success);
}

.card-back.card-impostor {
  background: linear-gradient(135deg, #3a1a1a, #4a0d0d);
  border-color: var(--danger);
  animation: glowRed 2s ease-in-out infinite;
}

@keyframes glowRed {
  0%, 100% { box-shadow: 0 0 20px rgba(225, 112, 85, 0.3); }
  50% { box-shadow: 0 0 40px rgba(225, 112, 85, 0.5); }
}

.card-type-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.card-word {
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
}

.card-impostor .card-word {
  color: var(--danger);
}

.card-normal .card-word {
  color: var(--success);
}

.card-emoji {
  font-size: 4rem;
  margin-bottom: 10px;
}

.card-hint {
  text-align: center;
  color: var(--gray);
  font-size: 0.85rem;
  margin: 15px 0;
}

/* Game players */
.game-players {
  margin: 20px 0;
}

.game-players h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--gray-light);
}

.players-list.compact .player-item {
  padding: 8px 14px;
}

/* Game host controls */
.game-host-controls {
  margin: 25px 0;
  text-align: center;
}

/* =============================================
   VOTING SECTION
   ============================================= */
.voting-section {
  margin: 20px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.voting-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--white);
}

.voting-hint {
  font-size: 0.85rem;
  color: var(--gray);
  margin-bottom: 16px;
}

.voting-players {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}

.vote-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--card-border);
  color: var(--gray-light);
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: 'Inter', sans-serif;
}

.vote-chip:hover {
  border-color: var(--primary);
  background: rgba(108, 92, 231, 0.12);
  color: var(--white);
  transform: translateY(-2px);
}

.vote-chip.selected {
  border-color: var(--accent);
  background: rgba(253, 121, 168, 0.2);
  color: var(--white);
  box-shadow: 0 0 15px rgba(253, 121, 168, 0.3);
  transform: translateY(-2px);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #e84393);
  color: var(--white);
  border: none;
  padding: 12px 32px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}

.btn-accent:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(253, 121, 168, 0.4);
}

.btn-accent:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-accent.vote-sent {
  background: linear-gradient(135deg, var(--success), #55efc4);
  color: #1a1a3e;
}

.vote-status {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--gray-light);
  font-weight: 500;
}

.player-badge.voted {
  font-size: 0.85rem;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(0, 184, 148, 0.15);
}

/* Fase de elección de tema (Nº1) */
.game-theme-chooser {
  margin: 20px 0;
  animation: fadeIn 0.4s ease;
}

.theme-chooser-header {
  text-align: center;
  margin-bottom: 20px;
}

.theme-chooser-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 8px;
}

.theme-chooser-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--warning), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.theme-chooser-header p {
  font-size: 0.9rem;
  color: var(--gray-light);
}

/* Esperando elección de tema */
.game-theme-waiting {
  text-align: center;
  padding: 40px 20px;
  margin: 20px 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.4s ease;
}

.game-theme-waiting p {
  font-size: 1rem;
  color: var(--gray-light);
  margin-top: 15px;
}

.game-theme-waiting strong {
  color: var(--warning);
}

/* =============================================
   PANTALLA DE RESULTADOS
   ============================================= */
.results-header {
  text-align: center;
  padding: 30px 0;
}

.results-header h2 {
  font-size: 2rem;
  font-weight: 800;
}

.results-content {
  text-align: center;
}

.results-impostor-reveal {
  background: var(--card-bg);
  border: 2px solid var(--danger);
  border-radius: var(--radius);
  padding: 30px;
  margin-bottom: 25px;
  animation: fadeIn 0.5s ease;
}

.results-impostor-reveal .reveal-icon {
  font-size: 4rem;
  margin-bottom: 10px;
}

.results-impostor-reveal .reveal-label {
  font-size: 0.85rem;
  color: var(--gray-light);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 5px;
}

.results-impostor-reveal .reveal-name {
  font-size: 2rem;
  font-weight: 800;
  color: var(--danger);
  margin-bottom: 15px;
}

.results-word-reveal {
  background: rgba(0, 184, 148, 0.1);
  border: 1px solid rgba(0, 184, 148, 0.3);
  border-radius: var(--radius-sm);
  padding: 15px;
  margin-bottom: 25px;
}

.results-word-reveal .word-label {
  font-size: 0.8rem;
  color: var(--gray-light);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.results-word-reveal .word-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--success);
}

.results-players-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 25px;
}

.results-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.results-player.is-impostor {
  border-color: var(--danger);
  background: rgba(225, 112, 85, 0.1);
}

.results-player .role-badge {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.results-player .role-badge.impostor {
  background: rgba(225, 112, 85, 0.2);
  color: var(--danger);
}

.results-player .role-badge.normal {
  background: rgba(0, 184, 148, 0.2);
  color: var(--success);
}

#results-host-controls,
#results-guest-waiting {
  margin-top: 25px;
  text-align: center;
}

#results-guest-waiting p {
  color: var(--gray-light);
  margin-top: 15px;
}

/* =============================================
   RESULTS: VOTES, SCORES & RANKING
   ============================================= */

/* Votes section */
.results-votes-section {
  margin: 20px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

.results-votes-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--white);
}

.votes-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vote-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.vote-voter {
  font-weight: 600;
  color: var(--gray-light);
  min-width: 80px;
}

.vote-arrow {
  color: var(--gray);
  font-size: 0.8rem;
}

.vote-target {
  font-weight: 600;
}

.vote-target.vote-correct {
  color: var(--success);
}

.vote-target.vote-wrong {
  color: var(--accent);
}

.vote-target.no-vote {
  color: var(--gray);
  font-style: italic;
  font-weight: 400;
}

/* Round scores section */
.results-scores-section {
  margin: 20px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}

.results-scores-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--white);
}

.scores-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
}

.score-row.is-impostor {
  border-left-color: var(--accent);
}

.score-player-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-player-info .role-icon {
  font-size: 1.1rem;
}

.score-player-info .player-name {
  font-weight: 600;
  color: var(--white);
  font-size: 0.95rem;
}

.round-score-badge {
  font-weight: 800;
  font-size: 1rem;
  padding: 4px 12px;
  border-radius: 20px;
  min-width: 50px;
  text-align: center;
}

.round-score-badge.score-positive {
  background: rgba(0, 184, 148, 0.2);
  color: var(--success);
}

.round-score-badge.score-negative {
  background: rgba(253, 121, 168, 0.2);
  color: var(--accent);
}

.round-score-badge.score-zero {
  background: rgba(178, 190, 195, 0.15);
  color: var(--gray);
}

/* Ranking section (shared lobby + results) */
.results-ranking-section {
  margin: 20px 0;
  padding: 16px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(253, 203, 110, 0.06));
  border: 1px solid rgba(253, 203, 110, 0.2);
  border-radius: var(--radius);
}

.results-ranking-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--white);
}

.ranking-section {
  margin: 20px 0;
  padding: 16px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(253, 203, 110, 0.06));
  border: 1px solid rgba(253, 203, 110, 0.2);
  border-radius: var(--radius);
}

.ranking-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--white);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ranking-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

.ranking-entry.ranking-me {
  background: rgba(108, 92, 231, 0.15);
  border: 1px solid rgba(108, 92, 231, 0.3);
}

.ranking-pos {
  font-size: 1.2rem;
  min-width: 28px;
  text-align: center;
  font-weight: 700;
}

.ranking-name {
  flex: 1;
  font-weight: 600;
  color: var(--white);
  font-size: 0.95rem;
}

.ranking-score {
  font-weight: 800;
  font-size: 1rem;
  color: var(--secondary);
  min-width: 60px;
  text-align: right;
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.2s ease;
}

.modal {
  background: #1e1e3f;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 30px;
  max-width: 380px;
  width: 90%;
  text-align: center;
}

.modal h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.modal p {
  color: var(--gray-light);
  font-size: 0.9rem;
  margin-bottom: 25px;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-actions .btn {
  flex: 1;
}

/* =============================================
   TOAST
   ============================================= */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #1e1e3f;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  min-width: 250px;
  max-width: 350px;
  box-shadow: var(--shadow);
  animation: toastIn 0.4s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.toast.toast-exit {
  animation: toastOut 0.3s ease forwards;
}

.toast-icon {
  font-size: 1.2rem;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px); }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 400px) {
  .logo-title {
    font-size: 2.2rem;
  }

  .room-code-value {
    font-size: 2rem;
    letter-spacing: 5px;
  }

  .themes-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .vote-chip {
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  .voting-section {
    padding: 14px;
  }

  .ranking-entry {
    padding: 8px 10px;
  }

  .ranking-score {
    font-size: 0.9rem;
  }

  .vote-row {
    font-size: 0.8rem;
    gap: 6px;
    padding: 6px 8px;
  }

  .vote-voter {
    min-width: 60px;
  }

  .theme-card {
    padding: 12px 8px;
  }

  .card-word {
    font-size: 1.6rem;
  }

  .toast-container {
    right: 10px;
    left: 10px;
  }

  .toast {
    min-width: auto;
  }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--gray);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-light);
}

/* Selección */
::selection {
  background: var(--primary);
  color: var(--white);
}

/* =============================================
   STEPS HOME
   ============================================= */
.home-step {
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.3s;
}

.home-step:hover {
  border-color: rgba(108, 92, 231, 0.3);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.step-label {
  font-weight: 600;
  font-size: 1rem;
  color: var(--gray-light);
}

.step-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-content .input-group {
  margin-bottom: 0;
}

.step-content .input-group label {
  font-size: 0.85rem;
  color: var(--gray-light);
  margin-bottom: 4px;
  display: block;
}

/* =============================================
   PAGINACIÓN
   ============================================= */
.rooms-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
}

.page-info {
  color: var(--gray-light);
  font-size: 0.85rem;
  font-weight: 500;
  min-width: 50px;
  text-align: center;
}

.btn-small {
  padding: 6px 14px !important;
  font-size: 0.8rem !important;
  min-width: auto !important;
}

.btn-small:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* =============================================
   ADMIN LINK
   ============================================= */
.admin-link {
  margin-top: 30px;
  text-align: center;
  padding-bottom: 20px;
}

.admin-link .btn {
  font-size: 0.8rem;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.admin-link .btn:hover {
  opacity: 1;
}

.btn-sm {
  padding: 8px 20px !important;
  font-size: 0.85rem !important;
}

/* =============================================
   ADMIN DASHBOARD
   ============================================= */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--card-border);
}

.admin-header h2 {
  font-size: 1.4rem;
  margin: 0;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s;
}

.stat-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.admin-section {
  margin-bottom: 25px;
}

.admin-section h3 {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: var(--gray-light);
}

.no-data {
  color: var(--gray);
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--card-border);
}

/* Admin Room Cards */
.admin-room-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  transition: border-color 0.3s;
}

.admin-room-card:hover {
  border-color: rgba(108, 92, 231, 0.3);
}

.admin-room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.admin-room-code {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--secondary);
}

.admin-room-status {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.admin-room-status.status-waiting {
  background: rgba(253, 203, 110, 0.15);
  color: var(--warning);
}

.admin-room-status.status-playing {
  background: rgba(0, 206, 201, 0.15);
  color: var(--secondary);
}

.admin-room-status.status-revealing {
  background: rgba(162, 155, 254, 0.15);
  color: var(--primary-light);
}

.admin-room-details {
  display: flex;
  gap: 15px;
  font-size: 0.8rem;
  color: var(--gray);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.admin-room-players {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-player-tag {
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--gray-light);
}

.admin-player-tag.is-host {
  border: 1px solid rgba(253, 203, 110, 0.3);
  color: var(--warning);
}

.admin-player-tag.is-impostor {
  border: 1px solid rgba(253, 121, 168, 0.3);
  color: var(--accent);
  background: rgba(253, 121, 168, 0.08);
}

.admin-room-impostors {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  color: var(--accent);
}

.admin-room-impostors .impostor-label {
  font-weight: 600;
}

.admin-room-impostors .impostor-name {
  font-weight: 500;
}

/* History Cards */
.history-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.history-room {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: var(--primary-light);
}

.history-date {
  font-size: 0.75rem;
  color: var(--gray);
}

.history-details {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--gray-light);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.history-players {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Admin responsive */
@media (max-width: 400px) {
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-value {
    font-size: 1.6rem;
  }

  .admin-room-details {
    flex-direction: column;
    gap: 4px;
  }

  .history-details {
    flex-direction: column;
    gap: 4px;
  }
}
