/* Messenger of the friend window (ui/messenger.js) and the text of chat and messenger (ui/chattext.js): conversations,
   item links, emojis and their picker. Art pixels like game.css (zoomed by --px). */

/* ---------- friend window: the list, a conversation next to it ---------- */
#friends-win .fr-cols { display: flex; gap: 5px; align-items: stretch; }
#friends-win .fr-left { flex: none; width: 162px; min-width: 0; }
/* one height on every tab, with and without a conversation (Nutzer 08.11.2026: "Blockiert" was lower): the list takes what
   the other parts leave, the field to add one stays at the bottom; one row higher for every row of "Team online" / "Mentor
   online" over three (ui/friends.js --fr-more: they never scroll, Nutzer 13.11.2026); only on a screen too low for it the
   column scrolls as one */
/* + what the player dragged at the bottom edge or the corner (ui/friends.js --fr-dh, Dev-Ticket #118) */
html:not(.touch) #ui #friends-win { height: calc(240px + var(--fr-more, 0) * 11px + var(--fr-dh, 0px)); }
/* the edges that size it (PC): bottom = taller, right = wider (only with a conversation), the corner both, with two fine lines */
#friends-win .fr-rz { position: absolute; z-index: 3; touch-action: none; }
#friends-win .fr-rz.s { left: 6px; right: 8px; bottom: 0; height: 3px; }
#friends-win .fr-rz.e { top: 16px; bottom: 8px; right: 0; width: 3px; }
#friends-win:not(.ms-open) .fr-rz.e { display: none; }
#friends-win .fr-rz.se { right: 0; bottom: 0; width: 8px; height: 8px; }
#friends-win .fr-rz.se::after { content: ''; position: absolute; right: 2px; bottom: 2px; width: 4px; height: 4px; opacity: .7;
  background: linear-gradient(135deg, transparent 0 45%, #a58b5c 45% 58%, transparent 58% 72%, #a58b5c 72% 85%, transparent 85%); }
#friends-win .fr-rz.se:hover::after { opacity: 1; }
html:not(.touch) #ui #friends-win > .win-body { flex: 1 1 auto; display: flex; flex-direction: column; overflow: hidden; }
html:not(.touch) #friends-win .fr-cols { flex: 1 1 auto; min-height: 0; }
html:not(.touch) #friends-win .fr-left { display: flex; flex-direction: column; min-height: 0; overflow: hidden auto; }
html:not(.touch) #friends-win .fr-left > * { flex: none; }
html:not(.touch) #friends-win .fr-left > .fr-list { flex: 1 1 auto; min-height: 40px; max-height: none; }
/* the open conversation in the lists: gold edge on the left like a picked row of the panels (imperial.css .fp-row.picked) */
#ui #friends-win :is(.fr-row, .ms-row).cur { background: linear-gradient(90deg, rgba(242, 196, 90, .2), rgba(242, 196, 90, .04)); box-shadow: inset 2px 0 0 #e2bf72; }
/* unread messages of a friend / a conversation */
.fr-badge { flex: none; min-width: 7px; height: 7px; padding: 0 2px; font-size: 6px; line-height: 7px; text-align: center; color: #fff;
  background: #b8322a; box-shadow: 0 0 0 1px var(--edge); text-shadow: var(--ol); }

/* portraits (class + gender, ui/messenger.js setFace) in a bronze frame, grey while the other one is offline */
#friends-win :is(.ms-rf, .ms-face) { position: relative; flex: none; padding: 1px; background: #1b1815; box-shadow: inset 0 0 0 1px #6d5f47, 0 0 0 1px #060504; }
#friends-win :is(.ms-rf, .ms-face) img { display: block; image-rendering: auto; filter: grayscale(.85) brightness(.7); }
#friends-win :is(.ms-row.on .ms-rf, .ms-pane.on .ms-face) { box-shadow: inset 0 0 0 1px #c0a36a, 0 0 0 1px #060504; }
#friends-win :is(.ms-row.on .ms-rf, .ms-pane.on .ms-face) img { filter: none; }

/* conversation list (tab "Nachrichten"): portrait with the online dot, name and time, the last message below */
#friends-win .ms-row { display: flex; align-items: center; gap: 4px; height: 21px; padding: 0 3px; cursor: pointer; color: var(--dim); box-shadow: inset 0 -1px 0 #2a241d; }
#friends-win .ms-row:hover { background: rgba(242, 196, 90, .07); }
#friends-win .ms-row:last-child { box-shadow: none; }
#friends-win .ms-rf img { width: 13px; height: 13px; }
#friends-win .ms-rf .fr-dot { position: absolute; right: -2px; bottom: -2px; translate: none; }
#friends-win .ms-row:not(.on) .ms-rf .fr-dot { display: none; }
#friends-win .ms-rt { flex: 1; min-width: 0; }
.ms-r1 { display: flex; align-items: center; gap: 3px; height: 9px; font-size: 7px; }
.ms-row .fr-name { color: var(--text); }
.ms-row.on .fr-dot { background: var(--green); }
.ms-row.unread .fr-name { color: var(--gold); }
.ms-ago { flex: none; font-size: 6px; color: var(--dim); }
.ms-r2 { height: 8px; font-size: 6px; line-height: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-row.unread .ms-r2 { color: var(--text); }

/* the conversation (user 03.11.2026: no black box behind it, like the panels of the Battle Pass): one framed panel as high
   as the list (its own content never makes the window taller) - head bar, the history on the warm panel surface, the bar
   to write at its foot */
#friends-win .ms-pane { position: relative; flex: 1; min-width: 0; }
#friends-win .ms-inner { position: absolute; inset: 0; display: flex; flex-direction: column;
  background: radial-gradient(ellipse 90% 45% at 50% 0%, rgba(226, 182, 104, .08), transparent 80%), linear-gradient(#25201a, #17130f);
  box-shadow: inset 0 0 0 1px #47423a; }
#friends-win .ms-head { flex: none; display: flex; align-items: center; gap: 4px; height: 26px; padding: 0 5px 0 4px;
  background: linear-gradient(90deg, #3b3021, #211b14 55%, #18140f); box-shadow: inset 0 0 0 1px #47423a, inset 0 -1px 0 #6b5733; }
#friends-win .ms-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 100%; cursor: pointer; }
#friends-win .ms-face img { width: 18px; height: 18px; }
#friends-win .ms-lv { white-space: nowrap; position: absolute; left: -2px; bottom: -3px; min-width: 9px; height: 7px; padding: 0 1px; font-size: 6px; line-height: 7px;
  text-align: center; color: #f3ddab; background: #2d2924; box-shadow: 0 0 0 1px #060504, inset 0 0 0 1px #8a7448; text-shadow: var(--ol); }
#friends-win .ms-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#friends-win .ms-name { height: 10px; font-size: 9px; line-height: 10px; color: var(--gold); text-shadow: 1px 1px 0 var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#friends-win .ms-who:hover .ms-name { color: #fff2ce; }
#friends-win .ms-sl { display: flex; align-items: center; gap: 3px; min-width: 0; height: 7px; }
#friends-win .ms-pane.on .ms-sl .fr-dot { background: var(--green); }
#friends-win .ms-sub { min-width: 0; font-size: 6px; line-height: 7px; color: #a89a80; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#friends-win .ms-close { flex: none; width: 11px; height: 11px; cursor: pointer; background: var(--ic-close) center / 12px 12px no-repeat; opacity: .7; }
#friends-win .ms-close:hover { opacity: 1; }

#friends-win .ms-log { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; padding: 3px 7px; }
.ms-log > :first-child { margin-top: auto; }
#friends-win .ms-empty { padding: 6px 4px; font-size: 7px; line-height: 9px; text-align: center; }
#friends-win .ms-more { flex: none; align-self: center; margin: 2px 0; padding: 0 5px; height: 9px; font-size: 6px; line-height: 9px; color: #b39a6a; cursor: pointer;
  background: #2a241d; box-shadow: inset 0 0 0 1px #4d453a; }
#friends-win .ms-more:hover { color: #fff2ce; box-shadow: inset 0 0 0 1px #8a7448; }
/* day: its name between two fine gold lines */
#friends-win .ms-day { flex: none; display: flex; align-items: center; gap: 4px; margin: 5px 0 3px; font-size: 6px; line-height: 7px; color: #b39a6a; }
#friends-win .ms-day::before, #friends-win .ms-day::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #5c4b2f); }
#friends-win .ms-day::after { background: linear-gradient(90deg, #5c4b2f, transparent); }
/* bubbles: the other one on the left in warm stone, the own ones on the right in bronze; the last of a group has a tail */
#friends-win .ms-msg { flex: none; display: flex; flex-direction: column; align-items: flex-start; margin-top: 1px; }
#friends-win .ms-msg.end { margin-bottom: 3px; }
#friends-win .ms-msg.mine { align-items: flex-end; }
#friends-win .ms-bub { --bub-e: #5d5244; position: relative; max-width: 86%; padding: 2px 5px 3px; font-size: 7px; line-height: 9px; color: #eee3c8;
  overflow-wrap: anywhere; white-space: pre-wrap; background: linear-gradient(#3a3229, #2a241d);
  box-shadow: inset 0 0 0 1px var(--bub-e), inset 0 2px 0 rgba(255, 236, 190, .05); }
#friends-win .ms-msg.mine .ms-bub { --bub-e: #9a7a44; color: #fbeed2; background: linear-gradient(#5b4627, #3d2e19); }
#friends-win .ms-msg.end .ms-bub::before { content: ''; position: absolute; bottom: 0; left: -3px; width: 4px; height: 4px; background: var(--bub-e);
  clip-path: polygon(100% 0, 100% 100%, 0 100%); }
#friends-win .ms-msg.mine.end .ms-bub::before { left: auto; right: -3px; clip-path: polygon(0 0, 100% 100%, 0 100%); }
/* 1-3 emojis alone: big, without a bubble */
#friends-win .ms-msg.big .ms-bub { padding: 0; background: none; box-shadow: none; }
#friends-win .ms-msg.big .ms-bub::before { display: none; }
.ms-msg.big .emo { font-size: 15px; line-height: 17px; }
#friends-win .ms-time { margin-top: 1px; padding: 0 2px; font-size: 6px; line-height: 7px; color: #8a7d68; }
#friends-win .ms-seen { color: #9cc27c; }
/* "… schreibt": three dots that light up in turn */
#friends-win .ms-typing { flex: none; display: flex; align-items: center; gap: 3px; height: 9px; padding: 0 8px; font-size: 6px; line-height: 9px; color: #b39a6a;
  white-space: nowrap; overflow: hidden; }
#friends-win .ms-dots { flex: none; display: flex; gap: 1px; }
#friends-win .ms-dots i { width: 2px; height: 2px; background: #e2bf72; animation: ms-dot 1.2s steps(1) infinite; }
#friends-win .ms-dots i:nth-child(2) { animation-delay: .2s; }
#friends-win .ms-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes ms-dot { 0%, 100% { opacity: .25; } 30% { opacity: 1; } 60% { opacity: .25; } }
#friends-win .ms-note { flex: none; margin: 0 5px 3px; padding: 1px 4px; font-size: 6px; line-height: 8px; color: #f0b070; overflow-wrap: anywhere;
  background: #2a1d12; box-shadow: inset 0 0 0 1px #6d4a26; }
#friends-win .ms-note.err { color: #ffa08e; background: #2c1612; box-shadow: inset 0 0 0 1px #7a3a30; }
/* the bar to write: the foot of the panel */
#friends-win .ms-bar { flex: none; display: flex; align-items: center; gap: 3px; padding: 3px 4px 4px;
  background: linear-gradient(#1d1814, #120f0c); box-shadow: inset 0 0 0 1px #47423a, inset 0 1px 0 #5c4b2f; }
#ui #friends-win .ms-bar .ms-text { flex: 1; min-width: 0; height: 14px; font-size: 7px; }
#ui #friends-win .ms-bar .btn.small { flex: none; min-width: 0; height: 14px; }
#ui #friends-win .ms-bar .emo-btn { width: 15px; }
#ui #friends-win .ms-bar .ms-go { padding: 0 7px; }

/* ---------- text of chat and messenger ---------- */
/* item link: tooltip of the item on hover, gold with bonuses like the tooltip title */
.ilink { color: #f1e6c0; cursor: pointer; }
.ilink.bon { color: var(--bon); }
.ilink:hover { color: #fff; }
/* web address in a message of the team (server/messenger.js msg.u) */
.web-link { color: #8fd0ff; text-decoration: underline; cursor: pointer; }
.web-link:hover { color: #fff; }
/* emojis: the colour font of the system, a little bigger than the narrow pixel font, without growing the line */
.emo { font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; font-size-adjust: none; font-size: 7px; line-height: 0; }
#chat .log div.ms-chat { cursor: pointer; }
#chat .log div.ms-chat:hover { background: rgba(231, 155, 255, .08); }
.ch-w-tag { color: #e79bff; }

/* chat input with the emoji button */
#chat .chat-row { display: flex; gap: 2px; margin-top: 2px; }
#chat .chat-row #chat-input { flex: 1; min-width: 0; width: auto; margin-top: 0; }
#chat.idle .chat-row .emo-btn { opacity: .35; }
.btn.small.emo-btn { flex: none; width: 14px; min-width: 0; height: 12px; padding: 0; }

/* emoji picker over its button */
.emo-pick { position: absolute; z-index: 9100; display: grid; grid-template-columns: repeat(8, 13px); gap: 1px; padding: 3px; }
.emo-k { display: flex; align-items: center; justify-content: center; width: 13px; height: 13px; cursor: pointer;
  font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif; font-size-adjust: none; font-size: 9px; line-height: 1; }
.emo-k:hover { background: rgba(242, 196, 90, .18); box-shadow: inset 0 0 0 1px var(--bronze); }

/* item tooltips: "Alt + Klick" opens the wiki - while typing in the chat or the messenger it puts the item there */
#ui .tooltip .tt-link { display: none; }
#ui.typing .tooltip .tt-link { display: block; }
#ui.typing .tooltip .tt-wiki { display: none; }

/* team members stand out (Nutzer 29.10.2026): emblem + colour in the head, their bubbles, their rows, the chat hint */
.ms-nl { display: flex; align-items: center; gap: 2px; min-width: 0; }
.ms-team { flex: none; height: 6px; image-rendering: pixelated; }
#friends-win .ms-pane.team .ms-name { color: #ff9a6a; }
#friends-win .ms-pane.team .ms-msg:not(.mine) .ms-bub { --bub-e: #a65a34; color: #ffd8c2; background: linear-gradient(#4b2b1d, #321c13); }
.ms-row.team .fr-name { color: #ff9a6a; }
#chat .log div.ms-note-line { color: #e79bff; }
#chat .log div.ms-note-line.team { color: #ff9a6a; }
#chat .log div.ms-note-line.team .ch-w-tag { color: #ff9a6a; }
/* the KI-Helfer "PIDLE Model 1" (ui/friends.js aiRow): its picture is an item icon, its name in the colour of the helper */
#friends-win .ms-row.ms-ai .fr-name { color: #8fb8ff; }
#friends-win .ms-row.ms-ai .ms-rf img, #friends-win .ms-face img[src*="27997"] { object-fit: contain; image-rendering: auto; }
/* the KI-Helfer first in "Mentor online" (ui/friends.js aiStaffRow) */
#friends-win .fr-row .fr-ai { width: 9px; height: 9px; object-fit: contain; flex: none; }
/* a finger high on the phone (the box grows with it) */
html.touch #friends-win .fr-row.fr-ai-row { height: auto; min-height: 44px; }
/* the conversation with the KI-Helfer: how often one may ask (ui/messenger.js renderHead) */
#friends-win .ms-aihint { font-size: 6px; line-height: 8px; color: var(--dim); padding: 2px 4px 3px; white-space: normal; overflow-wrap: anywhere; }
html.touch #friends-win .ms-aihint { font-size: 7px; line-height: 9px; }
