/* Lineage II Interlude Pet HUD, PetWnd & Cooper Modal styling */
.pet-hud-wrap {
 position: fixed;
 left: 1rem;
 top: calc(1rem + 58 * var(--hpx, 1px));
 box-sizing: border-box;
 width: calc(164 * var(--hpx, 1px));
 height: calc(46 * var(--hpx, 1px));
 padding: calc(5 * var(--hpx, 1px)) calc(10 * var(--hpx, 1px)) calc(4 * var(--hpx, 1px)) calc(6 * var(--hpx, 1px));
 border: 0 solid transparent;
 border-image: url(assets/ui/wnd/smallwnd.png) 17 20 2 16 fill / calc(17 * var(--wpx, 1px)) calc(20 * var(--wpx, 1px)) calc(2 * var(--wpx, 1px)) calc(16 * var(--wpx, 1px)) stretch;
 image-rendering: pixelated;
 display: flex;
 flex-direction: column;
 gap: calc(2 * var(--hpx, 1px));
 font: var(--hfont, 13px)/var(--hline, 16px) var(--l2font);
 color: #dcdcdc;
 text-shadow: none;
 z-index: 12;
 cursor: pointer;
 user-select: none;
}
.pet-hud-head {
 display: flex;
 align-items: center;
 gap: calc(4 * var(--hpx, 1px));
 height: calc(14 * var(--hpx, 1px));
 min-width: 0;
}
.pet-hud-ico {
 flex: none;
 width: calc(14 * var(--hpx, 1px));
 height: calc(14 * var(--hpx, 1px));
 object-fit: cover;
 border: var(--wpx, 1px) solid #7d643d;
 background: #0f0d0a;
}
.pet-hud-name {
 flex: 1;
 min-width: 0;
 font: var(--hfont, 13px)/calc(12 * var(--hpx, 1px)) var(--l2font);
 color: #e8dec8;
 text-shadow: var(--wpx, 1px) var(--wpx, 1px) 0 #000;
 white-space: nowrap;
 overflow: hidden;
 text-overflow: ellipsis;
}
.pet-hud-lv {
 flex: none;
 font: calc(12 * var(--wpx, 1px))/1 'L2 Small', var(--l2font);
 letter-spacing: var(--wpx, 1px);
 padding: var(--wpx, 1px) calc(3 * var(--hpx, 1px));
 background: #14110c;
 color: #efd695;
 border: var(--wpx, 1px) solid #7d643d;
}
.pet-hud-bars {
 display: flex;
 flex-direction: column;
 gap: calc(2 * var(--hpx, 1px));
}
.pet-hud-bar {
 position: relative;
 width: 100%;
 height: calc(11 * var(--hpx, 1px));
 overflow: hidden;
 background: url(assets/ui/xdat/tex/hpbar_back.png) 0 0/100% calc(100% * 8 / 6) repeat-x;
 image-rendering: pixelated;
}
.pet-hud-bar.xp {
 background-image: url(assets/ui/xdat/tex/mpbar_back.png);
}
.pet-hud-fill {
 position: absolute;
 left: 0;
 top: 0;
 bottom: 0;
 width: 0%;
 background: url(assets/ui/xdat/tex/hpbar.png) 0 0/100% calc(100% * 8 / 6) repeat-x;
 image-rendering: pixelated;
 transition: width 0.16s linear;
}
.pet-hud-bar.xp .pet-hud-fill {
 background-image: url(assets/ui/xdat/tex/mpbar.png);
}
.pet-hud-bar-txt {
 position: relative;
 z-index: 1;
 display: flex;
 align-items: center;
 justify-content: center;
 height: 100%;
 font: calc(13 * var(--wpx, 1px))/1 'L2 Small', var(--l2font);
 letter-spacing: var(--wpx, 1px);
 color: #fff;
 text-shadow: var(--wpx, 1px) var(--wpx, 1px) 0 #000;
 pointer-events: none;
 white-space: nowrap;
}
@media not (pointer: coarse) {
 body:has(#petStatusHud:not([hidden])) #townUi:has(>.hp-card) .town-party {
  top: calc(1rem + 108 * var(--hpx, 1px));
 }
}
@media (pointer: coarse) {
 .pet-hud-wrap {
  left: max(.5rem, env(safe-area-inset-left));
  top: calc(max(.5rem, env(safe-area-inset-top)) + 58 * var(--hpx, 1px));
 }
 body.in-town .pet-hud-wrap {
  left: calc(max(.5rem, env(safe-area-inset-left)) + 168 * var(--hpx, 1px));
  top: max(.5rem, env(safe-area-inset-top));
  width: min(calc(164 * var(--hpx, 1px)), calc(100vw - max(.5rem, env(safe-area-inset-left)) - 172 * var(--hpx, 1px) - max(.5rem, env(safe-area-inset-right))));
 }
 body:has(#petStatusHud:not([hidden])) #partyFrame.party-frame {
  top: calc(max(.5rem, env(safe-area-inset-top)) + 108 * var(--hpx, 1px));
 }
}
/* A phone in a run (finding of 30. 11. 2026, tests/pet-hud-phone.test.mjs): under the status the pet's frame covered the row of buffs
   and the Status button upright and the buffs sideways. Upright it goes under the run's counters (touch.css .run-stats: its top,
   a 23 hpx button and 2 x 4 hpx of padding, then .4rem as the expedition's box), left of that box; the party under the pet.
   Sideways it goes right of the status at the top as in town, the party back to its place under the buffs (l2-hudwnd.css), where
   under the pet four members ran into the joystick. */
@media (pointer: coarse) and (max-width: 600px) and (min-height: 521px) {
 body:not(.in-town) .pet-hud-wrap {
  top: calc(84px + .8rem + 31 * var(--hpx, 1px) + .4rem);
  width: min(calc(164 * var(--hpx, 1px)), calc(100vw - max(.5rem, env(safe-area-inset-left)) - min(15rem, 56vw) - max(.4rem, env(safe-area-inset-right)) - .5rem));
 }
 body:not(.in-town):has(#petStatusHud:not([hidden])) #partyFrame.party-frame {
  top: max(38%, calc(84px + .8rem + 31 * var(--hpx, 1px) + .4rem + 46 * var(--hpx, 1px) + .5rem));
 }
}
@media (pointer: coarse) and (max-height: 520px) {
 body:not(.in-town) .pet-hud-wrap {
  left: calc(max(.5rem, env(safe-area-inset-left)) + 168 * var(--hpx, 1px));
  top: max(.5rem, env(safe-area-inset-top));
 }
 body:not(.in-town):has(#petStatusHud:not([hidden])) #partyFrame.party-frame { top: 88px; }
}

.pet-wnd .l2w-in { background: #171410; }
.pet-wnd .xd-text {
 line-height: calc(12 * var(--wpx));
 white-space: nowrap;
 overflow: hidden;
 text-overflow: ellipsis;
}
.pet-wnd [data-xd="txtHP"],
.pet-wnd [data-xd="txtMP"],
.pet-wnd [data-xd="txtWeight"],
.pet-wnd [data-xd="txtSP"],
.pet-wnd [data-xd="txtExp"],
.pet-wnd [data-xd="txtFatigue"] {
 display: flex;
 align-items: center;
 justify-content: center;
 text-align: center;
 color: #f7efe0;
 text-shadow: var(--wpx) var(--wpx) 0 #000;
}
.pet-wnd [data-xd="txtLvHead"] { display: none; }
.pet-rename-bar {
 position: absolute;
 left: calc(10 * var(--wpx));
 right: calc(10 * var(--wpx));
 top: calc(25 * var(--wpx));
 display: flex;
 gap: calc(4 * var(--wpx));
 align-items: center;
 padding: calc(3 * var(--wpx));
 background: rgba(18, 15, 11, 0.98);
 border: var(--wpx) solid #7d643d;
 z-index: 5;
}
.pet-rename-input {
 flex: 1;
 min-width: 0;
 height: calc(20 * var(--wpx));
 background: #0f0d0a;
 color: #efe4ce;
 border: var(--wpx) solid #4d3f29;
 padding: 0 calc(5 * var(--wpx));
 font: inherit;
}
.pet-wnd-foot {
 position: absolute;
 left: 0;
 right: 0;
 top: calc(231 * var(--wpx));
 height: calc(29 * var(--wpx));
 display: flex;
 align-items: center;
 justify-content: center;
 gap: calc(5 * var(--wpx));
 padding: 0 calc(8 * var(--wpx));
 background: #14110d;
 border-top: var(--wpx) solid #493b27;
}

.cooper-root {
 position: absolute;
 left: calc(8 * var(--wpx));
 right: calc(8 * var(--wpx));
 top: calc(24 * var(--wpx));
 bottom: calc(8 * var(--wpx));
 display: flex;
 flex-direction: column;
 gap: calc(6 * var(--wpx));
 font: inherit;
 color: #dcdcdc;
}
.cooper-top {
 display: flex;
 justify-content: space-between;
 align-items: center;
 gap: calc(8 * var(--wpx));
 padding: calc(5 * var(--wpx)) calc(8 * var(--wpx));
 background: rgba(10, 9, 7, 0.72);
 border: var(--wpx) solid #4d3f29;
}
.cooper-wallet { color: #f0ca72; white-space: nowrap; }
.cooper-note { color: #b7ad9a; font-size: 0.9em; }
.cooper-tabs { display: flex; }
.cooper-wnd .l2-tabs { flex-wrap: wrap; }
.cooper-wnd .l2-tab {
 min-width: calc(68 * var(--wpx));
 padding: 0 calc(6 * var(--wpx));
}
.cooper-wnd .l2-btn {
 min-width: calc(54 * var(--wpx));
 padding: 0 calc(8 * var(--wpx)) calc(2 * var(--wpx));
}
.cooper-scroll {
 flex: 1;
 min-height: 0;
 border: var(--wpx) solid #3a3021;
 background: rgba(11, 10, 8, 0.65);
}
.cooper-scroll > .l2-scroll-view {
 padding: calc(5 * var(--wpx));
}
.pet-grid {
 display: grid;
 grid-template-columns: repeat(2, minmax(0, 1fr));
 gap: calc(6 * var(--wpx));
}
.pet-card, .pet-sc-card, .pet-gear-row {
 display: flex;
 flex-direction: column;
 gap: calc(5 * var(--wpx));
 padding: calc(6 * var(--wpx)) calc(8 * var(--wpx));
 background: rgba(29, 25, 19, 0.92);
 border: var(--wpx) solid #493b27;
}
.pet-card.active, .pet-sc-card.active {
 border-color: #b09b79;
 outline: var(--wpx, 1px) solid #b09b79;
 outline-offset: calc(-2 * var(--wpx, 1px));
}
.pet-card.owned { border-color: #5e7848; }
.pet-card-head { display: flex; align-items: center; gap: calc(8 * var(--wpx)); }
.pet-card-ico { width: calc(32 * var(--wpx)); height: calc(32 * var(--wpx)); border: var(--wpx) solid #6b5637; background: #0c0a08; flex-shrink: 0; }
.pet-card-meta { display: flex; flex-direction: column; min-width: 0; }
.pet-card-meta b { font-weight: 400; color: #f0e3c6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pet-card-meta small { font-size: 0.85em; color: #a79e8d; }
.pet-card-desc { font-size: 0.9em; color: #c7d4b3; min-height: calc(14 * var(--wpx)); }
.pet-card-act { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: calc(5 * var(--wpx)); margin-top: auto; }
.pet-req { font-size: 0.85em; color: #9c9282; }

.pet-gear-wrap { display: flex; flex-direction: column; gap: calc(8 * var(--wpx)); padding: calc(4 * var(--wpx)); }
.pet-gear-info { margin: 0; color: #bdb3a0; }
.pet-gear-row { flex-direction: row; align-items: center; justify-content: space-between; }
.pet-gear-meta { flex: 1; display: flex; flex-direction: column; gap: calc(2 * var(--wpx)); margin: 0 calc(8 * var(--wpx)); }
.pet-gear-meta b { font-weight: 400; color: #f0e3c6; }
.pet-gear-meta small { font-size: 0.9em; color: #b7ad9a; }

.pet-showcase { display: flex; flex-direction: column; gap: calc(6 * var(--wpx)); }
.pet-sc-banner { padding: calc(4 * var(--wpx)) calc(8 * var(--wpx)); background: rgba(145, 92, 24, 0.25); border: var(--wpx) solid #b57c2d; color: #f7d58b; font-size: 0.9em; }
.pet-sc-tools, .pet-sc-anims, .pet-sc-filters { display: flex; flex-wrap: wrap; gap: calc(5 * var(--wpx)); align-items: center; }
.pet-sc-search, .pet-sc-sel {
 background: #100e0b;
 color: #efe4ce;
 border: var(--wpx) solid #4d3f29;
 padding: calc(3 * var(--wpx)) calc(6 * var(--wpx));
 font: inherit;
}
.pet-sc-search { flex: 1; min-width: calc(120 * var(--wpx)); }
.pet-sc-card { flex-direction: column; align-items: stretch; gap: calc(5 * var(--wpx)); }
.pet-sc-head { display: flex; align-items: center; gap: calc(8 * var(--wpx)); min-width: 0; }
.pet-sc-card-btns { display: flex; flex-wrap: wrap; gap: calc(4 * var(--wpx)); margin-top: auto; }
.pet-sc-card-btns .l2-btn, .pet-card-act .l2-btn { min-width: calc(64 * var(--wpx)); padding: 0 calc(8 * var(--wpx)) calc(2 * var(--wpx)); }

@media (max-width: 620px) {
 .pet-grid { grid-template-columns: 1fr; }
}
