/* 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 */
  --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; }
.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: var(--teal); }
.ribbon--gold { background: #b7862c; }
.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-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); 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: 150px 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 */
.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); }
.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); 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; }
  .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: 110px 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; }
  .ribbon { width: 58px; font-size: .8rem; }   /* fünf Bänder passen auf 320 px */
}
@media (prefers-reduced-motion: reduce) { .ribbon { transition: none; } }
