.lorEnemyActor{position:absolute;top:0;left:0;z-index:50;cursor:pointer;pointer-events:auto;image-rendering:pixelated;background-size:800% 800%;background-repeat:no-repeat;transition:none;outline:0;}
.lorEnemyActor.walking{animation:lorEnemyWalkFrames 1s steps(3,end) both}
@keyframes lorEnemyWalkFrames{from{background-position-x:0}to{background-position-x:calc(-3 * var(--lor-enemy-size,32px))}}
.lorEnemyActor:hover,.lorEnemyActor:focus-visible{filter:drop-shadow(0 0 6px #8af064);outline:0;}
.lorMapContext{position:fixed;z-index:100000;min-width:250px;max-width:min(330px,92vw);padding:9px;display:grid;gap:7px;color:#edd9aa;background:linear-gradient(180deg,#452c1d 0%,#1c130d 72%,#140e09 100%);border:1px solid #8f6a3a;border-radius:8px;box-shadow:0 12px 32px #000c;font-family:Georgia,serif}
.lorMapContextTitle{display:grid;gap:2px;padding:4px 5px 8px;border-bottom:1px solid #7b5c36}
.lorMapContextTitle strong{font-size:15px;color:#f2d28d;letter-spacing:.2px}.lorMapContextTitle small{font-size:11px;color:#cdb086}
.lorMapContextItem{display:grid;grid-template-columns:32px minmax(0,1fr) 16px;align-items:center;gap:10px;width:100%;padding:8px 10px;background:linear-gradient(180deg,#4a311f 0%,#382315 100%);border:1px solid #75512c;color:#f0d5a1;border-radius:6px;cursor:pointer;text-align:left;font-family:inherit;box-shadow:inset 0 1px 0 #cda97426}
.lorMapContextItem:hover,.lorMapContextItem:focus-visible{background:linear-gradient(180deg,#5a3c26 0%,#422819 100%);border-color:#be9150;outline:0}.lorMapContextDanger{background:linear-gradient(180deg,#5a241e 0%,#411512 100%);border-color:#8e4b41}.lorMapContextDanger:hover,.lorMapContextDanger:focus-visible{background:linear-gradient(180deg,#6b2b23 0%,#4c1714 100%);border-color:#c36d60}
.lorMapContextIcon{width:24px;height:24px;display:grid;place-items:center;flex:none}.lorMapContextIcon img{width:24px;height:24px;display:block;image-rendering:pixelated}
.lorMapContextMeta{display:grid;gap:2px;min-width:0}.lorMapContextLabel{font-size:14px;color:#f4deaf}.lorMapContextDescription{font-size:11px;color:#bda27a;line-height:1.3}
.lorMapContextChevron{font-size:18px;color:#c99f60;text-align:right}
.lorEnemyContext{z-index:100000}
.lorEnemyContext b{font-size:13px;padding:3px}.lorEnemyContext button{background:#392615;border:1px solid #664c28;color:#eacb91;padding:7px;cursor:pointer;text-align:left;border-radius:3px}
.lorEnemyPopupOverlay{position:fixed;inset:0;z-index:100001;display:grid;place-items:center;background:#0008;padding:16px;box-sizing:border-box}
.lorEnemyPopup{width:min(400px,100%);padding:20px;color:#e7d5af;background:linear-gradient(#2b2014,#110d09);border:2px ridge #96713e;border-radius:9px;box-shadow:0 16px 50px #000d;font-size:14px}
.lorEnemyPopup h3{margin:0 0 12px;color:#f3cf82}.lorEnemyPopup p{line-height:1.55;overflow-wrap:anywhere}.lorEnemyPopupButtons{display:flex;flex-wrap:wrap;gap:7px;justify-content:flex-end;margin-top:18px}.lorEnemyPopupButtons button{border:1px solid #8f6b35;background:#382714;color:#f0d297;padding:8px 16px;border-radius:4px;cursor:pointer}
/* Backoffice enemy collection & dialog */
.lorEnemyAdminTitle{display:flex;align-items:center;gap:10px;white-space:nowrap}
.lorEnemyAdminThumb{display:inline-block;flex:none;width:38px;height:38px;background-repeat:no-repeat;background-size:800% 800%;background-position:0 0;image-rendering:pixelated;background-color:#0a0c08;border:1px solid #655136;border-radius:4px}
.lorEnemyAdminThumb.missing{display:grid;place-items:center;color:#ba9565}
#lorEnemyEditorOverlay[hidden]{display:none!important}
.lorEnemyAdminModal{width:min(810px,calc(100vw - 24px));max-height:min(88vh,850px)}
.lorEnemyAdminForm{overflow:auto;padding:16px;box-sizing:border-box;align-content:start;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.lorEnemyAdminForm .lorAdminField{min-width:0}
.lorEnemyAdminForm .lorAdminInput,.lorEnemyAdminForm .lorAdminSelect{width:100%;box-sizing:border-box}
.lorEnemySkillChoices{max-height:190px;overflow:auto;display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:8px;padding:10px;border:1px solid #3c2d1b;border-radius:4px}
.lorEnemySkillChoices label{font-size:12px;line-height:1.4}
.lorEnemyEditorActions{grid-column:1/-1;display:flex;gap:9px;justify-content:flex-end;padding:13px 0 0;border-top:1px solid #3b291b}
@media(max-width:780px){.lorEnemyAdminForm{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.lorEnemyAdminForm{grid-template-columns:1fr}}

.lorEnemySpawnerEditor{display:grid;grid-template-columns:1fr 1fr;gap:9px;padding:14px;overflow:auto}
.lorEnemySpawnerEditor .lorAdminField{min-width:0}
.lorEnemySpawnerEditor .lorAdminField:first-child,.lorEnemySpawnerEditor .lorAdminField:nth-child(2),.lorEnemySpawnerEditor .lorAdminHelp,.lorEnemySpawnerEditor .lorAdminConfirmActions{grid-column:1/-1}
.lorEnemySpawnerEditor input,.lorEnemySpawnerEditor select{width:100%;box-sizing:border-box}
@media(max-width:490px){.lorEnemySpawnerEditor{grid-template-columns:1fr}.lorEnemySpawnerEditor .lorAdminField{grid-column:1/-1}}

/* Combat signal stays attached to both actors and does not change enemy occupancy. */
.lorEnemyBattleBubble{position:absolute;left:0;top:0;z-index:75;display:flex;align-items:center;justify-content:center;width:40px;height:34px;background:#f7edd1;border:2px solid #75532d;border-radius:55% 55% 45% 45%;color:#4b2514;box-shadow:0 2px 10px #000b;pointer-events:none;transition:none;}
.lorEnemyBattleBubble::after{content:"";position:absolute;bottom:-8px;left:calc(50% - 6px);border-width:8px 6px 0;border-style:solid;border-color:#f7edd1 transparent transparent;}
.lorEnemyBattleBubble span{font-size:25px;line-height:1;filter:drop-shadow(0 1px 0 #98652a);}
.lorEnemyActor.inBattle{filter:drop-shadow(0 0 5px #df7944)}
.lorEnemyAssetUpload{grid-column:1/-1;border:1px solid #634b2c;border-radius:6px;padding:10px;}
.lorEnemyAssetUpload small{color:#bfa67f;font-size:11px;}
.lorEnemySpritePreview{min-height:38px;margin:8px 0;}
.lorEnemyAssetUpload [readonly]{opacity:.8}

/* Table action buttons must not touch in compact admin layouts. */
.lorEnemyRowActions{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:4px 8px 4px 0}
.lorEnemySpriteHelp{font-size:11px;color:#bda27a}
.lorEnemyActor{will-change:transform}

/* Enemy template editor helpers: keyboard-, mouse- and touch-accessible. */
.lorEnemyLabel{display:flex;align-items:center;gap:6px;min-height:17px}
.lorEnemyInfo{display:inline-flex;position:relative;font-size:12px;font-weight:normal;flex:none}
.lorEnemyInfo>summary{display:grid;place-items:center;width:16px;height:16px;cursor:help;border:1px solid #80643e;border-radius:50%;color:#e5bf77;font-size:11px;line-height:1;list-style:none;background:#2a2015;font-weight:bold;user-select:none}
.lorEnemyInfo>summary::-webkit-details-marker{display:none}
.lorEnemyInfo>summary:focus-visible{outline:2px solid #e8c779;outline-offset:2px}
.lorEnemyInfoBubble{display:none;position:absolute;top:23px;left:-8px;z-index:200;min-width:185px;width:max-content;max-width:min(270px,65vw);padding:9px 11px;border:1px solid #86633b;border-radius:5px;background:#20170e;color:#f2dbb2;font-size:12px;font-weight:normal;line-height:1.45;box-shadow:0 9px 30px #000c;white-space:normal;pointer-events:none}
.lorEnemyInfo[open] .lorEnemyInfoBubble,.lorEnemyInfo:hover .lorEnemyInfoBubble,.lorEnemyInfo:focus-within .lorEnemyInfoBubble{display:block}
.lorEnemyAdminForm .lorAdminField:has(.lorEnemyInfo[open]){z-index:20}
.lorEnemyCombo input[hidden]{display:none!important}
.lorEnemyFormulaNote{border-left:3px solid #956b37;background:#251b12;color:#d0b999;border-radius:4px;padding:11px;font-size:12px;line-height:1.5}
.lorEnemySpriteTrigger{display:flex;align-items:center;text-align:left;gap:10px;width:100%;min-width:0;padding:5px 9px!important}
.lorEnemySpriteSelected{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.lorEnemySpriteTrigger .lorEnemyAdminThumb{width:32px;height:32px}
.lorEnemySpriteModalOverlay{z-index:13010!important}
.lorEnemySpriteModalOverlay[hidden],.lorEnemySpriteOption[hidden]{display:none!important}
.lorEnemySpritePickerModal{width:min(720px,calc(100vw - 24px));max-height:min(80vh,740px)}
.lorEnemySpriteSearch{padding:12px;border-bottom:1px solid #39291c}
.lorEnemySpriteSearch .lorAdminInput{width:100%;min-width:0}
.lorEnemySpriteGrid{flex:1;min-height:130px;overflow:auto;display:grid;align-content:start;grid-template-columns:repeat(auto-fill,minmax(125px,1fr));gap:10px;padding:12px}
.lorEnemySpriteOption{min-width:0;display:flex;flex-direction:column;align-items:center;gap:8px;cursor:pointer;border:1px solid #54402b;background:#15100c;color:#e8d4ad;border-radius:7px;padding:12px 6px;font-family:inherit}
.lorEnemySpriteOption:hover,.lorEnemySpriteOption:focus-visible{border-color:#c5984f;background:#302115;outline:0}
.lorEnemySpriteOption.selected{border-color:#90b872;box-shadow:inset 0 0 0 1px #668b55}
.lorEnemySpriteOptionThumb{display:block;width:72px;height:72px;flex:none;image-rendering:pixelated;background-color:#080a08;background-size:800% 800%;background-position:0 0;background-repeat:no-repeat;border-radius:5px}
.lorEnemySpriteOptionName{max-width:100%;overflow-wrap:anywhere;font-size:11px;text-align:center}
.lorEnemySpritePickerFooter{display:flex;justify-content:flex-end;gap:8px;padding:10px;border-top:1px solid #39291c}

/* Kodex / journal. The existing game-panel frame supplies the medieval chrome. */
.lorKodex{color:#dfcda4;padding:12px;max-width:780px;width:min(780px,calc(100vw - 65px));box-sizing:border-box}
.lorKodexIntroduction{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;padding-bottom:12px;border-bottom:1px solid #71512c}
.lorKodexIntroduction b{color:#f1cf85;font-size:17px}.lorKodexIntroduction p{margin:5px 0;color:#c2a982;font-size:12px}
.lorKodexProgress{padding:7px 10px;border:1px solid #76542a;border-radius:6px;white-space:nowrap;color:#f0d29c}
.lorKodexLayout{display:grid;grid-template-columns:minmax(165px,32%) 1fr;gap:12px;margin-top:13px;max-height:min(56vh,530px);min-height:220px}
.lorKodexCollection{overflow-y:auto;display:flex;flex-direction:column;gap:5px;min-width:0;padding-right:5px}
.lorKodexItem{width:100%;display:flex;align-items:center;text-align:left;gap:9px;background:#1f190fdc;color:#e9d5a7;border:1px solid #5d4529;border-radius:5px;padding:6px;cursor:pointer}
.lorKodexItem.active{background:#382715;border-color:#d7a34e}.lorKodexItem:not(:disabled):hover{border-color:#b78a48}
.lorKodexItem.locked{opacity:.55;cursor:default}
.lorKodexItemText{display:flex;flex-direction:column;gap:3px;min-width:0}.lorKodexItemText b{font-size:13px;overflow-wrap:anywhere}.lorKodexItemText small{font-size:11px;color:#af9977}
.lorKodexSprite{width:44px;height:44px;flex:none;display:block;background-repeat:no-repeat;background-position:0 0;background-size:800% 800%;image-rendering:pixelated;background-color:#0c100d;border:1px solid #5f5039;border-radius:5px}
.lorKodexUnknown{display:grid;place-items:center;color:#7e7664;background:#151311;font-size:24px}
.lorKodexDetails{overflow-y:auto;min-width:0;padding:1px 8px 12px}.lorKodexEntry[hidden]{display:none!important}
.lorKodexHero{display:flex;gap:14px;align-items:center}.lorKodexHero h2{margin:0;color:#f1cf82;font-size:23px}.lorKodexHero p{margin:7px 0;color:#c6ac86}
.lorKodexHeroArt{display:grid;place-items:center;width:116px;height:116px;flex:none;background:#0e140c;border:2px solid #725633;border-radius:8px}
.lorKodexBigSprite{display:block;width:88px;height:88px;background-size:800% 800%;background-position:0 0;background-repeat:no-repeat;image-rendering:pixelated}
.lorKodexElement{display:inline-block;border:1px solid #856338;border-radius:4px;padding:4px 8px;color:#ebd5ad;font-size:12px}
.lorKodexEntry h3{font-size:15px;margin:18px 0 7px;color:#e6c38b}.lorKodexLore{line-height:1.65;font-size:13px;white-space:normal;overflow-wrap:anywhere}
.lorKodexFacts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:14px}.lorKodexFacts div{border:1px solid #5d482b;background:#1e180fc0;padding:8px;border-radius:4px;display:grid;gap:6px}.lorKodexFacts small{font-size:10px;color:#bda582}.lorKodexFacts b{font-size:16px;color:#f5db9c}
.lorKodexSkills{font-size:12px;color:#e4cca0}.lorKodexEmpty{text-align:center;padding:24px 12px;color:#c9b594;line-height:1.6}
.lorEnemyLoreInput{resize:vertical;min-height:75px;width:100%;box-sizing:border-box}
@media(max-width:650px){.lorKodex{width:calc(100vw - 40px);padding:8px}.lorKodexLayout{grid-template-columns:110px minmax(0,1fr);gap:6px}.lorKodexHero{flex-direction:column;align-items:flex-start}.lorKodexHeroArt{width:85px;height:85px}.lorKodexBigSprite{width:70px;height:70px}.lorKodexFacts{grid-template-columns:1fr}.lorKodexItem{gap:4px;padding:4px}.lorKodexSprite{width:32px;height:32px}}

/* Kodex: an actual two-page journal, reusing the Login book's parchment textures
   and the 3D page-turn technique without touching Login's global book state. */
.pannelContainer:has(.lorKodexBook){width:min(970px,calc(100vw - 22px));max-width:none;height:min(770px,calc(var(--lor-kodex-game-height, 100dvh) - 12px),calc(100dvh - 70px));max-height:calc(var(--lor-kodex-game-height, 100dvh) - 12px);}
.pannelContainer:has(.lorKodexBook)>.pannelContainerContent{width:100%;}
.pannelContainer:has(.lorKodexBook) .pannelContent{overflow:hidden;display:flex;min-height:0;}
.lorKodexBook{display:flex;flex-direction:column;position:relative;color:#402913;width:100%;height:100%;max-height:100%;min-height:0;font-family:Georgia,serif;box-sizing:border-box;padding:8px 17px 11px;background:#321e0c url('../assets/img/background/login/BookCover.webp') center/100% 100% no-repeat;border-radius:8px;}
.lorKodexTabs{display:flex;align-items:flex-end;gap:5px;padding:0 24px;flex:none;flex-wrap:wrap;position:relative;z-index:1;}
.lorKodexTab{font-family:inherit;min-width:95px;padding:8px 11px 7px;color:#e8d5a9;border:1px solid #74512d;background:linear-gradient(#49301b,#28180d);border-radius:6px 6px 0 0;cursor:pointer;display:flex;gap:9px;align-items:center;justify-content:space-between;font-weight:bold;}
.lorKodexTab small{font-size:10px;color:#c4a776;font-family:Arial,sans-serif;white-space:nowrap;}
.lorKodexTab.active,.lorKodexTab[aria-selected="true"]{background:#d8bf8c;border-color:#b08b51;color:#4d2c11;}
.lorKodexTab.active small{color:#785124}
.lorKodexTab:focus-visible,.lorKodexIndexRow:focus-visible,.lorKodexControls button:focus-visible{outline:2px solid #c98c3a;outline-offset:-2px}
.lorKodexBinding{display:grid;grid-template-columns:minmax(0,1fr) 14px minmax(0,1fr);min-height:0;flex:1;perspective:1450px;filter:drop-shadow(0 2px 7px #0008);}
.lorKodexLeaf{background:linear-gradient(90deg,#8a633636,#f0dfbc22 9%,transparent 24%,#66452320 98%),url('../assets/img/background/charSelection/BookPageBlank.webp') center/100% 100% no-repeat;position:relative;min-width:0;min-height:0;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#a98559 transparent;padding:24px clamp(15px,3vw,35px) 18px;box-sizing:border-box;}
.lorKodexIndexLeaf{border-radius:4px 0 0 4px;}
.lorKodexDetailLeaf{border-radius:0 4px 4px 0;background-image:linear-gradient(270deg,#8a633636,#f0dfbc22 9%,transparent 24%,#66452320 98%),url('../assets/img/background/charSelection/BookPageBlank.webp');}
.lorKodexSpine{background:linear-gradient(90deg,#48260855,#3b2413c9 45%,#d8ba8666 95%);box-shadow:inset 0 0 8px #2b190dbb;}
.lorKodexPageHeading{text-align:center;border-bottom:1px solid #a08052;margin-bottom:15px;padding-bottom:12px;}
.lorKodexPageHeading small{color:#88683c;letter-spacing:2px;text-transform:uppercase;font-size:10px;}
.lorKodexPageHeading h2{font-size:clamp(18px,2.6vw,25px);margin:5px 0 7px;color:#4b2c16;text-shadow:none;}
.lorKodexPageHeading p{color:#775438;font-size:12px;line-height:1.4;margin:0;}
.lorKodexIndexSection[hidden],.lorKodexDetail[hidden],.lorKodexEmptyPage[hidden]{display:none!important}
.lorKodexIndexSection{height:100%;display:flex;flex-direction:column;}
.lorKodexIndexEntries{display:flex;flex-direction:column;gap:2px;min-height:0;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#ab8864 transparent;flex:1;}
.lorKodexCategoryBlock{display:flex;flex-direction:column;gap:1px;margin:0 0 10px;}
.lorKodexCategoryTitle{position:sticky;top:0;z-index:1;margin:0;padding:7px 6px 5px;color:#6b4723;font:700 12px Georgia,serif;letter-spacing:.6px;text-transform:uppercase;background:linear-gradient(180deg,#efe0be 0%,#ead8b2 70%,#e1cb9d 100%);border-top:1px solid #c3a06e;border-bottom:1px solid #c3a06e;box-shadow:0 1px 0 #fff4, inset 0 1px 0 #fff8;}
.lorKodexIndexRow{font:14px Georgia,serif;line-height:1.25;display:flex;align-items:center;justify-content:space-between;gap:12px;background:transparent;border:0;border-bottom:1px dotted #bba07885;color:#4b2e1c;padding:8px 6px;text-align:left;cursor:pointer;}
.lorKodexIndexRow:not(:disabled):hover,.lorKodexIndexRow.active{background:#d5b78670;color:#261407;}
.lorKodexIndexRow.locked{color:#968472;cursor:default;}
.lorKodexIndexRow span:last-child{color:#866436;white-space:nowrap;}
.lorKodexNoDiscoveries{font:italic 13px/1.55 Georgia,serif;color:#856947;text-align:center;margin:30px 8px;}
.lorKodexIndexSection footer{border-top:1px solid #b8a07a;color:#886a45;padding-top:9px;font-size:11px;margin-top:8px;text-align:center;}
.lorKodexDetail{padding:0 5px 12px;min-height:100%;}
.lorKodexPortrait{height:clamp(106px,19vh,176px);display:grid;place-items:center;margin:7px 0 20px;background:radial-gradient(ellipse,#b69b7090,#e1c99f42 54%,transparent 76%);}
.lorKodexPortraitImage{display:block;width:clamp(88px,16vh,142px);height:clamp(88px,16vh,142px);background-size:contain;background-position:center;background-repeat:no-repeat;image-rendering:pixelated;filter:drop-shadow(1px 5px 3px #4c321070);}
.lorKodexPortraitImage.sheet{background-size:800% 800%;background-position:0 0;}
.lorKodexPortraitUnknown{font-size:55px;color:#886b46;}
.lorKodexDetailFacts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 18px;}
.lorKodexDetailFacts>div{display:grid;gap:3px;padding:5px 2px;border:0;background:none;min-width:0;}
.lorKodexDetailFacts small{font:10px Arial,sans-serif;color:#806340;}
.lorKodexDetailFacts b{font-size:13px;overflow-wrap:anywhere;color:#3f2715;}
.lorKodexDescription{padding:7px 3px;}
.lorKodexDescription h3{font-size:16px;margin:13px 0 8px;color:#67431f;border-bottom:1px solid #b293634d;padding-bottom:5px;}
.lorKodexDescription p{font-size:13px;line-height:1.65;color:#513822;white-space:normal;overflow-wrap:anywhere;margin:0;}
.lorKodexEmptyPage{min-height:100%;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;color:#806043;gap:12px;}
.lorKodexEmptyPage span{font-size:57px;opacity:.48}
.lorKodexEmptyPage h2{margin:0;font-size:19px}
.lorKodexEmptyPage p{max-width:230px;line-height:1.6;font-size:13px}
.lorKodexControls{display:flex;align-items:center;justify-content:space-between;gap:12px;color:#e6d3a7;padding:8px 32px 0;flex:none;font:12px Georgia,serif;}
.lorKodexControls button{position:relative;color:#f4e4bf;background:linear-gradient(180deg,#6b4623 0%,#4b2f16 48%,#362110 100%);border:1px solid #9e7645;border-radius:5px;cursor:pointer;padding:7px 16px;font:700 13px Georgia,serif;box-shadow:inset 0 1px 0 #cfae77, inset 0 -1px 0 #241306, 0 2px 4px #0005;text-shadow:0 1px 0 #2a1608;}
.lorKodexControls button:hover:not(:disabled){background:linear-gradient(180deg,#77502a 0%,#553619 48%,#3d2511 100%);}
.lorKodexControls button::before{content:"";position:absolute;left:8px;right:8px;top:3px;height:1px;background:#dfc18c55;pointer-events:none;}
.lorKodexControls button:disabled{opacity:.45;cursor:default;}
.lorKodexFlip{position:absolute;z-index:4;top:0;left:0;width:100%;height:100%;pointer-events:none;visibility:hidden;transform-origin:left center;backface-visibility:hidden;background:linear-gradient(90deg,#ba9a6e72,#f7e4be 18%,#dbb888 95%);box-shadow:3px 2px 9px #3b27175e;}
.lorKodexFlip.turning{visibility:visible;animation:lorKodexTurnPage .53s ease-in-out forwards;}
@keyframes lorKodexTurnPage{0%{transform:rotateY(0deg);opacity:.95}80%{opacity:.65}100%{transform:rotateY(-175deg);opacity:0;visibility:hidden}}
/* On narrow screens the Kodex is read one FULL page at a time.
   Two half-width pages forced tiny text and clipped longer descriptions. */
.lorKodexMobileNavigation{display:none;}
@media(max-width:700px){
.pannelContainer:has(.lorKodexBook){width:min(460px,calc(100vw - 8px));max-width:calc(100vw - 8px);height:min(790px,calc(var(--lor-kodex-game-height, 100dvh) - 12px),calc(100dvh - 70px));max-height:calc(var(--lor-kodex-game-height, 100dvh) - 12px);}
.pannelContainer:has(.lorKodexBook)>.pannelContainerContent{min-height:0;}
.lorKodexBook{min-height:0;padding:9px 12px 11px;}
.lorKodexTabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:0 7px;gap:3px;}
.lorKodexTab{min-width:0;display:flex;flex-direction:row;gap:5px;justify-content:space-between;padding:7px 9px;font-size:12px;line-height:1.1;}
.lorKodexTab small{font-size:10px;}
.lorKodexMobileNavigation{display:flex;flex:none;justify-content:center;gap:5px;padding:7px 15px;}
.lorKodexMobileNavigation button{position:relative;flex:1;max-width:200px;padding:8px 10px;font:700 13px Georgia,serif;border:1px solid #a1814e;border-radius:5px;color:#efdcb5;background:linear-gradient(180deg,#664122 0%,#4a2d16 48%,#352012 100%);box-shadow:inset 0 1px 0 #d0ab7055, inset 0 -1px 0 #241306, 0 2px 4px #0004;cursor:pointer;}
.lorKodexMobileNavigation button[aria-pressed="true"]{color:#402815;background:linear-gradient(180deg,#f0dfbe 0%,#e5d0a2 55%,#d8bf8c 100%);border-color:#c3a06a;box-shadow:inset 0 1px 0 #fff8, inset 0 -1px 0 #b48e59, 0 2px 4px #0002;}
.lorKodexMobileNavigation button:disabled{opacity:.5;cursor:default;}
.lorKodexBinding{display:grid;grid-template-columns:minmax(0,1fr);min-height:0;flex:1;}
.lorKodexSpine{display:none;}
.lorKodexBook[data-mobile-page="index"] .lorKodexDetailLeaf{display:none;}
.lorKodexBook[data-mobile-page="detail"] .lorKodexIndexLeaf{display:none;}
.lorKodexLeaf{min-width:0;min-height:0;overflow-y:auto;border-radius:4px;padding:20px 24px 25px;}
.lorKodexPageHeading{margin-bottom:12px;padding-bottom:11px;}
.lorKodexPageHeading h2{font-size:23px;}
.lorKodexPageHeading p{font-size:13px;}
.lorKodexIndexRow{font-size:15px;padding:11px 7px;}
.lorKodexCategoryTitle{font-size:11px;padding:6px 7px 4px;}
.lorKodexPortrait{height:145px;margin:7px 0 15px;}
.lorKodexPortraitImage{width:130px;height:130px;}
.lorKodexDetailFacts{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px;}
.lorKodexDetailFacts>div{padding:4px 2px;}
.lorKodexDetailFacts small{font-size:11px;}
.lorKodexDetailFacts b{font-size:14px;}
.lorKodexDescription h3{font-size:16px;}
.lorKodexDescription p{font-size:13px;line-height:1.65;}
.lorKodexControls{padding:8px 9px 0;gap:5px;font-size:12px;}
.lorKodexControls button{padding:7px 10px;font-size:12px;}
}
@media(max-width:360px){
.lorKodexLeaf{padding:16px 19px 20px;}
.lorKodexTab{font-size:11px;}
.lorKodexBook{padding:8px 9px;}
}
@media(prefers-reduced-motion:reduce){.lorKodexFlip.turning{animation:none;visibility:hidden}}

/* Kodex NPC relationship: native -10..+10 reputation, scoped to the current character. */
.lorKodexAffinity{margin:15px 2px 9px;color:#57381e;}
.lorKodexAffinityHeading{display:flex;align-items:baseline;flex-wrap:wrap;justify-content:space-between;gap:3px 10px;margin-bottom:10px;}
.lorKodexAffinityHeading h3{font:700 15px Georgia,serif;margin:0;color:#69441f;}
.lorKodexAffinityHeading strong{font:12px Georgia,serif;color:#765632;}
.lorKodexAffinityScale{display:flex;align-items:center;gap:10px;}
.lorKodexAffinityFace{flex:none;font-size:22px;line-height:1.15;filter:drop-shadow(0 1px 1px #764f3466);}
.lorKodexAffinityTrack{flex:1;position:relative;min-width:0;height:13px;border-radius:8px;background:linear-gradient(90deg,#a54d43 0%,#b59065 50%,#7e9958 100%);border:1px solid #886943;box-shadow:inset 0 1px 3px #49311977;}
.lorKodexAffinityFill{position:absolute;left:0;top:0;bottom:0;width:var(--lor-kodex-affinity);background:#f6e4b44d;border-radius:inherit;}
.lorKodexAffinityMarker{position:absolute;top:50%;left:var(--lor-kodex-affinity);height:20px;width:7px;box-sizing:border-box;border:2px solid #6c431d;border-radius:5px;background:#fff2c9;box-shadow:0 1px 3px #2c180b66;transform:translate(-50%,-50%);}
@media(max-width:470px){.lorKodexAffinity{margin-top:12px}.lorKodexAffinityScale{gap:7px}.lorKodexAffinityFace{font-size:20px}}

/* Enemy lighting uses the same vars as MapChar; glow must not erase night tint. */
.lorEnemyActor {
  --char-brightness:100%; --char-contrast:100%;
  --char-saturate:100%; --char-sepia:0%;
  filter:brightness(var(--char-brightness)) contrast(var(--char-contrast))
    saturate(var(--char-saturate)) sepia(var(--char-sepia));
  transition:filter .5s ease;
}
.lorEnemyActor:hover,.lorEnemyActor:focus-visible {
  filter:brightness(var(--char-brightness)) contrast(var(--char-contrast))
    saturate(var(--char-saturate)) sepia(var(--char-sepia)) drop-shadow(0 0 6px #8af064);
}
.lorEnemyActor.inBattle {
  filter:brightness(var(--char-brightness)) contrast(var(--char-contrast))
    saturate(var(--char-saturate)) sepia(var(--char-sepia)) drop-shadow(0 0 5px #df7944);
}
.lorEnemyActor.inBattle:hover {
  filter:brightness(var(--char-brightness)) contrast(var(--char-contrast))
    saturate(var(--char-saturate)) sepia(var(--char-sepia))
    drop-shadow(0 0 5px #df7944) drop-shadow(0 0 6px #8af064);
}
/* Mirror the exact visible 8x8 spritesheet frame, below its owning actor.
   The inherited frame stays in sync with idle, walk and direction changes. */
.lorEnemyReflection {
  position:absolute; top:100%; left:0; width:100%; height:100%;
  margin:0; z-index:-1; background-image:inherit;
  background-position:inherit; background-size:inherit; background-repeat:no-repeat;
  pointer-events:none; image-rendering:pixelated;
}

/* PvP 2.5.4: NPC context keeps its actions and title but shares the game's main-menu look. */
#lorEnemyContext.lorMapContext{
  width:min(290px,calc(100vw - 16px));min-width:240px;max-width:calc(100vw - 16px);
  padding:13px 10px 14px;gap:2px;border:0;border-radius:0;
  background:#201710 url('../assets/img/background/interface/menuBG.webp') center/100% 100% no-repeat;
  box-shadow:0 12px 32px rgba(0,0,0,.85);color:#edc06b;
}
#lorEnemyContext .lorMapContextTitle{padding:10px 9px 13px;min-width:0;display:block;border-bottom:0;background:transparent;}
#lorEnemyContext .lorMapContextTitle strong{padding:0;border:0;display:block;font:700 14px/1.25 Georgia,serif;color:#f4d69c;text-align:center;}
#lorEnemyContext .lorMapContextTitle small{display:none;}
#lorEnemyContext .lorMapContextItem{
  width:100%;min-height:52px;display:flex;gap:7px;align-items:center;
  padding:6px 10px 6px 12px;border:0;border-radius:0;text-align:left;
  background:transparent url('../assets/img/background/interface/menuItemList.webp') center/100% 100% no-repeat;
  box-shadow:none;filter:none;transition:filter .12s ease;
}
#lorEnemyContext .lorMapContextItem:hover,#lorEnemyContext .lorMapContextItem:focus-visible{
  background-image:url('../assets/img/background/interface/menuItemList.webp');
  border:0;filter:brightness(1.2);outline:1px solid #c39b6a66;outline-offset:-2px;
}
#lorEnemyContext .lorMapContextIcon{width:26px;height:26px;flex:none}
#lorEnemyContext .lorMapContextIcon img{width:26px;height:26px;image-rendering:pixelated}
#lorEnemyContext .lorMapContextMeta{flex:1;min-width:0}
#lorEnemyContext .lorMapContextLabel{font:700 14px/1.1 Georgia,serif;color:#edc06b}
#lorEnemyContext .lorMapContextDescription{display:none}
#lorEnemyContext .lorMapContextChevron{width:17px;flex:none;color:#a87536;font-size:21px}

/* Kodex: page navigation is printed on each parchment leaf, not outside the book. */
.lorKodexBook .lorKodexLeaf{
  display:flex;
  flex-direction:column;
  overflow:hidden;
  padding:0;
}
.lorKodexBook .lorKodexPageScroll{
  flex:1 1 auto;
  min-height:0;
  min-width:0;
  overflow-y:auto;
  padding:24px clamp(15px,3vw,35px) 10px;
  scrollbar-width:thin;
  scrollbar-color:#a98559 transparent;
}
.lorKodexBook .lorKodexPageFooter{
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex:0 0 auto;
  gap:8px;
  margin:0 clamp(15px,3vw,35px) 15px;
  padding:10px 0 0;
  border-top:1px solid #af90667a;
  color:#755034;
  font:12px/1.2 Georgia,serif;
  background:transparent;
}
.lorKodexBook .lorKodexPageFooter button{
  min-height:30px;
  padding:5px 7px;
  color:#63401e;
  font:700 12px/1.2 Georgia,serif;
  background:#dbc39866;
  border:1px solid #ba9b6e88;
  border-radius:3px;
  cursor:pointer;
  box-shadow:inset 0 1px 0 #fff7;
}
.lorKodexBook .lorKodexPageFooter button:hover:not(:disabled){background:#d5b38299;color:#40260f}
.lorKodexBook .lorKodexPageFooter button:focus-visible{outline:2px solid #a76e23;outline-offset:1px}
.lorKodexBook .lorKodexPageFooter button:disabled{opacity:.35;cursor:default}
.lorKodexBook .lorKodexPageFooter [data-kodex-counter]{font:italic 12px Georgia,serif;white-space:nowrap}
@media(min-width:701px){
  .lorKodexBook .lorKodexIndexLeaf [data-kodex-next],
  .lorKodexBook .lorKodexDetailLeaf [data-kodex-prev]{display:none}
  .lorKodexBook .lorKodexIndexLeaf .lorKodexPageFooter{justify-content:flex-start}
  .lorKodexBook .lorKodexDetailLeaf .lorKodexPageFooter{justify-content:flex-end}
}
@media(max-width:700px){
  .lorKodexBook .lorKodexLeaf{padding:0}
  .lorKodexBook .lorKodexPageScroll{padding:12px 22px 8px}
  .lorKodexBook .lorKodexMobileNavigation{
    display:flex;
    justify-content:center;
    align-items:center;
    padding:11px 22px 6px;
    gap:8px;
    background:transparent;
  }
  .lorKodexBook .lorKodexMobileNavigation button{
    flex:1;
    min-width:0;
    min-height:30px;
    max-width:160px;
    padding:5px 7px;
    font:700 12px Georgia,serif;
    color:#70502e;
    background:#dec8a06b;
    border:1px solid #b89b7085;
    box-shadow:inset 0 1px 0 #fff7;
  }
  .lorKodexBook .lorKodexMobileNavigation button[aria-pressed="true"]{
    color:#3d250f;background:#d1ac7377;border-color:#ab7d44;
  }
  .lorKodexBook .lorKodexPageFooter{margin:0 21px 15px;padding-top:8px}
  .lorKodexBook .lorKodexPageFooter button{font-size:12px;padding:5px 9px}
}
@media(max-width:360px){
  .lorKodexBook .lorKodexPageScroll{padding:10px 18px 7px}
  .lorKodexBook .lorKodexMobileNavigation{padding:9px 18px 5px}
  .lorKodexBook .lorKodexPageFooter{margin:0 16px 12px}
}

/* Kodex 2.5.7 — discovered-entry gallery, printed onto the book pages.
   All selectors are confined to the book; do not change other enemy/admin views. */
.lorKodexBook .lorKodexIndexLeaf{
  /* Book chapter tabs are now children of this parchment leaf. */
  isolation:isolate;
}
.lorKodexBook .lorKodexTabs{
  flex:none;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  align-items:stretch;
  gap:4px;
  padding:20px clamp(15px,3vw,35px) 5px;
  background:transparent;
  position:relative;
  z-index:2;
  min-width:0;
}
.lorKodexBook .lorKodexTab{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:2px 5px;
  min-width:0;
  min-height:33px;
  padding:5px 3px;
  border:1px solid #b7986d;
  border-radius:4px;
  color:#69401f;
  background:linear-gradient(#eedbbbdf,#d6b789bd);
  font:700 clamp(10px,1.15vw,12px)/1.15 Georgia,serif;
  text-align:center;
  box-shadow:inset 0 1px 0 #fff8;
  text-shadow:none;
}
.lorKodexBook .lorKodexTab small{
  color:#866343;
  font:700 10px/1 Arial,sans-serif;
}
.lorKodexBook .lorKodexTab.active,
.lorKodexBook .lorKodexTab[aria-selected="true"]{
  color:#f5e3c3;
  background:linear-gradient(#78502d,#57371d);
  border-color:#8f6638;
  box-shadow:inset 0 1px 0 #efd4a655,0 2px 5px #5c351f3b;
}
.lorKodexBook .lorKodexTab.active small{color:#f0d1a0}
.lorKodexBook .lorKodexTab:hover:not(.active){background:#e2c593}
.lorKodexBook .lorKodexTab:focus-visible{outline:2px solid #aa692e;outline-offset:1px}
.lorKodexBook .lorKodexIndexSection{height:auto;min-height:100%}
.lorKodexBook .lorKodexIndexEntries{
  flex:1 1 auto;
  min-height:0;
  overflow:visible;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.lorKodexBook .lorKodexEntryGrid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(77px,1fr));
  gap:8px 7px;
  align-content:start;
  min-width:0;
}
.lorKodexBook .lorKodexCategoryBlock{
  display:flex;
  flex-direction:column;
  gap:7px;
  margin:0;
  min-width:0;
}
.lorKodexBook .lorKodexCategoryTitle{
  position:static;
  margin:4px 0 0;
  padding:3px 2px 5px;
  color:#71502f;
  font:700 10px/1.2 Georgia,serif;
  letter-spacing:.08em;
  text-transform:uppercase;
  border:0;
  border-bottom:1px solid #aa865b94;
  background:transparent;
  box-shadow:none;
}
.lorKodexBook .lorKodexIndexRow{
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  width:100%;
  min-width:0;
  min-height:95px;
  gap:5px;
  padding:7px 4px 6px;
  text-align:center;
  color:#492e1a;
  border:1px solid transparent;
  border-radius:5px;
  background:linear-gradient(180deg,#e7d2aa66,#c9a97555);
  box-shadow:inset 0 1px 0 #fff5;
  cursor:pointer;
  transition:background .14s ease,box-shadow .14s ease,border-color .14s ease;
}
.lorKodexBook .lorKodexIndexRow:hover,
.lorKodexBook .lorKodexIndexRow.active{
  color:#37200e;
  background:linear-gradient(180deg,#dfbc83bd,#cda26c9c);
  border-color:#a57741;
  box-shadow:0 0 0 1px #fff5 inset,0 1px 6px #6a45293d;
}
.lorKodexBook .lorKodexIndexRow:focus-visible{outline:2px solid #99632a;outline-offset:1px}
.lorKodexBook .lorKodexIndexArt{
  box-sizing:border-box;
  display:block;
  flex:none;
  width:52px;
  height:52px;
  border:0;
  border-radius:4px;
  background-position:center;
  background-size:contain;
  background-repeat:no-repeat;
  image-rendering:pixelated;
  filter:drop-shadow(1px 3px 2px #4f371b5f);
}
.lorKodexBook .lorKodexIndexArt.sheet{
  background-size:800% 800%;
  background-position:0 0;
}
.lorKodexBook .lorKodexIndexArtFallback{
  display:grid;
  place-items:center;
  color:#a48662;
  border:1px solid #b89b7277;
  background:#d5ba9077;
  font-size:26px;
}
.lorKodexBook .lorKodexIndexName,
.lorKodexBook .lorKodexIndexRow span:last-child{
  color:inherit;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  overflow-wrap:anywhere;
  white-space:normal;
  max-width:100%;
  font:700 11px/1.2 Georgia,serif;
  text-align:center;
}
.lorKodexBook .lorKodexPageHeading{margin-bottom:10px;padding-bottom:9px}
@media (min-width:701px){
  .lorKodexBook .lorKodexIndexLeaf .lorKodexPageScroll{
    padding-top:12px;
  }
  .lorKodexBook .lorKodexTabs{padding-top:24px}
}
@media (max-width:700px){
  .lorKodexBook .lorKodexTabs{
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:3px;
    padding:13px 17px 3px;
  }
  .lorKodexBook .lorKodexTab{
    min-height:34px;
    gap:1px 3px;
    padding:4px 2px;
    font-size:10px;
  }
  .lorKodexBook .lorKodexTab small{font-size:9px}
  .lorKodexBook .lorKodexMobileNavigation{padding:5px 17px 4px}
  .lorKodexBook .lorKodexIndexLeaf .lorKodexPageScroll{padding:7px 17px 7px}
  .lorKodexBook .lorKodexEntryGrid{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:7px 6px;
  }
  .lorKodexBook .lorKodexIndexRow{
    min-height:89px;
    gap:4px;
    padding:6px 3px;
  }
  .lorKodexBook .lorKodexIndexArt{width:47px;height:47px}
  .lorKodexBook .lorKodexIndexName,
  .lorKodexBook .lorKodexIndexRow span:last-child{font-size:10px}
  .lorKodexBook .lorKodexPageHeading h2{margin:4px 0 5px}
  .lorKodexBook .lorKodexPageHeading p{font-size:12px}
}
@media (max-width:360px){
  .lorKodexBook .lorKodexTabs{padding:10px 12px 3px}
  .lorKodexBook .lorKodexIndexLeaf .lorKodexPageScroll{padding:7px 12px}
  .lorKodexBook .lorKodexMobileNavigation{padding:5px 12px 4px}
  .lorKodexBook .lorKodexIndexArt{width:45px;height:45px}
}
@media(prefers-reduced-motion:reduce){.lorKodexBook .lorKodexIndexRow{transition:none}}

/* Kodex 2.5.8: learned/observed links and NPC services inside parchment. */
.lorKodexConnections{margin:12px 0 15px;border-top:1px solid rgba(112,78,42,.26);padding-top:9px}
.lorKodexConnections h3{color:#78522f;font:700 16px Georgia,serif;margin:0 0 8px}
.lorKodexConnectionGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(115px,1fr));gap:6px}
.lorKodexConnection{display:flex;align-items:center;gap:6px;min-width:0;padding:6px 8px;border:1px solid #be966659;border-radius:4px;background:#e6cd9c77;color:#593c25;font:700 12px Georgia,serif;text-align:left;cursor:pointer}
.lorKodexConnection:hover,.lorKodexConnection:focus-visible{background:#c49b5e68;outline:1px solid #876335}
.lorKodexConnectionIcon,.lorKodexConnection img{width:27px;height:27px;min-width:27px;background-position:center;background-size:contain;background-repeat:no-repeat;object-fit:contain;image-rendering:pixelated}
.lorKodexConnectionPassive{cursor:default}
@media(max-width:700px){.lorKodexConnectionGrid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* 2.5.9 — Kodex as a standalone illustrated book, without the generic panel. */
#pannelContainer:has(> .pannelContainerContent #lorKodexRoot){
  width:min(1100px,calc(100vw - 18px));
  max-width:calc(100vw - 18px);
  height:min(850px,calc(var(--lor-kodex-game-height,100dvh) - 12px),calc(100dvh - 16px));
  max-height:calc(var(--lor-kodex-game-height,100dvh) - 12px);
  min-height:0;
  padding:0;
  border:0;
  border-radius:0;
  background:none!important;
  box-shadow:none;
  overflow:visible;
}
#pannelContainer:has(#lorKodexRoot)>.pannelContainerContent{
  width:100%;height:100%;padding:0;min-height:0;background:none;overflow:hidden;
}
#pannelContainer:has(#lorKodexRoot) .pannelContent{
  width:100%;height:100%;min-height:0;overflow:hidden;
}
#pannelContainer:has(#lorKodexRoot) .pannelTitleContainer,
#pannelContainer:has(#lorKodexRoot) .pannelContainerBottomBar{display:none!important}
#lorKodexRoot.lorKodexBook{
  width:100%;height:100%;max-height:100%;padding:8px 13px 14px;
  border:0;border-radius:8px;
}
#lorKodexRoot .lorKodexBookHeader{
  flex:0 0 40px;min-height:0;
  display:flex;align-items:center;justify-content:center;
  position:relative;z-index:9;
  padding:2px 112px 0 80px;box-sizing:border-box;
  color:#f4d49b;font:700 clamp(13px,1.8vw,18px)/1.1 Georgia,serif;
  text-shadow:0 2px 3px #201408;
}
#lorKodexRoot .lorKodexBookHeader>span{white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
#lorKodexRoot .lorKodexBookClose{
  position:absolute;right:6px;top:2px;z-index:20;
  display:inline-flex;gap:5px;align-items:center;justify-content:center;
  min-height:32px;padding:5px 11px;
  color:#f2d5a6;background:linear-gradient(180deg,#69412b,#41221a);
  border:1px solid #c18c51;border-radius:4px;
  font:700 12px Georgia,serif;cursor:pointer;
  box-shadow:0 2px 5px #160c09a6;
}
#lorKodexRoot .lorKodexBookClose>span{font-size:15px;color:#ffcf8e}
#lorKodexRoot .lorKodexBookClose:hover,#lorKodexRoot .lorKodexBookClose:focus-visible{
  filter:brightness(1.18);outline:2px solid #ebbf82;outline-offset:1px;
}
#lorKodexRoot .lorKodexBinding{flex:1 1 auto;min-height:0}
@media(max-width:700px){
  #pannelContainer:has(#lorKodexRoot){
    width:calc(100vw - 6px);max-width:calc(100vw - 6px);
    height:min(900px,calc(var(--lor-kodex-game-height,100dvh) - 4px),calc(100dvh - 5px));
    max-height:calc(var(--lor-kodex-game-height,100dvh) - 4px);
  }
  #lorKodexRoot.lorKodexBook{padding:6px 7px 9px}
  #lorKodexRoot .lorKodexBookHeader{height:32px;flex-basis:32px;padding:0 57px 0 43px;font-size:12px}
  #lorKodexRoot .lorKodexBookClose{right:0;top:0;min-height:30px;padding:4px 8px;font-size:0}
  #lorKodexRoot .lorKodexBookClose>span{font-size:17px}
}

/* NPC map menu matches the already established enemy/character list texture. */
#lorNpcMapContext.lorNpcMapContext{
  width:min(290px,calc(100vw - 16px));min-width:240px;
  max-width:calc(100vw - 16px);
  padding:13px 10px 14px;gap:2px;border:0;border-radius:0;
  background:#201710 url('../assets/img/background/interface/menuBG.webp') center/100% 100% no-repeat;
  box-shadow:0 12px 32px #000d;color:#edc06b;
}
#lorNpcMapContext.lorNpcMapContext>strong{
  padding:10px 9px 13px;display:block;border:0;
  background:transparent;text-align:center;
  font:700 14px/1.25 Georgia,serif;color:#f4d69c;
}
#lorNpcMapContext.lorNpcMapContext .lorNpcMenuOption{
  width:100%;min-height:52px;display:flex;gap:8px;align-items:center;
  padding:6px 10px 6px 12px;border:0;border-radius:0;text-align:left;
  background:transparent url('../assets/img/background/interface/menuItemList.webp') center/100% 100% no-repeat;
  box-shadow:none;filter:none;font:700 14px Georgia,serif;color:#edc06b;
}
#lorNpcMapContext.lorNpcMapContext .lorNpcMenuOption:hover,
#lorNpcMapContext.lorNpcMapContext .lorNpcMenuOption:focus-visible{
  background-image:url('../assets/img/background/interface/menuItemList.webp');
  filter:brightness(1.2);border:0;outline:1px solid #c39b6a66;outline-offset:-2px;
}
#lorNpcMapContext.lorNpcMapContext .lorNpcMenuOption img{
  width:26px;height:26px;flex:none;image-rendering:pixelated;
}
#lorNpcMapContext.lorNpcMapContext .lorNpcMenuOption::after{
  content:'›';margin-left:auto;color:#a87536;font:21px Georgia,serif;
}

/* 2.6.0 — immersive Kodex: no top bar; close control on the book's lower spine. */
#lorKodexRoot.lorKodexBook{position:relative;padding-top:4px;padding-bottom:11px;}
#lorKodexRoot .lorKodexBinding{flex:1 1 auto;min-height:0;}
#lorKodexRoot .lorKodexBookClose{
  position:absolute;top:auto;right:auto;left:50%;bottom:24px;
  transform:translateX(-50%);z-index:12;
  display:flex;align-items:center;justify-content:center;gap:5px;
  min-width:94px;max-width:30%;height:32px;
  padding:4px 11px;border:1px solid #a37c49;border-radius:4px;
  color:#58371c;font:700 12px/1.1 Georgia,serif;
  background:#dfc79b url('../assets/img/background/charSelection/BookPageBlank.webp') center/cover no-repeat;
  box-shadow:inset 0 1px 0 #fff9,0 2px 4px #29160258;
  text-shadow:none;cursor:pointer;
}
#lorKodexRoot .lorKodexBookClose>span{font-size:14px;color:#8b4426;}
#lorKodexRoot .lorKodexBookClose:hover,#lorKodexRoot .lorKodexBookClose:focus-visible{
  color:#3f250e;background-color:#ebd3a4;filter:brightness(1.06);outline:2px solid #c28d4b;outline-offset:1px;
}
@media(max-width:700px){
  #lorKodexRoot.lorKodexBook{padding-top:4px;padding-bottom:5px;}
  #lorKodexRoot .lorKodexBookClose{top:auto;right:auto;bottom:16px;height:31px;max-width:33%;min-width:80px;padding:4px 6px;font-size:12px;}
  #lorKodexRoot .lorKodexBookClose>span{font-size:13px;}
  #lorKodexRoot .lorKodexPageFooter [data-kodex-counter]{
    display:block;position:absolute;left:50%;bottom:52px;
    transform:translateX(-50%);font-size:10px;color:#8e6b48;
    pointer-events:none;
  }
  #lorKodexRoot .lorKodexPageFooter{justify-content:space-between;}
}

/* LOR 2.6.1 — enemy navigation notices match the in-game modal language. */
#lorEnemyPopup.lorEnemyPopupOverlay{
  z-index:999978;
  background:rgba(5,5,9,.79);
  backdrop-filter:blur(4px);
}
#lorEnemyPopup .lorEnemyPopup{
  width:min(470px,100%);
  padding:20px clamp(16px,3vw,25px);
  border:2px solid #ae804b;
  border-radius:8px;
  background:linear-gradient(160deg,rgba(39,26,21,.88),rgba(16,13,16,.92)),url('../assets/img/background/interface/menuBG.webp') center/100% 100% no-repeat;
  box-shadow:0 20px 65px #000d,inset 0 0 0 1px #eed1a526;
  color:#f4d8ad;
  font:14px/1.55 Georgia,serif;
}
#lorEnemyPopup .lorEnemyPopup h3{font:700 21px Georgia,serif;color:#f7d9a2;margin:0 0 13px;border-bottom:1px solid #b18a534a;padding:0 0 10px}
#lorEnemyPopup .lorEnemyPopup p{margin:8px 0 3px;color:#e8d1a8}
#lorEnemyPopup .lorEnemyPopupButtons{margin-top:20px;display:flex;justify-content:center}
#lorEnemyPopup .lorEnemyPopupButtons button{
  min-height:39px;min-width:123px;
  padding:7px 18px;border:0;border-radius:0;
  color:#ffe7c1;font:700 14px Georgia,serif;
  text-shadow:1px 1px 3px #000;
  background:transparent url('../assets/img/buttons/buttonBrown.webp') center/100% 100% no-repeat;
  filter:drop-shadow(2px 3px 4px #000a);
}
#lorEnemyPopup .lorEnemyPopupButtons button:hover,#lorEnemyPopup .lorEnemyPopupButtons button:focus-visible{filter:brightness(1.13) drop-shadow(2px 3px 4px #000a);outline:1px solid #d6af6c}

/* LOR 2.6.3: enemy navigation dialog uses the standard game panel treatment. */
#lorEnemyPopup .lorEnemyPopup{position:relative;background-image:linear-gradient(165deg,rgba(32,22,18,.88),rgba(12,11,14,.90)),url('../assets/img/background/interface/menuBG.webp');background-size:cover,100% 100%;background-repeat:no-repeat;padding:18px 20px 19px;border:1px solid #b7864d;border-radius:5px;box-shadow:0 22px 60px #000c,inset 0 0 0 1px #e1bd783b}
#lorEnemyPopup .lorEnemyPopup h3{text-align:center;font:700 18px Georgia,serif;color:#f0cc86;letter-spacing:.2px;padding:7px 3px 12px;margin:0 0 14px;border-bottom:1px solid #9f764c77}
#lorEnemyPopup .lorEnemyPopup p{color:#f7e1b7;font-size:13px;line-height:1.6;padding:0 7px}
#lorEnemyPopup .lorEnemyPopupButtons{justify-content:center}
#lorEnemyPopup .lorEnemyPopupButtons button{font:700 14px Georgia,serif;text-shadow:0 1px 2px #0009;background:transparent url('../assets/img/buttons/buttonBrown.webp') center/100% 100% no-repeat;min-width:130px;min-height:39px}

/* 2026-10-14 — Enemy notices use the same theme panel as character exchange.
   The message has one action; no second card / generic heading is needed. */
#lorEnemyPopup.lorEnemyPopupOverlay{
  background:rgba(0,0,0,.78);
  backdrop-filter:blur(3px);
  padding:clamp(10px,3vw,20px);
}
#lorEnemyPopup .lorEnemyPopup{
  --lor-enemy-panel:url('../assets/img/themes/darkfantasy/background/pannelBG.webp');
  --lor-enemy-button:url('../assets/img/themes/darkfantasy/buttons/button.webp');
  box-sizing:border-box;
  width:min(490px,100%);
  max-height:calc(100dvh - 32px);
  min-height:195px;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  padding:clamp(28px,4vw,42px) clamp(26px,5vw,45px);
  border:0;
  border-radius:2px;
  background:var(--lor-enemy-panel) center/100% 100% no-repeat #100f0e;
  box-shadow:0 16px 45px #000b;
  color:#f5ddb6;
  font-family:Georgia,serif;
  text-align:center;
}
#lorEnemyPopup[data-lor-theme="wood"] .lorEnemyPopup{
  --lor-enemy-panel:url('../assets/img/themes/wood/background/pannelBG.webp');
  --lor-enemy-button:url('../assets/img/themes/wood/buttons/button.webp');
}
#lorEnemyPopup .lorEnemyNoticePopup p{
  width:100%;margin:0 0 10px;padding:0;
  font:400 clamp(14px,2vw,16px)/1.5 Georgia,serif;
  color:inherit;text-align:center;
}
#lorEnemyPopup .lorEnemyPopupButtons{
  width:100%;margin:11px 0 0;
  justify-content:center;align-items:center;gap:8px;
}
#lorEnemyPopup .lorEnemyPopupButtons button{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  box-sizing:border-box;min-width:130px;min-height:43px;
  padding:6px 16px;border:0;border-radius:0;
  background:var(--lor-enemy-button) center/100% 100% no-repeat;
  color:#ffe8c0;font:700 15px Georgia,serif;
  filter:drop-shadow(3px 4px 4px #0008);
}
#lorEnemyPopup .lorEnemyPopupButtons button img{
  width:19px;height:19px;object-fit:contain;image-rendering:pixelated;
}
#lorEnemyPopup .lorEnemyPopupButtons button:hover:not(:disabled){filter:brightness(1.12) drop-shadow(3px 4px 4px #0008)}
#lorEnemyPopup .lorEnemyPopupButtons button:focus-visible{outline:2px solid #e9c17c;outline-offset:2px}
@media(max-width:420px){
  #lorEnemyPopup .lorEnemyPopup{min-height:170px;padding:27px 26px}
  #lorEnemyPopup .lorEnemyPopupButtons button{min-height:43px}
}

/* Compact Kodex: every discovered item is a card on mobile, not just the selected row. */
@media(max-width:700px){#lorKodexRoot .lorKodexIndexRow{background:#d5b78670;color:#261407;border:1px solid #b98e59;border-radius:5px;box-shadow:inset 0 0 0 1px #f5e2b566}#lorKodexRoot .lorKodexIndexRow.active{outline:2px solid #8c5427;outline-offset:-2px}}

/* Context headings: small character/NPC portraits and consistent red close action. */
.lorContextHeading{display:flex;align-items:center;justify-content:center;gap:10px;min-width:0;text-align:left}
.lorContextHeading>strong{min-width:0;overflow-wrap:anywhere}
.lorContextHeading:has(small){flex-wrap:wrap}
.lorContextPortrait{display:block;flex:0 0 36px;width:36px;height:36px;background-color:#2f241e;background-position:center;background-repeat:no-repeat;background-size:contain;border:1px solid #88613c;image-rendering:pixelated;box-shadow:inset 0 0 8px #0006}
.lorSelfPortrait{background-size:160px auto;background-position:center 12%}
#lorEnemyContext .lorMapContextTitle .lorContextHeading strong,#lorPvpContext .lorMapContextTitle .lorContextHeading strong{display:inline;text-align:left}
#lorEnemyContext .lorMapContextItem:last-child,#lorPvpContext .lorMapContextItem:last-child{background-color:#631b19!important;color:#ffd4cc!important;box-shadow:inset 0 0 12px #540b0b!important}
#lorNpcMapContext .lorNpcMenuOption[data-npc-action="close"],#lorSelfMapContext .lorSelfMapOption:last-child{background-color:#5f1c17!important;color:#ffcbc3!important}
#lorNpcMapContext .lorContextHeading,#lorSelfMapContext .lorContextHeading{padding:9px 8px 12px;justify-content:center}
#lorNpcMapContext .lorContextHeading strong,#lorSelfMapContext .lorContextHeading strong{font:700 14px/1.25 Georgia,serif;color:#f4d69c}

#lorEnemyContext .lorContextHeading:has(small),#lorPvpContext .lorContextHeading:has(small){display:grid;grid-template-columns:36px minmax(0,1fr);column-gap:10px;row-gap:2px}
#lorEnemyContext .lorContextHeading .lorContextPortrait,#lorPvpContext .lorContextHeading .lorContextPortrait{grid-row:1/3}
#lorEnemyContext .lorContextHeading small,#lorPvpContext .lorContextHeading small{grid-column:2;margin:0;padding:0}
#lorEnemyContext .lorMapContextTitle .lorContextHeading small{display:none}

/* 2026-10-15 follow-up: consistent left-aligned context headings/actions and portraits. */
#lorEnemyContext .lorContextHeading,#lorPvpContext .lorContextHeading,
#lorNpcMapContext .lorContextHeading,#lorSelfMapContext .lorContextHeading{justify-content:flex-start!important;text-align:left!important;width:100%;box-sizing:border-box;}
#lorEnemyContext .lorMapContextTitle strong,#lorPvpContext .lorMapContextTitle strong,
#lorNpcMapContext .lorContextHeading strong,#lorSelfMapContext .lorContextHeading strong{text-align:left!important;}
#lorEnemyContext .lorMapContextTitle,#lorPvpContext .lorMapContextTitle{text-align:left!important;}
#lorEnemyContext .lorMapContextMeta,#lorPvpContext .lorMapContextMeta{text-align:left!important;}
#lorEnemyContext .lorMapContextItem,#lorPvpContext .lorMapContextItem,
#lorNpcMapContext .lorNpcMenuOption,#lorSelfMapContext .lorSelfMapOption{justify-content:flex-start!important;text-align:left!important;}
#lorEnemyContext .lorEnemyPortrait{
    background-size:800% 800%!important;
    background-position:0 0!important;
    background-repeat:no-repeat;
}
#lorPvpContext .lorSelfPortrait,#lorSelfMapContext .lorSelfPortrait{
    background-size:contain!important;background-position:center center!important;background-repeat:no-repeat;
}
