/* Giran's chat and target window as the client's (Daniel 2. 11. 2026 at night with a screenshot of the client: "more of the
   Lineage II chat's look, and the target too", only the look; its tabs since 12. 11. 2026, at the end). Loaded after l2-ui.css. Sizes in the client's
   pixels: --cpx is one of them at the size the text is drawn (game.js uiFont: --l2text, the client's text being 11 px; 2 with
   the pixel font, which is drawn twice the client), so lines, buttons and the frame keep the client's proportions to the text
   on every screen. */
#townUi{--cpx:calc(var(--l2text,22px) / 11)}

/* The chat as the client's ChatWnd (system/interface.xdat, L2UI_CH3 ChatWnd Chatting_Back1-4): 348 px wide, flat dark grey at
   67 % inside a grey line and a black one, square; the log's lines close together and from the bottom up (the first one pushed
   down by margin-top:auto, which still scrolls, unlike justify-content:flex-end) and its scroll bar at the left; the edit box
   at the bottom near black in a grey line with the language letter A at its left (Chatting_IMEen). Everyone's chat white in one
   colour for the name and the words (one's own too), whispers magenta, the town's notices in the system messages' grey
   (interface.css .notice). */
#townUi .town-chat{width:min(calc(var(--cpx) * 400),calc(100vw - 2rem));gap:calc(var(--cpx) * 3);padding:calc(var(--cpx) * 3) calc(var(--cpx) * 3) calc(var(--cpx) * 4);background:#212021ab;border:max(1px,var(--cpx)) solid #525152ee;border-radius:0;box-shadow:0 0 0 max(1px,var(--cpx)) #080808;backdrop-filter:none}
#townUi .town-log{display:flex;flex-direction:column;height:min(calc(var(--cpx) * 150),26vh);direction:rtl;padding-left:calc(var(--cpx) * 2);line-height:calc(var(--l2text,22px) * 1.35);color:#fff}
#townUi .town-line{direction:ltr;text-align:left}#townUi .town-line:first-child{margin-top:auto}
#townUi .town-line b,#townUi .town-line.mine b{color:inherit}
#townUi .town-line b[data-id]:hover{color:var(--gold)}
#townUi .town-line.whisper,#townUi .town-line.whisper b{color:#ff00ff}
#townUi .town-line.whisper b[data-whisper]{cursor:pointer}#townUi .town-line.whisper b[data-whisper]:hover{color:var(--gold)}
#townUi .town-say{display:flex;align-items:center;gap:calc(var(--cpx) * 3);margin:0;padding:calc(var(--cpx) * 1) calc(var(--cpx) * 3) calc(var(--cpx) * 1) calc(var(--cpx) * 1);background:#101010ee;border:max(1px,var(--cpx)) solid #424142;cursor:text}
#townUi .town-say:focus-within{border-color:#636263}
#townUi .chat-ime{flex:none;width:calc(var(--cpx) * 14);height:calc(var(--cpx) * 14);background:url(./assets/ui/chat-ime.png) center/100% 100% no-repeat}
#townUi #townInput{flex:1;min-width:0;padding:0;background:none;border:0;border-radius:0;outline:0;line-height:calc(var(--l2text,22px) * 1.35);color:#fff}
#townUi #townInput::placeholder{color:#7d776b}

/* The target window as the client's TargetStatusWnd: SmallWindow_Back1, Back2 and Back3_ex (the navy handle with its gold arrow
   at the right) as one border-image (target-frame.png, doubled), the name in white at the top in the middle, the close button
   at the top right (btnClose, 10 px left of the handle); under the name an NPC's title in the green of the titles over the
   heads (town-npcs.js), a player's class grey and Invite and Block under it. */
#townUi .town-target{top:.5rem;display:flex;flex-direction:column;align-items:center;gap:calc(var(--cpx) * 1);min-width:calc(var(--cpx) * 190);max-width:calc(100vw - 2rem);padding:calc(var(--cpx) * 4) calc(var(--cpx) * 30) calc(var(--cpx) * 7);background:none;border:0 solid transparent;border-radius:0;box-shadow:none;backdrop-filter:none;border-image:url(./assets/ui/target-frame.png) 30 16 4 16 fill/calc(var(--cpx) * 15) calc(var(--cpx) * 8) calc(var(--cpx) * 2) calc(var(--cpx) * 8) stretch}
#townUi .town-target>b{color:#fff;white-space:nowrap}
#townUi .town-target:has(#townInvite[hidden])>small{color:#b4f0a0}
#townUi .town-target-actions{margin-top:calc(var(--cpx) * 3)}#townUi .town-target-actions:not(:has(.btn:not([hidden]))){display:none}
#townUi #townTargetClose{position:absolute;top:calc(var(--cpx) * 6);right:calc(var(--cpx) * 11);width:calc(var(--cpx) * 15);height:calc(var(--cpx) * 15);min-height:0;padding:0;border:0;border-radius:0;box-shadow:none;background:url(./assets/ui/close.png) center/100% 100% no-repeat;cursor:pointer}
#townUi #townTargetClose:hover{filter:none;background-image:url(./assets/ui/close-over.png)}
#townUi #townTargetClose:active{background-image:url(./assets/ui/close-down.png)}

/* The chat in a run (run-chat.js, 9. 11. 2026, Daniel: "a chat in the instances too"): the ChatWnd above, smaller, in the run's bottom
   left corner (the loot at the right, the bars in the middle), only whispers in their magenta, the party's lines in Lineage II's party
   green and the town's notices; the edit line only while typing, a quiet window fades. The party's green in the town's chat too.
   29. 11. 2026 (Viability, Nine: "bigger, like in town"; manager): as wide and its lines as tall as the town's window (ChatWnd 348 x 187,
   its log 141 px high), the width kept to a third of the screen for the bars in the middle; it grows with its lines up to that. */
#runChat{--cpx:calc(var(--l2text,22px) / 11);position:absolute;left:.7rem;bottom:.8rem;z-index:3;pointer-events:auto;font:26px/1.2 var(--l2font);text-shadow:0 1px 2px #000;display:flex;flex-direction:column;gap:calc(var(--cpx) * 3);width:min(calc(var(--cpx) * 400),34vw);padding:calc(var(--cpx) * 3);background:#212021ab;border:max(1px,var(--cpx)) solid #525152ee;box-shadow:0 0 0 max(1px,var(--cpx)) #080808;color:#fff;transition:opacity .6s}
#runChat[hidden]{display:none}
#runChat.quiet{opacity:.45}
#runChat .run-chat-log{display:flex;flex-direction:column;max-height:min(calc(var(--cpx) * 150),26vh);overflow-y:auto;line-height:calc(var(--l2text,22px) * 1.35)}
#runChat .town-line{text-align:left;overflow-wrap:anywhere}#runChat .town-line:first-child{margin-top:auto}
#runChat .town-line b{font-weight:400;color:inherit}
#runChat .town-line.whisper{color:#ff00ff}#runChat .town-line.party{color:#00ff00}
#runChat .town-line b[data-whisper],#runChat .town-line b[data-party]{cursor:pointer}#runChat .town-line b[data-whisper]:hover,#runChat .town-line b[data-party]:hover{color:var(--gold)}
#runChat .run-chat-say{display:none;align-items:center;gap:calc(var(--cpx) * 3);margin:0;padding:calc(var(--cpx) * 1) calc(var(--cpx) * 3) calc(var(--cpx) * 1) calc(var(--cpx) * 1);background:#101010ee;border:max(1px,var(--cpx)) solid #636263;cursor:text}
#runChat.typing .run-chat-say{display:flex}
#runChat .chat-ime{flex:none;width:calc(var(--cpx) * 14);height:calc(var(--cpx) * 14);background:url(./assets/ui/chat-ime.png) center/100% 100% no-repeat}
#runChat input{flex:1;min-width:0;padding:0;background:none;border:0;border-radius:0;outline:0;font:inherit;line-height:calc(var(--l2text,22px) * 1.35);color:#fff}
#runChat input::placeholder{color:#7d776b}
/* the quick words (run-chat.js quick: the siege's gate or rampart): the client's Btn1 (l2-hudrun.css), 40 px to tap (touch.css) */
#runChat .run-chat-quick{display:flex;gap:calc(var(--cpx) * 3)}
#runChat .run-chat-quick[hidden]{display:none}
#runChat .run-chat-quick button{flex:1;position:relative;white-space:nowrap}
/* the button that opens the line on a touch screen (no Enter there): only touch.css shows it */
#runChatBtn{display:none;position:absolute;z-index:3;width:40px;height:40px;padding:0;pointer-events:auto;background:url(./assets/ui/chat-ime.png) center/24px 24px no-repeat,rgba(30,27,23,.72);border:1px solid #000;border-radius:0;box-shadow:inset 0 0 0 1px var(--bevel);cursor:pointer}
/* the server's news (phase 1, town.js announced): the client's announcements' light blue, in the town's chat and in a run's */
#townUi .town-line.news,#runChat .town-line.news{color:#80ffff}
#townUi .town-line.party,#townUi .town-line.party b{color:#00ff00}#townUi .town-line.party b[data-party]{cursor:pointer}#townUi .town-line.party b[data-party]:hover{color:var(--gold)}
/* a sent whisper (->name: words) a shade lighter than one received, so the two sides of a talk part (RuSH3R 11. 11. 2026, Daniel
   "toto pls taky"); the name's gold on hover stays */
#townUi .town-line.whisper.mine,#townUi .town-line.whisper.mine b,#runChat .town-line.whisper.mine{color:#ff9cff}

/* The chat's tabs as the client's ChatWnd (12. 11. 2026, Daniel: "there is no clicking over to the party … the tabs as right in L2";
   town.js tabs): L2UI_CH3 Chatting_Tab1 for the open one (the window's grey runs into it), Chatting_Tab2 for the others (near
   black) and Chatting_Tab2_over under the pointer, 64 × 23 client px each, hanging under the log over the edit line in the town's
   window and the run's. A tab shows its lines (data-tab on the log): Party the party's, Clan the clan's, both the whispers and the
   notices too; General every line. */
#townUi .chat-tabs,#runChat .chat-tabs{display:flex;gap:0;margin:calc(var(--cpx) * -3) 0 0;padding:0 0 0 calc(var(--cpx) * 2);pointer-events:auto}
#townUi .chat-tabs button,#runChat .chat-tabs button{flex:none;width:calc(var(--cpx) * 64);height:calc(var(--cpx) * 23);min-height:0;margin:0;padding:0 0 calc(var(--cpx) * 5);border:0;border-radius:0;box-shadow:none;background:url(./assets/ui/chat-tab2.png) 0 0/100% 100% no-repeat;color:#9c968a;font:inherit;font-size:26px;line-height:calc(var(--cpx) * 17);text-shadow:none;filter:none;cursor:pointer}
#townUi .chat-tabs button:hover,#runChat .chat-tabs button:hover{background-image:url(./assets/ui/chat-tab-over.png);color:#d8d0bd;filter:none}
#townUi .chat-tabs button.active,#runChat .chat-tabs button.active{background-image:url(./assets/ui/chat-tab1.png);color:#fff}
#townUi .chat-tabs button[hidden],#runChat .chat-tabs button[hidden]{display:none}
#runChat .chat-tabs button{font-size:inherit}
:is(#townLog,#runChat .run-chat-log)[data-tab="party"]>.town-line:not(.party,.whisper,.notice,.news,.clan-sys),
:is(#townLog,#runChat .run-chat-log)[data-tab="clan"]>.town-line:not(.clan,.clan-sys,.whisper,.notice,.news){display:none}
