/* Handbuch (doku.html / doku-en.html): Zettel auf dem Kellerboden – gemeinsames Aussehen beider Sprachen */
/* ---------- Handbuch: Zettel auf dem Kellerboden ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  margin: 0; color: #2b1a0f; font-family: 'Patrick Hand', 'Comic Sans MS', cursive; font-size: 19px; line-height: 1.45;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(16, 10, 7, .55) 0%, rgba(8, 5, 3, .92) 100%) fixed,
    url("sprites/bg/basement.png") center / cover no-repeat fixed #140e0a;
}
.doc { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 26px; max-width: 1240px; margin: 0 auto; padding: 24px 16px 60px; }
@media (max-width: 900px) { .doc { grid-template-columns: minmax(0, 1fr); } nav.toc { position: static !important; max-height: none !important; } }

/* Inhaltsverzeichnis als angepinnter Zettel */
nav.toc {
  position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow-y: auto;
  padding: 16px 16px 18px; transform: rotate(-.6deg);
}
nav.toc h2 { font-family: 'Permanent Marker', cursive; font-size: 24px; margin: 0 0 6px; }
nav.toc a { display: block; color: #2b1a0f; text-decoration: none; font-size: 18px; padding: 1px 0 1px 18px; position: relative; }
nav.toc a::before { content: '▶'; position: absolute; left: 0; top: 5px; font-size: 11px; opacity: 0; }
nav.toc a:hover { color: #8e1c12; }
nav.toc a:hover::before { opacity: 1; }
nav.toc .sub { padding-left: 32px; font-size: 16px; opacity: .8; }

/* Papier wie Isaacs Zettel */
.paper {
  position: relative; color: #2b1a0f;
  background:
    radial-gradient(ellipse at 18% 12%, rgba(255, 250, 235, .45), transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(120, 80, 40, .22), transparent 55%),
    #d2bb92;
  border: 3px solid #2b1a0f; border-radius: 8px 12px 9px 14px;
  box-shadow: 0 0 0 1px rgba(255, 240, 210, .25) inset, 0 0 40px rgba(80, 40, 10, .35) inset, 6px 10px 0 rgba(0, 0, 0, .45);
}
.paper::after {   /* zweiter dünner Tintenrand */
  content: ''; position: absolute; inset: 7px; border: 1.5px solid rgba(43, 26, 15, .35); border-radius: 6px; pointer-events: none;
}
header.title { text-align: center; padding: 26px 20px 20px; margin-bottom: 26px; transform: rotate(.4deg); }
header.title h1 { font-family: 'Creepster', cursive; font-size: clamp(48px, 9vw, 92px); letter-spacing: 3px; margin: 0; line-height: 1; }
header.title .sub { font-family: 'Permanent Marker', cursive; font-size: 24px; margin-top: 4px; }
header.title p { max-width: 720px; margin: 10px auto 0; }
header.title .chars { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
header.title .chars img { height: 48px; image-rendering: pixelated; }

section.paper { padding: 26px 32px 28px; margin-bottom: 30px; }
section.paper:nth-of-type(odd) { transform: rotate(-.25deg); }
section.paper:nth-of-type(even) { transform: rotate(.25deg); }
@media (max-width: 600px) { section.paper { padding: 20px 18px; } }
h2.sec { font-family: 'Creepster', cursive; font-size: 46px; letter-spacing: 1px; margin: 0 0 6px; line-height: 1; color: #2b1a0f; }
h2.sec .ico { height: 40px; vertical-align: -4px; image-rendering: pixelated; margin-right: 8px; }
h3 { font-family: 'Permanent Marker', cursive; font-size: 25px; margin: 22px 0 6px; }
h4 { font-family: 'Permanent Marker', cursive; font-size: 19px; margin: 14px 0 4px; }
p { margin: 6px 0 10px; }
b, strong { color: #6e1208; }
ul, ol { margin: 4px 0 12px; padding-left: 24px; }
li { margin: 2px 0; }
main a { color: #8e1c12; text-decoration: underline wavy rgba(142, 28, 18, .45); text-underline-offset: 3px; }
main a:hover { color: #2b1a0f; }
code { font-family: Consolas, monospace; font-size: 15px; background: rgba(43, 26, 15, .1); padding: 0 4px; border-radius: 3px; }
.lead { font-size: 21px; }
.muted { color: #5a4128; opacity: .9; }
.note {
  margin: 12px 0; padding: 10px 14px 10px 46px; position: relative; border: 2px dashed rgba(43, 26, 15, .45); border-radius: 6px;
  background: rgba(255, 245, 220, .35);
}
.note::before { content: '!'; position: absolute; left: 14px; top: 6px; font-family: 'Creepster', cursive; font-size: 30px; color: #8e1c12; }
.note.tip::before { content: '?'; color: #2b5a8e; }
.ico-i { height: 1.2em; vertical-align: -.25em; image-rendering: pixelated; }
.px { image-rendering: pixelated; }

/* Tabellen in Tinte */
table.ink { border-collapse: collapse; width: 100%; margin: 8px 0 14px; font-size: 17px; }
table.ink th { font-family: 'Permanent Marker', cursive; font-weight: normal; text-align: left; border-bottom: 2.5px solid #2b1a0f; padding: 4px 8px; }
table.ink td { border-bottom: 1px dashed rgba(43, 26, 15, .35); padding: 4px 8px; vertical-align: top; }
table.ink tr:hover td { background: rgba(255, 245, 220, .35); }
.table-wrap { overflow-x: auto; }
.num { text-align: right; white-space: nowrap; }

/* Formel-Kasten */
.formula {
  display: inline-block; font-family: 'Permanent Marker', cursive; font-size: 22px; padding: 6px 16px; margin: 6px 0;
  border: 2.5px solid #2b1a0f; border-radius: 4px 9px 5px 10px; background: rgba(255, 248, 230, .5); transform: rotate(-.8deg);
}

/* Zweispaltige Info-Blöcke */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 12px 26px; }
.pill-box { display: flex; gap: 12px; align-items: flex-start; }
.pill-box img { flex: none; width: 46px; height: 46px; object-fit: contain; image-rendering: pixelated; }

/* Figuren */
.chars-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 14px; }
.char-card { padding: 12px 14px; border: 2.5px solid #2b1a0f; border-radius: 6px 10px 7px 12px; background: rgba(255, 248, 230, .35); }
.char-card .top { display: flex; gap: 12px; align-items: center; }
.char-card .top img { height: 66px; image-rendering: pixelated; }
.char-card .nm { font-family: 'Permanent Marker', cursive; font-size: 23px; line-height: 1.1; }
.char-card .unlock { font-size: 14px; color: #6e1208; }
.char-card dl { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; margin: 8px 0 4px; font-size: 16px; }
.char-card dt { opacity: .7; } .char-card dd { margin: 0; }

/* Filterleiste für Karten / Items */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0 12px; }
.filters input, .filters select {
  font-family: inherit; font-size: 18px; color: #2b1a0f; background: rgba(255, 248, 230, .6);
  border: 2px solid #2b1a0f; border-radius: 4px; padding: 2px 8px;
}
.filters .count { font-family: 'Permanent Marker', cursive; }

/* Karten-Galerie: echte Spielkarten, etwas kleiner */
.card-gallery { display: flex; flex-wrap: wrap; gap: 4px 2px; justify-content: center; max-height: 760px; overflow-y: auto; padding: 18px 4px; }
.card-gallery .card { transform: scale(.86); margin: -12px -8px; cursor: default; }
.card-gallery .card:hover { transform: scale(.95); z-index: 2; }

/* Item-Liste */
.item-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 6px 14px; max-height: 760px; overflow-y: auto; padding: 4px; }
.item-row { display: flex; gap: 10px; padding: 6px 8px; border-bottom: 1px dashed rgba(43, 26, 15, .35); }
.item-row img { flex: none; width: 44px; height: 44px; object-fit: contain; image-rendering: pixelated; }
.item-row .nm { font-family: 'Permanent Marker', cursive; font-size: 17px; line-height: 1.1; }
.item-row .meta { font-size: 13px; color: #6e1208; letter-spacing: .3px; }
.item-row .ds { font-size: 15px; line-height: 1.25; }
.tag { display: inline-block; font-size: 12px; background: #2b1a0f; color: #ecdcbc; border-radius: 3px; padding: 0 5px; margin-left: 3px; vertical-align: 1px; }
.tag.red { background: #8e1c12; }

/* Champions */
.champ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 10px 18px; }
.champ-row { display: flex; gap: 12px; align-items: center; padding: 6px 4px; border-bottom: 1px dashed rgba(43, 26, 15, .35); }
.champ-row .spr { flex: none; width: 64px; height: 64px; display: flex; align-items: flex-end; justify-content: center; }
.champ-row .spr img { width: 56px; image-rendering: pixelated; }
.champ-row .nm { font-family: 'Permanent Marker', cursive; font-size: 19px; }
.champ-row .meta { font-size: 13px; color: #6e1208; }
.champ-row .ds { font-size: 15.5px; line-height: 1.25; }

/* Verwandlungen */
.tf-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 12px 20px; }
.tf-row { display: flex; gap: 12px; padding: 8px 4px; border-bottom: 1px dashed rgba(43, 26, 15, .35); }
.tf-row > img, .tf-row > .em { flex: none; width: 56px; height: 56px; object-fit: contain; image-rendering: pixelated; font-size: 40px; text-align: center; }
.tf-row .nm { font-family: 'Permanent Marker', cursive; font-size: 20px; }
.tf-row .its { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; }
.tf-row .its img { width: 28px; height: 28px; object-fit: contain; image-rendering: pixelated; }

/* Etagen & Bosse */
.stage-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 12px 22px; }
.stage { padding: 10px 12px; border: 2px solid rgba(43, 26, 15, .7); border-radius: 6px; background: rgba(255, 248, 230, .3); }
.stage .nm { font-family: 'Permanent Marker', cursive; font-size: 20px; }
.stage .ch { font-size: 14px; color: #6e1208; }
.portraits { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.portraits img { height: 40px; width: auto; image-rendering: pixelated; }
.portraits img.final { height: 52px; filter: drop-shadow(0 0 0 #8e1c12) drop-shadow(0 0 3px rgba(142, 28, 18, .8)); }

/* Raumtypen & Marken */
.legend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 6px 18px; }
.legend-grid div { display: flex; gap: 10px; align-items: center; }
.legend-grid img { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; }
.marks-row { display: flex; flex-wrap: wrap; gap: 14px 26px; margin: 8px 0; }
.marks-row div { text-align: center; font-size: 15px; }
.marks-row img { width: 40px; height: 40px; image-rendering: pixelated; display: block; margin: 0 auto 2px; }

.kbd { display: inline-block; min-width: 26px; text-align: center; font-family: 'Permanent Marker', cursive; border: 2px solid #2b1a0f; border-radius: 5px; padding: 0 6px; background: rgba(255, 248, 230, .6); box-shadow: 0 2px 0 #2b1a0f; }
footer { text-align: center; color: #b39d84; font-size: 15px; }
a.back { position: fixed; right: 18px; bottom: 18px; z-index: 5; text-decoration: none; }
a.back img { width: 54px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .6)); }
/* Link zur anderen Sprache oben im Inhaltsverzeichnis */
nav.toc a.lang-link { padding-left: 0; font-family: 'Permanent Marker', cursive; font-size: 16px; color: #8e1c12; margin-bottom: 6px; }
nav.toc a.lang-link::before { display: none; }

/* Handy: nichts darf breiter als der Bildschirm werden – lange Pfade und Befehle brechen um, Tabellen wischt man seitlich */
main, nav.toc { min-width: 0; }
main code, .note, .lead, main p, main li { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .doc { padding: 12px 10px 40px; gap: 14px; }
  .table-wrap table { font-size: 15px; }
  .item-list { max-height: 560px; }
  section.paper, header.title, nav.toc { transform: none !important; }   /* lange gedrehte Zettel ragen sonst unten über den Rand */
}
