:root {
  --bg: #070b14; --panel: #0e1626; --panel2: #131d31; --line: #2a3651;
  --gold: #d6b26a; --gold2: #f3d58f; --gold-dark: #7d6232;
  --text: #e7e1d3; --muted: #8b93a7; --red: #e0584d; --green: #4fd07b; --blue: #7fb2ff;
  --it-normal: #f1efe8; --it-opt: #7fb2ff; --it-high: #ffd36b; --it-exc: #3dff8b;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: radial-gradient(ellipse at top, #13203a 0%, var(--bg) 60%) fixed; color: var(--text); font: 14px/1.35 Inter, system-ui, sans-serif; overflow-x: hidden; }
img { -webkit-user-drag: none; user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.up { color: var(--green); } .down { color: var(--red); }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 18px; padding: 8px 16px; border-bottom: 1px solid var(--gold-dark); background: linear-gradient(#141e33, #0a1120); box-shadow: 0 2px 12px #0008; position: sticky; top: 0; z-index: 20; }
.logo { font: 800 20px Cinzel, serif; color: var(--gold2); letter-spacing: 1px; text-shadow: 0 0 12px #d6b26a55; white-space: nowrap; }
.logo span { color: var(--gold); } .logo.big { font-size: 34px; text-align: center; }
.hero-mini { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 640px; min-width: 0; }
.hero-mini img { width: 36px; height: 36px; }
.hero-mini .who { display: flex; flex-direction: column; line-height: 1.1; white-space: nowrap; }
.hero-mini .who small, .hero-mini .lvl small { color: var(--muted); font-size: 11px; display: block; }
.hero-mini .lvl { white-space: nowrap; color: var(--gold2); }
.currencies { display: flex; gap: 8px; flex-wrap: wrap; }
.cur { display: flex; align-items: center; gap: 4px; background: #0007; border: 1px solid var(--line); border-radius: 20px; padding: 1px 10px 1px 1px; font-size: 13px; }
.cur img { width: 24px; height: 24px; }
.top-actions { margin-left: auto; display: flex; gap: 6px; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); }
.icon-btn.off { opacity: .4; }

/* ---------- bars ---------- */
.bar { position: relative; height: 16px; background: #05080f; border: 1px solid #3b3424; border-radius: 3px; overflow: hidden; flex: 1; }
.bar > div { height: 100%; width: 0; transition: width .12s; }
.bar > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.bar.xp > div { background: linear-gradient(#e9c86d, #9d7a2c); }
.bar.hp > div { background: linear-gradient(#ff5d4f, #8e1a14); }
.bar.mp { height: 11px; margin-top: 3px; } .bar.mp > div { background: linear-gradient(#5c8dff, #1f3c99); } .bar.mp > span { font-size: 9px; }
.bar.boss > div { background: linear-gradient(#c070ff, #5b1f8f); }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 290px minmax(0, 1fr) 390px; gap: 12px; padding: 12px; max-width: 1680px; margin: 0 auto; }
.panel { background: linear-gradient(var(--panel2), var(--panel)); border: 1px solid var(--gold-dark); border-radius: 10px; padding: 12px; box-shadow: inset 0 0 0 1px #000, 0 6px 24px #0007; min-width: 0; }
.panel-title { font: 700 15px Cinzel, serif; color: var(--gold2); margin-bottom: 10px; text-align: center; letter-spacing: 1px; }

/* ---------- postać ---------- */
.equip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.slot { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; background: #050912 center/68% no-repeat; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .1s, box-shadow .1s; }
.slot:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px var(--gold); }
.slot.empty { opacity: .3; cursor: default; }
.slot.icon3d { background-size: 92%; }
.slot .upg { position: absolute; top: 2px; right: 4px; font-weight: 800; font-size: 12px; color: var(--gold2); text-shadow: 0 1px 2px #000; }
.slot .req { position: absolute; bottom: 2px; left: 4px; font-size: 10px; color: var(--muted); }
.slot .stack-count { position: absolute; bottom: 1px; right: 3px; font: 800 11px Inter, sans-serif; color: #fff; text-shadow: 0 1px 3px #000, 0 0 4px #000; pointer-events: none; z-index: 2; }
.slot.q-opt { border-color: #4f78b8; box-shadow: inset 0 0 10px #7fb2ff33; }
.slot.q-high { border-color: #b08a2c; box-shadow: inset 0 0 14px #ffd36b44; }
.slot.q-exc { border-color: #2fbf68; box-shadow: inset 0 0 16px #3dff8b55; }
.slot.selected { outline: 2px solid var(--gold2); }
.stats { border-top: 1px solid var(--line); padding-top: 10px; }
.stats-head { display: flex; justify-content: space-between; color: var(--gold); font-weight: 700; margin-bottom: 6px; }
.stats-head .pts b { color: var(--green); }
.stat-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.stat-row .n { flex: 1; } .stat-row .v { width: 44px; text-align: right; font-weight: 700; }
.stat-row button { width: 24px; height: 24px; border-radius: 5px; border: 1px solid var(--gold-dark); background: #2a2210; color: var(--gold2); font-weight: 800; padding: 0; font-size: 12px; }
.stat-row button.x10 { width: 32px; font-size: 10px; }
.stat-row button:disabled { opacity: .25; cursor: default; }
.stat-row small { color: var(--muted); font-size: 11px; display: block; }
.derived { margin: 10px 0; border-top: 1px solid var(--line); padding-top: 8px; display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; font-size: 13px; }
.derived span:nth-child(odd) { color: var(--muted); } .derived span:nth-child(even) { text-align: right; font-weight: 600; }

/* ---------- arena ---------- */
.battle-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.battle { position: relative; height: 470px; border-radius: 10px; overflow: hidden; border: 1px solid var(--gold-dark); background: #000; user-select: none; }
.battle-bg { position: absolute; inset: 0; background: center 30%/cover no-repeat; filter: brightness(.7) saturate(1.05); }
.battle-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(#0000 40%, #0007), radial-gradient(ellipse at 50% 60%, transparent 40%, #000b 100%); }
#arenaCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.battle.shake { animation: shake .18s; }
@keyframes shake { 25% { transform: translate(3px, -2px); } 50% { transform: translate(-3px, 2px); } 75% { transform: translate(2px, 1px); } }
.plate { position: absolute; top: 10px; width: min(300px, 42%); pointer-events: none; }
.hero-plate { left: 12px; } .mon-plate { right: 12px; text-align: right; }
.pname { font: 700 15px Cinzel, serif; color: #fff; text-shadow: 0 2px 4px #000; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pname small { font: 600 11px Inter; color: var(--gold2); }
.pname.boss { color: #e7a6ff; }
.buffs { display: flex; gap: 4px; margin-top: 4px; }
.buffs div { position: relative; width: 28px; height: 28px; } .buffs img { width: 100%; height: 100%; }
.buffs span { position: absolute; bottom: -2px; right: -2px; font-size: 10px; font-weight: 800; background: #000c; border-radius: 3px; padding: 0 2px; }
.boss-timer { margin-top: 4px; color: #e7a6ff; font-weight: 700; text-shadow: 0 1px 3px #000; }
.map-badge { position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px; background: #000a; padding: 3px 10px 3px 3px; border-radius: 20px; border: 1px solid var(--gold-dark); font: 600 13px Cinzel, serif; color: var(--gold2); pointer-events: none; }
.map-badge img { width: 30px; height: 30px; border-radius: 50%; }
.death-overlay { position: absolute; inset: 0; background: #400a0acc; display: flex; flex-direction: column; align-items: center; justify-content: center; font: 700 30px Cinzel, serif; color: #ffd7d0; }
.death-overlay small { font: 14px Inter; }
.mob-bars { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mobbar { position: absolute; left: 0; top: 0; width: 84px; margin: -26px 0 0 -42px; text-align: center; transition: opacity .3s; will-change: transform; }
.mobbar small { display: block; font-size: 10px; color: #f0e6d2; text-shadow: 0 1px 2px #000, 0 0 3px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobbar small b { color: var(--gold2); }
.mobbar i { display: block; height: 5px; background: #000a; border: 1px solid #0008; border-radius: 2px; overflow: hidden; }
.mobbar u { display: block; height: 100%; background: linear-gradient(#ff6a5c, #a3241b); text-decoration: none; }
.mobbar.tgt small { color: #ffd36b; } .mobbar.tgt i { outline: 1px solid #ffd36b; }
.mobbar.boss { width: 120px; margin-left: -60px; } .mobbar.boss u { background: linear-gradient(#d18cff, #6a2aa0); }
.fx-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.dmg { position: absolute; font: 800 20px Inter; color: #fff; text-shadow: 0 2px 0 #000, 0 0 6px #000; animation: rise 1s ease-out forwards; white-space: nowrap; }
.dmg.crit { color: #4fc3ff; font-size: 24px; } .dmg.exc { color: #3dff8b; font-size: 24px; } .dmg.sk { color: #ffb347; font-size: 22px; }
.dmg.player { color: #ff5d4f; font-size: 17px; } .dmg.gold { color: var(--gold2); font-size: 14px; } .dmg.xp { color: #c6e4ff; font-size: 14px; }
.dmg.heal { color: #5fe08b; } .dmg.info { color: #ffd36b; font-size: 18px; } .dmg.miss { color: #aaa; font-size: 15px; }
@keyframes rise { 0% { transform: translate(-50%, 0) scale(.7); opacity: 0; } 15% { transform: translate(-50%, -10px) scale(1.1); opacity: 1; } 100% { transform: translate(-50%, -70px) scale(1); opacity: 0; } }

/* ---------- pasek akcji ---------- */
.actionbar { display: flex; gap: 14px; align-items: center; justify-content: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; flex-wrap: wrap; }
.skillbar { display: flex; gap: 10px; }
.skill { position: relative; width: 58px; height: 58px; border-radius: 12px; border: 1px solid var(--gold-dark); padding: 0; background: #050912; }
.skill img { width: 100%; height: 100%; border-radius: 12px; }
.skill.empty { opacity: .45; border-style: dashed; }
.skill .cd { position: absolute; inset: 0; border-radius: 12px; background: conic-gradient(#000c var(--p, 0%), transparent 0); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; }
.skill.nomana img { filter: saturate(.2) brightness(.6); }
.skill .key { position: absolute; top: -6px; left: -6px; background: #000; border: 1px solid var(--gold-dark); border-radius: 4px; font-size: 10px; padding: 0 4px; color: var(--gold2); }
.skill .auto { position: absolute; bottom: -7px; right: -7px; font-size: 9px; font-weight: 800; background: #222; border: 1px solid #555; border-radius: 4px; padding: 0 3px; color: #888; }
.skill .auto.on { background: #1d5b2f; border-color: var(--green); color: #fff; }
.skill .swap { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: #1b2438; border: 1px solid var(--gold-dark); font-size: 10px; line-height: 16px; color: var(--gold2); }
.skill.active-buff { box-shadow: 0 0 14px #6fd0ff; }
.skill.active-skill { border: 2px solid var(--gold2); box-shadow: 0 0 16px #ffcf3d, inset 0 0 10px #ffcf3d88; }
.potions { display: flex; gap: 8px; align-items: center; padding-left: 14px; border-left: 1px solid var(--line); }
.pot { position: relative; width: 50px; height: 50px; border-radius: 10px; border: 1px solid var(--line); background: #050912; padding: 4px; }
.pot img { width: 100%; height: 100%; }
.pot b { position: absolute; bottom: 0; right: 3px; font-size: 11px; text-shadow: 0 1px 2px #000; }
.pot .key { position: absolute; top: -6px; left: -6px; background: #000; border: 1px solid var(--gold-dark); border-radius: 4px; font-size: 10px; padding: 0 4px; color: var(--gold2); }

/* ---------- wyprawa ---------- */
.expedition { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }
.exp-col { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-width: 0; }
.exp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.exp-head > span { font: 700 14px Cinzel, serif; color: var(--gold2); } .exp-head b { color: #fff; }
.enemy-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.enemy { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 6px 4px; text-align: center; background: #070c17; cursor: pointer; font-size: 12px; }
.enemy:hover { border-color: var(--gold-dark); }
.enemy.on { border-color: var(--gold); box-shadow: inset 0 0 12px #d6b26a44; }
.enemy.off { opacity: .5; }
.enemy .ck { position: absolute; top: 3px; left: 5px; color: var(--gold2); font-size: 11px; }
.enemy b { display: block; color: var(--text); font-size: 12px; line-height: 1.15; }
.enemy small { color: var(--muted); } .enemy.danger small { color: var(--red); }
.enemy.fighting { border-color: #ff7a5c; }
.boss-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.loot-tabs { display: flex; gap: 4px; margin-bottom: 6px; }
.loot-tabs button { flex: 1; border: 1px solid var(--line); background: #0a1120; border-radius: 6px; padding: 3px; font-size: 12px; color: var(--muted); }
.loot-tabs button.active { color: var(--gold2); border-color: var(--gold-dark); }
.loot-box { font-size: 12px; max-height: 150px; overflow-y: auto; }
.loot-box .row { display: flex; align-items: center; gap: 6px; padding: 2px 0; border-bottom: 1px solid #ffffff08; }
.loot-box .row img { width: 20px; height: 20px; } .loot-box .row .r { margin-left: auto; color: var(--muted); }

/* ---------- przyciski ---------- */
.btn { border: 1px solid var(--gold-dark); background: linear-gradient(#26304a, #151d30); border-radius: 6px; padding: 6px 12px; color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--gold); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.gold { background: linear-gradient(#b48a3c, #6b4f1c); color: #fff6dc; font-weight: 700; }
.btn.red { background: linear-gradient(#8c2a22, #4e1410); }
.btn.small { padding: 3px 8px; font-size: 12px; }
.btn.wide { width: 100%; }
.btn img { width: 20px; height: 20px; margin: -4px 0; }
.chk { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; color: var(--muted); white-space: nowrap; cursor: pointer; }

/* ---------- zakładki ---------- */
.tabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 10px; }
.tabs button { border: 1px solid var(--line); background: #0a1120; border-radius: 8px; padding: 4px 1px; font-size: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); }
.tabs button img { width: 30px; height: 30px; }
.tabs button.active { border-color: var(--gold); color: var(--gold2); background: #1a1508; }
.inv-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; justify-content: space-between; flex-wrap: wrap; }
.inv-grid { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); aspect-ratio: 1; gap: 2px; }
.inv-cell { background: #050912; border: 1px solid #1c2538; border-radius: 3px; }
.inv-grid .slot { aspect-ratio: auto; z-index: 1; background-size: contain; border-radius: 4px; }
.inv-grid .slot.icon3d { background-size: contain; }
.item-detail { margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #070c17; }
.it { text-align: center; }
.it-name { font-weight: 800; font-size: 15px; }
.it-sub { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.it-line { font-size: 13px; } .it-opt { color: var(--blue); font-size: 13px; } .it-exc { color: var(--it-exc); font-size: 13px; }
.it-cmp { font-size: 12px; margin-top: 6px; }
.it-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.section { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.sel-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin: 6px 0; }
.jewel-btns { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 8px; }
.jewel-btn { display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid var(--line); background: #0a1120; border-radius: 8px; padding: 6px 8px; }
.jewel-btn:hover:not(:disabled) { border-color: var(--gold); }
.jewel-btn:disabled { opacity: .4; cursor: default; }
.jewel-btn img { width: 34px; height: 34px; } .jewel-btn small { display: block; color: var(--muted); font-size: 11px; }
.result { margin-top: 8px; font-weight: 700; min-height: 20px; text-align: center; }
.chance { font-size: 26px; font-weight: 800; color: var(--gold2); text-align: center; }
.skill-row { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px; margin-bottom: 6px; background: #070c17; }
.skill-row.locked { opacity: .45; }
.skill-row img { width: 44px; height: 44px; border-radius: 8px; }
.skill-row .info { flex: 1; font-size: 12px; } .skill-row .info b { font-size: 13px; color: var(--gold2); display: block; }
.skill-row .slots { display: flex; gap: 3px; }
.skill-row .slots button { width: 24px; height: 24px; padding: 0; border-radius: 5px; border: 1px solid var(--line); background: #111a2b; font-size: 11px; }
.skill-row .slots button.on { border-color: var(--gold); color: var(--gold2); background: #2a2210; }
.shop-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 6px; background: #070c17; }
.shop-row img { width: 40px; height: 40px; } .shop-row .info { flex: 1; font-size: 12px; } .shop-row .info b { font-size: 13px; display: block; }
.map-card { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 6px; margin-bottom: 6px; background: #070c17 center/cover; cursor: pointer; position: relative; overflow: hidden; }
.map-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #070c17f0 40%, #070c1790); }
.map-card > * { position: relative; }
.map-card img { width: 52px; height: 52px; border-radius: 50%; }
.map-card.current { border-color: var(--gold); }
.map-card.locked { opacity: .45; cursor: default; }
.map-card .mn { font: 700 14px Cinzel, serif; color: var(--gold2); }
.map-card small { color: var(--muted); display: block; }
.log { height: 560px; overflow-y: auto; font-size: 12px; display: flex; flex-direction: column; gap: 2px; }
.log div { padding: 2px 4px; border-bottom: 1px solid #ffffff08; }
.log .t { color: var(--muted); margin-right: 6px; }

.tooltip { position: fixed; z-index: 1000; background: #050912f5; border: 1px solid var(--gold-dark); border-radius: 8px; padding: 8px 12px; max-width: 280px; pointer-events: none; box-shadow: 0 6px 20px #000a; }
.popover { position: fixed; z-index: 45; background: #0b1324; border: 1px solid var(--gold); border-radius: 10px; padding: 8px; box-shadow: 0 8px 24px #000c; display: grid; grid-template-columns: repeat(3, 56px); gap: 6px; }
.popover button { position: relative; width: 56px; height: 56px; padding: 0; border-radius: 10px; border: 1px solid var(--line); background: #050912; }
.popover button img { width: 100%; height: 100%; border-radius: 10px; }
.popover button:disabled { opacity: .3; }
.modal { position: fixed; inset: 0; background: #000b; display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.modal-box { background: linear-gradient(var(--panel2), var(--panel)); border: 1px solid var(--gold); border-radius: 12px; padding: 20px; width: min(460px, 100%); text-align: center; }
.modal-box h2 { font: 800 20px Cinzel, serif; color: var(--gold2); margin: 0 0 8px; }
.modal-box img.big { width: 80px; }
.modal-box .rew { display: flex; justify-content: center; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.modal-box .rew div { background: #0007; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); display: flex; align-items: center; gap: 4px; }
.modal-box .rew img { width: 20px; height: 20px; }
.modal-actions { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }

/* ---------- tworzenie postaci ---------- */
.create { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; background: #000 center/cover; }
.create::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse, #0008, #000d); }
.create-box { position: relative; width: min(860px, 100%); text-align: center; }
.class-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.class-card { border: 1px solid var(--gold-dark); border-radius: 12px; padding: 14px; background: #0b1324e6; cursor: pointer; }
.class-card.sel { border-color: var(--gold2); box-shadow: 0 0 20px #d6b26a66; }
.class-card img { width: 72px; } .class-card b { display: block; font: 700 17px Cinzel, serif; color: var(--gold2); margin: 6px 0; }
.class-card p { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.class-card .st { font-size: 11px; }
.create-row { display: flex; gap: 10px; justify-content: center; }
.create-row input { background: #050912; border: 1px solid var(--gold-dark); border-radius: 6px; padding: 8px 12px; color: var(--text); width: 220px; }

/* ---------- responsywność ---------- */
@media (max-width: 1250px) {
  .layout { grid-template-columns: 1fr 1fr; }
  .battle-col { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; padding: 8px 16px; }
  .topbar { flex-wrap: wrap; gap: 8px; padding: 8px 16px; }
  .hero-mini { order: 3; flex-basis: 100%; max-width: none; }
  .battle { height: 340px; }
  .expedition { grid-template-columns: 1fr; }
  .enemy-list { grid-template-columns: repeat(2, 1fr); }
  .class-cards { grid-template-columns: 1fr; }
  .create-row { flex-direction: column; align-items: center; }
}

/* napisy łupów na ziemi (kolor = jakość przedmiotu) */
.droplabel { position: absolute; left: 0; top: 0; transform-origin: 0 0; margin-left: -60px; width: 120px; text-align: center; font-size: 11px; font-weight: 700;
  text-shadow: 0 1px 2px #000, 0 0 4px #000; white-space: nowrap; pointer-events: none; transition: opacity .25s; }
.droplabel.picked { opacity: 0; }

/* podróż między lokacjami */
.travel-overlay { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(420px, 80%); background: #000b; border: 1px solid var(--gold-dark);
  border-radius: 10px; padding: 8px 12px; text-align: center; font: 600 14px Cinzel, serif; color: var(--gold2); z-index: 3; }
.travel-overlay .bar { margin-top: 6px; height: 10px; }

/* =====================================================================
   UKŁAD RPG: walka na cały ekran, reszta jako mniejsze okna i nakładki
   ===================================================================== */
body { overflow: hidden; }
.topbar { padding: 4px 14px; gap: 12px; }
.topbar .logo { font-size: 16px; }
.layout { position: fixed; top: 46px; left: 0; right: 0; bottom: 0; display: block; padding: 0; max-width: none; margin: 0; }
.battle-col { position: absolute; inset: 0; display: block; }
.battle-col .battle { position: absolute; inset: 0; height: auto; border-radius: 0; border: none; }
.battle-col .actionbar { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 5; background: #0b1324d9; border-color: var(--gold-dark); backdrop-filter: blur(3px); }
.battle-col .expedition { position: absolute; left: 12px; bottom: 12px; width: min(380px, calc(100% - 24px)); grid-template-columns: 1fr; gap: 6px; z-index: 5; }
.battle-col .expedition .exp-col { background: #0b1324e6; padding: 8px; }
.battle-col .expedition .loot { display: none; }
.battle-col .enemy-list { grid-template-columns: repeat(3, 1fr); gap: 4px; }
.battle-col .enemy { padding: 3px; font-size: 11px; }
.battle-col .enemy b { font-size: 11px; }
.battle-col .map-badge { top: 64px; bottom: auto; left: 12px; }
.win { position: absolute; z-index: 30; max-height: calc(100% - 24px); overflow-y: auto; display: none; background: linear-gradient(#131d31f2, #0e1626f2); box-shadow: 0 12px 40px #000c; }
.win.open { display: block; }
.panel.char.win { left: 12px; top: 12px; width: 300px; }
.panel.side.win { right: 12px; top: 12px; width: min(420px, calc(100% - 24px)); max-height: calc(100% - 90px); }
.win-close { position: sticky; top: 0; float: right; width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--gold-dark); background: #2a2210; color: var(--gold2); font-weight: 800; z-index: 2; }
.dock { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 4px; z-index: 7; background: #0b1324d9; border: 1px solid var(--gold-dark); border-radius: 10px; padding: 5px; backdrop-filter: blur(3px); }
.dock button { position: relative; width: 42px; height: 42px; padding: 3px; border-radius: 8px; border: 1px solid var(--line); background: #050912; }
.dock button img { width: 100%; height: 100%; }
.dock button span { position: absolute; bottom: -4px; right: -3px; font-size: 9px; background: #000; border: 1px solid var(--gold-dark); border-radius: 3px; padding: 0 3px; color: var(--gold2); }
.dock button.on { border-color: var(--gold2); box-shadow: 0 0 10px #d6b26a88; }
@media (max-width: 1100px) {
  .battle-col .expedition { bottom: 86px; }
  .dock { bottom: auto; top: 64px; flex-direction: column; }
}
@media (max-width: 760px) {
  .panel.char.win, .panel.side.win { left: 8px; right: 8px; width: auto; }
  .battle-col .actionbar { bottom: 8px; flex-wrap: nowrap; padding: 6px; }
  .battle-col .expedition { display: none; }
}

/* ekwipunek postaci jak w MU */
.equip-grid { grid-template-columns: 1fr 1.2fr 1fr; grid-template-rows: auto auto auto auto auto;
  grid-template-areas: "necklace helmet wings" "weapon armor shield" "weapon armor shield" "gloves pants boots" "ring pet ring2"; }
.equip-grid .slot { aspect-ratio: auto; min-height: 58px; }
.equip-grid .eq-weapon, .equip-grid .eq-armor, .equip-grid .eq-shield { min-height: 100px; }
.equip-grid .eq-ring, .equip-grid .eq-ring2, .equip-grid .eq-necklace { min-height: 44px; }

/* podróż: ekran przygasa, gdy postać jest w portalu */
#arenaCanvas, .battle-bg { transition: filter 1s ease; }
.battle.traveling #arenaCanvas, .battle.traveling .battle-bg { filter: brightness(.25) blur(3px) saturate(.6); }
.battle.traveling .mob-bars { opacity: 0; }

/* siatka ekwipunku jak w MU: tekstura pola z gry, bez ramek jakości i liczb */
.inv-cell { background: url(../assets/ui/mu/newui_item_box.png) center/100% 100%; border: none; border-radius: 0; opacity: .9; }
.inv-grid { gap: 0; background: #000; padding: 2px; border: 1px solid #3a3326; }
.inv-grid .slot { border: none; box-shadow: none; background-color: transparent; border-radius: 0; }
.inv-grid .slot .req { display: none; }
.inv-grid .slot.q-exc { box-shadow: inset 0 0 18px #3dff8b55; }
.inv-grid .slot:hover { box-shadow: inset 0 0 0 1px #d6b26a, inset 0 0 14px #d6b26a44; transform: none; }
.inv-grid .slot.selected { outline: none; box-shadow: inset 0 0 0 1px #f3d58f, inset 0 0 18px #f3d58f55; }

.slot canvas.spin { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.slot.spinning { background-image: none !important; }

/* przeciąganie: klejnot na przedmiot, przedmiot na wolne pola */
.slot.dragging { opacity: .4; }
.slot.drop-ok, .inv-cell.drop-ok { box-shadow: inset 0 0 0 2px #5dff8a, inset 0 0 16px #5dff8a66 !important; }
.slot.held { box-shadow: inset 0 0 0 2px #f3d58f, 0 0 12px #f3d58f !important; }
.tabs { grid-template-columns: repeat(6, 1fr); }

/* =====================================================================
   INTERFEJS Z GRY (Data/Interface → assets/ui/mu): dolny pasek, kule, okna, sloty
   ===================================================================== */
.battle-col .actionbar { display: none; }
.muhud { position: absolute; left: 50%; bottom: 4px; width: 800px; height: 51px; transform: translateX(-50%) scale(var(--hud, 1.3)); transform-origin: 50% 100%; z-index: 6; image-rendering: auto; }
.muhud .hb { position: absolute; top: 0; height: 51px; pointer-events: none; }
.muhud .hb[src*="02_03"] { height: 42px; top: 4px; }
.muhud .orb { position: absolute; top: 3px; width: 45px; height: 39px; }
.muhud .orb.hp { left: 155px; } .muhud .orb.mp { left: 437px; }
.muhud .orb .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; overflow: hidden; transition: height .15s; }
.muhud .orb .fill img { position: absolute; left: 0; bottom: 0; width: 45px; height: 39px; }
.muhud .orb span { position: absolute; left: -10px; right: -10px; top: -14px; text-align: center; font: 700 9px Inter; color: #fff; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.muhud .expbar { position: absolute; left: 2px; top: 45px; width: 636px; height: 4px; }
.muhud .expbar div { height: 100%; width: 0; background: linear-gradient(#ffe27a, #b8862c); opacity: .9; }
.muhud .activeskill { position: absolute; left: 386px; top: 5px; width: 30px; height: 34px; background-size: cover; }
.muhud .skillbar { position: static; }
.muhud .skill { position: absolute; top: 5px; width: 30px; height: 34px; border: none; border-radius: 2px; background: transparent; padding: 0; }
.muhud .skill .ico { position: absolute; inset: 0; background-repeat: no-repeat; border-radius: 2px; }
.muhud .skill img { width: 100%; height: 100%; border-radius: 2px; }
.muhud .skill.empty { opacity: 1; border: none; }
.muhud .skill .key { display: none; }
.muhud .skill .swap { width: 11px; height: 11px; font-size: 7px; line-height: 9px; top: -4px; right: -4px; opacity: 0; transition: opacity .15s; }
.muhud .skill:hover .swap { opacity: 1; }
.muhud .skill.active-skill { box-shadow: 0 0 0 1px #f3d58f, 0 0 8px #ffcf3d; border: none; }
.muhud .skill .cd { border-radius: 2px; font-size: 10px; }
.muhud .pot { position: absolute; top: 5px; width: 35px; height: 34px; border: none; background: transparent; padding: 3px; border-radius: 0; }
.muhud #potHp { left: 2px; } .muhud #potMp { left: 39px; }
.muhud .pot b { font-size: 9px; right: 2px; bottom: 0; }
.muhud .autopot { position: absolute; left: 80px; top: 18px; font-size: 8px; color: #ddd; }
.muhud .autopot input { width: 10px; height: 10px; }
.hero-plate .bar { display: none; } /* życie i mana są w kulach na dolnym pasku */
.battle-col .expedition { bottom: 80px; }
.dock { bottom: 80px; }
/* okna: tła i ramki z newui_msgbox / newui_item_back01 */
.win { background: url(../assets/ui/mu/newui_msgbox_top.png) top center / 100% auto no-repeat, url(../assets/ui/mu/newui_msgbox_bottom.png) bottom center / 100% auto no-repeat, url(../assets/ui/mu/newui_msgbox_back.png) top center / 100% auto repeat-y, #0b0d12;
  border: 1px solid #4a4231; border-radius: 4px; padding-top: 34px; padding-bottom: 34px; }
.win .panel-title { color: #f3e2b0; font-family: Cinzel, serif; text-shadow: 0 1px 2px #000; }
.win-close { width: 27px; height: 15px; border: none; background: url(../assets/ui/mu/newui_button_close.png) 0 0 / 100% 300%; color: transparent; border-radius: 0; margin-top: -26px; }
.win-close:hover { background-position: 0 50%; }
.btn { border: none; background: url(../assets/ui/mu/newui_btn_empty.png) 0 0 / 100% 300%; color: #f3e2b0; border-radius: 2px; text-shadow: 0 1px 1px #000; }
.btn:hover:not(:disabled) { background-position: 0 50%; }
.btn:disabled { background-position: 0 100%; opacity: .6; }
.btn.gold { background: url(../assets/ui/mu/newui_btn_empty.png) 0 50% / 100% 300%; color: #ffe9a8; }
/* sloty postaci: tła z newui_item_* (sylwetki przedmiotów z gry) */
.equip-grid .slot { border: none; border-radius: 0; background-color: transparent; background-size: 100% 100%; box-shadow: none; }
.equip-grid .slot.empty { opacity: 1; }
.equip-grid .slot.icon3d { background-size: contain; background-color: #0006; }

/* NPC na mapie */
.npclabel { position: absolute; left: 0; top: 0; margin-left: -70px; width: 140px; text-align: center; font: 700 12px Cinzel, serif; color: #8fe0ff; text-shadow: 0 1px 2px #000, 0 0 4px #000; pointer-events: auto; cursor: pointer; white-space: nowrap; }
.npclabel:hover { color: #ffe066; text-shadow: 0 0 8px #ffb300; }
.vault-grid { max-height: 60vh; }
.tabs { grid-template-columns: repeat(7, 1fr); }

/* paski HP osobno nad każdym potworem (bez dużego paska celu) */
.mon-plate { display: none; }
.mobbar { width: 104px; margin: -30px 0 0 -52px; }
.mobbar small { font-size: 11px; }
.mobbar i { height: 7px; border: 1px solid #000; background: #2a0b08cc; border-radius: 1px; }
.mobbar u { background: linear-gradient(#ff5a48, #9c160e); }
.mobbar.tgt i { outline: 1px solid #f3d58f; box-shadow: 0 0 6px #f3d58f88; }
.mobbar.boss { width: 150px; margin-left: -75px; } .mobbar.boss i { height: 9px; }

/* =====================================================================
   EKRAN JAK W MU: bez górnego paska, menu w polach paska, komunikaty w rogu
   ===================================================================== */
.topbar { display: none; }
.layout { top: 0; }
.battle-col .expedition, .dock, .hero-plate .pname { display: none !important; }
.hero-plate { top: 8px; left: 8px; }
.zone-header {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  z-index: 6;
  pointer-events: none;
  max-width: calc(100vw - 20px);
}
.map-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(138, 114, 69, 0.5);
  padding: 2px 16px;
  border-radius: 3px;
  font: 700 14px Cinzel, serif;
  letter-spacing: 1.5px;
  color: #ffd36b;
  text-shadow: 0 1px 3px #000, 0 0 6px rgba(255, 211, 107, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  white-space: nowrap;
}
.map-badge img { display: none; }
.spot-bar {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  user-select: none;
  flex-wrap: wrap;
}
@media (hover: hover) and (pointer: fine) {
  body:has(#winSide.open) .zone-header,
  body:has(#winSide.open) .map-badge,
  body:has(#winSide.open) .spot-bar {
    display: none !important;
  }
}
@media (hover: hover) and (pointer: fine) and (max-width: 1100px) {
  body:has(#winChar.open) .zone-header,
  body:has(#winChar.open) .map-badge,
  body:has(#winChar.open) .spot-bar {
    display: none !important;
  }
}
.spot-pill { display: inline-flex; align-items: center; gap: 5px; background: rgba(14, 16, 22, 0.85); border: 1px solid rgba(138, 114, 69, 0.6); border-radius: 3px; color: #d8ceb5; font: 600 11px Inter, sans-serif; padding: 2px 8px; cursor: pointer; transition: all 0.15s ease; box-shadow: 0 2px 6px rgba(0,0,0,0.5); }
.spot-pill:hover { background: rgba(35, 30, 20, 0.95); border-color: #ffd36b; color: #fff; transform: translateY(-1px); }
.spot-pill.active { background: linear-gradient(180deg, rgba(82, 65, 30, 0.95), rgba(40, 30, 15, 0.95)); border-color: #ffd36b; color: #ffe9a8; font-weight: 700; box-shadow: 0 0 8px rgba(255, 211, 107, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2); cursor: default; }
.spot-pill .sp-name { font-family: Cinzel, serif; font-size: 11px; letter-spacing: 0.5px; }
.spot-pill .sp-lvl { font-size: 10px; opacity: 0.75; }
.spot-pill.active .sp-lvl { opacity: 0.9; color: #ffd36b; }
.spot-sub { font-size: 13px; font-weight: 500; color: #ffd36b; opacity: 0.9; }
.sub-locs .btn.active { border-color: #ffd36b; background: rgba(255, 211, 107, 0.18); color: #ffd36b; font-weight: 700; }
.muhud .mubt { position: absolute; top: 4px; width: 30px; height: 36px; border: none; padding: 0; background: transparent 0 0 / 100% 400% no-repeat; cursor: pointer; }
.muhud .mubt:hover, .muhud .mubt.on { background-position: 0 33.33%; }
.msgbox { position: absolute; left: 8px; bottom: calc(51px * var(--hud, 1.3) + 14px); width: min(440px, 46%); max-height: 150px; overflow: hidden; z-index: 5; pointer-events: none;
  display: flex; flex-direction: column; justify-content: flex-end; font: 600 12px Inter; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.msgbox div { color: #e8e2cf; padding: 1px 6px; background: linear-gradient(90deg, #000a, #0000); margin-top: 1px; animation: msgin .3s; }
.msgbox div b { color: #ffd36b; }
@keyframes msgin { from { opacity: 0; transform: translateX(-8px); } }
.gamemenu { position: absolute; left: 50%; bottom: calc(51px * var(--hud, 1.3) + 10px); transform: translateX(calc(-50% + 190px)); z-index: 9; display: grid; gap: 3px; padding: 10px;
  background: url(../assets/ui/mu/newui_msgbox_back.png) top / 100% auto, #0b0d12; border: 1px solid #4a4231; border-radius: 4px; width: 190px; }
.gamemenu button { border: none; background: url(../assets/ui/mu/newui_btn_empty.png) 0 0 / 100% 300%; color: #f3e2b0; padding: 6px 4px; font: 600 12px Inter; text-shadow: 0 1px 1px #000; }
.gamemenu button:hover { background-position: 0 50%; }
.moneybar { display: flex; align-items: center; height: 26px; margin-top: 6px; background: url(../assets/ui/mu/newui_item_money.png) 0 0 / 100% 100%; padding-left: 42px; font: 700 13px Inter; color: #ffe9a8; text-shadow: 0 1px 2px #000; }

/* podróż: ekran ładowania jak w MU (obraz lokacji z Interface/LoadingScreens + pasek postępu) */
.travel-overlay.loading { left: 0; right: 0; top: 0; bottom: 0; width: auto; transform: none; border: none; border-radius: 0; padding: 0;
  background: #000 center / cover no-repeat; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; z-index: 20; animation: loadin .6s ease; }
.travel-overlay.loading #travelText { margin-bottom: 10px; font: 700 20px Cinzel, serif; color: #f3e2b0; text-shadow: 0 2px 6px #000; }
.travel-overlay.loading .bar { width: min(560px, 80%); height: 12px; margin-bottom: 40px; border: 1px solid #6b5a33; background: #000c; }
.travel-overlay.loading .bar div { background: linear-gradient(#ffe27a, #a8781e); }
@keyframes loadin { from { opacity: 0; } }

.sub-locs { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.sub-locs .btn { font-size: 11px; padding: 3px 8px; }

/* łup na ziemi: klikalny napis, czerwony gdy brak miejsca; podświetlenie pola walki przy wyrzucaniu */
.droplabel { pointer-events: auto; cursor: pointer; }
.droplabel.full { color: #ff6b6b !important; }
.droplabel.full::after { content: ' (brak miejsca)'; font-size: 10px; opacity: .85; }
#battle.drop-throw { outline: 2px dashed #ffd36b88; outline-offset: -6px; }

/* =====================================================================
   SKALOWANIE OKIEN: jedna skala --uis (z wysokości ekranu), okna nie wchodzą pod pasek MU
   ===================================================================== */
.win { zoom: var(--uis, 1); }
.panel.char.win { left: 10px; top: 10px; width: 272px; max-height: var(--winMaxH, 560px) !important; }
.panel.side.win { right: 10px; top: 10px; width: 372px; max-height: var(--winMaxH, 560px) !important; transition: width 0.15s ease; }
.win { scrollbar-width: thin; scrollbar-color: #6b5a36 #0000; }
.win .panel-title { font-size: 15px; margin-bottom: 6px; }
.win .item-detail { font-size: 12px; }
/* dziennik w rogu nie chowa się pod oknem postaci */
@media (hover: hover) and (pointer: fine) {
  body:has(#winChar.open) .msgbox { left: calc(272px * var(--uis, 1) + 22px); }
}
.droplabel, .mobname { font-size: 12px; }

/* ---- czytelność okien: zakładki, napisy i przyciski ---- */
.win .tabs { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 8px; }
.win .tabs button { font-size: 11px; padding: 4px 7px; letter-spacing: -.2px; display: inline-flex; align-items: center; gap: 4px; }
.win .tabs button img { width: 22px; height: 22px; }
.win, .win .muted, .win small { font-size: 12px; }
.win .map-card small { font-size: 12px; line-height: 1.35; }
.win .map-card .mn { font-size: 15px; }
.win .map-card img { width: 46px; height: 46px; }
.win .sub-locs .btn, .win .item-detail .btn, .win .btn.small { font-size: 12px; padding: 4px 9px; }
.win .stat-row small { font-size: 11px; }

/* =====================================================================
   DWA OKNA OBOK SIEBIE: WYPOSAŻENIE + PLECAK
   ===================================================================== */
.panel.side.win.wide-inv,
.panel.side.win:has(#tab-inv:not([hidden])),
.panel.side.win:has(#tab-vault:not([hidden])),
.panel.side.win:has(#tab-chaos:not([hidden])) {
  width: min(710px, calc(100vw - 20px));
  background: url(../assets/ui/mu/newui_msgbox_back.png) top center / auto repeat, #0b0d14;
}

.inv-dual-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(310px, 1.18fr);
  gap: 10px;
  align-items: start;
}

.inv-subwin {
  background: linear-gradient(180deg, rgba(14, 20, 32, 0.94) 0%, rgba(8, 12, 19, 0.97) 100%);
  border: 1px solid #4a3e26;
  border-radius: 4px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.65), inset 0 0 14px rgba(0, 0, 0, 0.4);
  padding: 8px;
  position: relative;
}

.inv-subwin-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #251d13 0%, #15110a 100%);
  border: 1px solid #5a4b2c;
  border-radius: 3px;
  padding: 4px 8px;
  margin-bottom: 8px;
  min-height: 28px;
}

.inv-subwin-title .subwin-label {
  font: 700 13px Cinzel, serif;
  color: #ffd36b;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px #000;
  display: flex;
  align-items: center;
  gap: 6px;
}

.inv-subwin-title .bag-count {
  font-family: Inter, sans-serif;
  font-size: 11px;
  color: #f3e2b0;
  background: #00000088;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid #5a4b2c88;
}

.inv-actions {
  display: flex;
  gap: 4px;
}

.inv-actions .btn {
  font-size: 11px;
  padding: 2px 7px;
  background: linear-gradient(180deg, #2b2214, #18130a);
  border: 1px solid #6b5832;
  color: #f0d590;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.inv-actions .btn:hover {
  border-color: #ffd36b;
  color: #fff;
  box-shadow: 0 0 6px rgba(255, 211, 107, 0.4);
}

/* Siatka wyposażenia postaci */
#tab-inv .equip-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  grid-template-rows: 44px 50px 50px 44px 34px;
  gap: 4px;
  margin-bottom: 8px;
  padding: 6px;
  background: #04070d;
  border: 1px solid #3a3326;
  border-radius: 4px;
  grid-template-areas:
    "necklace helmet wings"
    "weapon   armor  shield"
    "weapon   armor  shield"
    "gloves   pants  boots"
    "ring     pet    ring2";
}

#tab-inv .equip-grid .slot {
  min-height: unset;
  height: 100%;
  border: 1px solid #232a38;
  border-radius: 3px;
  background-color: #060911;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#tab-inv .equip-grid .slot:hover {
  border-color: #ffd36b;
  box-shadow: 0 0 8px rgba(255, 211, 107, 0.35);
}

#tab-inv .equip-grid .slot.drop-ok {
  border-color: #5dff8a !important;
  box-shadow: inset 0 0 0 2px #5dff8a, inset 0 0 16px #5dff8a66 !important;
}

/* Opis wybranego przedmiotu w oknie wyposażenia */
#tab-inv .item-detail {
  margin-top: 0;
  border: 1px solid #3a3326;
  border-radius: 4px;
  padding: 8px 10px;
  background: #05080e;
  min-height: 80px;
  max-height: 190px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #6b5a36 #0000;
}

.item-detail-empty {
  font-size: 11px;
  color: #8892a4;
  line-height: 1.5;
  text-align: center;
  padding: 12px 6px;
}

/* Siatka plecaka i okien */
#tab-inv .inv-grid,
#tab-vault .inv-grid,
#tab-chaos .inv-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 1px;
  background: #020407;
  padding: 3px;
  border: 1px solid #3a3326;
  border-radius: 4px;
}

#tab-inv .inv-grid,
#tab-vault .bag-win .inv-grid,
#tab-chaos .bag-win .inv-grid {
  grid-template-rows: repeat(8, 1fr);
  aspect-ratio: 1;
}

#tab-vault .vault-grid {
  grid-template-rows: repeat(15, 1fr);
  aspect-ratio: 8 / 15;
  max-height: 440px;
  overflow-y: auto;
}

#tab-chaos .chaos-grid {
  grid-template-rows: repeat(4, 1fr);
  aspect-ratio: 8 / 4;
  min-height: 140px;
}

#tab-inv .inv-cell,
#tab-vault .inv-cell,
#tab-chaos .inv-cell {
  background: url(../assets/ui/mu/newui_item_box.png) center/100% 100%;
  border: none;
  border-radius: 0;
  opacity: 0.95;
}

#tab-inv .inv-cell.drop-ok,
#tab-vault .inv-cell.drop-ok,
#tab-chaos .inv-cell.drop-ok {
  box-shadow: inset 0 0 0 2px #5dff8a, inset 0 0 16px #5dff8a66 !important;
}

/* Pasek złota (Zen) */
#tab-inv .moneybar,
#tab-vault .moneybar,
#tab-chaos .moneybar {
  display: flex;
  align-items: center;
  height: 28px;
  margin-top: 6px;
  background: url(../assets/ui/mu/newui_item_money.png) 6px center / auto 80% no-repeat, #05080e;
  border: 1px solid #3a3326;
  border-radius: 4px;
  padding: 0 12px 0 42px;
  font: 700 13px Inter, sans-serif;
  color: #ffe9a8;
  text-shadow: 0 1px 2px #000;
  justify-content: space-between;
}

#tab-inv .moneybar .money-val {
  color: #ffd36b;
  font-weight: 800;
}

#tab-inv .moneybar .money-unit {
  font-size: 11px;
  color: #8c826e;
  font-weight: 600;
}

/* Responsywność */
@media (max-width: 1050px) {
  body:has(#winChar.open) .panel.side.win.wide-inv {
    max-width: calc(100vw - 300px);
  }
}
@media (max-width: 760px) {
  .win { zoom: 1; }
  .panel.char.win, .panel.side.win { max-height: calc(100% - var(--hudH, 80px) - 16px); }
  .panel.side.win.wide-inv {
    width: calc(100vw - 16px) !important;
    right: 8px !important;
    left: 8px !important;
  }
  .inv-dual-layout {
    grid-template-columns: 1fr;
  }
}
.char-head { margin-bottom: 10px; }
.char-head .ch-top { display: flex; align-items: center; gap: 10px; }
.char-head .ch-top img { width: 40px; height: 40px; }
.char-head .ch-name { font: 700 15px Cinzel, serif; color: #f3e2b0; }
.char-head .ch-cls { font-size: 12px; color: var(--muted); }
.char-head .ch-lvl { margin-left: auto; text-align: center; font: 700 26px Cinzel, serif; color: #ffd36b; line-height: 1; }
.char-head .ch-lvl small { display: block; font: 600 10px Inter; color: var(--muted); }
.char-head .ch-xp { position: relative; height: 16px; margin-top: 8px; background: #000; border: 1px solid #3a3326; }
.char-head .ch-xp div { height: 100%; background: linear-gradient(#e8c76a, #8a6a1c); }
.char-head .ch-xp span { position: absolute; inset: 0; text-align: center; font: 600 11px/16px Inter; color: #fff; text-shadow: 0 1px 2px #000; }

/* ===== ekran tworzenia postaci w scenie 3D (jak wybór postaci w MU) ===== */
body.creating .muhud, body.creating .msgbox, body.creating .zone-header, body.creating .map-badge, body.creating .win, body.creating .gamemenu, body.creating .hero-plate, body.creating .mob-bars, body.creating .spot-bar { display: none !important; }
.create { background: none !important; pointer-events: none; display: block; padding: 0; }
.create > * { pointer-events: auto; }
.cs-logo { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font: 700 34px Cinzel, serif; color: #f3e2b0; text-shadow: 0 2px 8px #000, 0 0 24px #d6b26a55; pointer-events: none; }
.cs-logo span { color: #ffd36b; }
.cs-panel { position: absolute; background: url(../assets/ui/mu/newui_msgbox_back.png) top / 100% auto, #0b0d12e8; border: 1px solid #4a4231; box-shadow: 0 8px 30px #000a; padding: 12px; }
.cs-left { left: 20px; top: 50%; transform: translateY(-50%); width: 230px; }
.cs-right { right: 20px; top: 50%; transform: translateY(-50%); width: 270px; }
.cs-bottom { left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; }
.cs-title { font: 700 15px Cinzel, serif; color: #f3e2b0; text-align: center; margin-bottom: 8px; }
.cs-list { display: grid; gap: 6px; }
.cs-list button { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: none; background: url(../assets/ui/mu/newui_btn_empty.png) 0 0 / 100% 300%; color: #e8dcc0; font: 600 14px Inter; cursor: pointer; text-align: left; }
.cs-list button img { width: 34px; height: 34px; }
.cs-list button:hover { background-position: 0 50%; }
.cs-list button.sel { background-position: 0 100%; color: #ffd36b; text-shadow: 0 0 8px #d6b26a; }
.cs-slot-btn { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: none; background: url(../assets/ui/mu/newui_btn_empty.png) 0 0 / 100% 300%; color: #e8dcc0; cursor: pointer; text-align: left; min-height: 42px; }
.cs-slot-btn:hover { background-position: 0 50%; }
.cs-slot-btn.sel { background-position: 0 100%; color: #ffd36b; text-shadow: 0 0 8px #d6b26a; }
.cs-slot-btn img { width: 30px; height: 30px; border-radius: 4px; flex-shrink: 0; }
.cs-slot-info { display: flex; flex-direction: column; overflow: hidden; line-height: 1.25; }
.cs-slot-name { font: 700 13px Cinzel, serif; color: #f3e2b0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-slot-btn.sel .cs-slot-name { color: #ffd36b; }
.cs-slot-meta { font: 500 11px Inter, sans-serif; color: #a89d85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-slot-btn.sel .cs-slot-meta { color: #e8dcc0; }
.cs-slot-empty { opacity: 0.65; border: 1px dashed #6b5a36 !important; justify-content: center; font: 600 12px Inter; min-height: 38px; }
.cs-slot-empty:hover { opacity: 1; border-color: #ffd36b !important; color: #ffd36b; }
.cs-empty-plus { font-size: 15px; margin-right: 4px; font-weight: 700; color: #ffd36b; }
.cs-class { display: flex; gap: 10px; align-items: flex-start; }
.cs-class img { width: 52px; height: 52px; }
.cs-class b { font: 700 17px Cinzel, serif; color: #ffd36b; }
.cs-class p { margin: 4px 0 0; font-size: 13px; color: #d8cfbb; line-height: 1.35; }
.cs-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #3a3326; font-size: 13px; }
.cs-stats div { display: flex; justify-content: space-between; } .cs-stats span { color: #a89d85; } .cs-stats b { color: #fff; }
.cs-hint { font-size: 12px; color: #8f8670; margin: 10px 0 0; }
.cs-bottom input { width: 220px; padding: 9px 12px; background: #000c; border: 1px solid #6b5a36; color: #fff; font: 600 15px Inter; }
.cs-bottom .btn { padding: 9px 18px; font-size: 14px; }
.cs-bottom .btn.big { padding: 10px 28px; font-size: 16px; font-weight: 700; letter-spacing: 0.5px; }
/* (stara reguła wąskiego ekranu dla listy klas usunięta — psuła listę postaci; telefon obsługuje @media max-height) */
/* scena tworzenia postaci: jaśniej (ciemna mapa światła tej sceny) */


.create::before { display: none; } /* stara ciemna nakładka zasłaniała scenę 3D */
.create .cs-logo { text-shadow: 0 2px 6px #000, 0 0 18px #000a; }

/* ===== dopracowanie: podróż = mały pasek pod nazwą mapy (gra widoczna, przyciemniona) ===== */
.travel-overlay, .travel-overlay.loading { position: absolute; left: 50%; top: 46px; bottom: auto; right: auto; transform: translateX(-50%); width: 280px; height: auto;
  padding: 7px 12px 9px; border: 1px solid #5a4b30; border-radius: 2px; background: url(../assets/ui/mu/newui_msgbox_back.png) center / 100% auto, #0b0d12e6;
  box-shadow: 0 4px 16px #000a; display: block; z-index: 6; animation: none; font: 600 12px Inter; color: #d8cfbb; text-align: center; }
.travel-overlay #travelText, .travel-overlay.loading #travelText { margin: 0 0 5px; font: 600 12px Inter; color: #d8cfbb; text-shadow: 0 1px 2px #000; display: flex; gap: 6px; justify-content: center; }
.travel-overlay #travelText b { color: #ffd36b; font-family: Cinzel, serif; } .travel-overlay #travelText span { color: #a89d85; }
.travel-overlay .bar, .travel-overlay.loading .bar { width: 100%; height: 6px; margin: 0; border: 1px solid #3a3326; background: #000; border-radius: 0; }
.travel-overlay .bar div, .travel-overlay.loading .bar div { height: 100%; background: linear-gradient(#ffe27a, #a8781e); transition: width .2s linear; }
.battle.traveling #arenaCanvas { filter: brightness(.55) saturate(.8); }
/* liczby obrażeń: obrys jak w MU, bez tła */

/* Stylizacja Kotła Chaosu i Magazyniera */
.chaos-panel {
  margin-top: 6px;
  padding: 8px;
  background: rgba(4, 7, 12, 0.85);
  border: 1px solid #4a3e26;
  border-radius: 4px;
}
.chaos-chance {
  font-size: 20px;
  font-weight: 700;
  color: #5dff8a;
  text-align: center;
  text-shadow: 0 0 10px rgba(93, 255, 138, 0.5);
  margin-bottom: 4px;
}
.chaos-quick-jewels {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 6px 0;
  align-items: center;
}
.chaos-quick-jewels .btn {
  padding: 3px 8px;
  font-size: 11px;
}
.vault-detail-panel {
  margin-top: 8px;
  padding: 6px;
  background: rgba(4, 7, 12, 0.7);
  border: 1px solid #3a3326;
  border-radius: 4px;
  min-height: 40px;
}
.dmg { font: 800 19px Inter; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 0 6px #000; background: none !important; border: none !important; box-shadow: none !important; width: auto !important; height: auto !important; padding: 0 !important; }
.dmg.crit, .dmg.exc { font-size: 22px; } .dmg.player { font-size: 16px; } .dmg.miss { font-size: 14px; } .dmg.info { font-size: 15px; }

/* zakładki okna w jednym rzędzie (7 równych kolumn), ikona nad napisem */
.win .tabs { display: grid !important; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.win .tabs button { flex-direction: column; justify-content: center; padding: 3px 0; font-size: 10.5px; gap: 1px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win .tabs button img { width: 22px; height: 22px; }

/* panel awansu klasy (okno statystyk) */
.evo-box { margin: 8px 0 10px; padding: 8px 10px; border: 1px solid #4a4231; background: #0006; font-size: 12px; }
.evo-box .evo-title { color: #e8dcc0; margin-bottom: 4px; } .evo-box .evo-title b { color: #ffd36b; font-family: Cinzel, serif; }
.evo-box .evo-req { color: #a89d85; } .evo-box .evo-req.ok { color: #9be39b; } .evo-box .evo-req small { color: #7d745f; }
.evo-box .btn { margin-top: 6px; width: 100%; } .evo-box .evo-done { color: #ffd36b; }

/* ===== telefon / tablet ===== */
html.touch, html.touch body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
html.touch body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.touch input { -webkit-user-select: text; user-select: text; }
html.touch .win-close { min-width: 34px; min-height: 22px; }
html.touch .muhud .mubt, html.touch .muhud .skill { touch-action: none; }
/* telefon trzymany pionowo: prośba o obrót (gra jest pozioma) */
.rotate-hint { display: none; position: fixed; inset: 0; z-index: 10000; background: #0b0d12; color: #e8dcc0; align-items: center; justify-content: center; text-align: center; font: 600 15px Inter; }
.rotate-hint b { display: block; font: 700 20px Cinzel, serif; color: #ffd36b; margin: 10px 0 4px; } .rotate-hint p { margin: 0; color: #a89d85; }
.rotate-hint .rh-icon { font-size: 46px; animation: rh 1.6s ease-in-out infinite; }
@keyframes rh { 50% { transform: rotate(90deg); } }
@media (orientation: portrait) and (max-width: 760px) { html.touch .rotate-hint, .rotate-hint.force { display: flex; } }
/* niski ekran (telefon w poziomie): ciaśniejsze panele ekranu postaci */
@media (max-height: 480px) {
  .cs-logo { font-size: 22px; top: 6px; }
  .cs-panel { padding: 8px; } .cs-left { width: 180px; } .cs-right { width: 220px; }
  .cs-list button { padding: 4px 8px; font-size: 13px; } .cs-list button img { width: 26px; height: 26px; }
  .cs-class p, .cs-hint { display: none; } .cs-bottom { bottom: 10px; } .cs-bottom input { width: 170px; padding: 6px 10px; }
  .msgbox { max-height: 70px; font-size: 11px; }
}
/* telefon w poziomie (wąski i niski ekran): okna skalowane (--uis), ekwipunek i plecak obok siebie */
@media (max-width: 760px) and (orientation: landscape), (max-height: 480px) and (orientation: landscape) {
  .win { zoom: var(--uis, 0.6) !important; }
  .panel.char.win, .panel.side.win { max-height: var(--winMaxH, 300px) !important; }
  .panel.side.win.wide-inv { width: calc((100vw - 16px) / var(--uis, 0.6)) !important; left: auto !important; right: 8px !important; }
  .inv-dual-layout { grid-template-columns: 1fr 1.15fr !important; }
}

.evo-box .evo-gives { color: #9fc8ff; margin-bottom: 4px; font-size: 11.5px; }

/* wytrzymałość: zużyty (pomarańczowy) i zepsuty (czerwony) przedmiot */
.slot.worn { box-shadow: inset 0 0 0 1px #ffb347, inset 0 0 14px #ffb34755 !important; }
.slot.broken { box-shadow: inset 0 0 0 2px #ff4a3c, inset 0 0 18px #ff4a3c77 !important; filter: grayscale(.6); }

/* telefon w poziomie: okno boczne po prawej w normalnym rozmiarze (nie rozciągnięte) */
@media (max-height: 480px) and (orientation: landscape) {
  .panel.side.win:not(.wide-inv) { left: auto !important; right: 8px !important; width: 372px !important; }
  .msgbox { max-height: 54px; }
}

body.creating .party-frame { display: none !important; }
/* telefon w poziomie: plecak i wyposażenie mieszczą się w wysokości okna (bez ucinania dolnych rzędów) */
@media (max-height: 480px) and (orientation: landscape) {
  .wide-inv .bag-win .inv-grid, .wide-inv .vault-grid { width: min(100%, calc(var(--winMaxH, 300px) - 150px)); margin: 0 auto; max-height: none; }
  .wide-inv .equip-win .equip-grid { max-width: calc(var(--winMaxH, 300px) - 200px); margin: 0 auto; }
  .wide-inv .equip-win .item-detail { display: none; }
}
/* zakładki plecaka (I–IV) */
.inv-pages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin: 0 0 4px; }
.inv-pages button { position: relative; border: 1px solid #3a3326; background: #0008; color: #a89d85; font: 700 12px Cinzel, serif; padding: 4px 0; cursor: pointer; }
.inv-pages button.on { color: #ffd36b; border-color: #8a6a2c; background: linear-gradient(#2a2210, #120e06); }
.inv-pages button.drop-ok { border-color: #5fe08a; color: #5fe08a; }
.inv-pages button small { position: absolute; top: 1px; right: 4px; font: 600 9px Inter, sans-serif; color: #8f866f; }

/* ===== zbieranie łupów ===== */
.droplabel.skip { opacity: .55; font-style: italic; }
.lf-wrap { position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; background: #000a; }
.lf { position: relative; width: min(420px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; box-sizing: border-box; padding: 18px 16px 14px;
  background: linear-gradient(#1c212b, #12151b 140px); border: 1px solid #4a4231; border-top-color: #e3b65c; border-radius: 14px; box-shadow: 0 20px 60px #000e; color: #efe2c2; font: 14px Inter, sans-serif; }
.lf h3 { margin: 0 48px 4px 0; font: 700 20px Cinzel, serif; color: #f6d68a; }
.lf-sub { margin: 0 0 10px; color: #9d927a; font-size: 12.5px; line-height: 1.4; }
.lf-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid #3b3323; background: #1c212b; color: #efe2c2; font: 400 22px/1 Inter, sans-serif; cursor: pointer; }
.lf-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; } .lf-presets .btn { flex: 1; min-height: 36px; }
.lf-list { display: grid; gap: 6px; margin-bottom: 10px; }
.lf-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #2c2618; border-radius: 10px; background: #0a0c10; cursor: pointer; min-height: 44px; box-sizing: border-box; }
.lf-row input { width: 20px; height: 20px; accent-color: #e3b65c; flex: none; }
.lf-row b { display: block; font-weight: 700; } .lf-row small { display: block; color: #8f866f; font-size: 12px; margin-top: 1px; }
html.portrait .lf-wrap { place-items: end stretch; }
html.portrait .lf { width: 100%; border-radius: 16px 16px 0 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }

/* ---- czytelność na polu walki: większe liczby i napisy z grubym obrysem, nazwy na ciemnym tle ---- */
.dmg { font: 900 22px Inter, system-ui, sans-serif; letter-spacing: .3px; paint-order: stroke fill; -webkit-text-stroke: 4px #000;
  text-shadow: 0 2px 0 #000, 0 0 8px #000c; }
.dmg.crit, .dmg.exc { font-size: 27px; } .dmg.sk { font-size: 24px; } .dmg.player { font-size: 19px; }
.dmg.gold, .dmg.xp { font-size: 15px; -webkit-text-stroke-width: 3px; } .dmg.info { font-size: 17px; } .dmg.miss { font-size: 15px; color: #d0d0d0; }
.mobbar small { font: 700 12px Inter, system-ui, sans-serif; color: #fff; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 0 4px #000; overflow: visible; }
.mobbar small b { color: #ffd36b; }
.droplabel { font: 700 12px Inter, system-ui, sans-serif; width: auto; min-width: 60px; max-width: 170px; margin-left: 0; transform: translateX(-50%);
  padding: 2px 6px; border-radius: 4px; background: #000b; border: 1px solid #ffffff22; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 1px #000; }
.vault-move-hint { margin: 4px 0; padding: 6px 8px; border: 1px solid #8a6a2c; background: #1a1508; color: #ffd36b; font-size: 12px; }
.vault-grid.moving .inv-cell { box-shadow: inset 0 0 0 1px #d6b26a66; cursor: pointer; }

/* podgląd postaci w ekwipunku (okno Postać) */
.char-preview { position: relative; margin: 0 0 10px; border: 1px solid #3a3326; background: radial-gradient(ellipse at 50% 70%, #2a2418 0%, #0b0a08 70%); }
.char-preview canvas { display: block; width: 100%; height: 260px; touch-action: pan-y; cursor: grab; }
.char-preview small { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; color: #a09581; font-size: 11px; pointer-events: none; }

/* Kocioł Chaosu: co powstanie, co przepadnie, wylosowana liczba */
.chaos-gives { margin: 4px 0 2px; font-size: 12px; color: #c9e6c4; text-align: center; }
.chaos-lost { margin: 2px 0 4px; font-size: 12px; color: #f0b0a0; text-align: center; }
.chaos-roll { margin-top: 2px; font-size: 11px; color: #a89d85; }

.exc-active { grid-column: 1 / -1; margin-top: 8px; padding-top: 6px; border-top: 1px solid #ffffff14; display: grid; gap: 4px; font-size: 12px; }
.exc-active > div:not(.stats-head) { display: flex; justify-content: space-between; gap: 8px; } .exc-active b { color: #3dff8b; font-weight: 600; text-align: right; }
.exc-active .down { display: block !important; color: #ff8a7a; }

/* ostrzeżenie o zepsutych przedmiotach */
#brokenWarn { position: fixed; left: 50%; top: 52px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100vw - 20px)); padding: 8px 12px;
  background: #3a1a14f2; border: 1px solid #a6483a; color: #ffd9cf; font: 13px "Trebuchet MS", system-ui, sans-serif; box-shadow: 0 6px 24px #000a; }
#brokenWarn[hidden] { display: none; } #brokenWarn .btn { min-height: 40px; flex: none; }
html.portrait #brokenWarn { top: calc(var(--m-top, 88px) + 6px); left: 8px; right: 8px; transform: none; max-width: none; flex-wrap: wrap; font-size: 12.5px; }
/* anulowanie podróży */
.travel-overlay { pointer-events: auto; } #travelCancel { display: block; width: 100%; margin-top: 6px; min-height: 36px; pointer-events: auto; }
/* sklep: sety */
.shop-set { flex-wrap: wrap; } .shop-set .info { flex: 1 1 100%; } .shop-set .set-btns { display: flex; flex-wrap: wrap; gap: 4px; } .shop-set .set-btns .btn { min-height: 36px; }
/* Kupiec jak w MU: siatka wystawy */
.shop-grid { max-width: 420px; margin: 0 auto; } .shop-stock .shop-price { margin-top: 6px; font-size: 13px; color: #eadcbb; } .shop-stock .item-detail { margin-top: 8px; }
