/* La Forêt de la Malédiction — feuille de style */
:root {
  --bg0: #0d0906;
  --bg1: #1a120c;
  --leather: #2b1d12;
  --leather2: #3a2818;
  --ink: #2a1c10;
  --ink-soft: #5a4632;
  --paper: #e9dcbc;
  --paper2: #dfcfa8;
  --paper-edge: #b79f6e;
  --gold: #d1a94f;
  --gold-dim: #9d7c33;
  --blood: #8e1f1a;
  --blood2: #b5302a;
  --good: #2f6b3a;
  --bad: #9a2a22;
  --chip-item: #2f4f7a;
  --shadow: rgba(0, 0, 0, .55);
  --font-body: "Palatino Linotype", "Book Antiqua", Palatino, "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-title: "Trajan Pro", "Copperplate Gothic Light", Copperplate, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --fs: 1.12rem;
  --sheet-w: 350px;
}
body[data-theme="parchment"] {
  --bg0: #cdbf9a;
  --bg1: #e2d5b1;
  --leather: #5a4632;
  --leather2: #6c5640;
  --paper: #f4ead0;
  --paper2: #eadfbf;
  --paper-edge: #c9b586;
  --shadow: rgba(60, 40, 15, .35);
}
body[data-fs="0"] { --fs: 1rem; }
body[data-fs="1"] { --fs: 1.12rem; }
body[data-fs="2"] { --fs: 1.28rem; }
body[data-fs="3"] { --fs: 1.44rem; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--paper);
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(140, 60, 25, .22), transparent 60%),
    radial-gradient(900px 600px at 10% 110%, rgba(30, 60, 35, .25), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
  background-attachment: fixed;
  overflow-x: hidden;
}
body[data-theme="parchment"] { color: var(--ink); background: linear-gradient(180deg, var(--bg1), var(--bg0)); }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 3px; }

#fog {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background:
    radial-gradient(60vw 30vh at 20% 80%, rgba(180, 190, 170, .07), transparent 70%),
    radial-gradient(70vw 30vh at 80% 70%, rgba(180, 190, 170, .06), transparent 70%);
  animation: fog 40s ease-in-out infinite alternate;
}
@keyframes fog { from { transform: translateX(-3%); } to { transform: translateX(3%); } }
body[data-theme="parchment"] #fog { display: none; }

/* ---------- Barre supérieure ---------- */
#topbar {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: max(.4rem, env(safe-area-inset-top)) .8rem .4rem;
  background: linear-gradient(180deg, rgba(13, 9, 6, .96), rgba(13, 9, 6, .82));
  border-bottom: 1px solid rgba(209, 169, 79, .25);
  backdrop-filter: blur(6px);
}
.tb-left, .tb-right { display: flex; align-items: center; gap: .35rem; }
.tb-right { justify-content: flex-end; }
.tb-title { font-family: var(--font-title); letter-spacing: .12em; font-size: .78rem; text-transform: uppercase; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-sec { font-family: var(--font-title); letter-spacing: .2em; color: var(--paper); font-size: .95rem; }
.icon-btn {
  width: 2.35rem; height: 2.35rem; border-radius: 50%; display: inline-grid; place-items: center;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(209, 169, 79, .3); color: var(--gold);
  font-size: 1.05rem; line-height: 1; transition: background .2s, transform .2s;
}
.icon-btn:hover { background: rgba(209, 169, 79, .18); transform: translateY(-1px); }

#quickbar {
  position: sticky; top: 3.1rem; z-index: 25;
  display: flex; justify-content: center; flex-wrap: wrap; gap: .25rem .9rem;
  padding: .35rem .8rem; font-size: .88rem;
  background: rgba(22, 15, 10, .93); border-bottom: 1px solid rgba(209, 169, 79, .18);
  font-variant-numeric: tabular-nums;
}
#quickbar .qb { display: inline-flex; align-items: baseline; gap: .3rem; white-space: nowrap; }
#quickbar .qb b { color: var(--gold); font-weight: 700; }
#quickbar .qb.low b { color: #ff7b6b; }

/* ---------- Mise en page ---------- */
#layout { position: relative; z-index: 1; display: block; max-width: 1240px; margin: 0 auto; padding: 1rem clamp(.5rem, 3vw, 1.5rem) 4rem; }
#stage { min-width: 0; outline: none; }
#sheet { display: none; }

@media (min-width: 1040px) {
  #app[data-sheet="on"] #layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--sheet-w); gap: 1.5rem; align-items: start; }
  #app[data-sheet="on"] #sheet { display: block; position: sticky; top: 4.2rem; max-height: calc(100vh - 5rem); overflow: auto; scrollbar-width: thin; }
  #quickbar { display: none !important; }
  .only-narrow { display: none !important; }
}
@media (max-width: 1039px) {
  #layout { z-index: auto; }
  #sheet.open {
    display: block; position: fixed; z-index: 60; top: 0; right: 0; bottom: 0;
    width: min(94vw, 400px); overflow: auto; box-shadow: -20px 0 60px rgba(0, 0, 0, .7);
    animation: slideIn .25s ease-out;
  }
  #sheet-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .6); }
  .tb-title { display: none; }
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Écrans ---------- */
.screen { max-width: 820px; margin: 0 auto; }
.screen.fresh, .page.fresh { animation: pageIn .5s ease-out both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.title-screen { text-align: center; padding: 2.5vh 0 2rem; }
.title-art { border: 2px solid var(--gold-dim); border-radius: 4px; overflow: hidden; box-shadow: 0 20px 60px var(--shadow), inset 0 0 0 4px rgba(0, 0, 0, .4); margin-bottom: 1.6rem; }
.title-art svg, .title-art img { display: block; width: 100%; height: auto; }
.kicker { font-family: var(--font-title); text-transform: uppercase; letter-spacing: .35em; color: var(--gold); font-size: .8rem; }
.big-title { font-family: var(--font-title); font-weight: 700; letter-spacing: .06em; line-height: 1.05; margin: .4rem 0 .3rem; font-size: clamp(2rem, 6vw, 3.6rem); color: var(--paper); text-shadow: 0 2px 0 #000, 0 0 30px rgba(190, 70, 30, .5); }
.tagline { font-style: italic; color: #cbb98f; max-width: 34em; margin: .4rem auto 1.5rem; line-height: 1.6; }
.menu { display: flex; flex-direction: column; gap: .7rem; align-items: center; margin-top: 1rem; }
.credits { margin-top: 2.2rem; font-size: .78rem; color: #9a8a68; line-height: 1.6; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.9rem; padding: .55rem 1.4rem;
  border-radius: 4px; border: 1px solid var(--gold-dim);
  background: linear-gradient(180deg, var(--leather2), var(--leather));
  color: var(--paper); font-family: var(--font-title); letter-spacing: .1em; text-transform: uppercase; font-size: .86rem;
  box-shadow: 0 3px 0 #000, 0 8px 16px rgba(0, 0, 0, .35);
  transition: transform .12s, box-shadow .12s, background .2s, border-color .2s;
  min-width: min(20rem, 100%);
}
.btn:hover:not(:disabled) { border-color: var(--gold); background: linear-gradient(180deg, #4a3220, #33221a); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, var(--blood2), var(--blood)); border-color: #d9a55a; }
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #cc3f36, #9d241d); }
.btn-small { min-height: 2.1rem; padding: .25rem .8rem; font-size: .74rem; min-width: 0; }
.btn-ghost { background: transparent; box-shadow: none; border-color: rgba(209, 169, 79, .4); }

/* ---------- Page du livre ---------- */
.page {
  position: relative;
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 245, 210, .55), transparent 60%),
    linear-gradient(180deg, var(--paper), var(--paper2));
  border-radius: 3px;
  padding: clamp(1rem, 3.2vw, 2.2rem);
  box-shadow: 0 0 0 1px var(--paper-edge), 0 0 0 5px rgba(0, 0, 0, .35), 0 25px 60px var(--shadow), inset 0 0 90px rgba(120, 85, 35, .28);
}
.page::before { /* grain du papier */
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .25  0 0 0 0 .1  0 0 0 .5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.page > * { position: relative; }
.sec-head { display: flex; align-items: center; gap: .8rem; margin: 0 0 .9rem; color: var(--blood); }
.sec-head::before, .sec-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--ink-soft), transparent); }
.sec-num { font-family: var(--font-title); font-size: 1.7rem; font-weight: 700; letter-spacing: .12em; }
.illus { margin: 0 0 1.1rem; border: 1px solid var(--ink); outline: 3px double rgba(42, 28, 16, .55); outline-offset: 3px; background: #cdbb8d; line-height: 0; overflow: hidden; }
.illus svg, .illus img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; }
.prose { font-size: var(--fs); line-height: 1.72; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.prose p { margin: 0 0 .9em; }
.prose p:first-child::first-letter {
  font-family: var(--font-title); float: left; font-size: 3.4em; line-height: .82; padding: .06em .1em 0 0; color: var(--blood); font-weight: 700;
}
.note { font-style: italic; text-align: center; margin: .5rem 1rem 1rem; padding: .6rem .9rem; border-left: 3px solid var(--blood); background: rgba(142, 31, 26, .07); font-size: calc(var(--fs) * .95); }
.rules-note { font-size: calc(var(--fs) * .88); font-style: italic; color: var(--ink-soft); border-top: 1px dotted var(--ink-soft); padding-top: .5rem; margin-top: .6rem; line-height: 1.5; }

/* chips d'effets */
.fxlog { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 1rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .7rem; border-radius: 99px; font-size: .84rem; font-family: var(--font-body); font-weight: 700; border: 1px solid; animation: chipIn .4s ease-out both; }
.chip.good { color: #1f4f2a; background: rgba(47, 107, 58, .14); border-color: rgba(47, 107, 58, .5); }
.chip.bad { color: #7a1c15; background: rgba(154, 42, 34, .13); border-color: rgba(154, 42, 34, .5); }
.chip.item { color: #1f3d66; background: rgba(47, 79, 122, .13); border-color: rgba(47, 79, 122, .5); }
.chip.used { color: #5b4a34; background: rgba(90, 70, 50, .12); border-color: rgba(90, 70, 50, .4); }
@keyframes chipIn { from { opacity: 0; transform: scale(.85) translateY(4px); } to { opacity: 1; transform: none; } }

/* choix */
.choices { display: flex; flex-direction: column; gap: .6rem; margin-top: 1.1rem; }
.choices-label { font-family: var(--font-title); letter-spacing: .15em; text-transform: uppercase; font-size: .78rem; text-align: center; color: var(--blood); margin: 1rem 0 0; }
.choice {
  position: relative; display: flex; gap: .8rem; align-items: center; text-align: left; width: 100%;
  padding: .8rem 1rem .8rem .8rem; border-radius: 3px;
  background: linear-gradient(180deg, #3b2919, #2a1c10); color: var(--paper);
  border: 1px solid #120a05; box-shadow: 0 2px 0 rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(209, 169, 79, .35);
  font-size: calc(var(--fs) * .96); line-height: 1.35; transition: transform .12s, background .2s, box-shadow .2s;
}
.choice .k { flex: none; width: 1.7rem; height: 1.7rem; display: grid; place-items: center; font-family: var(--font-title); font-size: .85rem; color: var(--gold); border: 1px solid var(--gold-dim); border-radius: 50%; background: rgba(0, 0, 0, .3); }
.choice:hover:not(:disabled) { background: linear-gradient(180deg, #6d2019, #4c1410); transform: translateX(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .5), inset 0 0 0 1px var(--gold); }
.choice:active:not(:disabled) { transform: translateX(3px) translateY(1px); }
.choice:disabled { opacity: .45; cursor: not-allowed; }
.choice small { display: block; opacity: .75; font-size: .78em; }
.choice.cont { justify-content: center; background: linear-gradient(180deg, var(--blood2), var(--blood)); font-family: var(--font-title); letter-spacing: .12em; text-transform: uppercase; font-size: .92rem; }
.choice.cont::after { content: "→"; }

/* panneaux interactifs */
.panel { margin: 1.1rem 0; padding: 1rem; border: 1px solid rgba(42, 28, 16, .55); background: rgba(90, 60, 25, .1); border-radius: 3px; box-shadow: inset 0 0 0 3px rgba(255, 245, 210, .25); }
.panel h3 { margin: 0 0 .6rem; font-family: var(--font-title); letter-spacing: .12em; text-transform: uppercase; font-size: .92rem; color: var(--blood); text-align: center; }
.panel-row { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; margin-top: .8rem; }
.panel .btn { min-width: 0; }
.result { text-align: center; margin: .8rem 0 .2rem; font-size: calc(var(--fs) * 1.02); }
.result strong.good { color: var(--good); }
.result strong.bad { color: var(--bad); }
.result-title { font-family: var(--font-title); letter-spacing: .14em; text-transform: uppercase; font-size: 1.15rem; }
.result-title.good { color: var(--good); }
.result-title.bad { color: var(--bad); }

/* dés */
.dice { display: inline-flex; gap: .45rem; vertical-align: middle; }
.die {
  --s: 2.5rem; width: var(--s); height: var(--s); border-radius: 22%; padding: 12%;
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  background: radial-gradient(circle at 30% 25%, #fffdf3, #e9dfc3 70%, #cdbf9b); border: 1px solid #6d5a3a;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .35), inset 0 -2px 3px rgba(90, 60, 20, .35);
}
.die i { display: block; border-radius: 50%; background: #1d1109; place-self: center; width: 78%; height: 78%; }
.die i.r { background: var(--blood); }
.die.sm { --s: 1.8rem; }
.dice.anim .die { animation: roll .55s cubic-bezier(.3, .7, .3, 1) both; }
.dice.anim .die:nth-child(2) { animation-delay: .08s; }
@keyframes roll { 0% { transform: translateY(-14px) rotate(-200deg) scale(.6); opacity: 0; } 60% { transform: translateY(3px) rotate(20deg) scale(1.05); opacity: 1; } 100% { transform: none; } }
.roll-sum { font-family: var(--font-title); font-weight: 700; font-size: 1.2rem; margin-left: .3rem; }

/* combat */
.foes { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.foe { position: relative; padding: .7rem .8rem; border: 1px solid rgba(42, 28, 16, .6); background: rgba(255, 245, 210, .35); border-radius: 3px; }
.foe.dead { opacity: .5; filter: grayscale(.8); }
.foe.target { outline: 2px solid var(--blood); box-shadow: 0 0 14px rgba(142, 31, 26, .35); }
.foe-name { font-family: var(--font-title); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .84rem; }
.foe-stats { font-size: .92rem; display: flex; gap: 1rem; margin-top: .25rem; font-variant-numeric: tabular-nums; }
.bar { height: .55rem; border: 1px solid rgba(42, 28, 16, .7); background: rgba(0, 0, 0, .15); border-radius: 99px; overflow: hidden; margin-top: .35rem; }
.bar > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7a1c15, #c2453a); transition: width .5s ease; }
.bar.you > span { background: linear-gradient(90deg, #2f6b3a, #5a9c56); }
.round-log { margin-top: .9rem; padding: .7rem; background: rgba(255, 245, 210, .4); border: 1px dashed rgba(42, 28, 16, .5); border-radius: 3px; }
.round-line { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: center; text-align: center; padding: .3rem 0; }
.round-line + .round-line { border-top: 1px dotted rgba(42, 28, 16, .35); }
.round-line .who { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); }
.round-line .fa { font-family: var(--font-title); font-weight: 700; font-size: 1.15rem; }
.round-out { grid-column: 1 / -1; font-weight: 700; }
.round-out.hit { color: var(--good); }
.round-out.hurt { color: var(--bad); }
.round-out.tie, .round-out.dodge { color: var(--ink-soft); }
.luck-row { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin-top: .6rem; align-items: center; }
.luck-res { font-size: .9rem; font-weight: 700; }
.luck-res.good { color: var(--good); } .luck-res.bad { color: var(--bad); }
.fa-line { font-size: .88rem; text-align: center; color: var(--ink-soft); margin-top: .5rem; }

/* paiement / boutique */
.pick-list { display: grid; gap: .35rem; margin: .6rem 0; }
.pick { display: flex; align-items: center; gap: .6rem; padding: .35rem .6rem; border: 1px solid rgba(42, 28, 16, .35); border-radius: 3px; background: rgba(255, 245, 210, .35); cursor: pointer; }
.pick input { accent-color: var(--blood); width: 1.1rem; height: 1.1rem; }
.stepper { display: inline-flex; align-items: center; gap: .4rem; }
.stepper button { width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--ink-soft); background: rgba(255, 245, 210, .6); font-weight: 700; color: var(--ink); }
.shop-row { display: grid; grid-template-columns: 1.6rem 1fr auto auto; gap: .5rem; align-items: center; padding: .4rem .3rem; border-bottom: 1px dotted rgba(42, 28, 16, .4); }
.shop-row .price { font-weight: 700; color: var(--blood); font-variant-numeric: tabular-nums; }
.shop-row .own { font-size: .78rem; color: var(--ink-soft); }
.shop-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .3rem; font-weight: 700; }
.tag-gold { color: #7a5a10; font-weight: 700; }

/* ---------- Feuille d'aventure ---------- */
.sheet-card {
  color: var(--ink); border-radius: 3px; padding: 1rem 1rem 1.2rem; position: relative;
  background: radial-gradient(120% 90% at 50% 0%, rgba(255, 245, 210, .5), transparent 60%), linear-gradient(180deg, var(--paper), var(--paper2));
  box-shadow: 0 0 0 1px var(--paper-edge), 0 0 0 5px rgba(0, 0, 0, .35), 0 20px 50px var(--shadow), inset 0 0 70px rgba(120, 85, 35, .25);
}
.sheet-title { font-family: var(--font-title); text-transform: uppercase; letter-spacing: .18em; text-align: center; color: var(--blood); font-size: 1rem; margin: 0; }
.sheet-name { text-align: center; font-style: italic; margin: .1rem 0 .8rem; color: var(--ink-soft); }
.sheet-close { position: absolute; right: .5rem; top: .5rem; width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--ink-soft); background: rgba(255, 245, 210, .6); font-size: 1rem; }
@media (min-width: 1040px) { .sheet-close { display: none; } }
.stat { padding: .5rem .6rem; border: 1px solid rgba(42, 28, 16, .55); border-radius: 3px; margin-bottom: .5rem; background: rgba(255, 245, 210, .35); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.stat-name { font-family: var(--font-title); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
.stat-val { font-family: var(--font-title); font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-val small { font-size: .55em; color: var(--ink-soft); font-weight: 400; }
.stat .adj { display: inline-flex; gap: .2rem; }
.stat .adj button { width: 1.5rem; height: 1.5rem; line-height: 1; border-radius: 50%; border: 1px solid var(--ink-soft); background: transparent; color: var(--ink-soft); font-size: .9rem; opacity: .55; }
.stat .adj button:hover { opacity: 1; background: rgba(255, 245, 210, .7); }
.stat.low .stat-val { color: var(--bad); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.sheet-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .45rem .1rem; border-bottom: 1px dotted rgba(42, 28, 16, .4); }
.sheet-row .lab { font-family: var(--font-title); text-transform: uppercase; letter-spacing: .1em; font-size: .76rem; }
.sheet-sec { font-family: var(--font-title); text-transform: uppercase; letter-spacing: .16em; font-size: .78rem; color: var(--blood); margin: 1rem 0 .3rem; border-bottom: 1px solid var(--blood); padding-bottom: .15rem; }
.prov-icons { letter-spacing: -.05em; font-size: .95rem; }
.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li { display: grid; grid-template-columns: 1.5rem 1fr auto; gap: .4rem; align-items: center; padding: .3rem 0; border-bottom: 1px dotted rgba(42, 28, 16, .3); font-size: .93rem; }
.item-list .qty { color: var(--ink-soft); font-size: .8rem; }
.item-list .base { opacity: .8; }
.mini-btn { padding: .1rem .55rem; font-size: .72rem; border: 1px solid var(--ink-soft); border-radius: 3px; background: rgba(255, 245, 210, .7); color: var(--ink); font-family: var(--font-title); letter-spacing: .05em; }
.mini-btn:hover:not(:disabled) { background: var(--paper); border-color: var(--blood); color: var(--blood); }
.mini-btn:disabled { opacity: .4; cursor: not-allowed; }
.x-btn { border: 0; background: none; color: var(--ink-soft); opacity: .5; font-size: 1rem; padding: 0 .3rem; }
.x-btn:hover { opacity: 1; color: var(--bad); }
.monsters { width: 100%; border-collapse: collapse; font-size: .84rem; }
.monsters td { padding: .2rem .3rem; border-bottom: 1px dotted rgba(42, 28, 16, .3); }
.monsters .o-win { color: var(--good); } .monsters .o-fled { color: #8a6a1c; } .monsters .o-lost { color: var(--bad); }
.notes { width: 100%; min-height: 6.5rem; resize: vertical; font: inherit; font-size: .92rem; color: var(--ink); background: rgba(255, 250, 230, .7); border: 1px solid rgba(42, 28, 16, .45); border-radius: 3px; padding: .5rem; line-height: 1.5; }
.trail { display: flex; flex-wrap: wrap; gap: .25rem; font-size: .78rem; }
.trail span { padding: .05rem .4rem; border: 1px solid rgba(42, 28, 16, .4); border-radius: 99px; background: rgba(255, 245, 210, .5); font-variant-numeric: tabular-nums; }
.trail span:last-child { background: var(--blood); color: var(--paper); border-color: var(--blood); }
.fa-box { font-size: .82rem; color: var(--ink-soft); margin-top: .25rem; }

/* ---------- Création ---------- */
.create-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 1rem 0; }
.roll-card { padding: .9rem; border: 1px solid rgba(42, 28, 16, .55); background: rgba(255, 245, 210, .4); border-radius: 3px; text-align: center; }
.roll-card h4 { margin: 0 0 .1rem; font-family: var(--font-title); letter-spacing: .12em; text-transform: uppercase; color: var(--blood); font-size: .95rem; }
.roll-card p { margin: 0 0 .6rem; font-size: .84rem; color: var(--ink-soft); }
.roll-card .big { font-family: var(--font-title); font-size: 2.6rem; font-weight: 700; line-height: 1; margin: .5rem 0 0; }
.potion-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: .8rem 0 1.2rem; }
.potion { text-align: left; padding: .7rem .8rem; border: 2px solid rgba(42, 28, 16, .4); background: rgba(255, 245, 210, .4); border-radius: 3px; color: var(--ink); }
.potion b { display: block; font-family: var(--font-title); letter-spacing: .06em; }
.potion span { font-size: .85rem; color: var(--ink-soft); }
.potion:hover { border-color: var(--blood); }
.potion.sel { border-color: var(--blood); background: rgba(142, 31, 26, .12); box-shadow: 0 0 0 2px rgba(142, 31, 26, .25); }
.field { display: block; margin: .5rem 0 1rem; }
.field span { display: block; font-family: var(--font-title); letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; color: var(--blood); margin-bottom: .25rem; }
.field input { width: 100%; padding: .6rem .8rem; font: inherit; font-size: 1.05rem; color: var(--ink); background: rgba(255, 250, 230, .75); border: 1px solid rgba(42, 28, 16, .5); border-radius: 3px; }
.h2 { font-family: var(--font-title); text-transform: uppercase; letter-spacing: .14em; color: var(--blood); font-size: 1.25rem; margin: 0 0 .2rem; text-align: center; }
.sub { text-align: center; font-style: italic; color: var(--ink-soft); margin: 0 0 1rem; }
.rules h3 { font-family: var(--font-title); text-transform: uppercase; letter-spacing: .1em; color: var(--blood); font-size: 1rem; margin: 1.4rem 0 .3rem; }
.rules p, .rules li { font-size: calc(var(--fs) * .95); line-height: 1.6; }
.rules ul { padding-left: 1.2rem; }
.rules kbd { font-family: inherit; padding: 0 .35rem; border: 1px solid var(--ink-soft); border-radius: 3px; background: rgba(255, 245, 210, .7); }
.end-screen { text-align: center; }
.end-screen .verdict { font-family: var(--font-title); font-size: clamp(1.7rem, 5vw, 2.6rem); letter-spacing: .08em; text-transform: uppercase; margin: .4rem 0; }
.end-screen.dead .verdict { color: var(--blood); }
.end-screen.win .verdict { color: #7a5a10; text-shadow: 0 0 22px rgba(255, 200, 80, .5); }
.end-screen .btns { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin-top: 1.4rem; }
.end-screen .btn { color: var(--paper); }
.stats-line { display: flex; gap: 1.4rem; justify-content: center; flex-wrap: wrap; margin: 1rem 0; font-size: .95rem; color: var(--ink-soft); }
.stats-line b { color: var(--ink); font-family: var(--font-title); font-size: 1.2rem; display: block; }

/* modales */
#modal-root .scrim { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .7); display: grid; place-items: center; padding: 1rem; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: min(30rem, 100%); max-height: 90vh; overflow: auto; color: var(--ink); background: linear-gradient(180deg, var(--paper), var(--paper2)); padding: 1.4rem; border-radius: 4px; box-shadow: 0 0 0 1px var(--paper-edge), 0 0 0 5px rgba(0, 0, 0, .4), 0 30px 80px #000; }
.modal h3 { margin: 0 0 .6rem; font-family: var(--font-title); text-transform: uppercase; letter-spacing: .12em; color: var(--blood); }
.modal .btn { width: 100%; margin-top: .5rem; color: var(--paper); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px dotted rgba(42, 28, 16, .4); }
.seg { display: inline-flex; border: 1px solid var(--ink-soft); border-radius: 3px; overflow: hidden; }
.seg button { border: 0; background: rgba(255, 245, 210, .5); padding: .3rem .8rem; color: var(--ink); }
.seg button.on { background: var(--blood); color: var(--paper); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
body[data-anim="off"] * { animation: none !important; transition: none !important; }
@media print { #topbar, #quickbar, #fog, .choices { display: none; } }

/* boutons discrets sur fond clair */
.panel .btn-ghost, .page .btn-ghost, .modal .btn-ghost { color: var(--ink); border-color: var(--ink-soft); background: rgba(255, 245, 210, .35); }
.panel .btn-ghost:hover:not(:disabled), .page .btn-ghost:hover:not(:disabled), .modal .btn-ghost:hover:not(:disabled) { background: rgba(255, 245, 210, .8); border-color: var(--blood); color: var(--blood); }
.end-screen .btn-ghost { color: var(--ink); }
@media (max-width: 430px) {
  #quickbar { font-size: .76rem; gap: .15rem .6rem; padding: .3rem .4rem; top: 3.05rem; }
  .prose { text-align: left; }
}

.item-list.quest li.miss{opacity:.5}
.item-list.quest li.have{font-weight:600}

#quickbar .qb-btn { font: inherit; cursor: pointer; border: 1px solid var(--gold); background: transparent; color: var(--gold); border-radius: 1rem; padding: .1rem .6rem; }
#quickbar .qb-btn:disabled { opacity: .35; cursor: default; }

/* Boutique : étiquette de l'objet (touchez le nom) */
.shop-name { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; border-bottom: 1px dotted var(--ink-soft); }
.shop-name:hover, .shop-row.open .shop-name { color: var(--blood); border-bottom-color: var(--blood); }
.shop-ico { cursor: pointer; }
.shop-desc { margin: -.15rem 0 .2rem 2.1rem; padding: .45rem .7rem; font-size: .92rem; font-style: italic; line-height: 1.4; color: var(--ink); background: rgba(255, 245, 210, .7); border: 1px dashed var(--ink-soft); border-radius: 3px; border-left: 3px solid var(--blood); animation: chipIn .25s ease-out both; }

/* ---------- Carte de l'aventurier ---------- */
.sheet-map { position: absolute; left: .5rem; top: .5rem; width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--ink-soft); background: rgba(255, 245, 210, .6); font-size: 1.05rem; line-height: 1; cursor: pointer; }
.sheet-map:hover { background: rgba(255, 245, 210, .95); }
#map-root { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; background: rgba(8, 5, 3, .94); color: var(--paper); animation: fade .2s; }
.map-bar { display: flex; align-items: center; gap: .4rem; padding: .5rem .7rem; padding-top: max(.5rem, env(safe-area-inset-top)); border-bottom: 1px solid rgba(209, 169, 79, .3); }
.map-ttl { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.map-ttl b { font-family: var(--font-title); text-transform: uppercase; letter-spacing: .14em; font-size: .85rem; color: var(--gold); }
.map-sub { font-size: .78rem; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-bar button { min-width: 2.3rem; height: 2.3rem; border-radius: 6px; border: 1px solid rgba(209, 169, 79, .35); background: rgba(255, 255, 255, .05); color: var(--gold); font-size: 1rem; cursor: pointer; }
.map-bar button:hover { background: rgba(255, 255, 255, .12); }
.map-view {
  position: relative; flex: 1; margin: .6rem; border-radius: 4px; overflow: hidden; touch-action: none; cursor: grab; min-height: 0;
  background: radial-gradient(120% 100% at 50% 40%, #f1e5c3, #e3d3a8 70%, #cdb783);
  box-shadow: 0 0 0 1px #b79f6e, 0 0 0 6px rgba(0, 0, 0, .45), inset 0 0 90px rgba(120, 85, 35, .45), inset 0 0 0 7px rgba(90, 60, 25, .18);
}
.map-view:active { cursor: grabbing; }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none; }
.map-node { cursor: pointer; }
.map-node:hover { filter: drop-shadow(0 0 4px rgba(181, 48, 42, .8)); }
.map-num { font: italic 700 9px/1 var(--font-body); fill: #5a4632; paint-order: stroke; stroke: rgba(244, 234, 208, .85); stroke-width: 2.6px; pointer-events: none; }
.map-lab { font: italic 700 11px/1 "Segoe Script", "Bradley Hand", "Comic Sans MS", cursive; fill: #8e1f1a; paint-order: stroke; stroke: rgba(244, 234, 208, .9); stroke-width: 3px; pointer-events: none; }
.map-spin { transform-box: fill-box; transform-origin: center; animation: mapspin 14s linear infinite; }
.map-pin { animation: mapbob 1.6s ease-in-out infinite; }
@keyframes mapspin { to { transform: rotate(360deg); } }
@keyframes mapbob { 50% { transform: translate(0, -4px); } }
.map-route { animation: mapmarch 1.2s linear infinite; }
@keyframes mapmarch { to { stroke-dashoffset: -12; } }
body[data-anim="off"] .map-spin, body[data-anim="off"] .map-pin, body[data-anim="off"] .map-route { animation: none; }
@media (prefers-reduced-motion: reduce) { .map-spin, .map-pin, .map-route { animation: none; } }
.map-compass { position: absolute; right: .7rem; top: .7rem; width: 64px; height: 64px; pointer-events: none; opacity: .9; }
.map-pop { position: absolute; left: .7rem; right: .7rem; bottom: .7rem; max-width: 22rem; margin: 0 auto; padding: .7rem .9rem; border-radius: 4px; color: var(--ink); background: linear-gradient(180deg, #f4ead0, #eadfbf); box-shadow: 0 0 0 1px #b79f6e, 0 8px 28px rgba(0, 0, 0, .55); font-size: .95rem; cursor: default; }
.map-pop b { font-family: var(--font-title); letter-spacing: .06em; color: var(--blood); }
.map-pop p { margin: .3rem 0; }
.map-pop .map-x { position: absolute; right: .3rem; top: .3rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 1px solid var(--ink-soft); background: transparent; color: var(--ink); cursor: pointer; }
.map-note { display: block; margin-top: .4rem; font-size: .8rem; color: var(--ink-soft); }
.map-note input { display: block; width: 100%; box-sizing: border-box; margin-top: .15rem; padding: .4rem .5rem; font: inherit; font-size: 1rem; color: var(--ink); background: rgba(255, 255, 255, .55); border: 1px solid var(--ink-soft); border-radius: 3px; }
.map-legend { position: absolute; left: .7rem; top: .7rem; max-width: 15rem; padding: .5rem .6rem; border-radius: 4px; display: flex; flex-direction: column; gap: .15rem; font-size: .82rem; color: var(--ink); background: rgba(244, 234, 208, .94); box-shadow: 0 0 0 1px #b79f6e, 0 6px 20px rgba(0, 0, 0, .4); max-height: calc(100% - 1.4rem); overflow: auto; }
.map-legend span { display: flex; align-items: center; gap: .45rem; }
.map-legend small { opacity: .75; margin-top: .2rem; }
.lg-route, .lg-old, .lg-stub { display: inline-block; width: 22px; height: 0; border-top: 3px dashed #b5302a; }
.lg-old { border-top: 2px solid #6b4a28; }
.lg-stub { border-top: 2px dotted #7a6a50; }
@media (max-width: 520px) { .map-view { margin: .3rem; } .map-compass { width: 48px; height: 48px; } }
@media (max-width: 420px) { .map-ttl b { font-size: .7rem; letter-spacing: .06em; } .map-bar { gap: .25rem; padding: .4rem .4rem; } .map-bar button { min-width: 2rem; } }

/* Boutique : étiquette de l'objet (touchez le nom) */
.shop-name { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; border-bottom: 1px dotted var(--ink-soft); }
.shop-name:hover, .shop-row.open .shop-name { color: var(--blood); border-bottom-color: var(--blood); }
.shop-ico { cursor: pointer; }
.shop-desc { margin: -.15rem 0 .2rem 2.1rem; padding: .45rem .7rem; font-size: .92rem; font-style: italic; line-height: 1.4; color: var(--ink); background: rgba(255, 245, 210, .7); border: 1px dashed var(--ink-soft); border-radius: 3px; border-left: 3px solid var(--blood); animation: chipIn .25s ease-out both; }
