/* caravane/caravane.css — « La Caravane d'Or » */
:root {
  --ink: #fbf1dc; --dim: #cdb894; --or: #ffd36a; --sable: #e9b872; --rouge: #ff9a8a; --vert: #8dffc0; --cyan: #8fd8ff;
  --panel: rgba(28, 16, 6, .92); --bord: rgba(255, 200, 110, .32); --sw: 1024px;
  --u: calc(var(--sw) / 1280);
  --serif: Georgia, "Palatino Linotype", "Book Antiqua", serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: #0f0904; color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-tap-highlight-color: transparent; }
body { overflow-x: hidden; }
.wrap { position: relative; z-index: 1; width: var(--sw); max-width: 100%; margin: 0 auto; }

/* ── Bandeau ─────────────────────────────────────────────────────────────── */
.fv-header { display: flex; align-items: center; gap: 8px; padding: 6px 8px; min-height: 52px; background: linear-gradient(180deg, #3a240c, #1c1006); border-bottom: 1px solid var(--bord); }
.fv-header .titre { flex: 1; min-width: 0; font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fv-header .titre small { color: var(--dim); font-weight: 400; }
.pastille { flex: none; display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,.06); border: 1px solid var(--bord); border-radius: 99px; padding: 6px 11px; font-size: .88rem; color: var(--or); }
.pastille.possibles { letter-spacing: 1px; }
.pastille.possibles i { font-style: normal; opacity: .45; }
.btn-rond { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--bord); background: rgba(255,255,255,.06); color: var(--ink); font-size: 1.05rem; padding: 0; cursor: pointer; font-family: inherit; touch-action: manipulation; }
.btn-rond:active { transform: scale(.94); }
.btn-rond.actif { background: rgba(255, 200, 80, .3); box-shadow: 0 0 12px rgba(255, 190, 70, .5); }

/* ── Scène ───────────────────────────────────────────────────────────────── */
.scene { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; background: #2a1a0a; }
.scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.calque { position: absolute; pointer-events: none; }
/* Bulle de Maître Oumrak (sous la bourse, à gauche) */
.bulle { left: calc(20 * var(--u)); top: calc(96 * var(--u)); width: calc(340 * var(--u)); min-width: 210px; max-height: calc(300 * var(--u)); overflow: hidden; padding: 8px 12px; border-radius: 14px;
  background: rgba(30, 18, 6, .92); border: 1px solid var(--bord); box-shadow: 0 8px 26px rgba(0,0,0,.6); font-size: max(12px, calc(17 * var(--u))); line-height: 1.35; opacity: 0; transform: translateY(-8px); transition: opacity .3s, transform .3s; z-index: 4; }
.bulle.vue { opacity: 1; transform: none; }
.bulle .qui { color: var(--or); font-weight: 700; }

/* Calculatrice de laiton */
.calc { position: absolute; left: 8px; top: 8px; width: min(270px, 46%); padding: 8px; border-radius: 16px; background: linear-gradient(180deg, rgba(60, 40, 14, .97), rgba(32, 20, 6, .97)); border: 2px solid #b8862a; box-shadow: 0 10px 30px rgba(0,0,0,.7), inset 0 0 18px rgba(255, 200, 90, .12); z-index: 5; }
.calc-ecran { background: #1a2a1a; border-radius: 10px; padding: 6px 10px; text-align: right; margin-bottom: 6px; min-height: 52px; box-shadow: inset 0 0 10px rgba(0,0,0,.6); }
.calc-ecran span { display: block; color: #9fc99a; font-size: .8rem; min-height: 1.1em; word-break: break-all; }
.calc-ecran b { display: block; color: #d6ffcf; font-size: 1.25rem; font-variant-numeric: tabular-nums; word-break: break-all; }
.calc-touches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.calc-touches button { font: 700 1.05rem system-ui, sans-serif; min-height: 40px; padding: 6px 0; border-radius: 9px; border: 1px solid rgba(255,220,140,.2); background: #3a2610; color: var(--ink); cursor: pointer; touch-action: manipulation; }
.calc-touches button.op { background: #4a3012; color: var(--or); }
.calc-touches button.eg { background: linear-gradient(180deg, #ffd36a, #c98a1a); color: #2a1406; }
.calc-touches button.vers { grid-column: span 5; background: #1e3a2a; color: var(--vert); font-size: .9rem; }
.calc-touches button:active { transform: scale(.94); }

/* ── Console ─────────────────────────────────────────────────────────────── */
/* bande libre en bas (64 px) : les boutons flottants du site s'y posent sans rien cacher */
.console { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; padding: 10px 12px 64px; background: linear-gradient(180deg, #24160a, #120a04); border-top: 1px solid var(--bord); min-height: 280px; }
.gauche { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.etape { font-size: .8rem; color: var(--dim); letter-spacing: .04em; text-transform: uppercase; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.etape .pas { display: inline-flex; gap: 4px; }
.etape .pas i { width: 18px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); }
.etape .pas i.fait { background: var(--vert); box-shadow: 0 0 6px var(--vert); }
.etape .pas i.ici { background: var(--or); box-shadow: 0 0 8px var(--or); }
.etape .boss { color: #ffb36a; }
.enonce { font-size: 1.06rem; line-height: 1.45; }
.enonce b { color: #ffe3a8; }
.enonce i { color: var(--dim); font-size: .95em; }
.enonce .tab { border-collapse: collapse; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.enonce .tab th, .enonce .tab td { border: 1px solid rgba(255, 210, 130, .45); padding: 5px 14px; text-align: center; }
.enonce .tab th { color: var(--dim); font-weight: 600; font-size: .9rem; text-align: left; }
.enonce .tab td { font-weight: 800; color: #fff; min-width: 54px; }
.enonce .tab td.trou { color: var(--or); }
.saisie { display: flex; align-items: center; gap: 8px; }
.saisie input { width: min(220px, 60%); font: 700 1.35rem system-ui, sans-serif; padding: 8px 12px; border-radius: 12px; border: 2px solid rgba(255, 200, 110, .55); background: #140c04; color: #fff; text-align: right; font-variant-numeric: tabular-nums; outline: none; }
.saisie input:focus { border-color: var(--or); box-shadow: 0 0 14px rgba(255, 200, 90, .35); }
.saisie input.faux { border-color: #ff6a5a; animation: secoue .4s; }
.saisie .unite { font-size: 1.15rem; font-weight: 700; color: var(--or); }
@keyframes secoue { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.msg { font-size: .98rem; line-height: 1.42; max-height: 9em; overflow: auto; -webkit-overflow-scrolling: touch; }
.msg:empty { display: none; }
.msg .ok { color: var(--vert); font-weight: 700; }
.msg .ko { color: var(--rouge); font-weight: 700; }
.msg .expl { display: block; margin: 4px 0; padding: 6px 10px; border-left: 3px solid var(--or); background: rgba(255, 190, 70, .08); border-radius: 0 10px 10px 0; }
.droite { display: flex; align-items: flex-start; }

/* Pavé numérique du jeu */
.pave { display: grid; grid-template-columns: repeat(4, 56px); grid-auto-rows: 46px; gap: 6px; }
.pave button { font: 800 1.3rem system-ui, sans-serif; border-radius: 11px; border: 1px solid rgba(255,220,150,.18); background: linear-gradient(180deg, #4a3014, #2c1c0a); color: var(--ink); box-shadow: 0 3px 0 #140c04; cursor: pointer; touch-action: manipulation; padding: 0; }
.pave button:active { transform: translateY(2px); box-shadow: 0 1px 0 #140c04; }
.pave .eff { color: #ffb0a0; }
.pave .ok { grid-row: span 2; background: linear-gradient(180deg, #ffd36a, #c98a1a); color: #2a1406; font-size: 1.15rem; }
.pave .zero { grid-column: span 3; }
.pave button:disabled { opacity: .4; }

/* Choix (tarifs, offres, coefficients) */
.choix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: min(400px, 46vw); }
.choix button { text-align: left; font: inherit; min-height: 52px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--bord); background: rgba(255,255,255,.05); color: var(--ink); cursor: pointer; touch-action: manipulation; line-height: 1.25; }
.choix button b { color: var(--or); display: block; }
.choix button small { color: var(--dim); font-size: .84rem; }
.choix button.sel { border-color: var(--or); background: rgba(255, 200, 80, .16); box-shadow: 0 0 14px rgba(255, 200, 80, .35); }
.choix button.barre { opacity: .45; text-decoration: line-through; }
.choix .valider { grid-column: span 2; text-align: center; font-weight: 800; background: linear-gradient(135deg, #ffd36a, #c98a1a); color: #2a1406; border: 0; }
.choix .valider:disabled { opacity: .45; }

/* ── Dialogues ───────────────────────────────────────────────────────────── */
.voile { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 12px; background: rgba(10, 6, 2, .6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.voile.ouvert { display: flex; }
.voile.bas { padding-bottom: 76px; align-items: flex-end; background: linear-gradient(180deg, transparent 35%, rgba(10, 6, 2, .72)); backdrop-filter: none; -webkit-backdrop-filter: none; }
.dialogue { width: min(100%, 680px); max-height: calc(100dvh - 24px); overflow: auto; -webkit-overflow-scrolling: touch; background: linear-gradient(180deg, #3a240e, #1a1006); border: 1px solid var(--bord); border-radius: 20px;
  padding: 18px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.75), 0 0 40px rgba(255, 190, 70, .15); animation: monte .35s ease-out; color: var(--ink); }
@keyframes monte { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.dialogue .qui { font-weight: 800; color: var(--or); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.dialogue .qui.rival { color: #e0b3ff; }
.dialogue .qui span { font-size: 1.7rem; }
.dialogue p { margin: 0 0 12px; line-height: 1.6; font-size: 1.05rem; }
.dialogue p.tt { min-height: 3.2em; }
.dialogue p.note { margin-top: 10px; color: var(--dim); }
.dialogue .actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.dialogue .solution { padding: 10px 14px; border-radius: 12px; background: rgba(255, 200, 80, .1); border: 1px solid var(--bord); line-height: 1.7; }
.bouton { cursor: pointer; font: 800 1rem system-ui, sans-serif; min-height: 46px; padding: 11px 18px; border-radius: 12px; border: 0; color: #2a1406; background: linear-gradient(135deg, #fff0b8, #ffc23c); box-shadow: 0 0 20px rgba(255, 190, 60, .45); touch-action: manipulation; }
.bouton.discret { color: var(--ink); background: rgba(255,255,255,.08); box-shadow: none; border: 1px solid var(--bord); }
.grosse-etoiles { font-size: 2.6rem; text-align: center; color: var(--or); letter-spacing: 8px; text-shadow: 0 0 18px rgba(255,211,106,.7); margin: 4px 0 6px; }
.grosse-etoiles i { font-style: normal; display: inline-block; animation: etoile .6s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes etoile { from { transform: scale(0) rotate(-90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.carte h2 { margin: 0 0 4px; text-align: center; font: 700 1.6rem var(--serif); color: #fff3c4; text-shadow: 0 0 18px rgba(255, 190, 60, .6); }
.carte .sous { text-align: center; color: var(--dim); margin: 0 0 14px; font-size: .92rem; }
.chapitres { display: grid; gap: 10px; }
.chap { --c: #f2b45a; display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px; border-radius: 16px; border: 1px solid rgba(255,255,255,.18); cursor: pointer; text-align: left; font: inherit; color: var(--ink); background: rgba(255,255,255,.04); }
.chap:disabled { opacity: .45; cursor: default; }
.chap .num { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; font-size: 1.5rem; background: radial-gradient(circle at 35% 30%, #fff, var(--c) 60%); box-shadow: 0 0 16px var(--c); }
.chap .t { flex: 1; font-weight: 700; }
.chap .t small { display: block; font-weight: 400; color: var(--dim); font-size: .8rem; }
.chap .barre { height: 5px; border-radius: 3px; background: rgba(255,255,255,.08); margin-top: 6px; overflow: hidden; }
.chap .barre i { display: block; height: 100%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.chap .et { color: var(--or); font-size: .9rem; white-space: nowrap; }
.niveaux-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-top: 12px; }
.niveaux-liste button { font: inherit; text-align: left; cursor: pointer; min-height: 56px; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--bord); background: rgba(255,255,255,.05); color: var(--ink); }
.niveaux-liste button:disabled { opacity: .4; cursor: default; }
.niveaux-liste .et { color: var(--or); font-size: .85rem; display: block; letter-spacing: 2px; }
.niveaux-liste .boss { border-color: rgba(255, 170, 60, .8); }
/* Grimoire (parchemin) */
.grimoire { background: linear-gradient(180deg, #f1e3bf, #e2cd9d); color: #2a1406; border-radius: 14px; padding: 14px 16px; box-shadow: inset 0 0 40px rgba(120, 80, 30, .35); }
.grimoire h3 { margin: 12px 0 6px; font: 700 1.15rem var(--serif); color: #5a2a10; border-bottom: 1px solid rgba(90,42,16,.3); padding-bottom: 3px; }
.grimoire h3:first-child { margin-top: 0; }
.grimoire .regle { margin: 0 0 8px; line-height: 1.5; font-size: .98rem; }
.grimoire .regle b { color: #7a2a10; }
.grimoire .ex { display: block; font-family: var(--serif); color: #1f3a6a; margin-top: 2px; }
.grimoire .scelle { color: #8a6a40; font-style: italic; }

.seo-about { max-width: 840px; margin: 26px auto 16px; padding: 16px 22px; border-radius: 14px; background: rgba(36, 22, 8, .85); border: 1px solid var(--bord); color: var(--dim); font-size: .92rem; line-height: 1.55; }
.seo-about h2 { color: var(--or); font-size: 1.05rem; margin: 0 0 8px; }
.seo-about a { color: var(--cyan); }

/* ── Petits écrans ───────────────────────────────────────────────────────── */
@media (max-width: 700px) { #etoilesTotal { display: none; } .fv-header { gap: 5px; } .btn-rond { width: 38px; height: 38px; } }
@media (max-width: 460px) { .pastille.possibles { display: none; } }
@media (max-width: 640px) {
  .console { grid-template-columns: 1fr; }
  .droite { justify-content: center; }
  .choix { width: 100%; }
  .pave { grid-template-columns: repeat(4, minmax(52px, 1fr)); width: 100%; max-width: 340px; }
  .calc { width: min(300px, 92%); }
}

/* Garde-fous thèmes du site (fond sombre : le texte n'est jamais noir sur noir) */
body[class*="theme-"] .fv-header, body[class*="theme-"] .fv-header * { color: #fff !important; -webkit-text-fill-color: #fff !important; text-shadow: none !important; }
body[class*="theme-"] .fv-header .pastille { color: #ffd36a !important; -webkit-text-fill-color: #ffd36a !important; }
body[class*="theme-"] .wrap, body[class*="theme-"] .wrap * { color: #fbf1dc !important; -webkit-text-fill-color: #fbf1dc !important; }
body[class*="theme-"] .wrap .msg .ok { color: #8dffc0 !important; -webkit-text-fill-color: #8dffc0 !important; }
body[class*="theme-"] .wrap .msg .ko { color: #ff9a8a !important; -webkit-text-fill-color: #ff9a8a !important; }
body[class*="theme-"] .wrap .unite, body[class*="theme-"] .wrap .choix button b { color: #ffd36a !important; -webkit-text-fill-color: #ffd36a !important; }
body[class*="theme-"] .wrap .calc-ecran b { color: #d6ffcf !important; -webkit-text-fill-color: #d6ffcf !important; }
body[class*="theme-"] .wrap .pave .ok, body[class*="theme-"] .wrap .choix .valider, body[class*="theme-"] .wrap .calc-touches .eg { color: #2a1406 !important; -webkit-text-fill-color: #2a1406 !important; }
body[class*="theme-"] .voile .dialogue, body[class*="theme-"] .voile .dialogue * { color: #fbf1dc !important; -webkit-text-fill-color: #fbf1dc !important; }
body[class*="theme-"] .voile .grimoire, body[class*="theme-"] .voile .grimoire * { color: #2a1406 !important; -webkit-text-fill-color: #2a1406 !important; }
body[class*="theme-"] .voile .bouton:not(.discret) { color: #2a1406 !important; -webkit-text-fill-color: #2a1406 !important; }
