@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --dark-gradient: linear-gradient(135deg, #232526 0%, #414345 100%);
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --spy-color: #dc2626;
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--primary-gradient);
  min-height: 100vh;
  color: #1f2937;
  position: relative;
  overflow-x: hidden;
}

/* Partículas animadas de fundo */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.08)"/><circle cx="40" cy="60" r="1" fill="rgba(255,255,255,0.06)"/><circle cx="70" cy="80" r="2.5" fill="rgba(255,255,255,0.04)"/><circle cx="10" cy="80" r="1" fill="rgba(255,255,255,0.08)"/></svg>');
  animation: float 20s infinite linear;
  pointer-events: none;
  z-index: -1;
}

@keyframes float {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-100vh) rotate(360deg); }
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* Logo/Título principal */
h1 {
  color: white;
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 0 10px 20px rgba(0,0,0,0.3);
  position: relative;
  background: linear-gradient(45deg, #fff, #e2e8f0);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h1::after {
  content: '🕵️';
  position: absolute;
  top: -20px;
  right: -30px;
  font-size: 2rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Subtítulo com sua marca */
.subtitle {
  color: rgba(255,255,255,0.9);
  font-size: 1.2rem;
  font-weight: 300;
  margin-bottom: 3rem;
  text-align: center;
  max-width: 600px;
}

.brand-tag {
  background: rgba(255,255,255,0.1);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  margin-top: 10px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
}

/* Cards modernos */
.card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  margin: 1rem 0;
  min-width: 350px;
  border: 1px solid rgba(255,255,255,0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: var(--primary-gradient);
  transition: 0.5s;
}

.card:hover::before {
  left: 0;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 35px 60px -12px rgba(0, 0, 0, 0.3);
}

.card h2 {
  margin-bottom: 1.5rem;
  color: #1f2937;
  text-align: center;
  font-weight: 600;
  font-size: 1.5rem;
  position: relative;
}

.card h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: var(--primary-gradient);
  border-radius: 2px;
}

/* Formulários estilizados */
form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

input, select {
  padding: 15px 20px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  background: white;
}

input:focus, select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

/* Botões impressionantes */
button {
  padding: 15px 30px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}

button:hover::before {
  left: 100%;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Estilos do jogo - Layout moderno */
.game-container {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
}

.game-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 25px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.3);
}

.room-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 1.2rem;
  font-weight: 600;
}

.room-code {
  background: var(--primary-gradient);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
}

.timer {
  font-weight: 700;
  font-size: 1.3rem;
  color: #059669;
  display: flex;
  align-items: center;
  gap: 8px;
}

.timer.warning {
  color: var(--danger-color);
  animation: pulse 1s infinite;
}

/* Informações do jogo mais chamativas */
.game-info {
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 15px;
  border-left: 5px solid #3b82f6;
  position: relative;
  overflow: hidden;
}

.game-info::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="rgba(59,130,246,0.05)" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.94-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/></svg>') no-repeat;
  opacity: 0.3;
}

.spy-info {
  background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
  border-left-color: var(--spy-color);
}

/* Lista de jogadores em grid responsivo */
.players-section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 25px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.3);
}

.players-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.player-card {
  padding: 20px;
  border: 2px solid #e5e7eb;
  border-radius: 15px;
  transition: all 0.3s ease;
  background: white;
  position: relative;
  overflow: hidden;
}

.player-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #e5e7eb;
  transition: 0.3s;
}

.player-card.owner::before {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.player-card.current-turn::before {
  background: linear-gradient(90deg, #10b981, #059669);
}

.player-card:hover {
  border-color: #667eea;
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.player-name {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-score {
  color: #6b7280;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.player-score::before {
  content: '🏆';
  font-size: 14px;
}

/* Controles do jogo */
.game-controls {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 25px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  border: 1px solid rgba(255,255,255,0.3);
}

/* Grid de locais mais organizado */
.locations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.location-item {
  padding: 12px 16px;
  background: white;
  border-radius: 10px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  border: 2px solid #e5e7eb;
  transition: all 0.2s ease;
  cursor: default;
}

.location-item:hover {
  border-color: #667eea;
  background: #f8fafc;
  transform: translateY(-1px);
}

/* Anotações mais elegantes */
.notes-section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 25px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.3);
}

.note-input {
  width: 100%;
  margin-top: 10px;
  resize: vertical;
  min-height: 80px;
  padding: 15px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.note-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Modais melhorados */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: white;
  margin: 5% auto;
  padding: 35px;
  border-radius: 20px;
  width: 90%;
  max-width: 800px; /* Aumentar largura máxima */
  max-height: 85vh; /* Limitar altura máxima */
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease-out;
  position: relative;
  overflow-y: auto; /* Adicionar scroll vertical */
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Botões do espião mais atrativos */
.location-guess-btn {
  padding: 15px 20px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s ease;
  width: 100%;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.location-guess-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.location-guess-btn:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Responsivo melhorado */
@media (max-width: 768px) {
  .game-container {
    padding: 15px;
    gap: 20px;
  }
  
  .players-list {
    grid-template-columns: 1fr;
  }
  
  /* Grid de locais mais organizado */
  .locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 20px;
    max-height: 50vh; /* Limitar altura do grid */
    overflow-y: auto; /* Scroll no próprio grid */
    padding-right: 10px; /* Espaço para a barra de scroll */
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 15px;
    background: #f9fafb;
  }
  
  .card {
    min-width: auto;
    padding: 2rem 1.5rem;
  }
  
  h1 {
    font-size: 2.5rem;
  }
}

/* Botões de votação */
.vote-option {
  padding: 15px 20px;
  margin: 8px 0;
  background: #f8fafc;
  color: #374151;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  width: 100%;
  text-align: center;
  font-family: inherit;
}

.vote-option:hover {
  border-color: #667eea;
  background: #e0e7ff;
  color: #3730a3;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.vote-option.selected {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.vote-option:active {
  transform: translateY(0);
}

.spy-guessing-message {
  text-align: center;
  font-size: 1.1rem;
  color: #dc3545;
  font-weight: bold;
  margin-bottom: 20px;
  padding: 15px;
  background: #fff5f5;
  border-radius: 8px;
  border: 2px solid #fecaca;
}

/* Animações extras */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; transform: scale(1.05); }
}

/* Notificações estilizadas */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  z-index: 10000;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}

/* Estilizar barra de scroll */
.locations-grid::-webkit-scrollbar {
  width: 8px;
}

.locations-grid::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.locations-grid::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}

.locations-grid::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Para Firefox */
.locations-grid {
  scrollbar-width: thin;
  scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Modal específico para escolha do espião */
#spy-guess-modal .modal-content {
  max-width: 900px;
  max-height: 90vh;
}

#spy-guess-modal .locations-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  max-height: 60vh;
  gap: 15px;
}

#spy-guess-modal .location-guess-btn {
  padding: 12px 8px;
  font-size: 0.85rem;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsivo melhorado */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-width: 95%;
    margin: 2% auto;
    padding: 20px;
    max-height: 95vh;
  }
  
  .locations-grid {
    grid-template-columns: repeat(2, 1fr);
    max-height: 70vh;
    gap: 10px;
  }
  
  #spy-guess-modal .location-guess-btn {
    font-size: 0.8rem;
    padding: 10px 5px;
  }
}

@media (max-width: 480px) {
  .locations-grid {
    grid-template-columns: 1fr;
  }
}

/* Header do modal */
.modal-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e5e7eb;
}

.cancel-btn-top {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
}

.cancel-btn-top:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4);
}

.cancel-btn-top:active {
  transform: translateY(0);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .modal-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
  }
  
  .cancel-btn-top {
    padding: 12px 18px;
    font-size: 1rem;
  }
}