/* Couche "jeu vidéo" : vert forêt, brun foncé et or, vermillon en accent.
   Les couleurs qui changent avec le présage du d20 sont en haut. */
:root {
  --laque: #0f1913;
  --laque-2: #1a2a20;
  --or: #d1aa5e;
  --or-doux: rgba(209, 170, 94, 0.38);
  --vermillon: #b8432f;
  --accent: #c2412d;            /* change selon le présage */
  --r-commun: #8e8a80;
  --r-rare: #7fae8a;
  --r-maudit: #b8432f;
  --r-legendaire: #d4a94a;
  --barre-h: 84px;
}
html[data-presage="higanbana"] { --accent: #c2412d; }
html[data-presage="lune"]      { --accent: #b7c78d; }
html[data-presage="brume"]     { --accent: #cfc9bb; }
html[data-presage="kintsugi"]  { --accent: #d9ad4f; }
html[data-presage="maudit"]    { --accent: #e0302a; }

/* Teinte d'ambiance : posée sur le fond du site, sous le contenu, pour ne jamais délaver les œuvres */
.teinte { position: fixed; inset: 0; z-index: 0; pointer-events: none; transition: background 1.2s, opacity 1.2s; }
html[data-presage="higanbana"] .teinte { background: radial-gradient(ellipse at 50% 0%, rgba(190, 60, 30, 0.16), transparent 70%); mix-blend-mode: soft-light; }
html[data-presage="lune"] .teinte { background: radial-gradient(ellipse at 70% 10%, rgba(200, 220, 160, 0.16), transparent 65%); mix-blend-mode: soft-light; }
html[data-presage="brume"] .teinte { background: linear-gradient(180deg, rgba(225, 222, 212, 0.1), rgba(225, 222, 212, 0.04)); backdrop-filter: saturate(0.45); -webkit-backdrop-filter: saturate(0.45); }
html[data-presage="kintsugi"] .teinte { background: radial-gradient(ellipse at 50% 20%, rgba(230, 180, 80, 0.18), transparent 70%); mix-blend-mode: soft-light; }
html[data-presage="maudit"] .teinte { background: rgba(150, 10, 0, 0.22); mix-blend-mode: color; }
.lune-rouge { display: none; }
html[data-presage="maudit"] .lune-rouge {
  display: block; position: absolute; top: 9vh; right: 9vw; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #ff6b4a, #8f1408 70%); box-shadow: 0 0 80px 30px rgba(200, 30, 10, 0.35);
  opacity: 0.5; mix-blend-mode: screen;
}
/* le dégradé doré ne peint que dans la boîte de l'élément : on l'agrandit (padding) sans le déplacer (marge négative)
   pour que les arabesques de Zenitha qui débordent (le F, le R) ne soient pas coupées */
html[data-presage="kintsugi"] .hero-titre em { background: linear-gradient(90deg, #f3d48a, #b98a2e, #f3d48a); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding: .15em .35em; margin: .05em -.35em -.15em; }   /* haut : .2em d'écart avec SARAH moins le padding */

body { padding-bottom: calc(var(--barre-h) + 12px); }
body.rituel-ouvert { overflow: hidden; }
.surtitre { color: var(--accent); }

/* Cadre "laque et or", réutilisé par les panneaux */
.inventaire > *, .barre, .toast {
  background: linear-gradient(180deg, rgba(26, 42, 31, 0.94), rgba(13, 22, 16, 0.96));
  border: 1px solid var(--or-doux);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.5), inset 0 0 0 4px rgba(201, 164, 92, 0.12), 0 20px 50px rgba(0, 0, 0, 0.45);
}

/* ---------- Inventaire ---------- */
.inventaire { display: grid; grid-template-columns: 88px minmax(0, 1fr) 300px; gap: 14px; align-items: stretch; }
.inv-equipe { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 2px; }
.membre { position: relative; padding: 0; border: 1px solid var(--or-doux); background: #000; cursor: pointer; aspect-ratio: 3 / 4; overflow: hidden; color: var(--blanc); }
.membre img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.6) brightness(0.7); transition: filter .3s; }
.membre span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 0.5rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px; background: rgba(0,0,0,0.7); line-height: 1.3; }
.membre:hover img, .membre[aria-selected="true"] img { filter: none; }
.membre[aria-selected="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 18px -4px var(--accent); }

.inv-panneau { padding: 18px 18px 22px; position: relative; }
.inv-panneau::before, .inv-panneau::after { /* coins façon ferrures japonaises */
  content: ""; position: absolute; width: 22px; height: 22px; border: 2px solid var(--or); opacity: 0.6;
}
.inv-panneau::before { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.inv-panneau::after { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }
.inv-entete { display: flex; align-items: baseline; justify-content: center; gap: 1rem; margin-bottom: 14px; flex-wrap: wrap; text-align: center; }
.inv-entete h3 { font-size: clamp(1.4rem, 2.4vw, 2rem); }
.inv-ja { font-family: var(--f-jp); font-size-adjust: none; color: var(--or); letter-spacing: 0.2em; font-size: 0.85rem; }
.inv-corps { display: grid; grid-template-columns: 92px minmax(0, 1fr) 92px; gap: 14px; align-items: center; }
.inv-slots { display: flex; flex-direction: column; gap: 14px; }
.inv-perso { position: relative; height: clamp(360px, 52vh, 520px); display: flex; justify-content: center; align-items: flex-end; }
.inv-perso img { max-height: 100%; width: auto; max-width: 100%; object-fit: contain; position: relative; z-index: 1;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 22%, #000 78%, transparent), linear-gradient(to bottom, transparent, #000 8%, #000 80%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 22%, #000 78%, transparent), linear-gradient(to bottom, transparent, #000 8%, #000 80%, transparent);
  mask-composite: intersect; }
.inv-sol { position: absolute; left: 15%; right: 15%; bottom: 0; height: 40px; border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--accent) 40%, transparent), transparent 70%); }

.slot { position: relative; display: block; width: 92px; height: 92px; padding: 0; cursor: pointer; background: #0b140f;
  border: 1px solid var(--r-commun); outline-offset: 3px; transition: transform .2s, box-shadow .2s; }
.slot img { width: 100%; height: 100%; object-fit: cover; }
.slot::after { content: ""; position: absolute; inset: 3px; border: 1px solid rgba(255,255,255,0.08); pointer-events: none; }
.slot-type { position: absolute; left: 0; right: 0; bottom: 0; font-size: 0.48rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gris); background: rgba(0,0,0,0.75); line-height: 1.6; }
.slot:hover, .slot.choisi { transform: translateY(-2px); box-shadow: 0 0 22px -6px currentColor; }
.slot.vide { cursor: default; border-style: dashed; border-color: rgba(201,164,92,0.18); background:
  radial-gradient(circle, rgba(201,164,92,0.08) 0 18%, transparent 19%), #0b140f; }
.rarete-commun { color: var(--r-commun); border-color: var(--r-commun); }
.rarete-rare { color: var(--r-rare); border-color: var(--r-rare); }
.rarete-maudit { color: var(--r-maudit); border-color: var(--r-maudit); }
.rarete-legendaire { color: var(--r-legendaire); border-color: var(--r-legendaire); }
.slot.choisi { outline: 1px solid currentColor; }

/* Fiche personnage et infobulle d'objet (façon BG3) */
.inv-fiche { padding: 20px; display: flex; flex-direction: column; gap: 14px; min-height: 100%; color: var(--blanc); }
.inv-fiche h4 { font-family: var(--f-titre); font-size-adjust: none; font-weight: 400; font-size: 1.35rem; margin: 0; line-height: 1.2; }
.fiche-tete .surtitre { margin-bottom: 0.3rem; }
.stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.stats li { display: grid; grid-template-columns: 26px 70px 1fr 22px; align-items: center; gap: 8px; font-size: 0.7rem; }
.stat-k { font-family: var(--f-jp); font-size-adjust: none; color: var(--or); font-size: 0.95rem; text-align: center; }
.stat-nom { color: var(--gris); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.56rem; }
.stat-jauge { height: 4px; background: rgba(255,255,255,0.08); }
.stat-jauge i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--or)); }
.stats b { font-weight: 500; text-align: right; }
.lore { font-family: var(--f-titre); font-size-adjust: none; font-style: italic; font-size: 1.05rem; line-height: 1.5; color: var(--creme); }
.astuce, .note { font-size: 0.62rem; letter-spacing: 0.06em; color: var(--gris-doux); }
.note::before { content: "✎ "; }
.infobulle { border-top: 2px solid currentColor !important; }
.info-tete { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; }
.info-tete img { width: 72px; height: 72px; object-fit: cover; border: 1px solid currentColor; }
.info-ja { display: block; font-family: var(--f-jp); font-size-adjust: none; font-size: 0.78rem; color: var(--or); letter-spacing: 0.15em; }
.info-rarete { display: block; font-size: 0.55rem; letter-spacing: 0.16em; text-transform: uppercase; color: currentColor; }
.inv-fiche button.lien { background: none; border: 0; border-bottom: 1px solid rgba(246,242,234,0.3); color: var(--blanc); cursor: pointer; align-self: flex-start; font-family: inherit; font-size-adjust: none; padding: 0 0 0.35rem; }
.inv-fiche button.lien.discret { color: var(--gris); }

.inv-planches-titre { display: flex; align-items: center; gap: 1rem; margin: 40px 0 18px; font-size: 0.62rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--or); }
.inv-planches-titre i { flex: 1; height: 1px; background: var(--or-doux); }
.galerie.planches { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.galerie.planches .oeuvre .cadre { border: 1px solid var(--or-doux); }

/* ---------- Barre du voyageur ---------- */
.barre { position: fixed; z-index: 65; left: 50%; bottom: max(10px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  width: min(980px, calc(100% - 20px)); height: var(--barre-h); display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-radius: 3px; }
.voyageur { display: flex; align-items: center; gap: 12px; min-width: 0; }
.voyageur-portrait { position: relative; flex: none; width: 60px; height: 60px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--blanc); }
.voyageur-portrait svg { width: 100%; height: 100%; }
.voyageur-portrait polygon { fill: #142219; stroke: var(--accent); stroke-width: 2.5; }
.voyageur-portrait polygon + polygon { fill: color-mix(in srgb, var(--accent) 25%, #142219); stroke: var(--or); stroke-width: 1.5; }
.voyageur-portrait span { position: absolute; inset: 0; display: grid; place-items: center; padding-top: 6px; font-family: var(--f-titre); font-size-adjust: none; font-size: 1.15rem; font-weight: 500; }
.voyageur-portrait:hover svg, .voyageur-portrait.roule svg { animation: rouler .5s ease-out; }
.voyageur-infos { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.voyageur-infos b { font-weight: 500; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; }
.voyageur-infos .ja { font-family: var(--f-jp); font-size-adjust: none; color: var(--or); letter-spacing: 0.1em; }
.voyageur-presage { font-size: 0.62rem; color: var(--accent); white-space: nowrap; }
.ki { width: 120px; height: 5px; background: rgba(255,255,255,0.08); margin-top: 4px; }
.ki i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--vermillon), var(--accent)); transition: width .15s; }
.raccourcis { display: flex; gap: 6px; margin: 0 auto; }
.raccourcis a { position: relative; width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid var(--or-doux); background: #0b140f; transition: border-color .2s, transform .2s; }
.raccourcis a .k { font-family: var(--f-jp); font-size-adjust: none; font-size: 1.35rem; color: var(--creme); }
.raccourcis a::before { content: attr(data-touche); position: absolute; top: 2px; left: 4px; font-size: 0.5rem; color: var(--gris-doux); }
.raccourcis a small { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 8px; background: var(--laque); border: 1px solid var(--or-doux); opacity: 0; pointer-events: none; transition: opacity .2s; }
.raccourcis a:hover small, .raccourcis a:focus-visible small { opacity: 1; }
.raccourcis a:hover { transform: translateY(-2px); border-color: var(--or); }
.raccourcis a.actif { border-color: var(--accent); box-shadow: inset 0 0 14px -4px var(--accent); }
.raccourcis a.actif .k { color: var(--accent); }
.collection { display: flex; align-items: center; gap: 8px; flex: none; font-size: 0.8rem; }
.collection .k { font-family: var(--f-jp); font-size-adjust: none; font-size: 1.2rem; color: var(--or); }
.collection small { display: block; font-size: 0.5rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gris-doux); }

/* Annonce (présage, succès, message secret) */
.toast { position: fixed; z-index: 66; left: 50%; transform: translateX(-50%); bottom: calc(var(--barre-h) + 24px);
  width: min(520px, calc(100% - 20px)); padding: 14px 18px; display: flex; gap: 14px; align-items: center; animation: apparaitre .4s ease-out; font-size: 0.75rem; line-height: 1.6; color: var(--gris); }
.toast .kanji { font-family: var(--f-jp); font-size-adjust: none; font-size: 2rem; color: var(--accent); flex: none; }
.toast b { display: block; color: var(--blanc); font-weight: 500; letter-spacing: 0.08em; }
.toast .lien { flex: none; background: none; border: 0; color: var(--creme); cursor: pointer; font-family: inherit; font-size-adjust: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .inventaire { grid-template-columns: minmax(0, 1fr); }
  .inv-equipe { flex-direction: row; justify-content: center; }
  .membre { width: 72px; }
  .galerie.planches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  :root { --barre-h: 64px; }
  .inv-corps { grid-template-columns: 64px minmax(0, 1fr) 64px; gap: 8px; }
  .slot { width: 64px; height: 64px; }
  .slot-type { display: none; }
  .inv-perso { height: 320px; }
  .voyageur-infos, .collection small { display: none; }
  .voyageur-portrait { width: 46px; height: 46px; }
  .raccourcis { gap: 4px; }
  .raccourcis a { width: 38px; height: 38px; }
  .raccourcis a .k { font-size: 1rem; }
  .raccourcis a::before, .raccourcis a small { display: none; }
  .barre { gap: 8px; padding: 6px 8px; }
  .collection { font-size: 0.68rem; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .voyageur-portrait:hover svg, .voyageur-portrait.roule svg { animation: none; }
}

@keyframes apparaitre { from { opacity: 0; transform: translateY(6px); } }
@keyframes rouler { to { transform: rotate(360deg) scale(0.92); } }
