@font-face { font-family: system-ui; src: local("Arial"); }
:root {
  --bg: #efe0bd;
  --bg-2: #d4b879;
  --panel: rgba(255, 244, 214, 0.92);
  --panel-strong: #fff2ce;
  --text: #26180d;
  --muted: #654b32;
  --accent: #8a5a22;
  --accent-2: #c4933b;
  --border: rgba(80, 48, 20, 0.28);
  --shadow: 0 20px 60px rgba(60, 35, 15, 0.22);
}
[data-theme="dark"] {
  --bg: #12100d;
  --bg-2: #22160d;
  --panel: rgba(36, 25, 16, 0.92);
  --panel-strong: #2e2116;
  --text: #f5dfb5;
  --muted: #c6a97a;
  --accent: #d7a446;
  --accent-2: #f0c878;
  --border: rgba(235, 190, 110, 0.24);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.65;
  background:
    radial-gradient(circle at top left, rgba(196,147,59,.22), transparent 34rem),
    linear-gradient(135deg, var(--bg), var(--bg-2));
  min-height: 100vh;
}
a { color: inherit; }
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: auto auto 1fr auto auto; gap: 1rem; align-items: center;
  padding: .75rem clamp(1rem, 3vw, 2rem);
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--panel), transparent 8%);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; gap: .7rem; align-items: center; text-decoration: none; min-width: max-content; }
.brand-mark { display: grid; place-items:center; width: 2.6rem; height:2.6rem; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent-2); font-weight: 800; box-shadow: inset 0 0 0 3px rgba(215,164,70,.12); }
.brand strong { display:block; font-size: 1.05rem; letter-spacing: .04em; text-transform: uppercase; }
.brand small { display:block; color: var(--muted); margin-top:-.2rem; }
.main-nav { display:flex; gap:.3rem; justify-content:center; flex-wrap:wrap; }
.main-nav a, .site-footer a { text-decoration:none; padding:.45rem .7rem; border-radius: 999px; color: var(--muted); }
.main-nav a:hover, .site-footer a:hover { background: rgba(196,147,59,.14); color: var(--text); }
.search-form input, .large-search input { width: min(22rem, 100%); padding: .65rem .9rem; border-radius:999px; border:1px solid var(--border); background:var(--panel-strong); color:var(--text); }
.theme-toggle, .nav-toggle, .button { border:1px solid var(--border); background:var(--panel-strong); color:var(--text); border-radius:999px; padding:.65rem .9rem; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; gap:.35rem; }
.nav-toggle { display:none; }
.button.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #160d06; font-weight:700; }
main { width:min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(1.2rem, 3vw, 2rem) 0 3rem; }
.parchment-panel, .content-card, .codex-card { border:1px solid var(--border); background: var(--panel); box-shadow: var(--shadow); border-radius: 1.4rem; }
.hero { min-height: clamp(28rem, 58vh, 40rem); display:grid; place-items:center; text-align:center; padding: clamp(2rem, 7vw, 5rem); overflow:hidden; position:relative; }
.hero::before { content:""; position:absolute; inset:1rem; border:1px solid var(--border); border-radius:1rem; pointer-events:none; }
.hero h1, .page-title h1 { font-size: clamp(2.4rem, 7vw, 5.8rem); line-height: .95; margin:.2rem 0 1rem; letter-spacing:.03em; }
.page-title h1 { font-size: clamp(2rem, 5vw, 4rem); }
.eyebrow { color: var(--accent); text-transform:uppercase; letter-spacing:.22em; font-weight:700; margin:0; }
.lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--muted); max-width: 68ch; margin: 0 auto 1.2rem; }
.hero-actions { display:flex; gap:.8rem; justify-content:center; flex-wrap:wrap; margin-top:1.5rem; }
.codex-grid, .children-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:1rem; margin-top:1rem; }
.codex-card { padding:1.25rem; text-decoration:none; transition: transform .18s ease, border-color .18s ease; min-height: 12rem; }
.codex-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.codex-card h2 { margin:.25rem 0 .4rem; font-size:1.35rem; }
.codex-card p { margin:0; color: var(--muted); display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; }
.card-rune { color: var(--accent-2); font-size:1.4rem; }
.page-shell { display:grid; gap:1rem; }
.breadcrumbs { color:var(--muted); display:flex; flex-wrap:wrap; gap:.45rem; align-items:center; font-size:.95rem; }
.breadcrumbs a { text-decoration:none; color:var(--accent); }
.compact { padding: clamp(1.3rem, 4vw, 2.5rem); }
.content-card { padding: clamp(1rem, 3vw, 2rem); overflow:hidden; }
.imported-content :is(img, figure img) { max-width:100%; height:auto; border-radius:1rem; box-shadow: 0 10px 30px rgba(0,0,0,.22); }
.imported-content figure { margin: 1.4rem auto; }
.imported-content h1, .imported-content h2, .imported-content h3 { line-height:1.15; margin-top:1.4em; color: var(--text); }
.imported-content p { max-width: 80ch; }
.imported-content table { width:100%; border-collapse: collapse; display:block; overflow-x:auto; }
.imported-content td, .imported-content th { border:1px solid var(--border); padding:.5rem; }
.large-search { display:flex; gap:.8rem; flex-wrap:wrap; justify-content:center; margin-top:1rem; }
.site-footer { display:flex; justify-content:space-between; gap:1rem; flex-wrap:wrap; padding:1.5rem clamp(1rem, 3vw, 2rem); border-top:1px solid var(--border); background: color-mix(in srgb, var(--panel), transparent 6%); color:var(--muted); }
@media (max-width: 980px) {
  .site-header { grid-template-columns: auto auto auto; }
  .main-nav { grid-column: 1 / -1; display:none; justify-content:flex-start; }
  .main-nav.open { display:flex; }
  .search-form { grid-column: 1 / -1; order:5; }
  .search-form input { width:100%; }
  .nav-toggle { display:inline-flex; }
  .codex-grid, .children-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  main { width:min(100% - 1rem, 1180px); }
  .site-header { gap:.6rem; padding:.6rem .75rem; }
  .brand small { display:none; }
  .hero { min-height: auto; padding: 2.2rem 1rem; }
  .codex-grid, .children-grid { grid-template-columns: 1fr; }
  .codex-card { min-height:auto; }
  .content-card { padding: .95rem; border-radius: 1rem; }
}


/* Bestiarium v0.1.1 */
.bestiary-shell { gap: 1.1rem; }
.bestiary-hero { position: relative; overflow: hidden; }
.bestiary-meta { display:flex; gap:.7rem; flex-wrap:wrap; justify-content:center; margin-top:1rem; }
.bestiary-meta span { border:1px solid var(--border); background: color-mix(in srgb, var(--panel-strong), transparent 15%); border-radius:999px; padding:.45rem .8rem; color:var(--muted); }
.bestiary-legend h2 { margin-top:0; }
.legend-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:.7rem; }
.legend-grid div { border:1px solid var(--border); border-radius:.9rem; padding:.75rem; background: color-mix(in srgb, var(--panel-strong), transparent 18%); }
.legend-grid strong { display:block; color:var(--accent); font-size:1.05rem; }
.legend-grid span { color:var(--muted); }
.bestiary-grid, .monster-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:1rem; }
.bestiary-card, .monster-card { display:flex; flex-direction:column; gap:.55rem; min-height: 14rem; padding:1.25rem; text-decoration:none; border:1px solid var(--border); background:var(--panel); border-radius:1.4rem; box-shadow:var(--shadow); transition:transform .18s ease, border-color .18s ease; }
.bestiary-card:hover, .monster-card:hover { transform:translateY(-3px); border-color:var(--accent); }
.bestiary-card h2, .monster-card h2 { margin:.15rem 0 0; line-height:1.15; }
.bestiary-card p, .monster-card p { color:var(--muted); margin:0; display:-webkit-box; -webkit-line-clamp:5; -webkit-box-orient:vertical; overflow:hidden; }
.bestiary-card strong { margin-top:auto; color:var(--accent); }
.monster-card-top { display:flex; justify-content:space-between; gap:.5rem; color:var(--muted); font-size:.92rem; }
.mini-stats { margin-top:auto; display:flex; flex-wrap:wrap; gap:.35rem; }
.mini-stats span { border:1px solid var(--border); border-radius:999px; padding:.25rem .55rem; background: color-mix(in srgb, var(--panel-strong), transparent 10%); color:var(--muted); font-size:.9rem; }
.monster-detail-hero h1 { font-size: clamp(2.2rem, 6vw, 5rem); margin:.2rem 0 .6rem; line-height:.95; }
.monster-detail-grid { display:grid; grid-template-columns: minmax(0, 1fr) 22rem; gap:1rem; align-items:start; }
.monster-description p { max-width:80ch; }
.monster-stats dl { display:grid; gap:.5rem; margin:0 0 1.2rem; }
.monster-stats dl div { display:grid; grid-template-columns: 5rem 1fr; gap:.7rem; align-items:center; border-bottom:1px solid var(--border); padding:.45rem 0; }
.monster-stats dt { font-weight:700; color:var(--accent); }
.monster-stats dd { margin:0; }
.monster-stats ul { padding-left:1.1rem; color:var(--muted); }
@media (max-width: 980px) {
  .bestiary-grid, .monster-grid, .legend-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .monster-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .bestiary-grid, .monster-grid, .legend-grid { grid-template-columns: 1fr; }
  .monster-stats dl div { grid-template-columns: 4rem 1fr; }
}

/* Design assets v0.1.2: Logo + Hintergrundbild */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(18,16,13,.34), rgba(18,16,13,.72)),
    url('/static/img/chronicles-background.png');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  opacity: .34;
}
[data-theme="light"] body::before,
html[data-theme="light"] body::before {
  opacity: .22;
  background-image:
    linear-gradient(180deg, rgba(255,244,214,.28), rgba(239,224,189,.78)),
    url('/static/img/chronicles-background.png');
}
.site-header {
  min-height: 4.25rem;
}
.brand {
  gap: .75rem;
}
.brand-logo {
  width: clamp(3.1rem, 7vw, 5.2rem);
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.35));
}
.brand-mark { display: none; }
.brand-text strong { font-size: .98rem; }
.brand-text small { font-size: .86rem; }
.hero-chronicles {
  background-image:
    linear-gradient(180deg, rgba(18,16,13,.12), rgba(18,16,13,.56)),
    url('/static/img/chronicles-background.png');
  background-size: cover;
  background-position: center center;
  border-color: color-mix(in srgb, var(--accent), var(--border) 45%);
}
[data-theme="light"] .hero-chronicles,
html[data-theme="light"] .hero-chronicles {
  background-image:
    linear-gradient(180deg, rgba(255,244,214,.18), rgba(255,244,214,.72)),
    url('/static/img/chronicles-background.png');
}
.hero-chronicles::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 0 42%, rgba(0,0,0,.30) 100%);
}
.hero-chronicles .hero-content {
  position: relative;
  z-index: 1;
  max-width: 62rem;
  padding: clamp(1.1rem, 3vw, 2rem);
  border-radius: 1.4rem;
  background: color-mix(in srgb, var(--panel), transparent 16%);
  backdrop-filter: blur(4px);
  box-shadow: 0 18px 70px rgba(0,0,0,.28);
}
.hero-logo {
  display: block;
  width: min(36rem, 92vw);
  max-height: 14rem;
  object-fit: contain;
  margin: 0 auto .5rem;
  filter: drop-shadow(0 16px 26px rgba(0,0,0,.38));
}
.hero-chronicles h1 {
  font-size: clamp(2rem, 5vw, 4.2rem);
}
.codex-card-featured {
  border-color: color-mix(in srgb, var(--accent), var(--border) 35%);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--panel), var(--accent) 10%), var(--panel));
}
@media (max-width: 980px) {
  .brand-logo { width: 3.5rem; }
  .hero-logo { width: min(28rem, 92vw); max-height: 10rem; }
}
@media (max-width: 640px) {
  body::before { opacity: .16; background-position: center top; }
  .brand-logo { width: 3rem; }
  .brand-text strong { font-size: .86rem; }
  .brand-text small { display: block; font-size: .74rem; }
  .hero-chronicles { background-image: linear-gradient(180deg, var(--panel), var(--panel)); }
  .hero-chronicles .hero-content { background: transparent; box-shadow: none; padding: .2rem; }
  .hero-logo { width: min(22rem, 94vw); max-height: 7.2rem; }
}

/* Bestiarium v0.1.3: Monsterbilder */
.monster-card-with-image {
  padding: 0;
  overflow: hidden;
}
.monster-card-image {
  margin: 0;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-strong), #000 12%);
}
.monster-card-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 45%, rgba(0,0,0,.32));
  pointer-events: none;
}
.monster-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.01);
  transition: transform .22s ease, filter .22s ease;
}
.monster-card-with-image:hover .monster-card-image img {
  transform: scale(1.045);
  filter: saturate(1.06) contrast(1.04);
}
.monster-card-body {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: 1.05rem 1.15rem 1.15rem;
  min-height: 12.5rem;
}
.monster-detail-hero-with-image {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 30rem);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  overflow: hidden;
}
.monster-detail-hero-text { min-width: 0; }
.monster-detail-image {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 1.15rem;
  overflow: hidden;
  background: #120d09;
  box-shadow: var(--shadow);
}
.monster-detail-image img {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
@media (max-width: 900px) {
  .monster-detail-hero-with-image { grid-template-columns: 1fr; }
  .monster-detail-image { max-width: 34rem; }
}
@media (max-width: 640px) {
  .monster-card-image { aspect-ratio: 16 / 10; }
  .monster-card-body { min-height: auto; padding: .95rem; }
}

/* Bestiarium v0.1.12: stabiler Bild-/Layout-Fix
   Entfernt das problematische v0.1.11-Verhalten durch saubere Wrapper-Regeln.
   Ziel: 16:10-Bilder passend im vorhandenen Rahmen, ohne schmale Textspalten und ohne Überlagerung. */
.monster-card.monster-card-with-image {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.monster-card-with-image .monster-card-image {
  margin: 0;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  display: block;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-strong), #000 12%);
}
.monster-card-with-image .monster-card-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.02), transparent 42%, rgba(0,0,0,.28));
  pointer-events: none;
}
.monster-card-with-image .monster-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  padding: 0;
  transform: scale(1.001);
  transition: transform .22s ease, filter .22s ease;
}
.monster-card-with-image:hover .monster-card-image img {
  transform: scale(1.025);
  filter: saturate(1.06) contrast(1.04);
}
.monster-card-with-image .monster-card-body {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  width: 100%;
  min-width: 0;
  padding: 1.05rem 1.15rem 1.15rem;
  min-height: 12.5rem;
}
.monster-detail-hero.monster-detail-hero-with-image {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 32rem);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  overflow: hidden;
}
.monster-detail-hero-with-image .monster-detail-hero-text {
  min-width: 0;
  max-width: 76ch;
  text-align: left;
}
.monster-detail-hero-with-image .monster-detail-image {
  margin: 0;
  width: 100%;
  max-width: 32rem;
  justify-self: end;
  aspect-ratio: 16 / 10;
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1.15rem;
  background: #120d09;
  box-shadow: var(--shadow);
}
.monster-detail-hero-with-image .monster-detail-image img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center 42%;
  padding: 0;
}
@media (max-width: 900px) {
  .monster-detail-hero.monster-detail-hero-with-image {
    grid-template-columns: 1fr;
  }
  .monster-detail-hero-with-image .monster-detail-image {
    max-width: none;
    justify-self: stretch;
  }
}
@media (max-width: 640px) {
  .monster-card-with-image .monster-card-image { aspect-ratio: 16 / 10; }
  .monster-card-with-image .monster-card-body { min-height: auto; padding: .95rem; }
  .monster-detail-hero-with-image .monster-detail-image { aspect-ratio: 16 / 10; }
}

/* Bestiarium v0.1.13: schonendes Bildlayout nach Rollback
   Ziel: kein globales object-fit, keine schmalen Textspalten, keine Überlagerung.
   Karten bleiben stabil im Raster. Detailbilder zeigen das Motiv vollständig mit dezenter Letterbox. */
.monster-card.monster-card-with-image {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.monster-card-with-image .monster-card-image {
  margin: 0;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  display: block;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at center, rgba(215, 164, 70, .16), transparent 62%),
    color-mix(in srgb, var(--panel-strong), #000 16%);
}
.monster-card-with-image .monster-card-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.02), transparent 50%, rgba(0,0,0,.22));
  pointer-events: none;
}
.monster-card-with-image .monster-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  padding: .22rem;
  transform: none;
  transition: filter .22s ease;
}
.monster-card-with-image:hover .monster-card-image img {
  transform: none;
  filter: saturate(1.06) contrast(1.04);
}
.monster-card-with-image .monster-card-body {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  width: 100%;
  min-width: 0;
  padding: 1.05rem 1.15rem 1.15rem;
  min-height: 12.5rem;
}
.monster-card-with-image .monster-card-body p {
  -webkit-line-clamp: 4;
}
.monster-detail-hero.monster-detail-hero-with-image {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 34rem);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  overflow: hidden;
}
.monster-detail-hero-with-image .monster-detail-hero-text {
  min-width: 0;
  max-width: 76ch;
  text-align: left;
}
.monster-detail-hero-with-image .monster-detail-image {
  margin: 0;
  width: 100%;
  max-width: 34rem;
  justify-self: end;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1.15rem;
  background:
    radial-gradient(circle at center, rgba(215, 164, 70, .13), transparent 62%),
    #120d09;
  box-shadow: var(--shadow);
}
.monster-detail-hero-with-image .monster-detail-image img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center center;
  padding: .35rem;
}
@media (max-width: 900px) {
  .monster-detail-hero.monster-detail-hero-with-image {
    grid-template-columns: 1fr;
  }
  .monster-detail-hero-with-image .monster-detail-image {
    max-width: none;
    justify-self: stretch;
  }
}
@media (max-width: 640px) {
  .monster-card-with-image .monster-card-image { aspect-ratio: 16 / 10; }
  .monster-card-with-image .monster-card-body { min-height: auto; padding: .95rem; }
  .monster-detail-hero-with-image .monster-detail-image { aspect-ratio: 16 / 10; }
  .monster-detail-hero-with-image .monster-detail-image img { padding: .22rem; }
}
/* Ende Bestiarium v0.1.13 */

/* Bestiarium v0.1.14: Detailbilder vollständig anzeigen */
/* Nur Detailkarte: kein fester 16:10-Zwang mehr, damit Bilder unten nicht abgeschnitten werden. */
.monster-detail-hero-with-image .monster-detail-image {
  aspect-ratio: auto;
  height: auto;
  align-self: center;
}
.monster-detail-hero-with-image .monster-detail-image img {
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center center;
}
@media (max-width: 640px) {
  .monster-detail-hero-with-image .monster-detail-image {
    aspect-ratio: auto;
  }
}
/* Ende Bestiarium v0.1.14 */

/* Bestiarium v0.1.16: Kategorie-Kartenbilder Wrapper füllen */
/* Nur Oberseiten/Kategorieseiten: Monsterkarten in der Grid-Übersicht sollen den Bildwrapper füllen.
   Keine Änderung an Detailseiten (.monster-detail-*) und keine Änderung an Bilddateien. */
.monster-grid .monster-card.monster-card-with-image .monster-card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  display: block;
  background: #120d09;
}
.monster-grid .monster-card.monster-card-with-image .monster-card-image img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  max-height: none;
  object-fit: cover !important;
  object-position: center center;
  padding: 0;
}
@media (max-width: 640px) {
  .monster-grid .monster-card.monster-card-with-image .monster-card-image {
    aspect-ratio: 16 / 10;
  }
}
/* Ende Bestiarium v0.1.16 */

/* Regelwerk v0.1.25 */
.rules-shell { gap: 1rem; }
.rules-hero { position: relative; overflow: hidden; }
.rules-actions { display: flex; flex-wrap: wrap; gap: .65rem; justify-content: center; margin-top: 1rem; }
.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.rules-card { min-height: 12rem; }
.rules-card small { display: block; margin-top: .85rem; color: var(--accent); }
.rules-note { max-width: 78ch; margin: 1rem auto 0; color: var(--muted); border: 1px solid var(--border); border-radius: 1rem; padding: .8rem 1rem; background: color-mix(in srgb, var(--panel-strong), transparent 15%); }
.rules-content { overflow-x: auto; }
.rules-text { white-space: pre-wrap; font-family: Georgia, "Times New Roman", serif; line-height: 1.62; max-width: 95ch; margin: 0 auto; }
.rules-prev-next { display: grid; grid-template-columns: 1fr auto 1fr; gap: .75rem; align-items: center; }
.rules-prev-next a:last-child { justify-self: end; }
@media (max-width: 760px) {
  .rules-grid { grid-template-columns: 1fr; }
  .rules-prev-next { grid-template-columns: 1fr; }
  .rules-prev-next a, .rules-prev-next a:last-child { justify-self: stretch; }
}

/* Regelwerk v0.1.26 – strukturierte Wrapper-Navigation */
.rules-shell {
  max-width: 1180px;
}

.rules-hero .rules-actions,
.rules-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.2rem;
}

.rules-wrapper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.rules-wrapper-card {
  position: relative;
  display: block;
  min-height: 180px;
  padding: 1.25rem;
  border: 1px solid rgba(210, 172, 91, .32);
  border-radius: 1.25rem;
  background: linear-gradient(145deg, rgba(42, 30, 22, .92), rgba(18, 14, 12, .94));
  color: inherit;
  text-decoration: none;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .32);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.rules-wrapper-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -55% 20%;
  height: 120px;
  background: radial-gradient(circle, rgba(210, 172, 91, .18), transparent 70%);
  pointer-events: none;
}

.rules-wrapper-card:hover {
  transform: translateY(-3px);
  border-color: rgba(235, 200, 124, .72);
  box-shadow: 0 22px 55px rgba(0, 0, 0, .42);
}

.rules-wrapper-card h2 {
  margin: .35rem 0 .55rem;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.rules-wrapper-card p {
  margin: 0 0 1rem;
  line-height: 1.55;
}

.rules-wrapper-card small {
  display: block;
  color: var(--muted);
  line-height: 1.4;
}

.rules-card-kicker {
  display: inline-block;
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}

.rules-group-card {
  min-height: 210px;
}

.rules-topic-card {
  min-height: 170px;
}

.rules-content {
  margin-top: 1.5rem;
}

.rules-text {
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 1rem;
}

.rules-prev-next {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: .75rem;
  align-items: center;
  margin-top: 1.5rem;
}

.rules-prev-next a:last-child {
  justify-self: end;
}

@media (max-width: 760px) {
  .rules-prev-next {
    grid-template-columns: 1fr;
  }
  .rules-prev-next a:last-child {
    justify-self: stretch;
  }
  .rules-prev-next .button {
    width: 100%;
    text-align: center;
  }
}
