* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d1117; font-family: "Segoe UI", system-ui, sans-serif; color: #f2f2f2; user-select: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#hud { position: fixed; inset: 0; pointer-events: none; }
#hud[hidden], #target-frame[hidden] { display: none; }

.bar { position: relative; height: 18px; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.25); border-radius: 4px; overflow: hidden; }
.bar .fill { height: 100%; background: linear-gradient(#e0484a, #9d1d22); transition: width .15s; }
.bar.enemy .fill { background: linear-gradient(#d9a23a, #8c5a12); }
.bar span { position: absolute; inset: 0; text-align: center; font-size: 12px; line-height: 18px; text-shadow: 0 1px 2px #000; }

#player-frame { position: absolute; left: 16px; top: 16px; width: 260px; }
.pf-name, .tf-name { font-weight: 600; margin-bottom: 4px; text-shadow: 0 1px 3px #000; }
#pf-level, #tf-level { color: #ffd166; font-weight: 500; }

#target-frame { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); width: 300px; text-align: center; }

#wallet { position: absolute; right: 198px; top: 16px; background: rgba(0,0,0,.45); padding: 8px 12px; border-radius: 6px; font-size: 14px; line-height: 1.6; }
.coin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.coin.silver { background: radial-gradient(#ffffff, #9aa3ad); }
.coin.gold { background: radial-gradient(#fff3b0, #c9971c); }
.coin.bronze { background: radial-gradient(#f0b27a, #8a4f1c); }

#perf { position: absolute; right: 198px; top: 148px; background: rgba(0,0,0,.45); padding: 6px 10px; border-radius: 6px; font: 12px/1.5 Consolas, monospace; white-space: pre; }

#skillbar { position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); display: grid; grid-template-columns: repeat(4, auto); column-gap: 8px; row-gap: 6px; }
#skillbar .skill { grid-row: 2; }
#hp-bar { grid-row: 1; grid-column: 1 / -1; height: 20px; border-radius: 5px; box-shadow: 0 2px 6px rgba(0,0,0,.4); }   /* životy nad dovednostmi 1–4, stejně široké */
#hp-bar span { line-height: 20px; font-weight: 600; }
/* stavový efekt (Omráčen / Očarován / Imunní): vedle ukazatele životů mimo mřížku – dřív se vkládal do řady dovedností a posouval je */
#cc-ikona { position: absolute; top: 0; left: calc(100% + 10px); height: 20px; line-height: 20px; padding: 0 8px; border-radius: 5px; white-space: nowrap; font-weight: 600; font-size: 13px; color: #fff; background: rgba(20, 16, 32, .78); box-shadow: 0 2px 6px rgba(0,0,0,.4); pointer-events: none; }
#cc-ikona.cc-charm { background: rgba(150, 40, 110, .85); } #cc-ikona.cc-stun { background: rgba(120, 100, 20, .85); } #cc-ikona.cc-imun { background: rgba(30, 110, 120, .85); }
body.dotyk #cc-ikona { top: auto; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); }
/* Nezlomný: zrušení stavu mezerníkem – tlačítko nad ukazatelem životů, připravené vibruje */
#cc-zlom { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); padding: 6px 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.35); font-weight: 700; font-size: 14px; color: #fff; white-space: nowrap; background: rgba(60, 60, 70, .85); box-shadow: 0 2px 8px rgba(0,0,0,.5); cursor: pointer; touch-action: none; z-index: 5; }
#cc-zlom kbd { display: inline-block; min-width: 82px; padding: 2px 8px; margin-right: 6px; border-radius: 5px; border: 1px solid rgba(255,255,255,.55); border-bottom-width: 3px; background: rgba(255,255,255,.12); font: inherit; font-size: 12px; text-align: center; }
#cc-zlom.pripraveno { background: linear-gradient(180deg, rgba(95, 255, 224, .95), rgba(40, 170, 160, .95)); color: #06201d; border-color: #c8fff4; animation: cc-zlom-vibrace .32s linear infinite; box-shadow: 0 0 14px rgba(95, 255, 224, .7), 0 2px 8px rgba(0,0,0,.5); }
#cc-zlom.pripraveno kbd { border-color: rgba(6, 32, 29, .6); background: rgba(255,255,255,.35); }
@keyframes cc-zlom-vibrace { 0%, 100% { transform: translateX(-50%) rotate(0); } 20% { transform: translateX(calc(-50% - 3px)) rotate(-2deg); } 40% { transform: translateX(calc(-50% + 3px)) rotate(2deg); } 60% { transform: translateX(calc(-50% - 2px)) rotate(-1deg); } 80% { transform: translateX(calc(-50% + 2px)) rotate(1deg); } }
body.dotyk #cc-zlom { bottom: calc(100% + 96px); padding: 10px 18px; font-size: 16px; }   /* na dotyku nad ikonou stavu i řadou lektvarů, větší pro prst */
@media (prefers-reduced-motion: reduce) { #cc-zlom.pripraveno { animation: none; } }
.skill { position: relative; width: 58px; height: 58px; background: rgba(20,24,32,.8); border: 1px solid rgba(255,255,255,.3); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; overflow: hidden; }
.skill b { font-size: 18px; color: #ffd166; }
.skill .cd { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(0,0,0,.7); }

#xpbar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); width: min(640px, calc(100% - 32px)); height: 12px; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.2); border-radius: 3px; overflow: hidden; }
#xp-fill { height: 100%; width: 0; background: linear-gradient(#8f7cff, #5636d9); transition: width .2s; }
#xp-text { position: absolute; inset: 0; text-align: center; font-size: 10px; line-height: 12px; }

#toast { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); font-size: 28px; font-weight: 700; text-shadow: 0 2px 6px #000; opacity: 0; transition: opacity .3s; text-align: center; }
#toast.show { opacity: 1; }
#oznameni { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 60; max-width: min(560px, calc(100vw - 32px)); padding: 16px 22px; border-radius: 12px; background: rgba(16, 20, 40, .94); border: 1px solid #f0c860; box-shadow: 0 8px 30px rgba(0,0,0,.6); color: #fff; font-size: 17px; line-height: 1.45; text-align: center; opacity: 0; pointer-events: none; transition: opacity .35s; cursor: pointer; }
#oznameni.show { opacity: 1; pointer-events: auto; }
#nova-verze { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 55; display: flex; gap: 10px; align-items: center; padding: 8px 10px 8px 16px; border-radius: 10px; background: rgba(16, 20, 40, .94); border: 1px solid #6fb3ff; color: #fff; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.5); max-width: calc(100vw - 32px); }
#nova-verze button { padding: 6px 12px; border-radius: 7px; border: 0; background: #3b82f6; color: #fff; font-weight: 700; cursor: pointer; }
#nova-verze .nv-pozdeji { background: transparent; color: #aab; padding: 6px 8px; }
#test-panel { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 58; text-align: center; font-size: 13px; }
#test-panel .tp-stitek { background: #d9302c; color: #fff; border: 0; border-radius: 6px; padding: 3px 12px; font-weight: 800; letter-spacing: 1px; cursor: pointer; }
#test-panel .tp-telo { margin-top: 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px; border-radius: 10px; background: rgba(16, 20, 40, .95); border: 1px solid #d9302c; width: 300px; }
#test-panel .tp-telo[hidden] { display: none; }
#test-panel .tp-telo p { grid-column: 1 / -1; margin: 0 0 4px; color: #ccd; }
#test-panel .tp-telo button { padding: 7px 6px; border-radius: 7px; border: 1px solid #445; background: #262c48; color: #fff; cursor: pointer; }
#test-panel .tp-telo button:hover { background: #343c62; }

#labels { position: absolute; inset: 0; overflow: hidden; }
.mobbar { position: absolute; left: 0; top: 0; width: 70px; will-change: transform; text-align: center; font-size: 11px; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.mobbar .mb { height: 5px; background: rgba(0,0,0,.6); border-radius: 2px; overflow: hidden; margin-top: 2px; }
.mobbar .mb div { height: 100%; background: #e0484a; }
.mobbar.targeted { color: #ffd166; }
.float { position: absolute; left: 0; top: 0; will-change: transform; font-weight: 700; text-shadow: 0 1px 3px #000, 0 0 2px #000; white-space: nowrap; }
.float.dmg { color: #fff; font-size: 18px; }
.float.crit { color: #ffcf3f; font-size: 24px; }
.float.hurt { color: #ff5a5a; font-size: 18px; }
.float.heal { color: #6cff8a; font-size: 18px; }
.float.loot { color: #e6e9ee; font-size: 15px; }
.float.lootb { color: #f0a868; font-size: 15px; }
.float.xp { color: #b3a6ff; font-size: 14px; }

#start { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(20,30,50,.75), rgba(5,8,14,.95)); }
#start[hidden] { display: none; }
.panel { width: min(520px, calc(100% - 32px)); background: rgba(16,20,28,.92); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 24px 28px; }
.panel h1 { margin: 0 0 8px; font-size: 26px; }
.panel h1 small { font-size: 14px; color: #9aa3ad; font-weight: 400; }
.controls { width: 100%; border-collapse: collapse; margin: 12px 0 18px; font-size: 14px; }
.controls td { padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.controls td:first-child { color: #ffd166; width: 38%; }
#play { width: 100%; padding: 12px; font-size: 17px; font-weight: 600; border: 0; border-radius: 8px; background: #5636d9; color: #fff; cursor: pointer; }
#play:disabled { opacity: .45; cursor: wait; }
.credits { font-size: 11px; color: #7d8590; margin: 14px 0 0; }

#death { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding-top: 18vh; pointer-events: auto; }
#death[hidden] { display: none; }
.death-box { background: rgba(10,10,14,.85); border: 1px solid rgba(255,255,255,.15); border-radius: 10px; padding: 18px 26px; text-align: center; max-width: 360px; }
.death-box h2 { margin: 0 0 6px; color: #e7c46a; font-size: 24px; }
.death-box p { margin: 0 0 14px; font-size: 14px; color: #cfd3da; }
#revive { padding: 10px 18px; font-size: 15px; font-weight: 600; border: 0; border-radius: 8px; background: #5636d9; color: #fff; cursor: pointer; }

/* ---------- okna ---------- */
.win { position: absolute; background: rgba(14,17,24,.94); border: 1px solid rgba(255,255,255,.14); border-radius: 10px; pointer-events: auto; box-shadow: 0 10px 40px rgba(0,0,0,.5); font-size: 13px; }
.win[hidden] { display: none; }
.win { z-index: 12; }   /* okna vždy nad HUDem (parta, úkoly, chat) */
#toast { z-index: 40; pointer-events: none; }
.win-head { padding: 10px 14px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; justify-content: space-between; align-items: center; }
.x { background: none; border: 0; color: #aab; font-size: 20px; cursor: pointer; line-height: 1; }
#inv { right: 200px; top: 112px; width: min(640px, calc(100% - 232px)); max-height: calc(100% - 248px); overflow: auto; }   /* vlevo od minimapy a ⚙, nad dovednostmi */
@media (max-width: 900px) { #inv { right: 16px; top: 236px; width: calc(100% - 32px); max-height: calc(100% - 330px); } }
@media (max-height: 520px) { #inv { top: 56px; right: 190px; width: calc(100% - 206px); max-height: calc(100% - 66px); } }   /* telefon na šířku */
.inv-body { display: flex; gap: 14px; padding: 12px 14px; flex-wrap: wrap; }
.inv-left { flex: 1 1 250px; min-width: 230px; }
.inv-right { flex: 0 0 301px; max-width: 301px; }
#inv-equip { display: grid; gap: 6px; }
.eqslot { display: flex; align-items: center; gap: 8px; }
.eqname { font-size: 12px; line-height: 1.2; }
#inv-bag { display: grid; grid-template-columns: repeat(6, 46px); gap: 5px; }
.cell { width: 46px; height: 46px; border: 1px solid rgba(255,255,255,.12); border-radius: 6px; background: rgba(255,255,255,.04); position: relative; display: flex; align-items: center; justify-content: center; }
.cell.has { cursor: pointer; background: rgba(255,255,255,.07); }
.cell .ic { font-size: 22px; }
.cell .ic.empty { opacity: .2; filter: grayscale(1); }
.cell .lv { position: absolute; right: 3px; bottom: 1px; font-size: 10px; color: #cfd3da; }
.inv-foot { display: flex; justify-content: space-between; margin-top: 8px; gap: 10px; }
.stats { margin-top: 10px; font-size: 12px; display: grid; gap: 2px; }
.stats div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.05); padding: 2px 0; }
.stats b { font-weight: 600; color: #ffe6a6; }
.muted { color: #8b93a1; }
.small { font-size: 11px; padding: 0 14px 10px; }
.m-g { color: #ffd76a; } .m-b { color: #e39a5b; } .m-s { color: #dfe4ea; }
#shop { left: 16px; top: 120px; width: min(380px, calc(100% - 32px)); }
#shop-list { max-height: 50vh; overflow: auto; padding: 8px 10px; display: grid; gap: 6px; }
.shoprow { display: flex; align-items: center; gap: 10px; padding: 4px; border-radius: 6px; cursor: pointer; }
.shoprow:hover { background: rgba(255,255,255,.06); }
.shopinfo { flex: 1; font-size: 12px; }
.shopprice { font-size: 12px; white-space: nowrap; }
.shopprice.bad { opacity: .45; }
.shop-foot { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; gap: 8px; border-top: 1px solid rgba(255,255,255,.08); }
#shop-sellcommon { background: #2b3242; color: #eee; border: 1px solid #3d4558; border-radius: 6px; padding: 6px 10px; cursor: pointer; }
#tooltip { position: fixed; left: 0; top: 0; z-index: 50; max-width: 300px; background: rgba(8,10,14,.97); border: 1px solid rgba(255,255,255,.18); border-radius: 8px; padding: 10px 12px; font-size: 12px; pointer-events: none; line-height: 1.45; }
#tooltip[hidden] { display: none; }
.tt-name { font-weight: 700; font-size: 14px; }
.tt-sub { color: #8b93a1; margin-bottom: 6px; }
.tt-base { color: #f2f2f2; }
.tt-aff { color: #8fd3ff; margin-top: 4px; }
.tt-eff { color: #e8c76a; margin-top: 6px; font-style: italic; }
.tt-req { margin-top: 6px; color: #cfd3da; } .tt-req.bad { color: #ff6b6b; }
.tt-sep { margin-top: 6px; color: #8b93a1; }
.up { color: #5fe07a; } .down { color: #ff6b6b; }
.tt-price { margin-top: 6px; }
.tt-hint { margin-top: 4px; color: #6f7785; font-size: 11px; }
.groundlabel { position: absolute; left: 0; top: 0; font-size: 12px; font-weight: 600; text-shadow: 0 1px 2px #000, 0 0 3px #000; white-space: nowrap; pointer-events: auto; cursor: pointer; background: rgba(0,0,0,.45); padding: 1px 6px; border-radius: 4px; will-change: transform; }
.npclabel { position: absolute; left: 0; top: 0; text-align: center; font-size: 13px; font-weight: 700; color: #ffe08a; text-shadow: 0 1px 3px #000; white-space: nowrap; will-change: transform; line-height: 1.15; }
.npclabel small { font-weight: 500; color: #d8dde6; font-size: 11px; }

.tt-set { margin-top: 6px; font-weight: 600; }
.tt-setb { color: #6f7785; } .tt-setb.on { color: #e6f0ff; }
.setdot { position: absolute; left: 3px; top: 3px; width: 7px; height: 7px; border-radius: 50%; }
.setline span { font-weight: 600; }

#errbox { position: fixed; left: 16px; bottom: 90px; z-index: 100; max-width: min(640px, calc(100% - 32px)); background: rgba(120,10,10,.92); color: #fff; font: 12px/1.4 Consolas, monospace; padding: 10px 12px; border-radius: 8px; white-space: pre-wrap; }
#errbox[hidden] { display: none; }
.warn { background: rgba(160,40,30,.35); border: 1px solid rgba(255,120,100,.5); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.45; margin: 0 0 14px; }
.warn[hidden] { display: none; }

/* ---------- úkoly ---------- */
.qm { font-size: 26px; font-weight: 900; line-height: 1; text-shadow: 0 2px 4px #000; }
.qm.avail { color: #ffd23f; } .qm.ready { color: #ffd23f; } .qm.active { color: #9aa3ad; }
#tracker { position: absolute; right: 16px; top: 226px; width: 240px; font-size: 12px; text-shadow: 0 1px 2px #000; }
#tracker[hidden] { display: none; }
.tq { margin-bottom: 8px; background: rgba(0,0,0,.28); padding: 6px 8px; border-radius: 6px; }
.tqn { font-weight: 700; color: #ffd76a; margin-bottom: 2px; }
#tracker .ok { color: #6fe08a; }
#dialog { left: 50%; top: 14%; transform: translateX(-50%); width: min(520px, calc(100% - 32px)); max-height: 72vh; overflow: auto; }
#dialog-body { padding: 10px 14px 14px; display: grid; gap: 10px; }
.dq { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 8px; padding: 10px 12px; }
.dq p { margin: 6px 0; color: #d5d9e0; line-height: 1.45; }
.dqn { font-weight: 700; color: #ffd76a; font-size: 14px; }
/* rozhovor u úkolu „promluv si s…“: postava vlevo, hráč vpravo, odpověď tlačítkem s vlastní větou */
.rz { border-radius: 8px; padding: 8px 12px; max-width: 88%; }
.rz b { font-size: 12px; letter-spacing: .02em; } .rz p { margin: 4px 0 0; line-height: 1.45; color: #e3e6ec; }
.rz-npc { background: rgba(255,215,106,.07); border: 1px solid rgba(255,215,106,.18); justify-self: start; } .rz-npc b { color: #ffd76a; }
.rz-ja { background: rgba(111,180,255,.09); border: 1px solid rgba(111,180,255,.22); justify-self: end; text-align: right; } .rz-ja b { color: #8fc4ff; }
.rz-odpoved { justify-self: end; text-align: left; background: rgba(111,180,255,.14); border: 1px solid rgba(111,180,255,.4); color: #dceaff; border-radius: 8px; padding: 8px 12px; cursor: pointer; font: inherit; max-width: 88%; }
.rz-odpoved:hover { background: rgba(111,180,255,.26); }
.rz-tema { display: block; width: 100%; text-align: left; margin-top: 6px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); color: #e3e6ec; border-radius: 6px; padding: 7px 10px; cursor: pointer; font: inherit; }
.rz-tema:hover:not(:disabled) { background: rgba(255,215,106,.12); } .rz-tema:disabled { opacity: .55; cursor: default; }
.promluvit { margin-left: auto; margin-right: 8px; background: rgba(255,215,106,.14); border: 1px solid rgba(255,215,106,.4); color: #ffe7a6; border-radius: 6px; padding: 2px 9px; cursor: pointer; font: inherit; font-size: 12px; }
.promluvit:hover { background: rgba(255,215,106,.26); }
.tq-skryty .tqn { color: #c9a8ff; }   /* osobní prosba (skrytý úkol) */
.dqo { color: #cfd3da; margin: 6px 0; }
.dqr { color: #cfd3da; margin: 6px 0; } .dqr .xp { color: #b3a6ff; }
.dbtn { margin-top: 6px; background: #5636d9; color: #fff; border: 0; border-radius: 6px; padding: 7px 14px; font-weight: 600; cursor: pointer; }
.choices { display: grid; gap: 6px; margin: 8px 0 4px; }
.choice { text-align: left; background: #1d2230; color: #eee; border: 1px solid #343b4d; border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.choice.on { border-color: #ffd76a; box-shadow: 0 0 0 1px #ffd76a inset; }
.exbtn { margin-top: 8px; width: 100%; background: #3a2f12; color: #ffd76a; border: 1px solid #6b5520; border-radius: 6px; padding: 7px 10px; font-weight: 600; cursor: pointer; }
.exbtn:disabled { opacity: .45; cursor: default; }
body.win-open #tracker { display: none; }

/* ---------- Trhlina ---------- */
#dungeon-hud { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); width: min(520px, calc(100% - 32px)); text-align: center; text-shadow: 0 1px 3px #000; }
#dungeon-hud[hidden], #dh-bar[hidden] { display: none; }
#dh-title { font-size: 18px; font-weight: 800; color: #c9a2ff; letter-spacing: .5px; }
#dh-bar { height: 14px; margin: 4px 0; }
#dh-bar .fill { background: linear-gradient(#a05cff, #4a1a9a); }
#dh-sub { font-size: 12px; color: #e6dcff; }
#dungeon-win { left: 50%; top: 18%; transform: translateX(-50%); width: min(460px, calc(100% - 32px)); }
#dw-body { padding: 10px 14px; line-height: 1.5; }
#dw-body ul { margin: 6px 0; padding-left: 18px; }
#log { left: 50%; top: 12%; transform: translateX(-50%); width: min(680px, calc(100% - 32px)); }
#log-list { max-height: 60vh; overflow: auto; padding: 8px 12px; font-size: 12px; }
.lr { display: grid; grid-template-columns: 120px 80px 1fr; gap: 8px; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.lt { color: #7d8590; } .lk { font-weight: 700; }
.lk-buy, .lk-sell { color: #ffd76a; } .lk-drop, .lk-pickup { color: #8fd3ff; } .lk-reward, .lk-quest, .lk-exchange { color: #6fe08a; } .lk-death { color: #ff6b6b; } .lk-dungeon { color: #c9a2ff; }
.small-btn { padding: 4px 10px; font-size: 12px; margin: 0; }

/* ---------- lektvary a alchymie ---------- */
#belt { position: absolute; left: calc(50% + 150px); bottom: 34px; display: flex; gap: 6px; pointer-events: auto; }
.pslot { position: relative; width: 44px; height: 44px; background: rgba(20,24,32,.8); border: 1px solid rgba(255,255,255,.25); border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; }
.pslot.empty { opacity: .45; }
.pslot b { position: absolute; left: 3px; top: 1px; font-size: 10px; color: #ffd166; }
.pslot .pi { font-size: 20px; }
.pslot .pn { position: absolute; right: 3px; bottom: 1px; font-size: 11px; font-weight: 700; }
.pslot .cd { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(0,0,0,.65); }
@media (max-width: 900px) { #belt { left: 50%; transform: translateX(-50%); bottom: 100px; } }
#buffs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.buff { font-size: 11px; background: rgba(0,0,0,.5); border: 1px solid; border-radius: 4px; padding: 1px 6px; }
#alch { left: 16px; top: 120px; width: min(470px, calc(100% - 32px)); }
#alch-mats { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 10px 14px 4px; font-size: 12px; }
#alch-list { max-height: 52vh; overflow: auto; padding: 6px 10px; display: grid; gap: 6px; }
.arow { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 6px 8px; border-radius: 6px; background: rgba(255,255,255,.04); }
.ainfo { font-size: 13px; } .small2 { font-size: 11px; margin-top: 2px; }
.ainfo .ok { color: #6fe08a; } .ainfo .bad { color: #ff6b6b; }
.abtns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.abtns button:disabled { opacity: .4; cursor: default; }
.buyb { background: #3a2f12 !important; color: #ffd76a !important; }
.lk-craft { color: #ffb347; }
#news { left: 50%; top: 12%; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); max-height: 72vh; overflow: auto; }
#news-body { padding: 10px 14px; display: grid; gap: 8px; }
#news-body ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.5; color: #d5d9e0; }
#wb-hud { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); width: min(520px, calc(100% - 32px)); text-align: center; text-shadow: 0 1px 3px #000; }
#wb-hud[hidden] { display: none; }
.wbt { font-size: 18px; font-weight: 800; color: #cfe3ff; }
#wb-hud .bar { height: 14px; margin: 4px 0; } #wb-hud .fill { background: linear-gradient(#cfe3ff, #5a7fb8); }
#wb-sub { font-size: 12px; }
.panel { max-height: calc(100vh - 32px); overflow: auto; }
#pets { left: 16px; top: 120px; width: min(470px, calc(100% - 32px)); }
#pet-list { max-height: 56vh; overflow: auto; padding: 8px 10px; display: grid; gap: 6px; }
#pet-info .bad { color: #ff6b6b; }
.abtns button:disabled { opacity: .4; }

/* minimapa, velká mapa, teleport, vylepšování */
#minimap { position: absolute; right: 16px; top: 16px; width: 170px; height: 170px; pointer-events: none; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
#podzemi-mapa { position: absolute; right: 16px; top: 16px; width: 170px; height: 170px; pointer-events: none; border-radius: 8px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
#podzemi-mapa[hidden] { display: none; }
#map-win { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(592px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto; }
#bigmap { display: block; width: calc(100% - 28px); margin: 10px 14px 0; aspect-ratio: 1; border-radius: 8px; cursor: pointer; }
#castbar { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); width: 260px; text-align: center; font-size: 13px; text-shadow: 0 1px 2px #000; }
#castbar[hidden] { display: none; }
#castbar .cb { height: 10px; margin-top: 4px; background: rgba(0,0,0,.55); border: 1px solid rgba(95,216,255,.6); border-radius: 5px; overflow: hidden; }
#cast-fill { height: 100%; width: 0; background: linear-gradient(90deg, #2a8fd0, #5fd8ff); }
#c, canvas { touch-action: none; } #inv .cell { touch-action: none; }
/* ---------- mobil / tablet ---------- */
.touch-help { display: none; margin: 0 0 12px; padding: 8px 10px; border-radius: 8px; background: rgba(95,216,255,.08); border: 1px solid rgba(95,216,255,.25); font-size: 13px; line-height: 1.5; }
body.dotyk .touch-help { display: block; } body.dotyk #start table.controls { display: none; }
body.dotyk #start .panel { max-height: calc(100dvh - 24px); overflow-y: auto; }
body.dotyk:not(.perf-on) #perf { display: none !important; }
body.dotyk.perf-on #perf { top: 64px; left: 102px; right: auto; font-size: 10px; padding: 4px 8px; }
#joy, #touch-btns, #touch-akce, #touch-cil { display: none; }
body.dotyk #joy { display: block; position: absolute; left: calc(18px + env(safe-area-inset-left)); bottom: 28px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.10), rgba(255,255,255,.04)); border: 2px solid rgba(255,255,255,.22); pointer-events: auto; touch-action: none; }
#joy-knob { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; background: rgba(255,255,255,.35); border: 2px solid rgba(255,255,255,.6); box-shadow: 0 2px 10px rgba(0,0,0,.4); }
#joy.on #joy-knob { background: rgba(255,209,102,.55); }
body.dotyk .skill { pointer-events: auto; touch-action: none; width: 64px; height: 64px; }
body.dotyk .skill.tisk { transform: scale(.94); border-color: #ffd166; }
body.dotyk #touch-btns { display: flex; flex-direction: column; gap: 6px; position: absolute; right: calc(10px + env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); pointer-events: auto; }
body.dotyk #touch-btns button, body.dotyk #touch-akce, body.dotyk #touch-cil { width: 48px; height: 48px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: rgba(14,17,24,.72); color: #e8ecf3; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 18px; padding: 0; touch-action: manipulation; }
body.dotyk #touch-btns small, body.dotyk #touch-akce small, body.dotyk #touch-cil small { font-size: 8px; color: #9aa3b2; line-height: 1; margin-top: 1px; }
body.dotyk #touch-akce { display: flex; position: absolute; right: calc(70px + env(safe-area-inset-right)); bottom: 28px; width: 64px; height: 64px; border-radius: 50%; pointer-events: auto; border-color: rgba(255,209,102,.6); }
body.dotyk #touch-akce b { font-size: 22px; color: #ffd166; }
body.dotyk #touch-cil { display: flex; position: absolute; right: calc(70px + env(safe-area-inset-right)); bottom: 100px; border-radius: 50%; pointer-events: auto; }
body.dotyk #chat { left: calc(170px + env(safe-area-inset-left)); bottom: 28px; width: min(260px, 32vw); opacity: .85; font-size: 13px; }
body.dotyk #chat-log { max-height: 64px; border-radius: 6px; }
body.dotyk #chat-input { display: none; }
body.dotyk.chat-otevreny #chat { position: fixed; z-index: 60; top: calc(8px + env(safe-area-inset-top)); bottom: auto; left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); opacity: 1; font-size: 15px; display: block; }
body.dotyk.chat-otevreny #chat-log { max-height: min(40vh, 260px); background: rgba(8,10,16,.85); border-radius: 8px 8px 0 0; }
body.dotyk.chat-otevreny #chat-input { display: block; font-size: 16px; padding: 10px 12px; }   /* 16 px: iOS jinak při psaní přiblíží stránku */
body.dotyk.chat-otevreny #chat-head { color: #e8ecf3; }
body.dotyk #touch-chat { position: relative; }
body.dotyk #touch-chat.nove::after { content: ''; position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: #ffd166; box-shadow: 0 0 6px #ffd166; }
body.dotyk.chat-otevreny #touch-chat { border-color: #2A8BF4; }
body.dotyk #wallet { right: auto; left: 16px; top: 64px; font-size: 12px; padding: 4px 8px; line-height: 1.4; }
body.dotyk #skillbar { bottom: 26px; }
body.dotyk #belt { left: 50%; transform: translateX(-50%); bottom: 130px; }
body.dotyk #xpbar { width: min(420px, 40vw); height: 8px; bottom: 6px; }
body.dotyk .pslot { touch-action: manipulation; }
@media (max-height: 520px) {   /* telefon na šířku: tlačítka oken v řadě nahoře, chat malý pod měšcem */
  body.dotyk #touch-btns { flex-direction: row; top: 8px; right: auto; left: calc(50% + 50px); transform: translateX(-50%); }
  body.dotyk #touch-btns button { width: 42px; height: 42px; font-size: 16px; }
  body.dotyk:not(.chat-otevreny) #chat { top: 128px; bottom: auto; left: 16px; width: 210px; }
  body.dotyk:not(.chat-otevreny) #chat-log { max-height: 44px; }
  body.dotyk.chat-otevreny #chat { top: 60px; width: min(520px, calc(100vw - 220px)); left: calc(50% - 60px); }   /* pod řadou tlačítek, vedle minimapy */
  body.dotyk.chat-otevreny #chat-log { max-height: 26vh; }
  body.dotyk #joy { width: 120px; height: 120px; bottom: 18px; }
  body.dotyk #skillbar { bottom: 16px; } body.dotyk .skill { width: 54px; height: 54px; }
  body.dotyk #belt { bottom: 104px; } body.dotyk .pslot { transform: scale(.85); }
  body.dotyk #touch-akce { bottom: 18px; right: 18px; } body.dotyk #touch-cil { bottom: 26px; right: 92px; }
  body.dotyk #party { top: 128px; left: auto; right: 16px; width: 170px; }
}
#otoc { display: none; }
@media (orientation: portrait) { body.dotyk #otoc:not(.skryt) { display: flex; position: fixed; inset: 0; z-index: 90; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(8,10,16,.92); color: #e8ecf3; text-align: center; padding: 24px; font-size: 16px; }
  body.dotyk #otoc div { font-size: 48px; } }
@media (orientation: portrait) and (pointer: coarse) { body.dotyk #touch-btns { top: 210px; transform: none; } body.dotyk:not(.chat-otevreny) #chat { display: none; } }
#party { position: absolute; left: 16px; top: 112px; width: 210px; pointer-events: auto; font-size: 12px; z-index: 1; }   /* parta vždy pod okny (usedlost, obchod…) */
#party .pt-head { display: flex; justify-content: space-between; align-items: center; color: #cfd6e4; font-weight: 700; margin-bottom: 4px; text-shadow: 0 1px 2px #000; }
#party .pt-leave { font-size: 11px; padding: 2px 8px; border-radius: 5px; border: 1px solid rgba(255,255,255,.2); background: rgba(0,0,0,.4); color: #ddd; cursor: pointer; }
#party .pt-m { background: rgba(10,13,20,.72); border: 1px solid rgba(255,255,255,.1); border-radius: 6px; padding: 4px 7px; margin-bottom: 4px; }
#party .pt-m.me { border-color: rgba(255,209,102,.4); }
#party .pt-m.dead { opacity: .55; }
#party .pt-n { display: flex; gap: 4px; align-items: center; color: #e8ecf3; text-shadow: 0 1px 2px #000; }
#party .pt-d { margin-left: auto; color: #c08bff; font-size: 11px; }
#party .pt-kick { margin-left: auto; background: none; border: 0; color: #ff8a8a; cursor: pointer; font-size: 14px; line-height: 1; }
#party .pt-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 3px; }
#party .pt-bar i { display: block; height: 100%; background: linear-gradient(90deg, #e2463c, #ff7b5c); }
#cech { left: 50%; top: 100px; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); max-height: calc(100% - 120px); overflow: auto; }
#cech .ce-zk { color: #ffd166; } #cech .ce-form { display: flex; gap: 10px; flex-wrap: wrap; } #cech .ce-form input, #cech #ce-poz { padding: 5px 7px; border-radius: 5px; border: 1px solid rgba(255,255,255,.2); background: rgba(0,0,0,.35); color: #fff; }
#cech .ce-list { padding: 8px 14px; } #cech .ce-m { display: flex; align-items: center; gap: 6px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.06); flex-wrap: wrap; }
#cech .ce-dot { width: 8px; height: 8px; border-radius: 50%; background: #555; } #cech .ce-m.on .ce-dot { background: #5ce08a; }
#cech .ce-h { color: #9fb3c8; font-size: 12px; } #cech .ce-akce { margin-left: auto; display: flex; gap: 4px; }
#cech .ce-akce button { font-size: 11px; padding: 2px 7px; border-radius: 5px; border: 1px solid rgba(255,255,255,.2); background: rgba(0,0,0,.35); color: #ddd; cursor: pointer; } #cech .ce-akce .bad { color: #ff8a8a; }
#cech .tr-foot { display: flex; gap: 8px; align-items: center; padding: 10px 14px 14px; }
#cech .ce-sez { padding: 4px 14px 10px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 6px; } #cech .ce-sez .tr-h { font-weight: 700; margin: 6px 0 2px; }
#cech-invite { left: 50%; top: 190px; transform: translateX(-50%); width: min(340px, calc(100% - 32px)); }
.player-title .ck { color: #ffd166; font-style: normal; font-weight: 700; }
#chat .cechc { color: #9bf0b0; } #chat .cch { color: #5ce08a; font-weight: 700; }
#pl-menu { width: 180px; padding: 4px 0; z-index: 30; }
#pl-menu .pm-h { padding: 6px 12px; font-weight: 700; color: #ffd166; border-bottom: 1px solid rgba(255,255,255,.1); }
#pl-menu button { display: block; width: 100%; text-align: left; padding: 7px 12px; background: none; border: 0; color: #e8ecf3; cursor: pointer; font-size: 13px; }
#pl-menu button:hover { background: rgba(255,255,255,.08); }
#trade-req { left: 50%; top: 150px; transform: translateX(-50%); width: min(320px, calc(100% - 32px)); }
#trade { left: 50%; top: 110px; transform: translateX(-50%); width: min(640px, calc(100% - 32px)); max-height: calc(100% - 130px); overflow: auto; }
#trade .tr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px 14px; }
#trade .tr-h { font-weight: 700; margin-bottom: 6px; }
#trade .tr-list { max-height: 230px; overflow: auto; background: rgba(0,0,0,.25); border-radius: 6px; padding: 6px 8px; }
#trade .tr-it { display: block; padding: 2px 0; cursor: pointer; }
#trade .tr-it.on { background: rgba(255,209,102,.1); }
#trade .tr-it label { cursor: pointer; }
#trade .tr-ks { display: flex; align-items: center; gap: 6px; margin: 3px 0 4px 24px; font-size: 12px; color: #c9d1dd; }
#trade .tr-pocet { width: 64px; padding: 4px 6px; background: rgba(0,0,0,.5); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 5px; font: inherit; font-size: 13px; }
#trade .tr-vse { padding: 3px 8px; font-size: 11px; border-radius: 5px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #e8ecf3; cursor: pointer; }
body.dotyk #trade .tr-pocet { width: 76px; padding: 8px; font-size: 16px; }   /* iOS: 16 px, jinak přiblíží stránku */
#trade .tr-silver { margin-top: 8px; }
#trade .tr-silver input { width: 90px; padding: 4px 6px; border-radius: 5px; border: 1px solid rgba(255,255,255,.2); background: rgba(0,0,0,.35); color: #fff; }
#trade .tr-foot { display: flex; gap: 8px; padding: 10px 14px 14px; }
@media (max-width: 560px) { #trade .tr-cols { grid-template-columns: 1fr; } }
#party-invite { left: 50%; top: 90px; transform: translateX(-50%); width: min(320px, calc(100% - 32px)); }
#chat .skc { color: #8fd3ff; } #chat .sk { color: #5cc8ff; font-weight: 700; }
.player-title.other { pointer-events: auto; cursor: pointer; }
#smena { left: 50%; top: 140px; transform: translateX(-50%); width: min(420px, calc(100% - 32px)); }
#smena .sm-row { display: flex; justify-content: space-between; padding: 3px 0; }
#smena input { width: 110px; padding: 6px 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,.2); background: rgba(0,0,0,.35); color: #fff; font-size: 15px; }
#smena .sm-warn { margin: 10px 0; padding: 8px 10px; border-radius: 6px; background: rgba(255,209,102,.1); border: 1px solid rgba(255,209,102,.35); }
.exbtn.gc { margin-left: 6px; border-color: rgba(255,209,102,.5); }
.exbtn.sklad { background: #1f2a3a; color: #cfe3ff; border-color: #3d5576; }
/* sklad v usedlosti */
.sk-sloupce { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.sk-h { font-weight: 700; margin-bottom: 4px; }
.sk-mriz { display: flex; flex-direction: column; gap: 3px; max-height: 300px; overflow-y: auto; background: rgba(0,0,0,.25); border-radius: 6px; padding: 5px; }
.sk-vec { text-align: left; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 5px; padding: 5px 7px; font: inherit; font-size: 12px; cursor: pointer; }
.sk-vec:hover { background: rgba(122,92,255,.25); }
.sk-vec.prazdny { color: #556; cursor: default; text-align: center; }
.sk-tl { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
body.dotyk .sk-vec { padding: 9px 8px; font-size: 13px; }
@media (max-width: 560px) { .sk-sloupce { grid-template-columns: 1fr; } }
#upg { left: 16px; top: 120px; width: min(520px, calc(100% - 32px)); max-height: calc(100% - 140px); overflow: auto; }
.ainfo .chance { color: #ffb347; }
.plus { color: #5fd8ff; font-weight: 800; }
.cell .pl { position: absolute; left: 3px; top: 1px; font-size: 10px; font-weight: 800; color: #5fd8ff; text-shadow: 0 1px 2px #000; }
.tt-plus { color: #5fd8ff; font-size: 12px; margin-top: 2px; }
#tracker { top: 200px; }
@media (max-width: 700px) { #minimap, #podzemi-mapa { width: 120px; height: 120px; } #wallet, #perf { right: 146px; } }

/* nastavení */
#set-open { position: absolute; right: 16px; top: 192px; width: 28px; height: 28px; border-radius: 6px; border: 1px solid rgba(255,255,255,.18); background: rgba(0,0,0,.5); color: #dde; font-size: 16px; line-height: 1; cursor: pointer; pointer-events: auto; }
#set-open:hover { background: rgba(86,54,217,.7); }
/* 👑 VIP vedle minimapy (pod měšcem) a okno s výhodami předplatného */
#vip-open { position: absolute; right: 198px; top: 108px; display: flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(255,209,102,.55); background: linear-gradient(180deg, rgba(58,44,10,.85), rgba(30,22,4,.85)); color: #ffd76a; font: 700 13px system-ui, sans-serif; cursor: pointer; pointer-events: auto; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
#vip-open small { font-size: 12px; letter-spacing: .5px; }
#vip-open:hover { background: linear-gradient(180deg, rgba(90,68,14,.95), rgba(44,32,6,.95)); }
#vip-open { animation: vip-aura 3.2s ease-in-out infinite; }   /* jemná zlatá aura – nepřehlédnutelná, ale nekřičí */
@keyframes vip-aura { 0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,.4), 0 0 6px 1px rgba(255,200,80,.25); } 50% { box-shadow: 0 2px 8px rgba(0,0,0,.4), 0 0 16px 4px rgba(255,200,80,.55); } }
#vip-open.otevreno { animation: none; box-shadow: 0 2px 8px rgba(0,0,0,.4), 0 0 8px 2px rgba(255,200,80,.35); }
@media (prefers-reduced-motion: reduce) { #vip-open { animation: none; box-shadow: 0 2px 8px rgba(0,0,0,.4), 0 0 10px 2px rgba(255,200,80,.4); } }
@media (max-width: 700px) { #vip-open { right: 146px; top: 100px; } }
body.dotyk #vip-open { right: 198px; top: 16px; height: 36px; }
@media (max-height: 520px) { body.dotyk #vip-open { right: 192px; top: 58px; height: 32px; } }   /* telefon na šířku: pod řadou tlačítek oken */
#vip-win { left: 50%; top: 90px; transform: translateX(-50%); width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 120px); overflow-y: auto; }
.vip-telo { padding: 8px 16px 16px; }
.vip-perex { font-size: 14px; margin: 6px 0 10px; }
.vip-stav.ok { background: rgba(80,200,120,.12); border: 1px solid rgba(80,200,120,.4); color: #9df0b5; border-radius: 8px; padding: 8px 12px; margin: 6px 0 10px; font-weight: 600; }
.vip-sloupce { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.vip-sloupce h4 { margin: 4px 0 6px; font-size: 14px; color: #ffd76a; }
.vip-seznam { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.vip-seznam li { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; line-height: 1.35; }
.vip-ik { flex: 0 0 22px; font-size: 16px; text-align: center; }
.vip-tl { display: flex; align-items: center; gap: 16px; margin: 16px 0 8px; flex-wrap: wrap; }
.vip-predplatit { display: inline-block; text-decoration: none; padding: 10px 26px; font-size: 15px; font-weight: 800; background: linear-gradient(180deg, #ffb93e, #f08c1a); color: #1d1405; border: 0; border-radius: 9px; box-shadow: 0 4px 14px rgba(240,140,26,.35); }
.vip-predplatit:hover { filter: brightness(1.08); }
.vip-vice { color: #cfd6e4; font-size: 13px; }
@media (max-width: 620px) { .vip-sloupce { grid-template-columns: 1fr; } }
#settings { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100% - 32px)); max-height: calc(100% - 40px); overflow: auto; }
#set-body { padding: 4px 16px 14px; }
#set-body .sgroup { margin: 14px 0 6px; font-weight: 700; color: #ffd166; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
#set-body .srow { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
#set-body .srow > span { flex: 0 0 44%; }
#set-body input[type=range] { flex: 1; accent-color: #7a5cff; }
#set-body .srow b { width: 46px; text-align: right; font-weight: 600; }
#set-body select { flex: 1; background: #1b2030; color: #e6e9ef; border: 1px solid rgba(255,255,255,.18); border-radius: 5px; padding: 4px; }
#set-body .controls { margin: 4px 0 10px; font-size: 13px; }
@media (max-width: 700px) { #set-open { top: 142px; } }

/* postava: atributy + strom dovedností */
#tal-badge { margin-top: 6px; background: linear-gradient(90deg, #ffb703, #ff7a00); color: #1a1000; border: 0; border-radius: 5px; padding: 3px 9px; font-weight: 700; font-size: 12px; cursor: pointer; pointer-events: auto; animation: talpulse 1.6s ease-in-out infinite; }
#tal-badge[hidden] { display: none; }
@keyframes talpulse { 50% { filter: brightness(1.25); box-shadow: 0 0 10px rgba(255,183,3,.6); } }
#talents { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(920px, calc(100% - 32px)); max-height: calc(100% - 30px); overflow: auto; }
.tal-wrap { display: flex; gap: 14px; padding: 12px 14px 14px; }
#tal-attrs { flex: 0 0 270px; }
.tal-right { flex: 1; min-width: 0; }
#tal-tree { width: 100%; max-height: 560px; display: block; touch-action: none; cursor: grab; }
.tal-pts { margin-bottom: 8px; }
.tal-attr { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.tal-attr .ai { font-size: 20px; width: 24px; text-align: center; }
.tal-attr .an { flex: 1; }
.tal-attr .av { color: #ffd166; font-weight: 700; margin-left: 4px; }
.plus-btn { width: 28px; height: 28px; border-radius: 6px; border: 0; background: #5636d9; color: #fff; font-size: 18px; font-weight: 700; cursor: pointer; }
.plus-btn:disabled { background: #2a2f3d; color: #667; cursor: default; }
.tal-sum { margin: 10px 0; line-height: 1.7; }
.tal-reset { display: flex; flex-wrap: wrap; gap: 6px; }
.dbtn.ghost { background: transparent; border: 1px solid rgba(255,255,255,.2); }
#tal-info { min-height: 52px; padding: 8px 10px; background: rgba(255,255,255,.04); border-radius: 6px; line-height: 1.6; }
.tal-node { cursor: pointer; }
.tal-node.can circle { animation: talglow 1.4s ease-in-out infinite; }
@keyframes talglow { 50% { opacity: .65; } }
.tal-node:hover circle { stroke: #fff; }
.tal-sector { font-size: 15px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.tal-cost { font-size: 13px; font-weight: 800; pointer-events: none; }
@media (max-width: 760px) { .tal-wrap { flex-direction: column; } #tal-attrs { flex: none; } }

/* inventář: suroviny, přetahování, koš */
.cell .lv.cnt { font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; font-size: 11px; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; opacity: .85; box-shadow: 0 6px 18px rgba(0,0,0,.6); }
#inv.dragging #inv-bag .cell:hover, #inv.dragging #inv-equip .cell:hover { background: rgba(122,92,255,.35); }
#inv-trash { width: 34px; height: 34px; margin-left: auto; border: 1px dashed rgba(255,255,255,.25); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 18px; opacity: .7; }
#inv.dragging #inv-trash { opacity: 1; border-color: #ff5a5a; background: rgba(255,60,60,.12); }
#inv-trash:hover { background: rgba(255,60,60,.25); }
#inv-confirm { margin-top: 8px; padding: 8px 10px; background: rgba(255,60,60,.12); border: 1px solid rgba(255,90,90,.4); border-radius: 6px; font-size: 12px; }
#inv-confirm[hidden] { display: none; }
.dbtn.danger { background: #c62f3a; }
.inv-foot { display: flex; align-items: center; gap: 10px; }

/* úkoly: kde co najít */
.dqh { color: #9fd3ff; margin: 4px 0 6px; font-size: 12px; }
.tqh { color: #aeb6c4; font-size: 11px; margin-top: 2px; }

/* účet GamersTogether */
.gt-ucet { margin: 10px 0 14px; padding: 10px 12px; border: 1px solid rgba(42,139,244,.45); border-radius: 8px; background: rgba(42,139,244,.08); text-align: left; }
.gt-ucet .gu-row { display: flex; align-items: center; gap: 10px; }
.gt-ucet .gu-row > div { flex: 1; min-width: 0; }
.gt-ucet .gu-logo { width: 34px; height: 34px; border-radius: 8px; background: #2A8BF4; color: #fff; font-weight: 900; display: flex; align-items: center; justify-content: center; font-size: 13px; flex: none; }
.gt-ucet .gu-sub { font-size: 12px; color: #aeb6c4; }
.gt-ucet .gu-sub a { color: #8cc4ff; }
.gt-ucet .gu-btn { background: #2A8BF4; color: #fff; border: 0; border-radius: 6px; padding: 7px 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.gt-ucet .gu-btn:disabled { opacity: .6; cursor: default; }
.gt-ucet .gu-ghost { background: transparent; border: 1px solid rgba(255,255,255,.25); }
.gt-ucet .gu-note { margin-top: 6px; font-size: 11px; color: #9aa3b2; }
.gt-ucet .gu-err { margin-top: 6px; font-size: 12px; color: #ff9a8a; }

/* úspěchy a titul nad hlavou */
#ach { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(640px, calc(100% - 32px)); max-height: calc(100% - 40px); overflow: auto; }
#ach-head select { background: #1b2030; color: #e6e9ef; border: 1px solid rgba(255,255,255,.18); border-radius: 5px; padding: 3px; }
#ach-list { padding: 0 14px 14px; }
.ach-cat { margin: 12px 0 6px; font-weight: 700; color: #ffd166; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.ach { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 6px; background: rgba(255,255,255,.03); margin-bottom: 5px; }
.ach.ok { background: rgba(255,209,102,.08); }
.ach-ic { font-size: 20px; width: 26px; text-align: center; opacity: .8; }
.ach-b { flex: 1; min-width: 0; }
.ach-bar { height: 5px; background: rgba(255,255,255,.08); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.ach-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb703, #ffd166); }
.ach-r { text-align: right; min-width: 120px; }
.player-title { position: absolute; left: 0; top: 0; pointer-events: none; text-align: center; white-space: nowrap; text-shadow: 0 1px 3px #000, 0 0 6px #000; }
.player-title .pt-title { display: block; color: #ffd166; font-weight: 800; font-size: 13px; letter-spacing: .03em; }
.player-title .pt-name { display: block; color: #e8ecf3; font-size: 12px; }
/* jmenovka: cech → titul → nick (👑) → malý průsvitný HP bar */
.player-title .pt-cech { display: block; color: #ffd166; font-size: 10px; font-weight: 700; opacity: .75; letter-spacing: .04em; }
.player-title .pt-title { opacity: .9; }
.player-title .pt-vip { margin-left: 3px; font-size: 11px; }
.player-title .pt-hp { display: block; width: 58px; height: 4px; margin: 2px auto 0; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.18); border-radius: 3px; overflow: hidden; box-shadow: 0 0 3px rgba(0,0,0,.4); }
.player-title .pt-hp i { display: block; height: 100%; background: rgba(110,220,120,.75); transition: width .25s; }
.player-title .pt-hp i.low { background: rgba(240,90,80,.8); }

/* chat a ostatní hráči */
#chat { position: absolute; left: 16px; bottom: 96px; width: min(360px, calc(100% - 32px)); pointer-events: auto; font-size: 12px; opacity: .55; transition: opacity .3s; }
#chat:hover, #chat.fresh, #chat:focus-within { opacity: 1; }
#chat-head { font-size: 11px; color: #9fb0c8; margin-bottom: 3px; text-shadow: 0 1px 2px #000; }
#chat-log { max-height: 150px; overflow-y: auto; background: rgba(0,0,0,.35); border-radius: 6px 6px 0 0; padding: 4px 8px; }
#chat-log .cl { padding: 1px 0; text-shadow: 0 1px 2px #000; word-wrap: break-word; }
#chat-log .cl b { color: #8cc4ff; font-weight: 700; } #chat-log .cl b.me { color: #ffd166; }
#chat-log .cl.sys { color: #9aa3b2; font-style: italic; }
#chat-input { width: 100%; box-sizing: border-box; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.15); border-radius: 0 0 6px 6px; color: #fff; padding: 5px 8px; font: inherit; outline: none; }
#chat-input:focus { border-color: #2A8BF4; }
.player-title.other .pt-name small { color: #ffd166; font-weight: 700; }
@media (max-width: 700px) { #chat { bottom: 150px; width: 240px; } }

/* fronta na kanál */
#fronta { margin: 10px 0; padding: 10px 12px; border-radius: 8px; background: rgba(255,183,3,.1); border: 1px solid rgba(255,183,3,.45); font-size: 13px; line-height: 1.5; text-align: left; }
#fronta .gu-btn { margin-top: 6px; background: transparent; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 6px; padding: 5px 10px; cursor: pointer; }
#fronta.plovouci { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 50; background: rgba(20,16,4,.92); max-width: 420px; }

.gt-ucet .gu-nick { margin-top: 8px; font-size: 12px; color: #dfe6f2; }
.gt-ucet .gu-nick-row { display: flex; gap: 6px; margin-top: 5px; }
.gt-ucet .gu-nick-row input { flex: 1; min-width: 0; background: #11151f; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; color: #fff; padding: 6px 8px; font: inherit; }
.gt-ucet .gu-note a { color: #8cc4ff; }
/* výběr postavy */
#postavy-vyber { margin: 10px 0 12px; }
#postavy-vyber h3 { margin: 4px 0 8px; font-size: 16px; }
.vp-sloty, .vp-tridy { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vp-slot, .vp-trida { background: rgba(255,255,255,.05); border: 1px solid var(--c, #556); border-radius: 10px; color: #fff; padding: 10px 8px; cursor: pointer; text-align: center; font: inherit; }
.vp-slot:hover, .vp-trida:hover { background: rgba(255,255,255,.12); }
.vp-slot.prazdny { border-style: dashed; color: #bbc; }
.vp-slot small, .vp-trida small { display: block; color: #aab; font-size: 12px; margin-top: 2px; }
.vp-ikona { font-size: 26px; color: var(--c, #ccc); line-height: 1.2; }
.vp-trida p { font-size: 12px; color: #ccd; margin: 6px 0; text-align: left; }
.vp-trida ul { margin: 0; padding-left: 0; list-style: none; text-align: left; font-size: 12px; color: #dde; }
.vp-trida li b { display: inline-block; width: 16px; color: var(--c); }
.vp-zpet { margin-top: 8px; }
#zmenit-postavu { margin-left: 8px; }
@media (max-width: 700px) { .vp-sloty, .vp-tridy { grid-template-columns: 1fr; } }
/* přehled schopností třídy v inventáři */
#inv-skilly { margin-top: 8px; padding: 8px; border-radius: 8px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); font-size: 12px; }
#inv-skilly .isk-head { font-weight: 700; margin-bottom: 4px; }
#inv-skilly .isk { display: flex; gap: 8px; padding: 3px 0; }
#inv-skilly .isk > b { flex: 0 0 18px; height: 18px; border-radius: 4px; background: #2a3150; color: #ffd166; text-align: center; line-height: 18px; }
#inv-skilly .isk span { font-weight: 700; color: #fff; }
#inv-skilly .isk small { color: #99a; }
#inv-skilly .isk p { margin: 1px 0 0; color: #ccd; line-height: 1.3; }
#podzemi-napoveda { position: fixed; left: 50%; bottom: 112px; transform: translateX(-50%); z-index: 30; padding: 6px 14px; border-radius: 8px; background: rgba(16,20,40,.85); border: 1px solid #ffd166; color: #fff; font-weight: 700; font-size: 14px; pointer-events: none; }
#podzemi-napoveda[hidden] { display: none; }
#dh-odejit { float: right; margin: -2px 0 0 8px; padding: 2px 8px; border-radius: 6px; border: 1px solid #8a6dd6; background: #2a2148; color: #fff; font-size: 12px; cursor: pointer; pointer-events: auto; }
/* Skill Shardy v okně Postava */
.tal-shardy { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.1); }
.tal-skill { margin: 6px 0; }
.tal-skill .ts-head { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.tal-skill .ts-head > b { width: 18px; height: 18px; border-radius: 4px; background: #2a3150; color: #ffd166; text-align: center; line-height: 18px; font-size: 12px; }
.tal-skill .ts-pips { margin-left: auto; display: flex; gap: 3px; }
.tal-skill .ts-pips i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid #7ad7ff; display: inline-block; }
.tal-skill .ts-pips i.on { background: #7ad7ff; }
.tal-skill .ts-pips i.op { border-color: #ffb347; }
.tal-skill .ts-pips i.op.on { background: #ffb347; box-shadow: 0 0 6px #ffb347; }
.tal-skill .ts-ranky { margin: 2px 0 0 24px; padding: 0; font-size: 11px; color: #99a; }
.tal-skill .ts-ranky li.ma { color: #dfe; }
.tal-skill .ts-ranky li.op { color: #cba070; }
.tal-skill .ts-ranky li.op.ma { color: #ffb347; font-weight: 700; }
/* Noční můry */
.mury-mod { margin: 8px 0; padding: 7px 10px; border-radius: 8px; background: rgba(90,122,255,.14); border: 1px solid rgba(90,122,255,.4); font-size: 13px; }
.mury-zeb { margin-top: 8px; font-size: 13px; }
.mury-zeb table { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: 12px; }
.mury-zeb th { text-align: left; color: #99a; font-weight: 600; padding: 2px 4px; }
.mury-zeb td { padding: 2px 4px; border-top: 1px solid rgba(255,255,255,.06); }
.mury-zeb tr.ja td { color: #ffd166; }
/* Usedlost */
#us-hud { pointer-events: auto; position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: rgba(14,18,30,.82); border: 1px solid rgba(122,216,138,.45); border-radius: 10px; padding: 6px 12px; text-align: center; z-index: 20; min-width: 220px; }
#us-hud-t { font-weight: 700; color: #9fe8a8; }
#us-hud-s { font-size: 12px; color: #bcc; margin: 2px 0 4px; }
.us-hud-b { display: flex; gap: 6px; justify-content: center; }
#us-win { left: 50%; top: 150px; transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 290px); overflow-y: auto; }   /* pod lištou usedlosti, nad dovednostmi */
#us-win.vlevo { left: 16px; top: 112px; transform: none; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 250px); }   /* sklad z inventáře: vedle inventáře */
#us-body { padding: 4px 14px 14px; }
@media (max-height: 520px) { #us-win, #us-win.vlevo { top: 8px; max-height: calc(100vh - 16px); } }
#us-body h4 { margin: 10px 0 4px; font-size: 14px; }
.us-urovne { margin: 4px 0 6px 18px; padding: 0; font-size: 12px; color: #99a; }
.us-urovne li.ma { color: #9fe8a8; }
.us-stavba { margin: 6px 0; padding: 6px 8px; border-radius: 8px; background: rgba(255,209,102,.08); border: 1px solid rgba(255,209,102,.3); font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.us-cena { white-space: nowrap; font-size: 12px; }
.us-cena.ok { color: #9fe8a8; } .us-cena.chybi { color: #ff8a7a; }
.us-seznam { display: flex; flex-direction: column; gap: 4px; }
.us-radek { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 7px; background: rgba(255,255,255,.04); font-size: 13px; }
.us-radek > div { flex: 1; }
.us-radek.ma { background: rgba(122,216,138,.1); }
.us-radek.zamceno { opacity: .55; }
.us-radek .ok { color: #9fe8a8; font-size: 12px; }
.us-ik { font-size: 22px; width: 28px; text-align: center; }
.us-on { color: #6fe08a; }
.us-akce { margin: 8px 0; }
/* interakce s blízkým hráčem klávesou E */
.player-title.other.e-blizko::after { content: '[E] skupina · obchod · cech'; display: block; font-size: 11px; font-weight: 700; color: #9fe8a8; margin-top: 1px; }
body.dotyk .player-title.other.e-blizko::after { content: 'E: skupina · obchod · cech'; }
/* mobil a tablet: větší cíle pro prst v oknech usedlosti, brány a v menu hráče */
body.dotyk #us-win, body.dotyk #dungeon-win { font-size: 14px; max-height: calc(100vh - 24px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
body.dotyk #us-win .small-btn, body.dotyk #dungeon-win .small-btn, body.dotyk #us-hud .small-btn { min-height: 38px; padding: 6px 12px; font-size: 13px; }
body.dotyk #us-win .dbtn, body.dotyk #dungeon-win .dbtn { min-height: 40px; }
body.dotyk .us-radek { padding: 8px; gap: 10px; }
body.dotyk .us-radek > div { min-width: 0; }
body.dotyk .us-stavba { font-size: 13px; }
body.dotyk #us-win .win-head .x, body.dotyk #dungeon-win .win-head .x { min-width: 40px; min-height: 40px; font-size: 22px; }
body.dotyk .mury-zeb, body.dotyk #us-body .mury-zeb { overflow-x: auto; }
body.dotyk #pl-menu { width: 220px; }
body.dotyk #pl-menu button { padding: 12px 14px; font-size: 15px; }
body.dotyk #us-hud { top: 58px; padding: 6px 10px; }
@media (max-height: 520px) { body.dotyk #us-hud { top: 54px; } body.dotyk #us-hud-s { font-size: 11px; } }
/* mobil: otevřená okna nad dotykovými tlačítky (jinak horní řada tlačítek zakryje křížek pro zavření) */
body.dotyk .win { z-index: 35; }
body.dotyk #pl-menu { z-index: 36; }

/* ---------- úvodní obrazovka (přihlášení, registrace, výběr postavy) ---------- */
#start { background: none; justify-content: flex-start; align-items: center; padding: 24px clamp(16px, 6vw, 96px); }
#start .uv-vinet { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(6,9,16,.92) 0%, rgba(6,9,16,.72) 34%, rgba(6,9,16,.15) 70%, rgba(6,9,16,.35) 100%), radial-gradient(ellipse at 70% 40%, rgba(0,0,0,0) 40%, rgba(0,0,0,.45) 100%); }
#start .uv-karta { position: relative; width: min(420px, 100%); max-height: calc(100dvh - 92px); margin-bottom: 26px; overflow-y: auto; padding: 26px 28px 20px; border-radius: 16px;
  background: rgba(14,18,30,.78); border: 1px solid rgba(232,199,106,.28); box-shadow: 0 20px 60px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); text-align: left; }
.uv-logo { margin-bottom: 18px; }
.uv-logo b { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 34px; line-height: 1.05; letter-spacing: .02em; color: #f1d58a; text-shadow: 0 2px 12px rgba(232,199,106,.35); }
.uv-logo small { display: block; margin-top: 4px; color: #aab3c5; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.uv-zalozky { display: flex; gap: 4px; padding: 4px; margin-bottom: 16px; border-radius: 10px; background: rgba(255,255,255,.06); }
.uv-zalozky button { flex: 1; padding: 9px 10px; border: 0; border-radius: 7px; background: none; color: #aab3c5; font-weight: 700; cursor: pointer; font-size: 14px; }
.uv-zalozky button.on { background: rgba(232,199,106,.18); color: #f1d58a; }
.uv-pole { display: block; margin-bottom: 12px; }
.uv-pole > span { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 600; color: #c4cbd8; }
.uv-pole input, .uv-heslo input { width: 100%; box-sizing: border-box; padding: 11px 12px; border-radius: 9px; border: 1px solid rgba(255,255,255,.14); background: rgba(5,8,14,.6); color: #eef1f6; font-size: 15px; outline: none; color-scheme: dark; }
.uv-pole input:focus, .uv-heslo input:focus { border-color: rgba(232,199,106,.7); box-shadow: 0 0 0 3px rgba(232,199,106,.15); }
.uv-heslo { position: relative; }
.uv-heslo input { padding-right: 44px; }
.uv-oko { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; cursor: pointer; opacity: .65; font-size: 16px; }
.uv-oko:hover { opacity: 1; }
.uv-kodpole { letter-spacing: .5em; font-size: 22px !important; text-align: center; }
.uv-radek { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: -2px 0 12px; }
.uv-odkaz { background: none; border: 0; padding: 4px 0; color: #9fc2ff; font-size: 13px; cursor: pointer; text-decoration: none; }
.uv-odkaz:hover { text-decoration: underline; }
.uv-odkaz:disabled { color: #6b7385; cursor: default; text-decoration: none; }
.uv-hlavni, #start #play { display: block; width: 100%; padding: 13px 16px; border: 0; border-radius: 10px; font-size: 16px; font-weight: 800; letter-spacing: .03em; cursor: pointer; color: #1a1408; background: linear-gradient(180deg, #f6dc8f, #d9a93e); box-shadow: 0 6px 18px rgba(217,169,62,.3); }
.uv-hlavni:hover:not(:disabled), #start #play:hover:not(:disabled) { filter: brightness(1.07); }
.uv-hlavni:disabled, #start #play:disabled { opacity: .55; cursor: default; box-shadow: none; }
.uv-nebo { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: #7d8698; font-size: 12px; }
.uv-nebo::before, .uv-nebo::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.12); }
.uv-discord { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px 14px; border: 0; border-radius: 10px; background: #5865f2; color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; }
.uv-discord:hover { background: #4752c4; }
.uv-souhlas { display: flex; gap: 9px; align-items: flex-start; margin: 4px 0 14px; font-size: 12.5px; color: #aab3c5; line-height: 1.4; }
.uv-souhlas input { margin-top: 2px; width: 17px; height: 17px; accent-color: #d9a93e; flex: none; }
.uv-souhlas a { color: #9fc2ff; }
.uv-chyba { margin: 0 0 12px; padding: 9px 11px; border-radius: 8px; background: rgba(255,90,74,.13); border: 1px solid rgba(255,90,74,.4); color: #ffb3aa; font-size: 13px; }
.uv-ok { margin: 0 0 12px; padding: 9px 11px; border-radius: 8px; background: rgba(122,216,138,.12); border: 1px solid rgba(122,216,138,.4); color: #b5f0bf; font-size: 13px; }
.uv-text { color: #c4cbd8; font-size: 13.5px; line-height: 1.5; margin: 0 0 14px; }
#start .uv-karta h2 { margin: 0 0 8px; font-size: 20px; color: #f1d58a; }
.uv-mini { margin: 14px 0 0; color: #7d8698; font-size: 12px; text-align: center; }
.uv-cekam { display: flex; align-items: center; gap: 10px; padding: 16px 0; color: #c4cbd8; }
.uv-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(232,199,106,.3); border-top-color: #f1d58a; animation: uvspin .9s linear infinite; }
@keyframes uvspin { to { transform: rotate(360deg); } }
.uv-uvitani { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 14px; border-radius: 10px; background: rgba(255,255,255,.05); }
.uv-uvitani small { display: block; color: #8d96a8; font-size: 11px; }
.uv-uvitani b { display: block; color: #eef1f6; font-size: 16px; }
.uv-uvitani > div { flex: 1; min-width: 0; }
.uv-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #d9a93e, #8a5a1e); color: #1a1408; font-weight: 800; font-size: 18px; flex: none; }
.uv-pred { display: inline-block; margin-top: 2px; font-size: 11px; color: #f1d58a; }
#start.uv-neprihlasen .uv-hra { display: none; }
.uv-hra #play { margin-top: 10px; }
.uv-hra #zmenit-postavu { margin-top: 8px; width: 100%; }
.uv-nacitani { margin-top: 14px; }
.uv-pruh { height: 4px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; }
.uv-pruh i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #d9a93e, #f6dc8f); transition: width .3s; }
#start #loading { margin: 6px 0 0; font-size: 12px; color: #8d96a8; text-align: left; }
.uv-horni { position: absolute; top: max(14px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); display: flex; gap: 8px; align-items: center; z-index: 2; }
.uv-ikona, .uv-jazyk { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.16); background: rgba(14,18,30,.72); color: #dde2ec; font-size: 15px; cursor: pointer; backdrop-filter: blur(8px); }
.uv-ikona span { font-size: 13px; }
.uv-ikona:hover, .uv-jazyk:hover { border-color: rgba(232,199,106,.5); }
.uv-jazyk select { background: none; border: 0; color: #dde2ec; font-size: 13px; cursor: pointer; outline: none; color-scheme: dark; }
.uv-pata { position: absolute; left: clamp(16px, 6vw, 96px); bottom: max(12px, env(safe-area-inset-bottom)); font-size: 12px; color: #7d8698; }
.uv-pata a { color: #9aa6bd; }
.uv-modal { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(4,6,12,.6); z-index: 5; padding: 16px; }
.uv-modal[hidden] { display: none; }
.uv-modal-box { width: min(680px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 18px 22px; border-radius: 14px; background: rgba(14,18,30,.96); border: 1px solid rgba(255,255,255,.14); }
.uv-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 17px; color: #f1d58a; }
.uv-modal-box table.controls { width: 100%; }
.uv-modal-box .credits { margin-top: 12px; font-size: 11px; color: #7d8698; }
body > #settings { position: fixed; z-index: 70; }
@media (max-width: 700px), (max-height: 520px) {
  #start { justify-content: center; padding: 64px 12px 36px; }
  #start .uv-vinet { background: rgba(6,9,16,.6); }
  #start .uv-karta { padding: 18px 18px 14px; max-height: calc(100dvh - 104px); }
  .uv-logo b { font-size: 26px; }
  .uv-ikona span { display: none; }
  .uv-pata { left: 50%; transform: translateX(-50%); white-space: nowrap; }
}
@media (max-height: 520px) { #start { padding-top: 58px; } .uv-logo { margin-bottom: 10px; } .uv-pole { margin-bottom: 8px; } .uv-pole input { padding: 9px 11px; } .uv-pata { display: none; } }
body.dotyk .uv-modal-box table.controls { display: none; }
@media (max-height: 520px) { .uv-horni { flex-direction: column; top: 50%; right: max(10px, env(safe-area-inset-right)); transform: translateY(-50%); } #start .uv-karta { margin-bottom: 0; max-height: calc(100dvh - 24px); } #start { padding: 12px 64px 12px 12px; } .uv-jazyk { padding: 0 8px; } .uv-jazyk select { width: 100%; padding: 0; opacity: 0; position: absolute; inset: 0; } .uv-jazyk { position: relative; } }
/* předplatné GT: korunka a VIP u jména */
.pt-vip { color: #ffd166; font-weight: 800; font-size: 11px; letter-spacing: .04em; text-shadow: 0 0 6px rgba(255,209,102,.55); }
.pf-name .pt-vip { font-size: 12px; }
/* okno Nastavení: stejný vzhled jako úvodní obrazovka, záložky Nastavení / Ovládání */
#settings { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 16px; background: rgba(14,18,30,.94); border: 1px solid rgba(232,199,106,.28); box-shadow: 0 20px 60px rgba(0,0,0,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
#settings .win-head { font-size: 18px; color: #f1d58a; font-family: Georgia, "Times New Roman", serif; padding: 14px 18px 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
#set-body { padding: 12px 18px 16px; }
.set-zalozky { display: flex; gap: 4px; padding: 4px; margin-bottom: 12px; border-radius: 10px; background: rgba(255,255,255,.06); }
.set-zalozky button { flex: 1; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: #aab3c5; font-weight: 700; cursor: pointer; font-size: 14px; }
.set-zalozky button.on { background: rgba(232,199,106,.18); color: #f1d58a; }
#set-body .sgroup { margin: 14px 0 6px; color: #f1d58a; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
#set-body .srow { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
#set-body .srow > span { flex: 1; color: #d6dbe6; }
#set-body input[type=range] { accent-color: #d9a93e; width: 150px; }
#set-body input[type=checkbox] { accent-color: #d9a93e; width: 17px; height: 17px; }
#set-body select { background: rgba(5,8,14,.6); color: #eef1f6; border: 1px solid rgba(255,255,255,.14); border-radius: 7px; padding: 5px 8px; color-scheme: dark; }
.set-tlacitka { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
#set-body table.controls { width: 100%; border-collapse: collapse; font-size: 13px; }
#set-body table.controls td { padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: top; color: #c4cbd8; }
#set-body table.controls td:first-child { width: 34%; white-space: nowrap; }
#set-body kbd { display: inline-block; padding: 2px 7px; border-radius: 6px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-bottom-width: 2px; color: #f1d58a; font: 600 12px system-ui, sans-serif; }
.set-dotyk { display: none; margin-bottom: 10px; padding: 9px 11px; border-radius: 9px; background: rgba(122,215,255,.08); border: 1px solid rgba(122,215,255,.25); color: #c9e9ff; font-size: 13px; line-height: 1.45; }
body.dotyk .set-dotyk { display: block; }
body.dotyk #set-body table.controls { display: none; }
#set-body .credits { margin-top: 12px; font-size: 11px; color: #7d8698; }
/* na úvodní obrazovce účet řeší přihlašovací karta – v nastavení se neopakuje */
body:has(#start:not([hidden])) #settings .set-ucet, body:has(#start:not([hidden])) #settings #set-postava { display: none; }
/* výběr postav: smazání postavy a účtu */
.vp-obal { position: relative; display: grid; }
.vp-obal .vp-slot { width: 100%; }
.vp-kos { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 7px; border: 1px solid transparent; background: rgba(0,0,0,.25); color: #c9ced8; font-size: 13px; cursor: pointer; opacity: .55; padding: 0; line-height: 1; }
.vp-kos:hover, .vp-kos:focus-visible { opacity: 1; border-color: rgba(255,90,74,.6); background: rgba(255,90,74,.18); }
body.dotyk .vp-kos { opacity: .85; width: 32px; height: 32px; }
.vp-smaz-ucet { display: block; margin: 6px auto 0; background: none; border: 0; color: #8d96a8; font-size: 12px; cursor: pointer; text-decoration: underline; }
.vp-smaz-ucet:hover { color: #ff9b8f; }
.vp-varovani { padding: 10px 12px; border-radius: 9px; background: rgba(255,90,74,.09); border: 1px solid rgba(255,90,74,.35); color: #e7d2cf; font-size: 13px; line-height: 1.45; }
.vp-varovani p { margin: 0 0 6px; } .vp-varovani ul { margin: 0 0 6px; padding-left: 18px; }
.vp-potvrd { display: block; margin: 12px 0 8px; font-size: 13px; color: #c4cbd8; }
.vp-potvrd input { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; padding: 10px 12px; border-radius: 9px; border: 1px solid rgba(255,255,255,.14); background: rgba(5,8,14,.6); color: #eef1f6; font-size: 15px; color-scheme: dark; }
.vp-potvrd input:focus { outline: none; border-color: rgba(255,90,74,.7); }
.vp-tlacitka { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.vp-smazat-ok { padding: 10px 16px; border: 0; border-radius: 9px; background: #c0392b; color: #fff; font-weight: 800; cursor: pointer; }
.vp-smazat-ok:hover:not(:disabled) { background: #d84433; } .vp-smazat-ok:disabled { opacity: .6; }
.vp-chyba { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: rgba(255,90,74,.13); border: 1px solid rgba(255,90,74,.4); color: #ffb3aa; font-size: 13px; }
.vp-info { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: rgba(122,216,138,.12); border: 1px solid rgba(122,216,138,.4); color: #b5f0bf; font-size: 13px; }
/* Sopel – batohy (rozšíření inventáře) */
@media (min-width: 1100px) { body.sopel-otevreno #dialog { left: calc(50% + 170px); width: min(480px, calc(100% - 470px)); } }   /* úkoly vedle okna s batohy */
#sopel-win { left: 16px; top: 112px; width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 250px); overflow-y: auto; }
.sp-telo { padding: 8px 14px 14px; }
.sp-ted { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; font-size: 13px; }
.sp-bon { color: #8fe3a5; font-size: 12px; }
.sp-seznam { display: flex; flex-direction: column; gap: 8px; }
.sp-radek { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: 8px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.06); }
.sp-radek.ma { border-color: rgba(255,209,102,.45); }
.sp-ik { font-size: 24px; width: 30px; text-align: center; }
.sp-info { flex: 1; font-size: 13px; line-height: 1.5; }
.sp-info .dbtn { margin-top: 4px; }
.sp-sloty { color: #ffd166; font-weight: 800; }
.sp-cena { margin-top: 4px; font-size: 12px; }
.q-batoh { color: #ffd166; }
@media (max-height: 520px) { #sopel-win { top: 8px; max-height: calc(100vh - 16px); } }

/* ---------- Dotykové rozhraní: jednotné měřítko podle fyzické velikosti displeje ----------
   --ui a --mapa nastavuje dotyk.js (velikostUi) z kratší strany displeje: malý telefon ~0,75, velký ~0,9, tablet 1.
   Ovládání se zmenšuje k rohu, ke kterému je přichycené – nic se nepřekrývá a prst trefí stejně (joystick počítá s měřítkem). */
html, body, .win, button { touch-action: pan-x pan-y; -webkit-touch-callout: none; -webkit-user-select: none; }   /* posouvání ano, přiblížení stránky (dvojklep, prsty) ne */
input, textarea, [contenteditable="true"], #chat-log { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
body.dotyk #player-frame { transform: scale(var(--ui, 1)); transform-origin: left top; }
body.dotyk #wallet { transform: scale(var(--ui, 1)); transform-origin: left top; top: calc(64px * var(--ui, 1)); }
body.dotyk #minimap, body.dotyk #podzemi-mapa { width: var(--mapa, 170px); height: var(--mapa, 170px); }
body.dotyk #set-open { top: calc(var(--mapa, 170px) + 22px); transform: scale(var(--ui, 1)); transform-origin: right top; }
body.dotyk #vip-open { right: calc(var(--mapa, 170px) + 28px); transform: scale(var(--ui, 1)); transform-origin: right top; }
body.dotyk #tracker { top: calc(var(--mapa, 170px) + 60px); transform: scale(var(--ui, 1)); transform-origin: right top; }
body.dotyk #joy { transform: scale(var(--ui, 1)); transform-origin: left bottom; }
body.dotyk #skillbar { transform: translateX(-50%) scale(var(--ui, 1)); transform-origin: center bottom; }
body.dotyk #belt { transform: translateX(-50%) scale(var(--ui, 1)); transform-origin: center bottom; bottom: calc(130px * var(--ui, 1)); }
body.dotyk #touch-akce { transform: scale(var(--ui, 1)); transform-origin: right bottom; }
body.dotyk #touch-cil { transform: scale(var(--ui, 1)); transform-origin: right bottom; bottom: calc(100px * var(--ui, 1)); }
body.dotyk #touch-btns { top: calc(var(--mapa, 170px) + 58px); transform: scale(var(--ui, 1)); transform-origin: right top; }   /* tablet: sloupec pod minimapou a nastavením (dřív zakrýval ozubené kolečko) */
body.dotyk #chat { transform: scale(var(--ui, 1)); transform-origin: left bottom; left: calc((170px * var(--ui, 1)) + env(safe-area-inset-left)); }
body.dotyk #party { transform: scale(var(--ui, 1)); transform-origin: left top; }
body.dotyk #castbar, body.dotyk #dungeon-hud, body.dotyk #wb-hud { zoom: var(--ui, 1); }
body.dotyk .win { zoom: var(--ui, 1); }
body.dotyk #pl-menu { zoom: 1; }   /* nabídka u jména hráče se umisťuje podle polohy jmenovky – bez zmenšení */
body.dotyk #tracker { right: calc(64px * var(--ui, 1) + 16px); }   /* tablet: vedle sloupce tlačítek, ne pod ním */   /* okna (inventář, mapa, dialogy…) úměrně menší na malém displeji */
@media (max-height: 520px) {   /* telefon na šířku */
  body.dotyk #touch-btns { top: 8px; transform: translateX(-50%) scale(var(--ui, 1)); transform-origin: center top; }   /* řada nahoře (pravidlo pro tablet by ji jinak posunulo doprostřed) */
  body.dotyk #belt { bottom: calc(104px * var(--ui, 1)); }
  body.dotyk #touch-cil { bottom: calc(26px * var(--ui, 1)); right: calc(92px * var(--ui, 1)); }
  body.dotyk:not(.chat-otevreny) #chat { top: calc(128px * var(--ui, 1)); left: 16px; transform-origin: left top; }
  body.dotyk #party { top: calc(128px * var(--ui, 1)); transform-origin: right top; }
  body.dotyk #vip-open { top: calc(58px * var(--ui, 1)); }
}
@media (orientation: portrait) and (pointer: coarse) { body.dotyk #touch-btns { top: 210px; transform: scale(var(--ui, 1)); transform-origin: right top; } }
body.dotyk.chat-otevreny #chat { transform: translateX(-50%); zoom: var(--ui, 1); }
/* hlášky bossů: bublina nad bossem + řádek v chatu */
.boss-bublina { position: absolute; left: 0; top: 0; max-width: 260px; padding: 7px 12px; border-radius: 12px; background: rgba(20, 12, 30, .9); border: 1px solid rgba(255, 120, 90, .7); color: #ffe7d6; font-size: 14px; font-weight: 600; font-style: italic; text-align: center; text-shadow: 0 1px 2px #000; box-shadow: 0 4px 16px rgba(0,0,0,.5); pointer-events: none; white-space: normal; z-index: 3; }
.boss-bublina::after { content: ''; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); border: 7px solid transparent; border-top-color: rgba(255, 120, 90, .7); border-bottom: 0; }
#chat-log .cl.boss { color: #ffb59a; font-style: italic; }
#chat-log .cl.boss b { color: #ff8a6a; font-style: normal; }
