/* ProjectIdle UI. Everything inside #ui is authored in art pixels and zoomed by --px (integer scale).
   One consistent pixel style: dark panels, 1px bronze inner border, hard shadows, no blur. */
:root {
  --px: 2;
  --bg0: #0d0a08;
  --bg1: #191411;
  --bg2: #221b16;
  --bg3: #2e251e;
  --edge: #050403;
  --bronze: #7d6240;
  --bronze-l: #b08a52;
  --bronze-d: #3a2d20;
  --gold: #f2c45a;
  --gold-d: #b08a3e;
  --text: #efe7d6;
  --dim: #a89a80;
  --red: #e2463a;
  --blue: #3f86e0;
  --green: #78d65a;
  --ink: #0a0706;
  /* Jersey 10: condensed pixel font with clear digits; it only has one weight, so nothing is faux-bolded */
  --font: 'Jersey 10', 'Segoe UI', sans-serif;
  --num: 'Press Start 2P', monospace;
  --slot: 18px;
  /* hairline outline for small text on icons and bars: half an art pixel, so the narrow pixel digits keep their gaps */
  --ol: .5px 0 0 var(--ink), -.5px 0 0 var(--ink), 0 .5px 0 var(--ink), 0 -.5px 0 var(--ink), .5px .5px 0 var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0809; color: var(--text); font-family: var(--font);
  font-size-adjust: 0.56; font-synthesis: none; /* Jersey runs ~30% smaller than the sizes the UI is authored in */ }
#stage { position: fixed; inset: 0; }
#gl, #overlay { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
#overlay { pointer-events: none; }
#ui { position: absolute; left: 0; top: 0; width: 100px; height: 100px; transform: scale(var(--px)); transform-origin: 0 0; pointer-events: none;
  font-size: 8px; line-height: 1.25; font-weight: 500; }
#ui * { image-rendering: pixelated; }
/* game UI: nothing can be selected / highlighted by clicking or dragging, only text fields */
html, body, #ui, #ui * { user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
#ui input, #ui textarea { user-select: text; -webkit-user-select: text; }
#ui > * { pointer-events: auto; }
.hidden { display: none !important; }
img { image-rendering: pixelated; }
.outline { text-shadow: var(--ol); }

/* ---------- frames ---------- */
.frame, .win, .tooltip {
  background: rgba(22, 17, 14, .96);
  box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px var(--bronze), inset 0 0 0 2px var(--edge), 0 2px 0 1px rgba(0, 0, 0, .45);
}
.frame.glass { background: rgba(14, 11, 9, .72); }

.win { position: absolute; min-width: 80px; padding: 2px; color: var(--text); user-select: none; }
.win-title {
  height: 13px; display: flex; align-items: center; justify-content: center; position: relative; cursor: move;
  background: linear-gradient(#3b2f23, #2a2119); box-shadow: inset 0 1px 0 #5e4a33, 0 1px 0 var(--edge);
  color: var(--gold); font-weight: 600; font-size: 8px; padding: 0 14px; white-space: nowrap; overflow: hidden;
  text-shadow: 1px 1px 0 var(--ink);
}
.win-body { padding: 5px; }
.win-close {
  position: absolute; right: 2px; top: 1px; width: 11px; height: 11px; cursor: pointer;
  background: var(--ic-close) center / 12px 12px no-repeat; opacity: .75;
}
.win-close:hover { opacity: 1; filter: drop-shadow(0 0 0 var(--red)); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 13px; min-width: 40px; padding: 0 6px;
  background: linear-gradient(#4a3b2b, #32281e); color: var(--text); font: inherit; font-size: 8px; border: 0; cursor: pointer;
  box-shadow: 0 0 0 1px var(--edge), inset 0 1px 0 #806444, inset 0 -1px 0 #1c1611; text-shadow: 1px 1px 0 var(--ink); white-space: nowrap;
  /* the fixed min-width replaces the automatic minimum of flex items: without this a button in a full row gets
     narrower than its label and the text runs over the frame */
  flex-shrink: 0;
}
.btn:hover { background: linear-gradient(#5c4934, #3d3124); color: #fff; }
.btn:active { box-shadow: 0 0 0 1px var(--edge), inset 0 1px 0 #1c1611; transform: translateY(1px); }
.btn.big, .btn.primary {
  height: 16px; min-width: 70px; font-size: 9px; color: #fff6dc;
  background: linear-gradient(#c08c3c, #8c5f24); box-shadow: 0 0 0 1px var(--edge), inset 0 1px 0 #f6d27c, inset 0 -1px 0 #5a3c14;
}
.btn.big:hover, .btn.primary:hover { background: linear-gradient(#d29c48, #9c6a2a); }
.btn.small { min-width: 22px; height: 11px; font-size: 7px; padding: 0 4px; }
.btn.on { color: var(--green); box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px #3f8f3f; }
.btn[disabled] { filter: grayscale(1) brightness(.6); cursor: default; }
/* buttons side by side are always equally wide and high (user wish), also a primary one next to a normal one */
.eq-btns { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; width: max-content; max-width: 100%; margin: 0 auto; }
.eq-btns > .btn, .eq-btns > .btn.primary { min-width: 0; width: 100%; height: 14px; font-size: 8px; padding: 0 6px; }
.eq-btns > .btn.small { height: 11px; font-size: 7px; padding: 0 4px; }

.slot {
  width: var(--slot); height: var(--slot); position: relative; flex: none;
  background: #0f0c0a; box-shadow: inset 0 0 0 1px #2e261d, inset 1px 1px 0 1px var(--edge);
}
/* tall item icons (32 x 32 * size) fit by height, centred; slots that grow with the item: itemSlot() in dom.js */
.slot img.ic { position: absolute; left: 1px; top: 1px; width: 16px; height: 16px; pointer-events: none; object-fit: contain; }
.slot .cnt { position: absolute; right: 2px; bottom: 1px; font-size: 6px; line-height: 6px; letter-spacing: .5px; color: #fff; pointer-events: none;
  text-shadow: var(--ol); }
.slot .cnt.grade { color: var(--gold); }
.slot.hl { box-shadow: inset 0 0 0 1px var(--gold); }
/* skill cooldown (ui.updateCooldowns): dark box clearing clockwise, seconds left in the middle, flash when ready */
.slot .cd { position: absolute; left: 1px; top: 1px; width: 16px; height: 16px; z-index: 1; pointer-events: none;
  display: flex; align-items: center; justify-content: center; font-size: 8px; line-height: 8px; color: #fff2bf;
  text-shadow: var(--ol); }
.slot .cdfx, .slot .act { position: absolute; left: 1px; top: 1px; width: 16px; height: 16px; z-index: 3; pointer-events: none;
  mix-blend-mode: screen; }
.slot .cnt { z-index: 2; }
.slot:hover { box-shadow: inset 0 0 0 1px var(--bronze-l), inset 1px 1px 0 1px var(--edge); }

.bar { position: relative; height: 7px; background: #110b09; box-shadow: 0 0 0 1px var(--edge), inset 0 1px 0 #000; overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; display: block; transition: width .15s linear; }
.bar.hp > i { background: linear-gradient(#ff8a72 0 1px, #e2463a 1px 4px, #a82c24 4px); }
.bar.sp > i { background: linear-gradient(#8cc2ff 0 1px, #3f86e0 1px 4px, #2a5aa8 4px); }
.bar.exp > i { background: linear-gradient(#ffe8a0 0 1px, #f2c45a 1px, #b8862e); }
.bar .bt { position: absolute; inset: 0; font-size: 6px; line-height: 7px; text-align: center; color: #fff; letter-spacing: .5px;
  text-shadow: var(--ol); }

#ui input[type=text], #ui input:not([type]), #ui input[type=password], #ui input[type=number], #ui select {
  font: inherit; font-size: 8px; color: var(--text); background: #0f0c0a; border: 0; outline: none; padding: 1px 3px; height: 12px;
  box-shadow: inset 0 0 0 1px #3a2e22, inset 1px 1px 0 1px var(--edge);
}
#ui input:focus, #ui select:focus { box-shadow: inset 0 0 0 1px var(--gold-d), inset 1px 1px 0 1px var(--edge); }
/* marked text in the bronze of the UI instead of the browser blue (user found it ugly) */
#ui input::selection, #ui textarea::selection { background: #6a4f2c; color: #fff6dc; }
#ui input[type=number] { width: 30px; height: 11px; font-size: 7px; appearance: textfield; -moz-appearance: textfield; }
/* no native up / down arrows in number fields (Nutzer): they ignore the pixel look and cover the digits */
#ui input[type=number]::-webkit-inner-spin-button, #ui input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
#ui select { appearance: none; -webkit-appearance: none; height: 11px; font-size: 7px; padding: 0 3px; cursor: pointer; }
/* own dropdown (dom.js makeSelect): native <select> lists ignore the UI zoom */
.sel { position: relative; display: inline-flex; align-items: center; height: 12px; min-width: 40px; padding: 0 12px 0 4px; font-size: 7px;
  color: var(--text); background: #0f0c0a; box-shadow: inset 0 0 0 1px #3a2e22, inset 1px 1px 0 1px var(--edge); cursor: pointer; white-space: nowrap; }
.sel::after { content: ''; position: absolute; right: 4px; top: 5px; border-left: 3px solid transparent; border-right: 3px solid transparent;
  border-top: 3px solid var(--bronze-l); }
.sel:hover, .sel.open { box-shadow: inset 0 0 0 1px var(--gold-d), inset 1px 1px 0 1px var(--edge); }
.sel.off { filter: grayscale(1) brightness(.6); cursor: default; pointer-events: none; }
.sel-label { overflow: hidden; text-overflow: ellipsis; }
.sel-list { position: absolute; left: 0; top: calc(100% + 1px); min-width: 100%; max-height: 112px; overflow-y: auto; z-index: 50; padding: 1px;
  background: rgba(22, 17, 14, .98); box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px var(--bronze); cursor: default; }
.sel-opt { height: 11px; line-height: 11px; padding: 0 4px; white-space: nowrap; color: var(--text); cursor: pointer; }
.sel-opt:hover { background: #3b2f23; color: #fff; }
.sel-opt.on { color: var(--gold); }
#ui input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 9px; height: 9px; margin: 0; background: #0f0c0a; cursor: pointer;
  position: relative; box-shadow: inset 0 0 0 1px #4a3b2b; }
#ui input[type=checkbox]:checked::after { content: ''; position: absolute; left: 2px; top: 2px; width: 5px; height: 5px; background: var(--green); }
/* scrollbars (user wish): thin bronze grip (light left pixel, dark right pixel) in a dark rail, no arrow buttons, only
   while the mouse is over the window or panel of the list and without a reserved place. The original client art
   (assets/ui/public/scrollbar_*) was much too heavy. No scrollbar-width / scrollbar-color in #ui: Chrome ignores the
   ::-webkit-scrollbar styles as soon as they are set */
#ui ::-webkit-scrollbar { width: 0; height: 0; }
#ui :is(.win, .frame):hover ::-webkit-scrollbar { width: 2px; height: 2px; }
/* long lists the user wants to see as scrollable at a glance (auto-hunt window, quest log): always shown */
#ui .scroll-on::-webkit-scrollbar { width: 2px; height: 2px; }
#ui ::-webkit-scrollbar-track { background: #0c0907; }
#ui ::-webkit-scrollbar-thumb { min-height: 10px; background: linear-gradient(90deg, #c49a5a 0 1px, #7d6240 1px); }
#ui ::-webkit-scrollbar-thumb:hover { background: linear-gradient(90deg, #f2c45a 0 1px, #b08a52 1px); }
#ui ::-webkit-scrollbar-button, #ui ::-webkit-scrollbar-corner { display: none; width: 0; height: 0; background: none; }

.tabs { display: flex; gap: 1px; margin-bottom: 4px; }
.tab { flex: 1; text-align: center; font-size: 7px; height: 12px; line-height: 12px; cursor: pointer; color: var(--dim);
  background: #15100d; box-shadow: inset 0 0 0 1px #33281d; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--gold); background: #2a2018; box-shadow: inset 0 0 0 1px var(--bronze), inset 0 -1px 0 1px var(--gold-d); }
/* "Sortieren" at the end of the page tabs (ui/inventory.js sortButton): with its 1 px frame as high as the tabs */
.tabs > .btn.sort-btn { flex: none; min-width: 0; height: 10px; margin: 1px 1px 1px 3px; padding: 0 4px; font-size: 7px; }

.gold { color: var(--gold); }
.dim { color: var(--dim); }
.red { color: #ff7a6a; }
.green { color: var(--green); }
.blue { color: #8cbaff; }
.cyan { color: #7ee8ff; }
.row { display: flex; gap: 4px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 3px; }
.music-row { margin-bottom: 2px; }
.music-row .music-step { min-width: 13px; width: 13px; padding: 0; }
.music-vol { flex: 1; text-align: center; font-size: 8px; white-space: nowrap; }
.center { text-align: center; }
.small { font-size: 6px; }
.keyhelp { font-size: 6px; color: var(--dim); }
.sep { height: 1px; background: #3a2e22; margin: 4px 0; box-shadow: 0 1px 0 #0a0807; }
.section { color: var(--gold); font-size: 8px; margin: 5px 0 2px; }

/* ---------- tooltip ---------- */
.tooltip { position: absolute; max-width: 160px; pointer-events: none; z-index: 100000; font-size: 7px; padding: 4px 5px; }
.tooltip .tt-name { font-size: 8px; font-weight: 600; margin-bottom: 2px; }
.tooltip .tt-sep { height: 1px; background: #3a2e22; margin: 3px 0; }
/* how to handle the item (inventory / special inventory: right click, split, drop) at the very bottom */
.tooltip .tt-key { color: var(--dim); }
.tooltip .tt-head { color: var(--dim); padding-bottom: 2px; margin-bottom: 3px; border-bottom: 1px solid #3a2e22; }
/* colours and stone slots of uitooltip.py: title, special title (bonuses), normal, positive (attack, own bonuses),
   special positive (random bonuses), negative, condition; a stone slot = metin_slot_silver frame, icon, name, bonus */
.tooltip .tt-name { color: #f2e7c1; }
.tooltip .tt-name.tt-special { color: #ffc800; }
.tooltip .tt-norm { color: #c2c2c2; }
.tooltip .tt-pos { color: #8ab98e; }
.tooltip .tt-spos { color: #b0dfb4; }
.tooltip .tt-neg { color: #e5797a; }
.tooltip .tt-cond { color: #beb47d; }
.tooltip .tt-sp { margin-top: 3px; }
.tooltip .tt-metin { display: flex; align-items: center; gap: 4px; margin-top: 3px; min-height: 18px; }
.tooltip .tt-metin .ms { position: relative; flex: none; width: 18px; height: 18px; background: url(../assets/ui/game/windows/metin_slot_silver.png) 0 0 / 18px 18px no-repeat; }
.tooltip .tt-metin .ms img { position: absolute; left: 1px; top: 1px; width: 16px; height: 16px; }
.tooltip .tt-metin .mt { display: flex; flex-direction: column; min-width: 0; line-height: 8px; }

/* ---------- screens (login / select / create) ---------- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .55) 100%); }
.empire-pick { display: flex; gap: 8px; justify-content: center; }
.empire-card { width: 70px; text-align: center; cursor: pointer; padding: 3px; box-shadow: inset 0 0 0 1px #2e251c; background: rgba(0, 0, 0, .3); }
.empire-card img { width: 48px; height: 48px; display: block; margin: 0 auto 2px; }
.empire-card.sel, .empire-card:hover { box-shadow: inset 0 0 0 1px var(--gold); background: rgba(242, 196, 90, .08); }
.empire-card .en { font-size: 8px; font-weight: 600; }
.class-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.class-card { text-align: center; cursor: pointer; padding: 3px 2px; box-shadow: inset 0 0 0 1px #2e251c; background: rgba(0, 0, 0, .3); }
.class-card img { width: 32px; height: 32px; display: block; margin: 0 auto 1px; }
.class-card.sel, .class-card:hover { box-shadow: inset 0 0 0 1px var(--gold); background: rgba(242, 196, 90, .08); }
.desc { font-size: 7px; color: var(--dim); min-height: 30px; margin: 4px 0; white-space: pre-line; }
.char-list { display: flex; gap: 5px; }
.char-slot { width: 72px; height: 88px; cursor: pointer; text-align: center; padding: 5px 3px; box-shadow: inset 0 0 0 1px #2e251c; background: rgba(0, 0, 0, .35); }
.char-slot.sel, .char-slot:hover { box-shadow: inset 0 0 0 1px var(--gold); background: rgba(242, 196, 90, .06); }
.char-slot img { width: 32px; height: 32px; }

/* ---------- HUD: player frame ---------- */
#pframe { position: absolute; left: 4px; top: 4px; width: 132px; height: 38px; display: flex; gap: 4px; padding: 3px; }
#pframe .portrait { width: 32px; height: 32px; flex: none; position: relative; background: #0f0c0a; box-shadow: inset 0 0 0 1px var(--bronze); overflow: hidden; }
#pframe .portrait img { width: 32px; height: 32px; }
#pframe .plv { position: absolute; left: 0; bottom: 0; min-width: 14px; height: 9px; line-height: 9px; padding: 0 2px; font-size: 7px; text-align: center;
  color: #fff; background: #2a1f16; box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px var(--gold-d); }
#pframe .pinfo { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-top: 1px; }
#pframe .pname { font-size: 8px; line-height: 9px; color: #fff; display: flex; justify-content: space-between; align-items: baseline; gap: 3px; }
#pframe .pn { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pframe .pgs { flex: none; font-size: 7px; cursor: help; }
#pframe .bar.hp { height: 8px; }
#pframe .bar.hp .bt { line-height: 8px; }

#affects { position: absolute; left: 6px; top: 46px; display: flex; gap: 2px; }
#affects .aff { width: 14px; height: 14px; position: relative; background: #0f0c0a; box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px var(--bronze); }
#affects .aff img { width: 12px; height: 12px; margin: 1px; }
#affects .aff span { position: absolute; bottom: -7px; left: -2px; right: -2px; text-align: center; font-size: 6px; }

/* ---------- HUD: target ---------- */
#target { position: absolute; left: 50%; top: 4px; transform: translateX(-50%); width: 150px; padding: 3px 5px 4px; text-align: center; }
#target .tname { font-size: 8px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#target .tname .tlv { color: var(--gold); margin-right: 3px; }
#target .tname .tgs { margin-left: 4px; font-size: 7px; }
#target .bar { height: 7px; }

/* ---------- HUD: minimap ---------- */
#minimap { position: absolute; right: 4px; top: 4px; width: 82px; padding: 2px; }
#minimap .mhead { height: 11px; line-height: 11px; text-align: center; font-size: 7px; color: var(--gold); white-space: nowrap; overflow: hidden; }
#minimap .mm { width: 78px; height: 78px; position: relative; background: #000; box-shadow: inset 0 0 0 1px var(--bronze-d); }
#minimap canvas { width: 78px; height: 78px; display: block; image-rendering: pixelated; cursor: pointer; }
#minimap .mfoot { display: flex; justify-content: space-between; align-items: center; height: 11px; padding: 0 1px; }
#minimap .mpos { font-size: 6px; color: var(--dim); }
#minimap .mbtn { width: 9px; height: 9px; line-height: 9px; text-align: center; font-size: 8px; cursor: pointer; color: var(--text);
  background: #2a2018; box-shadow: inset 0 0 0 1px var(--bronze); }
#minimap .mbtn:hover { color: var(--gold); }

/* ---------- HUD: action bar ---------- */
#actionbar { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); padding: 4px 5px 5px; display: flex; flex-direction: column; gap: 4px; }
#actionbar .ab-row { display: flex; gap: 5px; align-items: center; }
#quick { display: flex; gap: 2px; }
#quick .gap { width: 4px; }
#quick .slot { cursor: pointer; }
#quick .slot .key { position: absolute; left: 2px; top: 1px; font-size: 6px; line-height: 6px; letter-spacing: .5px; color: var(--gold); z-index: 2; pointer-events: none;
  text-shadow: var(--ol); }
#expbar { position: relative; height: 6px; }
#expbar.bar > i { transition: width .3s; }
#expbar .seg { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(0, 0, 0, .7); }
#exptext { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); margin-bottom: 2px; font-size: 6px; color: var(--dim); white-space: nowrap; pointer-events: none; }
#auto-btn {
  min-width: 38px; height: 18px; padding: 0 5px 0 3px; display: flex; align-items: center; justify-content: center; gap: 2px; cursor: pointer;
  font-size: 7px; font-weight: 700; white-space: nowrap; color: var(--dim);
  background: linear-gradient(#2e251c, #1c1611); box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px #4a3b2b;
}
#auto-btn i { width: 16px; height: 16px; background: var(--ic-sword) center / 16px 16px no-repeat; opacity: .6; }
#auto-btn:hover { color: var(--text); }
#auto-btn.on { color: #b6ffa0; background: linear-gradient(#2c4a22, #1a2e14); box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px #5fb04a; }
#auto-btn.on i { opacity: 1; }

#autopill { position: absolute; left: 50%; transform: translateX(-50%); bottom: 50px; padding: 2px 6px; font-size: 7px; white-space: nowrap; color: #c8f0b8;
  background: rgba(14, 22, 11, .8); box-shadow: 0 0 0 1px var(--edge), inset 0 0 0 1px #3f7a32; pointer-events: none; }
#autopill .dot { display: inline-block; width: 4px; height: 4px; background: var(--green); margin-right: 3px; vertical-align: 1px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- HUD: menu ---------- */
#menubar { position: absolute; right: 4px; bottom: 4px; display: flex; gap: 2px; padding: 3px; }
.mbtn-i { width: 20px; height: 20px; position: relative; cursor: pointer; background: linear-gradient(#3a2e22, #241c15) ; box-shadow: inset 0 0 0 1px #4a3b2b; }
.mbtn-i::before { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; background: var(--icon) center / 16px 16px no-repeat; }
.mbtn-i:hover { background: linear-gradient(#4e3e2d, #2e241b); box-shadow: inset 0 0 0 1px var(--bronze-l); }
.mbtn-i .hk { position: absolute; right: 2px; bottom: 1px; font-size: 6px; line-height: 6px; color: var(--gold);
  text-shadow: var(--ol); }
.mbtn-i.on { box-shadow: inset 0 0 0 1px var(--gold); }

/* ---------- HUD: chat ---------- */
#chat { position: absolute; left: 4px; bottom: 4px; width: 214px; padding: 2px; display: flex; flex-direction: column; }
#chat .ctabs { display: flex; gap: 1px; margin-bottom: 2px; }
#chat .ctab { padding: 0 4px; height: 10px; line-height: 10px; font-size: 6px; color: var(--dim); cursor: pointer; background: rgba(0, 0, 0, .35); }
#chat .ctab.on { color: var(--gold); box-shadow: inset 0 -1px 0 var(--gold-d); }
#chat .log { height: 72px; overflow-y: auto; display: flex; flex-direction: column; font-size: 7px; line-height: 9px; padding: 0 2px;
  text-shadow: 1px 1px 0 var(--ink); }
#chat .log > div:first-child { margin-top: auto; }
#chat .log div.sys { color: #ffe08a; }
#chat .log div.item { color: #a8ff8a; }
#chat .log div.exp { color: #9fd6ff; }
#chat .log div.err { color: #ff8a7a; }
#chat .log div.notice { color: #ff9f4a; }
.team-tag { color: #ff9f4a; }
#chat .log div.ch-map, #chat .log div.ch-all, #chat .log div.ch-w { color: var(--text); }
#chat-input { margin-top: 2px; width: 100%; height: 12px !important; font-size: 7px !important; }
#chat.idle { background: rgba(14, 11, 9, .35); box-shadow: none; }
#chat.idle .ctabs, #chat.idle #chat-input { opacity: .35; }

/* ---------- notifications ---------- */
#mapname-banner { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); font-size: 13px; color: var(--gold);
  text-shadow: 2px 2px 0 #000; pointer-events: none; transition: opacity 1s; white-space: nowrap; }
#levelup { position: absolute; left: 50%; top: 16%; transform: translateX(-50%); font-size: 16px; color: #ffe39a;
  text-shadow: 2px 2px 0 #000; pointer-events: none; white-space: nowrap; }

/* ---------- inventory ---------- */
/* equipment: the client's equipment background with silhouette, slots sit on its engraved slot shapes */
.equip-panel { position: relative; width: 78px; height: 94px; margin: 2px auto 5px;
  background: url(../assets/ui/game/windows/equipment_base.png); box-shadow: 0 0 0 1px #2e251c, 0 0 0 2px var(--edge); }
.eq-slot { position: absolute; width: 16px; }
.eq-slot:hover { box-shadow: inset 0 0 0 1px var(--bronze-l); }
.eq-slot img.ic { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 16px; pointer-events: none; }
.eq-slot img.ph { filter: grayscale(1) brightness(1.5); opacity: .32; }
.inv-grid { display: grid; grid-template-columns: repeat(5, var(--slot)); grid-auto-rows: var(--slot); gap: 0; position: relative; margin: 0 auto; width: max-content; }
.inv-item { position: absolute; width: var(--slot); cursor: pointer; }
.inv-item img { width: 16px; display: block; pointer-events: none; margin: 1px; }
.inv-item .cnt { position: absolute; right: 2px; bottom: 1px; font-size: 6px; line-height: 6px; letter-spacing: .5px; text-shadow: var(--ol); }
/* new drop: pulsing gold frame until it is hovered; the page tab and the bag button blink along */
.inv-item.new::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  box-shadow: inset 0 0 0 1px #ffd24a, inset 0 0 3px 1px rgba(255, 190, 60, .6); animation: inv-new 1.2s ease-in-out infinite; }
.tab.new, .mbtn-i.new { animation: inv-new-tab 1.2s ease-in-out infinite; }
@keyframes inv-new { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes inv-new-tab { 0%, 100% { box-shadow: inset 0 0 0 1px #ffd24a; } 50% { box-shadow: inset 0 0 0 1px #4a3b2b; } }
/* better than the worn piece: green pixel arrow in the top right corner */
.inv-item .up { position: absolute; right: 1px; top: 1px; width: 7px; height: 8px; pointer-events: none; z-index: 2;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 8' shape-rendering='crispEdges'%3E%3Cpath fill='%23081505' d='M3 0h1v1h1v1h1v1h1v2h-1v3h-5v-3h-1v-2h1v-1h1v-1h1z'/%3E%3Cpath fill='%2366e35a' d='M3 1h1v1h1v1h1v1h-1v3h-3v-3h-1v-1h1v-1h1z'/%3E%3C/svg%3E") center / 7px 8px no-repeat; }
/* better, but only from a higher level on: the same arrow in grey */
.inv-item .up.later { filter: grayscale(1) brightness(1.15); }
.money { display: flex; align-items: center; gap: 3px; justify-content: flex-end; font-size: 8px; margin-top: 4px; padding: 2px 4px; background: #120e0b; box-shadow: inset 0 0 0 1px #2e251c; }
.money i { width: 16px; height: 16px; background: var(--ic-coin) center / 16px 16px no-repeat; }

.stat-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 7px; padding: 1px 1px; min-height: 11px;
  border-bottom: 1px solid #2a2119; }
.stat-row .v { color: #fff; white-space: nowrap; }
.plus { width: 10px; height: 10px; cursor: pointer; display: inline-block; vertical-align: middle; margin-left: 3px;
  background: #2a2018 var(--ic-plus) center / 12px 12px no-repeat; box-shadow: inset 0 0 0 1px var(--bronze); }
.plus:hover { box-shadow: inset 0 0 0 1px var(--gold); }

.skill-row { display: flex; align-items: center; gap: 4px; padding: 1px 0; }
.skill-row .slot { cursor: grab; }
.skill-row .sname { flex: 1; font-size: 7px; }
.skill-row .slv { font-size: 7px; color: var(--gold); width: 18px; text-align: right; }

.dialog-text { font-size: 8px; line-height: 1.4; max-width: 200px; min-height: 30px; white-space: pre-wrap; }
.dialog-opts { display: flex; flex-direction: column; gap: 2px; margin-top: 5px; }
.dialog-opts .opt { cursor: pointer; font-size: 8px; color: var(--gold); padding: 1px 3px; background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px #2e251c; }
.dialog-opts .opt:hover { color: #fff; box-shadow: inset 0 0 0 1px var(--bronze-l); }

.shop-grid { display: grid; grid-template-columns: repeat(5, var(--slot)); grid-auto-rows: var(--slot); gap: 0; position: relative; width: max-content; margin: 0 auto; }

#drag-ghost { position: absolute; pointer-events: none; z-index: 999; width: 16px; opacity: .85; }
/* part of a stack hanging at the mouse after Shift + click (inventory.js splitStack) */
.split-ghost { position: absolute; pointer-events: none; z-index: 999; width: 16px; }
.split-ghost img { display: block; width: 16px; opacity: .85; }
.split-ghost .cnt { position: absolute; right: 0; bottom: 0; font-size: 6px; line-height: 6px; letter-spacing: .5px; color: #fff; text-shadow: var(--ol); }

/* modal question boxes instead of the browser's confirm / alert (ui/dialog.js) */
.dlg-back { position: absolute; inset: 0; z-index: 9500; background: rgba(0, 0, 0, .25); }
.dlg { width: 168px; }
.dlg .dlg-text { text-align: center; font-size: 8px; line-height: 10px; margin: 1px 2px 5px; overflow-wrap: anywhere; }
.dlg .dlg-row { display: flex; justify-content: center; align-items: center; gap: 3px; margin-bottom: 5px; }
#ui .dlg input.dlg-num { width: 44px; height: 12px; font-size: 8px; text-align: center; }
.dlg .dlg-btns { grid-auto-columns: minmax(56px, 1fr); }
#death { position: absolute; }
.atlas canvas { image-rendering: pixelated; display: block; }
.quest-item { font-size: 7px; padding: 2px 0; border-bottom: 1px solid #2a2119; }
.quest-item .qt { color: var(--gold); }

/* ---------- idle / social windows ---------- */
.ctl { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.ctl .unit { width: 11px; color: var(--dim); }
.ctl select, .ctl .sel { width: 44px; }
.report-items { display: flex; flex-wrap: wrap; gap: 1px; margin-top: 2px; }
.player-list { max-height: 150px; overflow-y: auto; }
.player-list .stat-row { cursor: pointer; }
.player-list .stat-row:hover { background: rgba(242, 196, 90, .07); }
.player-list .pl-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-list .pl-info { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-list .pl-gs { flex: none; width: 22px; text-align: right; }

/* ---------- gearscore ---------- */
/* fit against a recommendation (hunting window, map): reached, close (85 %), too low */
.gs-ok { color: var(--green); }
.gs-close { color: #ffaa40; }
.gs-low { color: var(--red); }
/* character window: number in the colour of the grade, the parts as one bar */
.gs-box { margin: 1px 0 4px; padding: 3px 4px 4px; background: #120e0b; box-shadow: inset 0 0 0 1px #2e251c; cursor: help; }
.gs-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 7px; }
.gs-head .gs-val { font-size: 12px; line-height: 11px; }
.gs-bar { display: flex; height: 4px; margin: 3px 0 2px; background: var(--ink); box-shadow: 0 0 0 1px var(--edge); }
.gs-bar i { display: block; min-width: 0; }
.gs-box .st { background: #d8a24a; }
.gs-box .sk { background: #4f9be0; }
.gs-box .eq { background: #6cc85a; }
.gs-legend { display: flex; justify-content: space-between; font-size: 6px; line-height: 7px; color: var(--dim); }
.gs-legend span { white-space: nowrap; }
.gs-legend i { display: inline-block; width: 4px; height: 4px; margin-right: 2px; }
.gs-grade { font-size: 7px; margin-top: 2px; }
/* inventory: gearscore under the equipment */
.inv-gs { display: flex; justify-content: space-between; align-items: center; height: 11px; padding: 0 4px; margin: -1px 0 4px; font-size: 7px;
  background: #120e0b; box-shadow: inset 0 0 0 1px #2e251c; cursor: help; }
.tooltip .tt-gs { color: var(--gold-d); margin: -1px 0 2px; }
.tooltip .tt-kv { display: flex; justify-content: space-between; gap: 8px; }
/* short note above the action bar when the gearscore changes */
#gs-toast { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); display: flex; align-items: baseline; gap: 3px;
  padding: 2px 6px; font-size: 8px; white-space: nowrap; pointer-events: none; }
#gs-toast .up { color: var(--green); }
#gs-toast .down { color: var(--red); }
#gs-toast.pop { animation: gs-pop 2.6s ease-out forwards; }
@keyframes gs-pop { 0% { opacity: 0; transform: translate(-50%, 3px); } 8% { opacity: 1; transform: translate(-50%, 0); } 80% { opacity: 1; } 100% { opacity: 0; } }


/* ---------- small screens ---------- */
#ui.compact #chat { width: 168px; bottom: 50px; }
#ui.compact #chat .log { height: 48px; }
#ui.compact #target { top: 46px; left: 4px; transform: none; width: 132px; }
#ui.compact #affects { top: 70px; }
#ui.compact #autopill { bottom: auto; top: 4px; }
#ui.compact #menubar { bottom: 50px; }

.inv-item img { width: 16px; object-fit: contain; }
