:root {
  --fond: #0b0b0b;
  --cuir: #141414;
  --papier: #ece6d8;
  --encre: #e9e3d4;
  --pale: #8f897c;
  --trait: #2a2826;
  --rouge: #a3121a;
  --rouge-vif: #d0222b;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 18px;
  line-height: 1.45;
  min-height: 100vh;
}
button, input { font: inherit; color: inherit; }

/* En-tête */
.entete {
  text-align: center;
  padding: 28px 16px 0;
  max-width: 640px;
  margin: 0 auto;
}
.titre {
  font-family: "UnifrakturMaguntia", serif;
  font-weight: 400;
  font-size: 56px;
  line-height: 1;
  margin: 0;
  letter-spacing: 1px;
}
.sous-titre {
  margin: 6px 0 18px;
  color: var(--pale);
  font-style: italic;
}
.onglets {
  display: flex;
  border-bottom: 1px solid var(--trait);
}
.onglets a {
  flex: 1;
  padding: 10px 0;
  color: var(--pale);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .5px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.onglets a.actif { color: var(--encre); border-color: var(--rouge); }

main { max-width: 640px; margin: 0 auto; padding: 0 16px 48px; }

/* La page du cahier */
.page {
  background: var(--cuir);
  border: 1px solid var(--trait);
  border-left: 4px solid var(--rouge);
  margin-top: 20px;
  padding: 22px 20px 26px;
}
.regle {
  margin: 0 0 22px;
  font-style: italic;
  color: var(--pale);
  font-size: 16px;
  border-bottom: 1px solid var(--trait);
  padding-bottom: 14px;
}
.etiquette {
  display: block;
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--pale);
  margin: 20px 0 8px;
}

/* Puces de noms */
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce {
  border: 1px solid #3a3733;
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}
.puce.choisie { background: var(--encre); color: var(--fond); border-color: var(--encre); }
.puce.plus { border-style: dashed; color: var(--pale); }
.puce .nb { color: var(--pale); font-weight: 500; margin-left: 4px; }
.puce.choisie .nb { color: #555; }
.puces.petites .puce { padding: 4px 12px; font-size: 16px; }

.ajout[hidden] { display: none; }
.ajout { display: flex; gap: 8px; margin-top: 10px; }
.ajout input {
  flex: 1; min-width: 0;
  background: transparent; border: 1px solid #3a3733; padding: 6px 12px;
}

/* Champs écrits à la plume */
.plume {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid #3a3733;
  font-family: "Caveat", cursive;
  font-size: 30px;
  padding: 2px 2px 4px;
  outline: none;
}
.plume:focus { border-color: var(--encre); }
.plume::placeholder { color: #4a4640; }

button.petit, .sceller {
  background: var(--encre);
  color: var(--fond);
  border: none;
  cursor: pointer;
  font-weight: 700;
}
button.petit { padding: 6px 14px; }
.sceller {
  margin-top: 28px;
  width: 100%;
  padding: 14px;
  background: var(--rouge);
  color: #fff;
  font-size: 19px;
  letter-spacing: .5px;
}
.sceller:disabled { opacity: .6; }
.message { min-height: 1.4em; margin: 12px 0 0; text-align: center; font-style: italic; }
.message.erreur { color: var(--rouge-vif); }

/* Liste du cahier */
.liste { list-style: none; margin: 18px 0 0; padding: 0; }
.entree {
  position: relative;
  padding: 12px 34px 12px 0;
  border-bottom: 1px solid var(--trait);
}
.entree .nom { font-family: "Caveat", cursive; font-size: 30px; font-weight: 700; line-height: 1.1; }
.entree .phrase { font-family: "Caveat", cursive; font-size: 24px; line-height: 1.2; }
.barre { color: var(--rouge-vif); }
.entree .date { font-size: 14px; color: var(--pale); margin-top: 2px; }
.entree .effacer {
  position: absolute; right: 0; top: 14px;
  background: none; border: none; color: #55514a; cursor: pointer; font-size: 22px; line-height: 1;
}
.entree .effacer:hover { color: var(--rouge-vif); }
.entree.nouvelle .nom, .entree.nouvelle .phrase { animation: ecrire 1.1s ease-out both; }
.entree.nouvelle .phrase { animation-delay: .35s; }
@keyframes ecrire { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.vide { text-align: center; color: var(--pale); font-style: italic; padding: 30px 0 10px; }

/* Débrief */
.semaine { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--trait); padding-bottom: 14px; }
.semaine-titre { flex: 1; text-align: center; font-weight: 700; font-size: 20px; }
.semaine-titre small { display: block; font-weight: 500; font-style: italic; color: var(--pale); font-size: 15px; }
.fleche {
  background: none; border: 1px solid #3a3733; width: 38px; height: 38px;
  cursor: pointer; font-size: 22px; line-height: 1;
}
.fleche:disabled { opacity: .25; cursor: default; }

.bloc { margin-top: 24px; }
.bloc h2 {
  font-size: 15px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--pale);
  margin: 0 0 10px; font-weight: 700;
}
.verdict {
  font-family: "Caveat", cursive; font-size: 27px; line-height: 1.25;
  border-left: 3px solid var(--rouge); padding-left: 14px; margin: 0;
}
.podium { list-style: none; padding: 0; margin: 0; }
.podium li { display: flex; align-items: baseline; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--trait); }
.podium .rang { width: 28px; font-weight: 700; color: var(--pale); }
.podium li:first-child .rang { color: var(--rouge-vif); }
.podium .qui { flex: 1; font-family: "Caveat", cursive; font-size: 28px; font-weight: 700; }
.podium .combien { color: var(--pale); }
.carte { font-family: "Caveat", cursive; font-size: 25px; line-height: 1.25; }
.carte small { display: block; font-family: "Cormorant Garamond", serif; font-size: 15px; color: var(--pale); }
.chiffre { font-size: 44px; font-weight: 700; line-height: 1; }
.chiffre small { font-size: 17px; font-weight: 500; color: var(--pale); margin-left: 6px; }

@media (max-width: 480px) {
  body { font-size: 17px; }
  .entete { padding-top: 20px; }
  .titre { font-size: 44px; }
  .sous-titre { margin-bottom: 12px; font-size: 16px; }
  .page { padding: 18px 14px 22px; margin-top: 14px; }
  .plume { font-size: 26px; }
  .entree .nom { font-size: 26px; }
  .entree .phrase { font-size: 22px; }
  .verdict { font-size: 24px; }
}
