/* Magic-Einstieg: eigenständiges Stylesheet ("Fünf Farben und Karten"). Keine fremden Schriften. */
:root {
  color-scheme: dark;
  --bg: #0f1117;
  --bg2: #151822;
  --panel: #1b1f2a;
  --panel2: #232836;
  --line: #343a4a;
  --ink: #ece9e1;
  --muted: #b0b4c0;
  /* Gold = mehrfarbig; Grundakzent außerhalb der Kapitel (auch für das Chatfenster) */
  --accent: #e3bd62;
  --accent-2: #f0d48f;
  --on-accent: #14161c;
  --ok: #8fd39b;
  --bad: #f4a08a;
  --radius: 14px;
  /* Kartenfarben als Akzent: alle ≥ 5,9:1 auf --panel2 */
  --mw: #ece3c0; --mu: #66b0ef; --mb: #c6b9dc; --mr: #f2876a; --mg: #74c785; --mc: #c8c4bd;
  /* Manasymbole im Text (dunkle Schrift, ≥ 8:1) */
  --sw: #f3ecd0; --su: #8cc3ee; --sb: #3a3340; --sr: #f09a7c; --sg: #8fcf96; --sc: #c8c4bd;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
}
.sec[data-c="w"], a[data-c="w"] { --accent: var(--mw); --accent-2: #fff6d8; --tint: rgba(236,227,192,0.07); }
.sec[data-c="u"], a[data-c="u"] { --accent: var(--mu); --accent-2: #a8d3f7; --tint: rgba(102,176,239,0.08); }
.sec[data-c="b"], a[data-c="b"] { --accent: var(--mb); --accent-2: #e0d7ee; --tint: rgba(198,185,220,0.07); }
.sec[data-c="r"], a[data-c="r"] { --accent: var(--mr); --accent-2: #f9b9a5; --tint: rgba(242,135,106,0.08); }
.sec[data-c="g"], a[data-c="g"] { --accent: var(--mg); --accent-2: #ace0b4; --tint: rgba(116,199,133,0.08); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; color: var(--ink); line-height: 1.55; overflow-x: hidden;
  background:
    radial-gradient(900px 420px at 92% -6%, rgba(102,176,239,0.12), transparent 60%),
    radial-gradient(700px 380px at -8% 4%, rgba(116,199,133,0.09), transparent 60%),
    radial-gradient(800px 500px at 50% 110%, rgba(242,135,106,0.06), transparent 60%),
    var(--bg);
}
a { color: var(--accent-2); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; font-family: var(--serif); }
h2 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); display: flex; align-items: center; gap: 14px; }
h3 { font-size: 1.14rem; }
p { margin: 0 0 0.8em; }
.wrap { width: min(1080px, 100%); margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 99; background: var(--panel); padding: 8px 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: 0.88rem; color: var(--muted); }
.muted { color: var(--muted); }
.fine { font-size: 0.82rem; color: var(--muted); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Kopfzeile ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(15,17,23,0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 16px; height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 800; white-space: nowrap; font-family: var(--serif); font-size: 1.08rem; }
.brand svg { width: 26px; height: 26px; color: var(--accent); }
.brand em { font-style: normal; color: var(--accent); }
.toc { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 88%, transparent); padding-right: 28px; }
.toc::-webkit-scrollbar { display: none; }
.toc a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 999px; font-size: 0.9rem; white-space: nowrap; }
.toc a i { display: none; }
.toc a:hover, .toc a.on { color: var(--ink); background: var(--panel2); box-shadow: inset 0 -2px 0 var(--accent); }
.toc-btn { display: none; }

/* ---------- Hero ---------- */
.hero { padding: 52px 0 24px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, transparent, rgba(0,0,0,0.28)); }
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; }
.kicker { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; color: var(--accent); font-weight: 700; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); font-weight: 700; letter-spacing: -0.01em; }
.hero h1 span { color: var(--accent); font-style: italic; }
.lead { font-size: 1.1rem; max-width: 34em; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.fan { position: relative; height: 250px; }
.cback { position: absolute; left: 50%; bottom: 6px; width: 120px; aspect-ratio: 63 / 88; margin-left: -60px; border-radius: 9px;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--c) 30%, #1a1410) 0 34%, transparent 35%), linear-gradient(160deg, #3a2c1e, #18120c);
  box-shadow: inset 0 0 0 4px #0c0a08, inset 0 0 0 6px color-mix(in srgb, var(--c) 70%, #000), 0 14px 30px -12px #000;
  transform-origin: 50% 120%; transform: rotate(calc((var(--i) - 2) * 13deg)); transition: transform 0.3s; display: grid; place-items: center; }
.cback span { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-weight: 800; font-size: 1.4rem; color: #14161c;
  background: radial-gradient(circle at 35% 30%, #fff8 0, transparent 55%), var(--c); box-shadow: -2px 2px 0 #000a; }
.cb-b span { background: radial-gradient(circle at 35% 30%, #fff3 0, transparent 55%), var(--sb); color: #eee; box-shadow: -2px 2px 0 #000a, inset 0 0 0 2px var(--mb); }
.cback:nth-child(1) { --i: 0; } .cback:nth-child(2) { --i: 1; } .cback:nth-child(3) { --i: 2; } .cback:nth-child(4) { --i: 3; } .cback:nth-child(5) { --i: 4; }
.fan:hover .cback { transform: rotate(calc((var(--i) - 2) * 17deg)) translateY(-6px); }
.facts { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.facts li { padding: 10px 12px; border-left: 1px solid var(--line); }
.facts li:first-child { border-left: 0; }
.facts b { display: block; font-family: var(--serif); font-size: 1.5rem; color: var(--accent); line-height: 1.1; }
.facts span { color: var(--muted); font-size: 0.82rem; }

/* ---------- Knöpfe ---------- */
.btn { display: inline-block; text-align: center; line-height: 1.4; min-height: 44px; border: 0; cursor: pointer; font: inherit; font-weight: 800; text-decoration: none;
  background: var(--accent); color: var(--on-accent); padding: 10px 18px; border-radius: 10px; box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 45%, #000); }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 45%, #000); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; transform: none; }

/* ---------- Kapitel ---------- */
.sec { padding: 56px 16px 8px; }
.sec > h2 { padding-bottom: 10px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, var(--tint, transparent), transparent 70%); border-radius: 30px 0 0 30px; }
/* Kapitelnummer als Manasymbol */
.num { display: inline-grid; place-items: center; width: 1.75em; height: 1.75em; border-radius: 50%; flex: none; font-family: var(--serif); font-size: 0.8em; font-weight: 800; color: var(--on-accent);
  background: radial-gradient(circle at 34% 28%, rgba(255,255,255,0.55), transparent 55%), var(--accent);
  box-shadow: -2px 2px 0 rgba(0,0,0,0.7), inset 0 0 0 2px rgba(0,0,0,0.15); }
.sec[data-c="b"] .num { background: radial-gradient(circle at 34% 28%, rgba(255,255,255,0.22), transparent 55%), var(--sb); color: #f1edf6; box-shadow: -2px 2px 0 rgba(0,0,0,0.7), inset 0 0 0 2px var(--mb); }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 18px 0; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 18px 0; }

/* Infokästen im Kartenstil: innerer Rahmen, Namensleiste, leichtes Anheben */
.tile, .panel { position: relative; background: linear-gradient(165deg, var(--panel2), var(--panel) 60%); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px;
  box-shadow: inset 0 0 0 3px var(--panel), inset 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent), 0 8px 20px -14px #000; transition: transform 0.2s, box-shadow 0.2s; }
.tile:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 3px var(--panel), inset 0 0 0 4px color-mix(in srgb, var(--accent) 55%, transparent), 0 14px 26px -14px #000; }
.tile h3, .panel h3 { margin: -2px -4px 10px; padding: 5px 10px; border-radius: 7px; background: var(--bg2); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); font-size: 1.05rem; }
.tile p, .panel p { margin: 0; }
.note { background: var(--bg2); border-left: 3px solid var(--accent); padding: 12px 16px; border-radius: 0 10px 10px 0; }
.tag { display: inline-block; font-family: ui-sans-serif, system-ui, sans-serif; font-size: 0.7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); vertical-align: middle; white-space: nowrap; }

.steps-num { counter-reset: s; list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
.steps-num li { counter-increment: s; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 12px 54px; position: relative; }
.steps-num li::before { content: counter(s); position: absolute; left: 14px; top: 11px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif);
  background: radial-gradient(circle at 34% 28%, rgba(255,255,255,0.45), transparent 55%), var(--accent); color: var(--on-accent); font-weight: 800; font-size: 0.9rem; box-shadow: -1px 1px 0 #000a; }
.merke { position: relative; margin: 26px 0 8px; padding: 20px 18px 14px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--tint, rgba(227,189,98,0.06)); }
.merke::before { content: "Merke"; position: absolute; top: -0.8em; left: 14px; padding: 1px 12px; background: var(--accent); color: var(--on-accent); font-weight: 900; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; border-radius: 999px; }
.merke > :last-child { margin-bottom: 0; }

/* ---------- Manasymbole ---------- */
.mana { display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; border-radius: 50%; font-family: var(--serif); font-size: 0.8em; font-weight: 800; font-style: normal; line-height: 1;
  color: #111; vertical-align: -0.12em; margin: 0 1px; box-shadow: -1px 1px 0 rgba(0,0,0,0.75); text-decoration: none; }
.mana.w { background: var(--sw); } .mana.u { background: var(--su); } .mana.b { background: var(--sb); color: #eee; box-shadow: -1px 1px 0 rgba(0,0,0,0.75), inset 0 0 0 1.5px var(--mb); }
.mana.r { background: var(--sr); } .mana.g { background: var(--sg); } .mana.c, .mana.n, .mana.t { background: var(--sc); }
.mana svg { width: 78%; height: 78%; display: block; }
.mana.hy { background: linear-gradient(135deg, var(--c1) 0 50%, var(--c2) 50% 100%); position: relative; font-size: 0.95em; }
.mana.hy i { position: absolute; font-style: normal; font-size: 0.6em; font-weight: 900; line-height: 1; }
.mana.hy i:first-child { top: 14%; left: 18%; }
.mana.hy i:last-child { bottom: 14%; right: 18%; }
.mana.hy.has-b i:last-child { color: #eee; }

/* ---------- Farben ---------- */
.colors { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.colors > div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; border-top: 4px solid var(--c); }
.colors b { display: block; margin-bottom: 4px; font-family: var(--serif); font-size: 1.05rem; }
.colors > div > span { color: var(--muted); font-size: 0.88rem; }
.colors b .mana { font-size: 0.9em; }

/* ---------- Beispielkarte ---------- */
.card-demo { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 24px; margin: 18px 0; align-items: start; }
.mcard-wrap { display: grid; place-items: center; padding: 8px 0; }
.mcard { width: 100%; max-width: 320px; aspect-ratio: 63 / 88; border-radius: 16px; padding: 14px 13px 12px; display: grid; grid-template-rows: auto 1fr auto auto auto; gap: 6px;
  background: linear-gradient(160deg, #3f7f52, #23503a 60%, #173826); box-shadow: inset 0 0 0 5px #0d0d0d, inset 0 0 0 7px #8fcf96aa, 0 18px 36px -18px #000;
  color: #15130f; transition: transform 0.45s cubic-bezier(.3,1.3,.5,1); transform-origin: 50% 55%; }
.mcard.tapped { transform: rotate(90deg) scale(0.72); }
.mcard > div { cursor: pointer; border-radius: 7px; outline-offset: 1px; }
.mcard > div:hover, .mcard > div.on, .mcard > div:focus-visible { outline: 3px solid var(--accent-2); }
.mc-top, .mc-type { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 5px 9px; font-family: var(--serif); font-weight: 800;
  background: linear-gradient(180deg, #e8efe2, #c9d6c1); border: 1px solid #0006; box-shadow: 0 1px 0 #fff6 inset; }
.mc-type { font-size: 0.92rem; }
.mc-art { min-height: 100px; overflow: hidden; border: 2px solid #0008; background: #1d3a2a; }
.mc-art svg { display: block; width: 100%; height: 100%; }
.mc-text { font-family: var(--serif); font-size: 0.86rem; line-height: 1.35; padding: 8px 10px; background: #efe9dc; border: 1px solid #0006; min-height: 86px; }
.mc-text i { color: #3d3a33; }
.mc-text .flavor { display: block; margin-top: 4px; }
.mc-pt { justify-self: end; font-family: var(--serif); font-weight: 900; font-size: 1.1rem; padding: 2px 14px; margin-top: -14px; background: linear-gradient(180deg, #e8efe2, #c9d6c1); border: 1px solid #0008; }
.explain { display: grid; gap: 12px; align-content: start; position: sticky; top: 72px; }
.explain .panel { min-height: 120px; }
.explain .btn { justify-self: start; }

/* ---------- Spielzonen ---------- */
.zones { display: grid; gap: 10px; margin: 18px 0; padding: 12px; border-radius: 18px; border: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 40%, rgba(242,135,106,0.06), transparent 70%), repeating-linear-gradient(45deg, #141720 0 6px, #12151d 6px 12px);
  grid-template-columns: 1.1fr 2.2fr 1.1fr; grid-template-areas: "cmd field lib" "stack field gy" "hand hand exile"; }
.zone { background: rgba(27,31,42,0.92); border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.zone h3 { font-size: 1.02rem; margin-bottom: 4px; }
.zone h3 small { font-family: ui-sans-serif, system-ui, sans-serif; font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.zone p { margin: 0; font-size: 0.88rem; }
.z-field { grid-area: field; border-style: solid; background: rgba(35,40,54,0.95); }
.z-lib { grid-area: lib; } .z-gy { grid-area: gy; } .z-exile { grid-area: exile; } .z-stack { grid-area: stack; } .z-hand { grid-area: hand; } .z-cmd { grid-area: cmd; }
.z-field { display: flex; flex-direction: column; }
.z-board { flex: 1; display: grid; grid-template-rows: 1fr 1fr; gap: 10px; margin-top: 12px; }
.z-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; min-height: 76px; padding: 6px 10px; border-radius: 10px; background: rgba(0,0,0,0.22); border: 1px dashed var(--line); }
.z-row small { width: 5.5em; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.mc { display: inline-block; width: 44px; height: 62px; border-radius: 4px; border: 2px solid #0008; transition: transform 0.3s; }
.mc.cr { background: linear-gradient(160deg, #3f7f52, #173826); }
.mc.ld { background: linear-gradient(160deg, #6e5a3a, #3a2e1e); }
.mc.tp { transform: rotate(90deg); margin: 0 9px; }
.z-pile { position: relative; height: 50px; margin-top: 8px; }
.z-pile i, .z-fan i { position: absolute; width: 32px; height: 45px; border-radius: 4px; background: linear-gradient(160deg, #3a2c1e, #18120c); border: 2px solid #000; box-shadow: inset 0 0 0 2px #6e5a3a; }
.z-pile i:nth-child(2) { left: 3px; top: -3px; } .z-pile i:nth-child(3) { left: 6px; top: -6px; }
.z-pile i:first-child { top: 0; left: 0; }
.z-fan { position: relative; height: 50px; margin-top: 8px; }
.z-fan i { bottom: 0; left: calc(var(--k) * 22px); transform: rotate(calc((var(--k) - 1.5) * 9deg)); transform-origin: 50% 120%; background: linear-gradient(160deg, #efe9dc, #c9c1ad); box-shadow: none; }
.z-fan i:nth-child(1) { --k: 0; } .z-fan i:nth-child(2) { --k: 1; } .z-fan i:nth-child(3) { --k: 2; } .z-fan i:nth-child(4) { --k: 3; }

/* ---------- Zugablauf ---------- */
.turn { list-style: none; padding: 0; margin: 20px 0 10px; display: grid; grid-template-columns: 1fr 1fr 1.25fr 1fr 1fr; gap: 14px; counter-reset: none; }
.ph { position: relative; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--phc, var(--muted)); border-radius: 12px; padding: 10px; }
.ph.main { --phc: var(--mu); }
.ph.combat { --phc: var(--mr); }
.ph:not(:last-child)::after { content: ""; position: absolute; right: -12px; top: 18px; width: 10px; height: 14px; background: var(--accent); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.ph-h { font-size: 1rem; display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.ph-h span { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; background: var(--phc, var(--sc)); color: #111; }
.st { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.st li { position: relative; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px 6px 32px; font-size: 0.88rem; line-height: 1.3; }
.st li small { display: block; color: var(--muted); font-size: 0.8rem; }
.st li::before { content: "–"; position: absolute; left: 6px; top: 6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: var(--muted); border: 1px dashed var(--line); font-size: 0.8rem; }
.st li.pr::before, .lg.pr { content: ""; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M11.5 1.5 4 11h5l-1.5 7.5L16 8.5h-5.2l.7-7Z' fill='%2314161c'/%3E%3C/svg%3E") center / 72% no-repeat; border: 0; }
.st li.mn { border-color: color-mix(in srgb, var(--mu) 55%, var(--line)); }
.st li.mn::after { content: ""; position: absolute; left: 6px; top: 30px; width: 20px; height: 20px; border-radius: 50%; background: var(--mu) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='4.5' y='2' width='11' height='16' rx='2' fill='none' stroke='%2314161c' stroke-width='2'/%3E%3Cpath d='M7.5 6h5M7.5 9h5' stroke='%2314161c' stroke-width='1.6'/%3E%3C/svg%3E") center / 70% no-repeat; }
.st li.mn { min-height: 58px; }
.legend { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; font-size: 0.88rem; color: var(--muted); }
.legend li { display: flex; gap: 10px; align-items: flex-start; }
.lg { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #14161c; }
.lg svg { width: 72%; height: 72%; }
.lg.pr svg { display: none; }
.lg.mn { background: var(--mu); }
.lg.no { border: 1px dashed var(--line); color: var(--muted); font-weight: 900; }

/* ---------- Länder tappen ---------- */
.sim { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 18px 0; box-shadow: inset 0 0 0 3px var(--panel), inset 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.sim h3 { font-size: 1.05rem; }
.lands { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.land-cell { width: 96px; height: 96px; display: grid; place-items: center; }
.land { width: 64px; height: 90px; border-radius: 7px; padding: 5px 4px; cursor: pointer; font: inherit; color: #111; display: grid; grid-template-rows: auto 1fr; justify-items: center; align-items: center;
  background: linear-gradient(170deg, color-mix(in srgb, var(--c) 85%, #fff) 0 22%, color-mix(in srgb, var(--c) 55%, #1a1a1a) 23% 100%);
  border: 2px solid #000; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 60%, #000), 0 6px 14px -8px #000; transition: transform 0.4s cubic-bezier(.3,1.3,.5,1), filter 0.3s; }
.land b { font-family: var(--serif); font-size: 0.72rem; line-height: 1.1; }
.land .mana { font-size: 1.15rem; }
.land[aria-pressed="true"] { transform: rotate(90deg); filter: saturate(0.6) brightness(0.8); }
.land:focus-visible { outline: 3px solid var(--accent-2); }
.pool-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.pool { display: flex; align-items: center; gap: 8px; min-height: 48px; min-width: 220px; padding: 6px 12px; border: 2px dashed var(--line); border-radius: 999px; background: var(--bg2); }
.pool-l { font-size: 0.8rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
#pool { display: flex; flex-wrap: wrap; gap: 2px; font-size: 1.25rem; min-height: 1.4em; }
#pool:empty::before { content: "leer"; font-size: 0.85rem; color: var(--muted); align-self: center; }
#pool .mana { animation: pop 0.3s ease; }
@keyframes pop { from { transform: translateY(-14px) scale(0.5); opacity: 0; } to { transform: none; opacity: 1; } }
.lands-msg { margin: 10px 0 0; min-height: 1.5em; font-size: 0.93rem; }
.lands-msg.good { color: var(--ok); } .lands-msg.bad { color: var(--bad); }

/* ---------- Tabellen ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 0.93rem; background: var(--panel); }
.tbl th, .tbl td { text-align: left; padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl thead th { border-top: 0; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; background: var(--bg2); }
.tbl tr.inst td:first-child b { color: var(--accent-2); }
.tbl-wrap { overflow-x: auto; margin: 12px 0; border: 1px solid var(--line); border-radius: 12px; }

/* ---------- Kampfrechner ---------- */
.fight { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fighter { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-width: 0; }
.fighter h3 { margin-bottom: 8px; }
.fighter .row { display: flex; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.stepper { display: grid; grid-template-columns: 44px 3.2em 44px; grid-template-rows: auto 44px; column-gap: 4px; }
.stepper > span { grid-column: 1 / -1; font-size: 0.82rem; color: var(--muted); margin-bottom: 2px; }
.stepper button { font: inherit; font-size: 1.3rem; font-weight: 800; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--ink); cursor: pointer; }
.stepper button:hover { border-color: var(--accent); }
.stepper input { width: 100%; text-align: center; font: inherit; font-weight: 800; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.kw { display: flex; flex-wrap: wrap; gap: 6px; }
.kw label { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 0.92rem; }
.kw label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--panel)); }
.kw input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.kw-none { margin-bottom: 10px; }
#b-box.off .b-fields { opacity: 0.4; }
.result { margin-top: 14px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.result ol { margin: 0; padding-left: 1.2em; }
.result li { margin-bottom: 4px; }
.result .sum { margin: 8px 0 0; font-weight: 800; color: var(--accent-2); }

/* ---------- Beispielzug ---------- */
.story { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; position: relative; }
.story::before { content: ""; position: absolute; left: 33px; top: 10px; bottom: 10px; width: 3px; background: linear-gradient(var(--mg), var(--mr)); border-radius: 3px; }
.story li { position: relative; display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 12px; align-items: start; }
.story .z { position: relative; z-index: 1; display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; text-align: center; font-family: var(--serif); font-weight: 800; font-size: 0.9rem; line-height: 1.1; color: var(--on-accent);
  background: radial-gradient(circle at 34% 28%, rgba(255,255,255,0.5), transparent 55%), var(--accent); box-shadow: -2px 2px 0 #000a; padding: 8px; }
.story li > div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }

/* ---------- Schlüsselwörter, FAQ, Glossar ---------- */
.kw-h { margin: 22px 0 6px; font-size: 1.05rem; color: var(--accent-2); }
.wr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 8px 0; }
.wr-list > div { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 10px 13px; }
.wr-list b { display: block; color: var(--accent-2); margin-bottom: 2px; }
.wr-list > div > span { color: var(--muted); font-size: 0.92rem; }
.faq { display: grid; gap: 8px; margin: 14px 0; }
.faq details, .later { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.faq summary, .later summary { cursor: pointer; padding: 14px 16px; font-weight: 800; list-style: none; display: flex; justify-content: space-between; gap: 12px; min-height: 44px; }
.faq summary::-webkit-details-marker, .later summary::-webkit-details-marker { display: none; }
.faq summary::after, .later summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after, .later[open] summary::after { content: "–"; }
.faq details p { margin: 0; padding: 0 16px 14px; }
.later { margin: 18px 0; border-style: dashed; }
.later summary { color: var(--accent-2); }
.later > .cols-2 { margin: 0; padding: 0 14px 14px; }
.gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; margin: 16px 0; }
.gloss > div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; }
.gloss dt { font-weight: 800; color: var(--accent-2); }
.gloss dt small { color: var(--muted); font-weight: 600; }
.gloss dd { margin: 2px 0 0; font-size: 0.92rem; }
.links li { margin-bottom: 6px; }

/* ---------- Stapel-Simulator ---------- */
.sim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.sim-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.sim-btns .btn { padding: 8px 14px; font-size: 0.92rem; }
.creature { display: flex; gap: 12px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; transition: opacity 0.3s; }
.creature .pt { font-family: var(--serif); font-size: 1.4rem; font-weight: 900; color: var(--accent); min-width: 3.2em; text-align: center; }
.creature.dead { opacity: 0.5; text-decoration: line-through; }
.creature.hit { animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.stack-h, .log-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 6px; }
.stack-h small, .log-h small { font-family: ui-sans-serif, system-ui, sans-serif; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.stack { list-style: none; margin: 0; padding: 12px 12px 8px; min-height: 150px; border: 2px dashed var(--line); border-radius: 12px; display: flex; flex-direction: column; background: var(--bg2); }
.stack:empty::before { content: "Stapel ist leer"; color: var(--muted); margin: auto; }
.stack li { position: relative; background: linear-gradient(165deg, var(--panel2), var(--panel)); border: 1px solid #0009; border-left: 6px solid var(--c, var(--accent)); border-radius: 9px; padding: 8px 10px; font-size: 0.92rem;
  box-shadow: 0 6px 12px -6px #000; transition: transform 0.25s, opacity 0.25s; }
.stack li + li { margin-top: -6px; transform: scale(0.97); }
.stack li + li + li { transform: scale(0.94); }
.stack li:first-child { z-index: 3; box-shadow: 0 0 0 2px var(--accent), 0 8px 16px -6px #000; }
.stack li:nth-child(2) { z-index: 2; }
.stack li small { display: block; color: var(--muted); }
.stack li.top-tag::after { content: "oben, wird zuerst verrechnet"; display: block; font-size: 0.75rem; color: var(--accent-2); font-weight: 700; }
.stack li.new { animation: drop 0.3s ease; }
.stack li.out { transform: translate(40px, -24px) rotate(8deg); opacity: 0; }
@keyframes drop { from { transform: translateY(-20px); opacity: 0; } }
.log { list-style: none; padding: 0; margin: 0; font-size: 0.9rem; max-height: 240px; overflow-y: auto; }
.log li { padding: 5px 0; border-top: 1px solid var(--line); color: var(--muted); }
.log li:first-child { color: var(--ink); font-weight: 600; }
.log li.bad { color: var(--bad); } .log li.good { color: var(--ok); }

/* ---------- Nach oben, Fuß ---------- */
.to-top { position: fixed; left: 16px; bottom: 16px; z-index: 30; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: 999px; text-decoration: none; font-weight: 800; font-size: 0.9rem;
  color: var(--ink); background: rgba(27,31,42,0.94); border: 1px solid var(--line); box-shadow: 0 6px 16px -6px #000; transition: opacity 0.25s, transform 0.25s; }
.js .to-top:not(.show) { opacity: 0; transform: translateY(12px); pointer-events: none; }
.foot { margin-top: 48px; border-top: 1px solid var(--line); padding: 20px 0 80px; color: var(--muted); }
.foot-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.foot a { color: var(--muted); }

/* ---------- Tablet ---------- */
@media (max-width: 900px) {
  .turn { grid-template-columns: 1fr 1fr; }
  .ph::after { display: none; }
  .ph.combat { grid-row: span 2; }
}
@media (max-width: 820px) {
  .hero-grid, .card-demo, .sim-grid, .fight { grid-template-columns: 1fr; }
  .cols-3 { grid-template-columns: 1fr; }
  .colors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .explain { position: static; }
  .fan { height: 190px; order: -1; }
  .cback { width: 92px; margin-left: -46px; }
  .cback span { width: 36px; height: 36px; font-size: 1.1rem; }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .facts li:nth-child(4) { border-left: 0; }
  .facts li:nth-child(n+4) { border-top: 1px solid var(--line); }
  /* Kapitelmenü zum Aufklappen */
  .js .toc-btn { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; min-height: 44px; padding: 6px 14px; font: inherit; font-weight: 800; color: var(--ink); background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
  .js .toc-btn[aria-expanded="true"] span { display: inline-block; transform: rotate(180deg); }
  .js .toc { display: none; position: absolute; top: 56px; left: 0; right: 0; max-height: calc(100vh - 56px); overflow-y: auto; mask-image: none; padding: 10px 16px 16px;
    background: rgba(15,17,23,0.98); border-bottom: 1px solid var(--line); flex-direction: column; gap: 2px; box-shadow: 0 20px 30px -10px #000; }
  .js .toc.open { display: grid; grid-template-columns: 1fr 1fr; }
  .js .toc a { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 0.95rem; color: var(--ink); border-radius: 10px; }
  .js .toc a i { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-style: normal; font-size: 0.72rem; font-weight: 800; background: var(--accent); color: var(--on-accent); flex: none; }
  .js .toc a[data-c="b"] i { background: var(--sb); color: #eee; box-shadow: inset 0 0 0 1.5px var(--mb); }
  .js .toc .toc-back { grid-column: 1 / -1; color: var(--muted); }
  /* Stapel-Simulator: Stapel oben, Knöpfe angeheftet, Protokoll darunter */
  .sim-bar { position: sticky; bottom: 0; z-index: 5; margin: 0 -16px; padding: 10px 16px 4px; background: linear-gradient(180deg, rgba(27,31,42,0.9), var(--panel) 30%); border-top: 1px solid var(--line); }
  .sim-btns { display: grid; grid-template-columns: 1fr 1fr; }
  .sim-btns .btn { padding: 6px 10px; font-size: 0.86rem; line-height: 1.2; }
  #b-cnt, #b-res { grid-column: 1 / -1; }
  .stack { min-height: 120px; }
  .log { max-height: 180px; }
}
/* ---------- Handy ---------- */
@media (max-width: 600px) {
  .cols-2 { grid-template-columns: 1fr; }
  .sec { padding-top: 44px; }
  .zones { grid-template-columns: 1fr 1fr; grid-template-areas: "field field" "lib gy" "hand hand" "stack exile" "cmd cmd"; padding: 8px; gap: 8px; }
  .zone { padding: 8px 10px; }
  .z-row { min-height: 58px; gap: 8px; padding: 4px 8px; }
  .z-row small { width: 100%; margin-bottom: -4px; }
  .to-top { width: 44px; height: 44px; padding: 0; justify-content: center; font-size: 1.2rem; }
  .to-top .tt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .fan { height: 160px; }
  .mc { width: 32px; height: 45px; }
  .mc.tp { margin: 0 6px; }
  .zone h3 .tag { display: block; width: max-content; margin-top: 3px; }
  .turn { grid-template-columns: 1fr; gap: 10px; }
  .ph.combat { grid-row: auto; }
  .ph:not(:last-child)::after { display: block; right: auto; left: 50%; top: auto; bottom: -10px; width: 14px; height: 8px; margin-left: -7px; clip-path: polygon(0 0, 100% 0, 50% 100%); }
  .ph.combat .st, .ph:first-child .st { grid-template-columns: 1fr 1fr; }
  .ph.combat .st li:last-child { grid-column: 1 / -1; }
  .ph:first-child .st li:first-child { grid-column: 1 / -1; }
  /* Tabelle als Karten */
  .tbl-wrap { border: 0; overflow: visible; }
  .tbl-cards, .tbl-cards tbody, .tbl-cards tr, .tbl-cards td { display: block; background: none; }
  .tbl-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl-cards tr { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; margin-bottom: 8px; padding: 8px 12px; }
  .tbl-cards td { border: 0; padding: 2px 0; }
  .tbl-cards td:first-child { font-family: var(--serif); font-size: 1.05rem; padding-bottom: 4px; }
  .tbl-cards td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
  .land-cell { width: 84px; height: 92px; }
  .land { width: 58px; height: 82px; }
  .pool { min-width: 0; flex: 1 1 100%; }
  .pool-row .sim-btns { grid-template-columns: 1fr 1fr; width: 100%; }
  .pool-row .sim-btns .btn:first-child { grid-column: 1 / -1; }
  .story::before { left: 25px; }
  .story li { grid-template-columns: 52px minmax(0, 1fr); gap: 10px; }
  .story .z { width: 52px; height: 52px; font-size: 0.75rem; padding: 4px; }
  .gloss { grid-template-columns: 1fr; }
  .mcard { max-width: 290px; }
  .mcard.tapped { transform: rotate(90deg) scale(0.66); }
}
@media (max-width: 480px) {
  .colors { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts li:nth-child(n) { border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
  .facts li:nth-child(odd) { border-left: 0; }
  .facts li:nth-child(-n+2) { border-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .sim, .top, .to-top, .lands-demo, #ex-calc, #mcard-tap, .fan { display: none !important; }
  body { background: #fff; color: #000; }
}
