/* =====================================================================
   POWER CUBE – Design-Tokens
   Layout: dunkle Kopfleiste wie bei Wizards / Cube Cobra, helle ruhige
   Inhaltsfläche, Navigation unten (Handy) bzw. oben (Desktop).
   Alle Farben, Schriften und Abstände werden nur hier festgelegt.
   ===================================================================== */
:root {
  /* Flächen & Text */
  --bg: #f3f2ef;
  --surface: #ffffff;
  --surface-2: #ecebe7;
  --ink: #1b1a18;
  --ink-2: #47443f;
  --muted: #77726b;
  --line: #dfdcd6;
  /* Akzent: Magic-Orange, sparsam eingesetzt */
  --accent: #b5481d;
  --accent-ink: #ffffff;
  --accent-soft: #f5e4da;
  /* Kopfleiste */
  --bar: #161518;
  --bar-ink: #f1eee8;
  --bar-muted: #9c968e;
  /* Status */
  --ok: #2c7a4b;
  --warn: #9a6a0c;
  --bad: #b3261e;
  /* Manafarben (Fächer) */
  --pip-w: #f5efd2;
  --pip-u: #b4d4ee;
  --pip-b: #c6bfbb;
  --pip-r: #efab92;
  --pip-g: #a1cfac;
  --pip-m: #e5c977;
  --pip-c: #d2cfca;
  --pip-l: #cbb79a;
  --pip-x: #d5c2e4;
  --pip-ink: #1b1a18;
  /* Schrift */
  --font-ui: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-cond: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --font-card: "Spectral", Georgia, "Times New Roman", serif;
  /* Maße */
  --radius: 10px;
  --radius-sm: 6px;
  --card-radius: 4.6%;
  --tabbar-h: 62px;
  --maxw: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121114; --surface: #1b1a1d; --surface-2: #252328; --ink: #edeae4; --ink-2: #c8c3bb;
    --muted: #8f8a83; --line: #312f34; --accent: #ee8857; --accent-ink: #1c0f08; --accent-soft: #3a241a;
    --bar: #0b0a0c; --bar-ink: #f1eee8; --bar-muted: #8c867f;
    --ok: #6cc28f; --warn: #e3b64e; --bad: #f08a80;
    --pip-w: #ddd7bb; --pip-u: #9cbfdc; --pip-b: #aea8a5; --pip-r: #df9a80; --pip-g: #8fbf9a;
    --pip-m: #d7bb69; --pip-c: #bdbab5; --pip-l: #b9a588; --pip-x: #c2afd2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121114; --surface: #1b1a1d; --surface-2: #252328; --ink: #edeae4; --ink-2: #c8c3bb;
  --muted: #8f8a83; --line: #312f34; --accent: #ee8857; --accent-ink: #1c0f08; --accent-soft: #3a241a;
  --bar: #0b0a0c; --bar-ink: #f1eee8; --bar-muted: #8c867f;
  --ok: #6cc28f; --warn: #e3b64e; --bad: #f08a80;
  --pip-w: #ddd7bb; --pip-u: #9cbfdc; --pip-b: #aea8a5; --pip-r: #df9a80; --pip-g: #8fbf9a;
  --pip-m: #d7bb69; --pip-c: #bdbab5; --pip-l: #b9a588; --pip-x: #c2afd2;
  color-scheme: dark;
}

/* =====================================================================
   Grundlagen
   ===================================================================== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--bg); color: var(--ink); }
body {
  margin: 0; font-family: var(--font-ui); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bar); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; line-height: 1.2; margin: 0; }
a { color: var(--accent); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow { font-family: var(--font-cond); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* =====================================================================
   Kopfleiste & Navigation
   ===================================================================== */
.appbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bar); color: var(--bar-ink); }
.appbar .wrap { display: flex; align-items: center; gap: 16px; min-height: 54px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--bar-ink); }
.brand b { font-family: var(--font-cond); font-weight: 700; font-size: 22px; letter-spacing: .14em; text-transform: uppercase; }
.brand span { font-family: var(--font-cond); font-size: 14px; letter-spacing: .06em; color: var(--bar-muted); text-transform: uppercase; }
.topnav { display: none; margin-left: auto; gap: 4px; }
.topnav a { color: var(--bar-muted); text-decoration: none; font-family: var(--font-cond); font-weight: 600; font-size: 16px; letter-spacing: .06em; text-transform: uppercase; padding: 16px 12px 13px; border-bottom: 3px solid transparent; }
.topnav a:hover { color: var(--bar-ink); }
.topnav a[aria-current="page"] { color: var(--bar-ink); border-bottom-color: var(--accent); }
.theme-btn { margin-left: auto; background: none; border: 1px solid #3a373d; color: var(--bar-muted); border-radius: 999px; width: 36px; height: 36px; display: grid; place-items: center; }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn:hover { color: var(--bar-ink); }
.tabbar { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line);
  padding: 0 max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px));
  display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar a.mic-tab span.dot { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; margin-top: -14px; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.tabbar a.mic-tab span.dot svg { width: 22px; height: 22px; }
@media (min-width: 860px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .topnav { display: flex; }
  .theme-btn { margin-left: 8px; }
}

/* =====================================================================
   Seitenköpfe & Bausteine
   ===================================================================== */
main { padding-block: 20px 40px; }
.view[hidden] { display: none; }
.pagehead { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 16px; margin-bottom: 18px; }
.pagehead h1 { font-family: var(--font-cond); font-weight: 700; font-size: 30px; letter-spacing: .01em; }
.pagehead p { margin: 2px 0 0; color: var(--muted); max-width: 60ch; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel + .panel { margin-top: 14px; }
.panel h2 { font-family: var(--font-cond); font-size: 20px; font-weight: 700; letter-spacing: .01em; margin-bottom: 10px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grid2 { display: grid; gap: 14px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; } }
.sticky-col { position: sticky; top: 74px; }
/* Handy: Ergebnis direkt unter dem Format zeigen */
@media (max-width: 899px) {
  #view-draft .grid2 { display: flex; flex-direction: column; gap: 14px; }
  #view-draft .grid2 > .stack { display: contents; }
  #view-draft .panel + .panel { margin-top: 0; }
  #fmtPanel { order: 1; } #resultBox { order: 2; } #fmtOptions { order: 3; } #distPanel { order: 4; } #howBox { order: 5; } #sampleBox { order: 6; }
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); padding: 9px 14px; font-weight: 600; font-size: 15px; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; }
.btn[disabled] { opacity: .5; cursor: default; }

.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 11px; font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: none; white-space: nowrap; }
button.chip:hover, a.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-inline: -16px; padding-inline: 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.badge { display: inline-block; white-space: nowrap; font-family: var(--font-cond); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; border-radius: 4px; padding: 1px 6px; background: var(--surface-2); color: var(--ink-2); }
.badge.exp { background: var(--accent-soft); color: var(--accent); }
.badge.maybe { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--line); }
.badge.t-inf { background: #e5ddf3; color: #4b2f7f; } .badge.t-win { background: #f6dcd6; color: #8b2416; }
.badge.t-lock { background: #dbe6ef; color: #23445f; } .badge.t-syn { background: #e0ecdf; color: #2e5531; }
:root[data-theme="dark"] .badge.t-inf, :root[data-theme="dark"] .badge.t-win, :root[data-theme="dark"] .badge.t-lock, :root[data-theme="dark"] .badge.t-syn { background: var(--surface-2); color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.t-inf, :root:not([data-theme="light"]) .badge.t-win, :root:not([data-theme="light"]) .badge.t-lock, :root:not([data-theme="light"]) .badge.t-syn { background: var(--surface-2); color: var(--ink); } }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 6px; font-weight: 600; font-size: 15px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

.field { display: flex; flex-direction: column; gap: 4px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 16px; }
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search .input { padding-left: 36px; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.stepper button { border: 0; background: transparent; width: 36px; height: 36px; font-size: 20px; color: var(--ink-2); }
.stepper button:hover { background: var(--surface-2); }
.stepper output { min-width: 40px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
input[type="range"] { width: 100%; accent-color: var(--accent); }

/* Mana-Symbole */
.ms { display: inline-grid; place-items: center; width: 1.15em; height: 1.15em; border-radius: 50%; font-family: var(--font-ui); font-size: .82em; font-weight: 700; line-height: 1; vertical-align: -0.12em; margin: 0 .03em; background: var(--pip-c); color: var(--pip-ink); box-shadow: inset 0 -1px 0 rgba(0,0,0,.18); }
.ms-w { background: var(--pip-w); } .ms-u { background: var(--pip-u); } .ms-b { background: var(--pip-b); } .ms-r { background: var(--pip-r); } .ms-g { background: var(--pip-g); }
.ms-t, .ms-q { background: var(--ink-2); color: var(--surface); font-size: .7em; }
.ms-e { background: var(--ink-2); color: var(--surface); }
.ms-h { font-size: .58em; letter-spacing: -.04em; }
.pip { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-family: var(--font-cond); font-weight: 700; font-size: 13px; color: var(--pip-ink); flex: none; box-shadow: inset 0 -1px 0 rgba(0,0,0,.18); }
.pip-W { background: var(--pip-w); } .pip-U { background: var(--pip-u); } .pip-B { background: var(--pip-b); } .pip-R { background: var(--pip-r); } .pip-G { background: var(--pip-g); }
.pip-M { background: var(--pip-m); } .pip-C { background: var(--pip-c); } .pip-L { background: var(--pip-l); } .pip-X { background: var(--pip-x); } .pip-T { background: var(--surface-2); }

/* =====================================================================
   Packbau
   ===================================================================== */
.fmt-group { margin-top: 12px; }
.fmt-group:first-child { margin-top: 0; }
.fmt-list { display: grid; gap: 6px; margin-top: 6px; }
.fmt { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; }
.fmt:hover { border-color: var(--muted); }
.fmt .radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); margin-top: 3px; grid-row: span 2; }
.fmt b { font-weight: 700; }
.fmt span.t { font-size: 14px; color: var(--muted); line-height: 1.35; }
.fmt[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.fmt[aria-pressed="true"] .radio { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 4px, transparent 5px); }

.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 14px; }
.summary div { background: var(--surface); padding: 10px 12px; }
.summary b { display: block; font-family: var(--font-cond); font-size: 30px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.summary span { font-size: 13px; color: var(--muted); }
.pull { width: 100%; border-collapse: collapse; }
.pull td { padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pull tr:last-child td { border-bottom: 0; }
.pull td.n { text-align: right; font-family: var(--font-cond); font-size: 26px; font-weight: 700; width: 3.2ch; font-variant-numeric: tabular-nums; }
.pull td.nm { padding-left: 10px; font-weight: 600; }
.pull td.bar { width: 38%; padding-left: 12px; }
.pull .track { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.pull .fill { height: 100%; background: var(--ink-2); border-radius: 3px; }
.pull .of { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.pull tr.over .of { color: var(--bad); font-weight: 600; }
.pull tfoot td { border-top: 2px solid var(--ink); border-bottom: 0; padding-top: 9px; }
.weights { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.weights .w { display: flex; align-items: center; justify-content: space-between; gap: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 4px 4px 8px; }
.colorpick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.colorpick button.pip { width: 38px; height: 38px; font-size: 16px; border: 2px solid transparent; opacity: .45; }
.colorpick button.pip[aria-pressed="true"] { opacity: 1; border-color: var(--ink); }
ol.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; }
ol.steps li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; gap: 8px; }
ol.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.rulebox { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 8px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-top: 8px; }
.rulebox b { display: block; }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.pack { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; background: var(--surface); min-width: 0; }
.pack h3 { font-family: var(--font-cond); font-size: 15px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.pack ul { list-style: none; margin: 0; padding: 0; }
.pack li button { all: unset; cursor: pointer; display: flex; gap: 6px; align-items: center; padding: 2px 0; font-size: 14px; width: 100%; }
.pack li button:hover { color: var(--accent); }
.pack .pip { width: 14px; height: 14px; font-size: 0; }

/* =====================================================================
   Karten
   ===================================================================== */
.toolbar { display: grid; gap: 10px; margin-bottom: 14px; }
.toolbar .row2 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar select.input { width: auto; padding-block: 6px; font-size: 15px; }
.count { font-size: 14px; color: var(--muted); }
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
@media (min-width: 600px) { .cardgrid { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 10px; } }
.mcard { all: unset; cursor: pointer; display: block; position: relative; aspect-ratio: 488 / 680; max-width: 100%; border-radius: var(--card-radius) / calc(var(--card-radius) * 0.718); overflow: hidden; background: var(--surface-2); box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.mcard img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mcard .flag { position: absolute; top: 5px; right: 5px; }
.mcard .dfc { position: absolute; bottom: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; display: grid; place-items: center; }
.mcard .dfc svg { width: 14px; height: 14px; }
/* Textkarte, wenn Bilder nicht laden */
.tcard { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 7px; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: inherit; }
.tcard .tn { font-weight: 700; font-size: 12px; line-height: 1.15; }
.tcard .tc { font-size: 11px; }
.tcard .tt { font-size: 10.5px; color: var(--muted); line-height: 1.2; }
.tcard .tx { font-family: var(--font-card); font-size: 10.5px; line-height: 1.25; overflow: hidden; flex: 1; color: var(--ink-2); }
.tcard::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; border-radius: 6px 6px 0 0; background: var(--fc, var(--pip-c)); }
.cardlist { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lrow { all: unset; cursor: pointer; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.lrow:last-child { border-bottom: 0; }
.lrow:hover { background: var(--surface-2); }
.lrow .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .ty { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .mc { font-size: 15px; white-space: nowrap; }
.more { display: flex; justify-content: center; margin-top: 16px; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

/* Karten-Detail (Sheet) */
.sheet-bg { position: fixed; inset: 0; z-index: 40; background: rgba(10,9,12,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 920px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 0 max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); overscroll-behavior: contain; }
.sheet-top { position: sticky; top: 0; z-index: 2; background: var(--bg); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; }
.sheet-top .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); position: absolute; left: 50%; top: 5px; transform: translateX(-50%); }
.closebtn { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; }
.closebtn svg { width: 18px; height: 18px; }
@media (min-width: 760px) { .sheet-bg { align-items: center; padding: 24px; } .sheet { border-radius: 16px; max-height: 88vh; } }
.detail { display: grid; gap: 18px; }
@media (min-width: 700px) { .detail { grid-template-columns: 300px minmax(0, 1fr); align-items: start; } }
.detail .art { position: relative; width: 100%; max-width: 320px; margin: 0 auto; }
.detail .art .mcard { width: 100%; cursor: default; }
.detail .flip { margin-top: 10px; width: 100%; }
.detail h2 { font-family: var(--font-cond); font-size: 28px; font-weight: 700; }
.face { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.face + .face { margin-top: 10px; }
.face-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.face-h b { font-size: 17px; }
.face .tl { font-size: 14px; color: var(--muted); margin: 2px 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.otext { font-family: var(--font-card); font-size: 16.5px; line-height: 1.45; }
.otext p { margin: 0 0 6px; }
.otext p:last-child { margin-bottom: 0; }
.otext i { color: var(--ink-2); }
.face .pt { text-align: right; font-weight: 700; margin-top: 6px; }
.note { border: 1px solid var(--warn); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 15px; background: var(--surface); }
.note b { color: var(--warn); }
.meta { font-size: 14px; color: var(--muted); }
details.rulings summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
details.rulings ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14.5px; }
details.rulings li span { color: var(--muted); font-size: 12.5px; margin-right: 6px; }

/* =====================================================================
   Lexikon & Strategie
   ===================================================================== */
.entries { display: grid; gap: 10px; }
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; }
.entry-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.entry-h h3 { font-size: 18px; font-weight: 700; }
.entry-h .de { color: var(--muted); font-size: 15px; }
.entry-h .badge { margin-left: auto; }
.entry p { margin: 6px 0 0; max-width: 70ch; }
.entry .tip { font-size: 14.5px; color: var(--ink-2); margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--line); }
.entry .chips { margin-top: 10px; }
.remind { margin-top: 10px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.remind .label { display: block; margin-bottom: 3px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.remind .otext { font-size: 16px; }
.entry.errata { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; align-items: start; }
.errata-art .mcard { width: 100%; }
@media (min-width: 700px) { .entry.errata { grid-template-columns: 170px minmax(0, 1fr); } }
.crbtn { all: unset; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); }
.crtext { margin-top: 8px; font-size: 14px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; max-height: 320px; overflow-y: auto; }
.crtext div { margin-bottom: 6px; }
.crtext b { font-variant-numeric: tabular-nums; margin-right: 6px; }
.arch { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px; }
.arch-h { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.arch-h h3 { font-family: var(--font-cond); font-size: 22px; font-weight: 700; }
.arch p { margin: 6px 0 0; max-width: 72ch; }
.strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; padding: 10px 0 4px; }
.strip .mcard { width: 100%; }
@media (min-width: 860px) { .strip { grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); } }
.sub { margin-top: 10px; }
.sub .label { display: block; margin-bottom: 5px; }
.combo-steps { margin-top: 10px; }
.cards-in { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.cards-in .plus { color: var(--muted); font-weight: 700; }

/* =====================================================================
   Regel-Assistent
   ===================================================================== */
.ask { display: grid; gap: 12px; }
.askbox { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 10px; }
.askbox textarea { width: 100%; min-height: 84px; resize: vertical; border: 0; background: transparent; font-size: 17px; line-height: 1.4; padding: 2px 2px; }
.askbox textarea:focus { outline: none; }
.askbar { display: flex; align-items: center; gap: 10px; }
.mic { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.mic svg { width: 28px; height: 28px; }
.mic.on { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(181,72,29,.45); } 50% { box-shadow: 0 0 0 14px rgba(181,72,29,0); } }
.askbar .clear { margin-left: auto; }
.askbar .clear + .send, .askbar .clear[hidden] + .send { margin-left: 0; }
.askbar .clear[hidden] + .send { margin-left: auto; }
.hint { font-size: 14px; color: var(--muted); }
.status { font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.spin { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: rot .8s linear infinite; flex: none; }
@keyframes rot { to { transform: rotate(360deg); } }
.thread { display: grid; gap: 12px; }
.q { justify-self: end; max-width: 85%; background: var(--ink); color: var(--bg); padding: 9px 13px; border-radius: 14px 14px 4px 14px; }
.a { background: var(--surface); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 13px 15px; }
.a .md p { margin: 0 0 8px; }
.a .md p:last-child { margin-bottom: 0; }
.a .md ul, .a .md ol { margin: 0 0 8px; padding-left: 20px; }
.a .md li { margin-bottom: 3px; }
.a .md a { cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.a .looked { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.a .tools { display: flex; gap: 8px; margin-top: 10px; }
.examples { display: grid; gap: 6px; }
.examples button { all: unset; cursor: pointer; padding: 9px 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm); font-size: 15px; color: var(--ink-2); }
.examples button:hover { border-color: var(--muted); color: var(--ink); }
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 11px 13px; font-size: 15px; }

.srcline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.srcline .spin { display: inline-block; vertical-align: -2px; }
.strip.small { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
@media (min-width: 860px) { .strip.small { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); } }
/* Archetypen-Übersicht und -Detail */
.archgrid { display: grid; gap: 12px; }
@media (min-width: 720px) { .archgrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .archgrid { grid-template-columns: repeat(3, 1fr); } }
.archtile { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: inherit; text-decoration: none; }
.archtile:hover { border-color: var(--ink-2); }
.archtile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.archtile .arch-h h3 { font-size: 20px; }
.archtile p { margin: 0; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.picks .mcard { width: 100%; }
.archtile .go { font-family: var(--font-cond); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: 13px; color: var(--accent); }
.archnav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.archnav .btn { max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archdetail h2 { font-family: var(--font-cond); font-size: 28px; font-weight: 700; margin: 0; }
.archdetail .sub > .label { display: block; margin-top: 4px; }
.ccfmt + .ccfmt { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ccfmt .md p { margin: 4px 0 0; }
@media (max-width: 899px) { #ccFormats { order: 5; } }
.arch-h > .row { flex: none; flex-wrap: nowrap; }
