/* =====================================================================
   L'atelier de l'axolotl — téléphone d'abord (390 x 844),
   et ça tient aussi sur un grand écran.
   Aucune police distante : on reste sur les polices du téléphone.
   ===================================================================== */
:root {
  --bleu: #0d47a1;
  --bleu-clair: #1565c0;
  --rose: #f48fb1;
  --vert: #69f0ae;
  --rouge: #ff8a80;
  --or: #ffd600;
  --perle: #b3e5fc;
  --blanc: #ffffff;
  --encre: #10243f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #062b63;
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body { -webkit-tap-highlight-color: rgba(255, 255, 255, .15); }

#appli {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(#0d47a1, #062b63 60%, #04204c);
  position: relative;
}

#haut { position: relative; flex: 0 0 auto; }
#scene { display: block; width: 100%; height: auto; }

#bandeau {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 8px;
}

.jeton {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, .40);
  border-radius: 20px;
  padding: 5px 11px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.rond {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: inline-block;
  border: 1.5px solid rgba(0, 0, 0, .30);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .16), inset 0 3px 0 rgba(255, 255, 255, .35);
}
.rond.or { background: var(--or); }
.rond.perle { background: var(--perle); }

#retour {
  position: absolute;
  top: 8px;
  left: 8px;
  min-width: 46px;
  min-height: 46px;
  font-size: 20px;
  padding: 0 12px;
  border-radius: 23px;
  border: none;
  background: rgba(0, 0, 0, .40);
  color: #fff;
}

#bulle {
  position: absolute;
  left: 8px;
  top: 60px;
  max-width: 54%;
  background: rgba(255, 255, 255, .94);
  color: var(--encre);
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .16);
}

#ecran {
  flex: 1 1 auto;
  padding: 12px 12px 36px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

h1 { font-size: 26px; margin: 2px 0 0; text-align: center; }
h2 { font-size: 20px; margin: 6px 0 0; }
h3 { font-size: 17px; margin: 4px 0 0; }
p { font-size: 16px; line-height: 1.45; margin: 4px 0; }
em { font-style: italic; color: #ffe082; }
b, strong { color: #fff59d; }

button {
  font-family: inherit;
  font-size: 18px;
  min-height: 48px;
  padding: 11px 16px;
  border: none;
  border-radius: 14px;
  background: var(--rose);
  color: var(--encre);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .25);
}
button:active { transform: translateY(2px); box-shadow: none; }
button:disabled { opacity: .45; box-shadow: none; }

.grand {
  width: 100%;
  min-height: 72px;
  font-size: 21px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
}
.grand .ico { font-size: 30px; display: inline-flex; align-items: center; justify-content: center; width: 34px; flex: 0 0 34px; }
.ic { vertical-align: -5px; }
button .ic { vertical-align: -6px; }
.grand small { display: block; font-size: 14px; font-weight: 600; opacity: .8; }

.pile { display: flex; flex-direction: column; gap: 10px; }
.ligne { display: flex; gap: 8px; flex-wrap: wrap; }
.ligne > button { flex: 1 1 42%; }

.carte {
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 16px;
  padding: 12px 14px;
}

.regle {
  background: rgba(255, 255, 255, .95);
  color: var(--encre);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.45;
}
.regle em { color: #8e24aa; }
.regle b { color: #ad1457; }

table.tableau {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  background: rgba(255, 255, 255, .95);
  color: var(--encre);
  border-radius: 12px;
  overflow: hidden;
}
table.tableau th, table.tableau td { padding: 7px 8px; text-align: left; border-bottom: 1px solid #cfd8dc; }
table.tableau th { background: #1565c0; color: #fff; font-size: 14px; }
table.tableau td:nth-child(2) { font-weight: 700; color: #ad1457; }
table.tableau td:nth-child(3) { font-size: 14px; color: #455a64; }

.exemple {
  background: rgba(255, 255, 255, .95);
  color: var(--encre);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 16px;
}
.exemple .ang { font-weight: 700; }
.exemple .rep { color: #1b5e20; font-weight: 700; }
.exemple .barre { text-decoration: line-through; color: #90a4ae; }
.exemple .pq { font-size: 14px; color: #37474f; margin-top: 3px; }

.question {
  background: rgba(255, 255, 255, .97);
  color: var(--encre);
  border-radius: 16px;
  padding: 14px;
  font-size: 19px;
  line-height: 1.5;
  font-weight: 600;
}
.question .trou {
  display: inline-block;
  min-width: 74px;
  border-bottom: 4px solid #ad1457;
  text-align: center;
  color: #ad1457;
  font-weight: 800;
}
.question .trou.vierge { background: rgba(173, 20, 87, .10); border-radius: 4px 4px 0 0; }
.question .enonce { font-size: 17px; font-weight: 600; color: #37474f; display: block; margin-bottom: 6px; }
.question .etape { display: block; margin-top: 6px; font-size: 14px; font-weight: 700; color: #6a1b9a; }

.option { width: 100%; background: var(--blanc); font-size: 20px; }
.option.bonne { background: var(--vert); }
.option.mauvaise { background: var(--rouge); }

.mots { display: flex; flex-wrap: wrap; gap: 7px; }
.mots button { flex: 0 0 auto; font-size: 17px; min-height: 46px; background: var(--blanc); }
.mots button.pris { background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .5); box-shadow: none; border: 2px dashed rgba(255, 255, 255, .4); opacity: 1; }

.zone-phrase {
  background: rgba(255, 255, 255, .97);
  color: var(--encre);
  border-radius: 14px;
  min-height: 56px;
  padding: 10px 12px;
  font-size: 19px;
  font-weight: 700;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.zone-phrase .vide { opacity: .4; font-weight: 600; font-size: 16px; }

.ardoise {
  background: rgba(255, 255, 255, .97);
  color: var(--encre);
  border-radius: 14px;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 2px;
}
.ardoise .vide { color: #607d8b; font-size: 18px; letter-spacing: 0; font-weight: 600; }

#clavier { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
#clavier button { min-height: 52px; font-size: 24px; background: var(--blanc); }
#clavier button.action { background: #90caf9; font-size: 18px; }
#clavier button.valide { background: #1b5e20; color: #fff; font-size: 20px; }
.mots + .ligne button.valide, .ligne button.valide { background: #1b5e20; color: #fff; }
.ligne button.action { background: #90caf9; }
.etiquette-zone { font-size: 13px; font-weight: 700; color: #cfe3ff; margin: 2px 0 -6px 4px; letter-spacing: .4px; }

.retour-juste, .retour-faux, .retour-aide {
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 16px;
  line-height: 1.45;
  color: var(--encre);
}
.retour-juste { background: #b9f6ca; }
.retour-faux { background: #ffe0b2; }
.retour-aide { background: #e1f5fe; }
.retour-juste b, .retour-faux b, .retour-aide b { color: #ad1457; }
.retour-juste em, .retour-faux em, .retour-aide em { color: #6a1b9a; }
.gagne { font-weight: 800; }

.barre-progres {
  height: 12px;
  background: rgba(255, 255, 255, .34);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 6px;
  overflow: hidden;
}
.barre-progres div { height: 100%; background: var(--vert); transition: width .25s; }
.compteur { font-size: 15px; text-align: center; color: #cfe3ff; font-weight: 600; }

.onglets { display: flex; gap: 6px; }
.onglets button { flex: 1 1 0; font-size: 15px; min-height: 44px; padding: 8px 6px; background: rgba(255, 255, 255, .22); color: #fff; }
.onglets button.actif { background: var(--or); color: var(--encre); }

.articles { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 9px; }
.article {
  background: rgba(255, 255, 255, .95);
  color: var(--encre);
  border-radius: 14px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.article .nom { font-weight: 800; font-size: 15px; }
.article .prix { font-size: 14px; display: flex; align-items: center; gap: 5px; }
.article button { min-height: 44px; font-size: 15px; padding: 8px 10px; background: var(--vert); }
.article.possede { outline: 3px solid var(--vert); }
.etiquette { display: block; text-align: center; background: #1b5e20; color: #fff; border-radius: 12px; padding: 12px 10px; font-size: 15px; font-weight: 700; min-height: 44px; box-sizing: border-box; line-height: 20px; }
.article .pastille { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .30); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .16), inset 0 5px 0 rgba(255, 255, 255, .35); }
.article .hautA { display: flex; align-items: center; gap: 8px; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, .86);
  color: #fff;
  padding: 11px 18px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 700;
  max-width: 92vw;
  text-align: center;
  z-index: 20;
}

.muet { opacity: .8; font-size: 14px; text-align: center; }

@media (min-width: 600px) {
  #appli { margin: 18px auto; min-height: calc(100vh - 36px); border-radius: 22px; overflow: hidden; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
  h1 { font-size: 30px; }
}
