/* ═══════════════════════════════════════════════════════════════════
   NORDSAGA – Gestaltungssystem
   Gemütliche Sagenwelt: Papier, Kiefernholz, Falunrot, Wald und See.
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --ink: #2b2320;
  --ink-soft: #5a4a40;
  --paper: #f6efe2;
  --paper-2: #efe4cf;
  --paper-3: #e4d5b8;
  --card: #fffaf0;
  --wood: #7b4f33;
  --wood-2: #a8714a;
  --wood-3: #d1a274;
  --falu: #a8322d;
  --falu-2: #c4473c;
  --forest: #2f5d3a;
  --forest-2: #44784d;
  --moss: #7d9a5a;
  --lake: #2f6584;
  --lake-2: #5d9bbb;
  --sky: #cfe6ef;
  --glass: #9fd8e0;
  --gold: #d9a441;
  --gold-2: #f0c96a;
  --snow: #fbfaf7;
  --danger: #b0322c;
  --ok: #3f7d3a;
  --shadow: 0 2px 0 rgba(43,35,32,.25), 0 6px 18px rgba(43,35,32,.12);
  --shadow-soft: 0 4px 14px rgba(43,35,32,.12);
  --q0: #7e8288;
  --q1: #3f7d3a;
  --q2: #2f68b0;
  --q3: #b9831f;
  --radius: 14px;
  --radius-sm: 9px;
  --font-display: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-w: 232px;
  --top-h: 64px;
  --bottom-h: 68px;
  --focus: 0 0 0 3px #fff, 0 0 0 6px #2f6584;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(255,255,255,.65), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(207,230,239,.55), transparent 60%),
    var(--paper);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 .8em; }
a { color: var(--lake); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 1000; }
.skip-link:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Start ───────────────────────────────────────────────────────── */
.boot { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 12px; color: var(--ink-soft); }
.boot-logo { width: 96px; height: 96px; margin: 0 auto; border-radius: 22px; background: linear-gradient(160deg, var(--falu-2), var(--falu)); box-shadow: var(--shadow); position: relative; }
.boot-logo::after { content: ""; position: absolute; inset: 22px 20px 18px; background: var(--snow); clip-path: polygon(50% 0, 100% 40%, 100% 100%, 0 100%, 0 40%); opacity: .9; }

/* ── Bedienelemente ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: .55em 1.1em; border-radius: 12px; cursor: pointer;
  border: 2px solid var(--ink); background: var(--card); color: var(--ink);
  font-weight: 650; box-shadow: 0 3px 0 var(--ink); transition: transform .06s ease, box-shadow .06s ease, background .15s;
  text-decoration: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: #fff; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: 0 3px 0 var(--ink); }
.btn-primary { background: var(--falu); color: #fff; border-color: #5e1814; box-shadow: 0 3px 0 #5e1814; }
.btn-primary:hover { background: var(--falu-2); }
.btn-green { background: var(--forest-2); color: #fff; border-color: #1d3a24; box-shadow: 0 3px 0 #1d3a24; }
.btn-green:hover { background: #4f8a58; }
.btn-gold { background: var(--gold); border-color: #6e4f12; box-shadow: 0 3px 0 #6e4f12; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: rgba(43,35,32,.06); }
.btn-sm { min-height: 36px; padding: .35em .8em; font-size: .92rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 650; font-size: .95rem; }
.field .hint { font-size: .85rem; color: var(--ink-soft); }
.input, select.input {
  min-height: 44px; padding: .55em .8em; border-radius: 10px; border: 2px solid #8c7a69; background: #fffdf8; width: 100%;
}
.input:focus { border-color: var(--lake); }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--forest-2); }
.error-text { color: var(--danger); font-weight: 600; }

.card {
  background: var(--card); border: 2px solid rgba(43,35,32,.85); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px;
}
.card-soft { background: rgba(255,250,240,.82); border: 1px solid rgba(43,35,32,.18); border-radius: var(--radius); box-shadow: var(--shadow-soft); padding: 16px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-title h2, .panel-title h3 { margin: 0; }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 650; background: var(--paper-2); border: 1px solid rgba(43,35,32,.2); }
.tag-ok { background: #dcebd5; border-color: #9cc08f; }
.tag-warn { background: #f6e3bd; border-color: #d9b46a; }
.tag-red { background: #f4d4cf; border-color: #d28b82; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.bar { height: 12px; border-radius: 999px; background: rgba(43,35,32,.12); overflow: hidden; border: 1px solid rgba(43,35,32,.25); }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--forest-2), var(--moss)); border-radius: 999px; transition: width .4s ease; }
.bar.xp > span { background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.bar.ap > span { background: linear-gradient(90deg, var(--lake), var(--lake-2)); }
.bar.hp > span { background: linear-gradient(90deg, #8f2a24, #d0503f); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .95rem; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }

/* ── App-Rahmen ──────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.sidenav {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 16px 12px 20px;
  background: linear-gradient(180deg, #3a2a20, #2a1e17); color: #f4e9d8; border-right: 3px solid #1c140f;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 6px 8px 16px; color: #fff; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-name { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: .06em; line-height: 1; }
.brand-sub { font-size: .72rem; opacity: .75; letter-spacing: .04em; }
.navlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.navlink {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 12px; border-radius: 12px;
  color: #f4e9d8; text-decoration: none; font-weight: 600; position: relative;
}
.navlink:hover { background: rgba(255,255,255,.07); }
.navlink[aria-current="page"] { background: linear-gradient(90deg, rgba(196,71,60,.9), rgba(168,50,45,.75)); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.navlink svg { width: 26px; height: 26px; flex: none; }
.navlink .badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: .78rem; font-weight: 800; display: inline-grid; place-items: center; }
.navsep { height: 1px; background: rgba(255,255,255,.12); margin: 10px 6px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; min-height: var(--top-h); display: flex; align-items: center; gap: 14px;
  padding: 8px 20px; background: rgba(246,239,226,.94); backdrop-filter: blur(6px); border-bottom: 2px solid rgba(43,35,32,.15);
}
.hero-mini { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hero-mini .portrait { width: 42px; height: 42px; border-radius: 50%; background: var(--paper-2); border: 2px solid var(--ink); overflow: hidden; flex: none; }
.hero-mini .who { min-width: 0; }
.hero-mini .name { font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22ch; }
.hero-mini .lvl { font-size: .8rem; color: var(--ink-soft); }
.hero-mini .bar { width: 140px; height: 8px; margin-top: 3px; }
.res { display: flex; gap: 10px; margin-left: auto; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 4px 12px 4px 6px; border-radius: 999px;
  background: var(--card); border: 2px solid rgba(43,35,32,.75); font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chip svg { width: 26px; height: 26px; }
.chip small { font-weight: 600; color: var(--ink-soft); }
.content { padding: 20px; max-width: 1240px; width: 100%; margin: 0 auto; flex: 1; }
.bottomnav { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidenav { display: none; }
  .topbar { padding: 6px 12px; gap: 8px; min-height: 56px; }
  .hero-mini .bar { width: 90px; }
  .hero-mini .name { max-width: 12ch; }
  .chip { min-height: 34px; padding: 2px 9px 2px 4px; }
  .chip svg { width: 22px; height: 22px; }
  .chip .lbl { display: none; }
  .content { padding: 14px 12px calc(var(--bottom-h) + 18px); }
  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    min-height: var(--bottom-h); padding-bottom: env(safe-area-inset-bottom); background: #2e2119; border-top: 3px solid #1c140f;
  }
  .bottomnav a, .bottomnav button {
    display: grid; place-items: center; gap: 2px; padding: 6px 2px; color: #f4e9d8; text-decoration: none; font-size: .72rem; font-weight: 650;
    background: none; border: 0; min-height: 56px; cursor: pointer; position: relative;
  }
  .bottomnav svg { width: 26px; height: 26px; }
  .bottomnav [aria-current="page"] { color: #fff; background: rgba(196,71,60,.55); }
  .bottomnav .badge { position: absolute; top: 4px; right: 22%; min-width: 18px; height: 18px; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: .7rem; font-weight: 800; display: grid; place-items: center; }
}
@media (max-width: 420px) {
  .hero-mini .who { display: none; }
}

/* ── Szenen (Dorfplatz, Regionen) ─────────────────────────────────── */
.scene {
  position: relative; border-radius: 18px; overflow: hidden; border: 3px solid var(--ink); box-shadow: var(--shadow);
  background: var(--sky); aspect-ratio: 16 / 8.2; min-height: 260px; container-type: inline-size;
}
.scene > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Dorfplatz (Update 03, P02): Schild = einziger sichtbarer Name, mittig auf dem gemeinsamen Anker; Größe wächst mit der Szene */
.hotspot {
  position: absolute; z-index: 3; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 5px;
  padding: .18em .7em; min-height: 28px; border-radius: 8px; border: 2px solid var(--ink); background: #f3e9d4;
  font-family: "Palatino Linotype", Georgia, serif; font-weight: 700; font-size: clamp(11px, 1.25cqw, 15px); line-height: 1.2;
  cursor: pointer; box-shadow: 0 2px 0 var(--ink); white-space: nowrap; color: var(--ink); text-decoration: none;
}
.hotspot:hover, .hotspot:focus-visible { background: #fffaf0; }
.hotspot:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.hotspot .dot { width: .6em; height: .6em; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(63,125,58,.35); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(63,125,58,.12); } }
.hit-area { position: absolute; z-index: 2; display: block; border-radius: 10px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hit-area:hover { background: rgba(255,250,240,.10); box-shadow: inset 0 0 0 2px rgba(255,250,240,.35); }
.village-hero { transform: translateX(-50%); }
.village-hero svg { display: block; }   /* keine Grundlinienlücke: Fußpunkt sitzt exakt auf dem Anker */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.place-chips { display: none; }
@media (max-width: 760px) {
  .scene-scroll { overflow-x: auto; overscroll-behavior-x: contain; border-radius: 18px; border: 3px solid var(--ink); box-shadow: var(--shadow); scrollbar-width: thin; }
  .scene-scroll .scene { width: 720px; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
  .place-chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 4px; scrollbar-width: none; }
  .place-chips .chip { flex: none; padding: 8px 14px; min-height: 40px; display: inline-flex; align-items: center; border-radius: 999px; border: 2px solid rgba(43,35,32,.45); background: var(--card); color: var(--ink); text-decoration: none; font-weight: 700; font-size: .88rem; }
}

/* ── Auswahl bei Angeboten (Update 03, P03): gewählt = leicht grün, Rahmen, Häkchen ── */
.opt { gap: 6px; text-align: left; }
.opt .opt-tick { display: inline-flex; align-items: center; justify-content: center; width: 1.25em; height: 1.25em; border-radius: 50%;
  border: 2px solid rgba(43,35,32,.35); font-weight: 900; font-size: .85em; flex: none; }
.opt.opt-on { background: #e4f1dc; border-color: var(--ok); box-shadow: 0 3px 0 #2f5d2b, inset 0 0 0 1px var(--ok); }
.opt.opt-on .opt-tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.grid > .opt { width: 100%; justify-content: flex-start; }
.start-hint { margin: 6px 0 4px; }

/* ── Auswahlliste mit Bildern (Update 03, P04/P05) ── */
.lp { position: relative; }
.lp-btn { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer; min-height: 44px; }
.lp-btn .lp-sub { display: none; }
.lp-caret { margin-left: auto; }
.lp-ico { width: 30px; height: 30px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.lp-ico svg { width: 30px; height: 30px; }
.lp-none { border: 2px dashed rgba(43,35,32,.3); border-radius: 8px; color: var(--muted); }
.lp-name { font-weight: 700; }
.lp-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; max-height: 280px; overflow-y: auto;
  background: var(--card); border: 2px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow); }
.lp-opt { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.lp-opt .lp-sub { flex-basis: 100%; padding-left: 38px; }
.lp-opt.active, .lp-opt:hover { background: rgba(217,164,65,.18); }
.lp-opt[aria-selected="true"] { background: #e4f1dc; }
.lp-check { margin-left: auto; font-weight: 900; color: var(--ok); }
.warn-text { color: #8a4b12; }

/* ── Öffentliches Heldenprofil (Update 03, P08) ── */
.profile-grid { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 14px; align-items: start; margin-top: 8px; }
@media (max-width: 520px) { .profile-grid { grid-template-columns: 1fr; } .profile-figure { max-width: 160px; margin: 0 auto; } }
.profile-figure svg { width: 100%; height: auto; display: block; overflow: visible; }
.profile-slots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.profile-slot { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 6px 8px; border-radius: 10px;
  border: 2px solid rgba(43,35,32,.25); background: var(--card); color: var(--ink); cursor: pointer; font: inherit; }
.profile-slot:hover, .profile-slot:focus-visible { border-color: var(--ink); }
.profile-slot.empty { cursor: default; border-style: dashed; }
.profile-ico { width: 36px; height: 36px; flex: none; display: inline-flex; }
.profile-ico svg { width: 36px; height: 36px; }
.profile-detail { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(43,35,32,.15); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline dotted; }

/* ── Inventar ────────────────────────────────────────────────────── */
.inv-layout { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 18px; align-items: start; }
@media (max-width: 980px) { .inv-layout { grid-template-columns: 1fr; } }
.paperdoll { display: grid; grid-template-columns: 74px 1fr 74px; gap: 8px; align-items: center; }
.paperdoll .figure { min-height: 280px; display: grid; place-items: center; }
.paperdoll .figure svg { width: 100%; max-width: 240px; max-height: 420px; height: auto; }
@media (max-width: 980px) { .paperdoll { max-width: 520px; margin-inline: auto; } .paperdoll .figure svg { max-height: 360px; } }
.paperdoll .col { display: grid; gap: 8px; }
.slotgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.slot {
  position: relative; aspect-ratio: 1; min-width: 56px; border-radius: 12px; border: 2px dashed rgba(43,35,32,.3);
  background: rgba(255,255,255,.45); display: grid; place-items: center; cursor: pointer; padding: 0;
}
.slot.filled { border-style: solid; border-color: rgba(43,35,32,.8); background: var(--card); }
.slot .slot-label { position: absolute; inset: auto 0 3px 0; text-align: center; font-size: .62rem; color: var(--ink-soft); font-weight: 700; pointer-events: none; }
.slot .ico { width: 82%; height: 82%; pointer-events: none; }
.slot .qty { position: absolute; right: 4px; bottom: 2px; font-size: .78rem; font-weight: 800; color: var(--ink); text-shadow: 0 0 3px #fff, 0 0 3px #fff; pointer-events: none; }
.slot .il { position: absolute; left: 4px; top: 2px; font-size: .68rem; font-weight: 800; color: var(--ink-soft); pointer-events: none; }
.slot.q1 { border-color: var(--q1); box-shadow: inset 0 0 0 2px rgba(63,125,58,.25); }
.slot.q2 { border-color: var(--q2); box-shadow: inset 0 0 0 2px rgba(47,104,176,.25); }
.slot.q3 { border-color: var(--q3); box-shadow: inset 0 0 0 2px rgba(185,131,31,.35), 0 0 12px rgba(240,201,106,.45); }
.slot.bound::after { content: ""; position: absolute; right: 4px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--wood-2); box-shadow: 0 0 0 2px #fff; }
.slot.locked { opacity: .55; }
.slot.locked::before { content: "🔒"; position: absolute; left: 3px; bottom: 1px; font-size: .75rem; }
.slot.selected { outline: 3px solid var(--lake); outline-offset: 2px; }
.slot.drop-ok { border-color: var(--ok); background: rgba(63,125,58,.12); border-style: solid; }
.slot.drop-no { border-color: var(--danger); background: rgba(176,50,44,.08); }
.help-q { position: relative; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; padding: 0; border-radius: 50%;
  border: 1.5px solid rgba(43,35,32,.55); background: var(--paper-2); color: var(--ink); font: 800 .75rem/1 inherit; cursor: pointer; vertical-align: middle; flex: none; }
.help-q::before { content: ''; position: absolute; inset: -10px; }   /* größere Tippfläche, Optik bleibt klein */
.help-q[aria-expanded="true"] { background: var(--lake); color: #fff; border-color: var(--lake); }
.help-pop { position: absolute; z-index: 1000; width: max-content; max-width: min(330px, calc(100vw - 24px)); background: #fffaf0; color: var(--ink);
  border: 2px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 38px 8px 14px; font-size: .88rem; line-height: 1.45; }
.help-pop p { margin: 0 0 6px; }
.help-pop .help-x { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; font-size: 1.25rem; cursor: pointer; color: var(--ink); }
.help-pop .help-x:hover, .help-pop .help-x:focus-visible { background: var(--paper-2); }
.check-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; cursor: pointer; min-height: 40px; }
.check-row input { width: 20px; height: 20px; accent-color: var(--falu); }
.split-box { margin-top: 8px; padding: 10px; border-radius: 10px; background: var(--paper-2); }
.split-box p { margin: 6px 0 0; }
/* ── Kristallkontor ───────────────────────────────────────────────── */
.shop-tabs { margin-bottom: 14px; }
.shop-card { display: grid; gap: 6px; align-content: start; }
.shop-card-off { opacity: .72; }
.shop-prev { position: relative; height: 190px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(180deg, #e3f1f4, #f3ead6); overflow: hidden; }
.shop-prev > svg { height: 100%; width: auto; }
.shop-prev-wide > svg { width: 100%; height: 100%; }
.shop-prev-empty { background: repeating-linear-gradient(45deg, var(--paper-2), var(--paper-2) 10px, #fffaf0 10px, #fffaf0 20px); }
.portrait-lg { width: 84px; height: 84px; }
.pkg-card { text-align: center; position: relative; overflow: hidden; }
.pkg-gem { position: relative; width: 110px; height: 90px; margin: 0 auto; display: grid; place-items: center; }
.pkg-gem svg { width: 64px; height: 64px; display: block; position: relative; z-index: 1; }
/* Blinken der Kristallpakete: je größer das Paket, desto mehr Funken, schneller und mit Glanz */
.pkg-sparkles { position: absolute; inset: 0; pointer-events: none; }
.pkg-spark { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; animation: pkgBlink 2s ease-in-out infinite;
  background: radial-gradient(circle, #fff 0 18%, rgba(159,216,224,.9) 30%, transparent 65%);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
@keyframes pkgBlink { 0%, 100% { opacity: .15; transform: scale(.5) rotate(0deg); } 50% { opacity: 1; transform: scale(1.25) rotate(45deg); } }
.pkg-lvl-2 .pkg-spark { width: 15px; height: 15px; margin: -7px 0 0 -7px; }
.pkg-lvl-3 .pkg-spark { width: 19px; height: 19px; margin: -9px 0 0 -9px; }
.pkg-lvl-4 .pkg-spark { width: 24px; height: 24px; margin: -12px 0 0 -12px; }
.pkg-lvl-3 .pkg-gem svg { animation: pkgGlow 1.8s ease-in-out infinite; }
.pkg-lvl-4 .pkg-gem svg { animation: pkgGlow 1.1s ease-in-out infinite; }
@keyframes pkgGlow { 50% { filter: drop-shadow(0 0 10px rgba(159,216,224,1)) drop-shadow(0 0 4px #fff); transform: scale(1.06); } }
.pkg-lvl-4::after { content: ''; position: absolute; inset: 0; pointer-events: none; animation: pkgShine 2.6s ease-in-out infinite;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%); background-size: 250% 100%; }
@keyframes pkgShine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.pkg-lvl-4 { box-shadow: 0 0 0 3px rgba(159,216,224,.6), var(--shadow); }
.reduce-motion .pkg-spark, .reduce-motion .pkg-gem svg, .reduce-motion .pkg-lvl-4::after { animation: none !important; opacity: .8; }
@media (prefers-reduced-motion: reduce) { .motion-auto .pkg-spark, .motion-auto .pkg-gem svg, .motion-auto .pkg-lvl-4::after { animation: none; opacity: .8; } }
.variant-block { margin-bottom: 18px; }
.tag.variant-niedlich { background: #fde3ec; } .tag.variant-verspielt { background: #fff1b8; } .tag.variant-boese { background: #2b2140; color: #f4efe4; }
.upg-spark { animation: twinkle 1.6s ease-in-out infinite; }
.big-num { font-size: 1.6rem; font-weight: 800; margin: 4px 0; }
.chip-nk { text-decoration: none; color: inherit; }
.tbl-wrap { overflow-x: auto; max-width: 100%; }
.grid > * { min-width: 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { text-align: left; padding: 6px 8px; border-bottom: 1px solid rgba(43,35,32,.15); }
.emote-holder { overflow: visible; }
.emote-ov { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.portrait.frame-see { box-shadow: 0 0 0 3px #f4efe4, 0 0 0 5px #5d9bbb, 0 0 0 7px #8a5a36; }
/* ── Namenseffekte (Update 03, P07): nur Farbe, die Buchstaben bleiben fest; ruhiger Verlauf, kein Flackern ──
   Alle Töne sind dunkel genug für den hellen Hintergrund; bei reduzierter Bewegung steht der Verlauf still. */
.pname-wrap { display: inline; }
.pname-tag { color: var(--muted); font-weight: 600; }
.pname-wrap .role-badge { margin-left: .4em; }
.fx { font-weight: 800; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  background-size: 300% 100%; animation: fxShift 16s linear infinite; }
@keyframes fxShift { to { background-position: 300% 0; } }
.fx-regenbogen { background-image: linear-gradient(90deg, #b03028, #a8701a, #3f7d3a, #2f6584, #6d4c9e, #b03028); animation-duration: 10s; }
.fx-nordlicht { background-image: linear-gradient(90deg, #1d6b4c, #1f7f74, #2a6f8a, #2f7f45, #1d6b4c); animation-duration: 20s; }
.fx-seeglanz { background-image: linear-gradient(90deg, #1f5a86, #2b7c9c, #4d6f86, #1c6f8c, #1f5a86); }
.fx-falunrot { background-image: linear-gradient(90deg, #8f2a22, #a8322d, #9a6a14, #a8322d, #8f2a22); }
.fx-glasmeister { background-image: linear-gradient(90deg, #5e3f94, #3a55a6, #1f7f8a, #5e3f94); }
.fx-winterlicht { background-image: linear-gradient(90deg, #2d5f88, #3d6f9a, #4a6a8c, #2f6f8a, #2d5f88); animation-duration: 22s; }
.fx-nachtglanz { background-image: linear-gradient(90deg, #1b2b55, #2b4683, #3d5fa8, #1b2b55); }
.reduce-motion .fx { animation: none; }
@media (prefers-reduced-motion: reduce) { .motion-auto .fx { animation: none; } }
/* frühere Klasse (Kompatibilität) */
.name-rainbow { font-weight: 800; }
.facade-light { animation: twinkle 2.4s ease-in-out infinite; }
.facade-light:nth-of-type(2n) { animation-delay: 1.2s; }
.look-glow { animation: twinkle 2s ease-in-out infinite; }
/* Emotes (nur Darstellung) */
.emote-sit .body-root { animation: emSit 4s ease-in-out both !important; transform-box: view-box; transform-origin: 100px 280px; }
@keyframes emSit { 12%, 88% { transform: translateY(16px) scaleY(.93); } }
.emote-nod .body-root { animation: emNod 3s ease-in-out both !important; transform-box: view-box; transform-origin: 100px 120px; }
@keyframes emNod { 30%, 60% { transform: rotate(-2.5deg) translateY(3px); } 45% { transform: rotate(-1deg) translateY(5px); } }
.emote-hop .body-root { animation: emHop 2s ease-in-out both !important; }
@keyframes emHop { 25% { transform: translateY(-8px); } 50% { transform: none; } }
.emote-sway .body-root { animation: emSway 3s ease-in-out both !important; transform-box: view-box; transform-origin: 100px 280px; }
@keyframes emSway { 25% { transform: translateX(-6px) rotate(-2deg); } 75% { transform: translateX(6px) rotate(2deg); } }
.emote-ov .em-steam { animation: emSteam 1.4s ease-in-out infinite; }
@keyframes emSteam { 50% { transform: translateY(-4px); opacity: .4; } }
.emote-ov .em-unfold { animation: emUnfold .6s ease-out both; transform-box: view-box; transform-origin: 98px 172px; }
@keyframes emUnfold { from { transform: scaleX(.1); } }
.emote-ov .em-wave { animation: emWave .5s ease-in-out 4 alternate; transform-box: view-box; transform-origin: 40px 112px; }
@keyframes emWave { to { transform: rotate(18deg); } }
.emote-ov .em-flake { animation: emFall 3s linear both; }
@keyframes emFall { from { transform: translateY(-40px); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(120px); opacity: 0; } }
.slot.target-ok { border-color: var(--ok); border-style: solid; box-shadow: inset 0 0 0 2px rgba(63,125,58,.25); }
.slot.dragging { opacity: .35; }
.slot.spoiled .ico { filter: grayscale(.8) sepia(.4); }
.slot.pending { animation: pending 1s ease-in-out infinite; }
@keyframes pending { 50% { opacity: .5; } }
.drag-ghost { position: fixed; pointer-events: none; z-index: 999; width: 64px; height: 64px; transform: translate(-50%, -50%) scale(1.08); filter: drop-shadow(0 8px 10px rgba(0,0,0,.25)); }
.inv-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.inv-toolbar .input { max-width: 220px; min-height: 40px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chips button { min-height: 36px; border-radius: 999px; border: 2px solid rgba(43,35,32,.4); background: var(--card); padding: 2px 12px; font-weight: 650; cursor: pointer; }
.filter-chips button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Detail-/Vergleichsbox */
.itemcard { display: grid; gap: 8px; }
.itemcard .head { display: flex; gap: 12px; align-items: center; }
.itemcard .head .big { width: 64px; height: 64px; flex: none; border-radius: 12px; background: var(--paper-2); border: 2px solid rgba(43,35,32,.5); display: grid; place-items: center; }
.itemcard .qn0 { color: var(--q0); } .itemcard .qn1 { color: var(--q1); } .itemcard .qn2 { color: var(--q2); } .itemcard .qn3 { color: var(--q3); }
.statline { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; font-size: .95rem; }
.delta-up { color: var(--ok); font-weight: 700; }
.delta-down { color: var(--danger); font-weight: 700; }

/* ── Taverne ─────────────────────────────────────────────────────── */
.offer { display: grid; gap: 10px; }
.offer .art { height: 120px; border-radius: 12px; overflow: hidden; border: 2px solid rgba(43,35,32,.5); background: var(--sky); }
.offer .art svg { width: 100%; height: 100%; display: block; }
.offer .meta { display: flex; gap: 8px; flex-wrap: wrap; }
.queue-item { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; background: var(--paper-2); }
.queue-item .ico { width: 48px; height: 48px; border-radius: 10px; background: var(--card); border: 2px solid rgba(43,35,32,.4); display: grid; place-items: center; }

/* ── Kampf ───────────────────────────────────────────────────────── */
.arena { position: relative; border-radius: 18px; overflow: hidden; border: 3px solid var(--ink); box-shadow: var(--shadow); aspect-ratio: 16/8; min-height: 240px; background: #cfe6ef; }
.arena > svg.bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.fighter { position: absolute; bottom: 6%; width: 30%; height: 64%; display: grid; place-items: end center; }
.fighter.left { left: 9%; }
.fighter.right { right: 9%; }
.fighter > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fighter .hpbox { position: absolute; bottom: calc(100% + 4px); left: 5%; right: 5%; z-index: 2; background: rgba(255,250,240,.92); border: 2px solid var(--ink); border-radius: 10px; padding: 4px 8px; font-size: .78rem; font-weight: 700; }
.fighter .hpbox .bar { height: 9px; margin-top: 3px; }
.fighter .hpbox .barrier { height: 5px; margin-top: 2px; background: transparent; border: 0; }
.fighter .hpbox .barrier > span { background: linear-gradient(90deg, #bfe6ee, #f4fbfd); box-shadow: 0 0 0 1px #6aaebe; }
.fighter .statuses { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; min-height: 18px; }
.fighter .statuses span { font-size: .68rem; padding: 0 6px; border-radius: 999px; background: var(--paper-2); border: 1px solid rgba(43,35,32,.35); white-space: nowrap; }
.floater { position: absolute; font-weight: 900; font-size: 1.35rem; color: #fff; -webkit-text-stroke: 1px var(--ink); paint-order: stroke; text-shadow: 0 2px 0 var(--ink); pointer-events: none; animation: floatUp 1s ease-out forwards; white-space: nowrap; }
.floater.crit { font-size: 1.8rem; color: var(--gold-2); }
.floater.heal { color: #9fe39a; }
.floater.barrier { color: #d6f3f8; font-size: 1.05rem; }
@keyframes floatUp { from { transform: translate(-50%, 0); opacity: 0; } 15% { opacity: 1; } to { transform: translate(-50%, -60px); opacity: 0; } }
.battle-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.battle-log { max-height: 280px; overflow-y: auto; font-size: .9rem; background: var(--card); border: 1px solid rgba(43,35,32,.2); border-radius: 12px; padding: 10px 12px; }
.battle-log p { margin: 0 0 4px; }
.battle-log .r { font-weight: 800; margin-top: 8px; color: var(--ink-soft); }

/* Animationen der Figuren (SVG-Gruppen) */
.anim-idle .body-root { animation: breathe 3.6s ease-in-out infinite; transform-origin: 50% 100%; transform-box: fill-box; }
@keyframes breathe { 50% { transform: scaleY(1.018) translateY(-1px); } }
.anim-attack .weapon-root { animation: swing .8s ease-in-out; transform-origin: var(--grip-x, 50%) var(--grip-y, 50%); transform-box: view-box; }
@keyframes swing { 0% { transform: rotate(0); } 35% { transform: rotate(-38deg); } 60% { transform: rotate(48deg); } 100% { transform: rotate(0); } }
.anim-lunge { animation: lunge .8s ease-in-out; }
@keyframes lunge { 40% { transform: translateX(14%); } 100% { transform: translateX(0); } }
.anim-lunge-left { animation: lungeL .8s ease-in-out; }
@keyframes lungeL { 40% { transform: translateX(-14%); } 100% { transform: translateX(0); } }
.anim-hit { animation: hit .35s ease-out; }
@keyframes hit { 30% { transform: translateX(-5%) rotate(-3deg); filter: brightness(1.6); } 100% { transform: none; filter: none; } }
.anim-hit-right { animation: hitR .35s ease-out; }
@keyframes hitR { 30% { transform: translateX(5%) rotate(3deg); filter: brightness(1.6); } 100% { transform: none; filter: none; } }
.anim-victory .body-root { animation: hop .9s ease-in-out 2; transform-origin: 50% 100%; transform-box: fill-box; }
@keyframes hop { 40% { transform: translateY(-8%); } }
.anim-defeat { animation: slump 1.2s ease-in forwards; transform-origin: 50% 100%; }
@keyframes slump { to { transform: translateY(8%) scaleY(.82) rotate(-6deg); filter: grayscale(.5); } }
.anim-cast { animation: cast .9s ease-in-out; }
@keyframes cast { 40% { filter: drop-shadow(0 0 14px rgba(159,216,224,.95)); transform: translateY(-3%); } }
.fx-projectile { position: absolute; width: 34px; height: 34px; pointer-events: none; }

/* ── Charaktererstellung ─────────────────────────────────────────── */
.creator { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .creator { display: block; } .creator > .preview-stage { margin-bottom: 16px; } }
.preview-stage { position: sticky; top: 84px; border-radius: 18px; border: 3px solid var(--ink); background: linear-gradient(180deg, #d9ecf3, #f3ead6 70%, #cdb68e); min-height: 380px; display: grid; place-items: center; overflow: hidden; box-shadow: var(--shadow); }
.preview-stage svg { width: min(78%, 300px); height: auto; }
/* Schmale Bildschirme: Vorschau bleibt als kompakter Streifen oben sichtbar, während man unten auswählt */
@media (max-width: 900px) { .preview-stage { --ps-h: clamp(190px, 30vh, 260px); top: 0; z-index: 6; min-height: 0; height: var(--ps-h); } .preview-stage svg { width: auto; height: calc(var(--ps-h) - 52px); margin-bottom: 44px; } }
.pose-tabs { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.choice {
  border: 2px solid rgba(43,35,32,.45); border-radius: 12px; background: var(--card); padding: 10px; cursor: pointer; text-align: left; min-height: 44px;
  display: grid; gap: 4px;
}
.choice .choice-art { height: 90px; }
.choice .choice-art svg { width: 100%; height: 100%; }
.choice[aria-pressed="true"] { border-color: var(--falu); box-shadow: 0 0 0 3px rgba(168,50,45,.25); background: #fff6f3; }
.choice strong { font-size: .98rem; }
.choice span { font-size: .8rem; color: var(--ink-soft); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(43,35,32,.5); cursor: pointer; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--falu), 0 0 0 6px rgba(168,50,45,.25); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper output { min-width: 4ch; text-align: center; font-weight: 750; }

/* ── Werkstatt / Rezepte ─────────────────────────────────────────── */
.recipe { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: start; padding: 12px; border-radius: 12px; background: var(--card); border: 1px solid rgba(43,35,32,.2); }
.recipe .ico { width: 56px; height: 56px; border-radius: 12px; background: var(--paper-2); border: 2px solid rgba(43,35,32,.4); display: grid; place-items: center; }
.ing { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border-radius: 999px; background: var(--paper-2); font-size: .85rem; margin: 2px 4px 2px 0; }
.ing svg { width: 22px; height: 22px; }
.ing.missing { background: #f4d4cf; }

/* ── Quests / Sagenbuch ──────────────────────────────────────────── */
.quest { border-left: 6px solid var(--wood-2); }
.quest.ready { border-left-color: var(--ok); }
.quest.done { opacity: .72; border-left-color: var(--q0); }
.quest.locked { opacity: .6; border-left-color: rgba(43,35,32,.25); }
.step { display: flex; gap: 10px; align-items: center; padding: 6px 0; }
.step .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-size: .8rem; flex: none; }
.step.done .tick { background: var(--ok); color: #fff; border-color: var(--ok); }

/* ── Modal, Toasts, Tooltips ─────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(28,20,15,.55); z-index: 200; display: grid; place-items: center; padding: 16px; animation: fade .15s ease-out; }
.modal { width: min(560px, 100%); max-height: 90vh; overflow: auto; background: var(--card); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35); padding: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 300; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
@media (max-width: 860px) { .toasts { bottom: calc(var(--bottom-h) + 12px); left: 12px; right: 12px; } }
.toast { background: var(--card); border: 2px solid var(--ink); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: flex-start; animation: slideIn .2s ease-out; }
.toast.err { border-color: var(--danger); background: #fff3f1; }
.toast.ok { border-color: var(--ok); }
@keyframes slideIn { from { transform: translateY(10px); opacity: 0; } }
.tooltip { position: fixed; z-index: 400; max-width: 300px; background: #2b2320; color: #fbf3e6; padding: 10px 12px; border-radius: 10px; font-size: .88rem; box-shadow: 0 10px 28px rgba(0,0,0,.35); pointer-events: none; }

/* ── Auth ────────────────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.2fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: #cfe6ef; }
.auth-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-art .tagline { position: absolute; left: 6%; bottom: 7%; right: 6%; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.45); }
.auth-art .tagline h1 { color: #fff; font-size: clamp(2rem, 4.4vw, 3.4rem); letter-spacing: .06em; margin: 0; }
.auth-form { display: grid; place-items: center; padding: 28px 18px; }
.auth-form .card { width: min(440px, 100%); }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-art { min-height: 34vh; } }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; background: var(--paper-2); padding: 4px; border-radius: 12px; }
.tabs button { flex: 1; min-height: 42px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--card); box-shadow: 0 1px 0 rgba(0,0,0,.15); }
.testbanner { background: #fff1c9; border: 2px dashed #c9962f; border-radius: 12px; padding: 8px 12px; font-size: .88rem; margin-bottom: 14px; }

/* ── Reduzierte Bewegung ─────────────────────────────────────────── */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
@media (prefers-reduced-motion: reduce) {
  .motion-auto *, .motion-auto *::before, .motion-auto *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}

/* ── Szenenbewegung (abschaltbar) ────────────────────────────────── */
.scene .smoke { animation: smoke 6s ease-in-out infinite; }
@keyframes smoke { 0% { opacity: .2; transform: translateY(6px) scale(.9); } 50% { opacity: 1; } 100% { opacity: .1; transform: translateY(-14px) scale(1.15); } }
.scene .shimmer { animation: shimmer 4s ease-in-out infinite; }
@keyframes shimmer { 50% { opacity: .2; transform: translateX(10px); } }
.scene .flag path { animation: flag 2.6s ease-in-out infinite; transform-origin: 3px -72px; transform-box: view-box; }
@keyframes flag { 50% { transform: skewY(-4deg) scaleX(.96); } }
.scene .boat { animation: bob 5s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }
.scene .clouds { animation: drift 60s linear infinite alternate; }
@keyframes drift { to { transform: translateX(60px); } }
.scene-prop .flame { animation: flicker 1.1s ease-in-out infinite; transform-origin: 50% 100%; transform-box: fill-box; }
@keyframes flicker { 30% { transform: scaleY(1.08) skewX(-3deg); } 60% { transform: scaleY(.94) skewX(2deg); } }
.scene-prop .sparkle { animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .25; } }
.stuga-scene { width: 100%; aspect-ratio: 16 / 7; min-height: 200px; margin-bottom: 16px; }
.stuga-scene .stuga-hero { left: 50%; bottom: 2%; width: 9%; min-width: 48px; }
.scene-hero { position: absolute; width: 11%; bottom: 3%; left: 51%; transform: translateX(-50%); pointer-events: none; }
.scene-hero svg { width: 100%; height: auto; overflow: visible; }
.anim-idle .weapon-root, .weapon-root { transform-origin: 0 0; transform-box: view-box; }
.anim-attack .weapon-root { transform-origin: 0 0; transform-box: view-box; }
.anim-walk .body-root { animation: walk .7s ease-in-out infinite; transform-origin: 50% 100%; transform-box: fill-box; }
@keyframes walk { 25% { transform: translateY(-3px) rotate(-1.5deg); } 75% { transform: translateY(-3px) rotate(1.5deg); } }
.anim-attack.anim-loop .weapon-root { animation: swing 1.4s ease-in-out infinite; }
.quest-dialog .portrait-row { display: flex; gap: 12px; align-items: center; }
.empty { text-align: center; padding: 26px 12px; color: var(--ink-soft); }
.slot { touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.slot.hover { transform: scale(1.06); }
.slot:focus-visible { box-shadow: var(--focus); }

/* ── Schmied, Bonusplätze, Mülltonne (Konzept 1.2) ─────────────────── */
.slot .up { position: absolute; right: 3px; bottom: 2px; font-size: .7rem; font-weight: 800; color: var(--ink); background: #fff8e6; border: 1px solid rgba(43,35,32,.55); border-radius: 6px; padding: 0 3px; line-height: 1.25; pointer-events: none; }
.slot .fav-star { position: absolute; right: 16px; top: 0; font-size: .8rem; color: #c8921a; text-shadow: 0 0 2px #fff, 0 0 2px #fff; pointer-events: none; }
.slot.has-bonus, .itemcard .big.has-bonus { outline: 3px solid #3d9a45; outline-offset: 1px; }
.slot.has-bonus.selected { outline-color: var(--lake); outline-width: 3px; }
.slot.up-glow .ico { filter: drop-shadow(0 0 4px rgba(240,201,106,.95)); }
.bonus-lines { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 4px; font-size: .88rem; }
.bonus-lines .bonus-on { color: #2c7a33; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.bonus-lines .bonus-on b { font-weight: 800; }
.bonus-lines .bonus-free { color: var(--ink-soft); font-style: italic; }
.trash-bin { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 12px 4px 8px; border: 2px dashed rgba(43,35,32,.45); border-radius: 12px; background: var(--paper-2); color: var(--ink); cursor: pointer; font: inherit; touch-action: none; }
.trash-bin svg { width: 28px; height: 28px; pointer-events: none; }
.trash-bin span { pointer-events: none; }
.trash-bin.drop-ok { border-style: solid; border-color: var(--danger); background: rgba(176,50,44,.1); }
.trash-bin.drop-no { opacity: .5; }
.trash-bin.hover { transform: scale(1.08); }
.trash-bin:focus-visible { box-shadow: var(--focus); }
.trash-bin .badge { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; }
.discard-note { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 10px; margin: 0 0 10px; border-radius: 10px; background: #fdf3df; border: 2px solid rgba(43,35,32,.25); }
.discard-note span { flex: 1; min-width: 140px; }
.trash-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.trash-list li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.trash-list .grow { flex: 1; min-width: 140px; }
.slot.mini { width: 48px; min-width: 48px; flex: none; cursor: default; }
.slot.mini svg { width: 82%; height: 82%; }

.smith-layout { display: grid; grid-template-columns: minmax(280px, 440px) 1fr; gap: 18px; align-items: start; }
.smith-layout > div { display: grid; gap: 16px; align-content: start; }
@media (max-width: 980px) {
  .smith-layout { grid-template-columns: 1fr; gap: 16px; }
  .smith-layout > div { display: contents; }
  .smith-layout .sm-forge { order: 1; } .smith-layout .sm-list { order: 2; } .smith-layout .smith-preview { order: 3; }
  .smith-layout .sm-bonus { order: 4; } .smith-layout .sm-mat { order: 5; } .smith-layout .sm-log { order: 6; }
}
.forge { position: relative; }
.forge-art { width: 100%; height: auto; display: block; border-radius: 16px; }
.smith-slot { position: absolute; left: 45%; top: 36%; width: 22%; min-width: 0; transform: translate(-50%, -50%); background: rgba(255,250,240,.92); cursor: default; }
.smith-slot svg { width: 82%; height: 82%; }
.smith-slot.drop-ok { border-color: var(--ok); border-style: solid; box-shadow: 0 0 0 4px rgba(63,125,58,.35); }
.smith-slot .slot-label { position: static; font-size: .66rem; padding: 4px; }
.forge-fire { transform-box: view-box; transform-origin: 257px 150px; animation: forgeFlicker 1.3s ease-in-out infinite; }
@keyframes forgeFlicker { 50% { transform: scaleY(1.08) scaleX(.96); } }
.forge-hammer { transform-box: view-box; transform-origin: 201px 98px; }
.forge.striking .forge-hammer { animation: forgeStrike .34s ease-in 2; }
@keyframes forgeStrike { 50% { transform: rotate(-30deg); } }
.forge-sparks circle { opacity: 0; transform-box: fill-box; }
.forge.win .forge-sparks circle { animation: forgeSpark .9s ease-out forwards; animation-delay: calc(var(--i) * 45ms); }
@keyframes forgeSpark { 0% { opacity: 1; transform: translate(0, 0) scale(1.4); } 100% { opacity: 0; transform: translate(calc((var(--i) - 2.5) * 12px), -34px) scale(.6); } }
.forge.miss .forge-art { animation: forgeMiss .45s ease-in-out; }
@keyframes forgeMiss { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.reduce-motion .forge-fire, .reduce-motion .forge-hammer, .reduce-motion .forge-sparks circle, .reduce-motion .forge-art { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .motion-auto .forge-fire, .motion-auto .forge-hammer, .motion-auto .forge-sparks circle, .motion-auto .forge-art { animation: none !important; } }
.smith-steps { display: flex; gap: 12px; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 800; margin: 10px 0; }
.smith-steps .grade { padding: 2px 14px; border-radius: 10px; background: var(--paper-2); border: 2px solid rgba(43,35,32,.45); }
.smith-steps .grade.next { background: #e9f5e1; border-color: var(--ok); }
.chance .meter { height: 12px; border-radius: 999px; overflow: hidden; background: var(--paper-2); border: 1px solid rgba(43,35,32,.4); margin: 4px 0 8px; }
.chance .meter span { display: block; height: 100%; background: linear-gradient(90deg, #e0b040, #3f7d3a); }
.statline.cost-miss span:last-child { color: var(--danger); font-weight: 700; }
.smith-result { padding: 8px 10px; border-radius: 10px; margin: 8px 0; font-weight: 600; }
.smith-result.ok { background: #e9f5e1; border: 2px solid var(--ok); }
.smith-result.fail { background: #f6efe4; border: 2px solid rgba(43,35,32,.35); }
.table-scroll { overflow-x: auto; }
.chance-table { border-collapse: collapse; width: 100%; font-size: .8rem; margin-top: 8px; }
.chance-table th, .chance-table td { padding: 4px 6px; text-align: center; border-bottom: 1px solid rgba(43,35,32,.15); white-space: nowrap; }
.chance-table tr.hit td { background: #fff1b8; font-weight: 800; }
.smith-log { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: .86rem; }

/* ── Auktionshaus ─────────────────────────────────────────────────── */
.auc-tabs { flex-wrap: wrap; }
.badge-inline { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: .72rem; font-weight: 800; }
.auc-filters .row { align-items: flex-end; gap: 8px; }
.auc-filters .field { margin: 0; }
.auc-filters details { margin-top: 8px; }
.auc-card { display: grid; gap: 6px; align-content: start; }
.auc-card.leading { box-shadow: 0 0 0 3px rgba(63,125,58,.45), var(--shadow); }
.auc-head { display: flex; gap: 12px; align-items: center; text-align: left; }
.auc-head .big { position: relative; width: 60px; height: 60px; flex: none; border-radius: 12px; background: var(--paper-2); border: 2px solid rgba(43,35,32,.5); display: grid; place-items: center; }
.auc-head .big.has-bonus { outline: 3px solid #3d9a45; outline-offset: 1px; }
.auc-head .big svg { width: 82%; height: 82%; }
.auc-head .big .up { position: absolute; right: 2px; bottom: 1px; font-size: .7rem; font-weight: 800; background: #fff8e6; border: 1px solid rgba(43,35,32,.55); border-radius: 6px; padding: 0 3px; }
.auc-priceblock { display: grid; gap: 2px; justify-items: start; }
.auc-price { font-size: 1.25rem; font-weight: 800; }
.tag.mode-fixed { background: #e7eef6; } .tag.mode-auction { background: #fff1b8; } .tag.mode-hybrid { background: #f6e1ec; }
.fee-box { background: var(--paper-2); border-radius: 12px; padding: 10px 12px; border: 2px solid rgba(43,35,32,.2); }
.auc-pick { max-height: 220px; overflow-y: auto; padding: 4px; }
.auc-req { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.auc-req li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.auc-req li > svg { width: 40px; height: 40px; flex: none; }
.auc-req .grow { flex: 1; min-width: 150px; }
.auc-hist td, .auc-hist th { font-size: .78rem; }
.smith-log .ev-new { font-weight: 700; }

/* ── Begleiter ────────────────────────────────────────────────────── */
.pet { width: 100%; height: auto; overflow: visible; display: block; }
.pet-pair { display: flex; gap: 8px; width: 220px; flex: none; }
.pet-pair svg { width: 50%; }
.comp-card { display: grid; gap: 6px; }
.comp-card.active { box-shadow: 0 0 0 3px rgba(63,125,58,.45); }
.comp-art { width: 120px; flex: none; }
.comp-stat { align-items: center; gap: 8px; }
.comp-stat .row .small { white-space: nowrap; }
.comp-summary { background: rgba(63,125,58,.08); border-radius: 10px; padding: 6px 8px; }
/* Dorfplatz: Tier läuft zwischen 58 % und 67 % auf dem Sandweg vor dem Helden, unter den Ortsknöpfen */
.scene-pet { position: absolute; bottom: 1.5%; left: 58%; width: 6.5%; pointer-events: none; }
.scene-pet .pet { transform-origin: 50% 100%; }
.pet-walk { animation: petWalk 22s linear infinite; }
.pet-walk .pet { animation: petFace 22s steps(1) infinite; }
.pet-walk .leg-a { animation: petStep .5s ease-in-out infinite; }
.pet-walk .leg-b { animation: petStep .5s ease-in-out infinite reverse; }
.pet-walk .pet-tail { animation: petWag .7s ease-in-out infinite; }
@keyframes petWalk { 0%, 8% { left: 59%; } 46%, 54% { left: 66%; } 92%, 100% { left: 59%; } }
@keyframes petFace { 0% { transform: scaleX(1); } 50% { transform: scaleX(-1); } }
@keyframes petStep { 0%, 100% { transform: rotate(14deg); } 50% { transform: rotate(-14deg); } }
@keyframes petWag { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(10deg); } }
.comp-art .pet-tail { animation: petWag 1.4s ease-in-out infinite; }
.reduce-motion .scene-pet, .reduce-motion .scene-pet *, .reduce-motion .comp-art .pet-tail { animation: none !important; }
.reduce-motion .scene-pet { left: 61%; }
@media (prefers-reduced-motion: reduce) {
  .motion-auto .scene-pet, .motion-auto .scene-pet *, .motion-auto .comp-art .pet-tail { animation: none !important; }
  .motion-auto .scene-pet { left: 61%; }
}

/* ── Lagerfeuer-Chat, Flaggen, Werben ──────────────────────────────── */
.campfire .fire-flames { transform-box: fill-box; transform-origin: 50% 100%; animation: forgeFlicker 1.1s ease-in-out infinite; }
.campfire .fire-sparks circle { animation: fireSpark 2.4s ease-out infinite; transform-box: fill-box; }
.campfire .fire-sparks circle:nth-child(2) { animation-delay: .8s; } .campfire .fire-sparks circle:nth-child(3) { animation-delay: 1.6s; }
@keyframes fireSpark { 0% { opacity: 0; transform: translateY(14px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px); } }
.reduce-motion .campfire * { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .motion-auto .campfire * { animation: none !important; } }
.flag-ico { width: 20px; height: 14px; vertical-align: -2px; display: inline-block; border-radius: 2px; flex: none; }
.chat-tabs { flex-wrap: wrap; }
.chat-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; margin-top: 12px; }
@media (max-width: 900px) { .chat-layout { grid-template-columns: 1fr; } }
.chat-main { display: grid; gap: 8px; }
.chat-list { height: min(58vh, 520px); overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 6px; background: var(--paper-2); border-radius: 12px; border: 2px solid rgba(43,35,32,.2); overscroll-behavior: contain; }
.chat-msg { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; padding: 4px 8px; border-radius: 10px; background: rgba(255,255,255,.7); line-height: 1.35; }
.chat-msg.mine { background: #eef6e8; }
.chat-msg.private { background: #fff7d9; border: 1px dashed rgba(43,35,32,.35); }
.chat-time { font-size: .72rem; color: var(--ink-soft); flex: none; }
.chat-name { background: none; border: 0; padding: 0; font: inherit; font-weight: 800; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.chat-name:focus-visible { box-shadow: var(--focus); border-radius: 6px; }
.chat-body { overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-body.pre { white-space: pre-line; }
.chat-form { display: flex; gap: 8px; }
.chat-form .input { flex: 1; min-width: 0; }
.chat-side { display: grid; gap: 10px; }
.chat-online { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
@media (max-width: 900px) { .chat-online:not(.open) { display: none; } }
.chat-quote { margin: 6px 0; padding: 6px 10px; border-left: 4px solid var(--falu); background: rgba(255,255,255,.7); border-radius: 6px; overflow-wrap: anywhere; }
.role-badge { font-size: .66rem; font-weight: 800; padding: 1px 6px; border-radius: 999px; color: #fff; letter-spacing: .02em; }
.role-gm { background: #2f6584; } .role-moderator { background: #3f7d3a; }
.mod-report { border-top: 1px solid rgba(43,35,32,.15); padding-top: 8px; margin-top: 8px; }
.invite-code { font-size: 2rem; font-weight: 800; letter-spacing: .18em; font-family: ui-monospace, Consolas, monospace; margin: 4px 0 10px; }
.ref-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ref-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; }
.ref-list li .small { grid-column: 1 / -1; }
fieldset.plain { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
fieldset.plain legend { padding: 0; margin-bottom: 4px; }
.lang-row { justify-content: flex-end; margin-bottom: 8px; gap: 6px; }
.lang-select { width: auto; min-height: 36px; padding: 4px 8px; }

/* Lagerfeuerenergie (Update 03, P10) */
.campfire-energy { display: grid; gap: 8px; }
.campfire-energy .cf-scene svg { display: block; width: 100%; height: auto; border-radius: 10px; }
.campfire-energy .cf-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.campfire-energy .cf-label { display: inline-flex; align-items: center; gap: 6px; }
.campfire-energy .icon-ap { width: 18px; height: 18px; }
.campfire-energy .cf-ready { color: #3f7a3a; }
.campfire-energy p { margin: 0; }

/* Postfach (Update 03, P11) */
.post-list { display: grid; gap: 6px; }
.post-row { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.55); border: 1px solid rgba(43,35,32,.12); color: inherit; text-decoration: none; }
.post-row:hover, .post-row:focus-visible { border-color: rgba(43,35,32,.35); }
.post-row.unread { border-left: 4px solid #b5453a; font-weight: 600; }
.post-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.post-who svg { width: 18px; height: 12px; vertical-align: -1px; }
.post-log { display: grid; gap: 8px; max-height: 55vh; overflow-y: auto; padding: 8px 2px; margin: 10px 0; }
.post-msg { max-width: 85%; justify-self: start; background: rgba(255,255,255,.75); border: 1px solid rgba(43,35,32,.12); border-radius: 12px 12px 12px 4px; padding: 8px 10px; }
.post-msg.mine { justify-self: end; background: #e6efe0; border-radius: 12px 12px 4px 12px; }
.post-meta { display: flex; gap: 4px; align-items: baseline; flex-wrap: wrap; opacity: .85; }
.post-meta .link-btn { margin-left: auto; }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.post-form { display: grid; gap: 6px; }
.post-input { resize: vertical; min-height: 70px; }
.chat-pm { padding: 0 6px; margin-left: 4px; }

/* Ranglisten (Update 03, P12) */
.rank-tabs { flex-wrap: wrap; }
.rank-me { margin: 10px 0; }
.rank-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
.rank-row { display: grid; grid-template-columns: 3em 1fr; gap: 2px 8px; align-items: baseline; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,.5); }
.rank-row.me { outline: 2px solid #d9a441; }
.rank-no { font-weight: 700; text-align: right; grid-row: span 2; }
.rank-main { min-width: 0; }
.rank-val { grid-column: 2; opacity: .85; }
.rank-who svg { width: 18px; height: 12px; vertical-align: -1px; }

/* Mythikpfad */
.mythic-score { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 8px 0; }
.mythic-score > div { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.55); }
.mythic-score strong { font-size: 1.25rem; }
.mythic-build { margin: 12px 0; }
.mythic-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mythic-opts { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.mythic-opt { padding: 4px 8px; border-radius: 8px; border: 1px solid rgba(43,35,32,.15); background: rgba(255,255,255,.5); cursor: pointer; }
.mythic-opt.on { border-color: #3f7a3a; background: #e6efe0; }
.mythic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.mythic-enc { display: grid; gap: 6px; }
.mythic-art { width: 64px; height: 64px; flex: none; }
.mythic-art svg { width: 100%; height: 100%; }
.mythic-skills { margin: 0; padding-left: 18px; }
.mythic-skills li.theme { color: #8a3b2e; }

/* Nordarena: gegnerischer Held schaut nach links */
.fighter.opponent-hero svg { transform: scaleX(-1); }

/* Nordarena */
.arena-match { display: grid; gap: 8px; margin-top: 8px; }
.arena-opp { display: grid; gap: 6px; }
.arena-hist { margin: 0; padding-left: 18px; display: grid; gap: 3px; }

/* Gilden */
.guild-members { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.guild-members li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.guild-role { width: auto; padding: 2px 6px; font-size: .85rem; }
.guild-project { display: grid; gap: 6px; }
.guild-good { display: grid; gap: 4px; }
.guild-invite { gap: 8px; margin: 6px 0; }

/* Spieleraufträge */
.order-card { display: grid; gap: 4px; }

/* Abzeichen */
.badge-list { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.badge-item { padding: 4px 10px; border-radius: 999px; background: rgba(217,164,65,.16); border: 1px solid rgba(217,164,65,.45); font-size: .9rem; }
.profile-badges { margin-top: 8px; }

/* Dungeons */
.dungeon-list { display: grid; gap: 8px; margin-top: 12px; }
.dungeon-card.locked { opacity: .7; }
.dungeon-card.done .dungeon-head strong { color: #3f7a3a; }
.dungeon-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; background: none; border: 0; padding: 4px 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.dungeon-dots { display: inline-flex; gap: 3px; margin-left: auto; }
.dungeon-dots .dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #2b2320; background: #fff; }
.dungeon-dots .dot.cleared { background: #3f7a3a; }
.dungeon-dots .dot.next { background: #d9a441; }
.dungeon-body { display: grid; gap: 8px; margin-top: 6px; }
.dungeon-room { display: flex; gap: 10px; align-items: flex-start; }
