/* Tagebuch von Sulion Soeler - ein Abenteuer-Tagebuch:
   aufgeschlagenes Lederbuch auf einem Holztisch, Pergamentseiten, eingeklebte Pixel-Illustration,
   Lesebänder als Navigation. Pixelschrift wie auf soeler.com, WoW-Anklänge: Erfahrungsleiste,
   [Level] wie im Questlog, Gegenstände in Qualitätsfarben, Stall mit fünf Plätzen. */
@font-face { font-family: 'Tiny5'; font-weight: 400; font-display: swap; src: url('fonts/tiny5-latin.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400 500; font-display: swap; src: url('fonts/inter-latin.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif'; font-weight: 400 700; font-display: swap; src: url('fonts/source-serif.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif'; font-style: italic; font-weight: 400 700; font-display: swap; src: url('fonts/source-serif-italic.woff2') format('woff2'); }

:root {
  --wood: #1c120b;
  --leather: #5b3320;
  --leather-dark: #3a1f12;
  --page: #f1e2bd;
  --page-edge: #d9bf88;
  --ink: #2e1c0c;
  --ink-soft: #6a4e2e;
  --red-ink: #8e1d15;
  --teal: #2f9a7a;          /* Sulions Tunika */
  --teal-ink: #1d6b54;      /* dieselbe Farbe als Schrift auf Pergament (Kontrast 5:1) */
  --sky: #5cc0e8;           /* Sulions Haare */
  --gold: #c99a3a;
  --text-light: #e9dcc0;
  --pixel: 'Tiny5', monospace;
  --body: 'Inter', system-ui, sans-serif;
  --book: 'Source Serif', Georgia, serif;
  --px: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--wood); }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--book);
  line-height: 1.65;
  min-height: 100vh;
  /* Holztisch im Kerzenlicht */
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 176, 80, .20), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 11px, rgba(0, 0, 0, .05) 11px 13px, transparent 13px 23px),
    linear-gradient(180deg, #2a1a0f, var(--wood) 70%);
  background-color: var(--wood);
}
h1, h2, h3, h4 { font-family: var(--pixel); font-weight: 400; line-height: 1.15; color: var(--ink); }
a { color: var(--red-ink); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.muted { color: var(--ink-soft); }

.desk { max-width: 1180px; margin: 0 auto; padding: 18px 16px 32px; }
/* Sprunglink: nur bei Tastaturbedienung sichtbar */
.skip { position: absolute; left: 8px; top: -60px; z-index: 10; padding: 8px 14px; font-family: var(--pixel); background: #fff6dc; color: var(--ink); border: 2px solid var(--ink); }
.skip:focus { top: 8px; }
main:focus { outline: none; }
.brand { display: inline-block; font-family: var(--pixel); font-size: 1.5rem; color: #ffcf7a; text-decoration: none; margin: 0 0 18px 8px;
  text-shadow: 0 2px 0 #000, 0 0 16px rgba(255, 176, 80, .35); }

/* Das Buch: Ledereinband mit Naht, zwei Seiten mit Falz in der Mitte */
.book { position: relative; padding: 16px; border-radius: 10px;
  background: radial-gradient(ellipse at 30% 20%, #74432a, var(--leather) 45%, var(--leather-dark));
  box-shadow: 0 30px 60px rgba(0, 0, 0, .6), 0 6px 0 #24130a, inset 0 0 0 1px rgba(255, 220, 170, .15); }
.book::before { content: ''; position: absolute; inset: 7px; border: 2px dashed rgba(240, 200, 140, .35); border-radius: 7px; pointer-events: none; }
.spread { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.page { position: relative; padding: 44px 46px 48px; min-height: 640px;
  background: radial-gradient(ellipse at 50% 30%, #f7ead0, var(--page) 60%, var(--page-edge));
  background-color: var(--page); }
.page--left { border-radius: 4px 0 0 4px; box-shadow: inset -30px 0 30px -24px rgba(90, 55, 20, .55); }
.page--right { border-radius: 0 4px 4px 0; box-shadow: inset 30px 0 30px -24px rgba(90, 55, 20, .55); padding-top: 92px; }
.page > :first-child { margin-top: 0; }

/* Lesebänder: hängen oben aus dem Buch über die rechte Seite */
.ribbons { position: absolute; top: 6px; right: 46px; z-index: 3; display: flex; gap: 10px; }
.ribbon { display: flex; align-items: flex-end; justify-content: center; width: 78px; height: 66px; padding-bottom: 14px;
  font-family: var(--pixel); font-size: .95rem; color: #fff6dc; text-decoration: none; text-shadow: 1px 1px 0 rgba(0, 0, 0, .5);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%); transition: height .12s steps(2);
  box-shadow: inset 4px 0 0 rgba(255, 255, 255, .15), inset -4px 0 0 rgba(0, 0, 0, .2); }
.ribbon:hover, .ribbon[aria-current="page"] { height: 80px; }
.ribbon--red { background: #a3291f; }
.ribbon--teal { background: #23795f; }
.ribbon--gold { background: #8f6519; }
.ribbon--blue { background: #3a6ea5; }
.ribbon--green { background: #5b7a2e; }

/* Stable-Seite: eine Karte pro Begleiter */
.pet-card { margin: 0 0 26px; padding-bottom: 20px; border-bottom: 2px dashed rgba(106, 78, 46, .35); }
.pet-card h2 { margin: 12px 0 2px; }
.pet-card .log-shot { margin: 0 0 4px; }
.pet-kind { margin: 0 0 10px; font-family: var(--body); color: var(--ink-soft); }
.pet-kind::first-letter { text-transform: uppercase; }
.pet-card .facts { font-size: .95rem; }
.pet-card--released .pet-portrait, .pet-card--released .log-shot img { filter: grayscale(.85) sepia(.25); opacity: .75; }
.pet-card--released h2 { color: var(--ink-soft); }
.pet-links { margin: 10px 0 0; font-family: var(--body); font-size: .9rem; }

/* Eingeklebte Illustration mit Klebestreifen */
.plate { position: relative; margin: 0 0 22px; padding: 8px; background: #fbf4e2; box-shadow: 0 3px 10px rgba(60, 35, 10, .35); }
.plate::before, .plate::after { content: ''; position: absolute; top: -10px; width: 70px; height: 22px; background: rgba(240, 225, 180, .75);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.plate::before { left: 18px; transform: rotate(-6deg); }
.plate::after { right: 18px; transform: rotate(5deg); }
.scene-art { display: block; width: 100%; height: 260px; object-fit: cover; object-position: 50% 62%; background: #a9d4ee; image-rendering: pixelated; }
.plate--short .scene-art { height: 170px; object-position: 50% 30%; }
.plate figcaption { font-style: italic; font-size: .9rem; color: var(--ink-soft); text-align: center; margin-top: 6px; }

.kicker { font-family: var(--pixel); color: var(--teal-ink); letter-spacing: .04em; margin: 0 0 4px; }
.page h1 { margin: 0 0 6px; font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
.page h2 { margin: 30px 0 12px; font-size: 1.45rem; padding-bottom: 6px; border-bottom: 2px solid rgba(106, 78, 46, .3); }
.byline { margin: 0 0 14px; font-family: var(--body); font-size: .95rem; color: var(--ink-soft); }
.intro { font-size: 1.1rem; font-style: italic; color: var(--ink-soft); }
.head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.head-row h2 { flex: 1; }
.head-row a { font-family: var(--pixel); text-decoration: none; white-space: nowrap; }

/* Erfahrungsleiste wie im Spiel: 20 Abschnitte, lila Füllung */
.xp { position: relative; height: 24px; margin: 10px 0 4px; background: #120d18; border: 3px solid #241608;
  box-shadow: 0 0 0 2px var(--gold), 0 3px 0 2px rgba(60, 35, 10, .3); }
.xp-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#c79bf2 0 25%, #8a4fd0 25% 70%, #5e2c9a 70%); }
.xp::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(5% - 2px), rgba(201, 154, 58, .6) calc(5% - 2px) 5%); }
.xp-text { position: absolute; inset: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 0 10px;
  font-family: var(--pixel); font-size: .9rem; color: #fff; text-shadow: 2px 2px 0 #000; }
.xp-text b { font-weight: 400; }

/* Steckbrief mit Porträt */
.sheet { display: grid; grid-template-columns: 210px 1fr; gap: 22px; align-items: center; margin-top: 26px; }
.portrait { margin: 0; aspect-ratio: 3 / 4; display: grid; place-items: end center; padding: 8px;
  background: radial-gradient(ellipse at 50% 85%, rgba(92, 192, 232, .35), transparent 60%), #efe0bc;
  border: 3px solid var(--ink); box-shadow: inset 0 0 0 3px #f7ecd2, inset 0 0 0 5px rgba(46, 28, 12, .35), 3px 3px 0 rgba(46, 28, 12, .25); }
.portrait img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; display: block; image-rendering: pixelated; }
.portrait img.is-render { image-rendering: auto; object-fit: cover; object-position: top; }   /* Bild aus dem Spiel: füllt den Rahmen, nicht verpixeln */
/* Render aus dem Arsenal (1600x1200, freigestellt, die Figur nur in der Mitte): auf die Figur zoomen.
   Alle "main-raw"-Bilder haben dieselbe Kamera, die Figur steht bei x 40-58 %, y 30-82 %. */
.portrait { position: relative; overflow: hidden; }
.portrait img.is-armory { position: absolute; max-width: none; width: 300%; height: auto; left: -96%; top: -44%; object-fit: fill; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 1rem; }
.facts dt { font-family: var(--pixel); color: var(--ink-soft); }
.facts dd { margin: 0; }

/* Ausrüstung aus dem Arsenal - erscheint erst, wenn es Daten gibt */
.doll:not(.has-gear) { display: none; }
.doll-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.gear { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-family: var(--body); font-size: .86rem; line-height: 1.25; }
.gear li { padding: 3px 0; border-bottom: 1px dotted rgba(106, 78, 46, .4); }
.gear--bottom { margin-top: 4px; grid-template-columns: repeat(3, 1fr); gap: 0 20px; }
.gear-slot { display: block; color: var(--ink-soft); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }
/* Qualitätsfarben, abgedunkelt für Pergament */
.q-poor { color: #6b6b6b; } .q-common { color: var(--ink); } .q-uncommon { color: #1d7d0a; } .q-rare { color: #0b5cb0; }
.q-epic { color: #7a2fb8; } .q-legendary { color: #c25e00; } .q-artifact, .q-heirloom { color: #9c7a2a; }

/* Stall: fünf Plätze */
.stable { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.slot { aspect-ratio: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 4px;
  border: 3px solid var(--ink); background: rgba(255, 255, 255, .25); box-shadow: 2px 2px 0 rgba(46, 28, 12, .25); }
.slot--active { border-color: var(--teal); }
.slot-name { font-family: var(--pixel); font-size: .95rem; line-height: 1.1; }
.slot-kind { font-family: var(--body); font-size: .65rem; color: var(--ink-soft); }
/* Mit Bild aus dem Arsenal: Bild füllt den Platz, Name auf einem Band unten */
.slot--pic { position: relative; justify-content: flex-end; padding: 0; }
.slot-frame { position: absolute; inset: 0; overflow: hidden; }
.slot-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.9); transform-origin: 50% 55%; }
.slot--pic .slot-name, .slot--pic .slot-kind { position: relative; width: 100%; background: rgba(46, 28, 12, .72); color: #f3e6c4; }
.slot--pic .slot-name { padding: 3px 2px 0; }
.slot--pic .slot-kind { padding: 0 2px 3px; color: #d8c79e; }
/* Gegenstandssymbole, Rahmen in Qualitätsfarbe */
.gear li.has-icon { display: flex; gap: 6px; align-items: center; }
.gear-icon { flex: none; width: 28px; height: 28px; border: 2px solid #6b6b6b; border-radius: 3px; }
.q-border-common { border-color: #9a8f7a; } .q-border-uncommon { border-color: #1d7d0a; } .q-border-rare { border-color: #0b5cb0; }
.q-border-epic { border-color: #7a2fb8; } .q-border-legendary { border-color: #c25e00; } .q-border-poor { border-color: #6b6b6b; }
/* Begleiter-Bild auf der Stall-Seite und im Wiki */
.pet-portrait { display: block; width: 100%; max-width: 420px; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(46, 28, 12, .25); margin: 0 0 10px; background: #1a1410; }
.npc-portrait { margin: 0 auto 16px; width: 100%; max-width: 260px; text-align: center; }
.npc-portrait img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; border: 3px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(46, 28, 12, .25); background: #f1e3c2; }
.npc-portrait figcaption { font-style: italic; font-size: .9rem; color: var(--ink-soft); margin-top: 6px; }
.slot--empty { border: 2px dashed rgba(106, 78, 46, .5); background: none; box-shadow: none; font-family: var(--pixel); font-size: .72rem; color: rgba(106, 78, 46, .7); }

/* Text: Buchschrift, Initiale in Pixelschrift */
.story, .diary { font-size: 1.1rem; line-height: 1.75; }
.diary { font-size: 1.16rem; }
.story > p:first-of-type::first-letter, .diary > p:first-child::first-letter {
  float: left; font-family: var(--pixel); font-size: 2.6em; line-height: 1; margin: 6px 10px 0 0; padding: 4px 8px 6px;
  background: var(--teal); color: #fff6dc; box-shadow: 3px 3px 0 rgba(46, 28, 12, .3); }
.story--auto > p:first-of-type::first-letter { float: none; font: inherit; margin: 0; padding: 0; background: none; color: inherit; box-shadow: none; }   /* Datenblatt, kein Initial */
.story blockquote, .diary blockquote { margin: 16px 0; padding: 2px 16px; border-left: 3px solid var(--page-edge); font-style: italic; color: var(--ink-soft); }
.tagline { font-style: italic; color: var(--ink-soft); }
.signoff { font-style: italic; color: var(--ink-soft); text-align: right; font-size: 1.1rem; }

/* Einträge mit [Level] wie im Questlog */
.entries { list-style: none; margin: 0; padding: 0; }
.entries li { border-bottom: 1px dashed rgba(106, 78, 46, .45); }
.entries a, .entries-empty { display: grid; grid-template-columns: 46px 1fr; gap: 8px; padding: 12px 6px; text-decoration: none; color: var(--ink); }
.entries a:hover { background: rgba(255, 255, 255, .35); }
.entry-level { font-family: var(--pixel); font-size: 1.15rem; color: var(--red-ink); }
.entry-title { display: block; font-family: var(--pixel); font-size: 1.3rem; line-height: 1.2; }
.entry-meta { display: block; font-family: var(--body); font-size: .82rem; color: var(--ink-soft); margin-top: 2px; }
.entry-summary { display: block; margin-top: 4px; }
.entries-empty { opacity: .8; }
.has-video { font-size: .8rem; color: var(--teal-ink); vertical-align: middle; }
.draft-tag { font-family: var(--body); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; background: #d48a2a; color: #fff; padding: 1px 6px; vertical-align: middle; }

.pins { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.pins li { font-family: var(--pixel); display: inline-flex; align-items: center; gap: 8px; }
.pins li::before { content: ''; width: 8px; height: 8px; background: var(--red-ink); box-shadow: 2px 2px 0 rgba(46, 28, 12, .3); }
.map { width: 100%; height: auto; margin-bottom: 12px; image-rendering: pixelated; }

/* "From the logbook": was das WoW-Addon in diesem Level mitgeschrieben hat */
.logbook { margin-top: 22px; padding: 12px 16px; border: 2px dashed rgba(106, 78, 46, .5); background: rgba(255, 255, 255, .22); }
.logbook h2 { margin: 0 0 8px; font-size: 1.1rem; }
.logbook dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-family: var(--body); font-size: .86rem; line-height: 1.35; }
.logbook dt { font-family: var(--pixel); color: var(--ink-soft); }
.logbook dd { margin: 0; }

/* Log-Seite: Zeitleiste pro Level, Farbpunkt je Art wie die Qualitätsfarben */
.log { list-style: none; margin: 0 0 24px; padding: 0 0 0 14px; border-left: 2px dashed rgba(106, 78, 46, .45); }
.log-item { position: relative; display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 8px 0; }
.log-item::before { content: ''; position: absolute; left: -20px; top: 14px; width: 10px; height: 10px; background: var(--ink-soft);
  box-shadow: 2px 2px 0 rgba(46, 28, 12, .3); }
.log--level::before { background: var(--gold); } .log--tame::before { background: var(--teal); }
.log--death::before, .log--pvp::before { background: var(--red-ink); } .log--place::before { background: #3a6ea5; }
.log--find::before { background: #0b5cb0; } .log--writing::before { background: #7a2fb8; }
.log--encounter::before { background: #c25e00; }
.log--duel::before { background: #8a6d1f; } .log--note::before { background: #5b7a2e; } .log--guild::before { background: #2f9a7a; }
.log-when { font-family: var(--body); font-size: .78rem; color: var(--ink-soft); padding-top: 3px; }
.log-title { margin: 0; font-family: var(--pixel); font-size: 1.05rem; line-height: 1.25; }
.log-detail { font-family: var(--body); font-size: .82rem; color: var(--ink-soft); }
.log-place { margin: 2px 0 0; font-family: var(--body); font-size: .8rem; color: var(--ink-soft); }
.log-item blockquote { margin: 6px 0 0; font-family: var(--book); font-style: italic; }
.log-item blockquote p { margin: 0 0 6px; }
.log-shot { display: block; margin-top: 8px; border: 3px solid var(--ink); box-shadow: 3px 3px 0 rgba(46, 28, 12, .25); }
.log-shot img { display: block; width: 100%; height: auto; }
.small { font-size: .85rem; }
@media (max-width: 520px) { .log-item { grid-template-columns: 1fr; gap: 2px; } }

/* Knöpfe als Stempel */
.links, .pager { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.pager { justify-content: space-between; }
.stamp { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px; font-family: var(--pixel); font-size: 1.05rem;
  color: #fff6dc; background: var(--red-ink); text-decoration: none; box-shadow: inset -4px -4px 0 rgba(0, 0, 0, .25), inset 4px 4px 0 rgba(255, 255, 255, .18);
  clip-path: polygon(0 var(--px), var(--px) var(--px), var(--px) 0, calc(100% - var(--px)) 0, calc(100% - var(--px)) var(--px), 100% var(--px), 100% calc(100% - var(--px)), calc(100% - var(--px)) calc(100% - var(--px)), calc(100% - var(--px)) 100%, var(--px) 100%, var(--px) calc(100% - var(--px)), 0 calc(100% - var(--px))); }
.stamp:hover { filter: brightness(1.12); }
.stamp--ghost { background: var(--ink); }

/* Eintrag: Wachssiegel mit Level */
.seal { position: absolute; top: 30px; right: 34px; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 38% 34%, #d0463a, #8e1d15 60%, #5e0f0a);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .25), inset 0 0 0 5px rgba(0, 0, 0, .14), inset 0 0 0 7px rgba(255, 255, 255, .08); }
.seal span { font-family: var(--pixel); font-size: 1.6rem; color: #f6d7b0; text-shadow: 2px 2px 0 #4a0a06; }
.seal ~ .kicker, .seal ~ h1 { margin-right: 84px; }
.video { aspect-ratio: 16 / 9; margin: 14px 0 18px; padding: 6px; background: #fbf4e2; box-shadow: 0 3px 10px rgba(60, 35, 10, .35); }
.video iframe { width: 100%; height: 100%; border: 0; display: block; background: #000; }

.wiki-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.wiki-list a { font-family: var(--pixel); font-size: 1.2rem; text-decoration: none; }
.wiki-list a:hover { text-decoration: underline; }
.wiki-list span:not(.draft-tag) { display: block; color: var(--ink-soft); font-size: .95rem; }

footer { padding: 28px 8px 8px; color: rgba(233, 220, 192, .7); font-family: var(--body); font-size: .86rem; text-align: center; }
footer a { color: var(--text-light); }
footer .small { font-size: .75rem; opacity: .8; }

/* Schmal: Buch klappt zu einer Seite zusammen */
@media (max-width: 860px) {
  .book { padding: 10px; }
  .book::before { inset: 4px; }
  .spread { grid-template-columns: minmax(0, 1fr); }
  .page { padding: 30px 22px 34px; min-height: 0; }
  .page--left { border-radius: 4px 4px 0 0; box-shadow: inset 0 -24px 24px -22px rgba(90, 55, 20, .5); padding-top: 92px; }
  .page--right { border-radius: 0 0 4px 4px; box-shadow: inset 0 24px 24px -22px rgba(90, 55, 20, .5); padding-top: 30px; }
  .ribbons { right: 20px; }
  .ribbon { width: 70px; height: 58px; font-size: .88rem; }
  .ribbon:hover, .ribbon[aria-current="page"] { height: 70px; }
  .scene-art { height: 210px; }
  .plate--short { margin-bottom: 16px; }
  .plate--short .scene-art { height: 104px; }   /* Unterseiten: Kopfbild flach, der Inhalt soll oben stehen */
  .seal { top: 96px; right: 22px; width: 54px; height: 54px; }
  .seal span { font-size: 1.3rem; }
  .seal ~ .kicker, .seal ~ h1 { margin-right: 64px; }
}
@media (max-width: 480px) {
  .sheet { grid-template-columns: 140px 1fr; gap: 14px; align-items: start; }
  .facts { font-size: .92rem; grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 4px; }
  .doll-cols, .gear--bottom { grid-template-columns: 1fr; }
  .ribbons { left: 50%; right: auto; transform: translateX(-50%); gap: 5px; }
  .stable { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* Namen passen ganz hinein */
  .ribbon { width: 58px; font-size: .8rem; }   /* fünf Bänder passen auf 320 px */
}
@media (prefers-reduced-motion: reduce) { .ribbon { transition: none; } }

/* Tooltips wie im Spiel: Gegenstände und Begleiter, beim Drüberfahren oder Antippen */
.has-tip { position: relative; cursor: help; }
.has-tip:focus { outline: 2px solid var(--teal); outline-offset: 2px; }
.tip { display: none; position: absolute; z-index: 50; left: 0; top: 100%; margin-top: 6px; gap: 8px; align-items: flex-start;
  width: max-content; max-width: min(300px, 82vw); padding: 7px 9px; border: 1px solid #a7a7b4; border-radius: 4px;
  background: rgba(9, 12, 32, .96); box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
  font-family: Verdana, Geneva, Tahoma, sans-serif; font-size: .74rem; line-height: 1.35; color: #fff;
  text-transform: none; letter-spacing: 0; text-align: left; pointer-events: none; }
.has-tip:hover > .tip, .has-tip:focus > .tip { display: flex; }
.gear--right .tip { left: auto; right: 0; }
.tip-body { display: flex; flex-direction: column; min-width: 0; }
.tip-name { display: block; font-size: .86rem; font-weight: bold; margin-bottom: 1px; }
.tip-line { display: flex; justify-content: space-between; gap: 18px; }
.tip-icon { flex: none; width: 44px; height: 44px; border: 2px solid #6b6b6b; border-radius: 4px; }
.tip--white { color: #fff; } .tip--green { color: #1eff00; } .tip--gold { color: #ffd100; } .tip--grey { color: #9d9d9d; }
.q-tip-poor { color: #9d9d9d; } .q-tip-common { color: #fff; } .q-tip-uncommon { color: #1eff00; } .q-tip-rare { color: #0070dd; }
.q-tip-epic { color: #a335ee; } .q-tip-legendary { color: #ff8000; } .q-tip-artifact, .q-tip-heirloom { color: #e6cc80; }
/* Begleiter: großes Bild über dem Stallplatz */
.tip--pet { flex-direction: column; gap: 4px; width: 300px; padding: 6px; top: auto; bottom: 100%; margin: 0 0 8px; }
.tip--pet img { display: block; width: 100%; height: auto; border-radius: 2px; }
.tip--pet .tip-name { color: #ffd100; font-family: var(--pixel); font-weight: normal; }
.stable li:nth-child(n+3) .tip--pet { left: auto; right: 0; }

/* Einklappbare Gruppen (Log nach Level, Wiki nach Art und Ort) */
.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 8px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: '\25B8'; font-family: var(--pixel); color: var(--teal); transition: transform .15s; flex: none; }
.fold[open] > summary::before { transform: rotate(90deg); }
.fold > summary h2 { display: inline; flex: 1; border: 0; margin: 0; padding: 0; }
.page .fold { margin: 22px 0 6px; padding-bottom: 6px; border-bottom: 2px solid rgba(106, 78, 46, .3); }
.page .fold[open] { border-bottom: 0; }
.fold > summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.fold-count { font-family: var(--pixel); font-size: .78rem; color: var(--ink-soft); background: rgba(106, 78, 46, .12);
  padding: 1px 6px; border-radius: 8px; }
.page .fold--sub { margin: 6px 0 6px 14px; padding-bottom: 0; border-bottom: 1px dotted rgba(106, 78, 46, .4); }
.fold--sub > summary { font-family: var(--pixel); font-size: .95rem; padding: 4px 0; }
.fold--sub .wiki-list { margin-top: 2px; }

/* Wiki-Suche */
.wiki-search { margin: 0 0 8px; }
.wiki-search input { width: 100%; box-sizing: border-box; padding: 8px 10px; font: inherit; font-size: 1rem; color: var(--ink);
  background: rgba(255, 255, 255, .45); border: 2px solid rgba(106, 78, 46, .55); border-radius: 3px; }
.wiki-search input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Charakterbogen (Wiki-Seite) */
.sheet-card { display: flex; gap: 12px; align-items: center; margin: 0 0 14px; padding: 8px 10px; text-decoration: none; color: var(--ink);
  border: 3px solid var(--ink); background: rgba(255, 255, 255, .3); box-shadow: 3px 3px 0 rgba(46, 28, 12, .25); }
.sheet-card:hover, .sheet-card:focus-visible { border-color: var(--teal); }
.sheet-thumb { flex: none; position: relative; overflow: hidden; width: 96px; height: 132px; border: 2px solid var(--ink);
  background: radial-gradient(ellipse at 50% 85%, rgba(92, 192, 232, .35), transparent 60%), #efe0bc; }
.sheet-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sheet-thumb img.is-armory { position: absolute; max-width: none; width: 300%; height: auto; left: -96%; top: -44%; object-fit: fill; }
.sheet-card b { display: block; font-family: var(--pixel); font-weight: normal; font-size: 1.1rem; }
.sheet-card span span { font-size: .9rem; color: var(--ink-soft); }
.page h3 { font-family: var(--pixel); font-weight: normal; font-size: .95rem; margin: 14px 0 6px; color: var(--ink-soft); }
.facts--wide { grid-template-columns: max-content 1fr; }
.stat-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 20px; }
.stat-groups h3 { margin-top: 8px; }
.bars { list-style: none; margin: 4px 0 10px; padding: 0; display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 9rem) 1fr auto; gap: 8px; align-items: center; font-size: .9rem; }
.bar { position: relative; height: 12px; border: 2px solid var(--ink); background: rgba(46, 28, 12, .12); }
.bar > span { position: absolute; inset: 0 auto 0 0; background: var(--gold); }
.bar-value { font-family: var(--pixel); font-size: .75rem; color: var(--ink-soft); white-space: nowrap; }
.bar--prof > span { background: #b0702c; } .bar--ach > span { background: #c9a227; }
.rep-bad > span { background: #b8332b; } .rep-low > span { background: #d0782a; } .rep-neutral > span { background: #c9a227; }
.rep-good > span { background: #3c9a3a; } .rep-great > span { background: var(--teal); }
.tiles { list-style: none; margin: 4px 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.tile { border: 3px solid var(--ink); background: #1a1410; box-shadow: 2px 2px 0 rgba(46, 28, 12, .25); overflow: hidden; }
.tile img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.tile-name { display: block; padding: 4px 6px 0; font-family: var(--pixel); color: #f3e6c4; font-size: .9rem; }
.tile-sub { display: block; padding: 0 6px 5px; font-size: .75rem; color: #d8c79e; }
.talents { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 8px; }
.talents span { display: block; font-size: .9rem; color: var(--ink-soft); }
@media (max-width: 520px) { .bar-row { grid-template-columns: 1fr auto; } .bar-row .bar { grid-column: 1 / -1; grid-row: 2; } }

/* Karten: Route über der Spielkarte (map.js) */
.map { margin: 10px 0 18px; }
.map svg { display: block; width: 100%; height: auto; border: 3px solid var(--ink); background: #2a2116; box-shadow: 3px 3px 0 rgba(46, 28, 12, .25); }
.map figcaption { font-size: .85rem; color: var(--ink-soft); font-style: italic; margin-top: 4px; }
.map-route { stroke: var(--ink); stroke-linecap: round; fill: none; }
.map-route--faint { opacity: .35; }
.map-node { fill: var(--page); stroke: var(--ink); stroke-width: .9; }
.map-label { font-family: var(--book); font-style: italic; fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: var(--page); stroke-width: 2.4px; stroke-linejoin: round; }
.map-num { font-family: var(--book); fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: var(--page); stroke-width: 1.6px; }
.map-me { fill: var(--teal); stroke: var(--ink); stroke-width: .9; }
.map-icon { cursor: help; }
.map-icon:hover { filter: drop-shadow(0 0 2px #fff); }
.map--compact, .map--pin { max-width: 520px; }
.logbook + .map { margin-top: 0; }
.map-link { cursor: pointer; }
.map-link:hover .map-node, .map-link:focus .map-node { fill: var(--gold); }
.map-link:focus { outline: none; }
.map-link:focus-visible .map-icon, .map-link:focus-visible .map-node { filter: drop-shadow(0 0 3px #fff); }
/* Sprungziel im Log kurz hervorheben */
.log-item.is-target { animation: log-flash 2.4s ease-out; }
@keyframes log-flash { 0%, 35% { background: rgba(201, 154, 58, .45); box-shadow: 0 0 0 6px rgba(201, 154, 58, .45); } 100% { background: transparent; box-shadow: 0 0 0 6px transparent; } }
.page > .left .map, .left .map { margin-top: 18px; }
.map-here-ring { fill: none; stroke: var(--teal); stroke-width: 1.5; }
.map--here { margin-top: 6px; }

/* Zoomen und Verschieben der Karten (site.js) */
.map { position: relative; }
.map svg { cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.map.is-active svg { touch-action: none; }
.map svg:active { cursor: grabbing; }
.map-zoom { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 4px; }
.map-zoom button { width: 30px; height: 30px; padding: 0; font: 700 18px/1 var(--body); color: var(--ink); background: var(--page);
  border: 2px solid var(--ink); box-shadow: 2px 2px 0 rgba(46, 28, 12, .3); cursor: pointer; }
.map-zoom button:hover, .map-zoom button:focus-visible { background: var(--gold); outline: none; }
.map-zoom button[data-z="home"] { opacity: 0; pointer-events: none; transition: opacity .15s; }
.map.is-zoomed .map-zoom button[data-z="home"] { opacity: 1; pointer-events: auto; }

/* Skizzenbuch */
.sketches { list-style: none; margin: 8px 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.sketches a { display: block; text-decoration: none; color: var(--ink); }
.sketches img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; box-shadow: 2px 3px 0 rgba(46, 28, 12, .2); transform: rotate(-.6deg); transition: transform .15s; }
.sketches li:nth-child(even) img { transform: rotate(.7deg); }
.sketches a:hover img, .sketches a:focus-visible img { transform: rotate(0) scale(1.02); }
.sketch-title { display: block; margin-top: 8px; font-family: var(--pixel); font-size: .92rem; line-height: 1.2; }
.sketch-meta { display: block; font-size: .8rem; color: var(--ink-soft); font-style: italic; }
.page-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }

/* By the numbers */
.tiles-stats { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tiles-stats li { border: 3px solid var(--ink); background: rgba(255, 255, 255, .3); padding: 10px 12px; box-shadow: 2px 2px 0 rgba(46, 28, 12, .2); }
.stat-value { display: block; font-family: var(--pixel); font-size: 1.7rem; line-height: 1.1; }
.stat-label { display: block; font-size: .8rem; color: var(--ink-soft); }
.chart { margin: 0 0 26px; }
.chart figcaption b { display: block; font-family: var(--pixel); font-weight: normal; font-size: 1.1rem; }
.chart figcaption span { display: block; font-size: .85rem; color: var(--ink-soft); font-style: italic; }
.chart svg { display: block; width: 100%; height: auto; margin-top: 6px; overflow: visible; }
.chart .axis { font: 11px var(--body); fill: var(--ink-soft); text-anchor: middle; }
.chart .axis--y { text-anchor: end; }
.chart .val { font: 600 12px var(--body); fill: var(--ink); text-anchor: middle; }
.chart .val--side { text-anchor: start; }
.chart .col:hover path, .chart .col:hover rect[fill="#24785f"] { opacity: .8; }
.chart-table summary { cursor: pointer; font-size: .8rem; color: var(--ink-soft); margin-top: 4px; }
.chart-table table { border-collapse: collapse; font-size: .85rem; margin-top: 4px; }
.chart-table th, .chart-table td { padding: 2px 12px 2px 0; text-align: left; font-weight: normal; border-bottom: 1px dotted rgba(106, 78, 46, .35); }

/* Play the journey */
.map-play { display: inline-block; margin-top: 8px; padding: 6px 12px; font-family: var(--pixel); font-size: .9rem;
  color: #fff6dc; background: var(--teal); border: 2px solid var(--ink); box-shadow: 2px 2px 0 rgba(46, 28, 12, .3); cursor: pointer; }
.map-play:hover, .map-play:focus-visible { background: var(--gold); color: var(--ink); outline: none; }
.map [data-step], .map .map-here { transition: opacity .35s; }
.map .is-hidden { opacity: 0; }
.map .is-new.map-icon, .map .is-new .map-icon { animation: map-pop .45s ease-out; transform-box: fill-box; transform-origin: center; }
@keyframes map-pop { 0% { transform: scale(.2); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
.map-walker { transition: cx .55s ease-in-out, cy .55s ease-in-out; }

/* Mehrere Karten als eine: Reiter, eine Karte sichtbar, die Reise über alle Karten */
.map-set { margin: 0 0 18px; }
.map-set-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 6px; }
.map-tab { font-family: var(--pixel); font-size: .78rem; padding: 3px 8px; color: var(--ink); background: rgba(255, 255, 255, .35);
  border: 2px solid var(--ink-soft); cursor: pointer; }
.map-tab:hover, .map-tab:focus-visible { border-color: var(--ink); outline: none; }
.map-tab.is-active { color: #fff6dc; background: var(--ink); border-color: var(--ink); }
.map-set.is-playing .map-tab { cursor: default; opacity: .75; }
.map-set.is-playing .map-tab.is-active { opacity: 1; }
.map-set-panel[hidden] { display: none; }
.map-set-panel .map { margin-bottom: 0; }
.map-set-panel.is-arriving { animation: map-arrive .45s ease-out; }
@keyframes map-arrive { from { opacity: .2; transform: scale(.97); } to { opacity: 1; transform: none; } }
.map-set-caption { font-style: italic; font-size: .9rem; color: var(--ink-soft); margin: 6px 0 0; }
.journey-line { stroke: var(--ink); stroke-dasharray: 6 4; stroke-linecap: round; fill: none; }
.journey-dot { fill: var(--teal); stroke: var(--ink); stroke-width: 1; }

.log--first::before { background: var(--gold); } .log--companion::before { background: var(--teal); }

/* Galerie (site.js): Bild groß über der Seite */
.lightbox { padding: 0; border: 0; background: transparent; max-width: none; max-height: none; width: 100vw; height: 100vh; margin: 0; }
.lightbox::backdrop { background: rgba(20, 12, 6, .88); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox figure { margin: 0; max-width: min(92vw, 1600px); display: flex; flex-direction: column; align-items: center; }
.lightbox img { display: block; max-width: 100%; max-height: 82vh; width: auto; height: auto; border: 4px solid var(--page); box-shadow: 0 8px 30px rgba(0, 0, 0, .6); background: #111; }
.lightbox figcaption { margin-top: 10px; color: var(--text-light); font-family: var(--book); font-size: 1rem; text-align: center; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; align-items: baseline; }
.lb-more { color: var(--gold); font-family: var(--pixel); font-size: .9rem; }
.lb-count { font-family: var(--pixel); font-size: .8rem; opacity: .7; }
.lb-close, .lb-prev, .lb-next { position: fixed; border: 2px solid var(--page); background: rgba(46, 28, 12, .75); color: var(--page);
  font: 700 28px/1 var(--body); width: 46px; height: 46px; cursor: pointer; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-close:hover, .lb-prev:hover, .lb-next:hover, .lb-close:focus-visible, .lb-prev:focus-visible, .lb-next:focus-visible { background: var(--gold); color: var(--ink); outline: none; }
.log-shot, .sketches a { cursor: zoom-in; }
@media (max-width: 600px) { .lb-prev, .lb-next { top: auto; bottom: 16px; transform: none; } }

/* The story so far */
.story-toc { margin: 10px 0 16px; padding-left: 22px; font-family: var(--pixel); }
.story-toc li { margin: 4px 0; }
.story-chapter .kicker { margin-top: 8px; }
.story-quote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--teal); background: rgba(255, 255, 255, .25); font-style: italic; }
.story-quote p { margin: 0 0 4px; }
.story-quote footer { font-style: normal; font-size: .8rem; color: var(--ink-soft); }
.story-moments, .story-quests { margin: 6px 0 14px; padding-left: 22px; }
.story-moments { list-style: none; padding-left: 4px; }
.story-moments li { margin: 4px 0; display: flex; gap: 8px; align-items: baseline; }
.story-moments .log-dot { flex: none; width: 9px; height: 9px; background: var(--ink-soft); display: inline-block; }
.story-moments .log--death { background: var(--red-ink); } .story-moments .log--level { background: var(--gold); }
.story-moments .log--tame, .story-moments .log--companion { background: var(--teal); } .story-moments .log--first { background: var(--gold); }
.story-quests { columns: 2; column-gap: 24px; font-size: .95rem; }
@media (max-width: 600px) { .story-quests { columns: 1; } }

/* Gästebuch und Freundebuch */
.book-form { display: grid; gap: 4px; margin: 18px 0; }
.book-form label { font-family: var(--pixel); color: var(--ink-soft); margin-top: 10px; }
.book-form input, .book-form textarea { width: 100%; padding: 9px 11px; font: inherit; font-family: var(--book); font-size: 1.05rem; color: var(--ink);
  background: rgba(255, 255, 255, .5); border: 2px solid rgba(106, 78, 46, .55); border-radius: 3px; }
.book-form textarea { resize: vertical; min-height: 96px; }
.book-form input:focus, .book-form textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.book-form button { margin-top: 16px; justify-self: start; border: 0; cursor: pointer; }
.book-form button:disabled { opacity: .6; cursor: wait; }
.book-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.book-status { min-height: 1.4em; margin: 6px 0 0; font-size: .95rem; }
.book-status--err { color: var(--red-ink); }
.book-status--ok { color: var(--ink-soft); }
.book-thanks { font-family: var(--book); font-size: 1.15rem; font-style: italic; padding: 14px 16px; border-left: 4px solid var(--teal); background: rgba(47, 154, 122, .1); }
.book-safe { margin: 22px 0 8px; padding: 12px 16px; border: 2px dashed rgba(106, 78, 46, .5); background: rgba(255, 255, 255, .25); }
.book-safe h2 { font-size: 1.1rem; margin: 0 0 6px; }
.book-safe ul { margin: 0; padding-left: 1.2em; }
.book-safe li { margin: 3px 0; }
.book-code { font-family: var(--pixel); }
.book-code strong { color: var(--red-ink); letter-spacing: .12em; }
.book-entry { margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px dashed rgba(106, 78, 46, .45); }
.book-text p { margin: 0 0 8px; font-family: var(--book); font-size: 1.05rem; }
.book-by { margin: 0; font-style: italic; }
.friend-page { margin: 0 0 28px; padding: 14px 18px; background: rgba(255, 255, 255, .28); border: 2px solid rgba(106, 78, 46, .35); }
.friend-page h2 { margin-top: 0; }
.friend-answers dt { font-family: var(--pixel); color: var(--ink-soft); margin-top: 10px; }
.friend-answers dd { margin: 2px 0 0; font-family: var(--book); }
.friend-answers dd p { margin: 0 0 6px; }
.friend-sign { font-family: var(--book); font-style: italic; font-size: 1.15rem; text-align: right; margin: 12px 0 4px; }
