:root {
  --nuit: #0e1120;
  --nuit-clair: #1a2040;
  --pierre: #e9ebf4;
  --encre: #1c2038;
  --gris: #6b7090;
  --lame: #3cd16f;          /* couleur du sabre, modifiée selon le choix */
  --lame-lueur: rgba(60, 209, 111, .55);
  --police-titre: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --police-texte: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
}

/* La page entière prend la couleur du sabre choisi (sans JavaScript) */
body:has(#rouge:checked), body.rouge { --lame: #ff3b4e; --lame-lueur: rgba(255, 59, 78, .55); }
body:has(#vert:checked),  body.vert  { --lame: #3cd16f; --lame-lueur: rgba(60, 209, 111, .55); }
body:has(#bleu:checked),  body.bleu  { --lame: #3fa4ff; --lame-lueur: rgba(63, 164, 255, .55); }

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background-color: #0e1120;
}

.fond {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;¨¨
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
  font-family: var(--police-texte);
  color: var(--encre);
  background: radial-gradient(circle at 50% 0%, var(--lame-lueur), transparent 55%);
}
/* ---------- Carte ---------- */
.carte {
  position: relative;
  width: 100%;
  max-width: 30rem;
  padding: 3.5rem 2rem 2rem;
  background: var(--pierre);
  border-radius: 1.5rem 1.5rem .5rem .5rem;
  box-shadow: 0 0 3rem var(--lame-lueur), 0 1.5rem 3rem rgba(0, 0, 0, .5);
}

/* La lame lumineuse qui borde le haut de la carte */
.lame {
  position: absolute;
  top: 1.2rem;
  left: 2rem;
  right: 2rem;
  height: .5rem;
  border-radius: 1rem;
  background: linear-gradient(90deg, #fff, var(--lame) 20%, var(--lame) 80%, #fff);
  box-shadow: 0 0 .6rem var(--lame), 0 0 1.6rem var(--lame);
  transition: background .4s, box-shadow .4s;
}


h1 {
  margin: 0 0 .5rem;
  font-family: var(--police-titre);
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: .02em;
}

.devise {
  margin: 0 0 1.8rem;
  font-family: var(--police-titre);
  font-style: italic;
  line-height: 1.5;
  color: var(--gris);
}

/* ---------- Formulaire ---------- */
.champ {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: 1.1rem;
}

label,
legend {
  font-weight: bold;
  font-size: .9rem;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: .7rem .9rem;
  font: inherit;
  color: var(--encre);
  background: #fff;
  border: 2px solid #c9cce0;
  border-radius: .4rem;
  transition: border-color .25s, box-shadow .25s;
}

textarea { resize: vertical; }

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--lame);
  box-shadow: 0 0 0 .2rem var(--lame-lueur);
}

/* ---------- Choix du sabre : grille de trois pastilles ---------- */
.sabres {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
  margin: 0 0 1.5rem;
  padding: 0;
  border: none;
}

.sabres legend {
  grid-column: 1 / -1;
  padding: 0;
  margin-bottom: .4rem;
}

/* On cache le vrai bouton radio, mais il reste accessible au clavier */
.sabres input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pastille {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .6rem .4rem;
  cursor: pointer;
  background: #fff;
  border: 2px solid #c9cce0;
  border-radius: 2rem;
  transition: transform .2s, border-color .2s, background .2s;
}

/* Petit point coloré devant chaque nom */
.pastille::before {
  content: "";
  width: .9rem;
  height: .9rem;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 .5rem var(--c);
}

.pastille.rouge { --c: #ff3b4e; }
.pastille.vert  { --c: #3cd16f; }
.pastille.bleu  { --c: #3fa4ff; }

.pastille:hover { transform: translateY(-2px); }

.sabres input:checked + .pastille {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, #fff);
}

.sabres input:focus-visible + .pastille {
  outline: 3px solid var(--encre);
  outline-offset: 2px;
}

/* ---------- Bouton ---------- */
button {
  width: 100%;
  padding: .95rem;
  font: bold 1rem var(--police-texte);
  letter-spacing: .04em;
  color: var(--nuit);
  background: var(--lame);
  border: none;
  border-radius: .4rem;
  cursor: pointer;
  box-shadow: 0 0 1rem var(--lame-lueur);
  transition: transform .15s, box-shadow .25s, background .4s;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 1.8rem var(--lame);
}

button:active { transform: translateY(1px); }

/* ---------- Page de resultat (traitement.php) ---------- */
.carte.large { max-width: 38rem; }

.resultat {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: #fff;
}

.resultat th,
.resultat td {
  padding: .7rem .9rem;
  text-align: left;
  border-bottom: 1px solid #d5d8e8;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.resultat thead th {
  color: #fff;
  background: var(--nuit-clair);
}

.resultat tbody th {
  width: 9rem;
  color: var(--gris);
}

.resultat tbody tr:nth-child(even) { background: #f4f5fb; }

.echantillon {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  margin-right: .5rem;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--lame);
  box-shadow: 0 0 .6rem var(--lame);
}

.retour {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--encre);
  font-weight: bold;
}

/* ---------- Petits Ecrans ---------- */
@media (max-width: 30rem) {
  .carte { padding: 3.2rem 1.2rem 1.5rem; }
  h1 { font-size: 1.6rem; }
  .sabres { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
