/* ===== Gollum-Online – Folien ===== */
:root {
  --bg: #0b0e0c;
  --bg-2: #121813;
  --elev: #161d18;
  --border: #29342b;
  --text: #ebe7d7;
  --muted: #a3ad9c;
  --gold: #e0b03a;
  --gold-soft: rgba(224, 176, 58, .14);
  --moss: #86a96f;
  --moss-soft: rgba(134, 169, 111, .14);
  --red: #e07a5f;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); }
body { overflow: hidden; }

/* ---- Folien ---- */
.deck { position: relative; height: 100%; }
.slide {
  position: absolute; inset: 0; display: none; flex-direction: column; justify-content: center;
  padding: clamp(1.5rem, 5vh, 4rem) clamp(1.5rem, 7vw, 8rem) 4.5rem;
  overflow-y: auto;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(224, 176, 58, .07), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(134, 169, 111, .08), transparent 60%),
    var(--bg);
  font-size: clamp(1rem, 1.25vw + .55rem, 1.45rem);
  line-height: 1.55;
}
.slide.active { display: flex; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .slide.active { animation: none; } }

.slide > * { max-width: 1200px; width: 100%; margin-left: auto; margin-right: auto; }
.slide { justify-content: flex-start; }
.slide > :first-child { margin-top: auto; }
.slide > :last-child { margin-bottom: auto; }

.slide h1, .slide h2 { font-family: var(--serif); font-weight: 700; letter-spacing: .01em; margin: 0 0 .6em; }
.slide h1 { font-size: 2.9em; line-height: 1.1; color: var(--gold); text-shadow: 0 0 40px rgba(224, 176, 58, .35); }
.slide h2 { font-size: 1.85em; color: var(--gold); }
.slide h3 { font-size: 1.1em; margin: .8em 0 .3em; color: var(--moss); }
.slide p { margin: .4em 0; }
.slide ul, .slide ol { margin: .3em 0; padding-left: 1.3em; }
.slide li { margin: .25em 0; }
.slide li::marker { color: var(--gold); }
.slide a { color: var(--gold); }
.slide strong { color: #fff3cf; }
.slide code { font-family: var(--mono); font-size: .88em; background: var(--elev); border: 1px solid var(--border); padding: .05em .35em; border-radius: 5px; }
.slide kbd { font-family: var(--mono); font-size: .8em; padding: .1em .4em; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--elev); }

/* Titelfolie */
.slide--title { text-align: center; align-items: center; }
.slide--title .ring { width: 120px; height: 120px; margin: 0 auto 1.5rem; }
.slide--title .sub { color: var(--muted); font-size: 1.2em; }
.slide--title .gollum { max-width: 760px; margin: 2rem auto 0; text-align: left; }

/* Gollum-Sprechblase */
.gollum {
  position: relative;
  background: var(--moss-soft); border: 1px solid rgba(134, 169, 111, .35);
  border-radius: 14px; padding: .8em 1.1em .8em 3.2em; margin: .3em auto .9em; font-style: italic; color: #dfe8d6;
}
.gollum::before { content: "🧌"; position: absolute; left: .7em; top: .55em; font-style: normal; font-size: 1.5em; line-height: 1; }
.gollum b { color: var(--gold); font-style: normal; }

/* Merke-Box */
.merke {
  border-left: 4px solid var(--gold); background: var(--gold-soft); padding: .6em 1em; border-radius: 0 10px 10px 0; margin: .7em auto;
}
.merke::before { content: "💍 Merke, mein Schatz: "; font-weight: 700; color: var(--gold); }
.warnung {
  border-left: 4px solid var(--red); background: rgba(224, 122, 95, .12); padding: .6em 1em; border-radius: 0 10px 10px 0; margin: .7em auto;
}
.warnung::before { content: "⚠️ Garstig! "; font-weight: 700; color: var(--red); }

/* Zwei Spalten */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5em; align-items: start; }
.cols > * { min-width: 0; }
@media (max-width: 800px) { .cols { grid-template-columns: 1fr; } }

/* Code */
pre.code {
  font-family: var(--mono); font-size: .78em; line-height: 1.55; margin: .5em auto; padding: 1em 1.2em;
  background: #070908; border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; position: relative;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, .5);
}
pre.code code { background: none; border: 0; padding: 0; font-size: 1em; }
pre.code[data-lang]::after {
  content: attr(data-lang); position: absolute; top: .5em; right: .8em; font-size: .7em; color: var(--muted); text-transform: uppercase; letter-spacing: .1em;
}
.t-com { color: #6f7d6a; font-style: italic; }
.t-str { color: #b5d48c; }
.t-num { color: #f0a868; }
.t-kw  { color: var(--gold); font-weight: 600; }
.t-tag { color: #e88a6a; }
.t-attr{ color: #d9c27a; }
.t-var { color: #8fc7e8; }
.t-prop{ color: #8fc7e8; }
.t-fn  { color: #c9a7ef; }

/* Tabellen */
table.tbl { border-collapse: collapse; width: 100%; font-size: .85em; margin: .5em auto; }
.tbl th, .tbl td { border-bottom: 1px solid var(--border); padding: .45em .6em; text-align: left; vertical-align: top; }
.tbl th { color: var(--gold); font-family: var(--serif); }
.tbl td code { white-space: nowrap; }

/* Live-Vorschau (z. B. HTML-Ausgabe) */
.preview { background: #fffdf5; color: #222; border-radius: 12px; padding: 1em 1.2em; font-family: Georgia, serif; font-size: .85em; border: 1px solid var(--border); }
.preview h1 { all: revert; margin: 0 0 .3em; font-size: 1.6em; }
.preview p { margin: .3em 0; }

/* Flexbox-Demos */
.flex-demo { display: flex; gap: .5em; min-height: 140px; padding: .6em; background: #070908; border: 1px dashed var(--moss); border-radius: 12px; }
.flex-demo .item { display: grid; place-items: center; min-width: 60px; padding: .6em 1em; border-radius: 8px; background: linear-gradient(135deg, var(--gold), #b9861c); color: #1a1406; font-weight: 700; font-family: var(--mono); }
.flex-demo .item:nth-child(2) { background: linear-gradient(135deg, var(--moss), #5d7f49); padding-block: 1.4em; }
.flex-demo .item:nth-child(3) { background: linear-gradient(135deg, #c9a7ef, #8b6cc4); }
.controls { display: flex; flex-wrap: wrap; gap: .6em 1.2em; margin: .6em auto; font-size: .8em; }
.controls label { display: flex; flex-direction: column; gap: .2em; color: var(--muted); font-family: var(--mono); }
.controls select { font: inherit; color: var(--text); background: var(--elev); border: 1px solid var(--border); border-radius: 8px; padding: .3em .5em; }

/* ---- UI ---- */
.bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem; z-index: 10;
  background: linear-gradient(to top, rgba(11, 14, 12, .95), rgba(11, 14, 12, 0)); font-size: .85rem; color: var(--muted); }
.bar a, .bar button { color: var(--muted); background: var(--elev); border: 1px solid var(--border); border-radius: 8px; padding: .35rem .7rem; font: inherit; cursor: pointer; text-decoration: none; }
.bar a:hover, .bar button:hover { color: var(--gold); border-color: var(--gold); }
.bar .count { margin-left: auto; font-family: var(--mono); }
.bar .hint { opacity: .7; }
@media (max-width: 700px) { .bar .hint { display: none; } }
.progress { position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--moss), var(--gold)); box-shadow: 0 0 12px var(--gold); transition: width .3s; z-index: 11; }

/* Übersicht (Taste O) */
body.overview { overflow: auto; }
body.overview .deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; padding: 1rem 1rem 5rem; height: auto; }
body.overview .slide { display: flex; position: relative; inset: auto; aspect-ratio: 16 / 9; font-size: 6px; padding: 1.5em; overflow: hidden; cursor: pointer; border: 1px solid var(--border); border-radius: 10px; animation: none; pointer-events: auto; }
body.overview .slide > * { pointer-events: none; }
body.overview .slide--title .ring { width: 10em; height: 10em; margin-bottom: 1em; }
body.overview .slide.active { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }

/* Drucken / PDF: jede Folie eine Seite */
@media print {
  @page { size: A4 landscape; margin: 0; }
  html, body { height: auto; overflow: visible; background: var(--bg); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .bar, .progress { display: none; }
  .deck { height: auto; }
  .slide { display: flex !important; position: relative; inset: auto; height: 100vh; page-break-after: always; break-after: page; overflow: hidden; font-size: 14px; animation: none; }
}
