/* Amtsschimmel – Gestaltung
   Leitmotiv: Amtsstube. Aktendeckel, Papier, Stempelfarbe. Jede Epoche hat eigene Wand, eigenen Schreibtisch und eigene Akten. */

:root {
  --ink: #2b2420;
  --ink-soft: #6b5e52;
  --ink-faint: #9a8d7f;
  --paper: #fbf6e9;
  --paper-2: #f3ead4;
  --paper-3: #e7dbbd;
  --folder: #e6d29e;
  --folder-2: #d6bd7c;
  --folder-edge: #b89c5a;
  --red: #b3261e;
  --red-ink: rgba(179, 38, 30, .86);
  --blue: #2a4c9a;
  --blue-ink: rgba(42, 76, 154, .84);
  --green: #2c8549;
  --gold: #c9a24a;
  --warn: #c7741a;
  --shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 2px 0 rgba(0,0,0,.08), 0 6px 18px rgba(30, 18, 8, .18);
  --shadow-sm: 0 1px 2px rgba(30, 18, 8, .22);
  --radius: 8px;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", "DejaVu Serif", serif;
  --font-mono: "Courier New", Courier, "Nimbus Mono PS", ui-monospace, monospace;
  --wall1: #b98d5e; --wall2: #8a6440;
  --desk1: #7a5b3f; --desk2: #5b412b;
  --accent: #b5651d;
  --top-h: 56px; --ticker-h: 30px; --nav-h: 0px;
  color-scheme: light;
}
body[data-era="1"] { --wall1: #d8d0c0; --wall2: #a99f8c; --desk1: #e8e2d5; --desk2: #b9b09d; --accent: #9b2d20; }
body[data-era="2"] { --wall1: #6b4a32; --wall2: #3f2a1c; --desk1: #8a5a36; --desk2: #5e3b22; --accent: #b3261e; }
body[data-era="3"] { --wall1: #3e5a63; --wall2: #22343a; --desk1: #5b3d27; --desk2: #3d2818; --accent: #2f4f7a; }
body[data-era="4"] { --wall1: #6d2f2f; --wall2: #3f1b1b; --desk1: #4c3020; --desk2: #2f1c12; --accent: #b88a2e; }
body[data-era="5"] { --wall1: #c07a3a; --wall2: #7a4a22; --desk1: #a87a4b; --desk2: #7a5532; --accent: #d06a14; }
body[data-era="6"] { --wall1: #a8a296; --wall2: #6f6a60; --desk1: #8e8c86; --desk2: #66645e; --accent: #2f8f4e; }
body[data-era="7"] { --wall1: #cfdbe8; --wall2: #8ea6c0; --desk1: #e9edf2; --desk2: #b9c4d0; --accent: #1f5fae; }
body[data-era="8"] { --wall1: #163038; --wall2: #0a171c; --desk1: #1d3a44; --desk2: #0f2329; --accent: #1fa9a9; }
body[data-era="9"] { --wall1: #1a1636; --wall2: #07061a; --desk1: #221d48; --desk2: #0e0b26; --accent: #c9a24a; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
  background-color: var(--wall2);
  background-image:
    radial-gradient(ellipse at 30% 0%, rgba(255,255,255,.14), transparent 60%),
    repeating-linear-gradient(90deg, rgba(0,0,0,.035) 0 2px, transparent 2px 46px),
    linear-gradient(180deg, var(--wall1), var(--wall2));
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  transition: background-color .8s;
}
button { font: inherit; color: inherit; }
button:not(:disabled) { cursor: pointer; }
:focus-visible { outline: 3px solid #f1b52b; outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd { font-family: var(--font-mono); font-size: .85em; padding: 0 .35em; border: 1px solid currentColor; border-radius: 4px; border-bottom-width: 2px; opacity: .85; }
svg { display: block; width: 100%; height: 100%; }
[data-icon] { display: inline-block; width: 1.2em; height: 1.2em; vertical-align: -.22em; flex: none; }

/* ---------- Kopfzeile ---------- */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.topbar {
  height: var(--top-h); flex: none;
  display: flex; align-items: center; gap: 12px; padding: 0 12px;
  background: linear-gradient(180deg, #3a2b20, #2a1f17);
  color: #f4e9d2;
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  position: relative; z-index: 5;
  padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right));
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-icon { width: 34px; height: 34px; background: #f4e9d2; border-radius: 50%; padding: 4px; box-shadow: 0 0 0 2px var(--accent); }
.brand-icon svg { width: 100%; height: 100%; }
.brand h1 { font-family: var(--font-serif); font-size: 21px; letter-spacing: .06em; margin: 0; font-weight: 700; font-variant: small-caps; line-height: 1; }
.brand small { font-size: 11px; opacity: .75; letter-spacing: .04em; }
.era-badge {
  margin-left: auto; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); border-radius: 18px;
  padding: 3px 12px; display: flex; flex-direction: column; align-items: center; line-height: 1.15; color: #f4e9d2; min-width: 0;
}
.era-badge:hover { background: rgba(255,255,255,.15); }
.era-year { font-family: var(--font-mono); font-size: 11px; opacity: .8; }
.era-name { font-family: var(--font-serif); font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.top-mini { display: none; align-items: center; gap: 5px; font-family: var(--font-serif); }
.top-mini b { font-size: 16px; }
.top-mini small { opacity: .75; font-size: 11px; }
.top-actions { display: flex; gap: 6px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(0,0,0,.35); background: #f4e9d2; padding: 6px; display: grid; place-items: center; box-shadow: 0 0 0 2px rgba(255,255,255,.12); }
.icon-btn:hover { background: #fff; }
.icon-btn[aria-pressed="false"] { background: #cdbfa6; }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- Laufband ---------- */
.ticker {
  height: var(--ticker-h); flex: none; display: flex; align-items: center; overflow: hidden;
  background: var(--paper-2); border-bottom: 1px solid var(--folder-edge); font-family: var(--font-serif); font-size: 14px;
}
.ticker-label { flex: none; padding: 0 10px; height: 100%; display: flex; align-items: center; background: var(--red); color: #fff; font-family: var(--font-ui); font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.ticker-track { flex: 1; overflow: hidden; white-space: nowrap; position: relative; height: 100%; }
.ticker-text { position: absolute; left: 0; top: 50%; transform: translate(100vw, -50%); white-space: nowrap; will-change: transform; }
body.no-ticker .ticker { display: none; }

/* ---------- Spalten ---------- */
.layout {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(380px, 1.1fr) minmax(360px, 1fr) minmax(340px, .95fr);
  gap: 10px; padding: 10px; padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right));
}
.col { min-height: 0; min-width: 0; border-radius: 10px; }
.col-panel, .col-shop { display: flex; flex-direction: column; }

/* Schreibtisch */
.col-desk {
  position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(255,240,200,.35), transparent 62%),
    repeating-linear-gradient(8deg, rgba(0,0,0,.045) 0 1px, transparent 1px 9px),
    linear-gradient(180deg, var(--desk1), var(--desk2));
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.18), inset 0 0 40px rgba(0,0,0,.25), var(--shadow);
  display: flex; flex-direction: column; align-items: center; padding: 12px 12px 10px;
  color: #fff8e8;
  container-type: inline-size; container-name: desk;
}
body[data-era="1"] .col-desk, body[data-era="7"] .col-desk { color: var(--ink); }
.counter { text-align: center; padding: 4px 8px 6px; text-shadow: 0 1px 2px rgba(0,0,0,.45); user-select: none; flex: none; }
body[data-era="1"] .counter, body[data-era="7"] .counter { text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.counter-main { display: flex; align-items: center; justify-content: center; gap: 8px; }
.counter-icon { width: 34px; height: 34px; }
.counter .num { font-family: var(--font-serif); font-weight: 700; font-size: clamp(30px, 4.4vw, 46px); line-height: 1; font-variant-numeric: lining-nums tabular-nums; letter-spacing: .01em; }
.counter-word { font-family: var(--font-serif); font-size: 16px; font-style: italic; opacity: .92; margin-top: 2px; min-height: 1.2em; }
.counter-sub { font-size: 13.5px; opacity: .92; }
.counter-sub b { font-family: var(--font-serif); font-size: 15px; }
.buff-x { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 9px; background: #f1b52b; color: #3a2b20; font-weight: 700; font-size: 12px; text-shadow: none; }
.buff-x:empty { display: none; }
.counter-v { font-size: 13px; opacity: .9; margin-top: 3px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.counter-v [data-icon] { width: 17px; height: 17px; }
.counter-v b { font-family: var(--font-serif); }

.buffs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 26px; margin: 2px 0 4px; }
.buff {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  background: rgba(251, 246, 233, .95); color: var(--ink); border-radius: 13px; padding: 2px 9px 2px 4px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.buff [data-icon] { width: 18px; height: 18px; }
.buff.bad { background: #f3d6d0; }
.buff i { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--red); }

.desk-surface { position: relative; width: 100%; flex: 1 1 0; min-height: 190px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.tray { width: 74px; height: 92px; position: relative; flex: none; align-self: center; opacity: .95; }
.tray::before { content: ''; position: absolute; inset: 30px 0 0; border: 3px solid rgba(40,40,46,.75); border-top: none; border-radius: 0 0 8px 8px; background: repeating-linear-gradient(90deg, rgba(40,40,46,.55) 0 2px, transparent 2px 9px); }
.tray-papers { position: absolute; left: 7px; right: 7px; bottom: 6px; height: 64px; }
.tray-papers i { position: absolute; left: 0; right: 0; height: 52px; background: var(--paper); border-radius: 2px; box-shadow: 0 1px 1px rgba(0,0,0,.25); }
.tray-label { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.tray-count { position: absolute; top: 0; right: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.tray-count:empty { display: none; }

/* ---------- Die Akte ---------- */
.doc-slot { position: relative; width: min(300px, 100%); height: min(330px, 100%); min-height: 190px; flex: none; perspective: 900px; }
@container desk (max-width: 500px) { .tray { display: none; } }
.doc {
  position: absolute; inset: 0; border-radius: 4px; padding: 16px 18px 14px;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 3px 0 rgba(0,0,0,.06), 0 12px 26px rgba(0,0,0,.35);
  display: flex; flex-direction: column; gap: 6px; overflow: hidden;
  cursor: pointer; user-select: none; touch-action: manipulation;
  transition: transform .32s cubic-bezier(.3,.8,.3,1), opacity .32s;
  transform-origin: 50% 80%;
  font-family: var(--font-mono);
}
.doc:focus-visible { outline-offset: 4px; }
.doc.enter { transform: translateX(-120%) rotate(-12deg); opacity: 0; }
.doc.leave { transform: translateX(130%) translateY(-20px) rotate(14deg); opacity: 0; pointer-events: none; }
.doc.leave-back { transform: translateX(-130%) rotate(-16deg) scale(.9); opacity: 0; pointer-events: none; }
.doc.leave-miss { transform: translateY(70%) rotate(6deg); opacity: 0; pointer-events: none; }
.doc.thump { animation: thump .16s ease-out; }
@keyframes thump { 0% { transform: scale(1); } 40% { transform: scale(.985) translateY(2px); } 100% { transform: scale(1); } }
.doc.shake { animation: shake .32s; }
@keyframes shake { 20% { transform: translateX(-8px) rotate(-1deg); } 40% { transform: translateX(7px) rotate(1deg); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; font-size: 10.5px; color: var(--ink-soft); gap: 8px; border-bottom: 1px solid rgba(0,0,0,.15); padding-bottom: 6px; }
.doc-amt { font-family: var(--font-serif); font-weight: 700; color: var(--ink); font-size: 12px; letter-spacing: .02em; }
.doc-az { text-align: right; white-space: nowrap; }
.doc-kind { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-top: 4px; }
.doc-title { font-family: var(--font-serif); font-size: 18px; line-height: 1.22; font-weight: 700; color: var(--ink); }
.doc-who { font-size: 11.5px; color: var(--ink-soft); }
.doc-lines { flex: 1; display: flex; flex-direction: column; gap: 7px; padding-top: 4px; opacity: .55; }
.doc-lines i { height: 1px; background: rgba(0,0,0,.25); }
.doc-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; font-size: 10.5px; color: var(--ink-soft); min-height: 30px; }
.doc-pips { display: flex; gap: 4px; }
.doc-pips i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ink-soft); }
.doc-pips i.on { background: var(--red); border-color: var(--red); }
.doc-sticker {
  position: absolute; top: 10px; right: 10px; width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; padding: 10px; color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,.3), inset 0 0 0 3px rgba(255,255,255,.55);
  transform: rotate(8deg);
}
.doc-sticker svg { width: 34px; height: 34px; filter: drop-shadow(0 1px 0 rgba(0,0,0,.25)); }
.doc-sticker b { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%) rotate(-8deg); white-space: nowrap; font-family: var(--font-ui); font-size: 10.5px; font-weight: 700; color: var(--ink); background: var(--paper); padding: 0 5px; border-radius: 3px; box-shadow: var(--shadow-sm); }
.doc.has-sticker .doc-head { padding-right: 62px; }
.doc.has-sticker .doc-title { padding-right: 46px; }
.doc-band { margin: -16px -18px 4px; padding: 5px 18px; font-family: var(--font-ui); font-weight: 800; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #fff; display: flex; justify-content: space-between; align-items: center; }
.doc-band.eilt { background: #d6402c; }
.doc-band.wider { background: #5a4a8a; }
.doc-band.gross { background: #2f6b5a; }
.doc-timer { height: 4px; background: rgba(255,255,255,.4); border-radius: 2px; width: 90px; overflow: hidden; }
.doc-timer i { display: block; height: 100%; background: #fff; transform-origin: left; }
.doc-seq { display: flex; align-items: center; gap: 4px; font-family: var(--font-ui); font-size: 11px; }
.doc-seq span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; padding: 4px; opacity: .45; border: 2px solid transparent; }
.doc-seq span.now { opacity: 1; border-color: var(--ink); transform: scale(1.12); }
.doc-seq span.done { opacity: 1; filter: grayscale(.6); }
.doc-seq em { font-style: normal; opacity: .6; }

/* Stempelabdrücke */
.imprint {
  position: absolute; pointer-events: none; font-family: var(--font-ui); font-weight: 900; text-transform: uppercase; letter-spacing: .08em;
  border: 3px solid currentColor; border-radius: 6px; padding: 2px 8px; line-height: 1.15; text-align: center; white-space: nowrap;
  color: var(--red-ink); mix-blend-mode: multiply; opacity: 0;
  animation: imprint .28s ease-out forwards;
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 55%, rgba(0,0,0,.65) 70%, #000 85%);
          mask-image: radial-gradient(circle at 30% 40%, #000 55%, rgba(0,0,0,.65) 70%, #000 85%);
}
.imprint small { display: block; font-size: .55em; letter-spacing: .12em; font-weight: 700; }
.imprint.small { font-size: 12px; border-width: 2px; }
.imprint.big { font-size: 24px; border-width: 4px; padding: 3px 12px; }
.imprint.round { border-radius: 50%; width: 74px; height: 74px; display: grid; place-items: center; padding: 0; font-size: 12px; }
@keyframes imprint { 0% { opacity: 0; transform: var(--rot) scale(1.6); } 60% { opacity: .95; transform: var(--rot) scale(.96); } 100% { opacity: .88; transform: var(--rot) scale(1); } }

/* Stempel fliegt herab */
.stamp-ghost { position: fixed; width: 64px; height: 64px; pointer-events: none; z-index: 30; transform: translate(-50%, -100%); animation: ghost .2s ease-in forwards; }
@keyframes ghost { 0% { transform: translate(-50%, -160%) scale(1.15); opacity: .0; } 50% { opacity: 1; } 75% { transform: translate(-50%, -88%) scale(1); } 100% { transform: translate(-50%, -130%) scale(1.05); opacity: 0; } }

/* Akten je Epoche */
.doc.e0 { background: radial-gradient(ellipse at 40% 30%, #d7b48b, #b98f64 70%, #a77d53); border-radius: 26px 22px 30px 24px; font-family: var(--font-serif); color: #3e2914; box-shadow: inset 0 0 18px rgba(80,45,15,.45), 0 12px 26px rgba(0,0,0,.4); }
.doc.e0 .doc-head { border-color: rgba(62,41,20,.35); color: #5b3e22; }
.doc.e0 .doc-title { color: #3e2914; }
.doc.e0 .doc-lines { opacity: .9; }
.doc.e0 .doc-lines i { height: 9px; background: none; background-image: repeating-linear-gradient(90deg, transparent 0 4px, rgba(62,41,20,.55) 4px 5px, transparent 5px 9px, rgba(62,41,20,.45) 9px 11px, transparent 11px 16px); clip-path: polygon(0 0, 100% 40%, 100% 60%, 0 100%); }
.doc.e1 { background: linear-gradient(#5c3b21, #4a2e18); padding: 14px; border-radius: 6px; }
.doc.e1 > *:not(.doc-sticker):not(.imprint) { position: relative; }
.doc.e1::before { content: ''; position: absolute; inset: 10px; background: linear-gradient(180deg, #2f2416, #241b10); border-radius: 3px; box-shadow: inset 0 2px 6px rgba(0,0,0,.6); }
.doc.e1 .doc-head, .doc.e1 .doc-who, .doc.e1 .doc-kind, .doc.e1 .doc-foot { color: #cbb68f; border-color: rgba(203,182,143,.3); }
.doc.e1 .doc-amt, .doc.e1 .doc-title { color: #f2e6c9; font-family: var(--font-serif); letter-spacing: .03em; }
.doc.e1 .doc-title { text-transform: uppercase; font-size: 16px; }
.doc.e1 .doc-lines i { background: rgba(242,230,201,.3); }
.doc.e1 .imprint { mix-blend-mode: screen; color: rgba(255, 196, 140, .9); }
.doc.e2 { background: radial-gradient(ellipse at 50% 40%, #f4e6c4, #e4cf9d 75%, #cfb27a); font-family: var(--font-serif); border-radius: 3px 3px 10px 10px; }
.doc.e2 .doc-title { font-style: italic; }
.doc.e2::after { content: ''; position: absolute; left: 22px; bottom: 16px; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #d9443a, #8e1d16); box-shadow: 0 2px 3px rgba(0,0,0,.35); }
.doc.e2 .doc-foot { padding-left: 56px; }
.doc.e3 { background: linear-gradient(#c8d3dc, #b6c3ce); border-radius: 3px; }
.doc.e3 .doc-amt { font-variant: small-caps; font-size: 14px; }
.doc.e3 .doc-title { background: var(--paper); padding: 8px 10px; border: 1px solid rgba(0,0,0,.25); font-size: 16px; }
.doc.e3 .doc-lines { opacity: .35; }
.doc.e4 { background: linear-gradient(#f1e6c6, #e7d7ad); }
.doc.e4 .doc-title { font-family: var(--font-mono); font-weight: 700; font-size: 16px; }
.doc.e5 { background: linear-gradient(#eef1f7, #dde3ef); box-shadow: inset 22px 0 0 -18px rgba(0,0,0,.05), 0 12px 26px rgba(0,0,0,.35); padding-left: 30px; }
.doc.e5::before { content: ''; position: absolute; left: 9px; top: 20%; width: 10px; height: 60%; background: radial-gradient(circle, #6b6458 0 3.5px, transparent 4px) 0 0 / 10px 50% repeat-y; }
.doc.e5 .doc-title { color: #233a7a; font-family: var(--font-mono); font-size: 16px; }
.doc.e5 .doc-lines i { background: #8fa3d6; }
.doc.e6 { background: repeating-linear-gradient(180deg, #fff 0 22px, #e3f2e3 22px 44px); padding: 14px 30px; border-radius: 0; }
.doc.e6::before, .doc.e6::after { content: ''; position: absolute; top: 0; bottom: 0; width: 18px; background: radial-gradient(circle, #8d8a80 0 3px, transparent 3.5px) 0 0 / 18px 22px repeat-y; }
.doc.e6::before { left: 0; } .doc.e6::after { right: 0; }
.doc.e6 .doc-title { font-family: var(--font-mono); font-size: 15px; text-transform: uppercase; letter-spacing: .02em; }
.doc.e7 { padding-top: 38px; border-radius: 8px; background: #fff; }
.doc.e7::before { content: 'Antrag.pdf — Kompatibilitätsmodus'; position: absolute; top: 0; left: 0; right: 0; height: 26px; background: linear-gradient(#e9eef5, #d2dbe6); border-bottom: 1px solid #b7c3d3; font: 600 11px/26px var(--font-ui); padding-left: 52px; color: #3b4a5a; }
.doc.e7::after { content: ''; position: absolute; top: 8px; left: 10px; width: 34px; height: 10px; background: radial-gradient(circle, #e0605a 0 4px, transparent 4.5px) 0 0 / 12px 10px repeat-x; }
.doc.e7 .doc-title { font-family: var(--font-ui); font-weight: 700; }
.doc.e7 .doc-sticker { top: 34px; }
.doc.e8 { background: linear-gradient(160deg, rgba(20,60,70,.92), rgba(10,30,40,.95)); color: #c8fbff; border: 1px solid rgba(80,230,240,.5); box-shadow: 0 0 22px rgba(60,220,230,.35), inset 0 0 30px rgba(60,220,230,.15); }
.doc.e8 .doc-head, .doc.e8 .doc-who, .doc.e8 .doc-kind, .doc.e8 .doc-foot { color: #8fe6ee; border-color: rgba(80,230,240,.3); }
.doc.e8 .doc-amt, .doc.e8 .doc-title { color: #e8feff; font-family: var(--font-ui); }
.doc.e8 .doc-lines i { background: rgba(120,240,250,.35); }
.doc.e8 .imprint { mix-blend-mode: screen; color: rgba(255,120,150,.95); }
.doc.e9 { background: radial-gradient(ellipse at 30% 20%, #3a3170, #15112f 70%); color: #f2e6c9; border: 1px solid rgba(233,196,106,.6); }
.doc.e9::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(1px 1px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 70% 60%, #fff, transparent), radial-gradient(1.5px 1.5px at 40% 80%, #ffe9a8, transparent), radial-gradient(1px 1px at 85% 20%, #fff, transparent), radial-gradient(1px 1px at 10% 70%, #fff, transparent); opacity: .7; pointer-events: none; }
.doc.e9 .doc-head, .doc.e9 .doc-who, .doc.e9 .doc-kind, .doc.e9 .doc-foot { color: #cdbf9a; border-color: rgba(233,196,106,.3); }
.doc.e9 .doc-amt, .doc.e9 .doc-title { color: #f6e7b8; font-family: var(--font-serif); }
.doc.e9 .doc-lines i { background: rgba(233,196,106,.35); }
.doc.e9 .imprint { mix-blend-mode: screen; color: rgba(255,200,120,.95); }

/* ---------- Stempelleiste ---------- */
.stampbar { display: flex; justify-content: center; gap: 6px; flex-wrap: nowrap; margin-top: 6px; min-height: 8px; width: 100%; max-width: 480px; flex: none; }
.stamp-btn {
  position: relative; flex: 0 1 74px; min-width: 46px; height: 84px; border: none; background: none; padding: 0; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; touch-action: manipulation;
  transition: transform .08s;
}
.stamp-btn::before { /* Griff */
  content: ''; position: absolute; top: 2px; left: 50%; width: 26px; height: 34px; transform: translateX(-50%);
  background: radial-gradient(ellipse at 40% 25%, #b48058, #6b4429 70%); border-radius: 13px 13px 6px 6px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), 0 2px 3px rgba(0,0,0,.35);
}
.stamp-face {
  position: relative; width: 100%; height: 46px; border-radius: 6px; background: var(--rc, #555);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.25), inset 0 -4px 0 rgba(0,0,0,.25), 0 3px 5px rgba(0,0,0,.35);
  display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; gap: 1px;
}
.stamp-face [data-icon] { width: 22px; height: 22px; }
.stamp-face span { font-size: 10.5px; font-weight: 700; letter-spacing: .02em; text-shadow: 0 1px 1px rgba(0,0,0,.4); max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stamp-key { position: absolute; top: 4px; right: 6px; font: 700 10px/16px var(--font-mono); width: 16px; height: 16px; border-radius: 4px; background: rgba(251,246,233,.92); color: var(--ink); box-shadow: var(--shadow-sm); }
.stamp-btn:active, .stamp-btn.pressed { transform: translateY(4px) scale(.97); }
.stamp-btn.hint .stamp-face { box-shadow: 0 0 0 3px #f1b52b, 0 0 16px 4px rgba(241,181,43,.75), inset 0 -4px 0 rgba(0,0,0,.25); }
.stamp-btn.flash-ok .stamp-face { animation: okflash .35s; }
.stamp-btn.flash-bad .stamp-face { animation: badflash .4s; }
@keyframes okflash { 50% { filter: brightness(1.4); } }
@keyframes badflash { 25%, 75% { transform: translateX(-4px); filter: saturate(.3); } 50% { transform: translateX(4px); } }

.flow { display: flex; align-items: center; gap: 8px; width: min(440px, 100%); margin-top: 8px; font-size: 12px; font-weight: 600; }
.flow-label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.flow-label [data-icon] { width: 18px; height: 18px; }
.flow-bar { flex: 1; height: 10px; border-radius: 5px; background: rgba(255,255,255,.22); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.25); }
.flow-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #5fb3e6, #f1b52b, #e3553f); border-radius: 5px; transition: width .2s; }
.flow-text { min-width: 64px; text-align: right; font-family: var(--font-serif); }
.desk-hint { font-size: 12.5px; opacity: .85; margin: 6px 0 0; text-align: center; min-height: 1.2em; }
.mascot .desk-hint { margin: 0 0 14px; text-align: left; flex: 1; }

/* Maskottchen */
.mascot { position: relative; align-self: stretch; margin-top: auto; display: flex; align-items: flex-end; gap: 8px; z-index: 4; min-height: 50px; padding-top: 4px; }
.mascot-head { pointer-events: auto; width: 62px; height: 54px; border: none; background: none; padding: 0; flex: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); transition: transform .2s; }
.mascot-head:hover { transform: rotate(-6deg) scale(1.05); }
.mascot-bubble {
  pointer-events: auto; background: var(--paper); color: var(--ink); border-radius: 12px 12px 12px 3px; padding: 8px 12px; font-size: 13px;
  box-shadow: var(--shadow); flex: 1; margin-bottom: 12px; position: relative; animation: pop .25s; text-shadow: none; max-height: 30vh; overflow-y: auto;
}
.mascot-bubble button { margin-top: 5px; }
.mascot-bubble:not([hidden]) ~ * { display: none; }
@keyframes pop { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Bürgeranliegen am Schalter */
.anliegen-slot { position: absolute; left: 50%; top: 92px; transform: translateX(-50%); width: min(380px, calc(100% - 20px)); z-index: 6; }
.anliegen {
  background: var(--paper); color: var(--ink); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.45); overflow: hidden;
  animation: slidein .3s cubic-bezier(.3,.8,.3,1); border-top: 5px solid var(--accent);
}
@keyframes slidein { from { transform: translateY(-20px); opacity: 0; } }
.anliegen-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px 2px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.anliegen-head [data-icon] { width: 20px; height: 20px; }
.anliegen-head .anl-timer { margin-left: auto; width: 60px; height: 4px; background: var(--paper-3); border-radius: 2px; overflow: hidden; }
.anliegen-head .anl-timer i { display: block; height: 100%; background: var(--accent); }
.anliegen-text { padding: 2px 14px 8px; font-family: var(--font-serif); font-size: 15.5px; }
.anliegen-text b { font-weight: 700; }
.anliegen-opts { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 12px; }
.anliegen-res { padding: 4px 14px 12px; font-family: var(--font-serif); font-size: 14.5px; }
.anliegen-res .gains { font-family: var(--font-ui); font-size: 12.5px; color: var(--green); font-weight: 600; margin-top: 4px; }

/* ---------- Reiter & Papierflächen ---------- */
.tabs { display: flex; gap: 3px; padding: 0 8px; overflow-x: auto; scrollbar-width: none; flex: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; border: none; background: var(--folder-2); color: var(--ink); border-radius: 9px 9px 0 0; padding: 7px 11px 6px; font-weight: 600; font-size: 13px;
  display: flex; align-items: center; gap: 5px; box-shadow: inset 0 -3px 4px -2px rgba(0,0,0,.18); position: relative; top: 1px; white-space: nowrap;
}
.tab [data-icon] { width: 18px; height: 18px; }
.tab[aria-selected="true"] { background: var(--folder); box-shadow: none; z-index: 1; }
.tab .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); display: none; }
.tab.has-news .dot { display: block; }
.panel-body, .shop {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  background: var(--folder); border-radius: 10px; box-shadow: var(--shadow);
  padding: 12px; scrollbar-width: thin; scrollbar-color: var(--folder-edge) transparent;
  background-image: linear-gradient(180deg, rgba(255,255,255,.18), transparent 120px), repeating-linear-gradient(0deg, rgba(0,0,0,.012) 0 1px, transparent 1px 3px);
}
.col-panel .panel-body { border-top-left-radius: 0; }
.shop { padding-top: 10px; }
h2.sec, h3.sec { font-family: var(--font-serif); margin: 4px 0 8px; display: flex; align-items: center; gap: 8px; }
h2.sec { font-size: 19px; }
h3.sec { font-size: 15.5px; margin-top: 14px; padding-bottom: 4px; border-bottom: 1px dashed var(--folder-edge); }
.sec [data-icon] { width: 22px; height: 22px; }
.sec .right { margin-left: auto; font-family: var(--font-ui); font-size: 12px; font-weight: 600; }
.muted { color: var(--ink-soft); }
.small { font-size: 12.5px; }
p { margin: 6px 0; }
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-sm), 0 0 0 1px rgba(0,0,0,.06); padding: 10px 12px; }
.card + .card { margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }

/* Knöpfe */
.btn {
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink); border-radius: 7px; padding: 6px 12px; font-weight: 700; font-size: 13px;
  box-shadow: 0 2px 0 var(--ink); transition: transform .06s, box-shadow .06s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center;
}
.btn:hover:not(:disabled) { background: #fff; }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.primary { background: var(--red); color: #fff; border-color: #6e140f; box-shadow: 0 2px 0 #6e140f; }
.btn.primary:hover:not(:disabled) { background: #c42e25; }
.btn.blue { background: var(--blue); color: #fff; border-color: #172c5c; box-shadow: 0 2px 0 #172c5c; }
.btn.small { padding: 3px 9px; font-size: 12px; border-width: 1.5px; }
.btn.wide { width: 100%; }
.btn.opt { justify-content: flex-start; text-align: left; font-weight: 600; }
.btn [data-icon] { width: 18px; height: 18px; }
.chip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 10px; background: var(--paper-3); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.chip.ok { background: #cfe8d5; color: #1d5e33; }
.chip.warn { background: #f6dfc2; color: #7a4210; }
.chip.red { background: #f3d6d0; color: #7f1d1d; }
.chip [data-icon] { width: 14px; height: 14px; }
.cost { font-family: var(--font-serif); font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.cost [data-icon] { width: 16px; height: 16px; }
.cost.no { color: var(--red); }
.bar { height: 8px; background: rgba(0,0,0,.12); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .3s; }

/* ---------- Haushalt ---------- */
.shop-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.shop-head h2 { margin: 0; }
.amt-toggle { margin-left: auto; display: inline-flex; border: 2px solid var(--ink); border-radius: 7px; overflow: hidden; }
.amt-toggle button { border: none; background: var(--paper); padding: 3px 9px; font-weight: 700; font-size: 12.5px; }
.amt-toggle button + button { border-left: 1.5px solid var(--ink); }
.amt-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.up-list { display: flex; flex-direction: column; gap: 5px; }
.up-row {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; text-align: left; width: 100%;
  background: var(--paper); border: 1.5px solid rgba(0,0,0,.12); border-radius: 7px; padding: 5px 8px; box-shadow: var(--shadow-sm);
}
.up-row.afford { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), var(--shadow-sm); }
.up-row:not(.afford) { opacity: .78; }
.up-row:hover { background: #fff; }
.up-ic { width: 34px; height: 34px; position: relative; }
.up-ic .tierno { position: absolute; right: -4px; bottom: -3px; font: 700 9.5px/14px var(--font-ui); background: var(--ink); color: var(--paper); border-radius: 7px; padding: 0 4px; }
.up-name { display: block; font-weight: 700; font-size: 13.5px; line-height: 1.2; }
.up-desc { display: block; font-size: 12px; color: var(--ink-soft); line-height: 1.25; }
.up-more { margin-top: 6px; }
.gen-row {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left;
  background: var(--paper); border: 1.5px solid rgba(0,0,0,.12); border-radius: 8px; padding: 6px 10px 6px 8px; box-shadow: var(--shadow-sm); position: relative;
}
.gen-row + .gen-row { margin-top: 6px; }
.gen-row.afford { border-color: var(--green); }
.gen-row.afford:hover { background: #fff; transform: translateX(1px); }
.gen-row:not(.afford) .gen-cost { color: var(--red); }
.gen-row.locked { opacity: .55; filter: grayscale(.8); cursor: default; }
.gen-row.boost { box-shadow: 0 0 0 2px #f1b52b, 0 0 14px rgba(241,181,43,.6); }
.gen-ic { width: 46px; height: 46px; background: var(--paper-2); border-radius: 8px; padding: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.gen-main { min-width: 0; }
.gen-name { display: block; font-weight: 700; font-size: 14.5px; line-height: 1.15; }
.gen-meta { display: block; font-size: 11.5px; color: var(--ink-soft); line-height: 1.3; }
.gen-cost { font-family: var(--font-serif); font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 3px; margin-top: 1px; }
.gen-cost small { font-family: var(--font-ui); font-weight: 600; color: var(--ink-soft); }
.gen-cost [data-icon] { width: 15px; height: 15px; }
.gen-n { font-family: var(--font-serif); font-size: 26px; font-weight: 700; color: rgba(43,36,32,.8); min-width: 40px; text-align: right; }
.gen-info { position: absolute; right: 4px; top: 4px; width: 20px; height: 20px; border: none; background: none; padding: 1px; opacity: .55; }
.gen-info:hover { opacity: 1; }
.gen-desc { grid-column: 1 / -1; font-size: 12.5px; background: var(--paper-2); border-radius: 6px; padding: 6px 8px; margin-top: 2px; font-family: var(--font-serif); font-style: italic; }
.gen-desc .stat { font-family: var(--font-ui); font-style: normal; display: block; margin-top: 3px; color: var(--ink-soft); }
.share { display: inline-block; height: 4px; background: var(--accent); border-radius: 2px; vertical-align: middle; margin-left: 4px; }

/* ---------- Amtsstube ---------- */
.era-card { position: relative; overflow: hidden; }
.era-card .era-big { font-family: var(--font-serif); font-size: 22px; font-weight: 700; line-height: 1.1; }
.era-card .era-meta { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }
.era-card .era-text { font-family: var(--font-serif); font-size: 14.5px; }
.timeline { display: flex; gap: 3px; margin: 8px 0 4px; }
.timeline i { flex: 1; height: 6px; border-radius: 3px; background: rgba(0,0,0,.12); }
.timeline i.on { background: var(--accent); }
.timeline i.now { background: var(--red); box-shadow: 0 0 0 2px rgba(179,38,30,.25); }
.proj-card .proj-stages { display: flex; gap: 4px; margin: 6px 0; }
.proj-card .proj-stages i { flex: 1; height: 8px; border-radius: 4px; background: rgba(0,0,0,.1); }
.proj-card .proj-stages i.on { background: var(--green); }
.proj-card .proj-stages i.delay { background: repeating-linear-gradient(45deg, #e3553f 0 4px, #f1b52b 4px 8px); }
.goal-list { display: flex; flex-direction: column; gap: 6px; }
.goal { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.goal [data-icon] { width: 22px; height: 22px; }
.goal .bar { flex: 1; min-width: 60px; }

/* Paragrafen */
.para-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.para-head .stat { background: var(--paper); border-radius: 8px; padding: 6px 10px; box-shadow: var(--shadow-sm); }
.para-head .stat b { display: block; font-family: var(--font-serif); font-size: 17px; }
.para-head .stat span { font-size: 11.5px; color: var(--ink-soft); }
.para-teil { margin-top: 12px; }
.para-list { display: flex; flex-direction: column; gap: 5px; }
.para-row { display: grid; grid-template-columns: 46px 1fr auto; gap: 8px; align-items: center; background: var(--paper); border-radius: 7px; padding: 6px 9px; box-shadow: var(--shadow-sm); border-left: 4px solid var(--folder-edge); }
.para-row.owned { border-left-color: var(--green); background: #f4f8ef; }
.para-row.locked { opacity: .5; }
.para-no { font-family: var(--font-serif); font-weight: 700; font-size: 15px; }
.para-name { font-weight: 700; font-size: 13.5px; }
.para-desc { font-size: 12px; color: var(--ink-soft); }

/* Formular-Album */
.ordner { margin-top: 12px; }
.ordner-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-serif); font-weight: 700; font-size: 15px; }
.ordner-head .set { margin-left: auto; font-family: var(--font-ui); font-size: 11.5px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; margin-top: 6px; }
.form-card { position: relative; background: var(--paper); border-radius: 4px; padding: 7px 8px 8px; min-height: 76px; font-family: var(--font-serif); font-size: 12px; line-height: 1.25; box-shadow: var(--shadow-sm); border-top: 4px solid var(--rcol, #aaa); }
.form-card.missing { background: repeating-linear-gradient(135deg, rgba(0,0,0,.04) 0 6px, transparent 6px 12px), var(--paper-2); color: var(--ink-faint); display: grid; place-items: center; text-align: center; font-family: var(--font-ui); }
.form-card .rar { display: block; font-family: var(--font-ui); font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rcol); margin-bottom: 2px; }
.form-card .cnt { position: absolute; right: 5px; bottom: 3px; font: 700 10px var(--font-ui); color: var(--ink-soft); }
.form-card.new { animation: newform 1.6s ease-out; }
@keyframes newform { 0% { box-shadow: 0 0 0 4px #f1b52b; } 100% { box-shadow: var(--shadow-sm); } }
.r-g { --rcol: #7d8a94; } .r-s { --rcol: #2a62a8; } .r-a { --rcol: #8b3fb0; } .r-l { --rcol: #c98a12; }

/* Reform & Laufbahn */
.reform-box { background: var(--paper); border-radius: 10px; padding: 12px; box-shadow: var(--shadow-sm); }
.dj-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.dj-big { font-family: var(--font-serif); font-size: 28px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.dj-big [data-icon] { width: 28px; height: 28px; }
.lb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-top: 8px; }
.lb-card { text-align: left; background: var(--paper); border: 2px solid rgba(0,0,0,.12); border-radius: 9px; padding: 9px 11px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-sm); position: relative; }
.lb-card:hover:not(:disabled) { border-color: var(--ink); }
.lb-card.sel { border-color: var(--red); box-shadow: 0 0 0 2px var(--red); }
.lb-card.locked { opacity: .5; }
.lb-card .lb-name { font-family: var(--font-serif); font-size: 16px; font-weight: 700; }
.lb-card .lb-motto { font-family: var(--font-serif); font-style: italic; font-size: 12.5px; color: var(--ink-soft); }
.lb-card ul { margin: 2px 0 0; padding-left: 16px; font-size: 12px; }
.lb-card li.pro { color: #1d5e33; } .lb-card li.con { color: #7f1d1d; }
.lb-card .lb-tag { position: absolute; top: 7px; right: 8px; }
.perk-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 8px; }
.perk-col h4 { margin: 0 0 6px; font-family: var(--font-serif); font-size: 14px; }
.perk { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; background: var(--paper); border-radius: 7px; padding: 6px 9px; box-shadow: var(--shadow-sm); border-left: 4px solid var(--folder-edge); }
.perk + .perk { margin-top: 5px; }
.perk.owned { border-left-color: var(--green); background: #f4f8ef; }
.perk.locked { opacity: .5; }
.perk-name { font-weight: 700; font-size: 13px; }
.perk-desc { font-size: 11.5px; color: var(--ink-soft); }

/* Urkunden */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.ach { background: var(--paper); border-radius: 6px; padding: 6px 8px; box-shadow: var(--shadow-sm); font-size: 12px; display: grid; grid-template-columns: 26px 1fr; gap: 6px; align-items: center; }
.ach [data-icon] { width: 26px; height: 26px; }
.ach b { display: block; font-size: 12.5px; line-height: 1.2; }
.ach.off { opacity: .45; filter: grayscale(1); }
.ach.off.secret b { font-style: italic; }

/* Statistik & Optionen */
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stats-table td { padding: 4px 6px; border-bottom: 1px dotted var(--folder-edge); }
.stats-table td:last-child { text-align: right; font-family: var(--font-serif); font-weight: 700; }
.opt-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dotted var(--folder-edge); flex-wrap: wrap; }
.opt-row label { flex: 1; min-width: 160px; }
.opt-row input[type="range"] { width: 140px; accent-color: var(--red); }
.opt-row select { font: inherit; padding: 4px 6px; border-radius: 6px; border: 1.5px solid var(--ink); background: var(--paper); }
.switch { position: relative; width: 44px; height: 24px; border-radius: 12px; border: 2px solid var(--ink); background: var(--paper-3); padding: 0; flex: none; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: #fff; }
textarea.save-box { width: 100%; min-height: 90px; font: 12px var(--font-mono); border-radius: 6px; border: 1.5px solid var(--ink); padding: 6px; background: var(--paper); resize: vertical; }

/* ---------- Meldungen ---------- */
.toasts { position: fixed; right: 14px; bottom: 14px; z-index: 40; display: flex; flex-direction: column-reverse; gap: 8px; width: min(340px, calc(100vw - 28px)); pointer-events: none; }
.toast {
  pointer-events: auto; background: var(--paper); color: var(--ink); border-radius: 9px; box-shadow: 0 8px 22px rgba(0,0,0,.35); padding: 9px 12px 9px 10px;
  display: grid; grid-template-columns: 34px 1fr; gap: 9px; align-items: center; border-left: 5px solid var(--accent); animation: toastin .3s cubic-bezier(.3,.8,.3,1);
}
.toast.out { animation: toastout .3s forwards; }
@keyframes toastin { from { transform: translateX(40px); opacity: 0; } }
@keyframes toastout { to { transform: translateX(40px); opacity: 0; } }
.toast [data-icon] { width: 34px; height: 34px; }
.toast .t-kicker { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.toast .t-title { font-family: var(--font-serif); font-weight: 700; font-size: 15px; line-height: 1.2; }
.toast .t-text { font-size: 12.5px; color: var(--ink-soft); }
.toast.gold { border-left-color: var(--gold); }
.toast.green { border-left-color: var(--green); }
.toast.red { border-left-color: var(--red); }
.toast.blue { border-left-color: var(--blue); }

.floaters { position: fixed; inset: 0; pointer-events: none; z-index: 35; overflow: hidden; }
.floater { position: absolute; font-family: var(--font-serif); font-weight: 700; font-size: 17px; color: #fff; text-shadow: 0 1px 0 #000, 0 0 6px rgba(0,0,0,.6); white-space: nowrap; animation: floatup 1s ease-out forwards; transform: translate(-50%, -50%); }
.floater.big { font-size: 22px; color: #ffe08a; }
.floater.bad { color: #ffb3a8; }
.floater.v { color: #cfe3ff; font-size: 15px; }
@keyframes floatup { to { transform: translate(-50%, -150%); opacity: 0; } }

/* Der Amtsschimmel galoppiert */
.schimmel-layer { position: fixed; inset: 0; pointer-events: none; z-index: 32; overflow: hidden; }
.schimmel {
  position: absolute; width: 184px; height: 134px; pointer-events: auto; cursor: pointer; border: none; background: none; padding: 0;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.45)); animation: gallop-x var(--dur, 13s) linear forwards;
}
.schimmel.rtl { animation-name: gallop-x-rtl; }
.schimmel.rtl svg { transform: scaleX(-1); }
.schimmel svg { animation: bob .32s ease-in-out infinite alternate; overflow: visible; }
.schimmel .sch-leg { transform-box: fill-box; transform-origin: 50% 0; animation: leg .32s ease-in-out infinite alternate; }
.schimmel .sch-leg-f2, .schimmel .sch-leg-b1 { animation-direction: alternate-reverse; }
.schimmel .sch-head { transform-box: fill-box; transform-origin: 0 100%; animation: nod .32s ease-in-out infinite alternate; }
.schimmel .sch-tail { transform-box: fill-box; transform-origin: 100% 0; animation: nod .32s ease-in-out infinite alternate-reverse; }
.schimmel::after { content: 'Fang mich!'; position: absolute; top: -22px; left: 50%; transform: translateX(-50%); background: var(--paper); color: var(--ink); font: 700 12px var(--font-ui); padding: 2px 8px; border-radius: 10px; white-space: nowrap; box-shadow: var(--shadow-sm); }
.schimmel.caught { animation: caught .5s forwards; }
@keyframes gallop-x { from { left: -200px; } to { left: calc(100% + 20px); } }
@keyframes gallop-x-rtl { from { left: calc(100% + 20px); } to { left: -200px; } }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-7px); } }
@keyframes leg { from { transform: rotate(-24deg); } to { transform: rotate(24deg); } }
@keyframes nod { from { transform: rotate(-4deg); } to { transform: rotate(5deg); } }
@keyframes caught { to { transform: scale(1.5) translateY(-30px); opacity: 0; } }

/* Dialoge */
.modal-back { position: fixed; inset: 0; background: rgba(20,12,6,.6); z-index: 50; display: grid; place-items: center; padding: 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--paper); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
  padding: 18px 20px; position: relative; border-top: 6px solid var(--accent); animation: pop .25s;
}
.modal h2 { font-family: var(--font-serif); margin: 0 0 8px; font-size: 22px; }
.modal .close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: none; background: none; padding: 6px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.modal.era-modal { text-align: center; }
.modal.era-modal .era-year-big { font-family: var(--font-mono); font-size: 14px; letter-spacing: .1em; color: var(--ink-soft); }
.modal.era-modal h2 { font-size: 30px; margin: 4px 0 10px; }
.modal.era-modal .era-text { font-family: var(--font-serif); font-size: 16px; }
.modal .new-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 12px 0 4px; }
.modal .new-list span { display: flex; flex-direction: column; align-items: center; width: 92px; font-size: 11.5px; font-weight: 600; gap: 3px; text-align: center; }
.modal .new-list span [data-icon] { width: 46px; height: 46px; }

/* Finale */
.finale { position: fixed; inset: 0; z-index: 60; background: radial-gradient(ellipse at 50% 30%, #2a2458, #07061a 70%); color: #f6e7b8; display: grid; place-items: center; text-align: center; padding: 20px; animation: fade 1s; overflow-y: auto; }
.finale h2 { font-family: var(--font-serif); font-size: clamp(26px, 5vw, 44px); margin: 0 0 10px; }
.finale p { font-family: var(--font-serif); font-size: 17px; max-width: 620px; margin: 8px auto; }
.finale .big-button { width: 180px; height: 180px; border-radius: 50%; border: none; margin: 20px auto; display: block; background: radial-gradient(circle at 40% 30%, #ff6a5a, #b3261e 60%, #6e140f); box-shadow: 0 10px 0 #4a0d09, 0 18px 40px rgba(0,0,0,.6), inset 0 6px 12px rgba(255,255,255,.35); color: #fff; font: 800 20px var(--font-ui); letter-spacing: .1em; text-transform: uppercase; }
.finale .big-button:active { transform: translateY(8px); box-shadow: 0 2px 0 #4a0d09, 0 8px 20px rgba(0,0,0,.6); }
.finale .printout { width: min(340px, 90vw); margin: 10px auto; display: flex; flex-direction: column; gap: 8px; }
.finale .printout div { background: var(--paper); color: var(--ink); border-radius: 3px; padding: 12px; font-family: var(--font-mono); font-size: 13px; text-align: left; animation: printout .9s ease-out both; box-shadow: 0 6px 16px rgba(0,0,0,.5); }
@keyframes printout { from { transform: translateY(-30px); clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.finale .credits { font-size: 14px; opacity: .85; line-height: 1.7; }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: var(--paper); font: 18px var(--font-serif); padding: 20px; text-align: center; z-index: 100; }

/* Mobile Navigation */
.mobile-nav { display: none; }

/* ---------- Tablet: zwei Spalten ---------- */
@media (max-width: 1179px) {
  .layout { grid-template-columns: minmax(340px, 1fr) minmax(340px, 1fr); }
  .col-shop { display: none !important; }
  .panel-body > .shop { background: none; box-shadow: none; padding: 0; overflow: visible; }
}

/* ---------- Handy: eine Spalte, Navigation unten ---------- */
@media (max-width: 759px) {
  :root { --top-h: 50px; --ticker-h: 26px; --nav-h: 60px; }
  body { font-size: 14.5px; }
  .brand-text small, .brand-text { display: none; }
  .brand-icon { width: 30px; height: 30px; }
  .era-badge { margin-left: 0; flex: 1; align-items: flex-start; }
  .era-name { max-width: 46vw; font-size: 13px; }
  .top-mini { display: flex; }
  body[data-view="desk"] .top-mini { display: none; }
  body:not([data-view="desk"]) .era-year { display: none; }
  body:not([data-view="desk"]) .era-name { max-width: 28vw; }
  body:not([data-view="desk"]) .era-badge { flex: 0 1 auto; padding: 3px 9px; }
  .top-mini { margin-left: auto; }
  #btnOptions { display: none; }
  .icon-btn { width: 34px; height: 34px; padding: 6px; }
  .ticker { font-size: 12.5px; }
  .layout { display: block; padding: 6px; padding-bottom: calc(var(--nav-h) + 6px + env(safe-area-inset-bottom)); }
  .col { height: 100%; }
  .col-desk, .col-panel { display: none; }
  body[data-view="desk"] .col-desk { display: flex; }
  body[data-view="panel"] .col-panel { display: flex; }
  .col-panel .tabs { display: none; }
  .col-panel .panel-body { border-top-left-radius: 10px; }
  .counter .num { font-size: 34px; }
  .counter-icon { width: 28px; height: 28px; }
  .tray { display: none; }
  .doc-slot { width: min(300px, 82vw); }
  .doc-title { font-size: 16.5px; }
  .doc-lines { display: none; }
  .desk-surface { min-height: 0; }
  .stamp-btn { height: 72px; }
  .stamp-btn::before { width: 22px; height: 28px; }
  .stamp-face { height: 42px; }
  .stamp-face span { font-size: 9.5px; max-width: 52px; }
  .stamp-key { display: none; }
  .mascot-head { width: 44px; height: 38px; }
  .mascot-bubble { font-size: 12.5px; margin-bottom: 8px; }
  .anliegen-slot { top: 70px; }
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: linear-gradient(180deg, #3a2b20, #2a1f17); border-top: 3px solid var(--accent); z-index: 20;
  }
  .mobile-nav button { flex: 1; border: none; background: none; color: #f4e9d2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; font-weight: 600; position: relative; padding: 0; }
  .mobile-nav button [data-icon] { width: 26px; height: 26px; background: #f4e9d2; border-radius: 7px; padding: 2px; }
  .mobile-nav button[aria-current="true"] { background: rgba(255,255,255,.12); }
  .mobile-nav button[aria-current="true"] [data-icon] { box-shadow: 0 0 0 2px var(--accent); }
  .mobile-nav .dot { position: absolute; top: 6px; right: calc(50% - 20px); width: 9px; height: 9px; border-radius: 50%; background: #e3553f; display: none; }
  .mobile-nav .has-news .dot { display: block; }
  .toasts { bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); right: 8px; left: 8px; width: auto; }
  .lb-grid, .perk-cols { grid-template-columns: 1fr; }
  .mobile-more { display: grid !important; }
}
@media (max-height: 820px) {
  .counter { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: 8px; padding-bottom: 2px; }
  .counter-sub, .counter-v { flex-basis: 100%; }
  .counter .num { font-size: 32px; }
  .counter-icon { width: 26px; height: 26px; }
  .counter-word { margin-top: 0; }
  .counter-v small { display: none; }
  .buffs { min-height: 0; }
  .doc { padding: 12px 14px 10px; gap: 4px; }
  .doc-title { font-size: 16px; }
  .doc-lines { display: none; }
  .doc-band { margin: -12px -14px 2px; }
}
.mobile-more { display: none; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; }

/* ---------- Weniger Bewegung ---------- */
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
body.reduce-motion .schimmel { animation: none !important; left: 50% !important; top: 40% !important; transform: translateX(-50%); }
body.reduce-motion .ticker-text { transform: translate(0, -50%) !important; }
@media (prefers-reduced-motion: reduce) {
  body:not(.allow-motion) *, body:not(.allow-motion) *::before, body:not(.allow-motion) *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  body:not(.allow-motion) .schimmel { animation: none !important; left: 50% !important; top: 40% !important; transform: translateX(-50%); }
}

.up-row .up-cost { justify-self: end; }
.up-desc i { color: var(--ink-faint); }
.help details { border-bottom: 1px dotted var(--folder-edge); padding: 5px 0; }
.help details:last-child { border-bottom: none; }
.help summary { cursor: pointer; }
.help p { margin: 4px 0 2px; }
