/* DMBXK RPG — Rustikaler Tavernen-Look: Holz, Pergament, Kerzenlicht */
:root {
  --bg: #16100b;
  --bg2: #221610;
  --card: #2b1d12;
  --card2: #3a2817;
  --line: #6b4a2a;
  --brass: #c9963c;
  --brass2: #e8c476;
  --ember: #ff9a3c;
  --red: #c04b3a;
  --green: #8aa860;
  --blue: #6f8fa8;
  --purple: #9a7fb8;
  --text: #ecdcba;
  --muted: #b39b72;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Spectral', Georgia, 'Times New Roman', serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 50% -100px, #3a2415 0%, transparent 60%),
    radial-gradient(900px 600px at 10% 110%, #2a1608 0%, transparent 55%),
    repeating-linear-gradient(90deg, #191008 0 90px, #170e07 90px 180px),
    var(--bg);
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, #00000088 100%);
}
h1, h2, h3, .logo-title, .btn, .tab, .section-title {
  font-family: 'Cinzel', Georgia, serif;
}
.bg-grid {
  position: fixed; inset: 0; z-index: -2; opacity: .5;
  background-image: repeating-linear-gradient(0deg, #ffffff05 0 2px, transparent 2px 46px);
}
.bg-glow { position: fixed; z-index: -1; width: 560px; height: 560px; border-radius: 50%; filter: blur(130px); opacity: .22; }
.glow-a { background: var(--glowA, #ff8c2a); top: -180px; left: -140px; }
.glow-b { background: var(--glowB, #a83226); bottom: -220px; right: -160px; }

/* ---------- Farbschemata (Gold = Standard) ---------- */
body[data-theme="forest"] {
  --brass: #8aa860; --brass2: #c4e09a; --ember: #9fe08a;
  --line: #4f6134; --glowA: #5da244; --glowB: #2c4a2c;
}
body[data-theme="frost"] {
  --brass: #6f8fa8; --brass2: #c2dcf0; --ember: #8fc3e8;
  --line: #3c4e60; --glowA: #3f7ab0; --glowB: #1c2c44;
}
body[data-theme="blood"] {
  --brass: #c06a4a; --brass2: #f2ab84; --ember: #ff7a5a;
  --line: #6e3a28; --glowA: #c04b3a; --glowB: #4c1a1a;
}
body[data-theme="forest"] .btn-gold { background: linear-gradient(180deg, #a8cc7a, #4c6b35); border-color: #d8f0b0; }
body[data-theme="frost"] .btn-gold { background: linear-gradient(180deg, #9dc0d8, #3a5a76); border-color: #d0e8f8; }
body[data-theme="blood"] .btn-gold { background: linear-gradient(180deg, #e08a5a, #7e2a1e); border-color: #f8c8a8; }
body[data-theme="forest"] .logo-box { background: linear-gradient(135deg, #2c4a2c, #8aa860); }
body[data-theme="frost"] .logo-box { background: linear-gradient(135deg, #1c2c44, #6f8fa8); }
body[data-theme="blood"] .logo-box { background: linear-gradient(135deg, #4c1a1a, #c06a4a); }
.theme-dots { display: flex; gap: 6px; align-items: center; }
.theme-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--dot); border: 2px solid #00000088; cursor: pointer; padding: 0; transition: transform .12s; }
.theme-dot:hover { transform: scale(1.2); }
.theme-dot.active { border-color: #fff; box-shadow: 0 0 8px var(--dot); }

/* ---------- SVG-Bildgrößen ---------- */
.ico > svg { display: inline-block; }
.ic > svg { width: 34px; height: 34px; }
.e-icon > svg { width: 46px; height: 46px; }
.npc-icon > svg { width: 38px; height: 38px; }
.cc-icon > svg { width: 36px; height: 36px; }
.fighter .f-icon > svg { width: 48px; height: 48px; }
.eq-ic > svg { width: 44px; height: 44px; }
.det-ic > svg { width: 64px; height: 64px; }
.ico-txt { font-size: 1.35em; line-height: 1; }

/* ---------- Weltkarte ---------- */
.worldmap { position: relative; max-width: 900px; margin: 0 auto; }
.map-terrain { width: 100%; height: auto; display: block; border-radius: 12px; box-shadow: 0 10px 30px #000c; }
#mapNodes { position: absolute; inset: 0; }
.map-node { position: absolute; transform: translate(-50%, -50%); background: none; border: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0; z-index: 2; }
.map-pin { width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #4a3418, #20140a); border: 2px solid var(--brass); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px #000d; animation: pinPulse 2.6s ease-out infinite; transition: transform .15s; }
.map-pin > svg { width: 34px; height: 34px; }
.map-node:hover .map-pin { transform: scale(1.18); }
.map-node:hover { z-index: 3; }
@keyframes pinPulse { 0% { box-shadow: 0 4px 12px #000d, 0 0 0 0 #c9963c77; } 70% { box-shadow: 0 4px 12px #000d, 0 0 0 14px transparent; } 100% { box-shadow: 0 4px 12px #000d, 0 0 0 0 transparent; } }
.map-label { font-family: 'Cinzel', serif; font-size: 13px; color: #2a1c0e; background: #eedcaeee; border: 1px solid #6b4a2a; border-radius: 8px; padding: 2px 10px; text-align: center; box-shadow: 0 2px 6px #0009; white-space: nowrap; }
.map-label small { display: block; font-family: 'Spectral', serif; font-size: 11px; color: #6b4a2a; }
.map-badge { font-size: 11px; font-weight: 700; background: #2c4a2c; color: #dff0c8; border: 1px solid #7ba05b; border-radius: 12px; padding: 1px 9px; animation: bump 1.2s ease infinite; }
.map-badge.dim { background: #3a2c17; color: var(--brass2); border-color: var(--line); animation: none; }
.map-back { margin-top: 8px; }

/* ---------- Inventar-Overhaul ---------- */
.equip-slot { display: flex; gap: 12px; align-items: center; }
.equip-slot.filled { border-color: var(--brass); }
.eq-ic.empty { width: 44px; text-align: center; color: var(--muted); font-size: 24px; }
.eq-info { flex: 1; font-size: 14px; }
.eq-score { color: var(--muted); font-size: 12px; }
.inv-detail { display: flex; gap: 14px; background: linear-gradient(180deg, #33240f, #241811); border: 1px solid var(--brass); border-radius: 10px; padding: 14px; margin-bottom: 14px; box-shadow: 0 6px 18px #000a; animation: popIn .25s ease; }
.det-info { flex: 1; font-size: 14px; }
.det-info h4 { margin: 0 0 6px; font-size: 17px; color: var(--brass2); }
.inv-card { cursor: pointer; }
.inv-card.selected { border-color: var(--brass2); box-shadow: 0 0 14px #c9963c55; }
.inv-card.equipped { border-color: var(--green); }
.craft-cost { font-size: 13px; margin: 6px 0; line-height: 1.7; }
.craft-cost svg { width: 1.1em; height: 1.1em; vertical-align: -0.15em; }

/* ---------- Start ---------- */
.start-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.start-card {
  max-width: 760px; width: 100%;
  background: linear-gradient(180deg, #33220f 0%, #2b1d12 100%);
  border: 2px solid var(--line); outline: 1px solid #2a1c0e; outline-offset: 4px;
  border-radius: 10px; padding: 36px; text-align: center;
  box-shadow: 0 10px 50px #000c, inset 0 1px 0 #ffffff14;
}
.start-eyebrow { color: var(--brass2); letter-spacing: 3px; font-size: 14px; }
.start-card h1 { font-size: clamp(28px, 5vw, 46px); margin: 10px 0; text-shadow: 0 2px 0 #000; }
.gold-text { color: var(--brass2); }
.gold { color: var(--brass2); }
.start-sub { color: var(--muted); max-width: 600px; margin: 0 auto 18px; }
#heroName {
  width: 100%; max-width: 340px; padding: 12px 14px; font-size: 18px; border-radius: 8px;
  border: 1px solid var(--line); background: #120c07; color: var(--text); text-align: center;
  font-family: 'Spectral', serif; margin-bottom: 16px;
  box-shadow: inset 0 2px 6px #000;
}
.class-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.class-card {
  border: 1px solid var(--line); border-radius: 8px; padding: 14px 10px; cursor: pointer;
  background: linear-gradient(180deg, #2e2013, #241811); transition: transform .08s, border-color .08s;
  box-shadow: inset 0 1px 0 #ffffff0d;
}
.class-card:hover { transform: translateY(-2px); }
.class-card.sel { border-color: var(--brass); box-shadow: 0 0 14px #c9963c55, inset 0 1px 0 #ffffff14; }
.class-card .cc-icon { font-size: 34px; }
.class-card h3 { margin: 6px 0 4px; font-size: 16px; color: var(--brass2); }
.class-card p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.continue-info { background: #120c07; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 14px; }

/* ---------- Topbar / HUD ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 10px 18px;
  background: linear-gradient(180deg, #2e2013 0%, #1d130b 100%);
  border-bottom: 2px solid var(--line);
  box-shadow: 0 4px 14px #000a;
  position: sticky; top: 0; z-index: 50; flex-wrap: wrap;
}
.logo { display: flex; gap: 10px; align-items: center; }
.logo-box {
  width: 42px; height: 42px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 24px; background: linear-gradient(135deg, #5a3a1c, #c9963c);
  border: 1px solid var(--brass2); box-shadow: 0 2px 6px #000;
}
.logo-title { font-weight: 800; letter-spacing: 2px; color: var(--brass2); text-shadow: 0 2px 0 #000; }
.logo-sub { font-size: 12px; color: var(--muted); }
.hero-bar { flex: 1; min-width: 260px; }
.hero-line { font-size: 15px; margin-bottom: 4px; }
.bars { display: flex; gap: 8px; flex-wrap: wrap; }
.bar { position: relative; height: 18px; background: #0e0805; border: 1px solid #4a3018; border-radius: 9px; overflow: hidden; flex: 1; min-width: 130px; box-shadow: inset 0 2px 5px #000; }
.bar .fill { height: 100%; width: 100%; transition: width .6s ease; }
.bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #ffe9c4; text-shadow: 0 1px 2px #000; }
.bar.hp .fill { background: linear-gradient(180deg, #d0684f, #7e2a1e); }
.bar.mana .fill { background: linear-gradient(180deg, #7fa6c4, #2e4d68); }
.bar.stam .fill { background: linear-gradient(180deg, #e8c476, #8a5f1e); }
.bar.xp .fill { background: linear-gradient(180deg, #b39ddb, #4c3573); }
.bar.foe-bar .fill { background: linear-gradient(180deg, #d0684f, #5e1a12); }
.xp-line { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.xp-line .bar { height: 10px; }
.wallet { display: flex; gap: 8px; align-items: center; }
.sp-chip { background: #120c07; border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px; font-size: 14px; box-shadow: inset 0 1px 3px #000; }

/* ---------- Tabs (Holztafeln) ---------- */
.tabs { display: flex; gap: 6px; padding: 10px 18px; flex-wrap: wrap; background: #140d08; border-bottom: 1px solid #3a2614; position: sticky; top: 73px; z-index: 40; }
.tab {
  background: linear-gradient(180deg, #3a2a16, #2a1d10); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px 6px 0 0;
  padding: 8px 14px; cursor: pointer; font-size: 13px; letter-spacing: .5px;
  box-shadow: inset 0 1px 0 #ffffff12;
}
.tab.active { border-color: var(--brass); color: var(--brass2); background: linear-gradient(180deg, #4a3418, #33240f); box-shadow: 0 -2px 10px #c9963c33; }
.tab:hover { border-color: var(--brass); }

.container { max-width: 1100px; margin: 0 auto; padding: 20px 18px 60px; }
.hidden { display: none !important; }
.hero { text-align: center; margin: 10px 0 18px; }
.hero h1 { font-size: clamp(24px, 4vw, 38px); margin: 6px 0; text-shadow: 0 3px 0 #000, 0 0 24px #ff9a3c22; }
.hero p { color: var(--muted); max-width: 700px; margin: 0 auto; font-style: italic; }
.section-title { font-size: 16px; letter-spacing: 1px; color: var(--brass2); margin: 22px 0 10px; text-shadow: 0 2px 0 #000; border-bottom: 1px solid #3a2614; padding-bottom: 6px; }
.section-title span { color: var(--ember); }
.inv-value { color: var(--muted); font-size: 13px; }

/* ---------- NPC (Pergament-Notiz) ---------- */
.npc {
  display: flex; gap: 12px; align-items: flex-start;
  background: linear-gradient(180deg, #463420, #382917);
  border: 1px solid #8a6a3a; border-left: 4px solid var(--brass);
  border-radius: 4px 10px 10px 4px; padding: 12px 14px; margin-bottom: 14px;
  box-shadow: 0 4px 12px #0009, inset 0 1px 0 #ffffff14;
}
.npc .npc-icon { font-size: 36px; filter: drop-shadow(0 2px 2px #000); }
.npc .npc-name { font-family: 'Cinzel', serif; color: var(--brass2); font-size: 14px; }
.npc .npc-text { font-style: italic; color: var(--text); font-size: 15px; }

/* ---------- Cards / grids ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } .tabs { top: auto; } }
.quest, .enemy-card, .skill-card, .listing, .payout-box, .stat-box, .equip-slot {
  background: linear-gradient(180deg, #31220f 0%, #2b1d12 100%);
  border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px;
  box-shadow: 0 4px 10px #0008, inset 0 1px 0 #ffffff0d;
}
.quest h4, .enemy-card h4 { margin: 0 0 4px; font-size: 16px; color: var(--brass2); }
.quest .q-reward { color: var(--brass2); font-size: 14px; }
.quest .q-progress { color: var(--blue); font-size: 14px; }
.quest.done { border-color: var(--green); }
.enemy-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.enemy-card { display: flex; gap: 12px; align-items: center; }
.enemy-card .e-icon { font-size: 44px; filter: drop-shadow(0 2px 2px #000); }
.enemy-card .e-info { flex: 1; font-size: 14px; color: var(--muted); }
.enemy-card.boss { border-color: var(--red); box-shadow: 0 0 14px #c04b3a44, inset 0 1px 0 #ffffff0d; }

.inventory { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.inv-card { background: linear-gradient(180deg, #31220f, #251811); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 14px; box-shadow: 0 3px 8px #0008; cursor: pointer; }
/* Kompakte Inventar-Toolbar + Chips */
.inv-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.inv-count { font-family: 'Cinzel', serif; font-weight: 700; color: var(--brass2); font-size: 14px; white-space: nowrap; }
.inv-count svg { width: 1.1em; height: 1.1em; vertical-align: -0.15em; }
.inv-filters { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  font-family: 'Spectral', serif; font-size: 12px; padding: 2px 11px; border-radius: 12px;
  background: #120c07; color: var(--muted); border: 1px solid var(--line); cursor: pointer;
}
.chip:hover { border-color: var(--brass); color: var(--text); }
.chip.active { background: linear-gradient(180deg, #e0aa4e, #8a5f1e); color: #1d1206; border-color: #f0d090; font-weight: 700; }
.bar.slim { height: 7px; min-width: 0; margin-bottom: 10px; }
.bar.slim .xp-fill { background: linear-gradient(90deg, #5b2d91, var(--purple)); }
/* Slot-Raster im Minecraft/DayZ-Stil */
.slot-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
@media (max-width: 700px) { .slot-grid { grid-template-columns: repeat(6, 1fr); } }
.slot {
  position: relative; aspect-ratio: 1/1; border-radius: 6px; cursor: pointer;
  background: linear-gradient(180deg, #17100a, #0e0805);
  border: 1px solid #000;
  box-shadow: inset 2px 2px 0 #ffffff10, inset -2px -2px 0 #00000088, inset 0 0 0 1px #4a3018;
  display: flex; align-items: center; justify-content: center;
  transition: transform .1s, box-shadow .15s;
}
.slot > svg { width: 72%; height: 72%; filter: drop-shadow(0 2px 2px #000); }
.slot.empty { cursor: default; opacity: .55; }
.slot:not(.empty):hover { transform: scale(1.1); z-index: 2; }
.slot.selected { box-shadow: inset 2px 2px 0 #ffffff10, inset -2px -2px 0 #00000088, 0 0 0 2px var(--brass2), 0 0 12px #c9963c66; }
.slot.equipped { box-shadow: inset 2px 2px 0 #ffffff10, inset -2px -2px 0 #00000088, 0 0 0 2px var(--green); }
.slot.locked > svg { filter: grayscale(.7) brightness(.75); }
.slot.r-common { box-shadow: inset 2px 2px 0 #ffffff10, inset -2px -2px 0 #00000088, inset 0 0 0 1px #4a3018, inset 0 -3px 0 #8a7a5c88; }
.slot.r-magic { box-shadow: inset 2px 2px 0 #ffffff10, inset -2px -2px 0 #00000088, inset 0 0 0 1px #4a3018, inset 0 -3px 0 #6f8fa8; }
.slot.r-rare { box-shadow: inset 2px 2px 0 #ffffff10, inset -2px -2px 0 #00000088, inset 0 0 0 1px #4a3018, inset 0 -3px 0 #9a7fb8; }
.slot.r-epic { box-shadow: inset 2px 2px 0 #ffffff10, inset -2px -2px 0 #00000088, inset 0 0 0 1px #4a3018, inset 0 -3px 0 #d07f3a; }
.slot.r-legendary { box-shadow: inset 2px 2px 0 #ffffff10, inset -2px -2px 0 #00000088, inset 0 0 0 1px #4a3018, inset 0 -3px 0 var(--brass2), 0 0 8px #c9963c44; }
.slot-qty { position: absolute; right: 3px; bottom: 1px; font-size: 12px; font-weight: 700; color: #ffe9c4; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.slot-plus { position: absolute; left: 3px; top: 1px; font-size: 11px; font-weight: 700; color: var(--brass2); text-shadow: 0 1px 2px #000; }
.slot-eq { position: absolute; right: 3px; top: 1px; font-size: 10px; font-weight: 700; color: var(--green); text-shadow: 0 1px 2px #000; }
.backpack-bar .bar { margin: 6px 0; }
/* ---------- Die Tiefen (Roguelike) ---------- */
.prestige-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 8px; }
.relic-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; font-size: 13px; color: var(--muted); }
.relic { display: inline-flex; align-items: center; gap: 4px; background: #120c07; border: 1px solid var(--purple); border-radius: 14px; padding: 2px 10px 2px 4px; color: var(--text); }
.relic svg { width: 1.3em; height: 1.3em; }
.draft-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 8px; }
.draft-card { background: linear-gradient(180deg, #31220f, #251811); border: 1px solid var(--purple); border-radius: 10px; padding: 12px; cursor: pointer; color: var(--text); font-family: 'Spectral', serif; transition: transform .12s, box-shadow .15s; }
.draft-card:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 8px 20px #000c, 0 0 16px #9a7fb866; }
.draft-card .ic > svg { width: 44px; height: 44px; }
.draft-card h4 { margin: 6px 0 4px; font-size: 15px; color: var(--brass2); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 8px 0; }
.run-status .bar { margin: 8px 0; }
/* Angelegt-Leiste über dem Rucksack */
.worn-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 6px; }
.slot.worn { border-color: var(--green); }
.slot.worn.empty { cursor: default; }
.worn-label { font-size: 11px; color: var(--muted); font-family: 'Cinzel', serif; }
.inv-card .ic { font-size: 30px; }
.inv-card h4 { margin: 4px 0; font-size: 14px; color: var(--text); }
.inv-card .wear { color: var(--muted); font-size: 12px; }
.inv-card .price { color: var(--brass2); font-weight: 700; }
.inv-card .row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.r-common { border-left: 4px solid #8a7a5c; }
.r-magic { border-left: 4px solid var(--blue); }
.r-rare { border-left: 4px solid var(--purple); }
.r-epic { border-left: 4px solid #d07f3a; }
.r-legendary { border-left: 4px solid var(--brass2); box-shadow: 0 0 12px #c9963c44; }
.r-tag { font-size: 11px; padding: 1px 8px; border-radius: 10px; background: #120c07; border: 1px solid var(--line); color: var(--muted); }

/* ---------- Buttons (geschnitztes Holz / Messing) ---------- */
.btn {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 16px; cursor: pointer;
  font-size: 13px; letter-spacing: .5px; color: var(--text);
  background: linear-gradient(180deg, #4a3418, #33240f);
  box-shadow: 0 3px 6px #0009, inset 0 1px 0 #ffffff1a;
  text-shadow: 0 1px 2px #000;
}
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 3px #0009; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-gold { background: linear-gradient(180deg, #e0aa4e, #8a5f1e); color: #1d1206; border-color: #f0d090; font-weight: 700; text-shadow: none; }
.btn-cyan { background: linear-gradient(180deg, #7fa6c4, #3a5a76); color: #f2e8d0; border-color: #9dc0d8; font-weight: 700; }
.btn-ghost { background: transparent; box-shadow: none; }
.btn.big { font-size: 16px; padding: 13px 26px; }
.btn.small { font-size: 12px; padding: 6px 10px; }
.shop-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.market-tabs { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.listing { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.listing .l-info { flex: 1; min-width: 200px; }
.opener-info { color: var(--muted); font-size: 14px; margin: 10px 0; font-style: italic; }

/* ---------- Combat ---------- */
.combat-wrap {
  position: fixed; inset: 0; z-index: 100; background: #0d0705f2;
  display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto;
}
.combat-card { width: 100%; max-width: 760px; background: linear-gradient(180deg, #33240f, #241811); border: 2px solid var(--brass); border-radius: 10px; padding: 18px; box-shadow: 0 0 40px #000, 0 0 60px #ff9a3c11; }
.combat-top { display: flex; justify-content: space-between; font-family: 'Cinzel', serif; color: var(--brass2); margin-bottom: 10px; }
.fighters { display: grid; grid-template-columns: 1fr 60px 1fr; gap: 8px; align-items: start; }
.fighter { background: #120c07; border: 1px solid var(--line); border-radius: 8px; padding: 10px; text-align: center; box-shadow: inset 0 2px 8px #000; }
.fighter .f-icon { font-size: 46px; filter: drop-shadow(0 2px 3px #000); }
.fighter .f-name { font-weight: 700; margin-bottom: 6px; color: var(--brass2); }
.fighter .bar { margin-bottom: 5px; min-width: 0; }
.vs { font-size: 30px; text-align: center; padding-top: 40px; }
.fx { min-height: 20px; font-size: 12px; color: var(--purple); }
.combat-log {
  height: 170px; overflow-y: auto; background: #0e0805; border: 1px solid #4a3018;
  border-radius: 8px; padding: 10px; margin: 12px 0; font-size: 14px; line-height: 1.5;
  box-shadow: inset 0 2px 8px #000;
}
.combat-log .dmg { color: #e08a7a; } .combat-log .heal { color: var(--green); }
.combat-log .mana { color: var(--blue); } .combat-log .sys { color: var(--brass2); }
.combat-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.combat-end { text-align: center; margin-top: 12px; font-size: 18px; }
.price-input { width: 110px; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: #120c07; color: var(--text); box-shadow: inset 0 2px 5px #000; }

/* ---------- Modal / Toast / Tables ---------- */
.modal { position: fixed; inset: 0; z-index: 200; background: #000c; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { background: linear-gradient(180deg, #3a2a14, #2b1d12); border: 2px solid var(--brass); border-radius: 10px; padding: 22px; max-width: 560px; width: 100%; max-height: 85vh; overflow-y: auto; box-shadow: 0 10px 40px #000; }
.win-eyebrow { color: var(--brass2); letter-spacing: 2px; font-size: 13px; margin-bottom: 8px; }
.win-buttons { display: flex; gap: 10px; margin-top: 14px; }
.toast-wrap { position: fixed; bottom: 18px; right: 18px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { background: linear-gradient(180deg, #3a2a14, #2b1d12); border: 1px solid var(--brass); border-radius: 8px; padding: 10px 14px; font-size: 14px; box-shadow: 0 4px 18px #000c; }
.hs-submit { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.hs-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.hs-table th, .hs-table td { padding: 9px 10px; border-bottom: 1px solid #3a2614; text-align: left; }
.hs-table th { color: var(--brass2); font-family: 'Cinzel', serif; font-size: 13px; }
.hs-table tr.me td { color: var(--brass2); font-weight: 700; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; font-size: 14px; }
.stat-grid b { color: var(--brass2); }
.skill-card.locked { opacity: .65; }
.food-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; border-top: 1px solid #3a2614; font-style: italic; }

/* ================= ANIMATIONEN & EFFEKTE ================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
#embers { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.ico > svg, .gain-pop svg { width: 1.15em; height: 1.15em; vertical-align: -0.18em; }
.glow-a { animation: flicker 4.5s ease-in-out infinite; }
.glow-b { animation: flicker 6s ease-in-out infinite reverse; }
@keyframes flicker { 50% { opacity: .32; } }

/* Kampf-Schauplatz */
.fighters { position: relative; }
.fx-layer { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 5; }
.fighter.foe .f-icon { animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.fighter.lunge-r .f-icon { animation: lungeR .35s ease; }
.fighter.lunge-l .f-icon { animation: lungeL .35s ease; }
@keyframes lungeR { 30% { transform: translateX(26px) scale(1.18); } }
@keyframes lungeL { 30% { transform: translateX(-26px) scale(1.18); } }
.fighter.shake { animation: shake .4s ease; }
@keyframes shake { 20% { transform: translate(-5px, 2px); } 40% { transform: translate(5px, -3px); } 60% { transform: translate(-4px, -2px); } 80% { transform: translate(3px, 2px); } }
.fighter .f-icon.hitflash { animation: hitflash .4s ease; }
@keyframes hitflash { 30% { filter: brightness(2.2) saturate(.3) drop-shadow(0 0 14px #ff5a3c); } }
.combat-card.shake { animation: bigshake .45s ease; }
@keyframes bigshake { 20% { transform: translate(-7px, 3px); } 40% { transform: translate(7px, -4px); } 60% { transform: translate(-5px, -3px); } 80% { transform: translate(4px, 3px); } }

/* Hochfliegende Zahlen & Partikel */
.float-txt {
  position: absolute; font-family: 'Cinzel', serif; font-weight: 700; font-size: 20px;
  white-space: nowrap; text-shadow: 0 2px 3px #000, 0 0 10px currentColor;
  animation: floatUp 1.15s ease-out forwards;
}
.float-txt.dmg { color: #ff9d7a; }
.float-txt.crit { color: #ffd75e; font-size: 29px; }
.float-txt.heal { color: #9fe08a; }
.float-txt.gold { color: #ffd75e; }
.float-txt.xp { color: #c9a6ff; font-size: 17px; }
.float-txt.mana { color: #8fc3e8; font-size: 16px; }
@keyframes floatUp {
  0% { transform: translate(-50%, 0) scale(.7); opacity: 0; }
  15% { opacity: 1; transform: translate(-50%, -12px) scale(1.15); }
  100% { transform: translate(-50%, -72px) scale(1); opacity: 0; }
}
.particle { position: absolute; width: 8px; height: 8px; border-radius: 50%; pointer-events: none; animation: particleFly .65s ease-out forwards; }
@keyframes particleFly { to { transform: translate(var(--dx, 0px), var(--dy, -50px)) scale(.2); opacity: 0; } }

/* +Gold/+XP-Popups oben rechts */
.gain-layer { position: fixed; top: 118px; right: 16px; z-index: 90; pointer-events: none; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.gain-pop {
  background: linear-gradient(180deg, #3a2a14, #2b1d12); border: 1px solid var(--brass);
  border-radius: 20px; padding: 5px 14px; font-family: 'Cinzel', serif; font-size: 14px; color: var(--brass2);
  box-shadow: 0 4px 14px #000c; animation: gainIn 2.2s ease forwards;
}
@keyframes gainIn {
  0% { transform: translateX(50px); opacity: 0; }
  12% { transform: none; opacity: 1; }
  78% { opacity: 1; }
  100% { transform: translateY(-16px); opacity: 0; }
}
.bump { animation: bump .5s ease; display: inline-block; }
@keyframes bump { 30% { transform: scale(1.3); } }

/* Warnpuls bei wenig HP */
.bar.hp.low { border-color: var(--red); }
.bar.hp.low .fill { animation: lowpulse 1s ease-in-out infinite; }
@keyframes lowpulse { 50% { filter: brightness(1.5); } }

/* Weiche Übergänge überall */
main section.view-enter { animation: viewIn .35s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } }
.modal-card { animation: popIn .32s cubic-bezier(.2, 1.4, .4, 1); }
.combat-card { animation: popIn .3s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes popIn { from { transform: scale(.86); opacity: 0; } }
.toast { animation: toastIn .25s ease; }
@keyframes toastIn { from { transform: translateX(30px); opacity: 0; } }
.btn { transition: filter .15s, transform .08s; }
.combat-actions .btn:active:not(:disabled) { transform: scale(.93); }
.tab { transition: border-color .2s, box-shadow .2s, filter .15s; }
.inv-card, .quest, .enemy-card, .skill-card, .listing { transition: transform .15s, box-shadow .2s; }
.inv-card:hover, .quest:hover, .skill-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px #000a, inset 0 1px 0 #ffffff0d; }
.class-card { transition: transform .15s, border-color .15s, box-shadow .2s; }

/* ---------- Customizer (Portrait, Titel, Banner) ---------- */
.look-label { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 8px 0 14px; }
@media (max-width: 560px) { .avatar-grid { grid-template-columns: repeat(4, 1fr); } }
.avatar-pick {
  font-size: 30px; text-align: center; padding: 6px 0; cursor: pointer;
  background: #120c07; border: 1px solid var(--line); border-radius: 8px;
  transition: transform .12s, border-color .12s, box-shadow .15s;
}
.avatar-pick:hover { transform: translateY(-2px); }
.avatar-pick.sel { border-color: var(--brass); box-shadow: 0 0 10px #c9963c66; background: #2a1d0e; }
.look-row { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.look-row select, .chat-row input, .chat-row select {
  flex: 1; min-width: 140px; padding: 9px 11px; border-radius: 8px;
  border: 1px solid var(--line); background: #120c07; color: var(--text);
  font-family: 'Spectral', serif; font-size: 14px; box-shadow: inset 0 2px 5px #000;
}
.banner-rot { color: #ff9d8a; } .banner-blau { color: #8fc3e8; }
.banner-grün { color: #9fe08a; } .banner-gold { color: var(--brass2); }
.banner-lila { color: #c9a6ff; } .banner-schwarz { color: #cfc8b4; }

/* ---------- Chat ---------- */
.chat-box {
  height: 220px; overflow-y: auto; background: #0e0805; border: 1px solid #4a3018;
  border-radius: 8px; padding: 10px; margin-bottom: 8px; box-shadow: inset 0 2px 8px #000;
  font-size: 14px; line-height: 1.5;
}
.chat-msg { margin-bottom: 5px; }
.chat-msg b { color: var(--brass2); margin-right: 6px; }
.chat-msg.me b { color: var(--ember); }
.chat-empty { color: var(--muted); font-style: italic; }
.chat-row { display: flex; gap: 8px; margin-bottom: 6px; }
.chat-row .btn { white-space: nowrap; }

/* ---------- Raid & Gilde ---------- */
.raid-players { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.raid-chip {
  background: #120c07; border: 1px solid var(--green); border-radius: 16px;
  padding: 3px 10px; font-size: 13px;
}
.raid-chip.down { border-color: var(--red); opacity: .6; text-decoration: line-through; }
.raid-log {
  max-height: 150px; overflow-y: auto; background: #0e0805; border: 1px solid #4a3018;
  border-radius: 8px; padding: 8px 10px; margin-top: 10px; font-size: 13px; line-height: 1.5;
  box-shadow: inset 0 2px 8px #000;
}
.sys-win { color: var(--brass2); font-size: 16px; margin: 8px 0; }
