*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: linear-gradient(135deg, #052e16, #14532d, #0f1a0f);
  color: #e0e0e0;
  padding: 16px;
}

#app {
  position: relative; z-index: 1;
  background: rgba(20, 20, 35, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 28px 24px 24px;
  max-width: 700px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.back-link { font-size: 0.85rem; color: #86efac; text-decoration: none; font-weight: 600; transition: color 0.2s; }
.back-link:hover { color: #bbf7d0; }
h1 { font-size: 1.5rem; font-weight: 800; background: linear-gradient(90deg, #86efac, #22c55e, #16a34a); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.date-titre { font-size: 0.9rem; color: #94a3b8; margin-bottom: 20px; }

/* Cartes de difficulte */
.defi-cartes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
.defi-carte {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 18px 14px;
  cursor: pointer;
  transition: all 0.3s;
}
.defi-carte:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(34, 197, 94, 0.3); transform: translateY(-2px); }
.defi-carte.active { border-color: rgba(34, 197, 94, 0.6); background: rgba(34, 197, 94, 0.15); }
.defi-carte.fait { border-color: rgba(74, 222, 128, 0.4); cursor: default; }
.defi-carte.fait:hover { transform: none; background: rgba(255, 255, 255, 0.06); border-color: rgba(74, 222, 128, 0.4); }
.defi-carte h3 { font-size: 1rem; font-weight: 700; color: #86efac; margin-bottom: 4px; }
.defi-carte .defi-details { font-size: 0.75rem; color: #94a3b8; }
.defi-carte .defi-statut { font-size: 0.78rem; margin-top: 6px; font-weight: 700; }
.defi-carte .statut-disponible { color: #86efac; }
.defi-carte .statut-en-cours { color: #f59e0b; }
.defi-carte .statut-gagne { color: #4ade80; }

/* Zone de jeu */
.zone-jeu { display: none; }
.zone-jeu.visible { display: block; }

.info-bar {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
  padding: 10px 16px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; gap: 16px;
}
.info-item { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; font-weight: 700; }
.info-icon { font-size: 1.1rem; }

/* Simon pads */
.pads-wrapper { display: flex; justify-content: center; margin-bottom: 12px; }
.pads-grid { display: grid; gap: 10px; width: 100%; max-width: 400px; }
.simon-pad {
  aspect-ratio: 1;
  border-radius: 14px;
  cursor: pointer;
  border: 3px solid rgba(255, 255, 255, 0.08);
  transition: filter 0.1s, transform 0.1s, box-shadow 0.1s;
  opacity: 0.55;
  position: relative;
  overflow: hidden;
}
.simon-pad::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  pointer-events: none;
}
.simon-pad.lit {
  opacity: 1;
  filter: brightness(1.5);
  transform: scale(1.06);
  box-shadow: 0 0 20px rgba(255,255,255,0.3);
}
.simon-pad.disabled { cursor: not-allowed; }
.simon-pad.joueur-lit {
  opacity: 1;
  filter: brightness(1.3);
  transform: scale(1.04);
}
.pad-rouge { background: linear-gradient(135deg, #ef4444, #dc2626); }
.pad-bleu { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.pad-vert { background: linear-gradient(135deg, #22c55e, #16a34a); }
.pad-jaune { background: linear-gradient(135deg, #facc15, #eab308); }
.pad-orange { background: linear-gradient(135deg, #f97316, #ea580c); }
.pad-violet { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.pad-cyan { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.pad-rose { background: linear-gradient(135deg, #ec4899, #db2777); }

.message-statut { font-size: 0.88rem; color: #94a3b8; padding: 12px; margin-top: 12px; background: rgba(255, 255, 255, 0.04); border-radius: 10px; }
.message-victoire { color: #4ade80; font-weight: 700; }
.message-erreur { color: #f87171; font-weight: 700; }
.message-sequence { color: #22c55e; font-weight: 700; font-size: 0.95rem; }

/* Classement */
.classement-section { margin-top: 20px; }
.classement-section h3 { font-size: 1rem; font-weight: 700; color: #86efac; margin-bottom: 12px; }
.podium { display: flex; justify-content: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.podium-item { text-align: center; padding: 12px; background: rgba(255, 255, 255, 0.06); border-radius: 12px; min-width: 80px; }
.podium-item:first-child { border: 1px solid rgba(255, 215, 0, 0.2); background: rgba(255, 215, 0, 0.05); }
.podium-rang { font-size: 1.4rem; margin-bottom: 4px; }
.podium-pseudo { font-size: 0.78rem; font-weight: 700; color: #86efac; }
.podium-info { font-size: 0.7rem; color: #94a3b8; margin-top: 2px; }

.non-connecte { padding: 24px; }
.non-connecte p { color: #94a3b8; margin-bottom: 16px; }

.btn {
  font-family: 'Inter', sans-serif; font-size: 0.9rem; font-weight: 700;
  padding: 10px 24px; border: none; border-radius: 10px; cursor: pointer;
  color: #fff; transition: transform 0.2s, box-shadow 0.2s; text-decoration: none; display: inline-block;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: #16a34a; box-shadow: none; }

.btn-mute {
  background: none; border: 1px solid rgba(255,255,255,0.15); border-radius: 8px;
  color: #94a3b8; font-size: 1.1rem; padding: 4px 8px; cursor: pointer; transition: all 0.2s;
}
.btn-mute:hover { border-color: rgba(255,255,255,0.3); }
.btn-mute.muted { opacity: 0.4; }

.partage-score { margin-top: 12px; }

.confetti { position: fixed; top: -10px; z-index: 200; pointer-events: none; font-size: 1.2rem; animation: confetti-fall 3s ease-in forwards; }
@keyframes confetti-fall { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }

footer { font-size: 0.78rem; color: #64748b; margin-top: 8px; }
footer a { color: #86efac; text-decoration: none; }
footer a:hover { color: #bbf7d0; }

@media (max-width: 480px) {
  body { padding-top: 50px; }
  #app { padding: 18px 12px 16px; border-radius: 18px; }
  h1 { font-size: 1.3rem; }
  .defi-cartes { grid-template-columns: 1fr; }
  .pads-grid { gap: 6px; max-width: 280px; }
  .simon-pad { border-radius: 10px; }
  .info-bar { padding: 8px 10px; gap: 8px; }
  .info-item { font-size: 0.8rem; }
}
