:root {
  --bg: #0e1220;
  --panel: rgba(16, 20, 36, 0.86);
  --panel-solid: #161b2e;
  --border: rgba(255, 255, 255, 0.12);
  --text: #eef1ff;
  --muted: #9aa3c7;
  --accent: #ffcf5a;
  --accent-2: #6c8cff;
  --hp: #e84a5f;
  --mp: #4a8cff;
  --xp: #f5c542;
  --danger: #ff6b6b;
  --ok: #6dff9c;
  --font: 'Kanit', 'Leelawadee UI', 'Tahoma', sans-serif;
}
/* Chinese: Kanit has no CJK glyphs — the system's Chinese font fills them in */
html.lang-zh { --font: 'Kanit', 'Microsoft YaHei', 'PingFang SC', 'Noto Sans SC', 'Leelawadee UI', sans-serif; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); user-select: none; }
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; image-rendering: pixelated; }
.hidden { display: none !important; }
button { font-family: inherit; }
input { font-family: inherit; }

/* ---------- screens ---------- */
.screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 20;
  background: radial-gradient(ellipse at 50% 30%, rgba(60, 80, 160, 0.35), rgba(8, 10, 20, 0.92) 70%);
  overflow-y: auto; padding: 16px;
}
.card {
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 16px; padding: 28px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55); max-width: 100%;
}
.login-card { width: 380px; }
.logo { font-size: 44px; font-weight: 700; letter-spacing: 4px; text-align: center; color: var(--accent); text-shadow: 0 0 24px rgba(255, 207, 90, 0.4); }
.logo span { display: block; font-size: 16px; letter-spacing: 12px; color: var(--muted); font-weight: 400; margin-top: -6px; }
.subtitle { text-align: center; color: var(--muted); margin: 6px 0 20px; font-size: 14px; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; background: rgba(255,255,255,0.05); padding: 4px; border-radius: 10px; }
.tab { flex: 1; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; }
.tab.active { background: var(--accent-2); color: #fff; }
label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
label input, #chat-input, .wsp-input {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06); color: var(--text); font-size: 15px; outline: none;
}
label input:focus, #chat-input:focus { border-color: var(--accent-2); }
.btn {
  border: 1px solid var(--border); background: rgba(255,255,255,0.08); color: var(--text); padding: 10px 16px; border-radius: 10px;
  cursor: pointer; font-size: 15px; transition: transform .08s, background .15s;
}
.btn:hover { background: rgba(255,255,255,0.15); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: linear-gradient(180deg, #ffd56e, #f0a92b); color: #2b1d00; border: 0; font-weight: 600; width: 100%; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.big { font-size: 18px; padding: 14px; margin-top: 18px; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.error { color: var(--danger); min-height: 20px; margin-top: 10px; font-size: 14px; text-align: center; }

.create-card { width: 900px; }
.create-card h2 { margin: 0 0 16px; color: var(--accent); }
/* the title and, on the right, 🚪 ออกจากระบบ */
.create-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.create-logout { flex: none; margin: 0; }
.create-grid { display: grid; grid-template-columns: 260px 1fr; gap: 24px; }
.section-label { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.section-label small { opacity: .7; }
.gender-row { display: flex; gap: 10px; margin-bottom: 16px; }
.gender-card {
  flex: 1; background: rgba(255,255,255,0.05); border: 2px solid var(--border); border-radius: 12px; padding: 10px 0 8px;
  color: var(--text); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 15px;
}
.gender-card canvas { image-rendering: pixelated; }
.gender-card.selected { border-color: var(--accent); background: rgba(255, 207, 90, 0.1); }
.name-label input { font-size: 17px; }
#weapon-choices { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.weapon-card {
  background: rgba(255,255,255,0.05); border: 2px solid var(--border); border-radius: 12px; padding: 10px 4px; cursor: pointer;
  color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
}
.weapon-card .wicon { font-size: 30px; }
.weapon-card .wname { font-weight: 600; font-size: 15px; }
.weapon-card.selected { border-color: var(--accent); background: rgba(255, 207, 90, 0.1); }
#weapon-skills { margin-top: 12px; background: rgba(0,0,0,0.25); border-radius: 12px; padding: 12px; min-height: 180px; }
#weapon-skills .role { color: var(--accent); margin-bottom: 8px; font-size: 14px; }
/* the five weapons' texts on top of each other; the box takes the tallest (main.js setupCreateScreen) */
.ws-stack { display: grid; }
.ws-stack > .ws-one { grid-area: 1 / 1; visibility: hidden; }
.ws-stack > .ws-one.on { visibility: visible; }
.skill-preview { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; }
.skill-preview div { font-size: 13px; color: var(--muted); }
.skill-preview b { color: var(--text); font-weight: 600; }

/* login / character creation / loading: the same light look as the in-game windows (white cards, blue and gold) */
.screen {
  --panel-solid: #ffffff; --border: #d9e0ee; --text: #2b3550; --muted: #6b7590; --accent-2: #2f6bd8; --danger: #d63a3a;
  background: radial-gradient(ellipse at 50% 25%, rgba(255,255,255,0.55), rgba(255,255,255,0) 60%), linear-gradient(180deg, #8fc4ff 0%, #c9e6ff 55%, #e9f6e6 100%);
  color: var(--text);
}
.screen .card { box-shadow: 0 20px 60px rgba(30,60,120,0.25); }
/* the login page's pictures, taking turns behind the card (client/js/login-bg.js) — the sky gradient shows until the
   first one has loaded */
.login-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.login-bg .lb-img { position: absolute; inset: -2%; background: center / cover no-repeat; opacity: 0; transition: opacity 1.6s ease; transform: scale(1); }
.login-bg .lb-img.on { opacity: 1; animation: lbZoom 10s ease-out forwards; }
@keyframes lbZoom { from { transform: scale(1); } to { transform: scale(1.08); } }
.login-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.18), rgba(10,30,70,0.12) 75%); }
.screen .logo { color: #2f6bd8; text-shadow: 0 3px 0 #ffd56e, 0 0 24px rgba(47,107,216,0.25); }
.screen .tabs { background: #eef2fa; }
.screen label input { background: #f5f7fc; }
.screen label input:focus { background: #fff; }
.screen .create-card h2, .screen #weapon-skills .role { color: #2f6bd8; }
.screen .gender-card, .screen .weapon-card { background: #f5f7fc; }
.screen .gender-card.selected, .screen .weapon-card.selected { border-color: #f0a92b; background: #fff6df; }
.screen #weapon-skills { background: #f1f4fa; }
.screen .spinner { border-color: rgba(47,107,216,0.15); border-top-color: #2f6bd8; }
.login-rules { font-size: 12px; color: var(--muted); margin: -6px 0 12px; line-height: 1.5; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; backdrop-filter: blur(4px); }

#status { position: absolute; left: 12px; top: 12px; width: 270px; padding: 10px 12px; }
.status-head { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 6px; }
#st-lv { color: var(--accent); }
.bar { position: relative; height: 16px; background: rgba(0,0,0,0.5); border-radius: 8px; overflow: hidden; margin-bottom: 5px; }
.bar .fill { position: absolute; inset: 0 auto 0 0; width: 0; transition: width .15s; }
.bar.hp .fill { background: linear-gradient(180deg, #ff6f80, var(--hp)); }
.bar.mp .fill { background: linear-gradient(180deg, #7aaeff, var(--mp)); }
.bar.xp { height: 10px; }
.bar.xp .fill { background: linear-gradient(180deg, #ffe07a, var(--xp)); }
.bar .shield { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(160, 220, 255, 0.55); }
.bar span { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 16px; text-shadow: 0 1px 2px #000; }
.bar.xp span { line-height: 10px; font-size: 9px; }
.status-sub { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
#st-gold { color: var(--accent); }
#buffs { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
/* the buff / debuff box under the status panel (shown only with some — ui.placeLeft puts it there) */
#buffbox { position: absolute; left: 12px; top: 120px; max-width: 300px; padding: 6px 8px; }
#buffbox #buffs { margin-top: 0; }
.buff { font-size: 12px; background: rgba(255,255,255,0.08); border-radius: 6px; padding: 1px 6px; }

#minimap-wrap { position: absolute; right: 12px; top: 12px; padding: 8px; text-align: center; }
#map-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--accent); }
#minimap { display: block; border-radius: 8px; background: #000; image-rendering: pixelated; }
#map-coords { font-size: 11px; color: var(--muted); margin-top: 3px; }

#skillbar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 14px; align-items: flex-end; }
#skills { display: flex; gap: 6px; }
.potions { display: flex; gap: 6px; }
/* Q / E (ui.setupPotSlots): emptied — just the key, dashed; its potion all used up — faded */
.slot.potion.empty { border-style: dashed !important; opacity: 0.7; }
.slot.potion.none .icon { opacity: 0.35; filter: grayscale(1); }
/* which kind each takes, written on it: HP red / MP blue (bottom-left; the key top-left, the count bottom-right) */
.slot.potion .pk { position: absolute; left: 3px; bottom: 1px; font-size: 10px; font-weight: 800; line-height: 11px; letter-spacing: 0.3px; color: #fff; padding: 0 3px; border-radius: 4px; pointer-events: none; }
#pot-hp .pk { background: #e0475f; }
#pot-mp .pk { background: #3b82e0; }
.slot.potion.drag-over { outline: 2px solid #4aa3ff; outline-offset: 1px; }
.slot {
  position: relative; width: 54px; height: 54px; border-radius: 10px; background: var(--panel); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer;
}
.slot .icon { font-size: 26px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); }
.slot .key { position: absolute; left: 4px; top: 1px; font-size: 11px; color: var(--accent); font-weight: 600; text-shadow: 0 1px 2px #000; }
.slot .count { position: absolute; right: 4px; bottom: 1px; font-size: 12px; font-weight: 600; text-shadow: 0 1px 2px #000; }
.slot .cd { position: absolute; inset: 0; background: rgba(0,0,0,0.65); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; }
.slot .lock { position: absolute; inset: 0; background: rgba(0,0,0,0.75); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.slot .mpcost { position: absolute; right: 3px; top: 1px; font-size: 10px; color: #8fb6ff; text-shadow: 0 1px 2px #000; }
.slot.nomp { border-color: rgba(74, 140, 255, 0.7); }
.slot.flash { border-color: var(--accent); }

/* menu buttons: top of the screen, just left of the minimap (184px wide at right 14px); on narrower screens they
   wrap into two rows rather than run under the target frame in the middle (320px wide) */
#menu-buttons { position: absolute; right: 208px; top: 14px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px;
  max-width: calc(50% - 160px - 208px - 16px); }

#chat { position: absolute; left: 12px; bottom: 14px; width: 360px; padding: 8px; }
#chat-log { height: 150px; overflow-y: auto; font-size: 13px; line-height: 1.45; padding-right: 4px; margin-bottom: 6px; user-select: text; }
#chat-log::-webkit-scrollbar { width: 6px; }
#chat-log::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
#chat-log .sys { color: var(--accent); }
#chat-log .name { color: #8fb6ff; font-weight: 600; }
#chat-input { margin: 0; padding: 6px 10px; font-size: 13px; }
#chat-input:disabled { opacity: 0.6; cursor: not-allowed; }
/* คำสั่งแชท: the list that shows above the chat box while a "/" command is typed (cmdguide.js) */
#cmd-guide { position: absolute; left: 8px; right: 8px; bottom: 44px; z-index: 30; padding: 6px; border-radius: 10px;
  background: linear-gradient(#fffdf6, #fbf1d9); border: 1px solid #e2c27a; box-shadow: 0 6px 18px rgba(60,40,10,0.28);
  font-size: 12.5px; color: #3a2f1c; max-height: 240px; overflow-y: auto; }
#cmd-guide .cg-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700;
  color: #8a5a12; padding: 2px 4px 5px; border-bottom: 1px solid #ecd9ae; margin-bottom: 4px; }
#cmd-guide .cg-head small { font-weight: 400; color: #9a8665; font-size: 11px; }
#cmd-guide .cg-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; padding: 4px 6px; border-radius: 7px; cursor: pointer; }
#cmd-guide .cg-row b { color: #2f5fb8; font-family: Consolas, monospace; font-size: 13px; }
#cmd-guide .cg-row.adm b { color: #c2412d; }
#cmd-guide .cg-row i { font-style: normal; color: #7b6a4c; font-family: Consolas, monospace; font-size: 12px; }
#cmd-guide .cg-row span { flex-basis: 100%; color: #6a5a3e; font-size: 11.5px; }
#cmd-guide .cg-row:hover { background: rgba(226,194,122,0.25); }
#cmd-guide .cg-row.on { background: linear-gradient(#ffe7a8, #f7d27a); box-shadow: inset 0 0 0 1px #d9a943; }
/* channel tabs: โลก / การค้า / ระบบ (a dot: new messages in a tab not shown) */
#chat-tabs { display: flex; gap: 4px; margin-bottom: 5px; }
#chat-tabs button { flex: 1; position: relative; border: 1px solid #d9e0ee; background: #f1f4fa; color: #6b7590; border-radius: 9px; padding: 3px 0; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
#chat-tabs button.on { background: #2f6bd8; border-color: #2f6bd8; color: #fff; }
#chat-tabs button.soon { opacity: 0.55; } /* (guild: not open yet) */
#chat-tabs button.soon.on { background: #8a94ad; border-color: #8a94ad; opacity: 1; }
#chat-tabs button i { position: absolute; top: 3px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: #ff5a5a; display: none; }
#chat-tabs button.new i { display: block; }
#chat.drop-ok { outline: 2px dashed #f0a92b; outline-offset: 2px; }
/* an item shown in the trade channel, and the one about to be posted */
.chat-item { display: inline-block; padding: 0 5px; margin: 0 1px; border-radius: 6px; background: rgba(40,60,110,0.08); font-weight: 700; cursor: help; }
#chat-item { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font-size: 12px; color: #6b7590; }
#chat-item.hidden { display: none; }
#chat-item button { border: 0; background: none; color: #c0392b; cursor: pointer; font-size: 13px; }
#chat-log .ch-trade .name { color: #c87a10; }
#chat-log .gain { color: #7a5ad8; }

.window { position: absolute; padding: 12px; }
.win-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 10px; color: var(--accent); }
.win-head.movable { cursor: move; user-select: none; touch-action: none; }
/* drag grips of the chat box (a strip on top) and the skill bar (a handle on its left) */
.grip { cursor: move; user-select: none; touch-action: none; color: #9aa6c2; font-size: 12px; line-height: 1; }
.grip:hover { color: #2f6bd8; }
#chat .grip { text-align: center; letter-spacing: 2px; margin: -4px 0 4px; padding: 2px 0; }
#skillbar .grip { align-self: stretch; display: flex; align-items: center; padding: 0 2px; font-size: 18px; margin-right: -6px; width: 12px; }
/* (no dots drawn: the grip is an invisible strip — the move cursor shows where it is) */
.chat-top .grip { min-height: 16px; }
.win-head .close { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; }
#inventory { right: 12px; top: 250px; width: 372px; }
.equip-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.equip-info { font-size: 13px; color: var(--muted); }
.equip-info b { color: var(--text); }
#inv-grid { display: grid; grid-template-columns: repeat(6, 54px); gap: 5px; }
#inv-grid .slot.drag-over { border-color: var(--accent); }
.inv-foot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; }
#inv-gold { color: var(--accent); font-weight: 600; }
.hint { color: var(--muted); font-size: 12px; }
#shop { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 420px; }
#shop-list { max-height: calc(50vh / var(--uiz, 1)); overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.shop-item { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.05); padding: 6px 10px; border-radius: 10px; cursor: pointer; }
.shop-item:hover { background: rgba(255,255,255,0.12); }
.shop-item .icon { font-size: 22px; width: 30px; text-align: center; }
.shop-item .nm { flex: 1; font-size: 14px; }
.shop-item .pr { color: var(--accent); font-weight: 600; }
#equip { left: 384px; top: 112px; width: 400px; } /* (right of the chat, under the status panel: no overlap with either) */
.eq-layout { display: flex; gap: 10px; align-items: stretch; }
.eq-col { display: flex; flex-direction: column; gap: 4px; justify-content: space-around; }
.eq-slot { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; color: var(--muted); min-height: 66px; }
.eq-slot .slot { width: 52px; height: 52px; }
.eq-uid { font-size: 11.5px; color: #6b7590; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.eq-uid b { color: #2b3550; letter-spacing: 1px; user-select: all; }
.eq-uid button { border: 1px solid #d9e0ee; background: #fff; border-radius: 7px; padding: 1px 6px; font: inherit; font-size: 11px; cursor: pointer; color: #2f6bd8; }
.eq-uid button:hover { background: #eef3ff; }
.eq-slot .slot.drag-over { outline: 2px solid #2f6bd8; }
.eq-slot .slot.empty { opacity: 0.55; border-style: dashed; }
.eq-portrait { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 80%, rgba(255,207,90,0.16), rgba(0,0,0,0.3) 70%); border-radius: 12px; padding: 6px 0; }
#eq-canvas { image-rendering: auto; width: 180px; height: 250px; cursor: grab; touch-action: none; }
#eq-canvas.turning { cursor: grabbing; } /* (a WebGL canvas: its pixel size follows the screen's pixel ratio) */
.eq-name { font-weight: 600; color: var(--accent); }
#eq-stats { margin: 10px 0 6px; font-size: 13px; background: rgba(0,0,0,0.25); border-radius: 10px; padding: 8px 10px; }
#equip { max-height: calc((100vh / var(--uiz, 1)) - 170px); overflow-y: auto; } /* (scrolls instead of running under the skill bar) */
/* the character window drawn smaller (on request: halved, then +50% → 75%) — scaled from its top-left corner, so dragging
   it (ui.makeMovable) and clicks inside work as before; max-height divided by the scale so it takes the same room on screen */
#equip { transform: scale(0.75); transform-origin: 0 0; max-height: none; overflow: visible; }
/* (the window's content scrolls inside it, so the bonus side panel can stick out on the left) */
#equip .eq-scroll { max-height: calc(((100vh / var(--uiz, 1)) - 260px) / 0.75); overflow-y: auto; overflow-x: hidden; }
/* the bonus side panel on the left of the character window; folds into a narrow vertical tab */
.eq-bonus { position: absolute; right: calc(100% + 8px); top: 0; width: 250px; max-height: calc(((100vh / var(--uiz, 1)) - 390px) / 0.75); overflow-y: auto; padding: 10px 12px; font-size: 13px; } /* (ends above the chat) */
#hud .eq-bonus { color: #2b3550; --text: #2b3550; --muted: #6b7590; }
.eqb-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: #2f6bd8; margin-bottom: 4px; }
.eqb-fold { border: 0; background: rgba(47,107,216,0.1); color: #2f6bd8; border-radius: 8px; width: 26px; height: 24px; cursor: pointer; font-size: 12px; }
.eqb-fold:hover { background: rgba(47,107,216,0.2); }
.eq-bonus .cs-row:nth-child(even) { background: rgba(40,60,110,0.04); }
.eq-bonus.collapsed { width: auto; padding: 0; overflow: hidden; }
.eqb-tab { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border: 0; background: transparent; color: #2f6bd8; font: inherit; font-weight: 700; font-size: 12px; cursor: pointer; }
.eqb-tab span { writing-mode: vertical-rl; }
.eqb-tab:hover { background: rgba(47,107,216,0.08); }
/* character stats: bars, style line, attribute chips, key-number cards, grouped bonus rows */
.cs-bar { position: relative; height: 20px; border-radius: 10px; background: rgba(0,0,0,0.35); overflow: hidden; margin-bottom: 5px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; font-size: 12px; }
.cs-bar > div { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 10px; }
.cs-bar.hp > div { background: linear-gradient(90deg, #c8364a, #ff6a7c); }
.cs-bar.mp > div { background: linear-gradient(90deg, #2f63c8, #5ea8ff); }
.cs-bar span, .cs-bar b { position: relative; color: #fff; text-shadow: 0 1px 2px #000; }
.cs-style { margin: 6px 0 4px; font-size: 13px; color: var(--text); }
.cs-style span { float: right; font-size: 11.5px; color: var(--muted); padding-top: 2px; }
.cs-attrs { display: flex; gap: 6px; margin: 4px 0 8px; }
.cs-attrs span { flex: 1; text-align: center; padding: 4px 0; border-radius: 8px; border: 1px solid var(--c); color: var(--c); background: rgba(255,255,255,0.04); font-size: 13px; cursor: help; }
.cs-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.cs-card { display: flex; flex-direction: column; align-items: center; padding: 5px 2px; border-radius: 9px; background: rgba(255,255,255,0.05); }
.cs-card i { font-style: normal; font-size: 15px; }
.cs-card span { font-size: 10.5px; color: var(--muted); }
.cs-card b { font-size: 14px; color: var(--text); }
.cs-more { width: 100%; margin-top: 7px; padding: 4px; border-radius: 8px; border: 1px dashed rgba(160,180,230,0.4); background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; }
.cs-more:hover { color: var(--text); }
.cs-group { margin-top: 7px; padding-bottom: 2px; border-bottom: 1px solid rgba(160,180,230,0.25); color: var(--muted); font-size: 11.5px; font-weight: 600; }
.cs-row { display: flex; justify-content: space-between; padding: 2px 0; font-size: 12.5px; color: var(--text); }
.cs-row b { color: #3fcf7a; }
.cs-row.neg b { color: #ff6b6b; }
/* the character window is drawn at 75%: its text is set 1/0.75 bigger so it reads at ~12px+ on screen */
#equip .eq-slot { font-size: 15px; min-height: 72px; }
#equip .eq-uid, #equip .eq-uid button, #equip .hint, #equip .eq-actions .hint { font-size: 15px; }
#equip .eq-name { font-size: 19px; }
#equip #eq-stats { font-size: 17px; }
#equip .cs-bar { height: 26px; font-size: 16px; border-radius: 13px; }
#equip .cs-style { font-size: 17px; }
#equip .cs-style span { font-size: 15px; }
#equip .cs-attrs span { font-size: 16px; }
#equip .cs-card i { font-size: 19px; }
#equip .cs-card span { font-size: 15px; }
#equip .cs-card b { font-size: 18px; }
#equip .cs-more { font-size: 15px; }
#equip .eq-bonus { width: 300px; font-size: 17px; }
#equip .eq-bonus.collapsed { width: auto; } /* (folded: just the narrow tab — the 300px above outranked .collapsed, 2026-10-10) */
#equip .cs-group { font-size: 15px; }
#equip .cs-row { font-size: 16px; }
#equip .eqb-tab { font-size: 15px; }
#help { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 520px; max-width: calc((100vw / var(--uiz, 1)) - 32px); max-height: calc((100vh / var(--uiz, 1)) - 200px); overflow-y: auto; }
.help-tabs { display: flex; gap: 4px; margin: 2px 0 8px; flex-wrap: wrap; }
.help-tabs button { flex: 1; border: 1px solid #d9e0ee; background: #f5f7fc; border-radius: 9px; padding: 6px 4px; font: inherit; font-size: 13px; color: #4a5470; cursor: pointer; white-space: nowrap; }
.help-tabs button.on { background: #2f6bd8; border-color: #2f6bd8; color: #fff; font-weight: 600; }
.help-h { font-weight: 700; font-size: 14px; color: #2f6bd8; margin: 10px 0 2px; }
.help-h:first-child { margin-top: 0; }
.help-list { margin: 0; padding-left: 22px; line-height: 1.7; font-size: 14px; }
.help-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 10px; font-size: 13px; margin: 4px 0; }
.help-keys kbd { display: inline-block; min-width: 18px; padding: 0 5px; border: 1px solid #c9d2e6; border-bottom-width: 2px; border-radius: 5px; background: #fff; font: 600 12px/18px Kanit, sans-serif; text-align: center; color: #2b3550; }

#worldmap { position: absolute; inset: 0; background: rgba(0,0,0,0.75); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
#worldmap canvas { image-rendering: pixelated; border-radius: 12px; border: 2px solid var(--border); }

#interact-hint { position: absolute; left: 50%; bottom: 100px; transform: translateX(-50%); background: var(--panel); padding: 6px 14px; border-radius: 8px; border: 1px solid var(--accent); font-size: 14px; }

#toasts { position: absolute; left: 50%; top: 80px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: rgba(0,0,0,0.7); padding: 6px 16px; border-radius: 8px; font-size: 15px; animation: toast 2.4s forwards; }
.toast.big { font-size: 22px; color: var(--accent); font-weight: 700; padding: 10px 24px; border: 1px solid var(--accent); }
@keyframes toast { 0% { opacity: 0; transform: translateY(-8px); } 10%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }

#death { position: absolute; inset: 0; background: rgba(60, 0, 0, 0.45); display: flex; align-items: center; justify-content: center; }
.death-box { text-align: center; background: var(--panel-solid); padding: 30px 40px; border-radius: 16px; border: 1px solid var(--danger); }
.death-box h1 { margin: 0 0 8px; color: var(--danger); }
.death-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

#tooltip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 280px; background: #0b0e1a; border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px; font-size: 13px; line-height: 1.5; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
#tooltip .tt-title { font-weight: 600; font-size: 15px; }
/* an item's name with its level badge at the top right (ui.itemTip, 2026-10-10) */
#tooltip .tt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
#tooltip .tt-lv { flex: none; margin-top: 1px; padding: 1px 9px; border-radius: 999px; font: 800 13px/18px Kanit, sans-serif; letter-spacing: 0.3px; white-space: nowrap; text-shadow: none; }
#tooltip .tt-lv.ok { color: #3b2600; background: linear-gradient(180deg, #ffe58a, #f0a92b); box-shadow: 0 0 0 1.5px #fff6d6 inset, 0 1px 4px rgba(240,169,43,0.55); }
#tooltip .tt-lv.bad { color: #fff; background: linear-gradient(180deg, #ff7b7b, #d63a3a); box-shadow: 0 0 0 1.5px rgba(255,255,255,0.35) inset, 0 1px 6px rgba(214,58,58,0.6); animation: ttLvPulse 1.2s ease-in-out infinite; }
@keyframes ttLvPulse { 50% { box-shadow: 0 0 0 1.5px rgba(255,255,255,0.35) inset, 0 0 10px rgba(255,80,80,0.9); } }
#tooltip .tt-sub { color: var(--muted); font-size: 12px; }
#tooltip .tt-bad { color: var(--danger); }
/* a bag item next to what's worn (ui.compareTip) */
#tooltip.wide { max-width: 560px; }
/* a skill's full card as the skill bar's tooltip (ui.skillTip): the skill window's light card, a little narrower */
#tooltip.skillcard { max-width: 400px; width: 400px; padding: 4px; background: #e9eef8; }
#tooltip.skillcard .sk-card { margin: 0; }
#tooltip .tt-cmp { display: flex; gap: 12px; align-items: stretch; }
#tooltip .tt-col { flex: 1 1 0; min-width: 200px; max-width: 260px; }
#tooltip .tt-worn { border-left: 1px solid rgba(255,255,255,0.15); padding-left: 12px; opacity: 0.92; }
#tooltip .tt-tag { display: inline-block; font-size: 11px; font-weight: 600; color: #0b0e1a; background: #9fb3d9; border-radius: 6px; padding: 0 6px; margin-bottom: 2px; }
#tooltip .tt-cmp-diff { margin-top: 6px; padding-top: 4px; border-top: 1px dashed rgba(255,255,255,0.18); font-weight: 600; }
#tooltip .cmp-up { color: #5fe07a; }
#tooltip .cmp-down { color: #ff6b6b; }
#tooltip .cmp-same { color: var(--muted); }

#loading { flex-direction: column; gap: 14px; }
/* (2026-10-11) over the world's pictures: the logo, and the text + bar on a frosted card so they read on any picture */
.ld-stack { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ld-logo { width: min(400px, 80vw); height: auto; user-select: none; filter: drop-shadow(0 8px 14px rgba(10,25,70,0.45)); animation: logoFloat 4s ease-in-out infinite; }
.ld-card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 14px 22px 16px; border-radius: 16px;
  background: rgba(255,255,255,0.82); box-shadow: 0 10px 30px rgba(20,40,90,0.25); backdrop-filter: blur(4px); }
/* the loading bar (0–100%, main.js setLoadPct) */
.ld-wrap { display: flex; align-items: center; gap: 12px; width: min(360px, 80vw); }
.ld-bar { flex: 1; height: 14px; border-radius: 999px; background: rgba(47,107,216,0.15); overflow: hidden; box-shadow: inset 0 1px 3px rgba(20,40,90,0.18); }
#loading-fill { width: 0; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #5b9bff, #2f6bd8); transition: width 0.25s ease-out; }
#loading-pct { min-width: 44px; text-align: right; font: 700 15px Kanit, sans-serif; color: #2f6bd8; }
.spinner { width: 42px; height: 42px; border: 4px solid rgba(255,255,255,0.15); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 920px) {
  .create-grid { grid-template-columns: 1fr; }
  #weapon-choices { grid-template-columns: repeat(3, 1fr); }
  #chat { width: 260px; }
  #chat-log { height: 90px; }
}

/* ======================================================================
   3D-era HUD: bright rounded panels in the style of the reference video
   ====================================================================== */
canvas#game { image-rendering: auto; }
canvas#overlay { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 5; }
#hud { --ink: #2b3550; --ink-soft: #6b7590; --card: rgba(255,255,255,0.93); --line: rgba(60,80,130,0.16); }
#hud .panel { background: var(--card); border: 1px solid var(--line); color: var(--ink); box-shadow: 0 6px 18px rgba(20,30,60,0.18); backdrop-filter: none; border-radius: 16px; }
#hud .hint, #hud .status-sub { color: var(--ink-soft); }
#hud .win-head { color: #2f6bd8; }
#hud .win-head .close { color: var(--ink-soft); }

#status { display: grid; grid-template-columns: 64px 1fr; column-gap: 10px; padding: 10px 12px 8px; width: 300px; }
/* คำแนะนำ: under the status panel (new players) */
#guide { position: absolute; left: 12px; top: 112px; width: 300px; box-sizing: border-box; padding: 8px 12px 10px; font-size: 13px; line-height: 1.55; color: #2b3550; }
.guide-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: #2f6bd8; margin-bottom: 3px; }
.guide-head button { border: 0; background: transparent; color: #8a93ab; cursor: pointer; font-size: 13px; padding: 0 2px; }
.guide-head button:hover { color: #d63a3a; }
#guide small { color: #6b7590; }
#guide .tr-btn { padding: 2px 10px; font-size: 12px; margin-left: 4px; }
.guide-tip { margin-top: 5px; font-size: 12.5px; color: #4a5470; }
#status #avatar { grid-row: span 6; width: 64px; height: 64px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(30,60,120,0.35); background: #cfe6ff; }
#status .status-head { color: var(--ink); }
#st-lv { color: #fff !important; background: #4f8ef7; border-radius: 10px; padding: 0 8px; font-size: 13px; }
#hud .bar { background: #e3e8f2; height: 17px; border-radius: 9px; }
#hud .bar span { color: #fff; font-size: 12.5px; line-height: 17px; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,0.55); }
#hud .bar.hp .fill { background: linear-gradient(180deg, #ff7a8a, #e8455b); }
#hud .bar.mp .fill { background: linear-gradient(180deg, #7ab4ff, #3f7fe8); }
/* the EXP bar shows "EXP now / needed (%)" */
#hud .bar.xp { height: 16px; }
#hud .bar.xp span { font-size: 11.5px; line-height: 16px; font-weight: 700; color: #4a3600; text-shadow: 0 0 3px #fff, 0 0 2px #fff; }
#st-gold { color: #c88a12 !important; font-weight: 600; }
/* the status line shows only the gold (ATK / DEF / SPD are in the character window) */
#hud .status-sub { display: flex; align-items: baseline; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 0; }
#st-gold { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* buffs / debuffs (2026-10-10): no frames — the picture and the time left only, the time green for a buff, red for
   a debuff, outlined so it reads over the ground; their tip shows at once on hover (ui.bufTip, still green / red) */
#buffs .buff { background: none; border: 0; padding: 0 2px; cursor: help; font-weight: 700; font-size: 15px; color: #3cd46a;
  display: inline-flex; align-items: center; gap: 2px;
  text-shadow: -1px -1px 0 #12321c, 1px -1px 0 #12321c, -1px 1px 0 #12321c, 1px 1px 0 #12321c, 0 1px 3px rgba(0,0,0,0.6); }
#buffs .buff.debuff { color: #ff6a5c;
  text-shadow: -1px -1px 0 #3a0d08, 1px -1px 0 #3a0d08, -1px 1px 0 #3a0d08, 1px 1px 0 #3a0d08, 0 1px 3px rgba(0,0,0,0.6); }
#buffs .buff .emo, #buffs .buff .skico { width: 28px; height: 28px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }

#minimap-wrap { position: absolute; right: 14px; top: 12px; width: 184px; text-align: center; background: none; border: 0; }
#minimap { border-radius: 50%; border: 5px solid #fff; box-shadow: 0 6px 18px rgba(20,30,60,0.3); background: #1a2a1a; }
#map-name { margin-top: 4px; display: inline-block; background: rgba(255,255,255,0.93); color: #2b3550; padding: 2px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; box-shadow: 0 2px 8px rgba(20,30,60,0.2); }
#map-coords { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.7); font-size: 11px; margin-top: 2px; }
/* the FPS meter under the map's coordinates: green 50+, yellow 30+, red below */
#fps-meter { display: inline-block; margin-top: 3px; padding: 1px 7px; border-radius: 6px; background: rgba(10,14,30,0.55); color: #8dff9e; font: 700 10.5px/1.5 Consolas, 'Kanit', monospace; text-shadow: none; white-space: nowrap; }
#fps-meter.mid { color: #ffe36b; } #fps-meter.low { color: #ff7a7a; }
#fps-meter.off { display: none; }


#target { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); width: 320px; background: rgba(255,255,255,0.93); border-radius: 14px; padding: 6px 12px 8px; box-shadow: 0 6px 18px rgba(20,30,60,0.2); text-align: center; color: #2b3550; font-weight: 600; font-size: 14px; }
#target .bar.tgt { margin-top: 4px; }
#target .bar.tgt .fill { background: linear-gradient(180deg, #ff6b6b, #d63a3a); }

#map-banner { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); text-align: center; pointer-events: none; }
#map-banner .mb-name { font-size: 42px; font-weight: 700; color: #fff; letter-spacing: 2px; text-shadow: 0 2px 0 rgba(0,0,0,0.25), 0 0 24px rgba(80,140,255,0.6), 0 4px 14px rgba(0,0,0,0.5); }
#map-banner .mb-sub { font-size: 16px; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.7); }
#map-banner.show { animation: banner 3.6s ease forwards; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, 12px); } 15%, 75% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

#skillbar { background: rgba(255,255,255,0.93); padding: 8px 10px; border-radius: 18px; box-shadow: 0 6px 18px rgba(20,30,60,0.22); bottom: 12px; }
#hud .slot { background: #f1f4fa; border: 2px solid #d9e0ee; border-radius: 12px; }
#hud .slot .key { color: #2f6bd8; text-shadow: none; }
#hud .slot .count { color: #2b3550; text-shadow: 0 0 3px #fff; }
#hud .slot .cd { background: rgba(30,40,70,0.6); color: #fff; }
#hud .slot .lock { background: rgba(230,234,244,0.9); color: #8a93ad; }
#hud .slot.nomp { border-color: #7ab4ff; }
#btn-auto { width: 58px; height: 54px; border-radius: 14px; border: 2px solid #d9e0ee; background: #f1f4fa; color: #5a6480; font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
#btn-auto.on { background: linear-gradient(180deg, #ffd56e, #f0a92b); color: #4a3200; border-color: #f0a92b; box-shadow: 0 0 14px rgba(255,190,60,0.8); animation: autoPulse 1.4s infinite; }
@keyframes autoPulse { 50% { box-shadow: 0 0 4px rgba(255,190,60,0.4); } }

#menu-buttons .btn.small { background: rgba(255,255,255,0.93); color: #2b3550; border: 1px solid var(--line); box-shadow: 0 4px 12px rgba(20,30,60,0.2); font-weight: 600; }
#menu-buttons .btn.small:hover { background: #fff; }

/* chat / whisper windows: their background strength follows --wa (the ◐ slider); text stays solid */
#chat, .whisper { --wa: 0.88; background: rgba(255,255,255,var(--wa)) !important; }
#chat.faded, .whisper.faded { box-shadow: none !important; border-color: rgba(217,224,238,var(--wa)) !important; }
#chat.faded #chat-log, .whisper.faded .wsp-log { text-shadow: 0 0 3px #fff, 0 0 2px #fff; }
#hud #chat-input, #hud .wsp-input { background: rgba(241,244,250,calc(var(--wa) + 0.08)) !important; }
.wsp-log { background: rgba(241,244,250,var(--wa)) !important; }
.chat-top { display: flex; align-items: center; margin: -4px 0 4px; }
.chat-top .grip { flex: 1; margin: 0 !important; }
/* the chat folded (▴): only its top bar stays — drag grip, ◐ and the unfold button */
#chat.folded #chat-tabs, #chat.folded #chat-log, #chat.folded #chat-item, #chat.folded #chat-input { display: none; }
#chat.folded { width: 120px; padding-bottom: 4px; }
#chat-fold.new { color: #fff; background: #ff5a5a; }
.alpha { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: #6b7590; cursor: default; }
.alpha input { width: 64px; height: 14px; margin: 0; padding: 0; accent-color: #2f6bd8; cursor: pointer; display: none; }
.alpha.open input { display: block; }
.alpha-btn { border: 0; background: none; color: #6b7590; font-size: 13px; line-height: 1; padding: 1px 3px; border-radius: 6px; cursor: pointer; }
.alpha-btn:hover, .alpha.open .alpha-btn { color: #2f6bd8; background: rgba(47,107,216,0.1); }
.whisper .win-head .alpha { margin-left: auto; margin-right: 8px; font-weight: 400; }
#chat-log { color: #2b3550; }
#chat-log .sys { color: #c87a10; }
#chat-log .name { color: #2f6bd8; }
#hud #chat-input, #hud .wsp-input { background: #f1f4fa; color: #2b3550; border: 1px solid #d9e0ee; }
/* สกิล window (K) */
#skills-win { left: 50%; top: 90px; width: 400px; margin-left: -200px; max-height: calc((100vh / var(--uiz, 1)) - 190px); overflow-y: auto; }
#skills-win[style*="left"] { margin-left: 0; }
.sk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0; }
/* the chosen skill's details: one fixed height for every skill (the tallest of the 35 is 466 px) — the window no
   longer grows and shrinks as another skill is picked (2026-10-10); longer text later scrolls inside */
#sk-detail { min-height: var(--skd-h, 470px); } /* (no scrollbar of its own — the window's is the only one; min-height: the tallest card, measured by ui.renderSkills, so the window keeps one size) */
/* mastery (shared/mastery.js — 2026-10-10): the weapon's level and points; a skill's rank pips and its ⬆ button */
.sk-ms { margin-top: 4px; font-size: 12px; color: #6a3fb8; } .sk-ms b.on { color: #fff; background: #8a4dff; border-radius: 6px; padding: 0 6px; } .sk-ms small { color: #8a93a8; }
.sk-rank { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 6px 0; padding: 6px 8px; border-radius: 9px; background: #f3ecff; font-size: 12.5px; color: #4a2f86; }
.sk-rank.base { background: #e9f8ee; color: #1d6b31; }
.sk-pips { display: inline-flex; gap: 2px; } .sk-pips i { width: 9px; height: 9px; border-radius: 2px; background: #d8cdee; } .sk-pips i.on { background: linear-gradient(180deg, #c9a2ff, #8a4dff); }
.sk-rank .sk-up { margin-left: auto; padding: 4px 10px; font-size: 12px; }
.sk-rank-note { font-size: 11.5px; color: #b3261e; margin: -2px 0 6px; }
.sk-tile.locked .sk-on { color: #b3261e; }
.sk-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 6px; border-radius: 12px; background: #f1f4fa; border: 2px solid transparent; cursor: grab; color: #2b3550; user-select: none; }
.sk-tile:hover { background: #e6edfb; }
.sk-tile.sel { border-color: #2f6bd8; background: #eaf1ff; }
.sk-tile.locked { opacity: 0.55; }
.sk-tile .sk-num { position: absolute; left: 6px; top: 4px; font-size: 11px; font-weight: 700; color: #6b7590; }
.sk-tile .sk-icon { font-size: 30px; line-height: 1.1; }
.sk-tile .sk-name { font-size: 12.5px; font-weight: 700; text-align: center; }
.sk-tile .sk-on { font-size: 10.5px; color: #2f6bd8; }
.sk-tile.locked .sk-on { color: #c0392b; }
#skills .slot.empty-skill { border-style: dashed; opacity: 0.55; }
.sk-tile .sk-on:empty { display: none; }
.sk-hint { font-size: 11px; color: #6b7590; display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
/* 🔄 รีสกิล: the icon on top, its word under it on one line (2026-10-10) */
#hud #sk-reset { flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 64px; padding: 6px 12px; border-radius: 16px; line-height: 1.1; white-space: nowrap; }
#sk-reset .rs-ico { font-size: 18px; line-height: 1; }
#sk-reset .rs-txt { font-size: 12px; font-weight: 700; }
.sk-role { font-size: 12px; color: #6b7590; margin-bottom: 6px; }
.sk-note { color: #c87a10; }
.sk-card { background: #f1f4fa; border-radius: 11px; padding: 8px 10px; margin-bottom: 6px; color: #2b3550; }
.sk-card.locked { opacity: 0.6; }
.sk-head { display: flex; align-items: center; gap: 7px; }
.sk-key { width: 20px; height: 20px; border-radius: 6px; background: #2f6bd8; color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.sk-icon { font-size: 18px; }
.sk-name { flex: 1; font-weight: 700; font-size: 14px; }
.sk-lv { font-size: 11px; color: #6b7590; }
.sk-lock { font-size: 11px; color: #c0392b; font-weight: 700; }
.sk-meta { font-size: 11.5px; color: #6b7590; margin: 3px 0; }
.sk-desc { font-size: 12.5px; margin-bottom: 3px; }
.sk-fx { margin: 0; padding-left: 16px; font-size: 12px; color: #3a4565; }
.sk-fx li { margin: 1px 0; }
/* PoE-style details (ui.renderSkills / skillinfo.js): type chips, the numbers, the skill tree acting on it */
.sk-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.sk-chip { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: #e3e9f6; color: #2f4370; white-space: nowrap; }
.sk-sec { font-size: 11.5px; font-weight: 700; color: #2f4370; margin: 7px 0 2px; }
table.sk-num { width: 100%; border-collapse: collapse; font-size: 11.5px; }
table.sk-num td { padding: 1px 4px; border-bottom: 1px dashed #d9e0ee; color: #3a4565; }
table.sk-num td:first-child { color: #6b7590; white-space: nowrap; }
table.sk-num td.sk-inc { color: #2f9a55; text-align: right; white-space: nowrap; }
table.sk-num tr.sk-tot td { color: #2b3550; border-bottom: 0; }
.sk-tree { display: flex; flex-wrap: wrap; gap: 3px; }
.sk-tree span { font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: #e8f6ec; color: #237a43; border: 1px solid #bfe5cb; }
.sk-tree span.off { background: #f3f4f7; color: #9aa2b6; border-color: #e1e4ec; }

/* ตั้งค่า window */
/* settings: opens in the middle of the screen every time (ui.toggle clears a dragged spot), popping in */
#settings { left: 50%; top: 50%; width: 340px; transform: translate(-50%, -50%); }
#settings[style*="left"] { margin-left: 0; }
#settings.pop { animation: st-pop 0.18s ease-out; }
@keyframes st-pop { from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.st-group { font-size: 12px; font-weight: 700; color: #2f6bd8; margin: 10px 0 4px; }
.st-group:first-of-type { margin-top: 0; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 9px; background: #f1f4fa; margin-bottom: 4px; font-size: 13px; color: #2b3550; cursor: default; }
label.st-row { cursor: pointer; }
.st-row input[type=range] { width: 130px; margin: 0; accent-color: #2f6bd8; cursor: pointer; }
.st-row input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: #2f6bd8; cursor: pointer; }
.st-note { font-size: 11px; color: #6b7590; margin: 0 2px 2px; }
#settings { max-height: calc((100vh / var(--uiz, 1)) - 210px); overflow-y: auto; }
/* the settings' topics as tabs along the top (ui.setupSettings): one page shown at a time; the page's own heading is
   the tab's, so it isn't repeated */
.st-tabs { display: flex; gap: 3px; margin: 0 0 8px; padding: 3px; background: #e8edf7; border-radius: 11px; position: sticky; top: -2px; z-index: 1; }
.st-tabs button { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 2px 4px; border: 0; border-radius: 8px; background: transparent;
  font: 600 11px/1.15 Kanit, sans-serif; color: #5a6684; cursor: pointer; white-space: nowrap; }
.st-tabs button i { font-style: normal; font-size: 16px; line-height: 1.1; }
.st-tabs button:hover { background: #f6f8fd; color: #2f6bd8; }
.st-tabs button.on { background: #fff; color: #2f6bd8; box-shadow: 0 1px 4px rgba(40,60,120,0.18); }
.st-page > .st-group:first-child { display: none; }
.st-seg { display: flex; border: 1px solid #d9e0ee; border-radius: 9px; overflow: hidden; }
.st-seg button { border: 0; background: #fff; color: #6b7590; font: inherit; font-size: 12px; padding: 3px 12px; cursor: pointer; white-space: nowrap; }
.lang-seg button { padding: 3px 9px; }
.st-seg button + button { border-left: 1px solid #d9e0ee; }
.st-seg button.on { background: #2f6bd8; color: #fff; font-weight: 700; }
/* กันบอท (signing up): the server's drawn sum, 🔄 for another, the answer below */
/* (one row the height of the other boxes: the picture, 🔄, the answer — 2026-10-10) */
.cap-box { display: flex; align-items: stretch; gap: 6px; margin-top: 4px; height: 52px; }
.cap-img { flex: 1 1 auto; min-width: 0; border-radius: 8px; border: 1px solid var(--border); overflow: hidden; background: #f7f3e6;
  display: flex; align-items: center; justify-content: center; }
.cap-img svg { width: 100%; height: 100%; display: block; }
.cap-wait { font-size: 12px; color: var(--muted); }
/* 🔄: the picture right in the middle of a box like the other boxes (no text line / baseline to push it about) */
.screen .cap-new { flex: none; width: 46px; height: 100%; box-sizing: border-box; margin: 0; padding: 0;
  display: flex; align-items: center; justify-content: center; font-size: 0; line-height: 0;
  border-radius: 8px; border: 1px solid var(--border); background: #f5f7fc; cursor: pointer; transition: background .15s; }
.screen .cap-new img.emo { width: 24px; height: 24px; margin: 0; vertical-align: 0; display: block; transition: transform .3s; }
.screen .cap-new:hover { background: #e8eefb; }
.screen .cap-new:hover img.emo { transform: rotate(90deg); }
.screen label #login-cap { flex: none; width: 84px; margin: 0; padding: 0 8px; box-sizing: border-box; text-align: center; font-size: 17px; font-weight: 600; }
/* ไทย / ENG: the login screen's top-right corner (not in the card — 2026-10-10) */
.login-card { position: relative; }
.login-lang { position: fixed; top: 16px; right: 16px; z-index: 2; box-shadow: 0 4px 14px rgba(20,40,90,0.25); }
/* the logo above the card (client/img/logo.png — tools/art/logo-gen.mjs): comes in with a bounce, then floats gently */
.login-stack { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; margin: auto; }
.login-logo { margin: 0 0 6px; line-height: 0; }
.login-logo img { width: min(460px, 88vw); height: auto; user-select: none;
  filter: drop-shadow(0 8px 14px rgba(10,25,70,0.45)) drop-shadow(0 0 22px rgba(255,220,120,0.35));
  animation: logoIn .9s cubic-bezier(.2,1.4,.4,1) both, logoFloat 4s ease-in-out .9s infinite; }
@keyframes logoIn { from { opacity: 0; transform: translateY(-30px) scale(0.7); } to { opacity: 1; transform: none; } }
@keyframes logoFloat { 50% { transform: translateY(-6px); } }

/* โซเชียล window: friends */
#social { left: 50%; top: 120px; width: 330px; margin-left: -165px; max-height: calc((100vh / var(--uiz, 1)) - 220px); overflow-y: auto; }
#social[style*="left"] { margin-left: 0; } /* (moved by dragging: its own spot) */
.so-add { display: flex; gap: 6px; margin-bottom: 8px; }
.so-add input { flex: 1; margin: 0; padding: 6px 10px; font-size: 13px; background: #f1f4fa; color: #2b3550; border: 1px solid #d9e0ee; border-radius: 9px; min-width: 0; }
.so-title { font-size: 12px; font-weight: 700; color: #6b7590; margin: 8px 0 4px; }
.so-row { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 9px; background: #f1f4fa; margin-bottom: 4px; font-size: 13px; color: #2b3550; }
.so-row.req { background: #fff6e0; }
.so-dot { width: 9px; height: 9px; border-radius: 50%; background: #b8c0d4; flex: none; }
.so-row.on .so-dot { background: #3fcf7a; box-shadow: 0 0 6px #3fcf7a; }
.so-row:not(.on):not(.req):not(.wait) { opacity: 0.7; }
.so-name { font-weight: 700; }
.so-sub { flex: 1; color: #6b7590; font-size: 11.5px; }
.so-row.req .so-name { flex: 1; }
.so-btn { border: 1px solid #d9e0ee; background: #fff; border-radius: 8px; padding: 2px 8px; font: inherit; font-size: 12px; cursor: pointer; color: #2b3550; }
.so-btn.ok { background: #3fcf7a; border-color: #3fcf7a; color: #fff; font-weight: 700; }
.so-btn.no:hover { background: #ffe5e5; }
#btn-social { position: relative; }
#btn-social .badge { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; border-radius: 8px; background: #ff4f6d; color: #fff; font-size: 10px; font-style: normal; font-weight: 700; line-height: 16px; text-align: center; padding: 0 3px; }
#btn-social .badge.hidden { display: none; }

/* whisper windows (private conversations) */
.whisper { width: 320px; }
.wsp-log { height: 170px; overflow-y: auto; font-size: 13px; line-height: 1.45; background: #f1f4fa; border-radius: 10px; padding: 6px 8px; margin-bottom: 6px; user-select: text; color: #2b3550; }
.wsp-log .me .name { color: #2f6bd8; font-weight: 600; }
.wsp-log .them .name { color: #c0398b; font-weight: 600; }
.wsp-log .err { color: #c0392b; }
.wsp-input { margin: 0; padding: 6px 10px; font-size: 13px; width: 100%; box-sizing: border-box; }
#chat-log .name[data-name] { cursor: pointer; }
/* an admin's name in chat / whispers: gold with a soft pulsing glow (and a crown in front) */
#chat-log .name.adm, .whisper .name.adm { color: #c98400; font-weight: 700; text-shadow: 0 0 2px rgba(255,214,90,0.95), 0 0 7px rgba(255,190,30,0.8); animation: admGlow 1.8s ease-in-out infinite alternate; }
@keyframes admGlow { from { text-shadow: 0 0 2px rgba(255,214,90,0.9), 0 0 4px rgba(255,190,30,0.5); } to { text-shadow: 0 0 3px rgba(255,224,110,1), 0 0 11px rgba(255,190,30,0.95); } }

#hud .window { color: #2b3550; }
#inv-grid .slot { background: #f1f4fa; }
.shop-item { background: #f1f4fa; color: #2b3550; }
.shop-item:hover { background: #e3ebfb; }
.equip-info b { color: #2b3550; }
#eq-stats { background: #f1f4fa; --text: #2b3550; --muted: #6b7590; }
#eq-stats .cs-card { background: #fff; box-shadow: 0 1px 3px rgba(40,60,110,0.12); }
#eq-stats .cs-bar { background: rgba(40,60,110,0.18); }
#eq-stats .cs-attrs span { background: #fff; filter: saturate(1.2) brightness(0.85); }
#eq-stats .cs-row:nth-child(even) { background: rgba(40,60,110,0.04); }
.eq-portrait { background: radial-gradient(ellipse at 50% 80%, rgba(120,170,255,0.25), rgba(220,230,250,0.6) 70%); }
#interact-hint { background: rgba(255,255,255,0.93); color: #2b3550; border: 1px solid #f0a92b; box-shadow: 0 4px 12px rgba(20,30,60,0.2); }
.toast { background: rgba(255,255,255,0.95); color: #2b3550; box-shadow: 0 4px 14px rgba(20,30,60,0.25); }
.toast.big { background: linear-gradient(180deg, #fff8e1, #ffffff); color: #c87a10; border-color: #f0c45a; }

/* ---- bot (AUTO) ---- */
/* the bot's own box under the minimap: a wide AUTO toggle and its settings button */
#bot-box { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
#bot-box #btn-auto { width: 118px; height: 36px; font-size: 14px; box-shadow: 0 4px 12px rgba(20,30,60,0.2); }
#btn-bot-cfg { width: 36px; height: 36px; padding: 0; border: 2px solid #d9e0ee; border-radius: 12px; background: #f1f4fa; color: #5a6480; cursor: pointer; font-size: 18px; line-height: 1; box-shadow: 0 4px 12px rgba(20,30,60,0.2); }
#btn-bot-cfg:hover { background: #e3ebfb; }
#bot-status { position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%); background: rgba(255,255,255,0.93); color: #2b3550; padding: 4px 14px; border-radius: 14px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 12px rgba(20,30,60,0.2); border: 1px solid #f0c45a; white-space: nowrap; }
/* (centred by a margin, not a translate: a dragged window's spot is set as left / top — ui.makeMovable — and the
   margin is cleared then, even while it's hidden) */
#botcfg { left: 50%; top: 60px; margin-left: -210px; width: 420px; max-width: calc((100vw / var(--uiz, 1)) - 32px); max-height: calc((100vh / var(--uiz, 1)) - 160px); overflow-y: auto; font-size: 13px; }
.bc-section { font-weight: 700; color: #2f6bd8; margin: 10px 0 4px; }
#bc-skills { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.bc-skill { display: flex; align-items: center; gap: 6px; color: #2b3550; margin: 0; cursor: pointer; }
.bc-skill.locked { opacity: 0.55; }
.bc-icon { font-size: 18px; }
.bc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #2b3550; margin: 4px 0; flex-wrap: wrap; }
.bc-row b { color: #c87a10; min-width: 54px; text-align: right; }
.bc-row input[type=range] { width: 100%; }
.bc-row select { font-family: inherit; padding: 3px 6px; border-radius: 8px; border: 1px solid #d9e0ee; }
.bc-check { display: flex; align-items: center; gap: 6px; color: #2b3550; margin: 3px 0; cursor: pointer; }
#botcfg label input[type=checkbox] { display: inline-block; width: auto; margin: 0; padding: 0; flex: none; accent-color: #f0a92b; }
#botcfg label input[type=range] { display: block; margin: 2px 0 0; padding: 0; border: 0; background: none; accent-color: #4f8ef7; }
#botcfg label { margin-bottom: 2px; font-size: 13px; }
#botcfg .bc-skill span:last-child { white-space: nowrap; }
#bc-kinds { display: grid; grid-template-columns: 1fr 1fr; column-gap: 10px; margin: 0 0 4px 22px; }
#bc-kinds .bc-check { margin: 1px 0; font-size: 12px; }
#bc-radius-row.off, #bc-focus-row.off, #bc-focus-hint.off, #bc-kinds.off { opacity: 0.4; pointer-events: none; } /* (only for "จุดเริ่มต้น" / when it loots) */
#botcfg { transition: background-color 0.15s, box-shadow 0.15s, border-color 0.15s; }
#botcfg > * { transition: opacity 0.15s; }
#botcfg.peek { background: transparent !important; box-shadow: none !important; border-color: transparent !important; }
#botcfg.peek > :not(#bc-radius-row) { opacity: 0; }
#botcfg.peek #bc-radius-row { background: rgba(255,255,255,0.93); border-radius: 10px; padding: 4px 8px; box-shadow: 0 4px 12px rgba(20,30,60,0.25); }

/* ---- world map (M) ---- */
#worldmap { position: absolute; inset: 0; background: rgba(15,25,45,0.55); display: flex; align-items: center; justify-content: center; z-index: 30; }
.wm-panel { background: #ffffff; border-radius: 20px; box-shadow: 0 20px 60px rgba(10,20,50,0.45); padding: 14px 16px 12px; width: min(94vw, 1180px); display: flex; flex-direction: column; gap: 8px; }
.wm-head { display: flex; justify-content: space-between; align-items: flex-start; }
.wm-title { font-size: 22px; font-weight: 700; color: #2b3550; }
.wm-sub { font-size: 12px; color: #6b7590; }
.wm-close { border: 0; background: #f1f4fa; color: #5a6480; width: 34px; height: 34px; border-radius: 50%; font-size: 16px; cursor: pointer; }
.wm-close:hover { background: #e3ebfb; }
#wm-canvas { width: 100%; height: min(72vh, 820px); border-radius: 14px; display: block; image-rendering: auto; border: 1px solid #e3e8f2; }
.wm-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: #2b3550; }
#wm-legend { display: flex; gap: 12px; flex-wrap: wrap; }
.wm-leg { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.wm-leg i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0,0,0,0.12); }
.wm-leg small { color: #6b7590; font-weight: 400; }
#wm-route b { color: #c87a10; }
#wm-route small { color: #6b7590; }

/* ---- NPC trade window ---- */
#shop { width: 520px; max-width: calc((100vw / var(--uiz, 1)) - 32px); }
.tr-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tr-tabs { display: flex; gap: 6px; }
.tr-tabs button { border: 2px solid #d9e0ee; background: #f1f4fa; color: #5a6480; border-radius: 12px; padding: 6px 18px; font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.tr-tabs button.on { background: linear-gradient(180deg, #ffd56e, #f0a92b); border-color: #f0a92b; color: #4a3200; }
#tr-gold { font-weight: 700; color: #c87a10; }
#tr-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
#tr-cats button { border: 1px solid #d9e0ee; background: #fff; color: #5a6480; border-radius: 10px; padding: 3px 12px; font-family: inherit; font-size: 12px; cursor: pointer; }
#tr-cats button.on { background: #2f6bd8; border-color: #2f6bd8; color: #fff; }
#tr-list { height: 270px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; padding-right: 4px; }
#tr-list.grid { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 70px; gap: 6px; flex-direction: unset; }
#tr-list .shop-item { border: 2px solid transparent; }
#tr-list .shop-item.sel, #tr-list .tr-cell.sel { border-color: #f0a92b; background: #fff6df; }
.shop-item .sub { display: block; font-size: 11px; color: #8a93ad; }
.shop-item .pr.poor { color: #d63a3a; }
.tr-cell { position: relative; background: #f1f4fa; border: 2px solid #d9e0ee; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tr-cell:hover { background: #e3ebfb; }
.tr-cell .icon { font-size: 24px; }
.tr-cell .count { position: absolute; right: 5px; top: 2px; font-size: 11px; font-weight: 700; color: #2b3550; }
.tr-cell .pr { font-size: 11px; font-weight: 600; color: #c87a10; }
.tr-empty { grid-column: 1 / -1; text-align: center; color: #8a93ad; padding: 40px 0; }
#tr-detail { margin-top: 8px; min-height: 62px; background: #f1f4fa; border-radius: 12px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; color: #2b3550; }
#tr-detail .icon { font-size: 30px; }
#tr-detail .info { flex: 1; min-width: 0; }
#tr-detail .info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tr-detail .info small { color: #6b7590; }
#tr-detail .total { font-weight: 700; color: #c87a10; white-space: nowrap; }
#tr-detail .total.poor { color: #d63a3a; }
.tr-qty { display: flex; align-items: center; gap: 2px; }
.tr-qty button { width: 26px; height: 26px; border: 1px solid #d9e0ee; background: #fff; border-radius: 8px; cursor: pointer; font-weight: 700; color: #2b3550; font-family: inherit; }
.tr-qty button.max { width: auto; padding: 0 6px; font-size: 11px; }
.tr-qty input { width: 44px; height: 26px; text-align: center; border: 1px solid #d9e0ee; border-radius: 8px; font-family: inherit; font-size: 13px; padding: 0; }
.tr-btn { border: none; border-radius: 12px; padding: 8px 18px; font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; background: linear-gradient(180deg, #5b9bff, #2f6bd8); color: #fff; }
.tr-btn.sell { background: linear-gradient(180deg, #ffd56e, #f0a92b); color: #4a3200; }
.tr-btn:disabled { background: #c9d0de; color: #fff; cursor: default; }
.tr-btn.ghost { background: #fff; border: 1px solid #f0a92b; color: #c87a10; padding: 5px 12px; font-size: 12px; }
.tr-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.tr-foot .hint { font-size: 11px; }

/* ---- discard ---- */
.inv-foot { align-items: center; gap: 8px; }
#inv-trash { width: 42px; height: 42px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 20px; background: #fff0f0 !important; border: 2px dashed #e28a8a !important; border-radius: 10px; }
#inv-trash.drag-over { background: #ffd6d6 !important; border-color: #d63a3a !important; transform: scale(1.08); }
#discard { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 360px; max-width: calc((100vw / var(--uiz, 1)) - 32px); z-index: 30; }
#dc-item { display: flex; align-items: center; gap: 10px; background: #f1f4fa; border-radius: 12px; padding: 8px 12px; font-weight: 700; }
#dc-item .icon { font-size: 30px; }
#dc-item small { display: block; font-weight: 400; color: #6b7590; }
.dc-warn { color: #d63a3a; font-size: 12px; margin: 8px 0; }
.dc-row { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.dc-row .tr-qty { margin-right: auto; }
.tr-btn.danger { background: linear-gradient(180deg, #ff7b7b, #d63a3a); }

/* ---- 90-slot inventory (same window size, smaller cells) + item lock ---- */
#inv-grid { grid-template-columns: repeat(10, 1fr); grid-auto-rows: 29px; gap: 3px; height: 290px; overflow: hidden; }
#inv-grid .slot { width: auto; height: auto; border-width: 1px; border-radius: 7px; }
#inv-grid .slot .icon { font-size: 17px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
#inv-grid .slot .count { font-size: 9px; right: 2px; bottom: 0; line-height: 10px; }
#inv-grid .slot .lk { position: absolute; left: 1px; top: 0; font-size: 8px; line-height: 10px; }
#inv-grid .slot.locked { background: #fff6df; box-shadow: inset 0 0 0 1px #f0a92b; }
#inv-grid.lockmode .slot { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Ctext y='17' font-size='16'%3E%F0%9F%94%92%3C/text%3E%3C/svg%3E") 4 4, pointer; }
#inv-sort { width: 42px; height: 42px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: #2b3550; cursor: pointer; padding: 0; }
#inv-sort:active { transform: scale(0.94); }
#inv-lockmode { width: 42px; height: 42px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; padding: 0; }
#inv-lockmode.on { background: linear-gradient(180deg, #ffd56e, #f0a92b) !important; border-color: #f0a92b !important; }
.tr-cell.locked { opacity: 0.55; cursor: not-allowed; }
.tr-cell .lk { position: absolute; left: 4px; top: 2px; font-size: 10px; }

/* multi-select selling */
.tr-cell .chk { position: absolute; left: 4px; bottom: 2px; width: 16px; height: 16px; border-radius: 50%; background: #f0a92b; color: #fff; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; }
#tr-detail .icon.multi { font-size: 20px; letter-spacing: -2px; max-width: 120px; overflow: hidden; white-space: nowrap; }
#tr-detail .tr-btn.ghost { padding: 6px 10px; font-size: 12px; }
#tr-detail { flex-wrap: wrap; row-gap: 6px; }
#tr-detail .info b { white-space: normal; }
#tr-detail .sell-total { flex: 1; font-size: 18px; font-weight: 700; color: #c87a10; white-space: nowrap; }

/* character window: take-off actions */
.eq-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
/* a locked worn item (2026-10-10): the 🔒 in its corner and the bag's locked look; the window's own lock-mode button */
.eq-slot .slot { position: relative; }
.eq-slot .slot .lk { position: absolute; left: 2px; top: 1px; font-size: 14px; line-height: 16px; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.35)); pointer-events: none; }
.eq-slot .slot.locked { background: #fff6df; box-shadow: inset 0 0 0 1px #f0a92b; }
#eq-lockmode { width: 38px; height: 38px; flex: none; margin-left: auto; display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; padding: 0; }
#eq-lockmode.on { background: linear-gradient(180deg, #ffd56e, #f0a92b) !important; border-color: #f0a92b !important; }
#equip.lockmode .eq-slot .slot { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Ctext y='17' font-size='16'%3E%F0%9F%94%92%3C/text%3E%3C/svg%3E") 4 4, pointer; }
.eq-actions .hint { font-size: 11px; }
#equip-weapon { cursor: pointer; }

/* ESC menu */
#sysmenu { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 300px; max-width: calc((100vw / var(--uiz, 1)) - 32px); z-index: 40; }
.sm-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.sm-btn { border: 1px solid #d9e2f2; border-radius: 12px; padding: 10px 14px; font-family: inherit; font-weight: 700; font-size: 14px; text-align: left; cursor: pointer; background: #fff; color: #33415c; }
.sm-btn:hover { background: #eef4ff; border-color: #9cc0ff; }
.sm-btn.danger { color: #c53030; border-color: #f3c2c2; }
.sm-btn.danger:hover { background: #fff1f1; border-color: #e88; }
.sm-btn:disabled { opacity: 0.6; cursor: default; }
.sm-ask { font-size: 14px; color: #33415c; padding: 2px 2px 4px; }

/* storehouse (คลัง): beside the bag window, same slot look */
#bank { right: 396px; top: 120px; width: 372px; max-width: calc((100vw / var(--uiz, 1)) - 32px); }
.bk-gold { display: flex; justify-content: space-between; font-size: 13px; color: #33415c; background: #f3f7ff; border-radius: 10px; padding: 6px 10px; margin-bottom: 6px; }
.bk-gold b { color: #b8860b; }
.bk-gold-row { display: flex; gap: 5px; margin-bottom: 8px; }
.bk-gold-row input { flex: 1; min-width: 0; border: 1px solid #c9d3e6; border-radius: 8px; padding: 4px 8px; font: inherit; }
.bk-gold-row .tr-btn { padding: 4px 10px; font-size: 12px; white-space: nowrap; }
#bank-grid { display: grid; grid-template-columns: repeat(10, 1fr); grid-auto-rows: 29px; gap: 3px; height: 290px; overflow-y: auto; padding-right: 2px; }
#bank-grid .slot { width: auto; height: auto; border-width: 1px; border-radius: 7px; background: #f6f1e6; cursor: pointer; }
#bank-grid .slot .icon { font-size: 17px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
#bank-grid .slot .count { font-size: 9px; right: 2px; bottom: 0; line-height: 10px; color: #2b3550; text-shadow: 0 0 3px #fff; }
#bank-grid .slot .lk { position: absolute; left: 1px; top: 0; font-size: 8px; line-height: 10px; }
.bk-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; }
.bk-foot .tr-btn { padding: 4px 10px; font-size: 12px; }
#bk-count { color: #7a879e; white-space: nowrap; }
@media (max-width: 800px) { #bank { right: auto; left: 16px; } }

/* a picture beside a dropdown / search box (their own text can't hold the game's emoji pictures — 2026-10-10) */
.sel-ico { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; font-size: 16px; }
.sel-ico img.emo { width: 20px; height: 20px; }
.sel-row { display: flex; align-items: center; gap: 6px; } .sel-row select { flex: 1; }
.mk-bar { align-items: center; }
/* รายงาน (client/js/reports.js): the buttons under the bot's, the form, the admins' inbox */
#report-box { display: flex; justify-content: center; gap: 6px; margin-top: 6px; }
#btn-report, #btn-reports { position: relative; height: 32px; padding: 0 12px; border-radius: 12px; border: 1px solid #e2c27a; background: #fffaf0; color: #8a4a08; font: 700 13px Kanit, sans-serif; cursor: pointer; }
#btn-report:hover, #btn-reports:hover { filter: brightness(1.05); }
#reports-badge { position: absolute; right: -6px; top: -7px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #e5483b; color: #fff; font: 700 11px/18px Kanit, sans-serif; box-shadow: 0 0 0 2px #fff; }
#report-win { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 360px; max-width: calc((100vw / var(--uiz, 1)) - 32px); color: #2b3550; }
.rp-form { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.rp-form label { display: flex; flex-direction: column; gap: 3px; font-weight: 600; }
.rp-form select, .rp-form input, .rp-form textarea { border: 1px solid #c9d3e6; border-radius: 8px; padding: 6px 8px; font: inherit; font-weight: 400; background: #fff; color: #2b3550; resize: vertical; }
.rp-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }
#reports-win { right: 396px; top: 90px; width: 440px; max-width: calc((100vw / var(--uiz, 1)) - 32px); color: #2b3550; }
#reports-list { display: flex; flex-direction: column; gap: 6px; max-height: 460px; overflow-y: auto; }
.rp-item { padding: 8px 10px; border-radius: 10px; background: #fff4f2; border-left: 4px solid #e5483b; font-size: 13px; }
.rp-item.done { background: #f2f5fa; border-left-color: #9aa6bd; opacity: 0.8; }
.rp-head { display: flex; justify-content: space-between; gap: 8px; } .rp-head span { color: #7a879e; font-size: 12px; }
.rp-from i { font-style: normal; color: #9aa6bd; font-size: 12px; } .rp-from i.on { color: #2fa04f; }
.rp-text { margin: 4px 0; white-space: pre-wrap; word-break: break-word; }
.rp-where { color: #5b6b88; font-size: 12px; }
.rp-btns { display: flex; gap: 6px; margin-top: 6px; } .rp-btns .tr-btn { padding: 4px 10px; font-size: 12px; }
.rp-empty { padding: 30px; text-align: center; color: #7a879e; }

/* ตลาดกลาง (the marketplace — client/js/market.js): categories down the left, the listings / forms on the right */
#market { right: 396px; top: 90px; width: 640px; max-width: calc((100vw / var(--uiz, 1)) - 32px); color: #2b3550; }
.mk-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.mk-tabs { display: flex; gap: 4px; padding: 3px; background: #e8edf7; border-radius: 11px; flex-wrap: wrap; }
.mk-tabs button { padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; font: 700 13px Kanit, sans-serif; color: #5b6b88; cursor: pointer; white-space: nowrap; }
.mk-tabs button:hover { background: #f6f8fd; color: #2f6bd8; }
.mk-tabs button.on { background: #fff; color: #2f6bd8; box-shadow: 0 1px 4px rgba(40,60,120,0.18); }
.mk-dot { color: #e8553a; }
#mk-gold { font-size: 13px; white-space: nowrap; } #mk-gold b { color: #b8860b; }
.mk-body { display: flex; gap: 8px; height: 400px; }
#mk-cats { width: 140px; flex: none; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.mk-cat, .mk-sub { text-align: left; border: 0; border-radius: 8px; padding: 6px 8px; background: #f3f6fc; font: 600 13px Kanit, sans-serif; color: #33415c; cursor: pointer; }
.mk-sub { margin-left: 14px; padding: 4px 8px; font-size: 12px; background: #f8fafd; color: #5b6b88; }
.mk-cat:hover, .mk-sub:hover { background: #e3ecff; }
.mk-cat.on, .mk-sub.on { background: #2f6bd8; color: #fff; }
.mk-cat.open { background: #dce7fb; color: #2f6bd8; }
#mk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.mk-bar { display: flex; gap: 6px; }
.mk-bar input, .mk-bar select, .mk-form input { flex: 1; min-width: 0; border: 1px solid #c9d3e6; border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 13px; background: #fff; color: #2b3550; }
.mk-bar select { flex: none; }
.mk-list { display: flex; flex-direction: column; gap: 4px; }
.mk-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 10px; background: #f6f8fc; }
.mk-row:nth-child(even) { background: #eef2fa; }
.mk-row .icon, .mk-pickgrid .icon, .mk-fhead .icon { position: relative; flex: none; width: 34px; height: 34px; display: grid; place-items: center; font-size: 20px; border: 2px solid #ccc; border-radius: 8px; background: #fff; }
.mk-row .count, .mk-pickgrid .count { position: absolute; right: 2px; bottom: 0; font-size: 10px; font-weight: 700; color: #2b3550; text-shadow: 0 0 3px #fff; }
.mk-pickgrid .rf { position: absolute; left: 2px; top: 0; font-size: 10px; font-weight: 700; color: #e8a400; }
.mk-nm { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.mk-nm b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-nm small, .mk-pr small, .mk-fhead small { color: #7a879e; font-size: 11px; }
.mk-rq { font-size: 11px; font-weight: 700; margin-left: 4px; }
.mk-fz { font-size: 11px; color: #4aa3ff; margin-left: 4px; }
.mk-pr { display: flex; flex-direction: column; align-items: flex-end; font-size: 14px; white-space: nowrap; } .mk-pr b { color: #b8860b; }
.mk-row .tr-btn { padding: 5px 12px; font-size: 12px; }
.mk-own { font-size: 11px; color: #7a879e; white-space: nowrap; }
.mk-pages { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 13px; }
.mk-empty { padding: 30px 10px; text-align: center; color: #7a879e; font-size: 13px; }
.mk-pickgrid { display: flex; flex-wrap: wrap; gap: 4px; max-height: 160px; overflow-y: auto; padding: 4px; background: #f3f6fc; border-radius: 10px; }
.mk-pickgrid .icon { cursor: pointer; }
.mk-pick.on { outline: 3px solid #2f6bd8; }
.mk-form { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 10px; background: #f6f8fc; font-size: 13px; }
.mk-form label { display: flex; align-items: center; gap: 8px; } .mk-form label input { flex: 1; }
.mk-fhead { display: flex; align-items: center; gap: 8px; } .mk-fhead div { display: flex; flex-direction: column; }
.mk-calc { min-height: 18px; color: #33415c; } .mk-calc b { color: #b8860b; }
.mk-box { display: flex; flex-direction: column; gap: 8px; }
.mk-boxgold { padding: 10px; border-radius: 10px; background: #fff7e3; font-size: 15px; } .mk-boxgold b { color: #b8860b; }
@media (max-width: 800px) { #market { right: auto; left: 16px; } #mk-cats { width: 110px; } }

/* NPC talk + refine (ตีบวก) */
#npctalk { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 320px; max-width: calc((100vw / var(--uiz, 1)) - 32px); z-index: 30; }
.nt-say { font-size: 13px; color: #33415c; background: #f3f7ff; border-radius: 10px; padding: 8px 10px; margin: 4px 0 8px; }
#refine { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 740px; max-width: calc((100vw / var(--uiz, 1)) - 32px); z-index: 30; }
.rf-layout { display: flex; gap: 12px; }
.rf-list { flex: 0 0 316px; min-width: 0; max-height: 330px; overflow-y: auto; padding-right: 4px; }
.rf-sec { font-size: 11px; font-weight: 700; color: #7a879e; margin: 6px 0 4px; }
.rf-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.rf-row:hover { background: #f1f6ff; }
.rf-row.sel { background: #e6f0ff; border-color: #9cc0ff; }
.rf-row .icon { width: 30px; height: 30px; display: grid; place-items: center; border: 2px solid #ccd; border-radius: 8px; background: #fff; font-size: 17px; }
.rf-row .nm { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rf-row .tag { font-size: 10px; background: #ffe9b8; color: #8a5a00; border-radius: 6px; padding: 1px 6px; }
.rf-detail { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; background: #f7f9fd; border-radius: 12px; padding: 12px 10px; }
.rf-big { width: 64px; height: 64px; display: grid; place-items: center; font-size: 36px; border: 3px solid #ccd; border-radius: 14px; background: #fff; }
.rf-name { font-weight: 700; font-size: 15px; }
.rf-step { font-size: 14px; color: #33415c; }
.rf-stat { font-size: 12px; color: #33415c; }
.rf-rate { font-weight: 700; color: #1f9d55; }
.rf-rate.mid { color: #d38a00; }
.rf-rate.low { color: #d63a3a; }
.rf-max { font-weight: 700; color: #8a5a00; }
.rf-res { font-weight: 700; font-size: 15px; animation: rf-pop 0.35s ease-out; }
.rf-res.ok { color: #1f9d55; }
.rf-res.bad { color: #d63a3a; }
@keyframes rf-pop { from { transform: scale(1.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.slot .rf, .eq-slot .rf, #equip-weapon .rf { position: absolute; left: 2px; top: 1px; font-size: 10px; font-weight: 800; color: #ffcf3a; text-shadow: 0 0 2px #000, 0 0 2px #000; pointer-events: none; }
.tt-ref { color: #ffcf3a; }
@media (max-width: 600px) { .rf-layout { flex-direction: column; } .rf-list { flex: none; max-height: 180px; } }
.rf-row .nm, .rf-name { color: #26324a; }
/* the blacksmith's tabs (ตีบวก / หลอม-เจาะรู) and the fusing page (ui.renderFuse — shared/fuse.js) */
.rf-tabs { display: flex; gap: 4px; margin: 0 0 10px; padding: 3px; background: #e8edf7; border-radius: 11px; }
.rf-tabs button { flex: 1; padding: 6px 4px; border: 0; border-radius: 8px; background: transparent; font: 700 13px Kanit, sans-serif; color: #5b6b88; cursor: pointer; }
.rf-tabs button:hover { background: #f6f8fd; color: #2f6bd8; }
.rf-tabs .rf-ico, #nt-fuse .rf-ico, #rf-title .rf-ico { width: 18px; height: 18px; vertical-align: -4px; } /* (2026-10-10: หลอม is the blacksmith's own button, no tabs) */
.rf-tabs button.on { background: #fff; color: #2f6bd8; box-shadow: 0 1px 4px rgba(40,60,120,0.18); }
.fz-dots { font-size: 11px; color: #4aa3ff; letter-spacing: 1px; white-space: nowrap; }
.fz-lines { width: 100%; display: flex; flex-direction: column; gap: 3px; text-align: left; }
.fz-line { font-size: 12.5px; color: #26324a; background: #fff; border: 1px solid #dfe6f3; border-radius: 8px; padding: 4px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fz-line b { color: #b5651d; }
.fz-line .fz-max { color: #8a94ab; font-size: 0.92em; }
.fz-line.top { border-color: #e04848; background: #ffe5e5; color: #b81f1f; }
.fz-line.top b, .fz-line.top .fz-max { color: #d62828; font-weight: 700; }
.fz-line.empty { color: #7a879e; border-style: dashed; }
.fz-line.locked { color: #a5afc2; background: #f0f2f7; border-style: dashed; }
.fz-stones { font-size: 12px; color: #33415c; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center; }
.fz-stones img.iico { width: 1.3em; height: 1.3em; }
#refine #fz-drill, #refine #fz-fuse { padding: 8px 6px; font-size: 13px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.ui-skin #refine #fz-drill:not(:disabled), body.ui-skin #refine #fz-fuse:not(:disabled) { padding: 1px 6px; } /* (the skin's 7px border instead) */
#fz-drill img.iico, #fz-fuse img.iico { width: 1.35em; height: 1.35em; vertical-align: -0.3em; object-fit: contain; filter: drop-shadow(0 0 1.5px #fff); }
.rf-detail .tr-btn { width: 100%; }
.tt-fzh { color: #7fc6ff; font-weight: 700; margin-top: 2px; }
.tt-fz { color: #ffd59a; }
.tt-fz.top { color: #ff4d4d; font-weight: 700; }
/* item rarity (shared/rarity.js): the options in a tooltip, and a gem in a slot's corner (rare+) */
.tt-rqh { font-weight: 700; margin-top: 2px; }
.tt-rqo { color: #e9f0ff; }
.tt-rqo .tt-rqm { color: #8f9ab3; font-size: 0.92em; }
.tt-rqo.top, .tt-rqo.top .tt-rqm { color: #ff4d4d; font-weight: 700; }
.slot .rqm, .eq-slot .rqm { position: absolute; right: 2px; top: 2px; width: 9px; height: 9px; transform: rotate(45deg); border-radius: 2px; pointer-events: none;
  background: var(--rqc); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9), 0 0 6px var(--rqc); }
.slot .rqm.rq4 { width: 11px; height: 11px; animation: rq-glow 1.6s ease-in-out infinite; }
@keyframes rq-glow { 50% { box-shadow: 0 0 0 1.5px #fff, 0 0 12px var(--rqc); } }
.tt-fz.empty { color: #9aa6bd; }

/* square minimap with zoom buttons */
#minimap-wrap .mm-box { position: relative; display: inline-block; }
#minimap { border-radius: 12px; }
.mm-zoom { position: absolute; right: 9px; bottom: 9px; display: flex; flex-direction: column; gap: 4px; }
.mm-zoom button { width: 24px; height: 24px; padding: 0; border: none; border-radius: 7px; background: rgba(255,255,255,0.92); color: #2b3550; font: 700 17px/24px Kanit, sans-serif; cursor: pointer; box-shadow: 0 2px 6px rgba(20,30,60,0.35); }
.mm-zoom button:hover { background: #fff; color: #2f6bd8; }
.mm-zoom button:active { transform: scale(0.92); }
/* minimap + world map (M) in the UI skin (2026-10-09 — Qwen-Image: client/img/ui/minimap_frame.png, worldmap_bg.png;
   sources assets/gen/ui). The frame's opening (212×208 of 240×242) is laid 1 px over the 170 px map's edge.
   (2026-10-10: re-measured — its inner edge is soft: half see-through from x 12 / 227, y 19 / 229 of the picture, solid
   only from 11 / 229, 18 / 232; laid at 197×198 the opening came out 175.6 px wide over the 170 px map, the page showing
   through at the left and right. Now the map's edges sit on picture x 12 / 227 and y 19 / 229 exactly: 189.8×195.9 at
   −9.5, −15.4; its corners rounded 16 px, inside the frame's solid corner) */
#minimap-wrap .mm-frame { display: none; }
body.ui-skin #minimap-wrap { top: var(--mm-wrap, 22px); } /* (room for the frame's compass star above) */
/* (each theme's frame laid over the map by its own opening — tools: measured from the picture; --mm-* per theme below) */
body.ui-skin #minimap-wrap .mm-frame { display: block; position: absolute; left: var(--mm-l, -9.5px); top: var(--mm-t, -15.4px); width: var(--mm-w, 189.8px); height: var(--mm-h, 195.9px); pointer-events: none; filter: drop-shadow(0 4px 8px rgba(20, 30, 60, 0.3)); }
body.ui-skin #minimap { border: 0; border-radius: 16px; box-shadow: none; }
body.ui-skin #map-name { margin-top: 8px; background: linear-gradient(180deg, #fffaf0, var(--sk-pill-bg)); border: 2px solid var(--sk-line); color: var(--sk-pill); text-shadow: 0 1px 0 #fff; }
body.ui-skin .mm-zoom button { background: linear-gradient(180deg, #fffdf6, var(--sk-pill-bg)); border: 1.5px solid var(--sk-line); color: var(--sk-pill); line-height: 21px; }
body.ui-skin .mm-zoom button:hover { background: #fff; color: #c27a00; }
body.ui-skin .wm-panel {
  background: none; border: 14px solid transparent; border-radius: 0; box-shadow: none; padding: 6px 10px 8px;
  border-image: var(--sk-frame) 34 fill / 17px stretch; filter: drop-shadow(0 16px 30px rgba(10, 20, 50, 0.4));
}
body.ui-skin .wm-title { color: var(--sk-ink); text-shadow: 0 1px 0 #fff; }
body.ui-skin .wm-close { width: 30px; height: 30px; font-size: 0; color: transparent; background: var(--sk-close) center / contain no-repeat; }
body.ui-skin .wm-close:hover { filter: brightness(1.12); transform: scale(1.06); background: var(--sk-close) center / contain no-repeat; }
body.ui-skin #wm-canvas { border: 2px solid var(--sk-line); border-radius: 12px; }
/* ---------- the Codex (วิธีเล่น, H): an open book — client/img/ui/codex_book.png (1100×734, Qwen-Image); its pages
   lie at x 58–534 / 555–1032, y 15–675 of the picture, so everything sits in % of the book ---------- */
#help.codex, body.ui-skin #hud #help.codex {
  width: min(1000px, calc((94vw / var(--uiz, 1))), calc((88vh / var(--uiz, 1)) * 1.4986)); aspect-ratio: 1100 / 734; max-height: none; overflow: visible;
  padding: 0; border: 0; border-image: none; border-radius: 0; box-shadow: none;
  background: url(/img/ui/codex_book.png) center / 100% 100% no-repeat; filter: drop-shadow(0 18px 30px rgba(30, 15, 0, 0.45));
  color: #4a3218;
}
#help.codex .cx-close { position: absolute; right: 1.2%; top: 1%; width: 36px; height: 36px; padding: 0; border: 0; font-size: 0; color: transparent; cursor: pointer; z-index: 2;
  background: var(--sk-close, url(/img/ui/btn_close.png)) center / contain no-repeat; } /* (the gold one when the skin is off) */
#help.codex .cx-close:hover { filter: brightness(1.12); transform: scale(1.06); }
#help.codex .cx-left { position: absolute; left: 8.5%; width: 36.5%; top: 8%; bottom: 11%; display: flex; flex-direction: column; }
#help.codex .cx-right { position: absolute; left: 55%; width: 37.5%; top: 6.5%; bottom: 10%; overflow-y: auto; padding-right: 8px; scrollbar-width: thin; scrollbar-color: #c9a46a transparent; }
.cx-title { display: flex; align-items: center; gap: 12px; }
.cx-title img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(60, 30, 0, 0.35)); }
.cx-title div { font: 700 38px/1 Kanit, serif; color: #7a3f0e; letter-spacing: 1px; text-shadow: 0 1px 0 #fff6dc, 0 2px 6px rgba(150, 90, 20, 0.25); }
.cx-title small { display: block; font: 500 13px/1.4 Kanit, sans-serif; color: #8a6a44; letter-spacing: 0; margin-top: 4px; }
.cx-rule { height: 10px; margin: 12px 0 10px; background: radial-gradient(circle, #b58a4c 0 3px, transparent 3.5px) center / 12px 10px no-repeat, linear-gradient(90deg, transparent, #c9a46a 20%, #c9a46a 80%, transparent) center / 100% 1.5px no-repeat; }
.cx-toc-h { font: 700 15px Kanit, sans-serif; color: #8a3b12; letter-spacing: 2px; margin-bottom: 6px; }
#help.codex .cx-toc { display: flex; flex-direction: column; gap: 6px; margin: 0; flex-wrap: nowrap; }
#help.codex .cx-toc button { flex: none; display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 12px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; font: 600 16px Kanit, sans-serif; color: #5a3d1c; cursor: pointer; white-space: nowrap; }
#help.codex .cx-toc button:hover { background: rgba(201, 164, 106, 0.18); border-color: rgba(181, 138, 76, 0.4); color: #7a3f0e; }
#help.codex .cx-toc button.on { background: linear-gradient(90deg, rgba(196, 52, 40, 0.16), rgba(196, 52, 40, 0.03)); border-color: rgba(176, 48, 36, 0.45); color: #8a2116; box-shadow: inset 4px 0 0 #b8302a; }
#help.codex .cx-toc i { font: 700 13px/1 Kanit, serif; font-style: normal; color: #9a7448; min-width: 26px; text-align: center; padding: 5px 0; border-radius: 50%; background: rgba(201, 164, 106, 0.22); }
#help.codex .cx-toc button.on i { background: #b8302a; color: #fff6dc; }
#help.codex .cx-foot { margin-top: auto; font-size: 12.5px; color: #8a6a44; text-align: center; }
#help.codex kbd { display: inline-block; min-width: 18px; padding: 0 5px; border: 1px solid #c9a46a; border-bottom-width: 2px; border-radius: 5px; background: #fff8e6; font: 600 12px/18px Kanit, sans-serif; text-align: center; color: #5a3d1c; }
.cx-chap { font: 700 22px Kanit, sans-serif; color: #7a3f0e; padding: 0 0 6px 60px; margin-bottom: 8px; border-bottom: 1.5px solid rgba(181, 138, 76, 0.55); } /* (left: room for the ribbon) */
#help.codex .help-h { color: #8a3b12; font-size: 15px; margin: 12px 0 3px; }
#help.codex .help-h::before { content: '✦ '; color: #c9a46a; }
#help.codex .help-list { font-size: 14px; line-height: 1.75; color: #4a3218; }
#help.codex .help-list b { color: #6b2e0c; }
#help.codex .help-keys { grid-template-columns: repeat(2, 1fr); font-size: 13.5px; }
/* the menu bar's Codex button: its picture */
img.mb-ico { width: 1.45em; height: 1.45em; object-fit: contain; vertical-align: -0.35em; pointer-events: none; }
/* a monster's element badge before its name (icons.js elemIconHtml — client/img/ui/elem_*.png) */
img.elico { display: inline-block; width: 1.25em; height: 1.25em; object-fit: contain; vertical-align: -0.25em; margin-right: 4px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4)); }
/* the game's emoji pictures (emoji.js): a letter tall, sitting on the text line; clicks go through to the button / row */
img.emo { display: inline-block; width: 1.2em; height: 1.2em; vertical-align: -0.22em; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
button > img.emo:only-child { width: 1.6em; height: 1.6em; vertical-align: middle; } /* (an icon-only button: ⚙ ❔ 🚪 …) */
/* a map's monster card on the world map (ui.showMapInfo) */
.wm-stage { position: relative; }
#wm-info { position: absolute; z-index: 2; width: 330px; max-height: calc(100% - 12px); overflow-y: auto; padding: 10px 12px 12px; background: linear-gradient(180deg, #fffdf6, #fbf3df); border: 2px solid #e2b54a; border-radius: 14px; box-shadow: 0 10px 28px rgba(40, 30, 10, 0.4); color: #26324a; animation: dlg-pop 0.14s ease-out; }
#wm-info.hidden { display: none; }
.wmi-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 2px solid; }
.wmi-title { font-size: 17px; font-weight: 700; text-shadow: 0 1px 0 #fff; }
.wmi-x { border: 0; background: #f1e6c8; color: #8a5a00; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: 13px; flex: none; }
.wmi-x:hover { background: #ead7a6; }
.wmi-sub { font-size: 11.5px; color: #6b7590; line-height: 1.45; }
.wmi-list { display: flex; flex-direction: column; gap: 6px; }
.wmi-mob { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: #fff; border: 1px solid #ecdcb0; border-radius: 10px; }
.wmi-mob.boss { background: #fff5f5; border-color: #f0b0b0; }
.wmi-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0, 0, 0, 0.15); }
.wmi-txt { flex: 1; min-width: 0; }
.wmi-name { font-weight: 700; font-size: 13.5px; }
.wmi-name small { color: #b5651d; font-weight: 600; }
.wmi-go { flex: none; padding: 5px 10px; font-size: 12px; white-space: nowrap; }
.wmi-go:disabled { opacity: 0.6; cursor: not-allowed; }
.wmi-map { width: 100%; margin-top: 8px; }

/* skill bar without a locked target */
#skills.notarget .slot { filter: grayscale(0.6) brightness(0.8); }

/* passive tree (star map) */
#passive { position: fixed; inset: 0; z-index: 45; background: #05070f; display: flex; flex-direction: column; }
/* (2026-10-11) the planned way's bar: what it takes and costs, ยืนยัน / ยกเลิก (passivetree.js showPlan) */
#pt-plan { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 14px;
  padding: 10px 14px 10px 18px; border-radius: 14px; background: rgba(12,20,40,0.94); border: 1px solid #3dbb7f;
  box-shadow: 0 0 0 1px rgba(109,255,180,0.25), 0 10px 30px rgba(0,0,0,0.55); color: #dfe8ff; font: 14px Kanit, sans-serif; max-width: calc(100vw - 32px); }
#pt-plan b { color: #8dffc4; }
#pt-plan .pp-left { color: #9fb2d8; }
#pt-plan .pp-bad { color: #ff8a7a; font-weight: 600; }
#pt-plan .pp-btns { display: flex; gap: 8px; flex: none; }
#pt-plan button { font: 600 14px Kanit, sans-serif; padding: 7px 16px; border-radius: 10px; cursor: pointer; border: 1px solid #4a5a80; background: #1b2744; color: #dfe8ff; }
#pt-plan .pp-ok { background: linear-gradient(#3fd98a, #22a862); border-color: #6dffb4; color: #06210f; }
#pt-plan .pp-ok:disabled { opacity: 0.45; cursor: not-allowed; }
#pt-plan .pp-no:hover { background: #26355a; }
#passive.hidden { display: none; }
.pt-head { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: linear-gradient(180deg, rgba(20,28,52,0.98), rgba(12,16,32,0.96)); border-bottom: 1px solid #2c3a66; color: #dfe6ff; flex-wrap: wrap; }
.pt-title { font-weight: 700; font-size: 17px; color: #ffd98a; }
.pt-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pt-tab { border: 1px solid #34457a; background: #141c36; color: #c9d4f2; border-radius: 10px; padding: 5px 10px; font: 600 13px Kanit, sans-serif; cursor: pointer; }
.pt-tab small { color: #8fd18f; font-weight: 500; }
.pt-tab span { margin-left: 6px; background: #2b3a6a; border-radius: 8px; padding: 0 6px; font-size: 11px; }
.pt-tab.on { background: #2a3d78; border-color: #8cc2ff; color: #fff; box-shadow: 0 0 10px rgba(110,170,255,0.35); }
.pt-points { margin-left: auto; font-size: 14px; }
.pt-points b { color: #ffd98a; font-size: 18px; }
.pt-points small { color: #93a1c8; }
.pt-close { border: none; background: #2a3458; color: #fff; width: 32px; height: 32px; border-radius: 10px; font-size: 16px; cursor: pointer; }
#pt-canvas { flex: 1; width: 100%; min-height: 0; display: block; cursor: grab; }
#pt-canvas:active { cursor: grabbing; }
.pt-hint { position: absolute; left: 14px; bottom: 10px; color: #8a97c0; font-size: 12px; pointer-events: none; }
.pt-sum { position: absolute; right: 14px; bottom: 10px; max-width: 360px; background: rgba(12,18,38,0.88); border: 1px solid #2c3a66; border-radius: 12px; padding: 8px 12px; color: #dfe6ff; font-size: 12px; line-height: 1.5; }
.pt-sum .dim { color: #7c88ad; }
/* summary: one stat per row, grouped */
.pt-sum { width: 330px; max-height: 46vh; bottom: 32px; overflow-y: auto; font-size: 12.5px; }
.ps-head { display: flex; flex-direction: column; margin-bottom: 4px; }
.ps-head b { font-size: 14px; color: #ffe08a; }
.ps-head span { font-size: 11px; color: #8f9bc4; }
.ps-attrs { display: flex; gap: 6px; margin: 4px 0 2px; }
.ps-attrs span { flex: 1; text-align: center; padding: 3px 0; border-radius: 8px; border: 1px solid var(--c); color: var(--c); background: rgba(255,255,255,0.04); font-size: 13px; }
.ps-group { margin-top: 7px; padding-bottom: 2px; border-bottom: 1px solid #2c3a66; color: #9fb0e0; font-size: 11.5px; font-weight: 600; }
.ps-row { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.ps-row:nth-child(even) { background: rgba(255,255,255,0.03); }
.ps-row span { color: #dfe6ff; }
.ps-row i { color: #7c88ad; font-style: normal; font-size: 10.5px; }
.ps-row b { color: #7dffa8; white-space: nowrap; }
.ps-row.neg b { color: #ff7a7a; }
.ps-rule { margin-top: 6px; color: #ffb27a; font-size: 11.5px; }
@media (max-width: 700px) { .pt-sum { left: 14px; right: 14px; bottom: 34px; max-width: none; } .pt-points { margin-left: 0; } }
/* tooltips and toasts stay above the full-screen passive tree */
#tooltip { z-index: 60; }
#toasts { z-index: 60; }
/* ประกาศจากแอดมิน (ui.announce — events.js): cards in the middle of the screen, closed with ✕ */
/* (half the first size, 2026-10-10) */
#announce-box { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); width: min(280px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 5px; z-index: 55; pointer-events: none; }
.ann-card { pointer-events: auto; position: relative; padding: 6px 9px 7px; border-radius: 9px;
  background: linear-gradient(#fffaf0, #fbecc8); border: 1px solid #d9a943;
  box-shadow: 0 0 0 2px rgba(255,236,170,0.55), 0 5px 15px rgba(60,35,5,0.35); color: #3a2a10; animation: annIn .35s ease-out; }
.ann-card.out { opacity: 0; transform: scale(0.96); transition: opacity .2s, transform .2s; }
.ann-head { display: flex; align-items: center; gap: 4px; margin-bottom: 3px; color: #9a5b00; }
.ann-head b { font-size: 11px; letter-spacing: .2px; }
.ann-head small { color: #8a7650; font-size: 10px; }
.ann-ico { font-size: 13px; line-height: 1; }
.ann-ico .emo { width: 15px; height: 15px; }
.ann-x { margin-left: auto; width: 16px; height: 16px; padding: 0; border-radius: 50%; border: 1px solid #d9a943; font-size: 9px;
  background: linear-gradient(#fff6dc, #f3d98f); color: #7a4d00; font-weight: 700; cursor: pointer; line-height: 1; }
.ann-x:hover { background: linear-gradient(#ffe9a8, #eec567); }
.ann-text { font-size: 12px; font-weight: 700; line-height: 1.4; text-align: center; word-break: break-word;
  color: #4a2c00; text-shadow: 0 1px 0 #fff; }
@keyframes annIn { from { opacity: 0; transform: translateY(-14px) scale(0.95); } to { opacity: 1; transform: none; } }
/* บัพคูณจากแอดมิน (ui.setBoosts): just the picture — no frame, no text — beside the status panel (left/top/size set
   there); the tooltip says what it is and the time left */
/* (z-index 0: on the HUD like the status panel — any window opened (1–2, the passive tree 45) covers it, 2026-10-11) */
#hud .evt-boost { position: absolute; left: 320px; top: 12px; z-index: 0; pointer-events: auto; cursor: help;
  display: flex; align-items: center; justify-content: center; }
.evt-boost .ee-ico { font-size: 30px; line-height: 1; display: flex; }
.evt-boost .emo { width: 100%; height: 100%; }
.evt-boost .ee-ico { width: 100%; height: 100%; align-items: center; justify-content: center; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.45)); }
/* แต้มที่ยังไม่ได้ใช้: a red number on 🌟 พาสซีฟ / ⚔️ สกิล (ui.updatePtsBadges) */
#btn-passive, #btn-skills { position: relative; }
.pts-badge { position: absolute; right: -6px; top: -7px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: #e5483b; color: #fff; font: 700 11px/18px Kanit, sans-serif; box-shadow: 0 0 0 2px #fff; pointer-events: none;
  animation: ptsPulse 1.6s ease-in-out infinite; }
@keyframes ptsPulse { 50% { transform: scale(1.15); } }
.tt-exp { line-height: 1.6; }
.tt-exp b:first-child { color: #c27a00; }
.pt-group { color: #93a1c8; font-size: 12px; font-weight: 700; margin: 0 2px 0 6px; align-self: center; }
.pt-tab.locked { opacity: 0.55; }

/* item pictures (icons.js): sized by the emoji's font size wherever an item icon sits */
img.iico { width: 1.45em; height: 1.45em; object-fit: contain; vertical-align: middle; pointer-events: none; }
.tt-title img.iico, .chat-item img.iico { width: 1.6em; height: 1.6em; margin: -4px 2px -2px 0; }
/* skill pictures (icons.js skillIconHtml, 2026-10-08): a little rounded square sized by the emoji's font size; on the
   skill bar the picture fills the whole slot (its key, MP cost, cooldown and lock stay on top) */
img.skico { width: 1.3em; height: 1.3em; border-radius: 22%; object-fit: cover; vertical-align: middle; pointer-events: none; box-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.slot .icon:has(img.skico) { position: absolute; inset: 0; filter: none; }
.slot img.skico { width: 100%; height: 100%; border-radius: 0; display: block; box-shadow: none; }
.slot:has(img.skico) .key, .slot:has(img.skico) .mpcost { z-index: 1; background: rgba(10,14,30,0.55); padding: 0 3px; border-radius: 4px; line-height: 13px; }
.slot:has(img.skico) .key { left: 2px; top: 2px; }
.slot:has(img.skico) .mpcost { right: 2px; top: 2px; }
.sk-tile .sk-icon img.skico, .sk-head .sk-icon img.skico { width: 1.25em; height: 1.25em; }
.slot .icon:has(img.iico) { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35)); }

.st-theme-row { flex-wrap: wrap; gap: 6px; }
.st-seg.st-theme { flex-wrap: wrap; justify-content: flex-end; }
/* trying on an outfit: six choices — they wrap onto two lines in a narrow window */
.st-seg.st-outfit { flex-wrap: wrap; justify-content: flex-end; max-width: 236px; }
.st-seg.st-outfit button { flex: 1 0 30%; } /* (three a line) */
/* ---------- UI skin themes (2026-10-09 — ตั้งค่า → ธีม UI; ui.js THEMES): the skin's pictures and accents as variables;
   body.ui-skin = the gold one, plus .th-<name> for the others (client/img/ui/themes/<name>, tools/art/ui-themes.mjs) ---------- */
body.ui-skin {
  --sk-frame: url(/img/ui/frame.png); --sk-btn: url(/img/ui/btn_blue.png); --sk-btn2: url(/img/ui/btn_gold.png); --sk-close: url(/img/ui/btn_close.png);
  --sk-slot: url(/img/ui/slot.png); --sk-bar: url(/img/ui/bar.png); --sk-ink: #a5670a; --sk-line: #e2b54a; --sk-pill: #8a5a00; --sk-pill-bg: #fbefd2;
}
body.ui-skin.th-elf {
  --sk-frame: url(/img/ui/themes/elf/frame.png); --sk-btn: url(/img/ui/themes/elf/btn_blue.png); --sk-btn2: url(/img/ui/themes/elf/btn_gold.png); --sk-close: url(/img/ui/themes/elf/btn_close.png);
  --sk-slot: url(/img/ui/themes/elf/slot.png); --sk-bar: url(/img/ui/themes/elf/bar.png); --sk-ink: #4b7a25; --sk-line: #8fbf5a; --sk-pill: #3e6a1e; --sk-pill-bg: #e6f3d6;
  --mm-l: -17.9px; --mm-t: -29.7px; --mm-w: 205.7px; --mm-h: 218.4px; --mm-wrap: 34px;
}
body.ui-skin.th-star {
  --sk-frame: url(/img/ui/themes/star/frame.png); --sk-btn: url(/img/ui/themes/star/btn_blue.png); --sk-btn2: url(/img/ui/themes/star/btn_gold.png); --sk-close: url(/img/ui/themes/star/btn_close.png);
  --sk-slot: url(/img/ui/themes/star/slot.png); --sk-bar: url(/img/ui/themes/star/bar.png); --sk-ink: #5a48b8; --sk-line: #a9b4e8; --sk-pill: #4a3c9e; --sk-pill-bg: #e8e6fb;
  --mm-l: -17.5px; --mm-t: -17.1px; --mm-w: 204.2px; --mm-h: 200px; --mm-wrap: 22px;
}
body.ui-skin.th-sakura {
  --sk-frame: url(/img/ui/themes/sakura/frame.png); --sk-btn: url(/img/ui/themes/sakura/btn_blue.png); --sk-btn2: url(/img/ui/themes/sakura/btn_gold.png); --sk-close: url(/img/ui/themes/sakura/btn_close.png);
  --sk-slot: url(/img/ui/themes/sakura/slot.png); --sk-bar: url(/img/ui/themes/sakura/bar.png); --sk-ink: #c0447a; --sk-line: #eaa3c0; --sk-pill: #a8336a; --sk-pill-bg: #fbe3ee;
  --mm-l: -14.9px; --mm-t: -23px; --mm-w: 198.9px; --mm-h: 209.5px; --mm-wrap: 28px;
}/* ---------- UI skin made with Qwen-Image 2.1 (client/img/ui, sources in assets/gen/ui; ตั้งค่า → UI แบบใหม่) ----------
   9-slice frames (border-image): the gold-rimmed cream window, white/gold slots, capsule HP/MP bars, glossy buttons.
   The old flat look comes back when body has no .ui-skin. */
body.ui-skin #hud .window, body.ui-skin #status, body.ui-skin #guide, body.ui-skin #target {
  background: none; border: 14px solid transparent; border-radius: 0; box-shadow: none;
  border-image: var(--sk-frame) 34 fill / 17px stretch;
  filter: drop-shadow(0 6px 10px rgba(20, 30, 60, 0.25));
}
body.ui-skin #hud .window { padding: 4px 6px 8px; }
body.ui-skin #status { padding: 2px 4px 0; }
body.ui-skin #guide { padding: 0 2px 2px; }
/* (the buff / debuff box: no frame at all — just the icons, see #buffs .buff) */
#hud #buffbox, body.ui-skin #hud #buffbox { background: none; border: 0; border-image: none; box-shadow: none; filter: none; padding: 0; backdrop-filter: none; }
body.ui-skin #hud .win-head { color: var(--sk-ink); text-shadow: 0 1px 0 #fff; }
body.ui-skin #hud .win-head .close {
  width: 24px; height: 24px; padding: 0; font-size: 0; color: transparent;
  background: var(--sk-close) center / contain no-repeat;
}
body.ui-skin #hud .win-head .close:hover { filter: brightness(1.12); transform: scale(1.06); }
/* item / skill slots */
body.ui-skin #hud .slot { background: var(--sk-slot) center / 100% 100% no-repeat; border: 0; border-radius: 10px; }
body.ui-skin #hud .slot.nomp { filter: hue-rotate(160deg) saturate(1.4); }
/* HP / MP / EXP: the fill runs inside the capsule frame */
body.ui-skin #hud .bar {
  background: none; border: 4px solid transparent; border-radius: 0; height: 21px; overflow: visible;
  border-image: var(--sk-bar) 11 20 fill / 4px 8px stretch;
}
body.ui-skin #hud .bar .fill, body.ui-skin #hud .bar .shield { border-radius: 6px; }
body.ui-skin #hud .bar span { line-height: 13px; }
body.ui-skin #hud .bar.xp { height: 19px; }
/* the weapon mastery bar under the EXP bar (shared/mastery.js — 2026-10-10): purple */
#hud .bar.ms { height: 16px; }
#hud .bar.ms .fill { background: linear-gradient(180deg, #d6a8ff, #8a4dff); }
#hud .bar.ms span { font-size: 11px; line-height: 16px; font-weight: 700; color: #fff; text-shadow: 0 0 2px #000, 0 1px 2px #000, 0 0 4px rgba(0,0,0,0.6); white-space: nowrap; }
#hud .bar.ms.none .fill { width: 0 !important; }
body.ui-skin #hud .bar.ms { height: 19px; }
body.ui-skin #hud .bar.ms span { line-height: 11px; }
body.ui-skin #hud .bar.xp span { line-height: 11px; color: #fff; text-shadow: 0 0 2px #000, 0 1px 2px #000, 0 0 4px rgba(0,0,0,0.6); } /* (half on gold, half on the navy trough) */
/* buttons */
/* (2026-10-10: the buttons are drawn with CSS now — a rounded rim and a gradient in the pictures' colours — not as
   9-slices of btn_blue / btn_gold / btn_cream.png: squeezing a picture's 26–30 px edge into a 7–9 px border turned its
   bevel and gradient into thin lines inside every button. Padding grows by what the border lost, so sizes stay.) */
body.ui-skin #hud .tr-btn:not(.ghost):not(.danger):not(:disabled) {
  background: linear-gradient(180deg, #9ee9ff 0%, #5fcaff 38%, #3fb6ff 100%); border: 2px solid #fbf8ef; border-radius: 999px; padding: 6px 17px;
  box-shadow: 0 1px 3px rgba(20, 60, 120, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 2px rgba(20, 60, 120, 0.6);
}
body.ui-skin #hud .tr-btn.sell:not(:disabled), body.ui-skin .screen .btn.primary {
  background: linear-gradient(180deg, #fff3a0 0%, #fde24a 30%, #fccd16 100%); border: 2px solid #c79a0c; border-radius: 999px;
  box-shadow: 0 2px 4px rgba(120, 80, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: #5a3300; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
body.ui-skin #hud .tr-btn.sell:not(:disabled) { padding: 8px 19px; } /* (was a 9 px border + 1 px 12 px) */
body.ui-skin .screen .btn.primary { padding: 17px 23px; }             /* (was a 9 px border + 10 px 16 px) */
body.ui-skin #hud .tr-btn:not(:disabled):hover, body.ui-skin .screen .btn.primary:hover { filter: brightness(1.08); }
/* the rest of the HUD in cream & gold (2026-10-09 — the chosen UI): the menu buttons, the lesser (ghost) buttons, the
   bot's buttons — the cream pill (client/img/ui/btn_cream.png, Qwen-Image); the chat and the skill bar — the window frame */
body.ui-skin { --sk-btn3: url(/img/ui/btn_cream.png); }
body.ui-skin #hud #menu-buttons .btn.small, body.ui-skin #hud .tr-btn.ghost, body.ui-skin #hud #btn-auto, body.ui-skin #hud #btn-bot-cfg {
  background: linear-gradient(180deg, #fffdf5 0%, #f7f2e4 55%, #efe8d6 100%); border: 2px solid #e8b83a; border-radius: 999px;
  box-shadow: inset 0 1px 0 #fff; color: #7a4a08; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  filter: drop-shadow(0 3px 4px rgba(60, 40, 10, 0.25));
}
body.ui-skin #hud #menu-buttons .btn.small { padding: 6px 12px; font-weight: 700; }
body.ui-skin #hud .tr-btn.ghost { padding: 6px 14px; }
body.ui-skin #hud #menu-buttons .btn.small:hover, body.ui-skin #hud .tr-btn.ghost:not(:disabled):hover, body.ui-skin #hud #btn-auto:hover, body.ui-skin #hud #btn-bot-cfg:hover { filter: brightness(1.05) drop-shadow(0 3px 6px rgba(200, 140, 20, 0.45)); }
/* (the bot settings ⚙ beside AUTO: the same cream pill, short — a 36 px square squeezed the pill's round ends out of
   shape; the same height as AUTO, its icon centred) */
body.ui-skin #hud #bot-box { align-items: center; }
body.ui-skin #hud #btn-bot-cfg { width: 54px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
body.ui-skin #hud #btn-bot-cfg img.emo { width: 20px; height: 20px; vertical-align: 0; }
body.ui-skin #hud #btn-auto { height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 12px; }
body.ui-skin #hud #btn-auto.on { background: linear-gradient(180deg, #fff3a0 0%, #fde24a 30%, #fccd16 100%); border: 2px solid #c79a0c; color: #5a3300; animation: none; filter: drop-shadow(0 0 8px rgba(255, 190, 60, 0.9)); } /* (CSS, not the btn_gold 9-slice — 2026-10-10) */
body.ui-skin #hud #chat, body.ui-skin #hud #skillbar {
  background: none; border: 14px solid transparent; border-radius: 0; box-shadow: none;
  border-image: var(--sk-frame) 34 fill / 17px stretch; filter: drop-shadow(0 6px 10px rgba(20, 30, 60, 0.25));
}
body.ui-skin #hud #chat { padding: 0 4px 2px; }
/* the chat / whisper frame on a layer of its own behind the content, its strength following the ◐ slider (--wa) —
   the frame picture can't fade by itself (it's the box's border-image); the text stays solid */
body.ui-skin #hud #chat, body.ui-skin #hud .whisper { border-image: none; background: none !important; }
body.ui-skin #hud #chat::before, body.ui-skin #hud .whisper::before {
  content: ''; position: absolute; inset: -14px; z-index: -1; pointer-events: none;
  border: 14px solid transparent; border-image: var(--sk-frame) 34 fill / 17px stretch; opacity: var(--wa, 0.88);
}
body.ui-skin #hud #chat.faded, body.ui-skin #hud .whisper.faded { filter: none; }
/* (the channel tabs fade with it too: their cream face and rim follow --wa, the chosen tab's blue pill — a picture —
   fades as a whole but never below half; the labels keep a light halo so they stay readable) */
body.ui-skin #hud #chat-tabs button:not(.on) { background: rgba(255, 250, 240, var(--wa, 0.88)); border-color: rgba(234, 215, 166, var(--wa, 0.88)); }
body.ui-skin #hud #chat-tabs button.on { opacity: max(0.5, var(--wa, 0.88)); }
body.ui-skin #hud #chat.faded #chat-tabs button:not(.on) { text-shadow: 0 0 3px #fff, 0 0 2px #fff; }
body.ui-skin #hud #chat-input, body.ui-skin #hud .wsp-input { background: rgba(255, 253, 246, calc(var(--wa, 0.88) + 0.08)) !important; }
body.ui-skin #hud #skillbar { padding: 0 6px; }
body.ui-skin #hud #chat-tabs button { background: #fffaf0; border: 1px solid #ead7a6; color: #8a6a3c; }
body.ui-skin #hud #chat-tabs button.on { background: linear-gradient(180deg, #9ee9ff 0%, #5fcaff 38%, #3fb6ff 100%); border: 2px solid #fbf8ef; border-radius: 999px; padding: 4px; color: #fff; text-shadow: 0 1px 2px rgba(20, 60, 120, 0.6); } /* (CSS, not the btn_blue 9-slice — 2026-10-10; padding: the 6 px border it lost) */
body.ui-skin #hud #chat-input { background: #fffdf6; border: 1px solid #e2c27a; }

/* ---------- party (ui.setParty / playerMenu / partyInvite) ---------- */
#party { position: absolute; left: 12px; top: 240px; width: 220px; box-sizing: border-box; padding: 8px 10px; font-size: 13px; color: #2b3550; }
.party-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: #2f6bd8; margin-bottom: 4px; }
.party-head b { color: #6b7590; font-weight: 600; }
#party-bonus { font-size: 11.5px; color: #c87a10; font-weight: 700; cursor: help; }
.pt-mem { padding: 3px 0 4px; border-top: 1px solid rgba(60,80,130,0.1); }
.pt-mem:first-child { border-top: 0; }
.pt-mem.off { opacity: 0.5; }
.pt-mem.me .pt-n { color: #2f6bd8; }
.pt-top { display: flex; align-items: center; gap: 4px; font-weight: 600; }
.pt-top small { color: #6b7590; font-weight: 400; }
.pt-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 110px; }
.pt-kick { margin-left: auto; border: 0; background: transparent; color: #a0a8bd; cursor: pointer; font-size: 11px; padding: 0 2px; }
.pt-kick:hover { color: #d63a3a; }
.pt-bar { height: 5px; border-radius: 3px; background: #e3e8f2; margin-top: 2px; overflow: hidden; }
.pt-bar i { display: block; height: 100%; border-radius: 3px; transition: width .3s; }
.pt-bar.hp i { background: linear-gradient(90deg, #e8455b, #ff7a8a); }
.pt-bar.mp i { background: linear-gradient(90deg, #3f7fe8, #7ab4ff); }
#party-leave { width: 100%; margin-top: 6px; }
#pmenu { position: absolute; z-index: 60; min-width: 150px; padding: 6px; background: #fff; border: 1px solid #d9e0ee; border-radius: 12px; box-shadow: 0 8px 24px rgba(20,30,60,0.25); display: flex; flex-direction: column; gap: 2px; }
#pmenu .pm-name { font-weight: 700; color: #2b3550; padding: 4px 8px 6px; border-bottom: 1px solid #eef1f7; margin-bottom: 2px; }
#pmenu .pm-name small { color: #6b7590; font-weight: 400; }
#pmenu button { text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 8px; font: inherit; font-size: 13.5px; color: #2b3550; cursor: pointer; }
#pmenu button:hover { background: #eef3ff; color: #2f6bd8; }
#pmenu button.pm-danger { color: #c93a3a; }
#pmenu button.pm-danger:hover { background: #ffecec; color: #c93a3a; }
#pmenu button:disabled { opacity: 0.45; cursor: default; background: transparent; color: #2b3550; }
/* ---------- in-game dialogs (dialog.js — in place of the browser's confirm / alert / prompt) ---------- */
#dlg { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(10, 16, 32, 0.35); pointer-events: auto; }
#dlg.hidden { display: none; }
#dlg .dlg-panel { position: relative; width: 340px; max-width: calc((100vw / var(--uiz, 1)) - 32px); padding: 16px 18px 14px; text-align: center; background: #fff; border: 1px solid #d9e0ee; border-radius: 14px; box-shadow: 0 12px 32px rgba(20, 30, 60, 0.35); animation: dlg-pop 0.16s ease-out; }
#dlg .dlg-text { font-size: 14.5px; color: #26324a; white-space: pre-line; line-height: 1.5; margin: 2px 0 12px; overflow-wrap: anywhere; }
#dlg .dlg-input { width: 100%; box-sizing: border-box; border: 1px solid #c9d3e6; border-radius: 9px; padding: 6px 10px; font: inherit; font-size: 15px; text-align: center; margin-bottom: 12px; }
#dlg .dlg-input.hidden, #dlg .dlg-no.hidden { display: none; }
#dlg .dlg-btns { display: flex; gap: 10px; justify-content: center; }
#dlg .dlg-btns .tr-btn { min-width: 96px; }
@keyframes dlg-pop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* ---------- trading between players (ui.tradeReq / setTrade — server/game/trade.js) ---------- */
#trade-req { left: 50%; top: 30%; transform: translateX(-50%); width: 300px; text-align: center; z-index: 46; }
#trade-req .pi-text { font-size: 15px; margin: 4px 0 12px; }
#trade-req .pi-btns { display: flex; gap: 10px; justify-content: center; }
#tradew { left: max(16px, calc(50% - 470px)); top: 18%; width: 440px; max-width: calc((100vw / var(--uiz, 1)) - 32px); z-index: 31; }
.tw-cols { display: flex; gap: 8px; }
.tw-side { flex: 1 1 50%; min-width: 0; background: #f7f9fd; border: 2px solid #e3e9f5; border-radius: 12px; padding: 8px; transition: border-color .15s, background .15s; }
.tw-side.locked { border-color: #f0b429; background: #fffaf0; }
.tw-side.ok { border-color: #3cb371; background: #f0fbf4; }
.tw-head { font-weight: 700; font-size: 13.5px; color: #2b3550; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 4px; white-space: nowrap; }
.tw-name { overflow: hidden; text-overflow: ellipsis; }
.tw-state { font-weight: 400; font-size: 12px; color: #8a94ab; }
.tw-side.locked .tw-state { color: #b7791f; }
.tw-side.ok .tw-state { color: #2f855a; }
.tw-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.tw-grid .slot { width: auto; height: auto; aspect-ratio: 1; border-width: 1px; border-radius: 8px; background: #f6f1e6; }
.tw-grid .slot .icon { font-size: 20px; }
.tw-grid .slot .count { font-size: 10px; right: 2px; bottom: 0; color: #2b3550; text-shadow: 0 0 3px #fff; }
#tw-me .tw-grid .slot.full { cursor: pointer; }
.tw-grid .slot.bad { opacity: 0.4; }
.tw-gold { margin-top: 8px; font-size: 13px; color: #33415c; display: flex; align-items: center; gap: 5px; }
.tw-gold input { flex: 1; min-width: 0; border: 1px solid #c9d3e6; border-radius: 8px; padding: 3px 8px; font: inherit; }
.tw-gold b { color: #b8860b; }
.tw-hint { font-size: 11.5px; margin: 8px 0 6px; text-align: center; }
.tw-btns { display: flex; gap: 6px; }
.tw-btns .tr-btn { flex: 1; padding: 8px 6px; font-size: 13px; white-space: nowrap; }
.tw-btns .tr-btn:disabled { opacity: 0.45; cursor: default; }
#party-invite { left: 50%; top: 22%; transform: translateX(-50%); width: 300px; text-align: center; z-index: 45; }
#party-invite .pi-text { font-size: 15px; margin: 4px 0 12px; }
#party-invite .pi-btns { display: flex; gap: 10px; justify-content: center; }
body.ui-skin #party { background: none; border: 14px solid transparent; border-radius: 0; box-shadow: none; border-image: var(--sk-frame) 34 fill / 17px stretch; filter: drop-shadow(0 6px 10px rgba(20,30,60,0.25)); padding: 0 2px 2px; }
#party-list { overflow-y: auto; overflow-x: hidden; }
#party-share { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; } /* (one switch per row: side by side they ran out of the panel) */
#party-share button { display: flex; justify-content: space-between; align-items: center; width: 100%; box-sizing: border-box; border: 1px solid #d9e0ee; background: #f5f7fc; border-radius: 8px; padding: 4px 10px; font: inherit; font-size: 12px; color: #6b7590; cursor: pointer; white-space: nowrap; overflow: hidden; }
#party-share button b { font-weight: 700; }
#party-share button.on { background: #e6f7ec; border-color: #7fd39b; color: #1f7a3d; }
#party-share button:disabled { cursor: default; opacity: 0.85; }
#party-share button:not(:disabled):hover { filter: brightness(0.97); }
/* party: online / offline */
.pt-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #b5bccb; box-shadow: 0 0 0 2px #fff; margin-right: 2px; flex: none; }
.pt-dot.on { background: #2fc24f; box-shadow: 0 0 0 2px #fff, 0 0 6px rgba(47,194,79,0.7); }
.pt-mem.off { opacity: 1; }
.pt-mem.off .pt-n { color: #8a93ab; }
.pt-mem.off .pt-bar i { background: #b8bfcc !important; }
.pt-off { color: #9aa2b5 !important; font-size: 11px; }
.party-sub { font-size: 11px; color: #6b7590; margin: -2px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party-head > span:first-child { white-space: nowrap; }
/* folding the party window (ui.setParty — the ▾ button / a click on its title): only the title row stays */
/* ส่องของ: another player's equipment (ui.inspect) — the character window's slots, their name and main stats between */
#inspect { left: 420px; top: 130px; width: 340px; }
#inspect .ins-mid { justify-content: flex-start; gap: 6px; padding: 10px 8px; min-width: 0; }
#inspect .eq-name { font-size: 14px; text-align: center; word-break: break-word; }
.ins-class { font-size: 12px; color: #6b7590; }
.ins-stats { width: 100%; display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.ins-stats div { display: flex; align-items: center; gap: 5px; background: rgba(255,255,255,0.6); border-radius: 7px; padding: 3px 7px; font-size: 12px; color: #2b3550; }
.ins-stats i { font-style: normal; width: 16px; text-align: center; }
.ins-stats b { margin-left: auto; }
#inspect .hint { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; }
.ins-refresh { border: 1px solid #d9e0ee; background: #fff; border-radius: 7px; padding: 2px 8px; font: inherit; font-size: 11.5px; cursor: pointer; color: #2f6bd8; }
.ins-refresh:hover { background: #eef3ff; }
/* a member's weapon, before the name (ui.setParty) */
.pt-w { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-right: 3px; vertical-align: -4px; border-radius: 5px; background: rgba(47,107,216,0.10); font-size: 12px; line-height: 1; flex: none; }
.pt-w .iico { width: 16px; height: 16px; }
.pt-mem.off .pt-w { opacity: 0.5; filter: grayscale(1); }
#party-bonus { margin-left: auto; margin-right: 4px; }
#party-fold { flex: none; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 6px; background: rgba(47,107,216,0.12); color: #2f6bd8; font-size: 12px; line-height: 20px; cursor: pointer; transition: transform 0.15s; }
#party-fold:hover { background: rgba(47,107,216,0.25); }
.party-head { cursor: pointer; user-select: none; }
#party.folded #party-fold { transform: rotate(-90deg); }
#party.folded .party-head { margin-bottom: 0; }
#party.folded .party-sub, #party.folded #party-list, #party.folded #party-share, #party.folded #party-leave { display: none; }
#party-bonus { white-space: nowrap; }
.pt-top { white-space: nowrap; min-width: 0; }
.pt-top small { white-space: nowrap; flex: none; }
.pt-n { min-width: 0; flex: 0 1 auto; }
