/* Nuit Secrète - CSS Corrigé */
/* Reset et base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Couleurs */
  --bg-primary: linear-gradient(135deg, #2a1a5e 0%, #4c2c92 50%, #6b4bc7 100%);
  --bg-secondary: rgba(255, 255, 255, 0.1);
  --bg-glass: rgba(255, 255, 255, 0.15);
  --bg-glass-hover: rgba(255, 255, 255, 0.25);

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.8);
  --text-accent: #74e4c4;
  --text-muted: rgba(255, 255, 255, 0.6);

  --color-success: #4ade80;
  --color-warning: #fcd34d;
  --color-danger: #f87171;
  --color-info: #60a5fa;

  /* Dimensions */
  --border-radius: 16px;
  --border-radius-lg: 24px;
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;

  /* Typographie */
  --font-size-xs: 14px;
  --font-size-sm: 16px;
  --font-size-md: 18px;
  --font-size-lg: 24px;
  --font-size-xl: 32px;
  --font-size-xxl: 48px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.37);
}

/* Base */
html {
  font-size: 16px;
  line-height: 1.6;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: var(--bg-primary);
  background-attachment: fixed;
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* Container principal - CRITIQUE */
.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: var(--spacing-md);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
}

/* Écrans - CORRECTION PRINCIPALE */
.screen {
  display: none !important; /* Force le masquage par défaut */
  flex-direction: column;
  flex: 1;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
  min-height: calc(100vh - 48px); /* Compenser le padding du container */
  width: 100%;
  position: relative;
}

.screen.active {
  display: flex !important; /* Force l'affichage quand actif */
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

/* Logo et titre */
.logo-container {
  margin-bottom: var(--spacing-lg);
}

.logo-circle {
  width: 200px;
  height: 200px;
  margin: 0 auto var(--spacing-md);
}

.logo-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(var(--shadow-md));
}

.main-title {
  font-size: var(--font-size-xxl);
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  text-shadow: var(--shadow-md);
  line-height: 1.2;
}

.subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xl);
}

.screen-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--spacing-lg);
  text-align: center;
  line-height: 1.2;
}

/* Boutons de mode */
.mode-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.mode-btn {
  background: var(--bg-glass);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius-lg);
  color: var(--text-primary);
  padding: var(--spacing-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-glass);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  font-size: var(--font-size-sm);
  width: 100%;
}

.mode-btn:hover {
  background: var(--bg-glass-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.mode-btn.primary {
  background: linear-gradient(
    135deg,
    rgba(116, 228, 196, 0.2),
    rgba(116, 228, 196, 0.1)
  );
  border-color: var(--text-accent);
}

.mode-title {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-primary);
}

.mode-description {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* Sections d'input */
.input-section {
  width: 100%;
  max-width: 600px;
  margin: 0 auto var(--spacing-lg);
}

.input-group {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
  width: 100%;
}

/* Inputs */
input[type="text"] {
  flex: 1;
  background: var(--bg-glass);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-md);
  backdrop-filter: blur(20px);
  transition: all 0.3s ease;
  outline: none;
}

input[type="text"]:focus {
  border-color: var(--text-accent);
  box-shadow: 0 0 0 3px rgba(116, 228, 196, 0.2);
}

input[type="text"]::placeholder {
  color: var(--text-muted);
}

/* Boutons */
button,
.btn-add,
.btn-primary,
.btn-scan,
.btn-secondary {
  background: var(--bg-glass);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: var(--font-size-md);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    rgba(116, 228, 196, 0.3),
    rgba(116, 228, 196, 0.1)
  );
  border-color: var(--text-accent);
  padding: var(--spacing-md) var(--spacing-xl);
  font-size: var(--font-size-lg);
  font-weight: 600;
}

button:hover,
.btn-add:hover,
.btn-primary:hover,
.btn-scan:hover,
.btn-secondary:hover {
  background: var(--bg-glass-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: linear-gradient(
    135deg,
    rgba(116, 228, 196, 0.4),
    rgba(116, 228, 196, 0.2)
  );
}

button:disabled,
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Liste des joueurs */
.players-list {
  width: 100%;
  max-width: 600px;
  margin: 0 auto var(--spacing-lg);
  max-height: 400px;
  overflow-y: auto;
}

.player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-glass);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  backdrop-filter: blur(20px);
  transition: all 0.3s ease;
}

.player-item:hover {
  background: var(--bg-glass-hover);
}

.player-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.player-avatar {
  width: 32px;
  height: 32px;
  background: var(--text-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #1f2937;
  font-size: var(--font-size-sm);
}

.player-name {
  font-weight: 500;
  font-size: var(--font-size-md);
}

.player-remove {
  background: rgba(248, 113, 113, 0.2);
  border: 1px solid rgba(248, 113, 113, 0.5);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-danger);
  transition: all 0.3s ease;
}

.player-remove:hover {
  background: rgba(248, 113, 113, 0.3);
}

/* Actions du bas */
.bottom-actions {
  margin-top: auto;
  padding-top: var(--spacing-xl);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
}

/* Barre de statut */
.status-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(42, 26, 94, 0.9);
  backdrop-filter: blur(20px);
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-sm);
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.status-info {
  display: flex;
  gap: var(--spacing-md);
}

.status-info span {
  color: var(--text-secondary);
}

/* QR Code */
.qr-container {
  margin: var(--spacing-xl) 0;
}

.qr-code {
  width: 200px;
  height: 200px;
  background: white;
  border-radius: var(--border-radius);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
}

.qr-placeholder {
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-pattern {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #000 50%, transparent 50%),
    linear-gradient(#000 50%, transparent 50%);
  background-size: 10px 10px;
  opacity: 0.8;
}

.qr-instruction {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  margin-top: var(--spacing-md);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: var(--spacing-sm);
  }

  .main-title {
    font-size: var(--font-size-xl);
  }

  .screen-title {
    font-size: var(--font-size-lg);
  }

  .mode-buttons {
    max-width: 100%;
  }

  .input-group {
    flex-direction: column;
    align-items: stretch;
  }

  .bottom-actions {
    flex-direction: column;
    align-items: center;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen.active {
  animation: fadeIn 0.5s ease-out;
}

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

.qr-pattern {
  animation: pulse 2s infinite;
}

/* États de chargement */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 2px solid transparent;
  border-top: 2px solid var(--text-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 9999;
}

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

/* Messages de notification */
.notification {
  position: fixed;
  top: 60px;
  right: var(--spacing-md);
  background: var(--bg-glass);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  animation: slideInRight 0.3s ease-out;
}

.notification.success {
  border-color: var(--color-success);
  background: rgba(74, 222, 128, 0.1);
}

.notification.error {
  border-color: var(--color-danger);
  background: rgba(248, 113, 113, 0.1);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Classes utilitaires */
.hidden {
  display: none !important;
}

.invisible {
  visibility: hidden !important;
}

.text-center {
  text-align: center !important;
}

.w-full {
  width: 100% !important;
}

.flex {
  display: flex !important;
}

.flex-col {
  flex-direction: column !important;
}

.items-center {
  align-items: center !important;
}

.justify-center {
  justify-content: center !important;
}
