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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
}

h1 {
  text-align: center;
  color: #fff;
  font-size: 1.8rem;
  margin-bottom: 0.3rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sous-titre {
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.carte-enfant {
  background: #fff;
  border-radius: 20px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

.carte-enfant:hover {
  transform: scale(1.02);
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  flex-shrink: 0;
}

.info-enfant {
  flex: 1;
}

.prenom {
  font-size: 1.4rem;
  font-weight: 700;
}

.score {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.1;
}

.score-label {
  font-size: 0.85rem;
  color: #888;
}

.lien-parent {
  display: block;
  text-align: center;
  margin-top: 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  text-decoration: none;
}

.lien-parent:hover {
  color: #fff;
}

/* Zone parent */

body.parent-page {
  background: #f0f2f5;
}

.parent-header {
  background: #4a5568;
  color: #fff;
  padding: 1rem;
  text-align: center;
}

.parent-header h1 {
  font-size: 1.3rem;
  text-shadow: none;
}

.parent-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem;
}

.ecran-pin {
  background: #fff;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  margin-top: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.ecran-pin h2 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.pin-input {
  width: 100%;
  max-width: 200px;
  font-size: 2rem;
  text-align: center;
  letter-spacing: 0.5rem;
  padding: 0.5rem;
  border: 2px solid #ddd;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.85;
}

.btn-principal {
  background: #667eea;
  color: #fff;
}

.btn-danger {
  background: #e53e3e;
  color: #fff;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
}

.erreur {
  color: #e53e3e;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.section {
  background: #fff;
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.section h3 {
  font-size: 1rem;
  margin-bottom: 0.8rem;
  color: #4a5568;
}

.selecteur-enfant {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.chip-enfant {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 2px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.chip-enfant.actif {
  border-color: transparent;
  color: #fff;
}

.grille-regles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.btn-regle {
  padding: 0.7rem 0.5rem;
  border: none;
  border-radius: 12px;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
  transition: transform 0.15s;
}

.btn-regle:active {
  transform: scale(0.95);
}

.btn-regle.positif {
  background: #c6f6d5;
  color: #22543d;
}

.btn-regle.negatif {
  background: #fed7d7;
  color: #742a2a;
}

.historique-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.85rem;
}

.historique-item:last-child {
  border-bottom: none;
}

.delta-positif {
  color: #38a169;
  font-weight: 700;
}

.delta-negatif {
  color: #e53e3e;
  font-weight: 700;
}

.barre-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.score-actuel {
  font-size: 1.1rem;
  font-weight: 700;
}

.cacher {
  display: none;
}

.feedback {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #2d3748;
  color: #fff;
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  font-size: 0.95rem;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 100;
}

.feedback.visible {
  opacity: 1;
}

/* Boutique */

.btn-boutique {
  display: block;
  text-align: center;
  background: #fff;
  color: #667eea;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 1rem;
  border-radius: 16px;
  text-decoration: none;
  margin-top: 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.btn-boutique:hover {
  transform: scale(1.02);
}

.etape-label {
  color: #fff;
  font-weight: 600;
  margin-bottom: 0.8rem;
  font-size: 1rem;
}

.solde-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.25);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.85rem;
  margin-left: 0.3rem;
}

.grille-enfants {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.carte-cliquable {
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.carte-cliquable:active {
  transform: scale(0.98);
}

.grille-recompenses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.carte-recompense {
  background: #fff;
  border: none;
  border-radius: 16px;
  padding: 1rem 0.6rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s;
  font-family: inherit;
}

.carte-recompense:active {
  transform: scale(0.95);
}

.carte-recompense.indisponible {
  opacity: 0.4;
  cursor: not-allowed;
}

.rec-icone {
  font-size: 2rem;
}

.rec-libelle {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

.rec-cout {
  font-size: 0.85rem;
  color: #667eea;
  font-weight: 700;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal.ouvert {
  display: flex;
}

.modal-contenu {
  background: #fff;
  border-radius: 20px;
  padding: 1.5rem;
  max-width: 320px;
  width: 100%;
  text-align: center;
}

.modal-contenu p {
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  line-height: 1.4;
}

.modal-boutons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.btn-secondaire {
  background: #e2e8f0;
  color: #4a5568;
}

.btn-annuler-achat {
  background: none;
  border: 1px solid #e53e3e;
  color: #e53e3e;
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  margin-left: 0.3rem;
}
