/* UI port step 1 (docs/design/l2-ui-port-2026-11-13.md, .claude/rules/l2-ui.md): the Status window (l2-status.js) and the client's
   StatusWnd at the top left. Sizes in the client's pixels times --wpx (l2-wnd.js: a whole multiple of the screen's pixels), the
   colours the client's (interface.xdat text colours: names 220, keys 163, values 176 155 121, the Exp 180). */

/* the Status window is MainWnd built from interface.xdat (l2-xdat.js, l2-wnd.css .xd-*): here only what xdat leaves to the game */
.l2-statuswnd [data-xd=texPledgeCrest] canvas,#statusWnd [data-xd=texPledgeCrest] canvas{display:block;width:100%;height:100%;image-rendering:pixelated}
/* a Founding clan's crest (game.js statusClan founding): plate/founding.png's 18 x 14 1 px line one client px round the 16 x 12 crest,
   as the clan window (clan-ui.css) and the nameplate (nameplate.js CREST_FRAME) frame it; an Aden addition, square */
.l2-statuswnd [data-xd=texPledgeCrest].founding::after,#statusWnd [data-xd=texPledgeCrest].founding::after{content:'';position:absolute;left:calc(-1 * var(--wpx));top:calc(-1 * var(--wpx));width:calc(18 * var(--wpx));height:calc(14 * var(--wpx));background:url(assets/ui/plate/founding.png) 0 0/100% 100% no-repeat;image-rendering:pixelated;pointer-events:none}
.l2-statuswnd [data-xd=texHero],#statusWnd [data-xd=texHero]{background-repeat:no-repeat;background-size:100% 100%}
.l2-statuswnd .xd-text[data-tip],#statusWnd .xd-text[data-tip]{cursor:help}
/* ClanWnd's members: offline in the client's grey, the selected one in its key colour (L2UI_CH3 has no row highlight texture) */
.l2-statuswnd .xd-list-row,#statusWnd .xd-list-row{cursor:pointer}
.l2-statuswnd .xd-list-row.off,#statusWnd .xd-list-row.off{color:#808080}
.l2-statuswnd .xd-list-row.sel,#statusWnd .xd-list-row.sel{color:#b09b79}
.l2-statuswnd .xd-list-row:hover,#statusWnd .xd-list-row:hover{color:#fff}
/* the class's style icon (the client's party_styleicon1-7: an 11 x 11 picture in a 16 x 16 texture, the client's lists draw 11 x 11 of it) */
.l2-statuswnd .xd-cls,#statusWnd .xd-cls{display:block;width:calc(11*var(--wpx));height:calc(11*var(--wpx));margin:0 auto;background:no-repeat 0 0/calc(16*var(--wpx)) calc(16*var(--wpx));image-rendering:pixelated}
.l2-statuswnd .xd-note,#statusWnd .xd-note{white-space:normal;overflow:hidden;line-height:calc(14*var(--wpx));color:#a3a3a3}
/* QuestTreeWnd's tree: the map's quests, a 32 px icon each with the names and the reward */
.l2-statuswnd .xd-tree,#statusWnd .xd-tree{overflow:hidden auto;scrollbar-width:none;overscroll-behavior:contain}
.l2-statuswnd .xd-tree::-webkit-scrollbar,#statusWnd .xd-tree::-webkit-scrollbar{display:none}
.l2-statuswnd .xd-tree-head,#statusWnd .xd-tree-head{height:calc(16*var(--wpx));line-height:calc(16*var(--wpx));padding:0 calc(3*var(--wpx));color:#b09b79;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.l2-statuswnd .xd-tree-row,#statusWnd .xd-tree-row{display:grid;grid-template-columns:calc(32*var(--wpx)) 1fr;column-gap:calc(5*var(--wpx));padding:calc(2*var(--wpx)) calc(3*var(--wpx));line-height:calc(14*var(--wpx));cursor:help}
.l2-statuswnd .xd-tree-row:hover>span,#statusWnd .xd-tree-row:hover>span{color:#fff}
.l2-statuswnd .xd-tree-icon,#statusWnd .xd-tree-icon{grid-row:span 2;width:calc(32*var(--wpx));height:calc(32*var(--wpx));background:no-repeat center/100% 100%}
.l2-statuswnd .xd-tree-row>span,#statusWnd .xd-tree-row>span{color:#dcdcdc;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}  /* (the names on two lines, all of them in the tooltip) */
.l2-statuswnd .xd-tree-row>small,#statusWnd .xd-tree-row>small{font-size:inherit;color:#b09b79;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.l2-statuswnd .xd-tree-row em,#statusWnd .xd-tree-row em{font-style:normal;color:#a3a3a3}

/* StatusWnd: the HUD's own card (.hp-card, game.js moves it between the run's HUD and the town) as the client draws it, 176 x 84
   less the 12 empty columns xdat leaves at its left and less CP and MP (Aden has neither): statuswnd-aden (Smallwindow2_back1,
   Smallwindow2_back2 stretched, ps_sizecontrol1) sliced at its 4 px top and bottom edges, the level in ps_levelback at 3, 6, the name
   at 28, 9, HP where the client has CP (4, 27) and the Exp where it has HP (4, 41), the bars 150 x 12. The ids game.js writes stay.
   In the HUD's scale (--hpx, l2-hudwnd.css: Daniel 14. 11. 2026 "o malinko zvětšit"): the frame's edges (Smallwindow2_back1's 16
   columns, ps_sizecontrol1's 4, the 4 rows at the top and the bottom) and the gauge's pixel font stay in --wpx, whole device
   pixels; the middle (one colour across, checked 14. 11.) stretches.
   The gaps even (e9 14. 11. 2026 from Daniel's test, "tady ty jsou špatne vertikalne vycentrovane … gaps blbe", the arrows at the
   HP bar's left end and the lower bar's right end): xdat's places (less its 12 columns: level 3, 6; name 28, 9; CP 4, 27; HP 4, 41)
   are for its 84 high window with four gauges, the last ending 3 px above its edge; in Aden's 56 with two they left 4 px over the
   level, 1 under it, 2 between the bars and 1 under the last, and 4 px left against 6 right. Now from the frame's light inner line
   (2 px in at the top and the bottom, ps_sizecontrol1's at 4 from the right; the left, Smallwindow2_back1, has none, its alpha steps
   at 2): 2 px over the level box (4..24), the name centred on it, 2 px to each bar (HP 26..38, the Exp or the town's row 40..52) and 2
   px under it; across, 4 px from each inner edge (6..156). */
:is(#hud,#townUi) .hp-card.hud-box{box-sizing:border-box;width:calc(164*var(--hpx));height:calc(56*var(--hpx));padding:0;margin:0;
 border:solid transparent;border-width:0;border-radius:0;box-shadow:none;backdrop-filter:none;background:none;
 border-image:url(assets/ui/wnd/statuswnd-aden.png) 4 4 4 16 fill/calc(4*var(--wpx)) calc(4*var(--wpx)) calc(4*var(--wpx)) calc(16*var(--wpx)) stretch;image-rendering:pixelated;
 font:var(--hfont)/var(--hline) var(--l2font);text-shadow:none;color:#dcdcdc;position:relative;left:0;top:0;flex-shrink:0}  /* left, top: style.css's narrow-screen rule moved the card .75rem over its buffs (Pixel 7 upright, 14. 11. 2026) */
:is(#hud,#townUi) .hp-card.hud-box .hp-top{display:block;margin:0}
:is(#hud,#townUi) .hp-card.hud-box #levelText{position:absolute;left:calc(6*var(--hpx));top:calc(4*var(--hpx));box-sizing:border-box;
 width:calc(22*var(--hpx));height:calc(20*var(--hpx));min-width:0;padding:0 0 0 var(--hpx);margin:0;border:0;border-radius:0;box-shadow:none;
 background:url(assets/ui/wnd/ps-levelback.png) 0 0/100% 100%;font:inherit;line-height:calc(20*var(--hpx));text-align:center;color:#dcdcdc;text-shadow:none}
/* the name 15 high under its 12 px line: the box clips (the ellipsis), and a j's or a g's tail below the line stays (14. 11. 2026 the
   test site read "Tvoie iméno"); the target's and the party's names do the same with a padding (l2-hudwnd.css) */
:is(#hud,#townUi) .hp-card.hud-box #hudClass{display:block;position:absolute;left:calc(31*var(--hpx));top:calc(8*var(--hpx));
 width:calc(125*var(--hpx));height:calc(15*var(--hpx));line-height:calc(12*var(--hpx));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
 font:inherit;color:#dcdcdc;text-shadow:none}
:is(#hud,#townUi) .hp-card.hud-box .bar{position:absolute;left:calc(6*var(--hpx));width:calc(150*var(--hpx));height:calc(12*var(--hpx));
 margin:0;border:0;border-radius:0;box-shadow:none;image-rendering:pixelated;overflow:visible}  /* (the comma of "0,00%" below the 12 px bar) */
:is(#hud,#townUi) .hp-card.hud-box .bar.health{top:calc(26*var(--hpx))}
:is(#hud,#townUi) .hp-card.hud-box .bar.xp{top:calc(40*var(--hpx))}
:is(#hud,#townUi) .hp-card.hud-box .bar>em{left:calc(9*var(--hpx));line-height:calc(12*var(--hpx));font:inherit;font-style:normal;letter-spacing:0;text-shadow:none;color:#fff}
:is(#hud,#townUi) .hp-card.hud-box .bar.xp>em{display:none}
/* the numbers in the gauge as the client draws them: its pixel font (L2 Small, sharp at 13 px times the scale) centred in the
   bar, one pixel apart, with its 1 px shadow (scratchpad ref: StatusWnd 2926/9209) */
:is(#hud,#townUi) .hp-card.hud-box .bar>span{padding:0;place-items:center;text-align:center;
 font:calc(13*var(--wpx))/calc(12*var(--hpx)) 'L2 Small',var(--l2font);letter-spacing:var(--wpx);
 text-shadow:var(--wpx) var(--wpx) 0 #000;color:#fff}
/* in town: at the top left, one window with Giran's head (Daniel 13. 11. 2026: "why is the whole UI not unified? the sushi test
   online is way off"). The name row is the town's name field (a click edits it, game.js; with no name yet it asks for one,
   muted), HP is always full, and where a run has the Exp the town's row says where the hero is and how many are here
   (#townHeadName and #townState, out of their own rounded box); the party under the card */
#townUi>.hp-card.hud-box{position:absolute;left:1rem;top:1rem}
#townUi>.hp-card .bar.xp{display:none}
#townUi>.hp-card #hudClass{pointer-events:auto;cursor:pointer}
#townUi>.hp-card #hudClass.l2s-noname{color:#a3a3a3}  /* not .hint: style.css gives .hint its own margin and size */
#townUi>.hp-card #hudClass:hover{color:var(--gold)}
 #townUi:has(>.hp-card) .town-head{left:calc(1rem + 6*var(--hpx));top:calc(1rem + 40*var(--hpx));width:calc(150*var(--hpx));
  height:calc(12*var(--hpx));min-width:0;box-sizing:border-box;margin:0;padding:0 0 0 calc(5*var(--hpx));border:0;border-radius:0;
  border-image:none;background:none;box-shadow:none;backdrop-filter:none;display:flex;align-items:center;gap:calc(6*var(--hpx));
  font:var(--hfont)/calc(12*var(--hpx)) var(--l2font);white-space:nowrap;text-shadow:none}
 #townUi:has(>.hp-card) .town-head>:is(b,small){flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;font:inherit;line-height:calc(12*var(--hpx))}
 #townUi:has(>.hp-card) #townName{display:none}
 #townUi:has(>.hp-card) #townNameInput{position:absolute;left:calc(25*var(--hpx));top:calc(-33*var(--hpx));box-sizing:border-box;
  width:calc(125*var(--hpx));height:calc(14*var(--hpx));margin:0;padding:0 calc(2*var(--hpx));border:var(--hpx) solid var(--gold);
  border-radius:0;font:var(--hfont)/calc(12*var(--hpx)) var(--l2font)}
@media not (pointer:coarse){#townUi:has(>.hp-card) .town-party{top:calc(1rem + 60*var(--hpx))}}
/* a phone in town: the same card with the town's row, at the phone's corner as far from it as the menu bar at the other
   (touch.css), the chat under it; no Menu button in the head (the bar's System window has the menu as its first row), the
   party where touch.css puts it */
@media (pointer:coarse){
 #townUi>.hp-card.hud-box{left:max(.5rem,env(safe-area-inset-left));top:max(.5rem,env(safe-area-inset-top))}
 #townUi:has(>.hp-card) .town-head{left:calc(max(.5rem,env(safe-area-inset-left)) + 6*var(--hpx));top:calc(max(.5rem,env(safe-area-inset-top)) + 40*var(--hpx))}
 #townUi:has(>.hp-card) #townMenu{display:none}
}
