/* ================================================================ REDESIGN 3: moderní souboj a RPG výbava
   Souboj: kompaktní panel uprostřed (podle full/gameplay/combat.png), ztmavený obrázek lokace v pozadí.
   Výbava: postava se sloty + mřížka batohu, karta předmětu po najetí (33_redesign2.js rpg*). */
:root { --rpg-gold: #e9c77b; --rpg-line: #ffffff1c; --rpg-panel: linear-gradient(160deg, #172333e6, #0a111ae6); --rpg-glow: 0 10px 30px #0008, inset 0 1px 0 #ffffff14; }

/* ---------------------------------------------------------------- SOUBOJ */
#tab-loc > .battle.rdb.rdb2 { width: 100%; max-width: 1380px; height: auto !important; min-height: 0 !important; margin: 4px auto 12px; align-self: start;
  grid-template-columns: 330px minmax(0, 1fr) 290px; grid-template-rows: auto auto auto auto; align-content: start; gap: 12px; padding: 14px;
  grid-template-areas: "head head head" "me skills foes" "log skills foes" "urgent urgent urgent";
  border: 1px solid #c9a25a55; border-radius: 16px; overflow: hidden;
  background: linear-gradient(180deg, #060b12d9 0%, #060b12f0 55%, #05080df7 100%), var(--rdb-bg, none) center 35% / cover no-repeat, #070c12;
  box-shadow: 0 24px 70px #000d, inset 0 1px 0 #ffffff18; }
.rdb2 :is(.rdb-me, .rdb-log, .rdb-skills, .rdb-foes) { border: 1px solid var(--rpg-line) !important; border-radius: 12px; background: var(--rpg-panel) !important; box-shadow: var(--rpg-glow) !important; backdrop-filter: blur(6px); padding: 10px !important; }
.rdb2 .rdb-head { padding: 2px 4px 0; }
.rdb2 .rdb-head h2 { font: 600 24px/1.2 var(--display-font, Georgia, serif) !important; color: #ffe6b0; text-shadow: 0 2px 8px #000; }
.rdb2 .rdb-count { border-radius: 999px; padding: 4px 12px; }
.rdb2 .rdb-foes > h3 span { border-radius: 999px; }
.rdb2 .battle-fighter { border: 0 !important; background: none !important; padding: 2px !important; }
.rdb2 .battle-fighter :is(img, .battle-portrait) { border-radius: 50%; }
.rdb2 .bar { border-radius: 7px; overflow: hidden; height: 18px; box-shadow: inset 0 1px 3px #000a; }
.rdb2 .battle-threat { border-radius: 10px; overflow: hidden; }
.rdb2 .rdb-log .battle-log { height: 210px !important; max-height: 210px !important; flex: 0 0 auto !important; border-radius: 8px; background: #050a10b3 !important; border: 1px solid var(--rpg-line) !important; }
.rdb2 .rdb-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important; grid-auto-rows: 104px !important; gap: 10px !important; overflow: visible !important; }
.rdb2 .rdb-skill { border-radius: 12px; border: 1px solid #c9a25a66 !important; background: radial-gradient(circle at 50% 30%, #24364a 0%, #111b27 60%, #0b121a 100%) !important;
  box-shadow: inset 0 1px 0 #ffffff1a, 0 6px 16px #0007; transition: transform .12s, box-shadow .12s, border-color .12s; }
.rdb2 .rdb-skill:hover:not(.off) { transform: translateY(-2px); border-color: var(--rpg-gold) !important; box-shadow: 0 0 0 1px var(--rpg-gold), 0 0 18px #e9c77b55, 0 8px 20px #0008; }
.rdb2 .rdb-skill .rdb-ico { font-size: 30px; filter: drop-shadow(0 0 6px #7fd8ff88); }
.rdb2 .rdb-skill .rdb-ico .battle-skill-art { width: 46px !important; height: 40px !important; }
.rdb2 .rdb-skill .rdb-copy b { font-size: 15px; }
.rdb2 .rdb-skill kbd { border-radius: 5px; }
.rdb2 .rdb-skill.good { box-shadow: 0 0 0 1px #85cf8b, 0 0 16px #85cf8b55; }
.rdb2 .rdb-cd { height: 4px; border-radius: 0 3px 3px 0; }
.rdb2 .rdb-foe { border-radius: 12px; background: linear-gradient(150deg, #2a1a1e, #120c0f) !important; border: 1px solid #7a3b34 !important; transition: border-color .12s, box-shadow .12s; }
.rdb2 .rdb-foe.sel { border-color: #ff8a5a !important; box-shadow: 0 0 0 1px #ff8a5a, 0 0 18px #ff6a3a55 !important; }
.rdb2 .rdb-foe .battle-portrait { width: 54px !important; height: 54px !important; flex-basis: 54px !important; border-radius: 50%; overflow: hidden; border: 2px solid #ff8a5a88; }
.rdb2 .rdb-foe-n { border-radius: 5px; }
.rdb2 .battle-urgent { gap: 10px; grid-template-columns: repeat(6, minmax(0, 1fr)) !important; padding: 10px; border: 1px solid var(--rpg-line); border-radius: 12px; background: var(--rpg-panel); }
.rdb2 .battle-urgent .btn { border-radius: 10px; min-height: 48px !important; background: linear-gradient(#26374a, #121c27) !important; border: 1px solid #c9a25a66 !important; font-weight: 600; }
.rdb2 .battle-urgent .btn:hover:not(:disabled) { border-color: var(--rpg-gold) !important; box-shadow: 0 0 12px #e9c77b44; }
@media (max-width: 1180px) {
  #tab-loc > .battle.rdb.rdb2 { grid-template-columns: minmax(0, 1fr) 260px; grid-template-areas: "head head" "me foes" "skills skills" "log log" "urgent urgent"; grid-template-rows: auto; }
  .rdb2 .battle-urgent { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 900px) { #tab-loc > .battle.rdb.rdb2 { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "me" "foes" "skills" "log" "urgent"; } }
body[data-mobile="true"] #tab-loc > .battle.rdb.rdb2 { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "me" "foes" "skills" "log" "urgent"; margin: 0; padding: 6px; gap: 6px; border-radius: 10px; }
body[data-mobile="true"] .rdb2 .rdb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; grid-auto-rows: 70px !important; gap: 6px !important; }
body[data-mobile="true"] .rdb2 .rdb-skill .rdb-ico .battle-skill-art { width: 30px !important; height: 26px !important; }
body[data-mobile="true"] .rdb2 .rdb-skill .rdb-copy b { font-size: 12px; }
body[data-mobile="true"] .rdb2 .rdb-log .battle-log { height: 74px !important; max-height: 74px !important; }
body[data-mobile="true"] .rdb2 .battle-urgent { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; padding: 6px; gap: 6px; }
body[data-mobile="true"] .rdb2 .battle-urgent .btn { min-height: 42px !important; }

/* ---------------------------------------------------------------- VÝBAVA */
.rpg-inv { display: grid; grid-template-columns: minmax(420px, 540px) minmax(0, 1fr); gap: 16px; max-width: 1480px; margin: 0 auto; align-items: start; }
.rpg-doll, .rpg-bag { border: 1px solid #c9a25a44; border-radius: 16px; box-shadow: 0 18px 50px #000a, inset 0 1px 0 #ffffff14; }
.rpg-doll { display: grid; grid-template-columns: 62px minmax(0, 1fr) 62px; gap: 12px; padding: 14px;
  background: radial-gradient(ellipse at 50% 30%, #3a2a4a 0%, #1a1626 40%, #0b0f16 80%); }
.rpg-col { display: flex; flex-direction: column; gap: 7px; }
.rpg-slot, .rpg-cell { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; padding: 5px; overflow: hidden; color: #9aa7b8; font: inherit; cursor: pointer;
  border: 1px solid #ffffff24; border-radius: 10px; background: linear-gradient(145deg, #1d2836, #0b1119); box-shadow: inset 0 2px 6px #0009;
  transition: transform .1s, box-shadow .12s, border-color .12s; }
.rpg-slot > :is(img, canvas, span:not(.rpg-ph)), .rpg-cell > :is(img, canvas, span:not(.rpg-lvl):not(.rpg-lock)) { max-width: 88%; max-height: 88%; }
.rpg-slot img, .rpg-cell img { width: 88%; height: 88%; object-fit: contain; filter: drop-shadow(0 2px 4px #000c); }
.rpg-slot:not(.empty), .rpg-cell:not(.empty) { border-color: currentColor; box-shadow: inset 0 0 16px -6px currentColor, inset 0 2px 6px #0009; }
.rpg-slot:hover, .rpg-cell:not(.empty):hover, .rpg-hot { transform: translateY(-1px); border-color: var(--rpg-gold) !important; box-shadow: 0 0 0 1px var(--rpg-gold), 0 0 16px #e9c77b55 !important; z-index: 1; }
.rpg-slot.empty { opacity: .75; }
.rpg-ph { font-size: 22px; color: #ffffff38; }
.rpg-cell.empty { cursor: default; background: linear-gradient(145deg, #141c27, #0a0f16); opacity: .7; }
.rpg-lvl { position: absolute; right: 3px; bottom: 2px; padding: 0 4px; border-radius: 4px; background: #000b; color: #f2e3c0; font: 600 10px/14px system-ui, sans-serif; }
.rpg-plus { position: absolute; left: 3px; top: 2px; color: #8df59a; font: 700 10px/12px system-ui, sans-serif; font-style: normal; text-shadow: 0 1px 2px #000; }
.rpg-lock { position: absolute; left: 2px; bottom: 1px; font-size: 10px; }
.rpg-hero { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-width: 0; }
.rpg-hero .rpg-hero-art, .rpg-hero > img, .rpg-hero > canvas { width: 100%; max-width: 330px; aspect-ratio: 3 / 4; height: auto; object-fit: cover; border-radius: 14px; border: 1px solid #e9c77b88; box-shadow: 0 0 40px #8a5cff33, 0 14px 30px #000c; }
.rpg-hero .rpg-hero-art img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.rpg-hero-name { text-align: center; }
.rpg-hero-name b { display: block; color: #ffe6b0; font: 600 22px/1.2 var(--display-font, Georgia, serif); text-shadow: 0 2px 6px #000; }
.rpg-hero-name small { color: #c9bda2; }
.rpg-hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: 100%; max-width: 340px; }
.rpg-hero-stats span { display: flex; flex-direction: column; align-items: center; padding: 6px 4px; border: 1px solid var(--rpg-line); border-radius: 10px; background: #0a1018cc; }
.rpg-hero-stats small { color: #a9b3c2; font-size: 11px; text-align: center; }
.rpg-hero-stats b { color: var(--rpg-gold); font-size: 17px; }
.rpg-bag { padding: 14px; background: linear-gradient(160deg, #152131, #0a1018); }
.rpg-bag header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.rpg-bag h3 { margin: 0; color: #ffe6b0; font: 600 20px/1.2 var(--display-font, Georgia, serif); }
.rpg-bag h3 small { color: #a9b3c2; font: 13px system-ui, sans-serif; }
.rpg-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.rpg-chip { padding: 6px 14px; border: 1px solid #ffffff26; border-radius: 999px; background: #0d1520; color: #d9cfb8; font: inherit; font-size: 13px; cursor: pointer; }
.rpg-chip:hover { border-color: var(--rpg-gold); }
.rpg-chip.on { border-color: var(--rpg-gold); background: linear-gradient(#6b5024, #3b2b12); color: #fff1cf; box-shadow: 0 0 10px #e9c77b44; }
.rpg-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 7px; }
.rpg-bag footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.rpg-hint { color: #8f9aab; }
/* Karta předmětu */
.rpg-card { position: fixed; z-index: 9000; width: 330px; max-height: calc(100vh - 16px); overflow: auto; padding: 12px; color: #e9e1cf;
  border: 1px solid #e9c77b88; border-radius: 14px; background: linear-gradient(165deg, #1b2738f7, #0a1018fa); box-shadow: 0 18px 50px #000d, inset 0 1px 0 #ffffff1a; backdrop-filter: blur(8px); }
.rpg-card[hidden] { display: none; }
.rpg-card-head { display: flex; gap: 10px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--rpg-line); }
.rpg-card-head > :first-child { flex: 0 0 56px; width: 56px; height: 56px; object-fit: contain; border-radius: 10px; background: #0007; }
.rpg-card-head b { display: block; font: 600 17px/1.2 var(--display-font, Georgia, serif); }
.rpg-card-head small { color: #a9b3c2; font-size: 12px; }
.rpg-card-body { padding: 8px 0; font-size: 13px; line-height: 1.45; }
.rpg-card-body :is(h3, h4) { font-size: 13px; margin: 6px 0 2px; }
.rpg-card-cmp { padding: 8px; border-radius: 10px; background: #0007; font-size: 13px; }
.rpg-card-cmp small { color: #a9b3c2; }
.rpg-card-cmp p { margin: 2px 0 0; }
.rpg-card-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rpg-card-acts .btn { flex: 1 1 auto; min-height: 36px; padding: 4px 10px; border-radius: 9px; font-size: 13px; }
.rpg-card-note { margin: 8px 0 0; color: #ffb38a; font-size: 12px; }
.rpg-card.sheet { left: 8px !important; right: 8px; top: auto !important; bottom: 76px; width: auto; max-height: 62vh; }
/* záložky inventáře moderněji */
.rd10-inventory .inventory-tabs .btn { border-radius: 10px; }
@media (max-width: 1100px) { .rpg-inv { grid-template-columns: minmax(0, 1fr); } }
body[data-mobile="true"] .rpg-inv { grid-template-columns: minmax(0, 1fr); gap: 10px; }
body[data-mobile="true"] .rpg-doll { grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 6px; padding: 8px; }
body[data-mobile="true"] .rpg-col { gap: 4px; }
body[data-mobile="true"] .rpg-slot { padding: 3px; border-radius: 8px; }
body[data-mobile="true"] .rpg-hero-name b { font-size: 17px; }
body[data-mobile="true"] .rpg-hero-stats b { font-size: 14px; }
body[data-mobile="true"] .rpg-bag { padding: 8px; }
body[data-mobile="true"] .rpg-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }

/* akční lišta: dvě skupiny (obrana | lektvary + útěk) přes celou šířku */
.rdb2 .battle-urgent, body[data-mobile="true"] .rdb2 .battle-urgent { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
.rdb2 .battle-urgent > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rdb2 .battle-urgent .btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tab-loc > .battle.rdb.rdb2 { background: linear-gradient(180deg, #060b1299 0%, #060b12d9 30%, #05080df2 70%), var(--rdb-bg, none) center 35% / cover no-repeat, #070c12; }
body[data-mobile="true"] .rdb2 .battle-urgent { grid-template-columns: minmax(0, 1fr) !important; }
body[data-mobile="true"] .rdb2 .battle-urgent .btn { white-space: normal; font-size: 12px; }
/* karta předmětu: název už je v záhlaví, první řádek popisu je zbytečný */
.rpg-card-body > :first-child:is(b, strong, h3, h4, .tip-title, div:first-child > b:first-child) { display: none; }
.rdb2 .rdb-me .battle-fighter { display: flex; align-items: center; gap: 12px; }
.rdb2 .rdb-me .battle-fighter .battle-portrait { width: 84px !important; height: 84px !important; flex: 0 0 84px !important; border-radius: 50%; overflow: hidden; border: 2px solid #e9c77baa; box-shadow: 0 0 18px #e9c77b44; }
.rdb2 .rdb-me .battle-fighter-copy { flex: 1; min-width: 0; }
.rdb2 .rdb-me .battle-fighter-copy strong { font: 600 18px/1.2 var(--display-font, Georgia, serif); color: #ffe6b0; }
body[data-mobile="true"] .rdb2 .rdb-me .battle-fighter .battle-portrait { width: 52px !important; height: 52px !important; flex-basis: 52px !important; }
/* telefon: souboj se musí vejít na obrazovku – schopnosti se posouvají, akční lišta je vždy vidět */
body[data-mobile="true"] #tab-loc > .battle.rdb.rdb2 { height: 100% !important; grid-template-rows: auto auto auto minmax(0, 1fr) auto auto; grid-template-areas: "head" "me" "foes" "skills" "log" "urgent"; }
body[data-mobile="true"] .rdb2 .rdb-skills { min-height: 0; overflow: auto; }
body[data-mobile="true"] .rdb2 .rdb-head h2 { font-size: 18px !important; }
body[data-mobile="true"] .rdb2 .rdb-me .battle-fighter .battle-portrait { width: 40px !important; height: 40px !important; flex-basis: 40px !important; }
body[data-mobile="true"] .rdb2 .rdb-me .battle-fighter-copy strong { font-size: 14px; }
body[data-mobile="true"] .rdb2 .rdb-foe .battle-portrait { width: 38px !important; height: 38px !important; flex-basis: 38px !important; }
body[data-mobile="true"] .rdb2 .rdb-log .battle-log { height: 56px !important; max-height: 56px !important; }
body[data-mobile="true"] .rdb2 .rdb-grid { grid-auto-rows: 58px !important; }
body[data-mobile="true"] .rdb2 .battle-urgent .btn { min-height: 36px !important; padding: 2px 4px !important; }
body[data-mobile="true"] .rdb2 .battle-urgent > div { gap: 4px; }
body[data-mobile="true"] .rdb2 .battle-urgent { gap: 4px; }
/* Charakter: portrét má poměr 3:4 a nesmí se roztáhnout do šířky (jinak je vidět jen brada) */
.chp-hero { align-items: center !important; }
.chp-hero .character-art.chp-hero-art { width: min(100%, 280px) !important; height: auto !important; aspect-ratio: 3 / 4; align-self: center; border-radius: 14px; overflow: hidden; box-shadow: 0 0 30px #8a5cff33, 0 12px 26px #000b; }
.chp-hero-copy { align-self: stretch; }
@container (max-width: 560px) { .chp-hero .character-art.chp-hero-art { width: 140px !important; } }
/* Charakter: stránka nejvýš 1500 px a uprostřed, ať se na širokém monitoru neroztahuje */
.chp-page { max-width: 1500px; margin-left: auto; margin-right: auto; }
/* Charakter: tři sloupce bez mezer – hrdina | vlastnosti + kořist | útok + přežití */
.chp-page { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr) minmax(0, 1fr) !important; align-items: start; gap: 12px !important; }
.chp-page > .chp-hero { grid-row: auto !important; }
.chp-stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.chp-stack > .chp-attrs { grid-row: auto; }
.chp-card { border-radius: 14px; border-color: #c9a25a55 !important; background: linear-gradient(160deg, #172333, #0a111a) !important; box-shadow: 0 12px 30px #0008, inset 0 1px 0 #ffffff12 !important; }
.chp-stat { border-radius: 8px; }
@container (max-width: 900px) { .chp-page { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; } .chp-page > .chp-hero { grid-column: 1 / -1; } }
@container (max-width: 560px) { .chp-page { grid-template-columns: minmax(0, 1fr) !important; } }
