/* NEO-KINARA — interface grand public. Papier chaud, textile, lisible. */

:root {
  --papier: #f6efe0;
  --papier2: #efe4cd;
  --carte: #fffaf0;
  --encre: #2b2118;
  --encre2: #5c4a38;
  --terracotta: #c2571f;
  --terracotta2: #a34517;
  --indigo: #35316e;
  --or: #d99a2b;
  --teal: #1f8a8a;
  --vert: #4a7c59;
  --violet: #7d5ba6;
  --rouge: #b3402e;
  --ubuntu: #4a7c59;
  --sankofa: #c78a1b;
  --nommo: #1f8a8a;
  --maat: #7d5ba6;
  --rayon: 16px;
  --ombre: 0 6px 24px rgba(43, 33, 24, .12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  background: var(--papier);
  color: var(--encre);
  font-size: 17px;
  line-height: 1.55;
  background-image:
    repeating-linear-gradient(90deg, rgba(194, 87, 31, .028) 0 2px, transparent 2px 26px),
    repeating-linear-gradient(0deg, rgba(53, 49, 110, .022) 0 2px, transparent 2px 26px);
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 16px; }
img { max-width: 100%; }

/* ── boutons ─────────────────────────────────────────── */
.btn {
  display: inline-block; border: none; border-radius: 12px;
  padding: 12px 22px; font-size: 16px; font-weight: 600;
  background: var(--terracotta); color: #fff;
  box-shadow: 0 3px 0 var(--terracotta2);
  transition: transform .06s ease, filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn.secondaire { background: var(--carte); color: var(--encre); box-shadow: 0 3px 0 #d8c9a8; border: 1px solid #e2d4b6; }
.btn.discret { background: transparent; box-shadow: none; color: var(--encre2); text-decoration: underline; padding: 6px 10px; }
.btn.indigo { background: var(--indigo); box-shadow: 0 3px 0 #232055; }
.btn.vert { background: var(--vert); box-shadow: 0 3px 0 #386044; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.large { width: 100%; text-align: center; padding: 15px; font-size: 17px; }

/* ── entête ──────────────────────────────────────────── */
header.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px;
  background: rgba(246, 239, 224, .92); backdrop-filter: blur(8px);
  border-bottom: 2px solid #e4d5b5;
}
header.top .logo { font-weight: 800; letter-spacing: .12em; color: var(--indigo); font-size: 17px; }
header.top .logo span { color: var(--terracotta); }
header.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
header.top nav button {
  background: none; border: none; padding: 8px 13px; border-radius: 10px;
  font-size: 15px; font-weight: 600; color: var(--encre2);
}
header.top nav button.actif, header.top nav button:hover { background: var(--papier2); color: var(--encre); }
header.top .droite { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--encre2); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.badge.demo { background: #f3e0c0; color: #8a5a10; }
.badge.actif { background: #dcedd2; color: #2f5c33; }
.badge.admin { background: #e4defa; color: #4d3a86; }

/* ── écrans ──────────────────────────────────────────── */
main { max-width: 1180px; margin: 0 auto; padding: 24px 18px 80px; }

.hero {
  position: relative; border-radius: 22px; overflow: hidden;
  min-height: 430px; display: flex; align-items: flex-end;
  box-shadow: var(--ombre);
  background: var(--indigo) center/cover no-repeat;
}
.hero .voile { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(20, 14, 40, .82)); }
.hero .contenu { position: relative; padding: 34px; color: #fff; max-width: 640px; }
.hero h1 { font-size: 42px; letter-spacing: .04em; line-height: 1.1; text-shadow: 0 2px 14px rgba(0,0,0,.5); }
.hero h1 small { display: block; font-size: 17px; font-weight: 500; opacity: .9; letter-spacing: .18em; }
.hero p { margin: 12px 0 18px; font-size: 17px; opacity: .95; }

.grille { display: grid; gap: 16px; }
.grille.deux { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grille.trois { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.carte {
  background: var(--carte); border: 1px solid #e6d8ba;
  border-radius: var(--rayon); padding: 20px; box-shadow: var(--ombre);
}
.carte h3 { font-size: 18px; margin-bottom: 8px; color: var(--indigo); }
.carte.cliquable { cursor: pointer; transition: transform .12s, border-color .12s; }
.carte.cliquable:hover { transform: translateY(-2px); border-color: var(--terracotta); }
.carte.choisie { border: 2px solid var(--terracotta); background: #fff5e8; }
.carte.verrou { opacity: .55; }
.carte .sous { color: var(--encre2); font-size: 14.5px; }

h2.section { font-size: 24px; margin: 26px 0 12px; color: var(--indigo); }
h2.section small { font-size: 14px; color: var(--encre2); font-weight: 500; margin-left: 8px; }

.champ { display: block; margin: 10px 0; }
.champ label { display: block; font-size: 14px; font-weight: 700; color: var(--encre2); margin-bottom: 4px; }
.champ input, .champ textarea, .champ select {
  width: 100%; padding: 11px 13px; border-radius: 10px;
  border: 1.5px solid #dcCDA9; border: 1.5px solid #dccda9; background: #fff;
}
.erreur { color: var(--rouge); font-weight: 600; font-size: 14.5px; margin-top: 8px; }
.note { color: var(--encre2); font-size: 14px; }

/* ── jeu ─────────────────────────────────────────────── */
.jeu { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; }
@media (max-width: 940px) { .jeu { grid-template-columns: 1fr; } .lateral { order: -1; } }

.battements { display: flex; gap: 5px; margin-bottom: 10px; flex-wrap: wrap; align-items: center; }
.battements .pt { width: 15px; height: 15px; border-radius: 50%; background: #e0d2b2; border: 1px solid #cbb98f; }
.battements .pt.fait { background: var(--or); border-color: #b57e17; }
.battements .pt.actuel { background: var(--terracotta); border-color: var(--terracotta2); transform: scale(1.28); }
.battements .acte { font-size: 12px; font-weight: 800; color: var(--encre2); margin: 0 4px; }

#feed { display: flex; flex-direction: column; gap: 12px; min-height: 320px; }

.ev-battement {
  background: var(--indigo); color: #fff; border-radius: var(--rayon);
  padding: 16px 20px; box-shadow: var(--ombre);
}
.ev-battement .acte { font-size: 12px; letter-spacing: .22em; opacity: .8; font-weight: 700; }
.ev-battement .nom { font-size: 21px; font-weight: 800; }
.ev-battement .sous { font-size: 14px; opacity: .85; font-style: italic; margin-top: 2px; }

.ev-texte {
  background: var(--carte); border: 1px solid #e6d8ba; border-radius: var(--rayon);
  padding: 16px 20px; font-family: Georgia, "Times New Roman", serif;
  font-size: 17.5px; line-height: 1.65;
}
.ev-info { color: var(--encre2); font-size: 14.5px; padding: 0 8px; }

.ev-voix {
  border-left: 5px solid var(--violet); border-radius: 10px;
  background: #f4effa; padding: 12px 16px; font-style: italic;
}
.ev-voix .qui { font-style: normal; font-weight: 800; font-size: 13px; letter-spacing: .14em; }
.ev-voix.v-ubuntu { border-color: var(--ubuntu); background: #edf4ec; }
.ev-voix.v-ubuntu .qui { color: var(--ubuntu); }
.ev-voix.v-sankofa { border-color: var(--sankofa); background: #f9f1dd; }
.ev-voix.v-sankofa .qui { color: #96660f; }
.ev-voix.v-nommo { border-color: var(--nommo); background: #e8f3f3; }
.ev-voix.v-nommo .qui { color: var(--nommo); }
.ev-voix.v-maat { border-color: var(--maat); background: #f1ecf7; }
.ev-voix.v-maat .qui { color: var(--maat); }

.ev-jet {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: #fbf6ea; border: 1px dashed #d8c69c; border-radius: 12px;
  padding: 10px 14px; font-size: 14.5px;
}
.ev-jet .pill { border-radius: 999px; padding: 2px 11px; font-weight: 700; font-size: 13.5px; }
.pill.anc { background: #f6e3bb; color: #7d5407; }
.pill.tum { background: #f4d3cb; color: #7c2b1c; }
.pill.tot { background: var(--encre); color: #fff; }
.pill.ok { background: #dcedd2; color: #2f5c33; }
.pill.ko { background: #f4d3cb; color: #7c2b1c; }
.pill.harmonie { background: linear-gradient(90deg, #ffd873, #ffb347); color: #6b4500; }

.ev-chip { align-self: flex-start; font-size: 14px; font-weight: 700; border-radius: 999px; padding: 6px 14px; }
.chip-valeur { background: #e6f0e2; color: #2f5c33; border: 1px solid #b9d3ae; }
.chip-passif { background: #e9e6f7; color: #4d3a86; border: 1px solid #cdc4ec; }
.chip-echo { background: #efe9dc; color: #6b5335; border: 1px solid #dccfae; font-weight: 500; font-style: italic; }
.chip-fin { background: linear-gradient(90deg, #ffd873, #ffb347); color: #6b4500; font-size: 16px; padding: 10px 18px; }

.ev-ennemis { background: #fbeeea; border: 1px solid #ecc7bc; border-radius: 12px; padding: 10px 16px; }
.ev-ennemis .ligne { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; padding: 3px 0; }
.ev-ennemis .vie { letter-spacing: 2px; color: var(--rouge); }

.ev-banner { text-align: center; padding: 18px; border-radius: var(--rayon);
  background: linear-gradient(135deg, #3a3277, #232055); color: #fff; box-shadow: var(--ombre); }
.ev-banner .titre { font-size: 22px; font-weight: 800; letter-spacing: .06em; }
.ev-banner .sous { opacity: .85; font-size: 14px; }

.ev-menace { display: flex; gap: 16px; align-items: center; background: var(--carte);
  border: 1px solid #e6d8ba; border-radius: var(--rayon); padding: 14px; }
.ev-menace img { width: 110px; height: 140px; object-fit: cover; border-radius: 10px; }
.ev-menace .t { font-weight: 800; color: var(--indigo); font-size: 17px; }

/* contrôles */
#controles { position: sticky; bottom: 0; padding: 14px 0 4px;
  background: linear-gradient(180deg, transparent, var(--papier) 30%); }
.choix-liste { display: flex; flex-direction: column; gap: 9px; }
.choix-btn {
  text-align: left; background: var(--carte); border: 1.5px solid #dcc9a2;
  border-radius: 13px; padding: 13px 17px; font-size: 16px; line-height: 1.45;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  transition: border-color .12s, transform .08s;
}
.choix-btn:hover { border-color: var(--terracotta); transform: translateX(3px); }
.choix-btn .tag { flex-shrink: 0; font-size: 12.5px; font-weight: 800; border-radius: 999px; padding: 3px 10px; background: var(--papier2); color: var(--encre2); }
.choix-btn .tag.v-ubuntu { background: #dcedd2; color: #2f5c33; }
.choix-btn .tag.v-sankofa { background: #f6e3bb; color: #7d5407; }
.choix-btn .tag.v-nommo { background: #d8ecec; color: #115e5e; }
.choix-btn .tag.v-maat { background: #e9e0f5; color: #533a80; }
.choix-btn .tag.v-combat { background: #f4d3cb; color: #7c2b1c; }
.saisie-zone { display: flex; gap: 8px; }
.saisie-zone input { flex: 1; padding: 13px; border-radius: 12px; border: 1.5px solid #dcc9a2; }
.libre-zone { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #d8c69c; }
.libre-zone input { flex: 1; padding: 12px 14px; border-radius: 12px; border: 1.5px solid #cbb98f;
  background: #fffaf0; font-style: italic; }
.libre-zone input:focus { outline: none; border-color: var(--terracotta); font-style: normal; }
.chip-codex { background: #f0e8dc; color: #6b5335; border: 1px solid #dccfae; }
.cx-entree { padding: 8px 0; border-bottom: 1px solid #eadfc4; font-size: 14px; }
.cx-entree:last-child { border-bottom: none; }
.cx-entree b { color: var(--indigo); }
.cx-entree.cx-captif b, .cx-entree.cx-mort b { color: var(--rouge); }
.cx-entree.cx-captif b::after { content: " ⛓"; }
.attente-griot { display: flex; align-items: center; gap: 10px; color: var(--encre2); font-style: italic; padding: 8px 4px; }
.tambour { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--terracotta);
  border-top-color: transparent; animation: tourne 1s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* panneau latéral */
.lateral .carte { margin-bottom: 14px; }
.jauges { display: flex; flex-direction: column; gap: 8px; }
.jauge { }
.jauge .lg { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 700; color: var(--encre2); }
.jauge .barre { height: 12px; border-radius: 999px; background: #eadfc4; overflow: hidden; }
.jauge .barre i { display: block; height: 100%; border-radius: 999px; transition: width .4s; }
.j-pv i { background: linear-gradient(90deg, #d0654a, #b3402e); }
.j-pe i { background: linear-gradient(90deg, #8d6fc0, #7d5ba6); }
.j-stress i { background: linear-gradient(90deg, #e0a1b1, #c96a86); }
.j-ubuntu i { background: var(--ubuntu); }
.j-sankofa i { background: var(--sankofa); }
.j-nommo i { background: var(--nommo); }
.j-maat i { background: var(--maat); }
.ressources { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.ressources .r { background: var(--papier2); border-radius: 999px; padding: 4px 11px; font-size: 13.5px; font-weight: 700; color: var(--encre2); }
.val-embleme { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 6px; }
.liste-recits { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.liste-recits li { border-bottom: 1px solid var(--papier2); padding-bottom: 8px; font-weight: 700; }
.liste-recits li:last-child { border-bottom: none; padding-bottom: 0; }
.prose-lsi { white-space: pre-wrap; max-height: 340px; overflow-y: auto; margin-top: 10px;
  padding: 12px 14px; background: var(--papier2); border-radius: 10px; font-size: 14.5px;
  line-height: 1.5; color: var(--encre2); }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 90; background: rgba(28, 20, 12, .66);
  display: flex; align-items: center; justify-content: center; padding: 18px; }
.overlay .boite { background: var(--carte); border-radius: 20px; padding: 30px;
  max-width: 560px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.4); max-height: 88vh; overflow: auto; }
.overlay h2 { color: var(--indigo); margin-bottom: 10px; }

/* stats +/- */
.alloc { display: grid; gap: 10px; }
.alloc .ligne { display: flex; align-items: center; gap: 12px; }
.alloc .ligne .nomstat { flex: 1; font-weight: 700; }
.alloc .pm { width: 38px; height: 38px; border-radius: 10px; border: none; font-size: 20px;
  font-weight: 800; background: var(--papier2); color: var(--encre); }
.alloc .valstat { width: 30px; text-align: center; font-size: 19px; font-weight: 800; }

/* tables admin */
table.admin { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.admin th, table.admin td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #eadfc4; }
table.admin th { color: var(--encre2); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; }
.mini { padding: 6px 12px; font-size: 13.5px; border-radius: 9px; }

.fond-image { border-radius: 22px; padding: 26px; color: #fff; background: var(--indigo) center/cover; position: relative; overflow: hidden; box-shadow: var(--ombre); }
.fond-image .voile { position: absolute; inset: 0; background: rgba(24, 17, 46, .55); }
.fond-image > *:not(.voile) { position: relative; }

.flux-echo { border-left: 3px solid var(--or); padding: 8px 12px; margin: 8px 0; background: #fbf6ea; border-radius: 8px; font-size: 15px; }
.flux-echo .qui { font-weight: 800; color: var(--terracotta); font-size: 13px; }

.onb-etapes { display: grid; gap: 12px; }
.onb-etapes .et { display: flex; gap: 12px; align-items: flex-start; }
.onb-etapes .num { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--terracotta);
  color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 99;
  background: var(--encre); color: #fff; border-radius: 12px; padding: 12px 20px; font-size: 15px;
  box-shadow: 0 8px 30px rgba(0,0,0,.35); }

/* ── capture d'email (« la meute ») ──────────────────── */
.meute {
  margin-top: 18px; border-radius: 22px; overflow: hidden;
  background: linear-gradient(135deg, var(--indigo), #241f52);
  box-shadow: var(--ombre);
}
.meute-corps { padding: 26px 28px; color: #fff; }
.meute-corps h3 { font-size: 22px; letter-spacing: .02em; }
.meute-corps .sous { color: rgba(255, 255, 255, .82); font-size: 15px; margin-top: 6px; max-width: 620px; }
.meute-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.meute-form input {
  flex: 1 1 260px; min-width: 0; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .95); color: var(--encre);
}
.meute-form .btn { background: var(--or); box-shadow: 0 3px 0 #b57e17; }
.meute-retour { margin-top: 12px; font-size: 14.5px; font-weight: 600; min-height: 1.2em; }
.meute-retour.ok { color: #ffe6a8; }
.meute-retour.ko { color: #ffc2b3; }

/* ── sceau de connexion : animation succès / échec avant le chargement ── */
.overlay-anim {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: radial-gradient(circle at 50% 42%, #3a3576 0%, #201c46 55%, #17132f 100%);
  animation: anim-fond .3s ease both;
}
.overlay-anim.sortie { animation: anim-sortie .22s ease forwards; }
@keyframes anim-fond { from { opacity: 0; } to { opacity: 1; } }
@keyframes anim-sortie { to { opacity: 0; } }

.overlay-anim .sceau { position: relative; width: 150px; height: 150px;
  display: flex; align-items: center; justify-content: center; }
.overlay-anim .anneau {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--or); opacity: 0;
  animation: anim-onde 1.5s ease-out infinite;
}
.overlay-anim .anneau.a2 { animation-delay: .35s; }
.overlay-anim .anneau.a3 { animation-delay: .7s; }
.overlay-anim.ko .anneau { border-color: var(--rouge); animation-iteration-count: 1; }
@keyframes anim-onde {
  0% { transform: scale(.4); opacity: .9; }
  80% { opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}
.overlay-anim .glyphe {
  font-size: 68px; line-height: 1;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .5));
  animation: anim-glyphe .6s cubic-bezier(.2, 1.4, .4, 1) both, anim-battement 1s ease-in-out .6s 2;
}
.overlay-anim.ko .glyphe {
  color: var(--rouge); font-weight: 900;
  animation: anim-glyphe .35s ease both, anim-secousse .5s ease .35s 1;
}
@keyframes anim-glyphe {
  from { transform: scale(0) rotate(-25deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes anim-battement { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.16); } }
.overlay-anim .sceau-texte {
  color: #f6efe0; font-size: 20px; font-weight: 700; letter-spacing: .02em; text-align: center;
  animation: anim-monte .5s ease .2s both;
}
.overlay-anim.ko .sceau-texte { color: #ffc2b3; }
@keyframes anim-monte { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* secousse + pulse du formulaire de connexion */
@keyframes anim-secousse {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-10px); } 30% { transform: translateX(9px); }
  45% { transform: translateX(-7px); } 60% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}
.boite.secoue { animation: anim-secousse .5s ease; }
.boite.chargement { animation: anim-pulse 1s ease-in-out infinite; }
@keyframes anim-pulse {
  0%, 100% { box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
  50% { box-shadow: 0 20px 60px rgba(217, 154, 43, .38); }
}

@media (prefers-reduced-motion: reduce) {
  .overlay-anim, .overlay-anim * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .boite.secoue, .boite.chargement { animation: none; }
}

/* ── Roman visuel : décor de scène, splash de battement, portraits, art de fin ── */
.jeu-scene {
  position: fixed; inset: 0; z-index: -1;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity .8s ease, background-image .8s ease;
  pointer-events: none;
}
.jeu-scene.visible { opacity: 1; }
.jeu-scene .voile {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20, 14, 40, .58) 0%, rgba(20, 14, 40, .80) 55%, rgba(20, 14, 40, .90) 100%);
}
/* Sur fond de scène, les cartes du fil gagnent un léger fondu de lisibilité. */
.jeu-scene.visible ~ .jeu #feed .ev-texte,
.jeu-scene.visible ~ .jeu #feed .ev-info { backdrop-filter: blur(1px); }

.splash-battement {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  background: #0b0713; animation: splash-in .5s ease;
}
.splash-battement img { max-width: 100%; max-height: 100%; object-fit: contain; }
.splash-battement.sortie { opacity: 0; transition: opacity .6s ease; }
@keyframes splash-in { from { opacity: 0; } to { opacity: 1; } }

.cx-entree.cx-illustre { display: grid; grid-template-columns: 46px 1fr; column-gap: 10px; align-items: start; }
.cx-entree.cx-illustre > b, .cx-entree.cx-illustre > .note { grid-column: 2; }
.cx-art {
  grid-row: 1 / 99; grid-column: 1;
  width: 46px; height: 46px; object-fit: cover; border-radius: 10px;
  box-shadow: var(--ombre);
}

.overlay-fin .boite { position: relative; overflow: hidden; }
.fin-art {
  display: block; width: 100%; max-height: 260px; object-fit: cover;
  border-radius: 12px; margin: -6px 0 10px;
}

@media (prefers-reduced-motion: reduce) {
  .jeu-scene { transition: none; }
  .splash-battement { animation: none; }
}

/* ── Sélecteur de Livre (création de récit, multi-Livre) ── */
.livres-choix { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.btn-livre {
  display: flex; gap: 14px; align-items: center; text-align: left;
  padding: 14px 16px; border-radius: var(--rayon);
  border: 1px solid rgba(43, 33, 24, .14); background: var(--carte);
  cursor: pointer; transition: border-color .15s, transform .05s;
}
.btn-livre:hover { border-color: var(--terracotta); }
.btn-livre:active { transform: scale(.99); }
.btn-livre .bl-embleme { font-size: 30px; line-height: 1; }

/* ── Emblèmes de caste/classe sur les cartes de création (lot P2) ── */
.carte-embleme { position: relative; }
.carte-embleme .embleme {
  float: right; width: 64px; height: 64px; object-fit: cover;
  border-radius: 12px; margin: 0 0 6px 10px; box-shadow: var(--ombre);
}

/* ════════════════════════════════════════════════════════════════════════
   NGOMA — la vitrine (landing « Netflix des Livres »). Monde visuel dédié :
   nuit indigo, or de lanterne, l'art des Livres fait le travail. Mono-thème
   assumé (cinématique), indépendant de la palette papier de l'app.
   ════════════════════════════════════════════════════════════════════════ */
.ng {
  --nuit: #0e0a18; --nuit2: #171029; --nuit3: #221a38;
  --or: #e0a92e; --or2: #f2c96a; --braise: #c2571f;
  --txt: #ece6f5; --txt2: #a99fc0; --ligne: rgba(233,226,242,.10);
  margin: -24px calc(50% - 50vw) -80px;   /* plein cadre : annule le padding de <main> */
  width: 100vw; background: var(--nuit); color: var(--txt);
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
}
.ng *, .ng *::before, .ng *::after { box-sizing: border-box; }

/* barre de marque */
.ng-barre {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(16px, 5vw, 56px);
  transition: background .3s ease, backdrop-filter .3s ease, border-color .3s;
  border-bottom: 1px solid transparent;
}
.ng-barre.pose { background: rgba(14,10,24,.86); backdrop-filter: blur(10px); border-bottom-color: var(--ligne); }
.ng-marque { font-weight: 800; letter-spacing: .22em; font-size: 18px; color: var(--txt); display: flex; align-items: center; gap: 10px; }
.ng-marque em { font-style: normal; font-weight: 500; letter-spacing: .04em; font-size: 12.5px; color: var(--txt2); }
.ng-emb { font-size: 20px; filter: drop-shadow(0 0 10px rgba(224,169,46,.55)); }
.ng-actions { display: flex; gap: 10px; }

.ng-btn {
  border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  padding: 10px 20px; font-size: 14.5px; font-weight: 700; letter-spacing: .01em;
  font-family: inherit; transition: transform .08s ease, filter .15s, background .15s, border-color .15s;
}
.ng-btn:active { transform: translateY(1px); }
.ng-btn.or { background: var(--or); color: #241703; box-shadow: 0 6px 22px rgba(224,169,46,.28); }
.ng-btn.or:hover { filter: brightness(1.07); }
.ng-btn.ghost { background: rgba(236,230,245,.08); color: var(--txt); border-color: rgba(236,230,245,.28); }
.ng-btn.ghost:hover { background: rgba(236,230,245,.16); }
.ng-btn.grand { padding: 14px 26px; font-size: 16px; }
.ng-btn:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }

/* hero-slider */
.ng-hero { position: relative; height: min(90vh, 760px); min-height: 480px; margin-top: -72px; }
.ng-slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1s ease; pointer-events: none;
}
.ng-slide.actif { opacity: 1; pointer-events: auto; }
.ng-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(14,10,24,.55) 0%, transparent 22%, transparent 55%, rgba(14,10,24,.82) 88%, var(--nuit) 100%),
    linear-gradient(90deg, rgba(14,10,24,.86) 0%, rgba(14,10,24,.35) 42%, transparent 70%);
}
.ng-slide-txt {
  position: absolute; left: clamp(16px, 5vw, 56px); bottom: clamp(70px, 12vh, 130px);
  max-width: 620px; z-index: 2;
}
.ng-slide-txt.centre { left: 0; right: 0; margin: 0 auto; text-align: center; max-width: 720px; padding: 0 20px; bottom: clamp(80px, 16vh, 160px); }
.ng-eyebrow { text-transform: uppercase; letter-spacing: .2em; font-size: 12.5px; font-weight: 700; color: var(--or); margin-bottom: 14px; }
.ng-slide-txt h1 {
  font-size: clamp(38px, 7vw, 88px); line-height: .98; font-weight: 800; letter-spacing: -.01em;
  text-wrap: balance; text-shadow: 0 4px 30px rgba(0,0,0,.6);
}
.ng-slide-txt h1 span { display: block; font-size: .34em; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--txt2); margin-top: 12px; }
.ng-devise {
  font-family: Georgia, "Times New Roman", serif; font-style: italic;
  font-size: clamp(16px, 2.1vw, 21px); line-height: 1.5; color: #efe7d6; margin: 18px 0 26px;
  text-shadow: 0 2px 16px rgba(0,0,0,.7);
}
.ng-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.ng-slide-txt.centre .ng-cta { justify-content: center; }
.ng-slide-marque { background-color: #0b0713; }

.ng-fleche {
  position: absolute; top: 44%; z-index: 3; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--ligne); background: rgba(14,10,24,.5); color: var(--txt);
  font-size: 26px; line-height: 1; cursor: pointer; backdrop-filter: blur(4px); transition: background .15s;
}
.ng-fleche:hover { background: rgba(14,10,24,.85); }
.ng-fleche.g { left: clamp(10px, 2vw, 22px); } .ng-fleche.d { right: clamp(10px, 2vw, 22px); }
.ng-points { position: absolute; bottom: 26px; left: 0; right: 0; z-index: 3; display: flex; gap: 9px; justify-content: center; }
.ng-pt { width: 30px; height: 4px; border-radius: 4px; border: none; background: rgba(236,230,245,.28); cursor: pointer; padding: 0; transition: background .2s, width .2s; }
.ng-pt.actif { background: var(--or); width: 44px; }

/* rangées de Livres (carrousels) */
.ng-rangs { padding: clamp(18px, 4vw, 40px) 0 10px; position: relative; z-index: 4; }
.ng-rang { margin-bottom: 30px; }
.ng-rang-titre { font-size: clamp(18px, 2.4vw, 24px); font-weight: 800; letter-spacing: .01em; margin: 0 clamp(16px, 5vw, 56px) 14px; }
.ng-piste {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 6px clamp(16px, 5vw, 56px) 16px; scrollbar-width: thin; scrollbar-color: var(--nuit3) transparent;
}
.ng-piste::-webkit-scrollbar { height: 8px; } .ng-piste::-webkit-scrollbar-thumb { background: var(--nuit3); border-radius: 8px; }
.ng-carte {
  flex: 0 0 auto; width: 210px; scroll-snap-align: start; cursor: pointer;
  background: none; border: none; padding: 0; text-align: left; color: inherit; font-family: inherit;
  transition: transform .18s ease;
}
.ng-carte:hover { transform: translateY(-4px); }
.ng-carte:focus-visible { outline: 2px solid var(--or); outline-offset: 3px; border-radius: 16px; }
.ng-carte-img {
  position: relative; aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden;
  background-size: cover; background-position: center; box-shadow: 0 10px 30px rgba(0,0,0,.5);
  border: 1px solid var(--ligne);
}
.ng-carte-lueur { position: absolute; inset: 0; background: linear-gradient(to top, rgba(12,8,20,.94) 4%, rgba(12,8,20,.5) 28%, transparent 55%); }
.ng-carte:hover .ng-carte-img { border-color: var(--acc, var(--or)); box-shadow: 0 14px 40px rgba(0,0,0,.6), 0 0 0 1px var(--acc, var(--or)); }
.ng-carte-play {
  position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px; color: #241703; background: var(--or);
  opacity: 0; transform: scale(.8); transition: opacity .18s, transform .18s;
}
.ng-carte:hover .ng-carte-play { opacity: 1; transform: scale(1); }
.ng-carte-verrou { position: absolute; left: 10px; top: 10px; z-index: 3; font-size: 12.5px; font-weight: 700; color: var(--txt); background: rgba(14,10,24,.72); padding: 5px 10px; border-radius: 999px; }
.ng-carte-bas { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 12px 13px 11px; text-align: left; }
.ng-carte-bas b { display: block; font-size: 15px; line-height: 1.2; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.75); }
.ng-carte-bas span { font-size: 12px; color: rgba(236,230,245,.82); }
.ng-carte.bientot { cursor: default; } .ng-carte.bientot:hover { transform: none; }
.ng-carte.bientot .ng-carte-img { filter: grayscale(.35) brightness(.82); }

/* « Qu'est-ce que Ngoma » */
.ng-about { padding: clamp(30px, 7vw, 80px) clamp(16px, 5vw, 56px); max-width: 1100px; margin: 0 auto; text-align: center; }
.ng-about h2 { font-size: clamp(26px, 4.5vw, 44px); font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.ng-lede { max-width: 68ch; margin: 16px auto 40px; font-size: clamp(16px, 2vw, 19px); line-height: 1.6; color: var(--txt2); }
.ng-lede b { color: var(--txt); }
.ng-piliers { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; text-align: left; }
.ng-pilier { background: var(--nuit2); border: 1px solid var(--ligne); border-radius: 18px; padding: 24px; }
.ng-pilier span { font-size: 28px; filter: drop-shadow(0 0 10px rgba(224,169,46,.4)); }
.ng-pilier h3 { font-size: 17px; margin: 12px 0 6px; }
.ng-pilier p { font-size: 14.5px; line-height: 1.55; color: var(--txt2); }

/* waitlist + pied */
.ng-meute { text-align: center; padding: clamp(24px, 5vw, 56px) 20px; background: radial-gradient(120% 100% at 50% 0%, rgba(224,169,46,.08), transparent 60%); }
.ng-meute h3 { font-size: clamp(20px, 3vw, 26px); font-weight: 800; }
.ng-meute p { color: var(--txt2); max-width: 60ch; margin: 8px auto 18px; font-size: 15px; }
.ng-meute-form { display: flex; gap: 10px; max-width: 460px; margin: 0 auto; }
.ng-meute-form input {
  flex: 1; padding: 13px 16px; border-radius: 999px; border: 1px solid var(--ligne);
  background: var(--nuit2); color: var(--txt); font-size: 15px;
}
.ng-meute-form input::placeholder { color: #6f6488; }
.ng-meute .meute-retour { margin-top: 12px; font-size: 14px; min-height: 1em; }
.ng-meute .meute-retour.ok { color: #8ad0a0; } .ng-meute .meute-retour.ko { color: #e59; }
.ng-pied { text-align: center; padding: 40px 20px 60px; border-top: 1px solid var(--ligne); color: var(--txt2); }
.ng-pied .ng-marque { justify-content: center; margin-bottom: 8px; }
.ng-pied p { font-size: 13.5px; }

/* fiche détaillée d'un Livre (overlay « show ») */
.ng-fiche {
  /* rendue hors du scope .ng (appendue au body) → palette autonome */
  --or: #e0a92e; --txt: #ece6f5; --txt2: #a99fc0; --nuit: #0e0a18; --ligne: rgba(233,226,242,.12);
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end;
  color: var(--txt); animation: ng-fondu .3s ease;
}
.ng-fiche-fond { position: absolute; inset: 0; background-size: cover; background-position: center; }
.ng-fiche-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,7,17,.55), rgba(10,7,17,.6) 40%, rgba(10,7,17,.95)); }
.ng-fiche-corps { position: relative; z-index: 2; max-width: 760px; padding: clamp(24px, 6vw, 64px); color: var(--txt); }
.ng-fiche-corps h1 { font-size: clamp(34px, 6vw, 66px); font-weight: 800; line-height: 1; text-wrap: balance; }
.ng-fiche-corps h1 span { display: block; font-size: .32em; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--txt2); margin-top: 10px; }
.ng-fiche-pitch { font-size: clamp(15px, 2vw, 18px); line-height: 1.6; color: #e7dfef; margin: 18px 0 26px; max-width: 60ch; }
.ng-fermer { position: absolute; top: 20px; right: 20px; z-index: 3; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--ligne); background: rgba(14,10,24,.6); color: var(--txt); font-size: 18px; cursor: pointer; }
.ng-fermer:hover { background: rgba(14,10,24,.9); }
@keyframes ng-fondu { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .ng-slide { transition: none; } .ng-carte, .ng-carte-play { transition: none; } .ng-fiche { animation: none; }
}
@media (max-width: 640px) {
  .ng-hero { height: 82vh; } .ng-carte { width: 150px; }
  .ng-barre { padding: 12px 14px; }
  .ng-barre .ng-marque { font-size: 16px; letter-spacing: .16em; }
  .ng-barre .ng-marque em { display: none; }
  .ng-barre .ng-btn { padding: 9px 14px; font-size: 13px; white-space: nowrap; }
  .ng-actions { gap: 8px; }
}

/* ════════════════════════════════════════════════════════════════════════
   THÈME IN-GAME — Kinara « nuit ». La plateforme (landing .ng) est sombre ;
   CHAQUE Livre porte son identité EN JEU (system theme()). Kinara = nuit
   indigo + or de lanterne + les couleurs des 4 valeurs. On redéfinit les
   tokens et on reprend les surfaces codées en dur (sans toucher au .ng).
   ════════════════════════════════════════════════════════════════════════ */
:root {
  --papier: #14101f; --papier2: #221a3a; --carte: #1b1430;
  --encre: #ece6f5; --encre2: #a99fc0;
  --terracotta: #e07a3a; --terracotta2: #b85a22;
  --or: #e0a92e; --bord: rgba(233,226,242,.12);
  --ombre: 0 8px 30px rgba(0,0,0,.5);
  /* --rouge servait de TEXTE (erreurs, captifs, vie des ennemis) sur du
     papier clair ; sur fond sombre le même rouge devient illisible
     (rouge sombre sur violet sombre). Éclairci pour rester lisible (~4.5:1). */
  --rouge: #f0917a;
}
body {
  color: var(--encre);
  background-image:
    radial-gradient(120% 90% at 50% -10%, rgba(53,49,110,.35), transparent 60%),
    repeating-linear-gradient(90deg, rgba(224,169,46,.02) 0 2px, transparent 2px 30px);
}
/* chrome */
header.top { background: rgba(20,16,31,.88); border-bottom-color: var(--bord); }
header.top .logo { color: var(--encre); } header.top .logo span { color: var(--or); }
header.top nav button { color: var(--encre2); }
header.top nav button.actif, header.top nav button:hover { background: var(--papier2); color: var(--encre); }
/* boutons */
.btn.secondaire { background: var(--papier2); color: var(--encre); border-color: var(--bord); box-shadow: 0 3px 0 #0c0918; }
.btn.discret { color: var(--encre2); }
/* cartes / surfaces / titres */
.carte { border-color: var(--bord); }
.carte h3, h2.section, .overlay h2, .cx-entree b, .ev-menace .t { color: #cdb9f0; }
.carte.choisie { border-color: var(--terracotta); background: #241a3d; }
.champ input, .champ textarea, .champ select { border-color: var(--bord); background: var(--papier2); color: var(--encre); }
.note, .carte .sous { color: var(--encre2); }
/* feed de jeu */
.ev-texte { border-color: var(--bord); }
.ev-info { color: var(--encre2); }
.ev-jet { background: var(--papier2); border-color: var(--bord); }
.ev-ennemis { background: #2a1620; border-color: rgba(224,120,60,.30); }
.ev-menace { border-color: var(--bord); }
/* Voix intérieures : le fond teinté reprend la couleur de la valeur, mais le
   TEXTE (.qui) doit être une version ÉCLAIRCIE de cette même teinte, sinon
   on obtient une couleur sur elle-même (ex. violet sur violet, illisible).
   .ev-voix (sans valeur reconnue — Livre tiers) reste neutre pour rester lisible. */
.ev-voix { background: var(--papier2); }
.ev-voix.v-ubuntu { background: rgba(74,124,89,.18); }
.ev-voix.v-ubuntu .qui { color: #a7d8b4; }
.ev-voix.v-sankofa { background: rgba(199,138,27,.16); }
.ev-voix.v-sankofa .qui { color: #f0cd7a; }
.ev-voix.v-nommo { background: rgba(31,138,138,.16); }
.ev-voix.v-nommo .qui { color: #7fd6d6; }
.ev-voix.v-maat { background: rgba(125,91,166,.18); }
.ev-voix.v-maat .qui { color: #cdb9f0; }
.choix-btn { background: var(--papier2); border-color: var(--bord); }
.choix-btn .tag { background: #2b2350; color: var(--encre2); }
/* pastilles de valeur des choix : mêmes teintes éclaircies que les voix,
   au lieu des pastilles pastel claires d'origine (illisibles sur fond sombre). */
.choix-btn .tag.v-ubuntu { background: rgba(74,124,89,.28); color: #a7d8b4; }
.choix-btn .tag.v-sankofa { background: rgba(199,138,27,.24); color: #f0cd7a; }
.choix-btn .tag.v-nommo { background: rgba(31,138,138,.24); color: #7fd6d6; }
.choix-btn .tag.v-maat { background: rgba(125,91,166,.28); color: #cdb9f0; }
.choix-btn .tag.v-combat { background: rgba(179,64,46,.28); color: #f0917a; }
.saisie-zone input, .libre-zone input { border-color: var(--bord); background: var(--papier2); color: var(--encre); }
.libre-zone { border-top-color: var(--bord); }
/* pills / chips — fond sombre teinté, texte clair */
.pill.anc { background: rgba(224,169,46,.22); color: #f0cd7a; }
.pill.tum, .pill.ko { background: rgba(179,64,46,.26); color: #f2a892; }
.pill.tot { background: #2b2350; color: #fff; }
.pill.ok, .chip-valeur { background: rgba(74,124,89,.24); color: #a7d8b4; border-color: transparent; }
.chip-passif { background: rgba(125,91,166,.24); color: #cdb9f0; border-color: transparent; }
.chip-echo { background: var(--papier2); color: var(--encre2); }
.chip-codex { background: var(--papier2); color: var(--encre2); border-color: var(--bord); }
/* panneau latéral */
.jauge .barre { background: #0e0a18; }
.jauge .lg, .ressources .r { color: var(--encre2); }
.ressources .r { background: var(--papier2); }
.cx-entree { border-bottom-color: var(--bord); }
/* overlays / tables / divers */
.overlay .boite { background: var(--carte); }
.alloc .pm { background: var(--papier2); color: var(--encre); }
table.admin th, table.admin td { border-bottom-color: var(--bord); }
table.admin th { color: var(--encre2); }
.flux-echo { background: var(--papier2); }
/* correctifs sombre : toast (utilisait --encre en fond) + badges de statut */
.toast { background: var(--papier2); color: var(--encre); border: 1px solid var(--bord); box-shadow: 0 8px 30px rgba(0,0,0,.55); }
.badge.demo { background: rgba(224,169,46,.20); color: #f0cd7a; }
.badge.actif { background: rgba(74,124,89,.26); color: #a7d8b4; }
.badge.admin { background: rgba(125,91,166,.30); color: #cdb9f0; }
