@import url("fonts.css");

:root {
  --ground: #E9EDEA; --surface: #F7F9F7; --paper: #FCFCFA; --sunk: #DFE5E1;
  --ink: #18221E; --muted: #56655E; --line: #C3CEC8;
  --accent: #2C6A55; --accent-ink: #FFFFFF;
  --gold: #E69F00; --death: #1E1E1E; --death-ink: #FFFFFF; --combat: #D55E00; --spell: #0072B2; --normal: #7A8781;
  --loss: #A12A1F; --gain: #1F6B4F;
  --display: "Alegreya SC", "Palatino Linotype", Georgia, serif;
  --serif: "Alegreya", "Palatino Linotype", Georgia, serif;
  --sans: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --read-size: 19px;
  --radius: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0F1513; --surface: #161E1B; --paper: #131A17; --sunk: #1D2723;
    --ink: #E1E9E5; --muted: #93A39B; --line: #2C3833;
    --accent: #72C2A2; --accent-ink: #0F1513;
    --death: #EDEDED; --death-ink: #111111; --combat: #E8773A; --spell: #56B4E9; --normal: #7D8D86;
    --loss: #FF8A7A; --gain: #7DD3AE;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0F1513; --surface: #161E1B; --paper: #131A17; --sunk: #1D2723;
  --ink: #E1E9E5; --muted: #93A39B; --line: #2C3833;
  --accent: #72C2A2; --accent-ink: #0F1513;
  --death: #EDEDED; --death-ink: #111111; --combat: #E8773A; --spell: #56B4E9; --normal: #7D8D86;
  --loss: #FF8A7A; --gain: #7DD3AE;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
a { color: var(--accent); }
img { max-width: 100%; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* ---------- barre du haut ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--display); font-weight: 700; font-size: 22px; text-decoration: none; color: var(--ink); letter-spacing: .01em; }
.topbar .spacer { flex: 1; }
.topbar .crumb { font-family: var(--display); font-size: 18px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 8px 14px; font-weight: 500; text-decoration: none; color: var(--ink); min-height: 40px; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.btn.danger { color: var(--loss); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 14px; }
.btn.ghost { background: none; border-color: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.ending .mark .ico { width: 72px; height: 72px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stack { display: grid; gap: 12px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- formulaires ---------- */
label.field { display: grid; gap: 4px; font-size: 14px; color: var(--muted); font-weight: 500; }
input[type=text], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); min-height: 38px;
}
textarea { resize: vertical; line-height: 1.5; }
input[type=number] { font-family: var(--mono); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }

/* ---------- page ---------- */
.page { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: 34px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

/* ---------- bibliothèque ---------- */
.lib-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; }
.card .cover { aspect-ratio: 3 / 2; background: var(--sunk); display: grid; place-items: center; overflow: hidden; }
.card .cover img { width: 100%; height: 100%; object-fit: cover; }
.card .cover .ph { font-family: var(--display); font-size: 42px; color: var(--muted); }
.card .body { padding: 14px 16px 8px; display: grid; gap: 6px; align-content: start; }
.card .foot { padding: 10px 16px 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; color: var(--muted); width: fit-content; }

/* ---------- lecture ---------- */
.play { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; max-width: 1180px; margin: 0 auto; padding: 20px 16px 80px; align-items: start; }
.reader { scroll-margin-top: 76px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 28px clamp(16px, 4vw, 48px) 36px; min-width: 0; }
.sec-num { font-family: var(--mono); font-weight: 700; font-size: 44px; line-height: 1; text-align: center; margin-bottom: 18px; }
.sec-num small { display: block; font-family: var(--display); font-size: 18px; font-weight: 500; color: var(--muted); margin-top: 6px; }
.illus { margin: 0 0 20px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--sunk); }
.illus img { display: block; width: 100%; max-height: 60vh; object-fit: contain; background: var(--sunk); cursor: zoom-in; }
.prose { font-family: var(--serif); font-size: var(--read-size); line-height: 1.65; max-width: 66ch; margin: 0 auto; text-align: var(--align, justify); hyphens: auto; -webkit-hyphens: auto; }
.prose p { margin: 0 0 1em; }
.prose h3 { font-size: 1.15em; margin: 1.2em 0 .4em; }
.msgs { display: grid; gap: 6px; margin: 16px auto 0; max-width: 66ch; }
.msg { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 6px; font-weight: 500; border: 1px solid var(--line); background: var(--surface); }
.msg.loss { color: var(--loss); } .msg.gain { color: var(--gain); }
.msg svg { width: 16px; height: 16px; flex: none; }

.choices { display: grid; gap: 8px; max-width: 66ch; margin: 24px auto 0; }
.choice { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-family: var(--serif); font-size: calc(var(--read-size) - 1px); }
.choice:hover:not(:disabled) { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.choice .go { font-family: var(--mono); font-weight: 700; font-size: 15px; color: var(--muted); }
.choice:disabled { cursor: not-allowed; opacity: .6; border-style: dashed; }
.choice .why { grid-column: 1 / -1; font-family: var(--sans); font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.choice .why svg { width: 14px; height: 14px; }

.block { max-width: 66ch; margin: 24px auto 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 16px; display: grid; gap: 12px; }
.block h3 { display: flex; gap: 8px; align-items: center; font-size: 18px; }
.block h3 svg { width: 22px; height: 22px; }
.outcome { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 17px; }
.outcome.ok::before { content: "✓"; } .outcome.ko::before { content: "✗"; }
.table-roll { width: 100%; border-collapse: collapse; font-size: 15px; }
.table-roll td { padding: 4px 8px; border-top: 1px solid var(--line); }
.table-roll tr.hit td { font-weight: 700; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.table-roll tr.hit td:first-child::before { content: "▶ "; }

.ending { text-align: center; max-width: 60ch; margin: 28px auto 0; display: grid; gap: 12px; justify-items: center; }
.ending .mark { display: block; }
.ending h2 { font-size: 30px; }

/* ---------- dés ---------- */
.dice { display: inline-flex; gap: 8px; align-items: center; }
.die { width: 46px; height: 46px; border-radius: 10px; background: var(--paper); border: 2px solid var(--ink); display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 6px; box-shadow: 0 2px 0 var(--line); }
.die i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); place-self: center; visibility: hidden; }
.die.rolling { animation: tumble .6s cubic-bezier(.3,.7,.4,1); }
@keyframes tumble { 0% { transform: rotate(-200deg) scale(.6) translateY(-18px); } 60% { transform: rotate(20deg) scale(1.08); } 100% { transform: none; } }
.dice-total { font-family: var(--mono); font-weight: 700; font-size: 22px; }

/* ---------- combat ---------- */
.fighters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.fighter { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 6px; background: var(--paper); }
.fighter.target { border: 2px solid var(--ink); }
.fighter.down { opacity: .5; }
.fighter.down .fname::after { content: " — vaincu"; font-weight: 400; color: var(--muted); }
.fighter .fname { font-weight: 700; display: flex; gap: 6px; align-items: center; }
.fighter img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; }
.bar { height: 10px; border-radius: 5px; background: var(--sunk); overflow: hidden; border: 1px solid var(--line); }
.bar > span { display: block; height: 100%; background: var(--ink); }
.bar.me > span { background: var(--accent); }
.statline { display: flex; justify-content: space-between; font-size: 14px; }
.round { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 6px; background: var(--paper); }
.round .vs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; }
.round .vs b { font-family: var(--mono); font-size: 18px; }
.log { max-height: 180px; overflow-y: auto; font-size: 14px; color: var(--muted); display: grid; gap: 2px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }

/* ---------- feuille d'aventure ---------- */
.sheet { position: sticky; top: 72px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 14px; max-height: calc(100vh - 90px); overflow-y: auto; }
.sheet h2 { font-size: 20px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stats { display: grid; gap: 8px; }
.stat { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px 8px; }
.stat .label { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.stat .val { font-family: var(--mono); font-weight: 700; font-size: 22px; }
.stat .val small { font-size: 14px; color: var(--muted); font-weight: 500; }
.stat .bar { grid-column: 1 / -1; }
.stat.flash .val { animation: flash .9s; }
@keyframes flash { 0% { transform: scale(1.35); } 100% { transform: none; } }
.inv { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.inv li { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 15px; }
.sheet-toggle { display: none; }
.pill { font-family: var(--mono); font-weight: 700; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; background: var(--paper); }

@media (max-width: 900px) {
  .play { grid-template-columns: 1fr; }
  .sheet { position: fixed; inset: auto 0 0 0; top: auto; max-height: 78vh; border-radius: 16px 16px 0 0; z-index: 30; transform: translateY(105%); transition: transform .25s; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -8px 30px rgb(0 0 0 / .2); }
  .sheet.open { transform: none; }
  .sheet-toggle { display: inline-flex; }
  .reader { padding-inline: 16px; }
}

/* ---------- création du héros ---------- */
.creator { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; display: grid; gap: 20px; }
.classes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.class-opt { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px; }
.class-opt[aria-pressed="true"] { border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.class-opt[aria-pressed="true"] b::before { content: "✓ "; }
.rolls { display: grid; gap: 10px; }
.rollrow { display: grid; grid-template-columns: 140px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.rollrow .formula { font-family: var(--mono); color: var(--muted); font-size: 14px; }

/* ---------- modales et notifications ---------- */
.overlay { position: fixed; inset: 0; background: rgb(0 0 0 / .45); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; width: min(720px, 100%); max-height: 88vh; overflow: auto; padding: 18px; display: grid; gap: 14px; }
.modal.wide { width: min(1100px, 100%); }
.modal header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.toasts { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 6px; width: min(460px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--surface); border-radius: 8px; padding: 10px 14px; font-weight: 500; box-shadow: 0 6px 20px rgb(0 0 0 / .25); }
.lightbox img { max-height: 84vh; width: auto; margin: 0 auto; display: block; }

/* ---------- éditeur ---------- */
.editor { display: grid; grid-template-columns: 260px minmax(0, 1fr); height: calc(100vh - 61px); min-height: 0; }
.ed-side { border-right: 1px solid var(--line); background: var(--surface); display: grid; grid-template-rows: auto auto 1fr auto; min-height: 0; }
.ed-side .head { padding: 12px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.ed-list { overflow-y: auto; padding: 6px; display: grid; gap: 2px; align-content: start; }
.ed-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; text-align: left; border: 1px solid transparent; background: none; border-radius: 6px; padding: 6px 8px; font-size: 14px; }
.ed-item:hover { background: var(--sunk); }
.ed-item[aria-current="true"] { background: var(--paper); border-color: var(--ink); }
.ed-item .n { font-family: var(--mono); font-weight: 700; }
.ed-item .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.ed-item .k { display: flex; gap: 3px; }
.ed-main { display: grid; grid-template-rows: auto 1fr; min-height: 0; min-width: 0; }
.tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--surface); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 12px 12px 10px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.ed-pane { overflow-y: auto; padding: 20px; min-height: 0; }
.ed-form { max-width: 900px; display: grid; gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 14px; display: grid; gap: 12px; }
.panel > header { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel > header h3 { font-size: 17px; }
.rowline { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.rowline .rm { justify-self: end; }
.subtle { font-size: 13px; color: var(--muted); }
.problems { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.problems li { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: baseline; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.lvl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); }
.lvl.error { border: 2px solid var(--loss); color: var(--loss); }
.lvl.error::before { content: "✗ "; }
.lvl.warning::before { content: "⚠ "; }
.lvl.info::before { content: "i "; }
.graph-wrap { position: relative; height: 100%; min-height: 420px; }
#graph { position: absolute; inset: 0; }
.graph-tools { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 2; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; pointer-events: none; }
.graph-tools > * { pointer-events: auto; }
.graph-actions { position: absolute; right: 10px; bottom: 10px; z-index: 2; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 6px 12px; font-weight: 500; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.chk { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 500; cursor: pointer; user-select: none; font-size: 15px; }
.chk input { accent-color: var(--accent); margin: 0; }
.legend { position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 330px); z-index: 2; display: flex; gap: 12px; flex-wrap: wrap; padding: 6px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend svg { width: 16px; height: 16px; }
.img-slot { display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: center; }
.img-slot .thumb { aspect-ratio: 4/3; border: 1px dashed var(--line); border-radius: 8px; display: grid; place-items: center; overflow: hidden; background: var(--sunk); color: var(--muted); font-size: 13px; }
.img-slot .thumb img { width: 100%; height: 100%; object-fit: cover; }
.saved { font-size: 13px; color: var(--muted); }

@media (max-width: 800px) {
  .editor { grid-template-columns: 1fr; height: auto; }
  .ed-side { max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .img-slot { grid-template-columns: 1fr; }
  .rollrow { grid-template-columns: 1fr auto; }
  .rollrow .formula { display: none; }
}

/* ---------- version imprimable ---------- */
.print-controls { display: grid; gap: 12px; }
.print-book { background: #fff; color: #111; max-width: 820px; margin: 0 auto 64px; padding: 32px clamp(16px, 5vw, 56px); border: 1px solid var(--line); font-family: var(--serif); font-size: 15px; line-height: 1.5; }
.print-root.A5 .print-book { max-width: 600px; font-size: 13.5px; }
.print-book h1, .print-book h2, .print-book h3 { font-family: var(--display); color: #111; }
.print-book h2 { font-size: 26px; margin: 0 0 12px; text-align: center; }
.print-book h3 { font-size: 17px; margin: 14px 0 6px; }
.print-book p, .print-book li { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.pr-page { break-after: page; page-break-after: always; padding-bottom: 24px; }
.pr-cover { text-align: center; display: grid; gap: 14px; justify-items: center; align-content: center; min-height: 60vh; }
.pr-cover h1 { font-size: 40px; }
.pr-cover-img { width: 100%; }
.pr-cover-img img { width: 100%; max-height: 90mm; object-fit: contain; }
.pr-author { font-family: var(--display); font-size: 20px; margin: 0; }
.pr-desc { font-style: italic; max-width: 50ch; text-align: center !important; }
.pr-small { font-size: .82em; color: #444; }
.pr-sections { padding-top: 8px; }
.print-root.cols .pr-sections { column-count: 2; column-gap: 8mm; column-rule: 1px solid #ccc; }
.pr-start { text-align: center !important; font-style: italic; column-span: all; }
.pr-sec { break-inside: auto; margin: 0 0 14px; }
.pr-num { font-family: var(--mono) !important; font-size: 22px !important; text-align: center; margin: 10px 0 4px !important; break-after: avoid; }
.pr-num::before, .pr-num::after { content: "—"; margin: 0 8px; color: #999; font-weight: 400; }
.pr-img img { display: block; width: 100%; max-height: 70mm; object-fit: contain; margin: 4px 0; break-inside: avoid; }
.pr-text p { margin: 0 0 .6em; }
.pr-fx, .pr-block { border-left: 3px solid #111; padding-left: 8px; }
.pr-block { break-inside: avoid; margin: .6em 0; }
.pr-table { border-collapse: collapse; width: 100%; margin: 4px 0; font-size: .95em; }
.pr-table td { border: 1px solid #999; padding: 2px 6px; }
.pr-spells td { text-align: center; font-family: var(--mono); }
.pr-choices { padding-left: 1.1em; margin: .4em 0; }
.pr-choices li { margin: .2em 0; }
.pr-go { font-style: italic; }
.pr-end { text-align: center !important; font-family: var(--display); font-weight: 700; letter-spacing: .3em; margin: .6em 0; }
.pr-sheet .pr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.pr-box { border: 2px solid #111; border-radius: 6px; min-height: 18mm; padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; font-family: var(--sans); }
.pr-wide { margin-bottom: 8px; }
.pr-tall { min-height: 45mm; }
.pr-boxes { display: inline-flex; gap: 4px; vertical-align: middle; }
.pr-boxes i { width: 12px; height: 12px; border: 1.5px solid #111; display: inline-block; }
.pr-foes-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; }
.pr-foe { border: 1px solid #111; border-radius: 4px; min-height: 16mm; padding: 4px; font-size: 11px; line-height: 1.8; }
.pr-code { font-family: var(--mono); letter-spacing: .1em; margin-right: 6px; }
.pr-spellbook p { margin: 0 0 .7em; }
.print-root.A5 .pr-box { min-height: 12mm; }
.print-root.A5 .pr-tall { min-height: 26mm; }
.print-root.A5 .pr-foe { min-height: 12mm; }
.print-root.A5 .pr-sheet h2 { margin-bottom: 6px; }
@media print {
  body { background: #fff; }
  .no-print, .topbar, .toasts { display: none !important; }
  .print-book { border: 0; padding: 0; max-width: none; margin: 0; }
  .print-root.A5 .print-book { max-width: none; }
  a { color: inherit; }
}
