/* abyssia/abyssia.css — « Les Profondeurs d'Abyssia » (tout le décor est au canvas : ici, l'interface).
   Palette : contraste glace (cyan pâle) / lave (orange braise) sur roche bleu-nuit. */
:root {
  --ink: #eef4fb; --dim: #a9b8cc; --or: #ffd36a; --vert: #8dffc0; --cyan: #9fe8ff; --rouge: #ff9a8a; --lave: #ff7a3c;
  --panel: rgba(10, 12, 24, .92); --bord: rgba(159, 232, 255, .28); --bord-lave: rgba(255, 122, 60, .45); --sw: 1024px;
  --u: calc(var(--sw) / 1280);
  --serif: Georgia, "Times New Roman", Times, serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: #07080f; 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: 100%; max-width: 1400px; margin: 0 auto; }
button { touch-action: manipulation; }

/* ── Bandeau ─────────────────────────────────────────────────────────────── */
.fv-header { display: flex; align-items: center; gap: 6px; padding: 6px 8px; min-height: 52px; background: linear-gradient(90deg, #12324a, #141428 55%, #3a1610); 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; color: var(--ink); }
.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(--ink); }
.pastille.possibles { color: var(--or); letter-spacing: 1px; }
.pastille.possibles i { font-style: normal; opacity: .45; }
.btn-rond { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--bord); background: rgba(255,255,255,.06); color: var(--ink); font-size: 1.1rem; padding: 0; cursor: pointer; font-family: inherit; }
.btn-rond.actif { background: rgba(127, 224, 255, .25); border-color: var(--cyan); }
.btn-rond:active { transform: scale(.94); }

/* ── Scène ───────────────────────────────────────────────────────────────── */
.scene { position: relative; width: var(--sw); max-width: 100%; margin: 0 auto; aspect-ratio: 16 / 9; overflow: hidden; user-select: none; -webkit-user-select: none; background: #07080f; }
.scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.calque { position: absolute; pointer-events: none; }
.bulle { right: calc(30 * var(--u)); top: calc(40 * var(--u)); width: min(calc(470 * var(--u)), 92%); max-height: calc(400 * var(--u)); overflow: auto; padding: calc(12 * var(--u)) calc(16 * var(--u)); border-radius: calc(18 * var(--u));
  background: rgba(12, 14, 28, .93); border: 1px solid var(--bord); box-shadow: 0 8px 30px rgba(0,0,0,.6); font-size: max(13px, calc(19 * var(--u))); line-height: 1.4; opacity: 0; transform: translateY(-10px); transition: opacity .3s, transform .3s; color: var(--ink); }
.bulle.vue { opacity: 1; transform: none; }
.bulle .qui { color: var(--or); font-weight: 700; margin-bottom: 2px; }

/* ── Console ─────────────────────────────────────────────────────────────── */
.console { position: relative; background: linear-gradient(180deg, #151a2c, #0a0b15); border-top: 1px solid var(--bord-lave); padding: 8px 10px 4px; }
.consigne { text-align: center; color: var(--ink); font-size: 1rem; line-height: 1.4; min-height: 1.4em; margin: 0 auto 8px; max-width: 920px; }
.consigne b { color: var(--or); }
.consigne .prec { color: var(--dim); font-size: .88rem; white-space: nowrap; }
.num-etape { display: inline-block; font-size: .78rem; font-weight: 800; color: #04121a; background: var(--cyan); border-radius: 99px; padding: 1px 8px; margin-right: 4px; vertical-align: 1px; }
.commandes { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; }
.choix-titre { width: 100%; text-align: center; color: var(--dim); }
.choix-titre b { color: var(--or); }
.choix { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.choix.colonne { flex-direction: column; align-items: stretch; max-width: 820px; width: 100%; }
.puce { font: 700 1rem system-ui, sans-serif; padding: 10px 16px; min-height: 48px; border-radius: 14px; border: 1px solid var(--bord); background: rgba(255,255,255,.06); color: var(--ink); cursor: pointer; }
.puce.large { text-align: left; font-weight: 500; font-size: .95rem; line-height: 1.35; }
.puce b { color: var(--or); }
.puce:active, .touche:active { transform: scale(.96); }
.saisie { display: flex; align-items: baseline; gap: 2px; padding: 4px 14px; border-radius: 14px; background: rgba(0,0,0,.35); border: 1px solid rgba(127,224,255,.4); min-width: 130px; justify-content: flex-end; }
.champ { min-width: 2.2em; text-align: right; font: 700 1.7rem var(--serif); color: #fff; font-variant-numeric: lining-nums tabular-nums; }
.champ.vide { color: rgba(255,255,255,.3); }
.unite { font: 700 1.4rem var(--serif); color: var(--or); white-space: pre; }
.pave { display: grid; grid-template-columns: repeat(13, auto); gap: 5px; }
.touche { width: 46px; height: 48px; border-radius: 12px; border: 1px solid var(--bord); background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.03)); color: var(--ink); font: 700 1.25rem system-ui, sans-serif; cursor: pointer; padding: 0; }
.touche.efface { color: var(--rouge); }
.pied { display: flex; align-items: center; justify-content: center; min-height: 46px; margin-top: 4px; padding: 0 130px 0 60px; }
.pied .msg { flex: 1; text-align: center; font-size: .92rem; color: var(--dim); min-height: 1.2em; }
.pied .msg b { color: var(--or); }
.pied .msg.ok { color: var(--vert); } .pied .msg.ko { color: var(--rouge); }
.bouton { cursor: pointer; font: 800 1rem system-ui, sans-serif; padding: 11px 18px; min-height: 48px; border-radius: 12px; border: 0; color: #04121a; background: linear-gradient(135deg, #c8f4ff, #5cd0ff); box-shadow: 0 0 20px rgba(92, 208, 255, .45); }
.bouton.envoyer { min-height: 52px; padding: 10px 22px; font-size: 1.08rem; letter-spacing: .02em; animation: appel 2.4s ease-in-out infinite; }
@keyframes appel { 50% { box-shadow: 0 0 34px rgba(92, 208, 255, .85); } }
.bouton:active { transform: scale(.96); }
.bouton.violet { color: #fff; background: linear-gradient(135deg, #8e6bff, #5a3fd0); box-shadow: 0 0 18px rgba(142, 107, 255, .4); }
.bouton.discret { color: var(--ink); background: rgba(255,255,255,.08); box-shadow: none; border: 1px solid var(--bord); }

/* ── Dialogues ───────────────────────────────────────────────────────────── */
.voile { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 12px; background: rgba(1, 6, 10, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.voile.ouvert { display: flex; }
.voile.bas { align-items: flex-end; background: linear-gradient(180deg, transparent 35%, rgba(1, 6, 10, .72)); backdrop-filter: none; -webkit-backdrop-filter: none; }
.voile.bas .dialogue { margin-bottom: 64px; max-height: 52dvh; }
.voile.haut { align-items: flex-start; background: linear-gradient(0deg, transparent 35%, rgba(1, 6, 10, .72)); backdrop-filter: none; -webkit-backdrop-filter: none; }
.voile.haut .dialogue { margin-top: 4px; max-height: 50dvh; }
.voile.droite { justify-content: flex-end; align-items: flex-start; background: linear-gradient(270deg, rgba(1, 6, 10, .75), transparent 50%); backdrop-filter: none; -webkit-backdrop-filter: none; }
.voile.droite .dialogue { width: min(100%, 345px); margin-top: 54px; max-height: calc(100dvh - 66px); }
.dialogue { width: min(100%, 700px); max-height: calc(100dvh - 24px); overflow: auto; -webkit-overflow-scrolling: touch; background: linear-gradient(180deg, #18233a, #0c0d18); 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(92, 208, 255, .12); 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.boss { color: #ffab7a; }
.dialogue .qui span { font-size: 1.7rem; }
.dialogue p { margin: 0 0 12px; line-height: 1.6; font-size: 1.04rem; }
.dialogue p b { color: var(--or); }
.dialogue p.tt { min-height: 3.2em; }
.dialogue .redaction { display: block; margin-top: 6px; padding: 8px 12px; border-radius: 10px; background: #f1e6c8; color: #2a1a08; font-family: var(--serif); line-height: 1.55; }
.dialogue .redaction b { color: #7a2a10; }
.dialogue .avertit { color: var(--rouge); font-size: .92rem; }
.dialogue .actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.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(-120deg); opacity: 0; } }

/* Carte des chapitres */
.carte h2 { margin: 0 0 4px; text-align: center; font: 700 1.6rem var(--serif); color: #fff; text-shadow: 0 0 18px rgba(92, 208, 255, .5); }
.carte .sous { text-align: center; color: var(--dim); margin: 0 0 14px; font-size: .92rem; }
.chapitres { display: grid; gap: 10px; }
.chap { --c: #7fe0ff; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid rgba(255,255,255,.18); cursor: pointer; text-align: left; font: inherit; color: var(--ink);
  background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,255,255,.02)); }
.chap:disabled { opacity: .45; cursor: default; }
.chap .num { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; font: 800 1.4rem system-ui, sans-serif; color: #04121a; 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 { display: block; 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(190px, 1fr)); gap: 8px; margin-top: 12px; }
.niveaux-liste button { font: inherit; text-align: left; cursor: pointer; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--bord); background: rgba(255,255,255,.05); color: var(--ink); min-height: 48px; }
.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, 138, 190, .6); }

/* Grimoire du navigateur */
.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; }

/* À propos (SEO) */
.seo-about { max-width: 840px; margin: 26px auto 16px; padding: 16px 22px; border-radius: 14px; background: rgba(14, 16, 30, .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); }

@media (max-width: 900px) {
  .pave { grid-template-columns: repeat(7, auto); }
}
@media (max-width: 820px) {
  .pied { padding: 0 96px 0 50px; }
  .consigne { font-size: .95rem; }
}
@media (max-width: 640px) {
  #etoilesTotal { display: none; }
  .fv-header { gap: 4px; padding: 5px 6px; }
  .btn-rond { width: 40px; height: 40px; font-size: 1rem; }
  .pastille { padding: 5px 7px; font-size: .78rem; }
  .fv-header .titre small { display: none; }
  .fv-header .titre { font-size: .82rem; }
  .touche { width: 44px; height: 46px; }
  .pied { padding: 0 60px 0 44px; }
}
/* Garde-fous thèmes du site (le jeu garde son fond sombre : texte clair obligatoire) */
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-"] .wrap, body[class*="theme-"] .wrap * { color: #eef6fb !important; -webkit-text-fill-color: #eef6fb !important; }
body[class*="theme-"] .wrap .unite, body[class*="theme-"] .wrap .consigne b, body[class*="theme-"] .wrap .msg b { color: #ffd36a !important; -webkit-text-fill-color: #ffd36a !important; }
body[class*="theme-"] .wrap .bouton, body[class*="theme-"] .wrap .bouton *, body[class*="theme-"] .wrap .num-etape, body[class*="theme-"] .wrap .signe.choisi { color: #04121a !important; -webkit-text-fill-color: #04121a !important; }
body[class*="theme-"] .wrap body[class*="theme-"] .voile .dialogue, body[class*="theme-"] .voile .dialogue * { color: #eef6fb !important; -webkit-text-fill-color: #eef6fb !important; }
body[class*="theme-"] .voile .bouton:not(.discret):not(.violet) { color: #04121a !important; -webkit-text-fill-color: #04121a !important; }
body[class*="theme-"] .voile .grimoire, body[class*="theme-"] .voile .grimoire *, body[class*="theme-"] .voile .redaction, body[class*="theme-"] .voile .redaction * { color: #2a1406 !important; -webkit-text-fill-color: #2a1406 !important; }

/* ── Abyssia : pavé avec touche de signe, comparer, ranger ──────────────── */
.touche.signe-touche { width: 58px; color: var(--lave); border-color: var(--bord-lave); font-size: 1.15rem; background: linear-gradient(180deg, rgba(255,122,60,.18), rgba(255,122,60,.05)); }
.champ.negatif { color: #bfefff; }
.saisie { min-width: 150px; }
.comparaisons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; }
.paire { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 14px; background: rgba(0,0,0,.3); border: 1px solid var(--bord); }
.paire .nb { min-width: 3.4em; text-align: center; font: 700 1.35rem var(--serif); color: #fff; white-space: nowrap; }
.signe { width: 50px; height: 48px; border-radius: 12px; border: 1px solid var(--bord); background: rgba(255,255,255,.06); color: var(--ink); font: 800 1.5rem system-ui, sans-serif; cursor: pointer; padding: 0; }
.signe.choisi { background: linear-gradient(180deg, #c8f4ff, #5cd0ff); color: #04121a; border-color: #c8f4ff; box-shadow: 0 0 14px rgba(92,208,255,.6); }
.rangement { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.suite-rangee { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; min-height: 50px; padding: 4px 10px; border-radius: 14px; background: rgba(0,0,0,.3); border: 1px dashed var(--bord); min-width: min(520px, 92vw); }
.suite-rangee i { font-style: normal; color: var(--or); font-weight: 800; font-size: 1.2rem; }
.suite-rangee .vide { color: var(--dim); font-size: .92rem; }
.tuiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 48px; }
.tuile { min-width: 62px; min-height: 48px; padding: 6px 12px; border-radius: 12px; border: 1px solid var(--bord); background: linear-gradient(180deg, rgba(159,232,255,.16), rgba(159,232,255,.04)); color: #fff; font: 700 1.25rem var(--serif); cursor: pointer; }
.tuile.pose { background: linear-gradient(180deg, rgba(255,211,106,.25), rgba(255,211,106,.06)); border-color: rgba(255,211,106,.5); }
.signe:active, .tuile:active { transform: scale(.95); }
@media (max-width: 640px) {
  .paire .nb { font-size: 1.1rem; min-width: 2.8em; }
  .signe { width: 44px; height: 46px; }
  .touche.signe-touche { width: 52px; }
}
