/* =========================================================
   style.css — l'habit d'Ember (maquette v5)
   nuit #121a24 · or #d8a94e · braise #e3903a
   Règle : jamais de texte sur une image ; le texte vit dessous, sur fond nuit.
   ========================================================= */

@font-face { font-family: 'Cinzel'; src: url('../polices/cinzel-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Cinzel'; src: url('../polices/cinzel-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('../polices/cormorant-garamond-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('../polices/cormorant-garamond-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('../polices/cormorant-garamond-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  color-scheme: dark;
  --fond: #0b1016;
  --nuit: #121a24; --nuit2: #1b2733; --pierre: #2a3a46;
  --braise: #e3903a; --or: #d8a94e; --or-pale: #f3dea2;
  --ivoire: #f4ecdc; --brume: #a6b0b8; --vert: #6fa87a; --rouge: #c4584c;
  --menu: calc(78px + env(safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--fond); color: var(--ivoire);
  font-family: 'Cormorant Garamond', Georgia, serif; font-size: 19px; line-height: 1.45;
  display: flex; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.telephone {
  width: 100%; max-width: 430px; min-height: 100vh; min-height: 100dvh;
  background: var(--nuit); position: relative; overflow-x: hidden;
  padding-bottom: calc(var(--menu) + 28px);      /* de la place sous chaque écran pour le menu */
}
h1, h2, h3, .cinzel { font-family: Cinzel, Georgia, serif; letter-spacing: .02em; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--or-pale); outline-offset: 2px; }
[hidden] { display: none !important; }
.centre { text-align: center; }

/* ---------- pages ---------- */
.page { display: none; position: relative; }
.page.actif { display: block; animation: fondu .45s ease; }
@keyframes fondu { from { opacity: 0 } to { opacity: 1 } }

/* ---------- grandes images (sans texte dessus) ---------- */
.tete { position: relative; overflow: hidden; background: var(--fond); }
.tete img { width: 100%; height: 100%; object-fit: cover; }
.tete::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 34%; background: linear-gradient(180deg, rgba(18,26,36,0), var(--nuit)); pointer-events: none; }
/* la tour : l'image prend la place qui reste, pour que le bouton Commencer soit visible sans défiler */
.tete.haute { width: 100%; height: clamp(170px, calc(100vh - var(--menu) - 330px), 62vh); height: clamp(170px, calc(100svh - var(--menu) - 330px), 62vh); }
.tete.moyenne { aspect-ratio: 16 / 10; }
.tete.portrait { aspect-ratio: 3 / 3.6; max-height: 58vh; width: 100%; }
/* image pas encore déposée : un ciel de nuit doré à la place */
.tete.vide {
  background:
    radial-gradient(ellipse 60% 50% at 50% 45%, rgba(216,169,78,.22), transparent 70%),
    radial-gradient(circle at 20% 20%, rgba(243,222,162,.5) 0 1px, transparent 2px),
    radial-gradient(circle at 75% 30%, rgba(243,222,162,.4) 0 1px, transparent 2px),
    radial-gradient(circle at 60% 70%, rgba(243,222,162,.35) 0 1px, transparent 2px),
    linear-gradient(180deg, var(--nuit2), var(--nuit));
}

/* ---------- blocs de texte sous l'image ---------- */
.bloc { padding: 4px 22px 24px; text-align: center; }
.bloc.sans-bas { padding-bottom: 0; }
.bloc h1 { font-size: 34px; color: var(--or-pale); font-weight: 700; line-height: 1.15; }
.sous { font-style: italic; color: var(--brume); font-size: 18px; }
.ambition { margin: 12px auto 0; max-width: 34ch; font-size: 20px; line-height: 1.35; }
.message { margin: 14px 0 4px; font-size: 21px; }
.message strong { color: var(--or-pale); font-weight: 600; }

/* ---------- bougies ---------- */
.bougies { display: flex; justify-content: center; gap: 18px; margin: 18px 0 4px; }
.bougie { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 15px; color: var(--brume); }
.bougie.auj { color: var(--or-pale); font-weight: 600; }
.flamme { width: 14px; height: 20px; border-radius: 50% / 60% 60% 40% 40%; background: #33414c; }
.flamme.allumee { background: radial-gradient(circle at 50% 70%, var(--or-pale), var(--braise) 60%, transparent 70%); box-shadow: 0 0 12px var(--braise); }

/* ---------- boutons ---------- */
.bouton {
  display: block; width: 100%; margin-top: 22px; padding: 18px; min-height: 60px;
  border: 0; border-radius: 14px; text-align: center;
  background: linear-gradient(180deg, #eba04a, #c86f22); color: #1a1000;
  font: 700 20px Cinzel, serif; letter-spacing: .04em; cursor: pointer;
  box-shadow: 0 6px 20px rgba(227,144,58,.35);
}
.bouton.doux { background: rgba(27,39,51,.85); color: var(--or-pale); border: 1px solid var(--or); box-shadow: none; font-size: 17px; }
.bouton:active { transform: translateY(1px); filter: brightness(1.05); }
.lien { display: inline-block; margin: 18px 0 0; background: none; border: 0; color: var(--or-pale); font: 600 15px Cinzel, serif; cursor: pointer; padding: 10px 0; }
.lien.discret { color: #6c7680; font: italic 16px 'Cormorant Garamond', serif; display: block; margin: 26px auto 0; }

/* ---------- portes du seuil ---------- */
.portes { display: grid; gap: 12px; margin-top: 22px; text-align: left; }
.porte {
  display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 14px;
  padding: 10px 14px 10px 10px; border-radius: 16px;
  background: rgba(27,39,51,.82); border: 1px solid rgba(216,169,78,.35); color: var(--ivoire);
}
.porte:active { border-color: var(--or); }
.porte img, .porte .ico { width: 76px; height: 76px; border-radius: 12px; object-fit: cover; }
.porte .ico { background: linear-gradient(170deg, #fbf3e1, #e9dcc0); color: #2a2030; display: flex; align-items: center; justify-content: center; font-size: 36px; }
.porte img.manque { background: var(--pierre); }
.porte-texte strong { display: block; font: 700 17px Cinzel, serif; color: var(--or-pale); }
.porte-texte em { display: block; font-size: 16px; color: var(--brume); margin-top: 2px; }
.porte .etat { font-size: 15px; color: var(--brume); white-space: nowrap; text-align: right; }
.porte .etat.due { color: var(--or-pale); font-weight: 600; }
.porte .etat.ok { color: var(--vert); }

/* ---------- pièces intérieures ---------- */
.piece { padding: 0 22px; }
.piece .tete { margin: 0 -22px; }
/* dans les pièces où l'on travaille (cartes, Lily), l'image se fait plus basse */
.piece .tete.moyenne { aspect-ratio: auto; height: clamp(130px, 24vh, 240px); }
.titre-piece { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 6px; }
.titre-piece h1 { font-size: 22px; color: var(--or-pale); }
.titre-piece .compte { font-size: 16px; color: var(--brume); white-space: nowrap; }
.titre-piece .compte b { color: var(--or-pale); }

/* ---------- la carte ---------- */
.carte {
  margin-top: 16px; min-height: 230px; border-radius: 18px;
  background: linear-gradient(170deg, #fbf3e1, #e9dcc0); color: #2a2030;
  padding: 20px 22px; display: flex; flex-direction: column; justify-content: center; text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.45); border: 1px solid #c9b78c;
}
.carte.tourne { animation: tourne .35s ease; }
@keyframes tourne { from { transform: rotateY(70deg); opacity: .3 } to { transform: none; opacity: 1 } }
.carte .type { font: 500 13px Cinzel, serif; letter-spacing: .12em; text-transform: uppercase; color: #8a6a2a; margin-bottom: 10px; }
.carte .mot { font-size: 26px; line-height: 1.2; font-weight: 600; }
.carte .mot.en { color: #1b2a5a; }
.carte .mot u { text-decoration: none; border-bottom: 3px solid var(--braise); padding-bottom: 1px; }
.carte .indice { margin-top: 14px; font-style: italic; color: #6a5a40; font-size: 17px; display: flex; align-items: center; justify-content: center; gap: 10px; text-align: left; }
.carte .indice b { font-style: normal; font-weight: 600; color: #8a6a2a; }
.lily-mini { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--or); flex: none; background: var(--pierre); }
.ecouter { margin: 14px auto 0; padding: 10px 18px; min-height: 44px; border-radius: 30px; border: 1px solid #8a6a2a; background: transparent; color: #5a4320; font: 600 15px Cinzel, serif; cursor: pointer; }
.reponses { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 18px; }
.reponses button { padding: 14px 6px; min-height: 68px; border: 0; border-radius: 12px; font: 700 17px Cinzel, serif; cursor: pointer; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.reponses small { font: italic 14px 'Cormorant Garamond', serif; opacity: .9; }
.reponses .su { background: var(--vert); }
.reponses .presque { background: var(--or); color: #1a1200; }
.reponses .rate { background: var(--rouge); }
.chemin { display: flex; gap: 6px; margin-top: 16px; justify-content: center; flex-wrap: wrap; }
.chemin i { flex: 0 1 34px; min-width: 10px; height: 5px; border-radius: 3px; background: var(--pierre); }
.chemin i.fait { background: var(--or); }
.chemin i.ici { background: var(--braise); }
.murmure { min-height: 1.5em; margin-top: 10px; text-align: center; font-style: italic; color: var(--or-pale); }
.note { margin-top: 14px; font-size: 15px; color: var(--brume); font-style: italic; text-align: center; }
.vide { margin: 26px 0 10px; text-align: center; font-style: italic; color: var(--brume); font-size: 19px; }

/* ---------- bilan ---------- */
#cartes-bilan { margin-top: 14px; }
.barres { display: flex; align-items: flex-end; justify-content: center; gap: 22px; height: 160px; margin-top: 12px; }
.barre-bilan { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; width: 66px; height: 100%; }
.barre-bilan i { width: 100%; border-radius: 10px 10px 4px 4px; min-height: 6px; height: 0; transition: height .8s ease; }
.barre-bilan .nombre { font: 700 22px Cinzel, serif; }
.barre-bilan .nom { color: var(--brume); font-size: 16px; }
.barre-bilan.su i { background: var(--vert); } .barre-bilan.su .nombre { color: #9fd0a9; }
.barre-bilan.presque i { background: var(--or); } .barre-bilan.presque .nombre { color: var(--or-pale); }
.barre-bilan.rate i { background: var(--rouge); } .barre-bilan.rate .nombre { color: #e9a097; }
.ornement { display: flex; align-items: center; gap: 12px; margin: 22px 0 12px; font-size: 15px; color: var(--or); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.ornement::before, .ornement::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(216,169,78,.6), transparent); }
.eclats { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; max-width: 320px; margin: 0 auto; }
.eclat { width: 18px; height: 18px; transform: rotate(45deg); border-radius: 3px; background: var(--pierre); }
.eclat.allume { background: linear-gradient(135deg, var(--or-pale), var(--braise)); box-shadow: 0 0 10px rgba(227,144,58,.6); }

/* ---------- leçon de Lily ---------- */
.consigne { margin-top: 18px; font-size: 18px; color: var(--brume); font-style: italic; }
.consigne strong { color: var(--ivoire); font-style: normal; font-weight: 600; }
.consigne.petit { margin-top: 4px; font-size: 16px; }
.sort-titre { margin-top: 14px; font-size: 18px; color: var(--or); font-weight: 500; letter-spacing: .06em; }
.regle { margin-top: 10px; padding: 16px 18px; border-left: 3px solid var(--or); background: var(--nuit2); border-radius: 0 12px 12px 0; font-size: 19px; }
.regle b { color: var(--or-pale); font-weight: 600; }
.regle .exemple { display: block; margin-top: 8px; font-style: italic; color: var(--or-pale); }
.reponse-zone { margin-top: 10px; min-height: 64px; border: 1px dashed rgba(216,169,78,.5); border-radius: 12px; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reponse-zone:empty::before { content: "Touche les mots dans l'ordre"; color: #6c7680; font-style: italic; font-size: 16px; }
.reponse-zone.reussie { border-style: solid; border-color: var(--vert); }
.tuiles { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; min-height: 48px; }
.tuile { padding: 10px 16px; min-height: 46px; border-radius: 10px; background: #f4ecdc; color: #2a2030; font-size: 21px; font-weight: 600; border: 0; cursor: pointer; box-shadow: 0 3px 0 #b9a77c; font-family: 'Cormorant Garamond', serif; }
.tuile.posee { background: var(--or); box-shadow: 0 3px 0 #8a6a2a; }
.tuile.cachee { visibility: hidden; }
.verdict { margin-top: 14px; min-height: 28px; text-align: center; font-size: 19px; color: var(--or-pale); }
.verdict.grand { font: 700 20px Cinzel, serif; margin-top: 22px; }
.phrase-juste { display: block; font-style: italic; color: #9fd0a9; }

/* ---------- route ---------- */
.mission { margin-top: 16px; padding: 18px 20px; border-radius: 16px; background: rgba(27,39,51,.85); border: 1px solid rgba(216,169,78,.35); }
.mission h2 { font-size: 16px; color: var(--or); font-weight: 500; letter-spacing: .08em; }
.mission p { margin-top: 8px; font-size: 19px; }
.mission .bouton.doux { margin-top: 16px; }
.petit-retour { min-height: 1.4em; font-style: italic; color: var(--vert) !important; font-size: 16px !important; text-align: center; }
.etiquette { display: block; margin-top: 14px; font-size: 16px; color: var(--brume); font-style: italic; }
.code { margin-top: 6px; display: flex; gap: 8px; }
.code input { flex: 1; min-width: 0; padding: 12px; border-radius: 10px; border: 1px solid rgba(216,169,78,.5); background: var(--fond); color: var(--ivoire); font: 600 18px Cinzel, serif; letter-spacing: .1em; text-align: center; }
.code .bouton { width: auto; margin: 0; padding: 12px 16px; min-height: 0; font-size: 15px; }

/* ---------- grimoire ---------- */
.jauges { margin-top: 18px; display: grid; gap: 10px; text-align: left; }
.jauge { display: grid; grid-template-columns: 118px 1fr auto; align-items: center; gap: 10px; font-size: 17px; }
.jauge .barre { height: 9px; border-radius: 5px; background: var(--pierre); overflow: hidden; }
.jauge .barre i { display: block; height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg, var(--braise), var(--or-pale)); transition: width .9s ease; }
.jauge .val { color: var(--brume); font-size: 15px; min-width: 70px; text-align: right; }
.jauge.sommeil .nom, .jauge.sommeil .val { color: #6c7680; font-style: italic; }
.liste { padding: 10px 22px 0; }
.liste h2 { font-size: 17px; color: var(--or); font-weight: 500; margin: 22px 0 8px; letter-spacing: .08em; display: flex; align-items: center; gap: 10px; }
.liste h2 img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--or); background: var(--pierre); }
.ligne { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 0; border-bottom: 1px solid rgba(216,169,78,.18); }
.ligne .fr { color: var(--brume); font-size: 16px; font-style: italic; }
.ligne .en { font-weight: 600; font-size: 19px; }
.ligne .quand { font-size: 15px; color: var(--brume); text-align: right; white-space: nowrap; }
.ligne .quand.due { color: var(--or-pale); font-weight: 600; }
.ligne .palier { display: flex; gap: 3px; justify-content: flex-end; margin-top: 4px; }
.ligne .palier i { width: 9px; height: 9px; border-radius: 50%; background: var(--pierre); }
.ligne .palier i.on { background: var(--or); }
.effacees { color: #6c7680; font-style: italic; font-size: 16px; padding-top: 8px; }
.ferme { color: #6c7680 !important; }
.ferme span { font-family: 'Cormorant Garamond', serif; font-style: italic; letter-spacing: 0; }
textarea { width: 100%; margin-top: 12px; padding: 12px; border-radius: 12px; border: 1px solid rgba(216,169,78,.5); background: var(--fond); color: var(--ivoire); font: 17px/1.4 'Cormorant Garamond', serif; resize: vertical; }
.apercu-ligne { padding: 6px 0; border-bottom: 1px solid rgba(216,169,78,.15); font-size: 17px; }
.apercu-ligne em { color: var(--brume); }

/* ---------- menu fixe ---------- */
nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 5;
  width: 100%; max-width: 430px; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--fond); border-top: 1px solid rgba(216,169,78,.3);
  padding: 8px 0 calc(10px + env(safe-area-inset-bottom, 0px));
}
nav a { display: block; text-align: center; color: var(--brume); font: 600 13px Cinzel, serif; padding: 6px 0; letter-spacing: .04em; }
nav a.actif { color: var(--or-pale); }
nav a span { display: block; font-size: 22px; margin-bottom: 2px; }

@media (prefers-reduced-motion: reduce) {
  .page.actif, .carte.tourne { animation: none; }
  .barre-bilan i, .jauge .barre i { transition: none; }
}
@media (max-width: 360px) {
  .porte { grid-template-columns: 60px 1fr; }
  .porte img, .porte .ico { width: 60px; height: 60px; }
  .porte .etat { grid-column: 2; text-align: left; }
  .jauge { grid-template-columns: 100px 1fr auto; font-size: 16px; }
}
