/* Killer Game — feuille de styles */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg-grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
  --danger: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  --success: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  --gold: #ffd700;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
  --card-bg: rgba(255, 255, 255, 0.1);
  --card-border: rgba(255, 255, 255, 0.2);
  --text-muted: rgba(255, 255, 255, 0.75);
}

html, body {
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-grad);
  background-attachment: fixed;
  color: white;
  font-size: 16px;
  line-height: 1.5;
}

#app {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 16px 80px;
  min-height: 100vh;
}

/* Cartes glass */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
}

/* Titres */
h1 { font-size: 2.2rem; margin-bottom: 8px; text-align: center; }
h2 { font-size: 1.4rem; margin-bottom: 12px; }
h3 { font-size: 1.1rem; margin-bottom: 8px; }
.subtitle { text-align: center; color: var(--text-muted); margin-bottom: 24px; }

/* Boutons */
.btn {
  display: block;
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  margin-bottom: 12px;
  font-family: inherit;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.secondary { background: transparent; border: 2px solid white; }
.btn.danger { background: var(--danger); }
.btn.success { background: var(--success); }
.btn.small { padding: 10px 16px; font-size: 14px; }

/* Inputs */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
input[type="text"], input[type="tel"], input[type="number"], select, textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 16px;
  font-family: inherit;
}
input::placeholder { color: rgba(255, 255, 255, 0.6); }
input:focus, select:focus { outline: none; border-color: white; background: rgba(255, 255, 255, 0.25); }

/* File input + photo preview */
.photo-upload {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  cursor: pointer;
}
.photo-upload .preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.photo-upload .preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-upload .preview .placeholder { font-size: 24px; opacity: 0.6; }
.photo-upload input[type="file"] { display: none; }
.photo-upload .label-txt { font-size: 14px; color: var(--text-muted); }

/* Liste des joueurs */
.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
}
.player-card.host { border: 2px solid var(--gold); }
.player-card.eliminated { opacity: 0.4; }
.player-card.eliminated .avatar img { filter: grayscale(100%); }
.player-card .avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.2);
}
.player-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.player-card .name { font-size: 12px; font-weight: 600; word-break: break-word; }
.player-card .badge {
  font-size: 10px;
  color: var(--gold);
  margin-top: 2px;
}
.player-card .kills { font-size: 11px; color: var(--text-muted); }

/* Cible */
.target-card {
  background: linear-gradient(135deg, #ff4757 0%, #ff3838 100%);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(255, 71, 87, 0.4);
}
.target-card .label { text-transform: uppercase; font-weight: 700; letter-spacing: 1px; opacity: 0.9; margin-bottom: 12px; }
.target-card .photo {
  width: 130px; height: 130px;
  border-radius: 50%;
  border: 4px solid white;
  margin: 0 auto 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.2);
}
.target-card .photo img { width: 100%; height: 100%; object-fit: cover; }
.target-card .target-name { font-size: 1.4rem; font-weight: 700; margin-bottom: 12px; }
.target-card .mission {
  background: rgba(0,0,0,0.3);
  padding: 14px;
  border-radius: 10px;
  font-style: italic;
}

/* Code secret affichage */
.secret-code {
  display: inline-block;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.4em;
  font-family: 'Courier New', monospace;
  padding: 12px 18px;
  background: rgba(0,0,0,0.4);
  border-radius: 12px;
  margin: 8px 0;
}

/* Stats */
.stats {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  flex: 1;
  background: rgba(255,255,255,0.1);
  padding: 14px;
  border-radius: 12px;
  text-align: center;
}
.stat .value { font-size: 1.8rem; font-weight: 800; }
.stat .label { font-size: 11px; text-transform: uppercase; opacity: 0.8; }

/* Code partie */
.game-code-display {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  padding: 16px;
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
  margin: 12px 0;
  font-family: 'Courier New', monospace;
}

/* Toast */
#toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: rgba(0,0,0,0.9);
  color: white;
  padding: 14px 24px;
  border-radius: 25px;
  z-index: 1000;
  transition: transform 0.3s ease;
  max-width: 90%;
  text-align: center;
  font-weight: 600;
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.success { background: linear-gradient(135deg, #2ecc71, #27ae60); }
#toast.error { background: linear-gradient(135deg, #e74c3c, #c0392b); }

/* Animations */
@keyframes pulse-success { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); box-shadow: 0 0 60px #2ecc71; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-12px); } 40%, 80% { transform: translateX(12px); } }
.anim-success { animation: pulse-success 1s ease; }
.anim-shake { animation: shake 0.5s ease; }

/* Podium */
.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 8px;
  margin: 24px 0;
}
.podium-place {
  flex: 1;
  max-width: 110px;
  padding: 12px 8px;
  border-radius: 12px 12px 0 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.podium-place .pp-photo {
  width: 60px; height: 60px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 6px;
  border: 3px solid white;
  background: rgba(255,255,255,0.2);
}
.podium-place .pp-photo img { width: 100%; height: 100%; object-fit: cover; }
.podium-place.gold { background: var(--gold); color: #4a3a00; height: 170px; order: 2; }
.podium-place.silver { background: var(--silver); color: #444; height: 130px; order: 1; }
.podium-place.bronze { background: var(--bronze); color: #fff; height: 110px; order: 3; }
.podium-place .pp-rank { font-size: 1.4rem; font-weight: 800; }
.podium-place .pp-name { font-size: 13px; font-weight: 700; }
.podium-place .pp-kills { font-size: 11px; }

/* Ranking */
.ranking { margin-top: 16px; }
.ranking-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  margin-bottom: 6px;
}
.ranking-row .pos { font-weight: 800; min-width: 28px; }
.ranking-row .photo {
  width: 36px; height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255,255,255,0.2);
  flex-shrink: 0;
}
.ranking-row .photo img { width: 100%; height: 100%; object-fit: cover; }
.ranking-row.eliminated .photo img { filter: grayscale(100%); }
.ranking-row.eliminated { opacity: 0.7; }
.ranking-row .info { flex: 1; }
.ranking-row .info .nm { font-weight: 600; }
.ranking-row .info .sm { font-size: 11px; opacity: 0.7; }
.ranking-row .kc { font-weight: 700; }

/* Kill input */
.kill-section {
  background: rgba(0,0,0,0.25);
  border-radius: 12px;
  padding: 18px;
  margin-top: 12px;
}
.kill-section input {
  text-align: center;
  font-size: 1.6rem;
  letter-spacing: 0.4em;
  font-family: 'Courier New', monospace;
  font-weight: 700;
}

/* Helpers */
.text-center { text-align: center; }
.muted { color: var(--text-muted); font-size: 14px; }
.row { display: flex; gap: 8px; }
.row .btn { flex: 1; }
.warning {
  background: rgba(255, 200, 0, 0.15);
  border: 1px solid rgba(255, 200, 0, 0.4);
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 12px;
}
.error-msg { color: #ffb4b4; font-size: 13px; margin-top: 6px; }
.spacer { height: 12px; }

/* Responsive */
@media (max-width: 480px) {
  h1 { font-size: 1.8rem; }
  .card { padding: 18px; }
  .game-code-display { font-size: 2rem; letter-spacing: 0.2em; }
  .secret-code { font-size: 1.6rem; }
}

/* Admin */
.admin-game {
  background: rgba(255,255,255,0.08);
  padding: 14px;
  border-radius: 12px;
  margin-bottom: 10px;
}
.admin-game .head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.admin-game .badge-status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.admin-game .badge-status.waiting { background: rgba(255, 200, 0, 0.3); }
.admin-game .badge-status.playing { background: rgba(46, 204, 113, 0.4); }
.admin-game .badge-status.finished { background: rgba(150, 150, 150, 0.4); }
.admin-game .codes { margin-top: 8px; font-size: 13px; }
.admin-game .codes div { padding: 4px 0; border-bottom: 1px dashed rgba(255,255,255,0.1); }
