/* ==========================================================================================================
   SIGIL UI — the one design system (UI Redesign V2 "modern anime MMORPG", owner 2026-10-14).
   Loaded last (index.html, server PUBLIC). Tokens -> window chrome -> components -> the four redesigned systems:
   HUD (#hud), character / inventory screen (.sx-cs: windows 'bag' + 'equip'), skill cards (.sx-sk), AUTO settings (.sx-auto).
   Rules of the system:
   - colours, sizes, radii and shadows come from the tokens below; a window never picks its own gold or navy
   - gold = what you can press next or what is chosen; cyan = magic / info / "can level up"; rarity colours only on items
   - phones: no backdrop-filter, no endless glow animations on big shadows (FPS); every tap target >= 40 px
   The old look layers for these systems (ui-v2.css components + .inv2/.eq3/.sk3/.eq2, skill-ui.css .sk4, the V3.1 / V3.2 /
   ui-hud HUD looks in hud-v3.css) were removed when this file took them over, so there is one rule per look, not five.
   ========================================================================================================== */
:root {
  /* ink (backgrounds), deepest first */
  --sx-ink0: #040917; --sx-ink1: #081332; --sx-ink2: #0d1c46; --sx-ink3: #142a62; --sx-ink4: #1d3a82;
  /* lines */
  --sx-line: rgba(132, 172, 255, .17); --sx-line2: rgba(132, 172, 255, .32); --sx-line-au: rgba(255, 210, 110, .42);
  /* brand */
  --sx-blue: #3f7dff; --sx-blue2: #2a5ae0; --sx-cyan: #5fe1ff; --sx-cyan2: #29b6ea;
  --sx-gold: #ffd56a; --sx-gold2: #f2a93b; --sx-gold3: #fff3c6; --sx-gold-ink: #2b1904;
  --sx-rose: #ff4f7a; --sx-violet: #a77bff;
  /* text */
  --sx-tx: #f3f7ff; --sx-tx2: #bdcaea; --sx-tx3: #8193bd; --sx-tx4: #5d6d96;
  /* states */
  --sx-up: #58f0a0; --sx-down: #ff6f86; --sx-warn: #ffb547; --sx-lock: #8a96b8;
  /* bars */
  --sx-hp: linear-gradient(90deg, #ff3d6e, #ff7d5c); --sx-mp: linear-gradient(90deg, #2f73ff, #5fe1ff);
  --sx-exp: linear-gradient(90deg, #ffbf3a, #fff08a); --sx-job: linear-gradient(90deg, #a77bff, #5fe1ff);
  /* rarity (same five grades as data.js RARITY) */
  --sx-r0: #c6cfdf; --sx-r1: #4cf08a; --sx-r2: #49b6ff; --sx-r3: #c86cff; --sx-r4: #ffa62b;
  /* type scale */
  --sx-font: Prompt, 'Noto Sans Thai', system-ui, sans-serif;
  --sx-fs1: 11px; --sx-fs2: 12px; --sx-fs3: 13px; --sx-fs4: 15px; --sx-fs5: 18px; --sx-fs6: 24px; --sx-fs7: 32px;
  /* spacing */
  --sx-s1: 4px; --sx-s2: 8px; --sx-s3: 12px; --sx-s4: 16px; --sx-s5: 24px;
  /* radius */
  --sx-rs: 7px; --sx-rm: 11px; --sx-rl: 16px; --sx-rx: 22px;
  /* shadows / glows */
  --sx-sh1: 0 2px 6px rgba(0, 4, 16, .45);
  --sx-sh2: 0 0 0 1px rgba(2, 6, 18, .85), 0 22px 60px rgba(0, 4, 18, .62);
  --sx-in: inset 0 1px 0 rgba(255, 255, 255, .07), inset 0 -1px 0 rgba(0, 0, 0, .35);
  --sx-glow-au: 0 0 14px rgba(255, 205, 96, .45); --sx-glow-cy: 0 0 14px rgba(95, 225, 255, .45);
  /* surfaces */
  --sx-win: radial-gradient(140% 70% at 50% -18%, rgba(63, 125, 255, .26), rgba(63, 125, 255, 0) 62%),
            linear-gradient(180deg, #11245a 0%, #0b1840 30%, #07102b 100%);
  --sx-card: linear-gradient(180deg, rgba(36, 66, 140, .34), rgba(14, 28, 70, .42));
  --sx-card2: linear-gradient(180deg, rgba(48, 86, 180, .3), rgba(18, 36, 90, .4));
  --sx-well: rgba(3, 8, 24, .55);
  --sx-btn: linear-gradient(180deg, #24418c, #172c66);
  --sx-btn-au: linear-gradient(180deg, #ffe590 0%, #ffcb52 46%, #e99a2c 100%);
  --sx-ease: cubic-bezier(.2, .8, .2, 1);
  --sx-tap: 40px;

  /* the older token names still used by the other windows: same palette, so every window shares the new colours */
  --nv0: var(--sx-ink0); --nv1: var(--sx-ink1); --nv2: var(--sx-ink2); --nv3: var(--sx-ink3); --nv4: var(--sx-ink4);
  --au: var(--sx-gold); --au2: var(--sx-gold2); --au3: var(--sx-gold3); --cr: var(--sx-cyan); --cr2: var(--sx-cyan2);
  --tx: var(--sx-tx); --tx2: var(--sx-tx2); --tx3: var(--sx-tx3); --ok: var(--sx-up); --bad: var(--sx-down);
  --r0: var(--sx-r0); --r1: var(--sx-r1); --r2: var(--sx-r2); --r3: var(--sx-r3); --r4: var(--sx-r4);
  --u-rad: var(--sx-rs); --u-gap: 10px; --u-tap: var(--sx-tap); --u-font: var(--sx-font); --u-ease: var(--sx-ease);
}

/* ==========================================================================================================
   Window chrome (every #panel window)
   ========================================================================================================== */
#panel .win {
  position: relative; color: var(--sx-tx); font-family: var(--sx-font);
  background: var(--sx-win); border: 1px solid var(--sx-line2); border-radius: var(--sx-rl);
  box-shadow: var(--sx-sh2), inset 0 1px 0 rgba(170, 205, 255, .16) !important;
}
/* corner ornaments: Codex filigree (assets/ui/v4/corner.webp) on the top corners; plain gold ticks when it is missing */
#panel .win::before, #panel .win::after {
  content: ''; position: absolute; top: -3px; width: 44px; height: 44px; z-index: 2; pointer-events: none; opacity: 1 !important;
  border: 0 !important; border-radius: 0 !important;
  background: url(assets/ui/v4/corner.webp) left top / 100% no-repeat, linear-gradient(var(--sx-gold), var(--sx-gold)) left 3px top 3px / 18px 2px no-repeat,
    linear-gradient(var(--sx-gold), var(--sx-gold)) left 3px top 3px / 2px 18px no-repeat;
}
#panel .win::before { left: -3px; }
#panel .win::after { right: -3px; left: auto; bottom: auto; transform: scaleX(-1); }
#panel:not([hidden]) .win { animation: sxWinIn .18s var(--sx-ease); }
@keyframes sxWinIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes uWinIn { from { opacity: 0; transform: translateY(6px) scale(.975); } }
#panel .win header { position: relative; background: linear-gradient(180deg, rgba(95, 150, 255, .14), rgba(95, 150, 255, 0)); border-bottom: 1px solid var(--sx-line); border-radius: var(--sx-rl) var(--sx-rl) 0 0; }
#panel .win header::after { content: ''; position: absolute; left: 18%; right: 18%; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--sx-gold), transparent); opacity: .75; }
#panel .win h2 { font: 700 var(--sx-fs5) var(--sx-font); letter-spacing: .4px; color: var(--sx-gold3);
  text-shadow: 0 1px 0 #000, 0 0 16px rgba(255, 205, 96, .25); }
#panel .win h2 small { color: var(--sx-tx3); font-weight: 500; font-size: var(--sx-fs2); }
#panel .wic { color: var(--sx-gold); background: radial-gradient(circle at 35% 30%, #2d52b0, #0e1d48) !important; border: 1px solid var(--sx-line-au) !important; border-radius: 9px !important; transform: rotate(45deg); }
#panel .wic > * { transform: rotate(-45deg); }
#pclose, #bmClose { width: 40px; height: 40px; border-radius: 50% !important; background: radial-gradient(circle at 40% 30%, #2a4a9a, #12245a) !important; color: var(--sx-gold3) !important;
  border: 1px solid var(--sx-line-au) !important; box-shadow: var(--sx-in), var(--sx-sh1) !important; font-size: 16px; transition: transform .12s var(--sx-ease), filter .15s; }
#pclose:hover, #bmClose:hover { filter: brightness(1.2); box-shadow: var(--sx-in), var(--sx-glow-au) !important; }
#pclose:active, #bmClose:active { transform: scale(.92); }
/* the character tab strip: one row of tabs, the chosen one lit gold with a glowing underline */
#hubTabs { display: flex; border-bottom: 1px solid var(--sx-line) !important; background: rgba(3, 8, 24, .35) !important; padding: 0 8px; gap: 2px; }
#hubTabs button { flex: 1; min-height: 42px; color: var(--sx-tx3) !important; background: none !important; border: 0 !important; border-bottom: 2px solid transparent !important;
  font: 600 var(--sx-fs3) var(--sx-font); letter-spacing: .3px; transition: color .15s, background .15s; box-shadow: none !important; }
#hubTabs button:hover { color: var(--sx-tx) !important; background: linear-gradient(rgba(95, 150, 255, 0), rgba(95, 150, 255, .1)) !important; }
#hubTabs button.on { color: var(--sx-gold3) !important; border-bottom-color: var(--sx-gold) !important; text-shadow: 0 0 12px rgba(255, 205, 96, .55);
  background: linear-gradient(rgba(255, 205, 96, 0), rgba(255, 205, 96, .14)) !important; }
#hubTabs button i { font-style: normal; color: var(--sx-gold); margin-right: 4px; }
#hubTabs button u { text-decoration: none; margin-left: 5px; font-size: var(--sx-fs1); color: var(--sx-tx4); }
body:not(.pc) #hubTabs button u { display: none; }
#pbody { scrollbar-color: #33549c transparent; scrollbar-width: thin; }

/* ==========================================================================================================
   Buttons: primary (gold), secondary (navy), ghost, danger, disabled — the same in every window and dialog
   ========================================================================================================== */
#pbody button, .u-dlg .u-btn { background: var(--sx-btn); border: 1px solid var(--sx-line2); color: var(--sx-tx); border-radius: var(--sx-rs);
  font-family: var(--sx-font); box-shadow: var(--sx-in); transition: border-color .12s, filter .12s, transform .06s, box-shadow .15s; }
#pbody button:hover:not(:disabled) { border-color: var(--sx-line-au); filter: brightness(1.14); }
#pbody button:active:not(:disabled) { transform: translateY(1px) scale(.985); }
#pbody button:disabled, .u-dlg .u-btn:disabled { filter: grayscale(.85) brightness(.75); opacity: .62; cursor: not-allowed; }
#pbody button.ok, #pbody .u-btn.gold, .u-dlg .u-btn.gold, #panel #pbody button.ok:not(:disabled), #panel #pbody .u-btn.gold:not(:disabled) {
  background: var(--sx-btn-au) !important; color: var(--sx-gold-ink) !important; border: 1px solid #fff0b8 !important; font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 245, 210, .6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -2px 0 rgba(150, 80, 0, .35), 0 3px 10px rgba(255, 170, 40, .28) !important; }
#pbody button.ok:hover:not(:disabled), #pbody .u-btn.gold:hover:not(:disabled) { filter: brightness(1.07); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 18px rgba(255, 196, 70, .55) !important; }
#pbody button.on { background: linear-gradient(180deg, rgba(255, 213, 106, .32), rgba(255, 213, 106, .12)); border-color: var(--sx-gold); color: var(--sx-gold3); }
#pbody .u-btn.danger, .u-dlg .u-btn.danger { background: linear-gradient(180deg, #e8506c, #a92445) !important; border-color: #ffb0be !important; color: #fff !important; }
#pbody .u-btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--sx-tx2); }
.u-btn { min-height: var(--sx-tap); padding: 0 14px; font: 600 var(--sx-fs3) var(--sx-font); cursor: pointer; }

/* chips, bars, diffs, tabs, headings, cards */
.u-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font: 600 var(--sx-fs1) var(--sx-font); color: var(--sx-tx2);
  background: rgba(95, 150, 255, .14); border: 1px solid var(--sx-line2); white-space: nowrap; }
.u-chip.gold { color: var(--sx-gold3); background: rgba(255, 213, 106, .14); border-color: var(--sx-line-au); }
.u-chip.max { color: var(--sx-gold-ink); background: var(--sx-btn-au); border-color: #fff0b8; }
.u-bar { position: relative; height: 14px; border-radius: 7px; background: var(--sx-well); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06); overflow: hidden; }
.u-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 7px; transition: width .3s var(--sx-ease); }
.u-bar span { position: absolute; inset: 0; text-align: center; font: 700 10px/14px var(--sx-font); color: #fff; text-shadow: 0 1px 2px #000; }
.u-hp i { background: var(--sx-hp); } .u-mp i { background: var(--sx-mp); } .u-exp i { background: var(--sx-exp); } .u-job i { background: var(--sx-job); }
.u-diff { font-style: normal; font-size: var(--sx-fs1); font-weight: 700; margin-left: 5px; }
.u-diff.up { color: var(--sx-up); } .u-diff.down { color: var(--sx-down); }
.u-tabs { display: flex; gap: 4px; margin-bottom: 8px; } .u-tabs button { flex: 1; }
.u-h { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font: 700 var(--sx-fs2) var(--sx-font); color: var(--sx-gold); letter-spacing: .6px; }
.u-h::before { content: ''; width: 7px; height: 7px; transform: rotate(45deg); background: var(--sx-gold); box-shadow: 0 0 6px rgba(255, 205, 96, .7); flex: none; }
.u-h::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--sx-line-au), transparent); }
.u-h small { color: var(--sx-tx3); font-weight: 500; letter-spacing: 0; }
.u-card { background: var(--sx-card); border: 1px solid var(--sx-line); border-radius: var(--sx-rm); padding: 10px; box-shadow: var(--sx-in); }
.u-rn0 { color: var(--sx-r0); } .u-rn1 { color: var(--sx-r1); } .u-rn2 { color: var(--sx-r2); } .u-rn3 { color: var(--sx-r3); } .u-rn4 { color: var(--sx-r4); }

/* StatRow */
.u-stat { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 5px 9px; border-radius: var(--sx-rs); background: rgba(95, 150, 255, .06); font-size: var(--sx-fs2); cursor: help; }
.u-stat:nth-child(4n+1), .u-stat:nth-child(4n+2) { background: rgba(95, 150, 255, .1); }
.u-sl { color: var(--sx-tx2); font-weight: 500; } .u-sv { color: var(--sx-tx); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.u-bonus { font-style: normal; color: var(--sx-cyan); font-weight: 600; margin-left: 2px; }

/* ItemSlot / EquipmentSlot = the rarity tile (Codex frames assets/ui/v4/tile-r<n>.webp over a CSS frame) */
.u-slot { --rc: #4a5e92; --rg: transparent; position: relative; width: 52px; height: 52px; flex: none; display: grid; place-items: center; padding: 0 !important;
  border-radius: 10px !important; background: radial-gradient(circle at 50% 30%, #23418a, #0d1b45 70%, #081232) !important; border: 1.5px solid var(--rc) !important;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5), inset 0 0 14px var(--rg), 0 2px 5px rgba(0, 0, 0, .4) !important; cursor: default; transition: transform .1s, box-shadow .15s; }
.u-slot::before { content: ''; position: absolute; inset: -3px; border-radius: 12px; pointer-events: none; background: var(--tile, none) center / 100% 100% no-repeat; z-index: 1; }
button.u-slot { cursor: pointer; }
button.u-slot:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5), inset 0 0 16px var(--rg), 0 0 12px var(--rg) !important; }
.u-slot.u-m { width: 46px; height: 46px; } .u-slot.u-l { width: 64px; height: 64px; } .u-slot.u-xl { width: 84px; height: 84px; }
.u-slot .u-ic { display: grid; place-items: center; width: 100%; height: 100%; }
.u-slot .u-ic img { width: 76%; height: 76%; image-rendering: pixelated; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .65)); }
.u-slot .u-glyph { font-style: normal; font-size: 18px; opacity: .3; filter: grayscale(1); }
.u-slot .u-glyph img { width: 60% !important; height: 60% !important; opacity: .55; }
.u-slot .u-cap { position: absolute; left: 0; right: 0; bottom: -15px; text-align: center; font-size: var(--sx-fs1); color: var(--sx-tx3); white-space: nowrap; }
.u-slot .u-badge { position: absolute; right: 3px; top: 1px; z-index: 2; font: 800 11px var(--sx-font); color: var(--sx-gold3); text-shadow: 0 1px 2px #000, 0 0 6px rgba(255, 196, 70, .8); }
.u-slot .u-count { position: absolute; right: 3px; bottom: 1px; z-index: 2; font: 700 11px var(--sx-font); color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.u-slot.u-empty { --rc: rgba(90, 120, 190, .4); background: rgba(8, 18, 48, .7) !important; box-shadow: inset 0 2px 8px rgba(0, 0, 0, .55) !important; border-style: dashed !important; }
.u-slot.u-r0 { --rc: #7887a8; --tile: url(assets/ui/v4/tile-r0.webp); }
.u-slot.u-r1 { --rc: #3fd877; --rg: rgba(76, 240, 138, .28); --tile: url(assets/ui/v4/tile-r1.webp); }
.u-slot.u-r2 { --rc: #3fa3ff; --rg: rgba(73, 182, 255, .32); --tile: url(assets/ui/v4/tile-r2.webp); }
.u-slot.u-r3 { --rc: #b75cff; --rg: rgba(200, 108, 255, .36); --tile: url(assets/ui/v4/tile-r3.webp); }
.u-slot.u-r4 { --rc: #ff9a22; --rg: rgba(255, 166, 43, .42); --tile: url(assets/ui/v4/tile-r4.webp); }
.u-slot.u-sel { border-color: var(--sx-gold3) !important; box-shadow: 0 0 0 2px var(--sx-gold), inset 0 0 16px rgba(255, 213, 106, .35), 0 0 16px rgba(255, 205, 96, .55) !important; }
.u-slot.u-lock { filter: grayscale(.7) brightness(.7); } .u-slot .u-lockic { position: absolute; left: 2px; top: 1px; z-index: 2; font-size: 10px; font-style: normal; }

/* ConfirmationDialog */
.u-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(2, 6, 18, .6); animation: sxFade .12s; }
.u-dlg { width: min(380px, 92vw); padding: 18px 18px 14px; border-radius: var(--sx-rl); color: var(--sx-tx); font-family: var(--sx-font);
  background: var(--sx-win); border: 1px solid var(--sx-line-au); box-shadow: var(--sx-sh2); animation: sxWinIn .16s var(--sx-ease); }
.u-dlg.danger { border-color: #ff9fb0; }
.u-dlg h3 { margin: 0 0 8px; font: 700 var(--sx-fs4) var(--sx-font); color: var(--sx-gold3); }
.u-dlgb { font-size: var(--sx-fs3); color: var(--sx-tx2); line-height: 1.55; }
.u-dlgf { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.u-dlgf .u-btn { min-width: 96px; }
@keyframes sxFade { from { opacity: 0; } }
@keyframes uFade { from { opacity: 0; } }
/* NotificationToast */
#uToasts { position: fixed; right: calc(14px + var(--sr, 0px)); top: calc(150px + var(--st, 0px)); z-index: 55; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none; }
.u-toast { padding: 8px 14px; border-radius: 999px; font: 600 var(--sx-fs2) var(--sx-font); color: var(--sx-tx); background: linear-gradient(180deg, #17306e, #0b1840);
  border: 1px solid var(--sx-line-au); box-shadow: 0 6px 18px rgba(0, 0, 0, .45); animation: uToastIn .2s var(--sx-ease); transition: opacity .25s, transform .25s; }
.u-toast.ok { border-color: rgba(88, 240, 160, .7); } .u-toast.bad { border-color: rgba(255, 111, 134, .75); }
.u-toast.out { opacity: 0; transform: translateX(12px); }
@keyframes uToastIn { from { opacity: 0; transform: translateX(16px); } }
/* item / skill tooltip */
#tip { background: linear-gradient(180deg, #142a66, #091534); border: 1px solid var(--sx-line-au); border-radius: var(--sx-rm); box-shadow: 0 10px 28px rgba(0, 0, 0, .55); color: var(--sx-tx); animation: sxFade .12s; }
#tip b { color: var(--sx-gold3); }

/* new components */
/* segmented control: one choice of a few */
.sx-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 999px; background: var(--sx-well); border: 1px solid var(--sx-line); }
#pbody .sx-seg > button { flex: 1 1 auto; min-height: 34px; padding: 0 12px; border-radius: 999px; background: transparent; border: 1px solid transparent; box-shadow: none;
  color: var(--sx-tx2); font: 600 var(--sx-fs2) var(--sx-font); white-space: nowrap; }
#pbody .sx-seg > button.on { background: var(--sx-btn-au) !important; color: var(--sx-gold-ink) !important; border-color: #fff0b8 !important; box-shadow: 0 2px 8px rgba(255, 170, 40, .3) !important; }
#pbody .sx-seg > button img { width: 18px; height: 18px; vertical-align: -4px; margin-right: 3px; image-rendering: pixelated; }
/* on / off switch (a button: data-act toggles it, the knob slides) */
#pbody button.sx-sw { position: relative; flex: none; width: 58px; min-width: 58px; height: 32px; min-height: 32px; padding: 0; border-radius: 999px; background: #1a2a55; border: 1px solid var(--sx-line2); }
#pbody button.sx-sw::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(#e6ecff, #9fb0d8); box-shadow: 0 2px 4px rgba(0, 0, 0, .45); transition: left .16s var(--sx-ease); }
#pbody button.sx-sw.on { background: linear-gradient(90deg, #2a8a62, #39d68c) !important; border-color: #7dffbe !important; }
#pbody button.sx-sw.on::after { left: 29px; background: #fff; }
/* little round count / status badges */
.sx-pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font: 700 var(--sx-fs1) var(--sx-font); background: rgba(95, 150, 255, .18); color: var(--sx-tx2); border: 1px solid var(--sx-line); white-space: nowrap; }
.sx-pill.cy { color: #062430; background: linear-gradient(#9af0ff, #36c0ea); border-color: #c8f8ff; }
.sx-pill.au { color: var(--sx-gold-ink); background: var(--sx-btn-au); border-color: #fff0b8; }
.sx-pill.up { color: #04281a; background: linear-gradient(#a6ffd0, #3ad88a); border-color: #c9ffe2; }
.sx-pill.no { color: #dfe6ff; background: rgba(120, 130, 160, .3); }
.sx-pill.red { color: #fff; background: linear-gradient(#ff7b93, #d63358); border-color: #ffc0cc; }
/* bottom sheet inside a window (phones): slides up over the body */
.sx-sheet-x { position: absolute; right: 8px; top: 8px; z-index: 3; width: 40px !important; height: 40px !important; min-height: 40px !important; padding: 0 !important; border-radius: 50% !important; }
/* stat row with a big number and ▲▼ change */
.sx-kv { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 4px 8px; border-radius: var(--sx-rs); background: rgba(95, 150, 255, .07); font-size: var(--sx-fs2); }
.sx-kv > span { color: var(--sx-tx3); font-weight: 600; } .sx-kv > b { color: var(--sx-tx); font-variant-numeric: tabular-nums; }
.sx-kv > b em { font-style: normal; color: var(--sx-cyan); font-weight: 600; font-size: var(--sx-fs1); margin-left: 3px; }
.sx-divider { height: 14px; margin: 6px 0; background: url(assets/ui/v4/divider.webp) center / 100% 100% no-repeat; }
@media (prefers-reduced-motion: reduce) { #panel:not([hidden]) .win { animation: none; } }

/* tile marks (bag): ★ favourite top-left, ▲ better than worn bottom-right, padlock toggle bottom-left (act ilock) */
.u-slot.u-fav::after { content: '★'; position: absolute; left: 4px; top: 1px; z-index: 2; font-size: 12px; color: #ffd860; text-shadow: 0 1px 2px #000, 0 0 5px rgba(255, 200, 60, .8); }
.u-slot.u-up::after { content: '▲'; position: absolute; right: 4px; bottom: 2px; left: auto; top: auto; z-index: 2; font: 800 11px/1 var(--sx-font); color: var(--sx-up); text-shadow: 0 0 4px #000, 0 0 7px rgba(88, 240, 160, .9); }
.u-slot.u-no .u-ic { filter: grayscale(.85) brightness(.6); }
.u-slot.u-no.u-sel .u-ic, .u-slot.u-no:hover .u-ic { filter: grayscale(.5) brightness(.85); }
.u-slot .u-lkb { position: absolute; left: 1px; bottom: 1px; width: 18px; height: 20px; display: grid; place-items: center; z-index: 3; cursor: pointer; border-radius: 5px; }
.u-slot .u-lkb::after { content: ''; position: absolute; inset: -2px -4px -1px -1px; }
.u-slot .u-lkb svg { width: 11px; height: 13px; overflow: visible; }
.u-slot .u-lkb .sh { fill: none; stroke: rgba(220, 230, 255, .6); stroke-width: 1.6; }
.u-slot .u-lkb .bd { fill: rgba(6, 12, 32, .6); stroke: rgba(220, 230, 255, .6); stroke-width: 1; }
.u-slot .u-lkb .kh { fill: rgba(220, 230, 255, .6); }
.u-slot .u-lkb:not(.on) { opacity: .4; } .u-slot:hover .u-lkb:not(.on), .u-slot.u-sel .u-lkb:not(.on) { opacity: .9; }
.u-slot .u-lkb.on .sh { stroke: #ffd860; } .u-slot .u-lkb.on .bd { fill: #f0bd4c; stroke: #7a4e10; } .u-slot .u-lkb.on .kh { fill: #6a3e08; }
.u-slot .u-lkb.on { filter: drop-shadow(0 0 3px rgba(255, 210, 90, .85)) drop-shadow(0 1px 1px #000); }

/* ==========================================================================================================
   Character / inventory screen (.sx-cs) — windows 'bag' and 'equip'
   wide (>= 1000 px of window): worn | hero | grid or pieces | detail · mid (landscape phones, small PCs): icon column |
   (hero in the equip view) | grid | detail · narrow (upright phones): worn strip / paper doll on top, detail as a bottom sheet
   ========================================================================================================== */
#panel[data-kind="bag"] .win, #panel[data-kind="equip"] .win { width: min(1240px, calc(100vw - 24px)) !important; height: min(700px, calc(100vh - 20px)) !important; max-height: none !important; }
@media (min-width: 1600px) and (min-height: 900px) { #panel[data-kind="bag"] .win, #panel[data-kind="equip"] .win { width: 1420px !important; height: 820px !important; } }
#panel[data-kind="bag"] #pbody, #panel[data-kind="equip"] #pbody { position: relative; display: flex !important; overflow: hidden !important; padding: 10px 12px 12px !important; }
.sx-csw { flex: 1; min-width: 0; min-height: 0; display: flex; container-type: inline-size; }
.sx-cs { flex: 1; min-width: 0; min-height: 0; display: grid; gap: 12px; grid-template-columns: 214px 214px minmax(0, 1fr) 282px; grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "eq hero main det"; }
.sx-cs > section, .sx-cs > aside { min-width: 0; min-height: 0; }
/* worn column */
.sx-eqc { grid-area: eq; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; padding: 8px; border-radius: var(--sx-rm); background: var(--sx-card); border: 1px solid var(--sx-line); scrollbar-width: thin; }
.sx-eqc .u-h { margin: 0 2px 4px; }
.sx-eql { display: flex; flex-direction: column; gap: 4px; }
#pbody .sx-eqr { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; min-height: 54px; padding: 4px 6px; text-align: left;
  background: rgba(8, 18, 50, .45); border: 1px solid transparent; border-radius: var(--sx-rm); box-shadow: none; }
#pbody .sx-eqr:hover:not(:disabled) { background: rgba(63, 125, 255, .16); border-color: var(--sx-line2); filter: none; }
#pbody .sx-eqr.on { background: linear-gradient(90deg, rgba(255, 213, 106, .2), rgba(255, 213, 106, .04)); border-color: var(--sx-line-au); box-shadow: inset 3px 0 0 var(--sx-gold); }
.sx-eqr .t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sx-eqr .t small { font-size: var(--sx-fs1); color: var(--sx-tx3); }
.sx-eqr .t b { font-size: var(--sx-fs2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-eqr .t b.none { color: var(--sx-tx4); font-weight: 500; }
.sx-eqr .t em { font-style: normal; font-size: var(--sx-fs1); color: var(--sx-tx); font-weight: 700; } .sx-eqr .t em i { font-style: normal; color: var(--sx-tx3); font-weight: 500; }
.sx-eqr.vac .u-slot { opacity: .8; }
/* hero column: the hero on a glowing pedestal, power, key stats, actions, loadouts */
.sx-hero { grid-area: hero; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; scrollbar-width: thin; }
.sx-stage { position: relative; flex: none; height: 196px; display: grid; place-items: end center; border-radius: var(--sx-rl); cursor: pointer; overflow: hidden;
  background: radial-gradient(70% 60% at 50% 72%, rgba(95, 225, 255, .28), rgba(95, 225, 255, 0) 70%), radial-gradient(100% 80% at 50% 0%, rgba(63, 125, 255, .3), rgba(63, 125, 255, 0) 70%), rgba(4, 10, 30, .5);
  border: 1px solid var(--sx-line); }
.sx-stage .ped { position: absolute; left: 50%; bottom: 6px; width: 190px; height: 74px; transform: translateX(-50%); pointer-events: none;
  background: url(assets/ui/v4/pedestal.webp) center / contain no-repeat, radial-gradient(closest-side, rgba(95, 225, 255, .5), rgba(63, 125, 255, .18) 60%, transparent); border-radius: 50%; }
.sx-stage canvas.hero2 { position: relative; width: 176px; height: 176px; margin-bottom: 14px; image-rendering: auto; }
.sx-stage .turn { position: absolute; right: 8px; top: 6px; font-size: 14px; color: var(--sx-tx3); }
.sx-id { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.sx-id b { font-size: var(--sx-fs4); color: var(--sx-tx); } .sx-id span { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.sx-power { display: flex; align-items: baseline; justify-content: center; gap: 8px; padding: 6px 10px; border-radius: var(--sx-rm); background: linear-gradient(90deg, transparent, rgba(255, 213, 106, .14), transparent);
  border-top: 1px solid var(--sx-line-au); border-bottom: 1px solid var(--sx-line-au); }
.sx-power small { color: var(--sx-gold); font-weight: 600; font-size: var(--sx-fs2); }
.sx-power b { font: 800 26px/1.1 var(--sx-font); background: linear-gradient(#fff6cf, #ffc84a 55%, #e99a2c); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 1px 0 #000); }
.sx-pstats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.sx-sets { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.sx-eqacts { display: grid; grid-template-columns: 1fr; gap: 6px; }
.sx-pre { gap: 4px; align-items: center; }
.sx-pre > small { grid-column: 1 / -1; color: var(--sx-tx3); font-size: var(--sx-fs1); }
.sx-pre { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sx-pre .pr { display: grid; grid-template-columns: minmax(0, 1fr) 24px; gap: 2px; }
#pbody .sx-pre .pr .u-btn { padding: 0 4px; min-width: 0; min-height: 36px; font-size: var(--sx-fs1); white-space: nowrap; }
#pbody .sx-pre .pr .u-btn:last-child { padding: 0; font-size: var(--sx-fs1); }
/* middle: category tabs, search + sort, the big tile grid, the footer */
.sx-main { grid-area: main; display: flex; flex-direction: column; gap: 8px; }
.sx-cats { display: flex; gap: 4px; flex-wrap: wrap; padding: 3px; border-radius: var(--sx-rm); background: var(--sx-well); border: 1px solid var(--sx-line); }
#pbody .sx-cats button { flex: 1 1 0; min-width: 44px; min-height: 40px; padding: 0 4px; display: flex; align-items: center; justify-content: center; gap: 4px;
  background: transparent; border: 1px solid transparent; border-radius: 9px; box-shadow: none; color: var(--sx-tx3); }
#pbody .sx-cats button.on { background: linear-gradient(180deg, rgba(255, 213, 106, .3), rgba(255, 213, 106, .1)); border-color: var(--sx-line-au); color: var(--sx-gold3); box-shadow: 0 0 10px rgba(255, 205, 96, .2); }
.sx-cats i { font-style: normal; display: grid; place-items: center; } .sx-cats i .uic { width: 22px; height: 22px; }
.sx-cats span { display: none; font-size: var(--sx-fs1); font-weight: 600; white-space: nowrap; } #pbody .sx-cats button.on { flex: 2 0 auto; } .sx-cats button.on span { display: inline; } .sx-cats em { font-style: normal; font-size: var(--sx-fs1); font-weight: 700; color: var(--sx-tx3); }
#pbody .sx-cats button.on em { color: var(--sx-gold); }
.sx-tools { display: flex; gap: 6px; align-items: center; }
.sx-tools input { flex: 1; min-width: 80px; height: 38px; padding: 0 12px; border-radius: 999px; background: var(--sx-well); border: 1px solid var(--sx-line); color: var(--sx-tx); font: 500 var(--sx-fs2) var(--sx-font); }
.sx-tools input:focus { outline: none; border-color: var(--sx-line-au); }
#pbody .sx-tools .sx-seg > button { min-height: 32px; padding: 0 9px; }
.sx-slotf { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; } #pbody .sx-slotf button { flex: none; min-height: 32px; padding: 0 10px; border-radius: 999px; font-size: var(--sx-fs1); }
.sx-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, 64px); grid-auto-rows: 64px; gap: 8px; align-content: start; justify-content: center;
  padding: 8px; border-radius: var(--sx-rm); background: rgba(3, 8, 26, .35); border: 1px solid var(--sx-line); scrollbar-width: thin; }
.sx-grid .u-slot { width: 64px; height: 64px; }
.sx-foot { display: flex; align-items: center; gap: 12px; font-size: var(--sx-fs1); color: var(--sx-tx3); flex-wrap: wrap; }
.sx-foot .cap { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 150px; } .sx-foot .cap .u-bar { flex: 1; } .sx-foot small { font-size: inherit; }
.sx-foot b { color: var(--sx-tx); } .sx-foot .coin b { color: var(--sx-gold3); }
/* equip view: the pieces for the chosen slot, best first */
.sx-cands { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; padding-right: 2px; }
.sx-cand { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 9px; border-radius: var(--sx-rm); cursor: pointer;
  background: var(--sx-card); border: 1px solid var(--sx-line); transition: border-color .12s, background .12s; }
.sx-cand:hover { border-color: var(--sx-line2); background: var(--sx-card2); }
.sx-cand.on { border-color: var(--sx-gold); box-shadow: 0 0 0 1px var(--sx-gold), 0 0 14px rgba(255, 205, 96, .3); }
.sx-cand.lk { opacity: .7; }
.sx-cand .t { min-width: 0; } .sx-cand .nm { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; } .sx-cand .nm b { font-size: var(--sx-fs3); }
.sx-cand .lk { font-size: var(--sx-fs1); color: var(--sx-down); } .sx-cand .df { font-size: var(--sx-fs1); line-height: 1.5; color: var(--sx-tx2); }
.sx-cand .mv { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; } .sx-cand .mv b { font-size: var(--sx-fs5); color: var(--sx-tx); } .sx-cand .mv small { font-size: 10.5px; color: var(--sx-tx3); }
/* detail panel */
.sx-det { grid-area: det; position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--sx-rl); overflow: hidden;
  background: radial-gradient(100% 50% at 70% 0%, rgba(95, 225, 255, .14), transparent 70%), var(--sx-card); border: 1px solid var(--sx-line2); }
.sx-det > .sx-sheet-x { display: none; }
.sx-dscroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; padding-right: 2px; }
.sx-det > .sx-ih, .sx-det > .sx-vs { flex: none; }
.sx-ih { display: flex; gap: 12px; align-items: center; }
.sx-ih .t { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sx-ih .t b { font: 700 var(--sx-fs4)/1.25 var(--sx-font); overflow-wrap: anywhere; }
.sx-ih .t small { font-size: var(--sx-fs1); color: var(--sx-tx3); }
.sx-big { display: flex; align-items: baseline; gap: 8px; padding: 2px 0 4px; border-bottom: 1px solid var(--sx-line); }
.sx-big b { font: 800 var(--sx-fs7)/1 var(--sx-font); color: var(--sx-tx); text-shadow: 0 0 18px rgba(95, 225, 255, .35); }
.sx-big span { font-size: var(--sx-fs2); color: var(--sx-tx2); font-weight: 600; }
.sx-lines { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; font-size: var(--sx-fs2); }
.sx-lines span { display: flex; justify-content: space-between; color: var(--sx-tx2); } .sx-lines span b { color: var(--sx-up); font-weight: 700; }
.sx-opt { color: #ffd88a; font-size: var(--sx-fs2); font-weight: 600; }
.sx-sock { display: flex; gap: 6px; flex-wrap: wrap; } .sx-sock span { font-size: var(--sx-fs1); padding: 2px 8px; border-radius: 6px; background: rgba(200, 108, 255, .14); border: 1px solid rgba(200, 108, 255, .4); }
.sx-sock span.free { background: transparent; border-style: dashed; color: var(--sx-tx3); }
.sx-req { font-size: var(--sx-fs1); color: var(--sx-tx3); line-height: 1.5; } .sx-req .no { color: var(--sx-down); } .sx-req .ok { color: var(--sx-up); }
.sx-desc { margin: 0; font-size: var(--sx-fs2); color: var(--sx-tx2); line-height: 1.55; }
.sx-cmp { padding: 8px 10px; border-radius: var(--sx-rm); background: rgba(3, 8, 26, .45); border: 1px solid var(--sx-line); }
.sx-cmp .hd { display: flex; flex-direction: column; gap: 2px; } .sx-cmp .hd small { color: var(--sx-tx3); font-size: var(--sx-fs1); }
.sx-cmp .vd { font-size: var(--sx-fs3); } .sx-cmp .vd.up { color: var(--sx-up); } .sx-cmp .vd.down, .sx-cmp .vd.no { color: var(--sx-down); } .sx-cmp .vd.eq { color: var(--sx-tx2); }
.sx-cmp .diffs { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: var(--sx-fs1); color: var(--sx-tx2); }
.sx-acts { display: flex; flex-wrap: wrap; gap: 6px; } #pbody .sx-acts .u-btn { flex: 1 1 auto; min-height: 36px; padding: 0 10px; font-size: var(--sx-fs1); }
.sx-do { flex: none; display: flex; gap: 8px; align-items: center; padding-top: 8px; border-top: 1px solid var(--sx-line); }
#pbody .sx-do .u-btn { flex: 1; min-height: 46px; font-size: var(--sx-fs4); border-radius: var(--sx-rm); }
.sx-where { flex: 1; font-size: var(--sx-fs1); color: var(--sx-tx3); }
.sx-hint { font-size: var(--sx-fs1); color: var(--sx-tx3); text-align: center; }
.sx-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 18px 10px; text-align: center; color: var(--sx-tx3); }
.sx-empty i { font-style: normal; font-size: 30px; opacity: .55; } .sx-empty i .uic { width: 46px; height: 46px; }
.sx-empty b { color: var(--sx-tx2); font-size: var(--sx-fs4); } .sx-empty small { font-size: var(--sx-fs1); line-height: 1.6; }
/* compare worn -> new (equip view) */
.sx-vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: start; }
.sx-vsi { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; min-width: 0; }
.sx-vsi small { font-size: var(--sx-fs1); color: var(--sx-tx3); } .sx-vsi b { font-size: var(--sx-fs1); overflow-wrap: anywhere; line-height: 1.3; }
.sx-vs .arr { align-self: center; color: var(--sx-gold); font-size: 20px; }
.sx-dg { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; align-content: start; }
.sx-dg > div { display: grid; grid-template-columns: 1fr auto auto auto auto; gap: 3px; align-items: baseline; padding: 4px 6px; border-radius: var(--sx-rs); background: rgba(95, 150, 255, .07); font-size: var(--sx-fs1); }
.sx-dg span { color: var(--sx-tx3); font-weight: 600; } .sx-dg b { font-variant-numeric: tabular-nums; } .sx-dg i { color: var(--sx-tx4); font-style: normal; }
.sx-dg .d-eq { opacity: .5; } .sx-dg .d-up { background: rgba(88, 240, 160, .1); } .sx-dg .d-dn { background: rgba(255, 111, 134, .1); }
@container (min-width: 1300px) { .sx-cs { grid-template-columns: 240px 250px minmax(0, 1fr) 320px; } .sx-stage { height: 230px; } .sx-stage canvas.hero2 { width: 200px; height: 200px; } }
/* mid: the worn column becomes an icon column; the hero shows only in the equip view */
@container (max-width: 999px) {
  .sx-cs { gap: 8px; grid-template-columns: 58px minmax(0, 1fr) 262px; grid-template-areas: "eq main det"; }
  .sx-cs.m-eq { grid-template-columns: 58px 172px minmax(0, 1fr) 246px; grid-template-areas: "eq hero main det"; }
  .sx-cs.m-bag .sx-hero { display: none; }
  .sx-eqc { padding: 4px; gap: 4px; } .sx-eqc .u-h { display: none; }
  #pbody .sx-eqr { grid-template-columns: 46px; justify-content: center; padding: 2px; min-height: 50px; position: relative; }
  .sx-eqr .t { display: none; } .sx-eqr .sx-pill { position: absolute; right: -3px; bottom: -3px; padding: 0 4px; font-size: var(--sx-fs1); z-index: 3; }
  .sx-stage { height: 150px; } .sx-stage canvas.hero2 { width: 132px; height: 132px; margin-bottom: 10px; } .sx-stage .ped { width: 150px; height: 58px; }
  .sx-pstats { grid-template-columns: 1fr; } .sx-power b { font-size: 21px; }
  .sx-grid { grid-template-columns: repeat(auto-fill, 54px); grid-auto-rows: 54px; gap: 6px; padding: 6px; } .sx-grid .u-slot { width: 54px; height: 54px; }
  .sx-det { padding: 10px; } .sx-big b { font-size: var(--sx-fs6); }
}
/* narrow (upright phones): worn strip / paper doll on top, the list under it, the detail as a sheet from the bottom */
@container (max-width: 640px) {
  .sx-csw { display: block; overflow-y: auto; overscroll-behavior: contain; }
  .sx-cs, .sx-cs.m-eq { display: flex; flex-direction: column; gap: 8px; height: auto; }
  .sx-cs > section, .sx-cs > aside:not(.sheet) { min-height: auto; }
  .sx-cs.m-bag .sx-eqc { flex: none; flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 4px; }
  .sx-cs.m-bag .sx-eql { flex-direction: row; } #pbody .sx-cs.m-bag .sx-eqr { width: 52px; }
  .sx-cs.m-eq { display: grid; grid-template-columns: 54px minmax(0, 1fr) 54px; grid-template-rows: auto auto; grid-template-areas: "a hero b" "main main main"; align-content: start; }
  .sx-cs.m-eq .sx-eqc { display: contents; } .sx-cs.m-eq .sx-eqc .u-h { display: none; }
  .sx-cs.m-eq .sx-eql.a { grid-area: a; } .sx-cs.m-eq .sx-eql.b { grid-area: b; }
  .sx-cs.m-eq .sx-hero { overflow: visible; } .sx-cs.m-eq .sx-pstats { grid-template-columns: 1fr 1fr; }
  .sx-main { flex: none; } .sx-grid, .sx-cands { flex: none; overflow: visible; max-height: none; }
  .sx-grid { grid-template-columns: repeat(auto-fill, 56px); grid-auto-rows: 56px; gap: 6px; padding: 6px; } .sx-grid .u-slot { width: 56px; height: 56px; }
  .sx-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } #pbody .sx-cats button { flex: none; min-width: 52px; }
  .sx-tools { flex-wrap: wrap; } .sx-tools input { min-width: 100%; }
  .sx-det { display: none; }
  .sx-det.sheet { display: flex; position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; max-height: 72vh; border-radius: var(--sx-rx) var(--sx-rx) 0 0; padding: 14px 14px calc(12px + var(--sb, 0px));
    background: linear-gradient(180deg, #14306e, #0a1636); box-shadow: 0 -12px 40px rgba(0, 0, 0, .6); animation: sxUp .2s var(--sx-ease); }
  .sx-det.sheet > .sx-sheet-x { display: grid; place-items: center; }
  .sx-det.sheet.fresh { pointer-events: none; }
}
@keyframes sxUp { from { transform: translateY(40px); opacity: 0; } }
/* landscape phones: tighter rows, the footer keeps only the capacity and the gold */
@media (max-height: 500px) {
  #panel[data-kind="bag"] #pbody, #panel[data-kind="equip"] #pbody { padding: 6px 8px 8px !important; }
  .sx-main { gap: 5px; } .sx-tools input { height: 34px; } #pbody .sx-cats button { min-height: 36px; }
  .sx-foot > span:not(.coin) { display: none; }
  .sx-hero { gap: 5px; } .sx-id, .sx-sets, .sx-pre > small { display: none; }
  #pbody .sx-do .u-btn { min-height: 42px; font-size: var(--sx-fs3); }
  .sx-ih .u-slot.u-xl { width: 64px; height: 64px; } .sx-big { padding: 0 0 2px; }
}

/* landscape phones: the hub windows drop the title row (the tab strip already names the window) and keep the ✕ at the tab row's end */
@media (max-height: 500px) {
  #panel:is([data-kind="bag"], [data-kind="equip"], [data-kind="stats"], [data-kind="skills"], [data-kind="cards"]) .win > header { position: absolute; right: 4px; top: 2px; z-index: 3; padding: 0 !important; background: none; border: 0; }
  #panel:is([data-kind="bag"], [data-kind="equip"], [data-kind="stats"], [data-kind="skills"], [data-kind="cards"]) .win > header h2 { display: none; }
  #panel:is([data-kind="bag"], [data-kind="equip"], [data-kind="stats"], [data-kind="skills"], [data-kind="cards"]) .win > header::after { display: none; }
  #panel:is([data-kind="bag"], [data-kind="equip"], [data-kind="stats"], [data-kind="skills"], [data-kind="cards"]) #hubTabs { padding-right: 52px; padding-left: 10px; }
  #panel:is([data-kind="bag"], [data-kind="equip"], [data-kind="stats"], [data-kind="skills"], [data-kind="cards"]) #hubTabs button { min-height: 44px; }
}

/* ==========================================================================================================
   Skill cards (.sx-sk) — window 'skills'
   header: job chips (tier dots, unspent points) · the points box (next point = Job EXP bar) · tools
   body: advice strip + card grids by group | detail column (PC / tablet) or a bottom sheet (phones) · footer: staged points
   ========================================================================================================== */
#panel[data-kind="skills"] .win { width: min(1200px, calc(100vw - 24px)) !important; height: min(700px, calc(100vh - 20px)) !important; max-height: none !important; }
@media (min-width: 1600px) and (min-height: 900px) { #panel[data-kind="skills"] .win { width: 1380px !important; height: 820px !important; } }
#panel[data-kind="skills"] #pbody { position: relative; display: flex !important; flex-direction: column; overflow: hidden !important; padding: 10px 12px 10px !important; }
.sx-sk { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.sx-skh { flex: none; display: flex; align-items: center; gap: 10px; }
.sx-jobs { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
#pbody .sx-jobs button { flex: none; display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 12px 0 8px; border-radius: 999px; background: var(--sx-card); border: 1px solid var(--sx-line); box-shadow: var(--sx-in); }
#pbody .sx-jobs button .em { display: grid; place-items: center; width: 26px; height: 26px; font-size: 13px; color: var(--sx-tx3); background: radial-gradient(circle, #24459a, #0e1e4c);
  border: 1px solid var(--sx-line2); transform: rotate(45deg); border-radius: 6px; }
#pbody .sx-jobs button .jn { display: flex; flex-direction: column; align-items: flex-start; font: 600 var(--sx-fs3)/1.15 var(--sx-font); }
.sx-jobs .dots { display: flex; gap: 3px; margin-top: 2px; } .sx-jobs .dots i { width: 5px; height: 5px; transform: rotate(45deg); background: rgba(255, 255, 255, .18); }
.sx-jobs .dots i.on { background: var(--sx-gold); box-shadow: 0 0 4px rgba(255, 205, 96, .8); }
#pbody .sx-jobs button.on { background: linear-gradient(180deg, rgba(255, 213, 106, .26), rgba(255, 213, 106, .08)); border-color: var(--sx-gold); color: var(--sx-gold3); box-shadow: 0 0 14px rgba(255, 205, 96, .25); }
#pbody .sx-jobs button.on .em { color: var(--sx-gold-ink); background: var(--sx-btn-au); border-color: #fff0b8; }
#pbody .sx-jobs button.off { opacity: .55; }
.sx-jobs .sp { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; font-size: var(--sx-fs1); color: #04281a; background: linear-gradient(#a6ffd0, #3ad88a); }
.sx-pts { flex: none; display: flex; flex-direction: column; gap: 3px; min-width: 170px; padding: 6px 12px; border-radius: var(--sx-rm); background: rgba(3, 8, 26, .5); border: 1px solid var(--sx-line); }
.sx-pts .r { display: flex; align-items: center; gap: 8px; } .sx-pts .gem { width: 14px; height: 14px; transform: rotate(45deg); background: linear-gradient(135deg, #b6f3ff, #3b8fe0); box-shadow: 0 0 8px rgba(95, 225, 255, .8); }
.sx-pts b { font: 800 22px/1 var(--sx-font); color: var(--sx-tx); } .sx-pts .r span { font-size: var(--sx-fs2); color: var(--sx-tx2); font-weight: 600; }
.sx-pts.has { border-color: rgba(95, 225, 255, .6); box-shadow: 0 0 14px rgba(95, 225, 255, .22); } .sx-pts.has b { color: var(--sx-cyan); text-shadow: 0 0 10px rgba(95, 225, 255, .7); }
.sx-pts .nx small { font-size: var(--sx-fs1); color: var(--sx-tx3); } .sx-pts .u-bar { height: 5px; }
.sx-sktools { flex: none; display: flex; gap: 6px; } #pbody .sx-sktools .u-btn { min-height: 40px; padding: 0 12px; font-size: var(--sx-fs2); }
.sx-skb { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 12px; }
.sx-sk:not(.wide) .sx-skb { grid-template-columns: minmax(0, 1fr); }
.sx-skl { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; scrollbar-width: thin; }
.sx-skl > .u-h { margin: 6px 0 0; }
/* advice strip */
.sx-guide { flex: none; padding: 8px 10px; border-radius: var(--sx-rm); background: linear-gradient(90deg, rgba(255, 213, 106, .14), rgba(63, 125, 255, .1)); border: 1px solid var(--sx-line-au); }
.sx-guide .gh { display: flex; align-items: center; gap: 10px; } .sx-guide .gh b { flex: none; color: var(--sx-gold3); font-size: var(--sx-fs3); }
.sx-guide .gh .sty { flex: 1; min-width: 0; font-size: var(--sx-fs1); color: var(--sx-tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-guide .gh .sk4-more { margin-left: auto; }
.sx-guide.open .gh .sty { white-space: normal; }
#pbody .sx-guide .sk4-more { flex: none; min-height: 32px; padding: 0 10px; font-size: var(--sx-fs1); background: transparent; border-color: var(--sx-line); }
.sx-guide .chain { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 6px; } .sx-guide .chain > i { color: var(--sx-tx4); font-style: normal; }
#pbody .sx-guide .ci { width: 36px; height: 36px; min-height: 36px; padding: 2px; border-radius: 50%; background: #0c1a44; border: 1px solid var(--sx-line2); }
#pbody .sx-guide .ci.own { border-color: var(--sx-gold); } .sx-guide .ci img { width: 100%; height: 100%; border-radius: 50%; image-rendering: pixelated; }
#pbody .sx-guide .gh .u-btn { flex: none; min-height: 38px; font-size: var(--sx-fs2); }
.sx-guide .gl { margin: 8px 0 0; padding-left: 18px; font-size: var(--sx-fs1); color: var(--sx-tx2); line-height: 1.6; }
.r-first { color: var(--sx-up); font-weight: 700; } .r-later { color: var(--sx-warn); font-weight: 700; } .r-skip { color: var(--sx-tx3); font-weight: 700; }
/* the card grid */
.sx-skg { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 8px; }
.sx-skc { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 9px 9px 8px; border-radius: 14px; background: var(--sx-card); border: 1px solid var(--sx-line);
  box-shadow: var(--sx-in); transition: border-color .15s, box-shadow .15s, transform .1s; }
.sx-skc:hover { border-color: var(--sx-line2); }
#pbody .sx-skc .main { display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "ic hd" "lv lv" "meta meta"; gap: 6px 8px; align-items: center; width: 100%; min-height: 0;
  padding: 0; background: none; border: 0; box-shadow: none; text-align: left; filter: none; transform: none; }
.sx-skic { grid-area: ic; position: relative; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%;
  background: url(assets/ui/v4/skill-card.webp) center / 100% no-repeat, radial-gradient(circle, #23468f, #0b1840 70%); }
.sx-skic img { width: 40px; height: 40px; border-radius: 50%; image-rendering: pixelated; object-fit: cover; }
.sx-skic u { position: absolute; left: -2px; top: -2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 6px; font: 700 10px/18px var(--sx-font); text-decoration: none; text-align: center;
  color: var(--sx-gold-ink); background: var(--sx-btn-au); box-shadow: 0 1px 3px #000; z-index: 2; }
.sx-skic .lki { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 18px; border-radius: 50%; background: rgba(4, 8, 22, .55); }
.sx-skic.drag { cursor: grab; }
.sx-skc .hd { grid-area: hd; min-width: 0; display: flex; flex-direction: column; } .sx-skc .hd b { font: 700 var(--sx-fs3)/1.25 var(--sx-font); color: var(--sx-tx); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sx-skc .hd .sub { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; } .sx-skc .hd .sub i { font-style: normal; font-size: var(--sx-fs1); color: var(--sx-tx3); }
.sk4-bdg { font-style: normal; font-size: var(--sx-fs1); font-weight: 700; padding: 0 6px; border-radius: 999px; }
.sk4-bdg.r-first { color: #04281a; background: linear-gradient(#a6ffd0, #3ad88a); } .sk4-bdg.r-later { color: #2b1904; background: linear-gradient(#ffe0a0, #f2a93b); } .sk4-bdg.r-skip { color: var(--sx-tx2); background: rgba(255, 255, 255, .1); }
.sx-skc .lv { grid-area: lv; display: flex; align-items: center; gap: 8px; min-width: 0; }
.sx-skc .lv .n { font-size: var(--sx-fs1); color: var(--sx-tx3); white-space: nowrap; } .sx-skc .lv .n b { font-size: var(--sx-fs4); color: var(--sx-tx); } .sx-skc .lv .n em { font-style: normal; color: var(--sx-up); font-weight: 700; margin-left: 2px; }
.sx-skc .pips { flex: 1; display: flex; gap: 2px; min-width: 0; } .sx-skc .pips i { flex: 1; height: 6px; background: rgba(255, 255, 255, .12); border-radius: 1px; transform: skewX(-20deg); }
.sx-skc .pips i.on { background: var(--sx-gold); box-shadow: 0 0 4px rgba(255, 205, 96, .7); } .sx-skc .pips i.sg { background: var(--sx-up); box-shadow: 0 0 4px rgba(88, 240, 160, .8); }
.sx-skc .meta { grid-area: meta; display: flex; align-items: center; gap: 10px; font-size: var(--sx-fs1); color: var(--sx-tx2); font-weight: 600; min-width: 0; }
.sx-skc .meta .pas { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--sx-cyan); }
.sx-skc .stt { margin-left: auto; flex: none; font-size: var(--sx-fs1); padding: 0 7px; }
.sx-skc > .lk { font-size: var(--sx-fs1); color: var(--sx-down); line-height: 1.4; }
.sk4-link { color: var(--sx-cyan); text-decoration: underline; cursor: pointer; }
.sx-skc .pm { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 6px; }
#pbody .sx-skc .pm .u-btn { min-height: 34px; padding: 0; font-size: 18px; line-height: 1; }
/* card states */
.sx-skc.ready { border-color: rgba(95, 225, 255, .65); box-shadow: var(--sx-in), 0 0 14px rgba(95, 225, 255, .22); }
.sx-skc.ready .sx-skic { box-shadow: 0 0 12px rgba(95, 225, 255, .55); }
.sx-skc.max { border-color: rgba(255, 213, 106, .6); } .sx-skc.max .sx-skic { box-shadow: 0 0 12px rgba(255, 196, 70, .55); }
.sx-skc.lock { background: rgba(10, 16, 36, .6); } .sx-skc.lock .sx-skic img { filter: grayscale(1) brightness(.55); } .sx-skc.lock .hd b { color: var(--sx-tx3); }
.sx-skc:not(.own):not(.lock):not(.add) .sx-skic img { filter: grayscale(.5) brightness(.8); }
.sx-skc.add { border-color: rgba(88, 240, 160, .7); }
.sx-skc.sel { border-color: var(--sx-gold3); box-shadow: 0 0 0 2px var(--sx-gold), 0 0 18px rgba(255, 205, 96, .35); }
.sx-skc.pulse { animation: sxPulse .6s var(--sx-ease); } @keyframes sxPulse { 40% { transform: scale(1.03); box-shadow: 0 0 22px rgba(95, 225, 255, .7); } }
/* detail */
.sx-skd { min-height: 0; display: flex; flex-direction: column; padding: 12px; border-radius: var(--sx-rl); border: 1px solid var(--sx-line2);
  background: radial-gradient(100% 45% at 50% 0%, rgba(95, 225, 255, .16), transparent 70%), var(--sx-card); }
.sx-skd > .sx-sheet-x { display: none; }
.sx-skd .sx-dscroll { gap: 10px; }
.sx-skdh { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; }
.sx-skdh canvas { width: 96px; height: 96px; border-radius: var(--sx-rm); background: radial-gradient(ellipse at 50% 85%, rgba(95, 225, 255, .3), transparent 65%), rgba(3, 8, 26, .55); border: 1px solid var(--sx-line); }
.sx-skdh .sx-skic { grid-area: auto; } .sx-skdh .sx-skic.big { width: 72px; height: 72px; } .sx-skdh .sx-skic.big img { width: 52px; height: 52px; }
.sx-skdh.sm { grid-template-columns: 72px minmax(0, 1fr); }
.sx-skdh .t { display: flex; flex-direction: column; gap: 4px; min-width: 0; } .sx-skdh .t > b { font: 700 var(--sx-fs5)/1.2 var(--sx-font); color: var(--sx-gold3); }
.sx-skdh .chips { display: flex; flex-wrap: wrap; gap: 4px; } .sx-skdh .lvl { font-size: var(--sx-fs2); color: var(--sx-tx3); } .sx-skdh .lvl b { font-size: var(--sx-fs4); color: var(--sx-tx); } .sx-skdh .lvl em { font-style: normal; color: var(--sx-up); }
.sx-cost { display: flex; gap: 6px; } .sx-cost span { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 5px 4px; border-radius: var(--sx-rs); background: rgba(3, 8, 26, .5); border: 1px solid var(--sx-line); }
.sx-cost small { font-size: var(--sx-fs1); color: var(--sx-tx3); } .sx-cost b { font-size: var(--sx-fs3); color: var(--sx-tx); }
.sx-skdesc { margin: 0; font-size: var(--sx-fs2); line-height: 1.6; color: var(--sx-tx2); }
.sk4-why { font-size: var(--sx-fs1); padding: 6px 8px; border-radius: var(--sx-rs); background: rgba(3, 8, 26, .45); color: var(--sx-tx2); line-height: 1.5; }
.sk4-why b { margin-right: 4px; } .sk4-why.r-first b { color: var(--sx-up); } .sk4-why.r-later b { color: var(--sx-warn); } .sk4-why.r-skip b { color: var(--sx-tx3); }
.sx-num { width: 100%; border-collapse: collapse; font-size: var(--sx-fs2); } .sx-num th { font-size: var(--sx-fs1); color: var(--sx-tx3); font-weight: 600; text-align: right; padding: 0 6px 4px; }
.sx-num td { padding: 4px 6px; border-bottom: 1px solid var(--sx-line); text-align: right; font-variant-numeric: tabular-nums; } .sx-num td:first-child { text-align: left; color: var(--sx-tx3); } .sx-num td.nx { color: var(--sx-up); font-weight: 700; }
.sx-req2 { display: flex; flex-wrap: wrap; gap: 6px; font-size: var(--sx-fs1); } .sx-req2 span { padding: 2px 8px; border-radius: 999px; }
.sx-req2 .ok { color: var(--sx-up); background: rgba(88, 240, 160, .1); } .sx-req2 .no { color: var(--sx-down); background: rgba(255, 111, 134, .1); }
.sk4-off { font-size: var(--sx-fs1); color: var(--sx-warn); }
.sk4-slots small { color: var(--sx-tx3); font-size: var(--sx-fs1); } .sk4-slots > div { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; margin-top: 5px; }
#pbody .sk4-slots button { position: relative; min-height: 40px; padding: 0; display: grid; place-items: center; border-radius: 9px; background: rgba(3, 8, 26, .55); border: 1px dashed var(--sx-line2); }
#pbody .sk4-slots button.on { border: 1px solid var(--sx-gold); box-shadow: 0 0 10px rgba(255, 205, 96, .4); }
.sk4-slots button img { width: 28px; height: 28px; image-rendering: pixelated; } .sk4-slots button u { position: absolute; left: 3px; top: 1px; font: 700 9.5px var(--sx-font); text-decoration: none; color: var(--sx-gold); }
#pbody .sk4-slots button.sk4-over, #skills .sk.sk4-over { outline: 2px solid var(--sx-cyan); outline-offset: 1px; }
.sk4-ghost { position: fixed; z-index: 90; width: 44px; height: 44px; margin: -22px 0 0 -22px; pointer-events: none; border-radius: 50%; box-shadow: 0 0 16px rgba(95, 225, 255, .8); }
.sk4-ghost img { width: 100%; height: 100%; border-radius: 50%; image-rendering: pixelated; }
body.sk4-dragging #skills .sk { outline: 1px dashed rgba(95, 225, 255, .55); }
/* footer */
.sx-skf { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--sx-rm); background: rgba(3, 8, 26, .55); border: 1px solid var(--sx-line); }
.sx-skf.on { border-color: rgba(88, 240, 160, .6); background: linear-gradient(90deg, rgba(88, 240, 160, .12), rgba(3, 8, 26, .55)); }
.sx-skf .fi { flex: 1; min-width: 0; font-size: var(--sx-fs2); color: var(--sx-tx2); } .sx-skf .fi b { color: var(--sx-up); font-size: var(--sx-fs4); }
#pbody .sx-skf .u-btn { min-height: 42px; } #pbody .sx-skf [data-act="skapply2"] { min-width: 140px; }
/* combo editor inside the skill window */
.sx-sk.cbmode > .cbed { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
/* phones: two cards a row, the detail slides up as a sheet; landscape: one compact header row */
@media (max-width: 640px) {
  .sx-skh { flex-wrap: wrap; } .sx-jobs { flex: 1 1 100%; order: 1; } .sx-pts { order: 2; flex: 1; min-width: 0; } .sx-sktools { order: 3; }
  .sx-skg { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .sx-skc .meta { flex-wrap: wrap; gap: 4px 8px; } #pbody .sx-skc .main { grid-template-columns: 44px minmax(0, 1fr); } .sx-skic { width: 44px; height: 44px; } .sx-skic img { width: 32px; height: 32px; }
  .sx-guide .gh .sty { display: none; } .sx-guide .gh { flex-wrap: wrap; } #pbody .sx-guide .gh .u-btn { flex: 1 1 100%; }
}
.sx-skd.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; max-height: 76%; border-radius: var(--sx-rx) var(--sx-rx) 0 0; padding: 14px 14px calc(12px + var(--sb, 0px));
  background: linear-gradient(180deg, #14306e, #0a1636); box-shadow: 0 -12px 40px rgba(0, 0, 0, .6); animation: sxUp .2s var(--sx-ease); }
.sx-skd.sheet > .sx-sheet-x { display: grid; place-items: center; }
@media (max-height: 500px) {
  #panel[data-kind="skills"] #pbody { padding: 6px 8px 6px !important; gap: 6px; }
  .sx-sk { gap: 6px; } .sx-skh { gap: 6px; }
  #pbody .sx-jobs button { min-height: 40px; } .sx-pts { min-width: 0; padding: 3px 10px; } .sx-pts .nx { display: none; } .sx-pts b { font-size: 18px; }
  #pbody .sx-sktools .u-btn { padding: 0 8px; }
  .sx-guide { padding: 5px 8px; } .sx-guide .chain { display: none; } .sx-guide.open .chain { display: flex; }
  .sx-skb { grid-template-columns: minmax(0, 1fr) 272px; gap: 8px; } .sx-skd { padding: 8px; } .sx-skdh { grid-template-columns: 64px minmax(0, 1fr); gap: 8px; } .sx-skdh canvas { width: 64px; height: 64px; }
  .sx-skg { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
  .sx-skc { padding: 6px 7px; gap: 4px; } .sx-skic { width: 48px; height: 48px; } .sx-skic img { width: 34px; height: 34px; } #pbody .sx-skc .main { grid-template-columns: 48px minmax(0, 1fr); }
  .sx-skd.sheet { max-height: 88%; }
  .sx-skf { padding: 4px 8px; } .sx-skf .fi { font-size: var(--sx-fs1); } #pbody .sx-skf .u-btn { min-height: 40px; }
}
/* landscape phones: the footer moves under the detail column, the guide is one line (it took a third of the height) */
@media (max-height: 500px) {
  .sx-sk.wide:not(.cbmode) { display: grid; grid-template-columns: minmax(0, 1fr) 272px; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "h h" "l d" "l f"; }
  .sx-sk.wide .sx-skh { grid-area: h; } .sx-sk.wide .sx-skb { display: contents; } .sx-sk.wide .sx-skl { grid-area: l; } .sx-sk.wide .sx-skd { grid-area: d; } .sx-sk.wide .sx-skf { grid-area: f; }
  .sx-sk.wide .sx-skf .fi { display: none; } .sx-sk.wide .sx-skf .u-btn { flex: 1; }
  .sx-guide .gh .sty { display: none; }
  .sx-skc .hd .sub i { display: none; }
}

/* ==========================================================================================================
   AUTO settings (.sx-auto) — window 'auto': status + start / stop, five category tabs, one card of rows per category
   ========================================================================================================== */
#panel[data-kind="auto"] .win { width: min(760px, calc(100vw - 24px)) !important; height: auto !important; max-height: min(640px, calc(100vh - 20px)) !important; }
#panel[data-kind="auto"] #pbody { padding: 12px 14px 14px !important; }
.sx-auto { display: flex; flex-direction: column; gap: 10px; }
.sx-ahead { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--sx-rl); background: linear-gradient(90deg, rgba(63, 125, 255, .2), rgba(63, 125, 255, .05)); border: 1px solid var(--sx-line2); }
.sx-ahead.on { background: linear-gradient(90deg, rgba(88, 240, 160, .2), rgba(63, 125, 255, .06)); border-color: rgba(88, 240, 160, .55); }
.sx-ahead .dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: #5d6d96; box-shadow: 0 0 0 3px rgba(93, 109, 150, .25); }
.sx-ahead.on .dot { background: var(--sx-up); box-shadow: 0 0 0 3px rgba(88, 240, 160, .25), 0 0 10px var(--sx-up); }
.sx-ahead .t { flex: 1; min-width: 0; display: flex; flex-direction: column; } .sx-ahead .t b { font: 700 var(--sx-fs4) var(--sx-font); } .sx-ahead .t small { font-size: var(--sx-fs1); color: var(--sx-tx2); }
#pbody .sx-ahead .u-btn { flex: none; min-width: 130px; min-height: 42px; }
.sx-acats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 3px; border-radius: var(--sx-rm); background: var(--sx-well); border: 1px solid var(--sx-line); }
#pbody .sx-acats button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 4px 2px; background: transparent; border: 1px solid transparent; box-shadow: none;
  border-radius: 9px; color: var(--sx-tx3); font: 600 var(--sx-fs1) var(--sx-font); }
#pbody .sx-acats button.on { background: linear-gradient(180deg, rgba(255, 213, 106, .3), rgba(255, 213, 106, .1)); border-color: var(--sx-line-au); color: var(--sx-gold3); }
.sx-acats i { font-style: normal; } .sx-acats i .uic { width: 24px; height: 24px; } .sx-acats span { max-width: 100%; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.sx-abody { display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: var(--sx-rl); background: var(--sx-card); border: 1px solid var(--sx-line); animation: sxFade .15s; }
.sx-arow, .sx-auto .arow { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--sx-rm); background: rgba(3, 8, 26, .3); }
.sx-arow .l { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .sx-arow .l b { font-size: var(--sx-fs3); } .sx-arow .l small { font-size: var(--sx-fs1); color: var(--sx-tx3); line-height: 1.45; }
.sx-arow .c { flex: none; display: flex; justify-content: flex-end; max-width: 64%; }
.sx-arow.wide { flex-direction: column; align-items: stretch; } .sx-arow.wide .c { max-width: none; justify-content: flex-start; }
.sx-arow.vipoff { opacity: .6; }
.sx-seg.wrap { flex-wrap: wrap; border-radius: var(--sx-rm); } #pbody .sx-seg.wrap > button { flex: 0 1 auto; }
.sx-askills { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; width: 100%; }
#pbody .sx-askills button { display: flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 8px; text-align: left; border-radius: var(--sx-rm); font-size: var(--sx-fs1); }
#pbody .sx-askills button.on { border-color: rgba(88, 240, 160, .6); background: linear-gradient(180deg, rgba(88, 240, 160, .16), rgba(88, 240, 160, .04)); }
#pbody .sx-askills button.off { opacity: .55; filter: grayscale(.6); }
.sx-askills i { font-style: normal; font-weight: 800; width: 14px; } .sx-askills button.on i { color: var(--sx-up); } .sx-askills button.off i { color: var(--sx-down); }
.sx-askills img { width: 26px; height: 26px; border-radius: 50%; image-rendering: pixelated; } .sx-askills span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-acond { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; width: 100%; }
.sx-acond label { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: var(--sx-rm); background: rgba(3, 8, 26, .4); font-size: var(--sx-fs1); }
.sx-acond img { width: 24px; height: 24px; border-radius: 50%; image-rendering: pixelated; } .sx-acond span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-acond select { min-height: 40px; max-width: 128px; padding: 0 6px; border-radius: 8px; background: #12245a; color: var(--sx-tx); border: 1px solid var(--sx-line2); font: 500 var(--sx-fs1) var(--sx-font); }
.sx-anote { padding: 6px 10px; font-size: var(--sx-fs1); color: var(--sx-tx3); line-height: 1.5; }
.sx-auto .arow.aqjob { flex-direction: column; align-items: stretch; }
@media (max-width: 640px) {
  .sx-arow:not(.wide) { flex-direction: column; align-items: stretch; } .sx-arow .c { max-width: none; justify-content: flex-start; }
  .sx-acats span { font-size: var(--sx-fs1); } #pbody .sx-ahead .u-btn { min-width: 0; }
}
@media (max-height: 500px) {
  #panel[data-kind="auto"] .win { max-height: calc(100vh - 12px) !important; }
  #panel[data-kind="auto"] #pbody { padding: 8px 10px 10px !important; }
  .sx-auto { gap: 6px; } .sx-ahead { padding: 6px 10px; } #pbody .sx-acats button { min-height: 44px; flex-direction: row; gap: 5px; }
  .sx-arow, .sx-auto .arow { padding: 6px 8px; }
}

/* ==========================================================================================================
   HUD (#hud) — anime MMORPG look (owner's reference work/redesign/ref/ref-hud-anime-mobile.webp)
   No boxes around the always-on parts: a diamond portrait with thin HP/MP bars, quest objectives as slim banners on the
   left, an ornate round minimap, a clean skill ribbon (PC) or diamond skill buttons round a big attack diamond (touch).
   Positions stay in hud-v3.css (layout) and ui.js stackHud / stackTop; this block owns the look.
   Performance: no backdrop-filter, no endless shadow animations; the low-HP warning blinks one small element's opacity.
   ========================================================================================================== */
#me, #target, #topr, #menu, #petFrame, #tame, .win, .tbox, #interactBtn, .bm-box, #hud #rail, #hud #pills, #hud #quick, #hud #skills { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

/* ---------- portrait: diamond frame, Lv badge, name, thin HP / MP bars ---------- */
#hud #me { gap: 6px; padding: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; animation: none !important; }
#hud #me::before { content: ''; position: absolute; left: 34px; top: 2px; right: -34px; bottom: 6px; z-index: -1; pointer-events: none; border-radius: 0 40px 40px 0;
  background: linear-gradient(90deg, rgba(4, 10, 32, .78), rgba(4, 10, 32, .5) 72%, rgba(4, 10, 32, 0)); }
#hud #portrait { width: 76px; height: 76px; }
#hud #portrait::before { content: ''; position: absolute; inset: -6px; z-index: 2; pointer-events: none; opacity: 1; background: url(assets/ui/v4/portrait-diamond.webp) center / 100% no-repeat; }
#hud #portrait::after { display: none; }
#hud #portraitCv { width: 64px; height: 64px; border-radius: 0; clip-path: polygon(50% 2%, 98% 50%, 50% 98%, 2% 50%); box-shadow: none;
  background: radial-gradient(circle at 50% 30%, #3466d0, #0d1d52 70%); }
#hud #tenRing { inset: 4px; border-radius: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); opacity: .85; }
#hud #tenTxt { bottom: -10px; z-index: 3; font: 800 11px var(--sx-font); color: #ffd0f4; }
#hud #me .meinfo { width: 184px; padding: 4px 0 2px; }
#hud #me .r1 { gap: 6px; } #hud #me .r1 b { font: 700 var(--sx-fs4) var(--sx-font); color: #fff; text-shadow: 0 1px 2px #000, 0 0 10px rgba(63, 125, 255, .6); }
#hud #me .r1 span { font: 600 var(--sx-fs1) var(--sx-font); color: var(--sx-gold); text-shadow: 0 1px 2px #000; }
#hud #me .r2 { gap: 4px; margin: 1px 0 3px; }
#hud #me .r2 em { padding: 0 7px; border-radius: 999px; font: 700 10.5px/16px var(--sx-font); white-space: nowrap; color: var(--sx-gold3); background: rgba(255, 213, 106, .14); border: 1px solid rgba(255, 213, 106, .35); }
#hud #me .r2 em#pLv { color: var(--sx-gold-ink); background: var(--sx-btn-au); border-color: #fff0b8; }
#hud #me .bar { height: 11px; margin-top: 3px; border-radius: 0; overflow: hidden; background: rgba(2, 6, 20, .78); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
#hud #me .bar::after { content: ''; position: absolute; inset: 0 0 55% 0; background: linear-gradient(rgba(255, 255, 255, .3), rgba(255, 255, 255, 0)); pointer-events: none; }
#hud #me .bar i { border-radius: 0; }
#hud #me .bar.hp i { background: var(--sx-hp); } #hud #me .bar.mp i { background: var(--sx-mp); }
#hud #me .bar span { right: 8px; top: 0; z-index: 1; font: 700 10px/11px var(--sx-font); letter-spacing: .2px; opacity: 1; text-shadow: 0 0 2px #000, 0 1px 1px #000; }
#hud #me.lowhp .bar.hp i { background: linear-gradient(90deg, #d4142e, #ff5a4a); }
#hud #me.lowhp::after { content: ''; position: absolute; left: 0; top: 0; width: 76px; height: 76px; pointer-events: none; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: radial-gradient(circle, rgba(255, 40, 70, 0) 45%, rgba(255, 40, 70, .75)); animation: sxLow 1s ease-in-out infinite; will-change: opacity; }
@keyframes sxLow { 50% { opacity: .15; } }
@media (prefers-reduced-motion: reduce) { #hud #me.lowhp::after { animation: none; } }

/* buffs, pet, party cards under the portrait */
#hud .bf { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle, #1c3a86, #0a1640); border: 1.5px solid rgba(255, 213, 106, .55); box-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
#hud .bf img { width: 22px; height: 22px; border-radius: 50%; }
#hud .bf i { right: -4px; bottom: -6px; font: 800 10px var(--sx-font); color: #fff; }
#hud #petFrame { padding: 3px 12px 3px 3px; border-radius: 999px !important; background: linear-gradient(90deg, rgba(4, 10, 32, .8), rgba(4, 10, 32, .45)) !important; border: 1px solid var(--sx-line) !important; box-shadow: none !important; }
#hud #petFrame .pbar i { background: var(--sx-hp); }

/* ---------- quest objectives: slim banners with a diamond, the count as a pill, compact buttons ---------- */
#hud #jqCard { width: 238px; padding: 6px 12px 7px 14px !important; text-align: left; font: 500 var(--sx-fs2)/1.45 var(--sx-font) !important; color: var(--sx-tx);
  background: linear-gradient(90deg, rgba(6, 16, 48, .84), rgba(6, 16, 48, .55) 62%, rgba(6, 16, 48, 0)) !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  border-image: linear-gradient(90deg, var(--sx-gold), rgba(255, 213, 106, .25) 70%, transparent) 1 0 1 0 / 1px 0 1px 0 !important; text-shadow: 0 1px 2px #000; }
#hud #jqCard b { display: inline-flex; align-items: center; gap: 6px; color: var(--sx-gold3) !important; font-size: var(--sx-fs2); font-weight: 700; letter-spacing: .2px; }
#hud #jqCard > b::before { content: ''; flex: none; width: 9px; height: 9px; transform: rotate(45deg); background: linear-gradient(135deg, #fff3c6, #e9a33a); box-shadow: 0 0 6px rgba(255, 205, 96, .8); }
#hud #jqCard i { color: var(--sx-up) !important; }
#hud #jqCard .qn { display: inline-block; margin-left: 3px; padding: 0 7px; border-radius: 999px; font: 800 11px/17px var(--sx-font); font-style: normal; color: #062430; background: linear-gradient(#9af0ff, #36c0ea); text-shadow: none; }
#hud #jqCard hr { margin: 6px 0; border: 0; height: 1px; background: linear-gradient(90deg, rgba(255, 213, 106, .45), transparent); }
#hud #jqCard .qloc { display: block; margin-top: 1px; color: #ffd27a; font-size: 10.5px; }
#hud #jqCard .aqnow { display: block; color: var(--sx-up); font-size: 10.5px; }
/* ui/aq-headline: auto quest training a Novice's Job = the headline; the chapter's hunt after it, small; the off hint */
#hud #jqCard .qnext { display: block; margin-top: 1px; color: var(--sx-tx2, #b9c6e8); font-size: 10.5px; line-height: 1.35; }
#hud #jqCard .qnext small { font-size: inherit; }
#hud #jqCard .qhint { display: block; margin-top: 2px; color: #ffd27a; font-size: 10.5px; line-height: 1.35; }
#hud #jqCard .aqrow { display: flex; gap: 5px; margin-top: 5px; }
#hud #jqCard .aqb { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 4px; width: 100%; min-height: 34px; margin: 5px 0 0; padding: 0 10px; border-radius: 999px;
  font: 700 var(--sx-fs2) var(--sx-font); color: var(--sx-gold-ink); background: var(--sx-btn-au); border: 1px solid #fff0b8; box-shadow: 0 2px 8px rgba(255, 170, 40, .3); text-shadow: none; pointer-events: auto; }
#hud #jqCard .aqrow .aqb { flex: 1 1 auto; width: auto; margin: 0; white-space: nowrap; min-width: 0; }
#hud #jqCard .aqrow .aqb.aqw { flex: 0 0 auto; color: var(--sx-tx); background: rgba(20, 40, 100, .85); border-color: var(--sx-line2); box-shadow: none; }
#hud #jqCard .aqb.on { color: #d8ffe8; background: linear-gradient(180deg, rgba(58, 216, 138, .45), rgba(58, 216, 138, .2)); border-color: rgba(88, 240, 160, .7); }
#hud #jqCard .aqb:active { transform: scale(.97); }
#hud #jqCard .jcta { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 6px 10px; min-height: 40px; border-radius: var(--sx-rm); text-align: left; pointer-events: auto; animation: none;
  background: linear-gradient(90deg, rgba(255, 213, 106, .32), rgba(255, 213, 106, .08)); border: 1px solid rgba(255, 213, 106, .65); box-shadow: 0 0 12px rgba(255, 205, 96, .25); }
#hud #jqCard .jcta i { font-style: normal; font-size: 18px; color: var(--sx-gold3); } #hud #jqCard .jcta > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#hud #jqCard .jcta b { display: block; color: #fff3c9 !important; font-size: var(--sx-fs2); } /* block, not the card's inline-flex: its 6 px gap split «Warrior !» (fix/aq-jobflow) */ #hud #jqCard .jcta b::before { display: none; }
#hud #jqCard .jcta small { color: var(--sx-tx2); font-size: 10.5px; } #hud #jqCard .jcta em { font-style: normal; color: var(--sx-gold3); font-size: 14px; }
#hud #jqMini { font: 700 var(--sx-fs2) var(--sx-font); color: var(--sx-tx); padding: 5px 14px 5px 12px; border-radius: 0 999px 999px 0; border-left: 3px solid var(--sx-gold);
  background: linear-gradient(90deg, rgba(6, 16, 48, .88), rgba(6, 16, 48, .55)); text-shadow: 0 1px 2px #000; }
/* PC: the quest banners sit on the left under the portrait (they were squeezed between the minimap and the rail) */
body.pc #hud #jqCard { left: calc(10px + var(--sl)) !important; right: auto !important; width: 252px; margin-top: 0; }

/* ---------- round minimap with the ornate ring, map name ribbon, clock + gold pills ---------- */
#hud #topr { width: 140px !important; padding: 0 !important; gap: 4px !important; background: none !important; border: 0 !important; box-shadow: none !important; }
#hud #topr::before, #hud #topr::after { display: none; }
#hud #mapRing { position: relative; width: 128px !important; height: 128px !important; border-radius: 50% !important; overflow: visible; border: 0 !important; box-shadow: 0 4px 14px rgba(0, 0, 0, .5) !important; }
#hud #mapRing::before { content: ''; position: absolute; inset: -8px; z-index: 2; pointer-events: none; background: url(assets/ui/v4/minimap-ring.webp) center / 100% no-repeat; }
#hud #mini { width: 128px !important; height: 128px !important; border-radius: 50%; }
#hud #mapRing::after { content: attr(data-zone); position: absolute; left: 50%; right: auto; bottom: -14px; z-index: 3; transform: translateX(-50%); max-width: 150px; padding: 2px 12px !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 999px; font: 700 10.5px var(--sx-font) !important; color: var(--sx-gold3); letter-spacing: .2px;
  background: linear-gradient(180deg, #19357c, #0b1a48) !important; border: 1px solid rgba(255, 213, 106, .6); box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
#hud #topr .clk { margin-top: 16px; padding: 1px 10px; border-radius: 999px; font: 700 12px var(--sx-font); color: #fff; letter-spacing: .5px; background: rgba(4, 10, 32, .7); border: 1px solid var(--sx-line); text-shadow: none; }
#hud #topr .gold, #hud #crysBox { padding: 1px 10px; border-radius: 999px; font: 700 11px var(--sx-font); color: var(--sx-gold); background: rgba(4, 10, 32, .7); border: 1px solid rgba(255, 213, 106, .35); }
#hud #topr .gold b { color: var(--sx-gold3) !important; }
#hud #zoomBar { opacity: 0; transition: opacity .2s; } #hud #topr:hover #zoomBar { opacity: 1; }
#hud #zoomBar button { width: 22px; height: 22px; border-radius: 50%; background: rgba(4, 10, 32, .8); border: 1px solid rgba(255, 213, 106, .35); color: var(--sx-gold3); }

/* ---------- the rail + menu button: round icon buttons, no box ---------- */
#hud #rail { gap: 6px; padding: 0; background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 0; }
#hud #rail button { width: 44px !important; height: 44px !important; border-radius: 50% !important; background: radial-gradient(circle at 50% 35%, rgba(36, 70, 150, .9), rgba(8, 18, 52, .92)) !important;
  border: 1px solid rgba(255, 213, 106, .4) !important; box-shadow: 0 3px 8px rgba(0, 0, 0, .45) !important; transition: transform .12s var(--sx-ease), border-color .15s; }
#hud #rail button:hover { border-color: var(--sx-gold) !important; transform: translateY(-1px); }
#hud #rail button:active { transform: scale(.92); }
#hud #rail button.on { border-color: var(--sx-gold) !important; box-shadow: 0 0 0 2px rgba(255, 213, 106, .35), 0 0 12px rgba(255, 205, 96, .5) !important; }
#hud #rail button.on::before { display: none; }
#hud #rail button .mic { width: 28px; height: 28px; opacity: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .8)); }
#hud #rail #menuBtn::after { display: none; }
#hud #rail button u { right: auto !important; left: 50% !important; top: auto !important; bottom: -7px !important; transform: translateX(-50%); padding: 0 4px; border-radius: 4px;
  font: 700 9px/12px var(--sx-font) !important; color: var(--sx-gold3) !important; background: rgba(4, 10, 32, .9); opacity: 1 !important; }
@media (min-height: 820px) { body.pc #hud #rail button { width: 48px !important; height: 48px !important; } body.pc #hud #rail button span { display: none !important; } }

/* ---------- PC bottom ribbon: potions | skill bar | AUTO + quick buttons ---------- */
body.pc { --slot: 38px; --slotP: 44px; }
@media (min-width: 1500px) { body.pc { --slot: 44px; --slotP: 50px; } }
body.pc #dock { align-items: flex-end; gap: 8px; }
body.pc #hud #pills, body.pc #hud #quick, body.pc #hud #skills { padding: 5px !important; gap: 5px !important; border-radius: 14px !important;
  background: linear-gradient(180deg, rgba(10, 24, 66, .72), rgba(4, 10, 32, .84)) !important; border: 1px solid rgba(132, 172, 255, .2) !important;
  box-shadow: inset 0 1px 0 rgba(255, 213, 106, .25), 0 6px 18px rgba(0, 0, 0, .4) !important; }
body.pc #hud #skills { grid-template-columns: repeat(4, var(--slotP)) repeat(var(--rest, 8), var(--slot)) !important; gap: 5px 5px !important; padding: 5px 8px !important; align-items: end; }
body.pc #hud .sk { justify-self: center; }
body.pc #hud .sk[data-slot="0"], body.pc #hud .sk[data-slot="1"], body.pc #hud .sk[data-slot="2"], body.pc #hud .sk[data-slot="3"] { width: var(--slotP) !important; height: var(--slotP) !important; }
body.pc #hud .sk.pg2, body.pc #hud .sk.pg3 { width: var(--slot) !important; height: var(--slot) !important; }
@media (max-width: 1239px) { body.pc #hud #skills { grid-template-columns: repeat(6, var(--slot)) !important; } body.pc #hud .sk { width: var(--slot) !important; height: var(--slot) !important; } }
body.pc #hud #pills button, body.pc #hud #quick button { width: var(--slot) !important; height: var(--slot) !important; border-radius: 11px !important; }
body.pc #hud #autoBtn { width: calc(var(--slot) * 1.5) !important; }
body.pc #hud .sk.trail { display: none !important; }
/* one slot look for skills, potions and quick buttons */
#hud .sk, #hud #pills button, #hud #quick button { border-radius: 11px; background: radial-gradient(circle at 50% 28%, #24489e, #0d1d52 66%, #07112f) !important;
  border: 1px solid rgba(132, 172, 255, .38) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 -3px 6px rgba(0, 0, 0, .45), 0 2px 5px rgba(0, 0, 0, .4) !important;
  transition: transform .12s var(--sx-ease), border-color .15s, filter .15s; }
#hud .sk:hover, #hud #pills button:hover, #hud #quick button:hover { border-color: rgba(255, 213, 106, .8) !important; }
#hud .sk:active, #hud #pills button:active, #hud #quick button:active { transform: scale(.94); filter: brightness(1.2); }
#hud .sk[data-slot="0"], #hud .sk[data-slot="1"], #hud .sk[data-slot="2"], #hud .sk[data-slot="3"] { border-color: rgba(255, 213, 106, .8) !important;
  box-shadow: inset 0 1px 0 rgba(255, 243, 198, .2), inset 0 -3px 6px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .4), 0 0 10px rgba(255, 205, 96, .22) !important; }
body.pc #hud .sk .pxi { width: calc(100% - 8px); height: calc(100% - 8px); border-radius: 8px; }
body.pc #hud .sk.empty { background: rgba(4, 10, 32, .35) !important; border: 1px dashed rgba(132, 172, 255, .25) !important; box-shadow: none !important; }
body.pc #hud .sk.empty .key { opacity: .45; }
body.pc #hud .sk .key, body.pc #hud #pills u, body.pc #hud #quick u { display: block !important; left: 3px !important; right: auto !important; top: 1px !important; bottom: auto !important; width: auto !important; height: auto !important;
  padding: 0 !important; background: none !important; border: 0 !important; font: 800 9.5px/11px var(--sx-font) !important; color: var(--sx-gold3) !important; text-shadow: 0 1px 2px #000, 0 0 3px #000; z-index: 2; }
#hud #pills b { right: 2px !important; bottom: 1px !important; min-width: 16px; padding: 0 4px !important; border-radius: 8px !important; font: 800 10px/14px var(--sx-font) !important;
  background: rgba(4, 10, 32, .9) !important; color: #fff !important; box-shadow: 0 0 0 1px rgba(95, 225, 255, .5); text-shadow: none !important; }
#hud .sk .cd { border-radius: inherit !important; font: 800 14px var(--sx-font) !important; color: #fff; text-shadow: 0 0 6px rgba(95, 225, 255, .9), 0 1px 2px #000 !important; z-index: 1; }
#hud .sk.cooling { border-color: rgba(95, 225, 255, .6) !important; } #hud .sk.cooling .ic { filter: grayscale(.65) brightness(.72); }
#hud .sk.nomp .ic { filter: grayscale(.4) brightness(.6) sepia(.3) hue-rotate(180deg) !important; }
#hud .sk.nomp::before { content: 'MP'; position: absolute; right: 3px; bottom: 1px; z-index: 2; font: 800 8.5px var(--sx-font); color: #9ac8ff; text-shadow: 0 1px 2px #000; }
/* AUTO: a clear toggle, cyan when off, gold with a lit dot when on */
#hud #autoBtn { color: var(--sx-cyan) !important; font: 800 12px var(--sx-font) !important; letter-spacing: 1.5px; animation: none !important; }
#hud #autoBtn.on { color: var(--sx-gold-ink) !important; background: var(--sx-btn-au) !important; border-color: #fff0b8 !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 14px rgba(255, 196, 70, .55) !important; }
#hud #autoBtn.on::after { content: ''; position: absolute; right: 5px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: #3ad88a; box-shadow: 0 0 6px #3ad88a; } /* a steady lit dot: an endless blink kept the main thread restyling (fps-ab) */
@keyframes sxDot { 50% { opacity: .3; } }
#hud #tenBtn { color: #ffb0ec !important; } #hud #rideBtn.on, #hud #sitBtn.on { border-color: var(--sx-cyan) !important; box-shadow: 0 0 12px rgba(95, 225, 255, .5) !important; }

/* ---------- touch: diamond skill buttons round a big attack diamond (owner's reference) ---------- */
body:not(.pc) #hud .sk { width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; }
body:not(.pc) #hud .sk::after { content: ''; position: absolute; inset: -4px; z-index: 2; pointer-events: none; background: url(assets/ui/v4/skill-diamond.webp) center / 100% no-repeat; }
body:not(.pc) #hud .sk .ic { position: absolute; inset: 7px; display: grid; place-items: center; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: radial-gradient(circle, #24489e, #0a1846 70%); }
body:not(.pc) #hud .sk .pxi { width: 100%; height: 100%; border-radius: 0; object-fit: cover; }
body:not(.pc) #hud .sk .cd { inset: 7px !important; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); border-radius: 0 !important; display: grid; place-items: center; }
body:not(.pc) #hud .sk.s3, body:not(.pc) #hud .sk.s4, body:not(.pc) #hud .sk.s5 { --o: max(50px, calc(44px / (var(--hk) * var(--ctl)))); width: var(--o) !important; height: var(--o) !important;
  margin: calc(var(--o) / -2) 0 0 calc(var(--o) / -2) !important; opacity: 1; }
body:not(.pc) #hud .sk.s0, body:not(.pc) #hud .sk.s1, body:not(.pc) #hud .sk.s2 { filter: drop-shadow(0 0 5px rgba(255, 205, 96, .3)); }
body:not(.pc) #hud .sk.empty { display: none !important; }
body:not(.pc) #hud .sk.cooling .cd { font-size: 15px !important; }
body:not(.pc) #hud #atkBtn { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: none !important; overflow: visible; }
body:not(.pc) #hud #atkBtn::before { content: ''; position: absolute; inset: 12px; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: radial-gradient(circle at 50% 38%, #3a74e8, #142e86 55%, #08164a); }
body:not(.pc) #hud #atkBtn::after { content: ''; position: absolute; inset: -8px; pointer-events: none; background: url(assets/ui/v4/attack-diamond.webp) center / 100% no-repeat;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); }
body:not(.pc) #hud #atkBtn span { position: relative; z-index: 1; opacity: 1; display: grid; place-items: center; width: 100%; height: 100%; font-size: 0; }
body:not(.pc) #hud #atkBtn span::before { content: ''; width: 46px; height: 46px; background: url(assets/icons/ui/equip.png) center / contain no-repeat; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .8)); }
body:not(.pc) #hud #atkBtn:active { transform: scale(.93); filter: brightness(1.2); }
body:not(.pc) #hud #wheel::before { border: 0; background: radial-gradient(circle, rgba(63, 125, 255, .18), rgba(63, 125, 255, 0) 70%); }
body:not(.pc) #hud #skPage { border-radius: 50% !important; background: radial-gradient(circle at 50% 35%, #2a55b8, #0b1a4c) !important; border: 1px solid rgba(255, 213, 106, .5) !important; color: var(--sx-gold3); }
/* touch quick buttons and potions: round glass buttons, potions = item squares with a count */
body:not(.pc) #hud #quick button { border-radius: 50% !important; }
body:not(.pc) #hud #autoBtn { border-radius: 999px !important; width: 66px !important; }
body:not(.pc) #hud #pills button { border-radius: 12px !important; }
body:not(.pc) #hud #pills #dashBtn { border-radius: 50% !important; }
body:not(.pc) #hud #pills .pxi { width: 28px; height: 28px; }
body:not(.pc) #hud #pills b { font-size: 10px !important; }
#hud #joy { opacity: .85; }

/* ---------- chat (PC): no box, readable lines, quiet tabs ---------- */
body.pc #hud #log { background: linear-gradient(90deg, rgba(4, 10, 32, .55), rgba(4, 10, 32, .15)) !important; border: 0 !important; border-left: 2px solid rgba(132, 172, 255, .35) !important; border-radius: 0 !important; text-shadow: 0 1px 2px #000; }
body.pc #hud #logTabs { background: none !important; border: 0 !important; border-radius: 0; overflow: visible; gap: 4px; }
#hud #logTabs button { border-radius: 999px !important; background: rgba(4, 10, 32, .7) !important; border: 1px solid rgba(132, 172, 255, .2) !important; color: var(--sx-tx3) !important; box-shadow: none !important; }
#hud #logTabs button.on { color: var(--sx-gold3) !important; border-color: rgba(255, 213, 106, .6) !important; background: rgba(255, 213, 106, .14) !important; }
/* ---------- EXP strip ---------- */
#hud #xp { height: 5px; background: rgba(2, 6, 20, .8) !important; box-shadow: 0 -1px 0 rgba(255, 213, 106, .3); }
#hud #expFill { background: var(--sx-exp) !important; box-shadow: 0 0 8px rgba(255, 210, 80, .7); } #hud #jexpFill { background: var(--sx-job) !important; box-shadow: none; }
#hud #expTxt, #hud #jexpTxt { padding: 1px 8px; border-radius: 999px; font: 800 10px var(--sx-font) !important; color: #fff; background: rgba(4, 10, 32, .78); border: 1px solid rgba(255, 213, 106, .35); }
/* ---------- target / boss bar ---------- */
#hud #target { padding: 5px 14px 7px !important; border-radius: 12px !important; background: linear-gradient(180deg, rgba(14, 26, 70, .9), rgba(4, 10, 32, .9)) !important;
  border: 1px solid rgba(255, 111, 134, .35) !important; box-shadow: 0 6px 16px rgba(0, 0, 0, .45) !important; }
#hud #target .tgbar { border-radius: 0; clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
#hud #tgFill { background: var(--sx-hp) !important; }
#hud #tgName { font-weight: 700; } #hud #tgName::before { content: '◆ '; color: var(--sx-rose); }
/* ---------- zone banner: the Codex quest banner art ---------- */
#hud #zoneBanner b, #hud #zoneBanner small { text-shadow: 0 1px 3px #000, 0 0 12px rgba(63, 125, 255, .7); }
body:not(.pc) #hud #quick button, body:not(.pc) #hud #pills button { width: 42px !important; height: 42px !important; }
body:not(.pc) #hud #autoBtn { width: 60px !important; }
body:not(.pc) #hud #jqCard .aqb { min-height: calc(42px / var(--hk)); }
body:not(.pc) #hud #rail { right: calc(26px + var(--sr) + 140px * var(--hk) * .92); }
body.m-port #hud #me .meinfo { width: 150px; } body.m-port #hud #me::before { right: -14px; }
body:not(.pc) #hud #skPage { min-width: calc(42px / (var(--hk) * var(--ctl))); min-height: calc(42px / (var(--hk) * var(--ctl))); }
/* moved here from skill-ui.css when that file went (UI Redesign V2): the shrine's job style line and the combo editor's auto button */
#pbody .job .sty { color: var(--sx-gold3); }
#panel .cbauto { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
#panel .cbauto .u-btn { min-height: 44px; padding: 0 16px; font-weight: 700; }
#panel .cbauto small { color: var(--sx-tx2); }
.sx-skc .hd .sub .elic { width: 14px; height: 14px; image-rendering: pixelated; }
/* the info pills under the minimap flow two to a row (online adds the crystal and the online count: a column of five ran into
   the skill wheel on landscape phones) */
#hud #topr { flex-direction: row !important; flex-wrap: wrap; justify-content: center; align-content: flex-start; }
#hud #topr > #mapRing, #hud #topr > #zoomBar { flex: 0 0 auto; } #hud #topr > #zoomBar { width: 100%; }
#hud #topr .clk { margin-top: 16px; } #hud #topr .gold, #hud #crysBox, #hud #onlineN { margin-top: 0; }
#hud #topr > #mapRing + #zoomBar + .clk, #hud #topr > #mapRing + .clk { margin-right: 2px; }
#hud #onlineN { padding: 1px 8px; border-radius: 999px; font: 700 10.5px var(--sx-font); color: var(--sx-tx2); background: rgba(4, 10, 32, .7); border: 1px solid var(--sx-line); }
body.m-land #hud #mapRing, body.m-land #hud #mini { width: 112px !important; height: 112px !important; }
body.m-land #hud #topr .clk { margin-top: 15px; }
body.pc #hud #log { bottom: calc(60px + var(--sb)) !important; } body.pc #hud #logTabs { bottom: calc(168px + var(--sb)) !important; } /* 2 px clear of the docked chat bar */
body.pc #hud #loot { right: calc(var(--railW, 60px) + 26px + var(--sr)) !important; }

/* ==========================================================================================================
   UI Redesign V3 (owner 2026-10-15 «ทำหน้าต่างอื่นตามแบบใหม่เลย»): every other window on the same system.
   One window kit (sizes, tab bars, NPC banner, row cards, tiles, inputs, notes, progress, sticky action bar) and then the
   windows built on it. The old looks of these families (style.css / ui-v2.css / hud-v3.css / guide.css) were removed
   (work/redesign3/prune3.py) so each family has one rule set here.
   ========================================================================================================== */
/* ---------- window sizes: list windows L, the busy ones XL; phones keep the full-screen rules ---------- */
#panel .win { width: min(760px, calc(100vw - 24px)); max-height: min(700px, calc(100vh - 20px)); }
#panel:is([data-kind="market"], [data-kind="smith"], [data-kind="shop"], [data-kind="storage"], [data-kind="prem"], [data-kind="lab"],
  [data-kind="life"], [data-kind="book"], [data-kind="guild"], [data-kind="mailbox"], [data-kind="shrine"], [data-kind="ach"],
  [data-kind="newbie"], [data-kind="cards"], [data-kind="stats"], [data-kind="tavern"], [data-kind="vend"], [data-kind="trade"],
  [data-kind="ranch"], [data-kind="help"], [data-kind="settings"], [data-kind="pvp"], [data-kind="login"]) .win {
  width: min(1040px, calc(100vw - 24px)) !important; height: min(700px, calc(100vh - 20px)) !important; max-height: none !important; }
@media (min-width: 1600px) and (min-height: 900px) {
  #panel .win { width: 860px; max-height: 820px; }
  #panel:is([data-kind="market"], [data-kind="smith"], [data-kind="shop"], [data-kind="storage"], [data-kind="prem"], [data-kind="lab"],
    [data-kind="life"], [data-kind="book"], [data-kind="guild"], [data-kind="mailbox"], [data-kind="shrine"], [data-kind="ach"],
    [data-kind="newbie"], [data-kind="cards"], [data-kind="stats"], [data-kind="tavern"], [data-kind="vend"], [data-kind="trade"],
    [data-kind="ranch"], [data-kind="help"], [data-kind="settings"], [data-kind="pvp"], [data-kind="login"]) .win { width: 1240px !important; height: 820px !important; }
}
@media (max-height: 500px) { #panel .win, #panel[data-kind] .win { width: calc(100vw - 16px - var(--sl, 0px) - var(--sr, 0px)) !important; height: calc(100vh - 12px) !important; max-height: none !important; } }
@media (max-width: 600px) and (min-height: 600px) { #panel .win, #panel[data-kind] .win { width: 100vw !important; height: calc(100vh - 92px - var(--st, 0px)) !important; } }
#panel #pbody { padding: 12px 16px 14px; font: 400 var(--sx-fs3)/1.5 var(--sx-font); color: var(--sx-tx); }
@media (max-height: 500px) { #panel #pbody { padding: 8px 10px; } }
#pbody small { color: var(--sx-tx3); }
#pbody .gold, #pbody b.gold { color: var(--sx-gold) !important; }

/* ---------- tab bars inside windows: one pill bar like the bag categories ---------- */
#pbody :is(.sktabs, .u-tabs, .smtabs, .mktabs, .ptabs, .settabs, .htabs) { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 10px; padding: 3px;
  border-radius: var(--sx-rm); background: var(--sx-well); border: 1px solid var(--sx-line); }
#pbody :is(.sktabs, .u-tabs, .smtabs, .mktabs, .ptabs, .settabs, .htabs) > button { flex: 1 1 auto; min-height: 40px; padding: 0 12px; border-radius: 9px;
  background: transparent; border: 1px solid transparent; box-shadow: none; color: var(--sx-tx3); font: 600 var(--sx-fs2) var(--sx-font); white-space: nowrap; }
#pbody :is(.sktabs, .u-tabs, .smtabs, .mktabs, .ptabs, .settabs, .htabs) > button:hover:not(:disabled) { color: var(--sx-tx); filter: none; }
#pbody :is(.sktabs, .u-tabs, .smtabs, .mktabs, .ptabs, .settabs, .htabs) > button.on { color: var(--sx-gold3); border-color: var(--sx-line-au);
  background: linear-gradient(180deg, rgba(255, 213, 106, .3), rgba(255, 213, 106, .1)); box-shadow: 0 0 10px rgba(255, 205, 96, .2); }
#pbody :is(.sktabs, .u-tabs) > button.off { opacity: .55; }
#pbody :is(.sktabs, .u-tabs) .sp { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; font-size: var(--sx-fs1); color: #04281a; background: linear-gradient(#a6ffd0, #3ad88a); }
/* filter chips (soul book, cosmetics, market find) */
#pbody :is(.bkf, .cos-f) { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; padding: 0; background: none; border: 0; }
#pbody :is(.bkf, .cos-f) > button { flex: 0 1 auto; min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: var(--sx-fs2); }
#pbody :is(.bkf, .cos-f) > button.on { background: var(--sx-btn-au) !important; color: var(--sx-gold-ink) !important; border-color: #fff0b8; }
#pbody :is(.bkf, .cos-f) > button small { margin-left: 3px; opacity: .8; color: inherit; }
#pbody .seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 999px; background: var(--sx-well); border: 1px solid var(--sx-line); }
#pbody .seg > button { flex: 1 1 auto; min-height: 36px; padding: 0 12px; border-radius: 999px; background: transparent; border: 1px solid transparent; box-shadow: none; color: var(--sx-tx2); font: 600 var(--sx-fs2) var(--sx-font); }
#pbody .seg > button.on { background: var(--sx-btn-au) !important; color: var(--sx-gold-ink) !important; border-color: #fff0b8 !important; }
#pbody .seg.wrap { border-radius: var(--sx-rm); }
#pbody .seg img, #pbody .seg .pxi { width: 20px; height: 20px; vertical-align: -5px; margin-right: 3px; image-rendering: pixelated; object-fit: contain; }

/* ---------- inputs ---------- */
#panel #pbody :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea), .u-dlg :is(input, select, textarea) {
  min-height: 40px; padding: 0 12px; border-radius: 10px; background: var(--sx-well); border: 1px solid var(--sx-line2); color: var(--sx-tx);
  font: 500 var(--sx-fs3) var(--sx-font); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .45); }
#panel #pbody textarea { padding: 8px 12px; line-height: 1.5; }
#panel #pbody :is(input, select, textarea):focus { outline: none; border-color: var(--sx-gold); box-shadow: 0 0 0 2px rgba(255, 213, 106, .2), inset 0 1px 3px rgba(0, 0, 0, .45); }
#panel #pbody select option { background: #0d1c46; }
#pbody input[type="checkbox"], #pbody input[type="radio"] { width: 20px; height: 20px; accent-color: var(--sx-gold); }
#pbody input[type="range"] { accent-color: var(--sx-gold); }
#pbody .arow { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
#pbody .arow > b { font: 600 var(--sx-fs2) var(--sx-font); color: var(--sx-gold); }
#pbody .arow.ib { flex-direction: row; align-items: stretch; } #pbody .arow.ib > input { flex: 1; min-width: 0; } #pbody .arow.ib > button { flex: none; min-width: 120px; padding: 0 14px; }

/* ---------- NPC banner: a portrait medallion + what they say (the old left-border quote line) ---------- */
#pbody .dq { --npc: url(assets/icons/ui/help.png); position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; margin: 0 0 12px; padding: 10px 14px 10px 76px;
  border: 1px solid var(--sx-line-au); border-radius: var(--sx-rl); font: italic 500 var(--sx-fs3)/1.55 var(--sx-font); color: var(--sx-gold3);
  background: radial-gradient(80% 140% at 0% 50%, rgba(255, 213, 106, .2), transparent 60%), var(--sx-card); }
#pbody .dq::before { content: ''; position: absolute; left: 12px; top: 50%; width: 52px; height: 52px; transform: translateY(-50%);
  background: var(--npc) center / 30px no-repeat, url(assets/ui/v4/skill-diamond.webp) center / 100% no-repeat, radial-gradient(circle, #2a55b8, #0b1a4c 70%);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); image-rendering: auto; }
#pbody .dq > button, #pbody .dq .crysb { margin-left: auto; font-style: normal; }
#panel[data-kind="shop"] .dq { --npc: url(assets/icons/ui/itemshop.png); } #panel[data-kind="smith"] .dq { --npc: url(assets/icons/ui/smith.png); }
#panel[data-kind="storage"] .dq { --npc: url(assets/icons/ui/storage.png); } #panel[data-kind="shrine"] .dq { --npc: url(assets/icons/ui/shrine.png); }
#panel[data-kind="church"] .dq { --npc: url(assets/icons/ui/church.png); } #panel[data-kind="tavern"] .dq { --npc: url(assets/icons/ui/tavern.png); }
#panel[data-kind="herald"] .dq { --npc: url(assets/icons/ui/herald.png); } #panel[data-kind="arena"] .dq { --npc: url(assets/icons/ui/arena.png); }
#panel[data-kind="guide"] .dq { --npc: url(assets/icons/ui/guide.png); }
@media (max-height: 500px) { #pbody .dq { min-height: 48px; padding: 6px 12px 6px 60px; font-size: var(--sx-fs2); } #pbody .dq::before { width: 40px; height: 40px; left: 10px; background-size: 22px, 100%, auto; } }

/* ---------- note / hint, empty states, headings ---------- */
#pbody .note { display: block; position: relative; margin: 6px 0 10px; padding: 8px 12px 8px 36px; border-radius: var(--sx-rm); font-size: var(--sx-fs2); line-height: 1.55; color: var(--sx-tx2);
  background: rgba(63, 125, 255, .08); border: 1px solid var(--sx-line); }
#pbody .note::before { content: 'i'; position: absolute; left: 11px; top: 9px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  font: italic 700 12px/1 Georgia, serif; color: #062430; background: linear-gradient(#9af0ff, #36c0ea); }
#pbody .note.warn { color: #ffd9a0; background: rgba(255, 181, 71, .1); border-color: rgba(255, 181, 71, .4); }
#pbody .note.warn::before { content: '!'; font-style: normal; background: linear-gradient(#ffe0a0, #f2a93b); color: #2b1904; }
#pbody .note b { color: var(--sx-tx); }
#pbody .empty { padding: 18px; text-align: center; color: var(--sx-tx3); }
#pbody .u-empty { display: grid; justify-items: center; gap: 6px; max-width: 460px; margin: 16px auto; padding: 24px 20px; text-align: center; border-radius: var(--sx-rl);
  border: 1px dashed var(--sx-line-au); background: radial-gradient(circle at 50% 0%, rgba(255, 213, 106, .12), transparent 70%), var(--sx-card); }
#pbody .u-empty i { font-style: normal; font-size: 40px; line-height: 1; } #pbody .u-empty b { font-size: var(--sx-fs4); color: var(--sx-gold3); }
#pbody .u-empty p { margin: 0; color: var(--sx-tx2); } #pbody .u-empty small { color: var(--sx-tx3); }
#pbody :is(.tierh, .mqhead, .nbgrp h4) { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; font: 700 var(--sx-fs3) var(--sx-font); color: var(--sx-gold); letter-spacing: .3px; }
#pbody .tierh::before { content: ''; width: 7px; height: 7px; transform: rotate(45deg); background: var(--sx-gold); box-shadow: 0 0 6px rgba(255, 205, 96, .7); }
#pbody .tierh::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--sx-line-au), transparent); }
#pbody .mqhead { justify-content: space-between; padding: 10px 14px; border-radius: var(--sx-rm); background: linear-gradient(90deg, rgba(255, 213, 106, .18), transparent); border-left: 3px solid var(--sx-gold); }
#pbody .mqhead small { color: var(--sx-cyan); }

/* ---------- row cards: every list row of every window ---------- */
#pbody :is(.shoprow, .dqrow, .job, .pet, .mon, .rk, .nbrow, .srow, .vrow, .gdn, .pvcard, .lab-dum, .cos-item, .nw2) {
  border-radius: 14px; background: var(--sx-card); border: 1px solid var(--sx-line); box-shadow: var(--sx-in); color: var(--sx-tx); }
#pbody :is(.shoprow, .dqrow, .job, .pet, .mon) { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; padding: 10px 12px; }
#pbody :is(.shoprow, .dqrow, .job, .pet, .mon) > div { flex: 1; min-width: 0; }
#pbody :is(.shoprow, .dqrow) b { font-weight: 700; } #pbody :is(.shoprow, .dqrow) small { line-height: 1.45; }
#pbody :is(.shoprow, .dqrow, .job, .pet, .nbrow, .gdn):hover { border-color: var(--sx-line2); }
#pbody .shoprow.off { opacity: .6; } #pbody .shoprow.off:hover { opacity: .9; } #pbody .shoprow[data-it] { cursor: help; } #pbody .shoprow[data-it] button { cursor: pointer; }
/* the icon tile at the start of a row */
#pbody .sic { flex: none; display: grid; place-items: center; width: 48px; height: 48px; font-size: 24px; border-radius: 12px;
  background: radial-gradient(circle at 50% 30%, #23418a, #0d1b45 70%); border: 1.5px solid #4a5e92; box-shadow: inset 0 0 10px rgba(95, 150, 255, .2); }
#pbody .sic .pxi, #pbody .sic img { width: 34px; height: 34px; border-radius: 6px; image-rendering: pixelated; object-fit: contain; }
#pbody .mkn-chip { display: inline-block; padding: 0 8px; border-radius: 999px; font: 700 var(--sx-fs1)/18px var(--sx-font); color: var(--sx-gold3); background: rgba(255, 213, 106, .14); border: 1px solid var(--sx-line-au); vertical-align: 1px; }
/* progress bars inside windows */
#pbody .gbar { position: relative; height: 14px; margin-top: 6px; border-radius: 7px; overflow: hidden; background: var(--sx-well); border: 0; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06); }
#pbody .gbar i { position: absolute; inset: 0 auto 0 0; border-radius: 7px; background: var(--sx-exp); transition: width .25s var(--sx-ease); }
#pbody .gbar span { position: relative; display: block; text-align: center; font: 700 10px/14px var(--sx-font); color: #fff; text-shadow: 0 1px 2px #000; }
#pbody .dqrow .gbar i { background: linear-gradient(90deg, #ffbf3a, #fff08a); }
/* the wallet strip + the sticky action bar of the economy windows */
#pbody .eco-wallet, #panel .smwallet { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 10px; padding: 8px 12px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 213, 106, .14), rgba(255, 213, 106, .03)); border: 1px solid var(--sx-line-au); font-size: var(--sx-fs2); }
#pbody .eco-wallet b { font-size: var(--sx-fs4); } #pbody .eco-wallet small { font-size: var(--sx-fs1); }
#panel .smwallet > span { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 6px; border-radius: 999px; background: rgba(4, 10, 32, .5); border: 1px solid var(--sx-line); white-space: nowrap; }
#panel .smwallet img, #panel .smwallet .ii { width: 18px; height: 18px; }
#panel .smwallet b { color: var(--sx-gold3); }
#pbody .eco-steps { display: grid; gap: 3px; margin: 0 0 10px; padding: 10px 14px; border-radius: var(--sx-rm); background: rgba(63, 125, 255, .1); border: 1px solid var(--sx-line2); }
#pbody .eco-steps b { color: var(--sx-gold3); font-size: var(--sx-fs3); } #pbody .eco-steps span { font-size: var(--sx-fs2); }
#pbody .eco-bar { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 8px; margin: 10px -4px 0; padding: 10px;
  border-radius: var(--sx-rl); background: linear-gradient(180deg, #13296a, #0a1638); border: 1px solid var(--sx-line-au); box-shadow: 0 -8px 20px rgba(0, 0, 0, .45); }
#pbody .eco-bar .eco-barsum { flex: 1; min-width: 0; font-size: var(--sx-fs2); color: var(--sx-tx2); } #pbody .eco-bar .eco-barsum b { color: var(--sx-tx); }
#pbody .eco-bar .eco-barsum.bad, #pbody .eco-bar .eco-barsum.bad b { color: var(--sx-down); }
#pbody .eco-bar button { min-height: 46px; padding: 0 16px; white-space: nowrap; }
#pbody .eco-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: var(--sx-fs4); }
/* the big call to action under a window */
#pbody > button.big, #pbody button.big { width: 100%; min-height: 50px; margin-top: 10px; border-radius: var(--sx-rl); font: 700 var(--sx-fs4) var(--sx-font); }
#pbody > button.big { position: sticky; bottom: 0; z-index: 3; box-shadow: 0 -6px 18px rgba(0, 0, 0, .45); }
#pbody button.big:not([disabled]) { background: var(--sx-btn-au) !important; color: var(--sx-gold-ink) !important; border-color: #fff0b8 !important; }
#pbody button.big[disabled] { opacity: 1; filter: none; background: #142a5e !important; color: var(--sx-tx3) !important; }
#pbody button.wide { width: 100%; min-height: 44px; margin-top: 6px; }
#pbody button.gdanger, #pbody .gdanger { color: #ffc0c8 !important; border-color: rgba(255, 111, 134, .5) !important; }
#pbody button .why { display: block; font-size: var(--sx-fs1); color: #ffb0be; font-weight: 600; }

/* ==========================================================================================================
   V3 windows
   ========================================================================================================== */
/* ---------- shop: wallet + item cards in a grid with ×1 / ×10 price buttons ---------- */
#panel[data-kind="shop"] #pbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 10px; align-content: start; }
#panel[data-kind="shop"] #pbody > :not(.shoprow) { grid-column: 1 / -1; }
#pbody .shop2 { align-items: center; }
#pbody .shop2 .shopb { display: grid; place-items: center; min-width: 74px; min-height: 48px; padding: 2px 8px; line-height: 1.1; border-radius: 12px; font-weight: 700; }
#pbody .shop2 .shopb small { font-size: var(--sx-fs1); color: var(--sx-gold) !important; font-weight: 700; }
#pbody .shop2 .shopb:disabled small { color: var(--sx-tx3) !important; }
#pbody .sellbox { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 8px; padding: 10px 12px; border-radius: var(--sx-rl);
  background: rgba(88, 240, 160, .07); border: 1px solid rgba(88, 240, 160, .3); }

/* ---------- smith: wallet pills, risk legend, refine rows with a coloured risk edge ---------- */
.rf-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 8px; }
.rf-legend span { display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; border-radius: var(--sx-rm); font-size: var(--sx-fs1); color: var(--sx-tx2); border: 1px solid; }
.rf-legend b { font-size: var(--sx-fs2); }
.rf-legend .safe { border-color: rgba(88, 240, 160, .45); background: rgba(88, 240, 160, .08); } .rf-legend .safe b { color: var(--sx-up); }
.rf-legend .drop { border-color: rgba(255, 196, 92, .5); background: rgba(255, 196, 92, .08); } .rf-legend .drop b { color: #ffd27a; }
.rf-legend .break { border-color: rgba(255, 111, 134, .6); background: rgba(255, 111, 134, .1); } .rf-legend .break b { color: var(--sx-down); }
#pbody .rf-guard { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin: 0 0 8px; padding: 6px 12px !important; text-align: left; border-radius: var(--sx-rm); }
#pbody .rf-guard i { font-style: normal; font-size: 18px; width: 24px; text-align: center; }
#pbody .rf-guard span { display: flex; flex-direction: column; font-size: var(--sx-fs3); color: var(--sx-gold3); } #pbody .rf-guard small { font-size: var(--sx-fs1); font-weight: 400; }
#pbody .rf-guard.on { border-color: rgba(95, 225, 255, .8) !important; background: linear-gradient(180deg, rgba(95, 225, 255, .22), rgba(95, 225, 255, .06)) !important; box-shadow: 0 0 12px rgba(95, 225, 255, .25); }
#pbody .shoprow.rf { border-left: 4px solid transparent; }
#pbody .shoprow.rk-safe { border-left-color: rgba(88, 240, 160, .75); } #pbody .shoprow.rk-drop { border-left-color: rgba(255, 196, 92, .8); }
#pbody .shoprow.rk-break { border-left-color: var(--sx-down); background: linear-gradient(90deg, rgba(255, 111, 134, .12), transparent 40%), var(--sx-card); }
#pbody .shoprow.rk-guard { border-left-color: var(--sx-cyan); }
#pbody .rf-to { font-size: var(--sx-fs2); color: var(--sx-tx2); } #pbody .rf-to b { color: var(--sx-gold3); }
#pbody .rf-gain { margin-left: 8px; font-size: var(--sx-fs2); font-weight: 700; color: var(--sx-up); }
#pbody .rf-risk { display: block; font-size: var(--sx-fs2); margin-top: 1px; }
#pbody .rk-safe .rf-risk { color: var(--sx-up); } #pbody .rk-drop .rf-risk { color: #ffd27a; } #pbody .rk-break .rf-risk { color: var(--sx-down); font-weight: 700; } #pbody .rk-guard .rf-risk { color: var(--sx-cyan); }
#pbody .rf-cost { display: block; font-size: var(--sx-fs1); color: var(--sx-tx3); }
#panel[data-kind="smith"] #pbody .shoprow > button { min-width: 96px; min-height: 46px; }
@media (max-height: 500px) { #panel[data-kind="smith"] .dq { display: none; } .rf-legend span { padding: 3px 6px; } }

/* ---------- market: search row, listing cards (price big), page buttons ---------- */
#pbody .mkfind { display: flex; flex-direction: row; flex-wrap: wrap; align-items: stretch; gap: 6px; margin-bottom: 8px; }
#pbody .mkfind #mkq { flex: 1 1 160px; } #pbody .mkfind select { flex: 1 1 150px; } #pbody .mkfind button { min-height: 40px; }
#panel[data-kind="market"] #pbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 10px; align-content: start; }
#panel[data-kind="market"] #pbody > :not(.mkrow) { grid-column: 1 / -1; }
#pbody .mkrow b.gold { font-size: var(--sx-fs4); }
#pbody .mkacts { display: flex; flex-direction: column; gap: 6px; } #pbody .mkacts button { min-height: 40px; min-width: 76px; }
#pbody .mkacts .mkw { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 8px; font-size: var(--sx-fs1); }
#pbody .mkacts .mkw .uic { width: 18px; height: 18px; }
#pbody .mkpg { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 8px 0; font-size: var(--sx-fs2); }
#pbody .mkpg button { min-width: 44px; min-height: 40px; font-size: 18px; border-radius: 50%; }

/* ---------- mail: letters as cards, attachments as chips ---------- */
#pbody .dqlist { display: grid; gap: 8px; margin: 6px 0; }
#pbody .dqrow { margin: 0; } #pbody .dqrow > div { flex: 1; } #pbody .dqrow button { min-height: 44px; min-width: 96px; }
#pbody .dqrow .rw { display: block; margin-top: 4px; color: #ffe3a0; } #pbody .dqrow.done { opacity: .6; }
#pbody .dqrow .vn { width: 70px; }
#pbody .dqgo, #pbody .dqrow .dqrr { min-height: 44px !important; min-width: 0 !important; padding: 0 12px; margin-left: 4px; font-size: var(--sx-fs2); white-space: nowrap; }
#pbody .mlrow2 { align-items: flex-start; } #pbody .mlrow2.has { border-color: var(--sx-line-au); background: linear-gradient(90deg, rgba(255, 213, 106, .1), transparent 50%), var(--sx-card); }
#pbody .mltext, .u-dlg .mltext { margin: 6px 0 0; padding: 8px 10px; border-radius: 10px; background: rgba(4, 10, 32, .45); color: var(--sx-tx); font-size: var(--sx-fs3); line-height: 1.5; word-break: break-word; }
#pbody .mlatt { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
#pbody .mlatt span { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px 2px 4px; border-radius: 999px; background: rgba(4, 10, 32, .5); border: 1px solid var(--sx-line); font-size: var(--sx-fs1); }
#pbody .mlatt span.g { color: var(--sx-gold); } #pbody .mlatt .pxi { width: 22px; height: 22px; }
@media (max-width: 560px) { #pbody .dqrow { flex-wrap: wrap; } #pbody .dqrow > div { flex-basis: 100%; } #pbody .dqrow button { flex: 1; } }

/* ---------- storage / trade: two item panes of rarity tiles ---------- */
#pbody .stbox { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0; }
#pbody .stbox > div { min-width: 0; padding: 10px; border-radius: var(--sx-rl); background: var(--sx-card); border: 1px solid var(--sx-line); }
#pbody .stbox > div > b { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--sx-gold3); }
#pbody .stbox .stdir { display: block; width: 100%; font-weight: 400; font-size: var(--sx-fs1); color: var(--sx-cyan) !important; }
#pbody .bag { display: grid; grid-template-columns: repeat(auto-fill, 56px); gap: 6px; justify-content: start; align-content: start; min-height: 60px; }
#pbody .cell { position: relative; display: grid; place-items: center; width: 56px; height: 56px; padding: 0 !important; border-radius: 10px !important;
  background: radial-gradient(circle at 50% 30%, #23418a, #0d1b45 70%) !important; border: 1.5px solid #4a5e92 !important; box-shadow: inset 0 0 10px rgba(95, 150, 255, .15) !important; image-rendering: pixelated; }
#pbody .cell.r1 { border-color: #3fd877 !important; } #pbody .cell.r2 { border-color: #3fa3ff !important; } #pbody .cell.r3 { border-color: #b75cff !important; } #pbody .cell.r4 { border-color: #ff9a22 !important; }
#pbody .cell .pxi { width: 38px; height: 38px; }
#pbody .cell b { position: absolute; right: 3px; bottom: 2px; padding: 0; background: none; font: 700 11px var(--sx-font); color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
#pbody .cell.sel { border-color: var(--sx-gold3) !important; box-shadow: 0 0 0 2px var(--sx-gold), 0 0 12px rgba(255, 205, 96, .5) !important; }
#pbody .cell.empty { opacity: 1; background: rgba(8, 18, 48, .6) !important; border-style: dashed !important; border-color: rgba(90, 120, 190, .4) !important; }
#pbody .cell.gear u { position: absolute; left: 3px; top: 1px; font-size: 9px; text-decoration: none; color: var(--sx-up); }
#pbody .cell.gear s { position: absolute; right: 3px; top: 0; font-size: 10px; text-decoration: none; color: var(--sx-cyan); letter-spacing: -2px; }
#pbody .cell.gear b { color: var(--sx-gold3); }
#pbody .trside .bag, #pbody .trbag { grid-template-columns: repeat(auto-fill, 50px); } #pbody .trside .cell, #pbody .trbag .cell { width: 50px; height: 50px; }
#pbody .cell:active { transform: scale(.95); }
@media (max-width: 600px) { #pbody .stbox { grid-template-columns: 1fr; } }

/* ---------- my shop / player shop: a table of cards ---------- */
#pbody .vlist { display: grid; gap: 6px; margin: 6px 0; }
#pbody .vrow { display: grid; grid-template-columns: 24px 36px 1fr 76px 110px; align-items: center; gap: 8px; padding: 6px 10px; }
#pbody .vrow.mlrow { grid-template-columns: 24px 36px 1fr 76px; }
#pbody .vrow:has(input[data-vk^="g:"]) { grid-template-columns: 24px 36px 1fr 76px 110px; } /* window markup only, never hot state */
#pbody .vrow .pxi { width: 32px; height: 32px; image-rendering: pixelated; } #pbody .vrow input[type=number] { width: 100%; }
#pbody .vrow.locked { opacity: .5; } #pbody .vrow.nopr { border-color: var(--sx-down); } #pbody .vrow.nopr .vp { border-color: var(--sx-down) !important; }
#pbody .vrow .vone { text-align: center; color: var(--sx-tx3); font-size: var(--sx-fs1); }
#pbody .vhead { display: grid; grid-template-columns: 24px 36px 1fr 76px 110px; gap: 8px; padding: 0 10px; font-size: var(--sx-fs1); color: var(--sx-tx3); }
#pbody .vhead span:first-child { grid-column: 1 / 4; }

/* ---------- guild: crest header, notice board, member cards ---------- */
#pbody .ghead { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; padding: 12px 14px; border-radius: var(--sx-rl);
  background: radial-gradient(60% 120% at 0% 0%, rgba(255, 213, 106, .2), transparent 60%), var(--sx-card); border: 1px solid var(--sx-line-au); }
#pbody .ghead .gemb { flex: none; width: 64px; height: 64px; display: grid; place-items: center; font-size: 32px;
  background: url(assets/ui/v4/skill-diamond.webp) center / 100% no-repeat, radial-gradient(circle, #2a55b8, #0b1a4c 70%); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
#pbody .ghead > div:last-child { flex: 1; min-width: 0; } #pbody .ghead b { font-size: var(--sx-fs5); color: var(--sx-gold3); } #pbody .ghead small { display: block; }
#pbody .gnext { color: var(--sx-cyan) !important; }
#pbody .gnotice { margin: 0 0 10px; padding: 10px 14px; border-radius: var(--sx-rm); font-size: var(--sx-fs3); background: rgba(88, 240, 160, .07); border: 1px dashed rgba(88, 240, 160, .4); }
#pbody .gnotice > small:first-child { display: block; margin-bottom: 2px; color: var(--sx-up) !important; font-size: var(--sx-fs1); }
#pbody .glist { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 0 10px; }
#pbody .glist em.on { color: var(--sx-up); font-style: normal; }
#pbody :is(.glist, .plist) .gbtn { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; } #pbody :is(.glist, .plist) .gbtn button { min-height: 40px; padding: 0 10px; font-size: var(--sx-fs2); }
#pbody .gdon { margin-top: 4px; }

/* ---------- ranking: podium for the top three, then rows ---------- */
#pbody .ranklist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 6px 0; max-height: none; overflow: visible; }
#pbody .rk { grid-column: 1 / -1; display: grid; grid-template-columns: 40px 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px 14px; }
#pbody .rk i { grid-row: 1 / 3; display: grid; place-items: center; width: 34px; height: 34px; font: 800 var(--sx-fs3) var(--sx-font); font-style: normal; color: var(--sx-tx2);
  border-radius: 50%; background: rgba(4, 10, 32, .5); border: 1px solid var(--sx-line); }
#pbody .rk b { font-size: var(--sx-fs3); } #pbody .rk small { grid-column: 2; font-size: var(--sx-fs1); }
#pbody .rk em { grid-column: 3; grid-row: 1 / 3; font-style: normal; font-weight: 800; color: var(--sx-gold3); }
#pbody .rk.me { border-color: var(--sx-cyan); box-shadow: 0 0 0 1px var(--sx-cyan), 0 0 14px rgba(95, 225, 255, .25); }
#pbody .rk:is(.top0, .top1, .top2) { grid-column: auto; grid-template-columns: 1fr; grid-template-rows: auto; justify-items: center; text-align: center; row-gap: 2px; padding: 14px 8px 12px; }
#pbody .rk:is(.top0, .top1, .top2) i { grid-row: auto; width: 54px; height: 54px; font-size: 30px; background: none; border: 0; }
#pbody .rk:is(.top0, .top1, .top2) :is(small, em) { grid-column: auto; grid-row: auto; }
#pbody .rk:is(.top0, .top1, .top2) b { font-size: var(--sx-fs4); }
#pbody .rk.top0 { order: -2; background: linear-gradient(180deg, rgba(255, 213, 106, .32), rgba(255, 213, 106, .06)), var(--sx-card); border-color: var(--sx-gold); padding-top: 20px; }
#pbody .rk.top1 { order: -3; background: linear-gradient(180deg, rgba(220, 230, 255, .2), rgba(220, 230, 255, .04)), var(--sx-card); border-color: #c6cfdf; margin-top: 14px; }
#pbody .rk.top2 { order: -1; background: linear-gradient(180deg, rgba(240, 160, 90, .22), rgba(240, 160, 90, .04)), var(--sx-card); border-color: #e9a26a; margin-top: 22px; }

/* ---------- login calendar: 7 reward tiles a row, today glows, claimed = check ---------- */
#pbody .logingrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
#pbody .lday { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 4px 6px; border-radius: 14px; border: 1px solid var(--sx-line); background: var(--sx-card); }
#pbody .lday small { font-size: var(--sx-fs1); color: var(--sx-tx3); } #pbody .lday .pxi { width: 34px; height: 34px; image-rendering: pixelated; }
#pbody .lday b { font-size: var(--sx-fs2); } #pbody .lday em { font-style: normal; font-size: var(--sx-fs1); color: var(--sx-gold); }
#pbody .lday.big { border-color: rgba(200, 108, 255, .6); background: radial-gradient(circle at 50% 30%, rgba(200, 108, 255, .3), transparent 70%), var(--sx-card); }
#pbody .lday.today { border-color: var(--sx-gold); background: radial-gradient(circle at 50% 30%, rgba(255, 213, 106, .4), transparent 70%), var(--sx-card); box-shadow: 0 0 0 1px var(--sx-gold), 0 0 16px rgba(255, 205, 96, .45); }
#pbody .lday.today small { color: var(--sx-gold3); font-weight: 700; }
#pbody .lday.today::before { content: 'วันนี้'; position: absolute; top: -9px; left: 50%; transform: translateX(-50%); padding: 0 8px; border-radius: 999px; font: 700 10px/16px var(--sx-font); color: var(--sx-gold-ink); background: var(--sx-btn-au); }
:lang(en) #pbody .lday.today::before { content: 'Today'; } /* English page (i18n.js trDom sets <html lang="en">) */
:lang(en) #pbody .lday > small { white-space: nowrap; letter-spacing: -.02em; } /* 'Day 20' on one line in the 7-column phone grid */
#pbody .lday.done { opacity: .5; } #pbody .lday.done::after { content: '✓'; position: absolute; top: 4px; right: 6px; color: var(--sx-up); font-weight: 800; }

/* ---------- achievements + titles: trophy cards ---------- */
#pbody .achgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 8px; }
#pbody .ach { display: grid; gap: 2px; min-height: 76px; padding: 10px 12px !important; text-align: left; border-radius: 14px !important; opacity: 1;
  background: rgba(8, 18, 48, .45) !important; border: 1px dashed var(--sx-line2) !important; box-shadow: none !important; }
#pbody .ach b { font-size: var(--sx-fs3); color: var(--sx-tx2); } #pbody .ach small { font-size: var(--sx-fs1); color: var(--sx-tx3); } #pbody .ach em { font-style: normal; font-size: var(--sx-fs1); color: rgba(255, 213, 106, .55); }
#pbody .ach.got { background: radial-gradient(90% 120% at 0% 0%, rgba(255, 213, 106, .2), transparent 60%), var(--sx-card) !important; border: 1px solid var(--sx-line-au) !important; }
#pbody .ach.got b { color: var(--sx-gold3); } #pbody .ach.got small { color: var(--sx-tx2); } #pbody .ach.got em { color: var(--sx-gold); }
#pbody .ach.rare.got { border-color: #c86cff !important; background: radial-gradient(90% 120% at 0% 0%, rgba(200, 108, 255, .28), transparent 60%), var(--sx-card) !important; }
#pbody .ach.on { box-shadow: 0 0 0 2px var(--sx-gold), 0 0 14px rgba(255, 205, 96, .4) !important; }
#pbody button.ach[disabled] { opacity: 1; filter: none; }

/* ---------- shrine: class cards with the hero, tier headers ---------- */
#pbody .jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 10px; }
#pbody .jobs > .tierh { grid-column: 1 / -1; }
#pbody .job { align-items: flex-start; }
#pbody .job canvas { flex: none; width: 76px; height: 76px; border-radius: 12px; image-rendering: auto;
  background: radial-gradient(70% 60% at 50% 80%, rgba(95, 225, 255, .3), transparent 70%), rgba(4, 10, 32, .5); }
#pbody .job > div > b { font-size: var(--sx-fs4); color: var(--sx-gold3); } #pbody .job small { font-size: var(--sx-fs1); line-height: 1.5; }
#pbody .job .sty { color: var(--sx-tx2) !important; } #pbody .job .m { color: var(--sx-gold) !important; }
#pbody .job em { font-style: normal; color: var(--sx-up); font-size: var(--sx-fs1); white-space: nowrap; align-self: center; }
#pbody .job > button { align-self: center; min-height: 44px; }
#pbody .job.cur { border-color: var(--sx-gold); box-shadow: 0 0 0 1px var(--sx-gold), 0 0 14px rgba(255, 205, 96, .3); }
#pbody .job.lock canvas { filter: grayscale(1) brightness(.6); } #pbody .job.lock > div { color: var(--sx-tx3); } #pbody .job.lock > div > b { color: var(--sx-tx2); }
#pbody .jqbox { margin: 0 0 12px; padding: 12px 14px; border-radius: var(--sx-rl); background: var(--sx-card); border: 1px solid var(--sx-line-au); }
#pbody .jqbox ol { margin: 8px 0; padding-left: 20px; } #pbody .jqbox li.done { color: var(--sx-up); } #pbody .jqbox li.cur { color: var(--sx-gold3); font-weight: 700; }
#pbody .skbtns { display: flex; gap: 6px; flex-wrap: wrap; } #pbody .skbtns button { min-height: 44px; flex: 1; }

/* ---------- pets + soul book ---------- */
#pbody .rn2 .pet { gap: 12px; padding: 10px 12px; }
#pbody .ranch .pet img, #pbody .mon img { width: 52px; height: 52px; image-rendering: pixelated; object-fit: contain; flex: none; }
#pbody .rn2 .rn-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; } #pbody .rn2 .rn-t b { font-size: var(--sx-fs4); } #pbody .rn2 .rn-plus { font-style: normal; color: var(--sx-gold3); }
#pbody .rn2 .rn-out { font-size: var(--sx-fs1); color: #ff9ac4; font-weight: 700; } #pbody .rn2 .u-bar { max-width: 280px; }
#pbody .rn2 .pbtn { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 54%; } #pbody .rn2 .pbtn .u-btn { min-height: 40px; font-size: var(--sx-fs2); padding: 0 12px; white-space: nowrap; }
#pbody .pet.act { border-color: #ff8ab8; box-shadow: 0 0 0 1px #ff8ab8, 0 0 14px rgba(255, 138, 184, .25); } #pbody .pet.sel { background: rgba(255, 138, 184, .12); }
#pbody .pet .bar, #pbody .mon .bar { height: 5px; margin-top: 4px; border-radius: 3px; overflow: hidden; background: var(--sx-well); } #pbody .pet .bar i, #pbody .mon .bar i { display: block; height: 100%; background: var(--sx-exp); }
#pbody .book { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
#pbody .book .mon { margin: 0; cursor: pointer; } #pbody .book .mon.sel { border-color: var(--sx-gold); box-shadow: 0 0 0 1px var(--sx-gold); }
#pbody .mon.unk img { filter: brightness(0) drop-shadow(0 0 1px rgba(95, 150, 255, .7)); opacity: .55; } #pbody .book .bkm { font-style: normal; font-size: var(--sx-fs2); margin-left: 4px; }
@media (max-width: 600px) { #pbody .rn2 .pet { flex-wrap: wrap; } #pbody .rn2 .pbtn { max-width: none; width: 100%; } #pbody .rn2 .pbtn .u-btn { flex: 1; } }

/* ---------- town guide, PvP / arena cards, lab dummies, cosmetics, news, help ---------- */
#panel[data-kind="guide"] .guide { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
#panel .guide .gdn { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 12px; text-align: left; }
#panel .guide .gdn > i { flex: none; display: grid; place-items: center; width: 40px; height: 40px; font-style: normal; font-size: 20px; border-radius: 10px; background: radial-gradient(circle, #23418a, #0d1b45 70%); }
#panel .guide .gdn > i .uic { width: 28px; height: 28px; }
#panel .guide .gdn span { flex: 1; min-width: 0; display: flex; flex-direction: column; } #panel .guide .gdn b { font-size: var(--sx-fs3); color: var(--sx-gold3); } #panel .guide .gdn small { font-size: var(--sx-fs1); }
#panel .guide .gdn em { font-style: normal; font-size: var(--sx-fs1); color: var(--sx-cyan); white-space: nowrap; }
#pbody .pvcard { margin: 0 0 10px; padding: 12px 14px; } #pbody .pvcard h4 { margin: 0 0 4px; font-size: var(--sx-fs4); color: var(--sx-gold3); } #pbody .pvcard p { margin: 4px 0; font-size: var(--sx-fs2); color: var(--sx-tx2); }
#pbody .pvrow { display: flex; gap: 8px; flex-wrap: wrap; } #pbody .pvrow > button { flex: 1; min-height: 44px; }
#pbody .lab-dum { margin: 0 0 10px; padding: 10px 12px; } #pbody .ld-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; } #pbody .ld-h b { color: var(--sx-gold3); font-size: var(--sx-fs4); }
#pbody .lab-dum .seg { margin: 4px 0; }
#pbody .cos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
#pbody .cos-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; text-align: center; }
#pbody .cos-item.on { border-color: var(--sx-gold); box-shadow: 0 0 0 1px var(--sx-gold), 0 0 14px rgba(255, 205, 96, .3); }
#pbody .cos-item b { font-size: var(--sx-fs3); } #pbody .cos-item .u-btn { min-height: 40px; min-width: 100px; }
#pbody .prem-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 10px; padding: 10px 14px; border-radius: var(--sx-rl);
  background: radial-gradient(80% 140% at 0% 50%, rgba(95, 225, 255, .22), transparent 60%), var(--sx-card); border: 1px solid rgba(95, 225, 255, .45); }
#pbody .crys-big b { font-size: var(--sx-fs6); color: #bff4ff; }
#pbody .nw2list { display: flex; flex-direction: column; gap: 8px; }
#pbody .nw2 { padding: 12px 14px; } #pbody .nw2 header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } #pbody .nw2 header b { color: var(--sx-gold3); font-size: var(--sx-fs4); }
#pbody .nw2 time { margin-left: auto; font-size: var(--sx-fs1); color: var(--sx-tx3); } #pbody .nw2 p { margin: 6px 0 0; font-size: var(--sx-fs3); line-height: 1.6; color: var(--sx-tx2); }
#pbody .nw2 .nt { font-style: normal; font-size: var(--sx-fs1); font-weight: 700; padding: 1px 8px; border-radius: 999px; }
#pbody .nw2 .nt.new { background: rgba(88, 240, 160, .18); color: var(--sx-up); } #pbody .nw2 .nt.fix { background: rgba(95, 225, 255, .18); color: var(--sx-cyan); } #pbody .nw2 .nt.bal { background: rgba(255, 213, 106, .18); color: var(--sx-gold); }
#pbody .help { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
#pbody .help p { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--sx-card); border: 1px solid var(--sx-line); line-height: 1.65; font-size: var(--sx-fs2); color: var(--sx-tx2); }
#pbody .help p b { display: block; margin-bottom: 4px; font-size: var(--sx-fs3); color: var(--sx-gold3); }
#pbody .help em { font-style: normal; font-weight: 700; color: var(--sx-gold3); } #pbody .help em.hk { color: var(--sx-up); }
body:not(.pc) #pbody .help .kb, body.pc #pbody .help .mob { order: 9; opacity: .7; }

/* ---------- settings: option cards two a row ---------- */
#pbody .setbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 8px; }
#pbody .srow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; }
#pbody .srow > div:first-child { flex: 1 1 200px; display: grid; gap: 2px; } #pbody .srow b { font-size: var(--sx-fs3); } #pbody .srow small { font-size: var(--sx-fs1); line-height: 1.4; }
#pbody .srow > button { min-height: 42px; padding: 0 14px; }
#pbody .srow .sval { display: flex; align-items: center; gap: 8px; flex: 1 1 200px; } #pbody .srow .sval input { flex: 1; height: 32px; } #pbody .srow .sval b { width: 44px; text-align: right; }

/* ---------- new player guide: progress + checklist ---------- */
.nbw { display: flex; flex-direction: column; gap: 10px; }
#pbody .nbtop { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--sx-rl); background: radial-gradient(80% 140% at 0% 50%, rgba(255, 213, 106, .18), transparent 60%), var(--sx-card); border: 1px solid var(--sx-line-au); }
#pbody .nbprog b { color: var(--sx-gold3); }
#pbody .nbprog i { display: block; height: 10px; margin-top: 6px; border-radius: 5px; background: linear-gradient(90deg, var(--sx-gold) var(--k), rgba(255, 255, 255, .08) var(--k)); box-shadow: 0 0 10px rgba(255, 205, 96, .3); }
#pbody .nbsw button, #pbody .nbrow button { min-height: 40px; padding: 0 14px; border-radius: 10px; }
#pbody .nbgrp h4 small { font-weight: 400; color: var(--sx-tx3); font-size: var(--sx-fs1); }
#pbody .nbrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 6px; }
#pbody .nbrow .nbic { flex: 0 0 40px; height: 40px; display: grid; place-items: center; font-style: normal; font-size: 20px; border-radius: 10px; background: radial-gradient(circle, #23418a, #0d1b45 70%); }
#pbody .nbrow .nbtx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } #pbody .nbrow .nbtx b { font-size: var(--sx-fs3); } #pbody .nbrow .nbtx small { font-size: var(--sx-fs1); line-height: 1.45; }
#pbody .nbrow .nbst { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; } #pbody .nbrow .nbst span { font-size: var(--sx-fs1); color: var(--sx-tx3); white-space: nowrap; }
#pbody .nbrow .nbx { min-height: 40px; padding: 0 12px; font-size: var(--sx-fs2); }
#pbody .nbrow.done { opacity: .6; } #pbody .nbrow.done .nbst span { color: var(--sx-up); font-size: 16px; }
#pbody .nbrow.now { border-color: var(--sx-gold); box-shadow: 0 0 0 1px rgba(255, 213, 106, .45), 0 0 14px rgba(255, 205, 96, .2); } #pbody .nbrow.now .nbst span { color: var(--sx-gold3); font-weight: 700; }
#pbody .nbrow.open .nbst span { color: var(--sx-cyan); }
#pbody .nbrow.lock .nbtx small { display: none; } #pbody .nbrow.done .nbtx small:not(.nbgift) { display: none; }
#pbody .nbrow.lock .nbst { max-width: 46%; } #pbody .nbrow.lock .nbst span { white-space: normal; text-align: right; }
@media (max-width: 520px) { #pbody .nbrow.open, #pbody .nbrow.now { flex-wrap: wrap; } #pbody .nbrow .nbst { flex-direction: row; align-items: center; justify-content: flex-end; }
  #pbody .nbrow.open .nbst, #pbody .nbrow.now .nbst { width: 100%; } #pbody .nbrow:not(.open):not(.now) .nbst { flex: 0 1 auto; max-width: 42%; min-width: 0; } }

/* ---------- life skills: skill cards with an unlock strip ---------- */
#pbody .lsk { display: flex; gap: 12px; align-items: flex-start; flex: 1; }
#pbody .lsk > i { flex: none; display: grid; place-items: center; width: 48px; height: 48px; font-style: normal; font-size: 24px; border-radius: 12px; background: radial-gradient(circle, #23418a, #0d1b45 70%); border: 1.5px solid #4a5e92; }
#pbody .unl { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
#pbody .unl span { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px 2px 4px; border-radius: 999px; font-size: var(--sx-fs1); color: var(--sx-tx3); background: rgba(4, 10, 32, .5); border: 1px solid var(--sx-line); }
#pbody .unl span.ok { color: var(--sx-up); border-color: rgba(88, 240, 160, .45); } #pbody .unl .pxi { width: 20px; height: 20px; }

/* ---------- small screens: grids fold to one column ---------- */
@media (max-width: 700px) {
  #panel:is([data-kind="shop"], [data-kind="market"]) #pbody { display: block; }
  #pbody :is(.glist, .jobs, .guide, .help, .setbody, .achgrid, .book) { grid-template-columns: 1fr; }
  #pbody .logingrid { gap: 4px; } #pbody .lday .pxi { width: 26px; height: 26px; } #pbody .lday em { display: none; }
}
@media (max-height: 500px) { #pbody .setbody, #pbody .help { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); } #pbody .glist { grid-template-columns: 1fr 1fr; } }
/* shop cards: name + price buttons under it (the row squeezed the name into two lines) */
#pbody .shop2 { display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 8px 10px; align-items: center; }
#pbody .shop2 > .sic { grid-row: 1; grid-column: 1; } #pbody .shop2 > div { grid-row: 1; grid-column: 2 / 4; }
#pbody .shop2 > .shopb { grid-row: 2; min-height: 44px; display: flex; gap: 6px; justify-content: center; } #pbody .shop2 > .shopb:nth-of-type(1) { grid-column: 1 / 3; } #pbody .shop2 > .shopb:nth-of-type(2) { grid-column: 3; }
#pbody .shop2 > .shopb small { font-size: var(--sx-fs2); }
@media (max-height: 500px) { #pbody .rk:is(.top0, .top1, .top2) { padding: 8px 6px; } #pbody .rk:is(.top0, .top1, .top2) i { width: 36px; height: 36px; font-size: 22px; } #pbody .rk.top1, #pbody .rk.top2 { margin-top: 6px; } }

/* ---------- status window: hero on the pedestal, stat rows as cards with a gold +, derived stats in tiles ---------- */
#pbody .cs2 { gap: 14px; }
#pbody .cs2-id { padding: 12px 14px; border-radius: var(--sx-rl); background: radial-gradient(80% 140% at 0% 0%, rgba(255, 213, 106, .18), transparent 60%), var(--sx-card); border: 1px solid var(--sx-line-au); }
#pbody .cs2-id .nm b { font-size: var(--sx-fs5); color: var(--sx-gold3); }
#pbody .doll { border-radius: var(--sx-rl); background: radial-gradient(60% 50% at 50% 70%, rgba(95, 225, 255, .22), transparent 70%), var(--sx-card); border: 1px solid var(--sx-line); padding: 10px 8px 18px; }
#pbody .doll .stage { position: relative; }
#pbody .doll .stage::before { content: ''; position: absolute; left: 50%; bottom: 2px; width: 168px; height: 56px; opacity: .85; transform: translateX(-50%); pointer-events: none;
  background: url(assets/ui/v4/pedestal.webp) center / contain no-repeat; }
#pbody .doll canvas.hero2 { position: relative; }
#pbody .radarbox { border-radius: var(--sx-rl); }
#pbody .pts2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 14px; border-radius: var(--sx-rl);
  background: radial-gradient(80% 140% at 0% 50%, rgba(95, 225, 255, .18), transparent 60%), var(--sx-card); border: 1px solid rgba(95, 225, 255, .4); }
#pbody .pts2 b { font: 800 var(--sx-fs6)/1 var(--sx-font); color: var(--sx-cyan); }
#pbody .arow2 { display: grid; grid-template-columns: 76px 1fr auto auto auto auto; align-items: center; gap: 8px; margin: 0 0 6px; padding: 6px 8px 6px 10px; border-radius: 12px; background: var(--sx-card); border: 1px solid var(--sx-line); }
#pbody .arow2 .k { font: 800 var(--sx-fs3) var(--sx-font); color: var(--sx-gold3); cursor: help; } #pbody .arow2 .k small { display: block; font-weight: 500; }
#pbody .arow2 .v { font: 800 var(--sx-fs5) var(--sx-font); } #pbody .arow2 .v em { font-style: normal; font-size: var(--sx-fs2); color: var(--sx-cyan); margin-left: 3px; } #pbody .arow2 .v .add { color: var(--sx-up); }
#pbody .arow2 .cost { font-size: var(--sx-fs1); color: var(--sx-tx3); white-space: nowrap; }
#pbody .arow2 .u-btn { min-width: 44px; min-height: 40px; padding: 0 8px; }
#pbody .arow2.st { border-color: rgba(88, 240, 160, .5); } #pbody .arow2.flash-up { animation: sxFlash .5s var(--sx-ease); } @keyframes sxFlash { 0% { background: rgba(88, 240, 160, .35); } }
#pbody .der2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
#pbody .der2 .u-stat { padding: 8px 10px; border-radius: 10px; background: var(--sx-card) !important; border: 1px solid var(--sx-line); }
#pbody .info2 { padding: 8px 12px; border-radius: var(--sx-rm); font-size: var(--sx-fs2); color: var(--sx-tx2); background: rgba(63, 125, 255, .08); border: 1px solid var(--sx-line); }
#pbody .cs2-right .pend { position: sticky; bottom: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding: 10px;
  border-radius: var(--sx-rl); background: linear-gradient(180deg, #13296a, #0a1638); border: 1px solid rgba(88, 240, 160, .55); box-shadow: 0 -8px 20px rgba(0, 0, 0, .45); }
#pbody .cs2-right .pend span { flex: 1; font-size: var(--sx-fs2); color: var(--sx-tx2); } #pbody .cs2-right .pend .u-btn { min-height: 44px; }
#pbody .mast { font-size: var(--sx-fs2); color: var(--sx-tx2); } #pbody .elstat { margin: 8px 0; }

/* ---------- monster cards: portrait cards with rarity frames, album sections as cards ---------- */
#pbody .cd2 { border-radius: 12px !important; }
#pbody .cd2-prog { border-radius: var(--sx-rl); }
#pbody .cd2-sec, #pbody .cd2-set { border-radius: var(--sx-rl); background: var(--sx-card); border: 1px solid var(--sx-line); }
#pbody .cd2.sel { box-shadow: 0 0 0 2px var(--sx-gold), 0 0 16px rgba(255, 205, 96, .5) !important; }
#pbody .cd2-side { border-radius: var(--sx-rl); background: radial-gradient(100% 50% at 70% 0%, rgba(95, 225, 255, .14), transparent 70%), var(--sx-card); border: 1px solid var(--sx-line2); }
#pbody .cd2-side .inv-empty { padding: 18px; color: var(--sx-tx3); } #pbody .cd2-side .inv-empty b { display: block; color: var(--sx-tx2); font-size: var(--sx-fs4); }
#pbody .cd2-side .inv-acts { display: flex; flex-wrap: wrap; gap: 6px; } #pbody .cd2-side .inv-acts .u-btn { flex: 1 1 auto; }

/* ---------- the main menu (☰): window chrome, tiles with an icon medallion ---------- */
#hud #menu { background: var(--sx-win) !important; border: 1px solid var(--sx-line2) !important; border-radius: var(--sx-rl) !important; box-shadow: var(--sx-sh2) !important; }
#hud #menu > header { border-bottom-color: var(--sx-line) !important; } #hud #menu > header b { color: var(--sx-gold3) !important; font: 700 var(--sx-fs5) var(--sx-font) !important; }
#hud #menuX { border-radius: 50% !important; background: radial-gradient(circle at 40% 30%, #2a4a9a, #12245a) !important; border: 1px solid var(--sx-line-au) !important; color: var(--sx-gold3) !important; }
#hud #menu .mgrp { background: var(--sx-card) !important; border: 1px solid var(--sx-line) !important; border-radius: var(--sx-rl) !important; }
#hud #menu .mgrp.sys { background: rgba(8, 18, 48, .4) !important; border-style: dashed !important; }
#hud #menu .mgrp > h4 { color: var(--sx-gold) !important; font: 700 var(--sx-fs3) var(--sx-font) !important; }
#hud #menu .mgrp > h4::before { width: 7px !important; height: 7px !important; border-radius: 0 !important; transform: rotate(45deg); background: var(--sx-gold) !important; box-shadow: 0 0 6px rgba(255, 205, 96, .7); }
#hud #menu .mgrp button { background: linear-gradient(180deg, rgba(48, 86, 180, .28), rgba(14, 28, 70, .4)) !important; border: 1px solid var(--sx-line) !important; border-radius: 14px !important; box-shadow: var(--sx-in) !important; }
#hud #menu .mgrp button:hover { border-color: var(--sx-line-au) !important; background: linear-gradient(180deg, rgba(255, 213, 106, .2), rgba(14, 28, 70, .4)) !important; }
#hud #menu .mgrp button span { color: var(--sx-tx) !important; font-weight: 600 !important; }
#hud #menu .mgrp button u { color: var(--sx-gold3) !important; background: rgba(4, 10, 32, .85) !important; }

/* ---------- big map: the window chrome, pill tabs ---------- */
#bigMap { background: rgba(2, 6, 18, .62) !important; }
#bigMap .bm-box { background: var(--sx-win) !important; border: 1px solid var(--sx-line2) !important; border-radius: var(--sx-rl); box-shadow: var(--sx-sh2) !important; }
#bigMap header { background: linear-gradient(180deg, rgba(95, 150, 255, .14), rgba(95, 150, 255, 0)) !important; border-bottom: 1px solid var(--sx-line) !important; }
#bigMap h2 { color: var(--sx-gold3) !important; font: 700 var(--sx-fs4) var(--sx-font) !important; }
#bigMap .bm-tabs { display: flex; gap: 4px; padding: 3px; border-radius: var(--sx-rm); background: var(--sx-well); border: 1px solid var(--sx-line); }
#bigMap .bm-tabs button { min-height: 40px; padding: 0 14px; border-radius: 9px !important; background: transparent !important; border: 1px solid transparent !important; color: var(--sx-tx3) !important; font: 600 var(--sx-fs2) var(--sx-font); box-shadow: none !important; }
#bigMap .bm-tabs button.on { color: var(--sx-gold3) !important; border-color: var(--sx-line-au) !important; background: linear-gradient(180deg, rgba(255, 213, 106, .3), rgba(255, 213, 106, .1)) !important; }
#bigMap #wmInfo { background: rgba(4, 10, 32, .35); }

/* ---------- tooltips / item cards, toasts, the knocked-out box, player menu, invites, tame offer ---------- */
#tip .tipcard .tiph b, .ic2 .tiph b { color: var(--sx-gold3); }
.tipcard .tipgrid span, .ic2-sec { border-color: var(--sx-line) !important; }
#nq .nqi { background: linear-gradient(180deg, rgba(20, 44, 110, .94), rgba(8, 18, 52, .94)) !important; border: 1px solid var(--sx-line2) !important; border-left: 3px solid var(--sx-cyan) !important;
  border-radius: 999px !important; box-shadow: 0 6px 18px rgba(0, 0, 0, .45) !important; color: var(--sx-tx) !important; font: 600 var(--sx-fs3) var(--sx-font) !important; }
#nq .nq-ok { border-left-color: var(--sx-up) !important; } #nq .nq-bad { border-left-color: var(--sx-down) !important; }
#nq :is(.nq-rare, .nq-ann) { border-left-color: var(--sx-gold) !important; background: linear-gradient(180deg, rgba(110, 76, 14, .94), rgba(52, 34, 6, .94)) !important; }
#nq .nqgo { background: var(--sx-btn-au) !important; color: var(--sx-gold-ink) !important; border-color: #fff0b8 !important; border-radius: 999px !important; }
#deathBox { background: radial-gradient(90% 120% at 50% 0%, rgba(255, 79, 122, .28), transparent 60%), var(--sx-win) !important; border: 1px solid rgba(255, 111, 134, .6) !important; border-radius: var(--sx-rl) !important; box-shadow: var(--sx-sh2) !important; }
#deathBox p b { color: #ff9fb0 !important; font-size: var(--sx-fs5) !important; }
#deathBox button { background: var(--sx-btn) !important; border: 1px solid var(--sx-line2) !important; border-radius: var(--sx-rm) !important; color: var(--sx-tx) !important; font: 700 var(--sx-fs3) var(--sx-font) !important; }
#deathBox #riseBtn { background: var(--sx-btn-au) !important; color: var(--sx-gold-ink) !important; border-color: #fff0b8 !important; }
#deathBox #riseBtn:disabled { opacity: .45; filter: grayscale(.6); }
#pmenu, #pinv { background: var(--sx-win) !important; border: 1px solid var(--sx-line-au) !important; border-radius: var(--sx-rl) !important; box-shadow: var(--sx-sh2) !important; font-family: var(--sx-font); color: var(--sx-tx); }
#pmenu b { color: var(--sx-gold3); font-size: var(--sx-fs4); }
#pmenu button, #pinv button { background: var(--sx-btn); border: 1px solid var(--sx-line2); border-radius: var(--sx-rm); color: var(--sx-tx); font: 600 var(--sx-fs3) var(--sx-font); }
#pmenu button:hover { border-color: var(--sx-line-au); }
#pinv .ok { background: var(--sx-btn-au) !important; color: var(--sx-gold-ink) !important; border-color: #fff0b8 !important; }
#tame { background: linear-gradient(180deg, rgba(20, 44, 110, .95), rgba(8, 18, 52, .95)) !important; border: 1px solid rgba(88, 240, 160, .55) !important; border-radius: var(--sx-rl) !important; }
#tame button { background: var(--sx-btn) !important; border: 1px solid var(--sx-line2) !important; color: var(--sx-tx) !important; }
#tameYes { background: linear-gradient(180deg, #3ad88a, #1f9a5e) !important; color: #04281a !important; border-color: #a6ffd0 !important; }

/* ---------- title / login / characters: the same tokens (layout and art stay title.css) ---------- */
#title { --au: var(--sx-gold); --au2: var(--sx-gold3); --au3: var(--sx-gold2); --ln: var(--sx-line-au); --ln2: rgba(255, 210, 110, .18); --navy: rgba(10, 24, 66, .82); --okc: var(--sx-up); --bad: var(--sx-down); font-family: var(--sx-font); }
/* touch: stat names (tap = what it does) and the map zoom buttons reach 40 px; the shop table fits a 375 px phone */
body:not(.pc) #pbody .arow2 .k { min-height: 40px; display: flex; flex-direction: column; justify-content: center; }
body:not(.pc) #bigMap :is(.wm-tools, .hm-tools) button { min-width: 40px; min-height: 40px; }
@media (max-width: 480px) { #pbody .vrow, #pbody .vhead { grid-template-columns: 22px 30px minmax(0, 1fr) 54px 76px; gap: 5px; padding-left: 6px; padding-right: 6px; } #pbody .vrow:has(input[data-vk^="g:"]) { grid-template-columns: 22px 30px minmax(0, 1fr) 54px 76px; } }

/* ==========================================================================================================
   HD portraits + card art (2026-10-15, owner: "the portrait looks broken" / "card pictures look broken").
   HUD diamond = assets/ui/portrait/<art>.webp drawn at device resolution (ui.js portraitPx), smooth, not pixelated.
   Cards = assets/monsters/card/<img>.webp (320 px) filling the art window; hue variants via --hf.
   ========================================================================================================== */
#hud #portraitCv { image-rendering: auto; background: radial-gradient(circle at 50% 28%, #4a7ee0, #16285e 58%, #0a1238 85%); }

/* small diamond busts: party frame (sm) and the character window header (lg) */
.sx-bust { flex: none; position: relative; display: inline-block; width: 28px; height: 28px; vertical-align: middle;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: linear-gradient(160deg, #ffe7a6, #b07a2a); }
.sx-bust img { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); object-fit: cover; image-rendering: auto;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: radial-gradient(circle at 50% 28%, #4a7ee0, #16285e 60%, #0a1238); }
.sx-bust.lg { width: 52px; height: 52px; margin-right: 4px; }
#pbody .cs2-id .nm { align-items: center; }
#partyFrame .pmem:has(.sx-bust) { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 6px; align-items: center; padding-left: 5px; }
#partyFrame .pmem > .sx-bust { grid-row: 1 / span 3; width: 30px; height: 30px; }
#partyFrame .pmem > :not(.sx-bust) { grid-column: 2; }
#partyFrame .pmem.dead .sx-bust img { filter: grayscale(1) brightness(.6); }

/* card art: the HD picture fills the art window over a rarity-tinted glow; the pixel sprite stays the fallback */
.cd2 .art, .mcard { overflow: hidden; }
.cd2 .art { background: radial-gradient(circle at 50% 42%, var(--cg), transparent 62%), radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .16), rgba(8, 12, 28, .92) 78%); }
.cd2 .art img.hd { width: 100%; height: 100%; object-fit: contain; image-rendering: auto; transform: scale(1.06);
  filter: var(--hf, none) drop-shadow(0 2px 3px rgba(0, 0, 0, .7)); }
.cd2.unk .art img.hd { filter: brightness(0) opacity(.55); }
.mcard img.hd { image-rendering: auto; object-fit: contain; filter: var(--hf, none); }
.mcard.unk img.hd { filter: brightness(0) opacity(.55); }

/* ==========================================================================================================
   UI Polish 2 (2026-10-16, branch polish/ui, Codex review 2026-10-15: "polish only, keep every system")
   1. Phones read windows at 12-14 px: the type scale steps up one notch inside windows, the menu, tooltips and dialogs
      (the HUD keeps its own sizes: it is laid out around the controls).
   ========================================================================================================== */
body:is(.m-land, .m-port, .m-tab) :is(#panel, #menu, #tip, #uConfirm, #lkCard, #bigMap, #coach) {
  --sx-fs1: 12px; --sx-fs2: 13px; --sx-fs3: 14px; --sx-fs4: 16px;
}
/* the few hard-coded small sizes of the older layers, on the same scale */
#panel #pbody .u-slot .u-cap, body:not(.pc) #pbody .u-slot .u-cap { font-size: var(--sx-fs1) !important; }
.doll .turn { font-size: var(--sx-fs1); }
body:is(.m-land, .m-port, .m-tab) .u-slot .u-count { font-size: 12px; }
body:is(.m-land, .m-port, .m-tab) #pbody :is(.u-h small, small) { font-size: max(var(--sx-fs1), .9em); }

/* 2. Bag (Codex: "the detail panel takes the room before anything is picked; slots should stand out")
   - nothing picked: a one-line hint over the grid instead of a big empty detail card (phones, small windows)
   - landscape phones / tablets: the grid keeps the full width; the picked item's detail slides in over the side away from it
     (no reflow: the tile stays under the finger for the double tap); ✕ closes it */
.sx-bhint { display: none; margin: 0; font-size: var(--sx-fs1); color: var(--sx-tx3); line-height: 1.4; }
@container (max-width: 999px) { .sx-bhint { display: block; } }
@container (min-width: 641px) and (max-width: 999px) {
  .sx-cs.m-bag { position: relative; grid-template-columns: 58px minmax(0, 1fr); grid-template-areas: "eq main"; }
  .sx-cs.m-bag .sx-det { display: none; }
  .sx-cs.m-bag.pick .sx-det { display: flex; position: absolute; top: 0; bottom: 0; right: 0; width: min(310px, 48%); z-index: 6;
    background: linear-gradient(180deg, #14306e, #0a1636); box-shadow: -16px 0 36px rgba(0, 0, 0, .6); animation: sxSideR .18s var(--sx-ease); }
  .sx-cs.m-bag.pick .sx-det.at-l { right: auto; left: 0; box-shadow: 16px 0 36px rgba(0, 0, 0, .6); animation-name: sxSideL; }
  .sx-cs.m-bag.pick .sx-det > .sx-sheet-x { display: grid; place-items: center; }
  .sx-cs.m-bag.pick .sx-det .sx-ih { padding-right: 44px; }
  .sx-cs.m-bag .sx-det.fresh { pointer-events: none; }
}
@keyframes sxSideR { from { transform: translateX(30px); opacity: 0; } }
@keyframes sxSideL { from { transform: translateX(-30px); opacity: 0; } }
/* filled tiles read as items, empty ones step back */
.sx-grid .u-slot:not(.u-empty) { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5), inset 0 0 14px var(--rg), 0 3px 8px rgba(0, 0, 0, .55), 0 0 0 1px rgba(170, 200, 255, .12) !important; }
.sx-grid .u-slot.u-sel { box-shadow: 0 0 0 2px var(--sx-gold), inset 0 0 16px rgba(255, 213, 106, .35), 0 0 16px rgba(255, 205, 96, .55) !important; }
.sx-grid .u-slot.u-empty { opacity: .38; border-width: 1px !important; }

/* 3. Window proportions on PC (Codex: "on PC the windows are very large"): a window leaves the HUD's top row and the action
      bar in view at 1280x720 and stops growing at 1920x1080; phones keep their full-screen rules (below 500 px tall / 600 px wide) */
@media (min-height: 501px) and (min-width: 601px) {
  #panel:is([data-kind="market"], [data-kind="smith"], [data-kind="shop"], [data-kind="storage"], [data-kind="prem"], [data-kind="lab"],
    [data-kind="life"], [data-kind="book"], [data-kind="guild"], [data-kind="mailbox"], [data-kind="shrine"], [data-kind="ach"],
    [data-kind="newbie"], [data-kind="cards"], [data-kind="stats"], [data-kind="tavern"], [data-kind="vend"], [data-kind="trade"],
    [data-kind="ranch"], [data-kind="help"], [data-kind="settings"], [data-kind="pvp"], [data-kind="login"]) .win {
    width: min(1020px, calc(100vw - 40px)) !important; height: min(660px, calc(100vh - 56px)) !important; }
  #panel:is([data-kind="bag"], [data-kind="equip"]) .win { width: min(1160px, calc(100vw - 40px)) !important; height: min(664px, calc(100vh - 56px)) !important; }
  #panel[data-kind="skills"] .win { width: min(1140px, calc(100vw - 40px)) !important; height: min(664px, calc(100vh - 56px)) !important; }
  #panel .win { max-height: min(660px, calc(100vh - 56px)); }
}
@media (min-width: 1600px) and (min-height: 900px) {
  #panel .win { width: 820px; max-height: 760px; }
  #panel:is([data-kind="market"], [data-kind="smith"], [data-kind="shop"], [data-kind="storage"], [data-kind="prem"], [data-kind="lab"],
    [data-kind="life"], [data-kind="book"], [data-kind="guild"], [data-kind="mailbox"], [data-kind="shrine"], [data-kind="ach"],
    [data-kind="newbie"], [data-kind="cards"], [data-kind="stats"], [data-kind="tavern"], [data-kind="vend"], [data-kind="trade"],
    [data-kind="ranch"], [data-kind="help"], [data-kind="settings"], [data-kind="pvp"], [data-kind="login"]) .win { width: 1120px !important; height: 760px !important; }
  #panel:is([data-kind="bag"], [data-kind="equip"]) .win { width: 1300px !important; height: 780px !important; }
  #panel[data-kind="skills"] .win { width: 1260px !important; height: 780px !important; }
}

/* 4. Status: on PC the window is three columns (hero | base stats | combat stats) instead of a tall left column of empty doll
      space with the combat stats far below; the confirm bar spans the bottom */
.cs2-base, .cs2-der { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
@media (min-width: 1100px) and (min-height: 600px) {
  #pbody .cs2 { grid-template-columns: minmax(270px, .9fr) minmax(320px, 1.05fr) minmax(300px, 1fr); gap: 14px; }
  #pbody .cs2-right { display: contents; }
  #pbody .cs2-right > .pend { grid-column: 1 / -1; }
  #pbody .cs2 .doll { padding-bottom: 12px; } #pbody .cs2 .doll .stage { height: 196px; }
}

/* 5. Skill detail (Codex: "new skill detail layout, clear lock reasons"): the lock box right under the name says what is
      needed and where you are now; MP / cooldown / cast sit in one slim row; the requirement chips stay at the end */
.sx-lockbox { padding: 8px 10px; border-radius: var(--sx-rm); background: rgba(255, 79, 122, .1); border: 1px solid rgba(255, 111, 134, .45); font-size: var(--sx-fs2); line-height: 1.5; }
.sx-lockbox > b { display: block; color: #ffb3c2; font-size: var(--sx-fs3); margin-bottom: 2px; }
.sx-lockbox ul { margin: 0; padding-left: 18px; color: var(--sx-tx); } .sx-lockbox li + li { margin-top: 2px; }
.sx-lockbox .off { margin: 4px 0 0; color: var(--sx-warn); font-size: var(--sx-fs2); }
.sx-lockbox.soft { background: rgba(255, 181, 71, .08); border-color: rgba(255, 181, 71, .4); } .sx-lockbox.soft > b { color: var(--sx-warn); }
.sx-cost span { flex-direction: row; justify-content: center; align-items: baseline; gap: 6px; padding: 4px 6px; }
.sx-skd .sx-dscroll { gap: 8px; }
.sx-skc > .lk { font-size: var(--sx-fs1); line-height: 1.4; }
@media (min-width: 1600px) and (min-height: 900px) { .sx-skb { grid-template-columns: minmax(0, 1fr) 360px; } }

/* 6. Main menu: the favourites row across the whole menu (big tiles), the other groups as compact tiles, the advanced group
      quieter (same tiles, softer card) */
#hud #menu .mgrp.fav { grid-column: 1 / -1; }
#hud #menu .mgrp.fav > div { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
#hud #menu .mgrp.fav button { min-height: 78px !important; border-color: var(--sx-line-au) !important;
  background: linear-gradient(180deg, rgba(255, 213, 106, .16), rgba(14, 28, 70, .45)) !important; }
#hud #menu .mgrp.fav button .mic { width: 38px !important; height: 38px !important; }
#hud #menu .mgrp.fav button span { font-size: var(--sx-fs3) !important; }
#hud #menu .mgrp:not(.fav):not(.sys) button { min-height: 60px !important; }
#hud #menu .mgrp:not(.fav):not(.sys) button .mic { width: 28px !important; height: 28px !important; }
#hud #menu .mgrp:not(.fav) button span { font-size: var(--sx-fs1) !important; }
#hud #menu .mgrp.adv { background: rgba(8, 18, 48, .35) !important; }
body.m-port #hud #menu .mgrp.fav > div { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
body.m-land #hud #menu .mgrp.fav button { min-height: 62px !important; }
body.m-land #hud #menu .mgrp:not(.fav):not(.sys) button { min-height: 52px !important; }

/* 7. Guide tip (Codex: "fewer help texts at once, must not cover the play area"): one short line (two at most on phones),
      the rest behind «อ่านต่อ ▾», – folds it to the chip until tapped, hidden while a window it is not about is open */
#hud #coach.underwin { visibility: hidden !important; }
#coach.gd .gd-m { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
body:not(.pc) #coach.gd .gd-m { -webkit-line-clamp: 2; }
#coach.gd .gd-more { pointer-events: auto; align-self: flex-start; width: auto !important; height: auto !important; min-height: 0; margin-top: 2px; padding: 2px 8px !important;
  border: 0 !important; background: none !important; color: var(--sx-cyan) !important; font: 600 var(--sx-fs1) var(--sx-font) !important; text-decoration: underline; }
/* the link is ~22 px tall: phones missed it (smooth2 tip check 2026-10-16); an invisible 40 px tap area, same look */
body:not(.pc) #coach.gd .gd-more { position: relative; }
body:not(.pc) #coach.gd .gd-more::after { content: ''; position: absolute; left: -6px; right: -6px; top: 50%; height: 40px; transform: translateY(-50%); }
#coach.gd:has(.gd-more[aria-expanded="true"]) .gd-m { -webkit-line-clamp: unset; display: block; }
#coach.gd button[data-g="fold"] { font-size: 18px; }
body.m-land #hud #coach.gd button[data-g="list"] { display: none; } /* the checklist is in the menu; three buttons squeezed the text */

/* 8. Big map: monsters far from the hero are one soft patch per area (worldmap.js); its legend entry */
.wm-legend .lg-pack::before { width: 14px; height: 14px; background: radial-gradient(closest-side, rgba(255, 80, 80, .55), rgba(255, 80, 80, 0)); }
.wm-sub, .wm-hint { font-size: var(--sx-fs1); }

/* 9. Empty states: what this is, why it is empty, the next step as a button (market, guild, ...) */
#pbody .u-empty .u-cta { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
#pbody .u-empty .u-cta button { min-height: 44px; padding: 0 18px; }
#pbody .u-empty.slim { max-width: none; margin: 0 0 10px; padding: 12px 16px; grid-template-columns: auto 1fr; justify-items: start; text-align: left; column-gap: 12px; }
#pbody .u-empty.slim i { grid-row: span 2; font-size: 30px; align-self: center; }

/* 10. New player guide window: the next step on top with its button; done / locked rows are one line */
#pbody .nbnext { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; padding: 14px 16px; border-radius: var(--sx-rl);
  background: radial-gradient(90% 140% at 0% 0%, rgba(255, 213, 106, .22), transparent 60%), var(--sx-card); border: 1px solid var(--sx-gold); box-shadow: 0 0 16px rgba(255, 205, 96, .18); }
#pbody .nbnext .nbic { flex: 0 0 48px; height: 48px; display: grid; place-items: center; font-style: normal; font-size: 24px; border-radius: 12px; background: rgba(255, 213, 106, .14); }
#pbody .nbnext .nbtx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#pbody .nbnext .nbtx small { color: var(--sx-gold); font-weight: 700; font-size: var(--sx-fs1); }
#pbody .nbnext .nbtx b { font-size: var(--sx-fs4); color: var(--sx-tx); } #pbody .nbnext .nbtx p { margin: 2px 0 0; font-size: var(--sx-fs2); color: var(--sx-tx2); line-height: 1.5; }
#pbody .nbnext .nbst button { min-height: 46px; padding: 0 20px; }
#pbody .nbrow:is(.done, .lock, .skip) .nbtx > small { display: none; }
#pbody .nbrow:is(.done, .lock, .skip) { padding-top: 6px; padding-bottom: 6px; }
@media (max-width: 600px) { #pbody .nbnext { flex-wrap: wrap; } #pbody .nbnext .nbst { flex: 1 1 100%; } #pbody .nbnext .nbst button { width: 100%; } }

/* 11. Button states, the same everywhere (windows, dialogs, menu, guide tip, big map): hover = lighter edge, pressed = pushed in,
       keyboard focus = cyan ring, disabled = grey; danger keeps its red on hover */
.u-dlg .u-btn:hover:not(:disabled), #bigMap button:hover:not(:disabled), #coach button:hover { border-color: var(--sx-line-au); filter: brightness(1.14); }
.u-dlg .u-btn:active:not(:disabled), #bigMap button:active:not(:disabled), #coach button:active, #pbody button.ok:active:not(:disabled), #pbody .u-btn.gold:active:not(:disabled) { transform: translateY(1px) scale(.985); filter: brightness(.96); }
:is(#pbody, .u-dlg, #menu, #coach, #bigMap, #hubTabs) :is(button, [role="button"], [role="link"]):focus-visible { outline: 2px solid var(--sx-cyan); outline-offset: 2px; }
#pbody .u-btn.danger:hover:not(:disabled), .u-dlg .u-btn.danger:hover:not(:disabled) { filter: brightness(1.1); border-color: #ffd0d8 !important; }
#bigMap button:disabled { filter: grayscale(.85) brightness(.75); opacity: .62; cursor: not-allowed; }
#bigMap .wm-legend button.lg-tog { display: inline-flex; align-items: center; justify-content: flex-start; min-height: 40px; padding: 0 10px 0 6px; border-radius: 999px; font: 500 var(--sx-fs1) var(--sx-font);
  color: var(--sx-tx); background: rgba(255, 90, 90, .1); border: 1px solid rgba(255, 90, 90, .45); cursor: pointer; }
#bigMap .wm-legend button.lg-tog::after { content: '✓'; margin-left: 8px; color: var(--sx-up); }
#bigMap .wm-legend button.lg-tog[aria-pressed="false"] { opacity: .6; background: transparent; border-style: dashed; } #bigMap .wm-legend button.lg-tog[aria-pressed="false"]::after { content: '✕'; color: var(--sx-tx3); }
#pbody .nbrow .nbst { display: grid; grid-auto-flow: column; grid-template-rows: auto auto; justify-content: end; align-items: center; gap: 4px 6px; }
#pbody .nbrow .nbst > span { grid-row: 1; grid-column: 1 / -1; text-align: right; }
#pbody .nbrow .nbst > button { grid-row: 2; }
/* landscape phones: with the bigger type the skill cards go two a row (three squeezed MP / cooldown onto two lines) and the
   detail header is compact so the lock box shows without scrolling */
@media (max-height: 500px) {
  .sx-skg { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
  .sx-skdh { grid-template-columns: 48px minmax(0, 1fr); } .sx-skdh canvas { width: 48px; height: 48px; }
  .sx-skdh .t > b { font-size: var(--sx-fs4); } .sx-skdh .chips .u-chip { padding: 1px 7px; }
}
/* list windows that are often short (no guild, an empty market page, no mail): the window ends with its content instead of a
   tall empty card; it still grows up to the cap above */
@media (min-height: 501px) and (min-width: 601px) {
  #panel:is([data-kind="guild"], [data-kind="market"], [data-kind="mailbox"], [data-kind="party"], [data-kind="vend"]) .win { height: auto !important; min-height: min(420px, calc(100vh - 56px)); max-height: min(660px, calc(100vh - 56px)) !important; }
}
@media (min-width: 1600px) and (min-height: 900px) {
  #panel:is([data-kind="guild"], [data-kind="market"], [data-kind="mailbox"], [data-kind="party"], [data-kind="vend"]) .win { height: auto !important; max-height: 760px !important; }
}
/* phones: a select never grows past its row (the bigger type made the build lab's monster picker run off the window) */
body:is(.m-land, .m-port, .m-tab) #pbody select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
#pbody .labw .ld-row label { min-width: 0; max-width: 100%; } #pbody .labw .ld-row label:has(select) { flex: 1 1 100%; } #pbody .labw .ld-row label select { flex: 1 1 auto; min-width: 0; width: 0; }

/* Story + bag fix (2026-10-16 playtest #5): the compare names its two numbers (item stats vs the character's totals) */
.sx-cmp .lab { display: block; margin-top: 6px; color: var(--sx-tx3); font-size: var(--sx-fs1); }
.ic2-lab { display: block; margin: 1px 0 2px; font-size: 10px; color: #8e9ab3; }
/* ==========================================================================================================
   Playtest "ugly" rows (2026-10-16, branch polish/playtest-ugly, PLAYTEST-UGLY-REPORT.md): the new-player playtest's layout
   findings, smallest fix each. Row numbers = PLAYTEST-REPORT.md.
   ========================================================================================================== */
/* 9: shrine job cards: the description had ~90 px beside «รับเควสต์» (one or two words a line, very long cards; English worse).
   On a narrow card the button / «อาชีพปัจจุบัน» drops under the text; a wide card keeps one row */
#pbody .job { flex-wrap: wrap; }
#pbody .job > div { flex: 1 1 180px; }
#pbody .job > :is(button, em) { margin-left: auto; }
/* 12: card stars sat on the card name: the old status-row rule `.st` (style.css: grid, padding 6px 8px, a background) also
   matched the stars line of a card face and made it 20 px tall */
.cd2 .st { display: block; padding: 0; background: none; border-radius: 0; height: 8px; overflow: hidden; }
.cd2.big .st { height: 11px; }
/* 17: landscape phones: the «▼ เลื่อนดูต่อ» chip sat on a button in the window's bottom-right corner; it goes into the header,
   left of the close button (windows with a title row; the hub windows keep their tab row) */
@media (max-height: 500px) {
  #panel:has(#hubTabs[hidden]) #moreCue { top: 14px; bottom: auto !important; right: 64px; }
}
/* 18: landscape phones: the big map's zoom bar covered the picture's bottom-right corner (and the names there); it stands
   upright at the right edge, in the space beside the picture */
body.m-land #bigMap .bm-main > .hm-tools { flex-direction: column; inset: auto 6px 6px auto; }
body.m-land #bigMap .hm-tools b { min-width: 0; font-size: 10px; }
/* 19: world map: whole place names (they were cut to «Drowned Colonna…» / «Maelstrom Th…»); a place at the picture's left /
   right edge puts its name inward (worldmap.js .el / .er) so the frame doesn't cut «…al Throne» / «Sanct…» */
.wm-a .wm-node .nm { max-width: none; overflow: visible; }
.wm-a .wm-node.el { align-items: flex-start; } .wm-a .wm-node.er { align-items: flex-end; }
.wm-a .wm-node.el > .disc { margin-left: 46px; } .wm-a .wm-node.er > .disc { margin-right: 46px; } /* the 40 px sign stays on its spot (node 132 wide) */
/* 20: status combat stats: the short meaning sits under the stat's name on every card, so the ▲ preview no longer pushes a
   label onto a second line («ตีทุกช่วงตี / ปกติ», "Attack every / basic / attack") */
#pbody .der2 .u-sl small { display: block; margin-top: 1px; }
#pbody .der2 .u-stat { align-items: center; }
/* 21: the five hub windows (status / equipment / bag / skills / cards) are one size, so switching tabs doesn't move the tab bar
   (status + cards were 1020 wide, skills 1140, bag + equipment 1160) */
@media (min-height: 501px) and (min-width: 601px) {
  #panel:is([data-kind="stats"], [data-kind="cards"], [data-kind="skills"]) .win { width: min(1160px, calc(100vw - 40px)) !important; height: min(664px, calc(100vh - 56px)) !important; }
}
@media (min-width: 1600px) and (min-height: 900px) {
  #panel:is([data-kind="stats"], [data-kind="cards"], [data-kind="skills"]) .win { width: 1300px !important; height: 780px !important; }
}
/* 22: PC chat: a darker backing so lines read on the bright town paving, and the line cut at the top fades out below the tab
   pills instead of sitting half under them */
body.pc #hud #log { background: linear-gradient(90deg, rgba(4, 10, 32, .72), rgba(4, 10, 32, .42)) !important; padding-top: 12px;
  -webkit-mask-image: linear-gradient(transparent 2px, #000 20px); mask-image: linear-gradient(transparent 2px, #000 20px); }
/* playtest 2 row 5: a piece this character can't wear shows why instead of «if worn» totals (itemtip.js compare) */
.ic2-der.ic2-lock { color: var(--sx-down, #ff8f8f); }
.ic2-der.ic2-lock small { display: block; color: #b9c3d8; }

/* perf/ios (2026-10-16, IOS-PERF-REPORT.md): html.ios-lite = touch / iOS with SIGIL.sm2.css on (main.js). Safari re-blurs a
   backdrop-filter and repaints an animated box-shadow every frame over the moving game canvas. */
html.ios-lite #ann { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html.ios-lite .coach-hi { animation: none !important; box-shadow: 0 0 0 3px #ffd36a, 0 0 12px rgba(255, 211, 106, .7); }

/* ==========================================================================================================
   Sigil Runes (feat/runes 2026-10-16, RUNE-DESIGN.md §8): the «◈ รูน» view inside the skill window (src/rune-ui.js).
   Phone first: one column, the slot strip scrolls sideways; >= 700 px the codex goes 2-3 cards a row.
   ========================================================================================================== */
.rn-dot { display: inline-block; width: 8px; height: 8px; margin-left: 4px; border-radius: 50%; background: #ff5a5a; box-shadow: 0 0 6px #ff5a5a; vertical-align: middle; }
.rn { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.rn-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; border-radius: var(--sx-rm); border: 1px solid var(--sx-line);
  background: linear-gradient(90deg, rgba(150, 110, 255, .16), rgba(3, 8, 26, .5)); }
.rn-top .t { display: flex; flex-direction: column; min-width: 150px; } .rn-top .t b { font: 800 var(--sx-fs4) var(--sx-font); color: #e6d8ff; }
.rn-top .t small { color: var(--sx-tx3); font-size: var(--sx-fs1); }
.rn-sum { flex: 1 1 220px; display: flex; flex-wrap: wrap; gap: 4px; }
.rn-dust { display: flex; align-items: center; gap: 6px; font-size: var(--sx-fs2); color: var(--sx-tx2); } .rn-dust b { color: #bff4ff; } .rn-dust b.g { color: var(--sx-gold); margin-left: 6px; }
/* icon: the Codex picture over an emoji, a rarity frame, a badge */
.rn-ic { position: relative; flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 10px;
  background: radial-gradient(circle at 50% 45%, rgba(127, 232, 255, .22), rgba(4, 10, 30, .9) 70%); border: 1px solid var(--rc, #7fe8ff); }
.rn-ic > i { font-style: normal; font-size: 22px; line-height: 1; } .rn-ic > img { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: contain; }
.rn-ic > u { position: absolute; right: -4px; bottom: -4px; min-width: 18px; height: 18px; padding: 0 2px; display: grid; place-items: center; border-radius: 9px; text-decoration: none;
  font-size: 11px; background: #0a1636; border: 1px solid var(--rc, #7fe8ff); color: #fff; z-index: 1; }
.rn-ic::after { content: ""; position: absolute; inset: -3px; pointer-events: none; background: center / 100% 100% no-repeat; }
.rn-ic.r2::after { background-image: url(assets/icons/rune/frame-magic.webp); } .rn-ic.r3::after { background-image: url(assets/icons/rune/frame-rare.webp); }
.rn-ic.r4::after { background-image: url(assets/icons/rune/frame-legend.webp); }
.rn-ic.sm { width: 36px; height: 36px; } .rn-ic.sm > i { font-size: 17px; } .rn-ic.sm > u { display: none; }
.rn-ic.xs { width: 22px; height: 22px; border-radius: 6px; } .rn-ic.xs > i { font-size: 12px; } .rn-ic.xs > u, .rn-ic.xs::after { display: none; }
.rn-ic.empty { --rc: #4a5a86; background: rgba(4, 10, 30, .6); border-style: dashed; color: var(--sx-tx3); }
/* the free rune */
.rn-free { padding: 10px; border-radius: var(--sx-rm); border: 1px solid rgba(255, 214, 106, .6); background: linear-gradient(180deg, rgba(255, 200, 80, .14), rgba(3, 8, 26, .5)); }
.rn-free > b { color: var(--sx-gold); } .rn-free > small { display: block; color: var(--sx-tx3); margin-bottom: 6px; }
.rn-fl { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px; }
#pbody .rn-fc { display: grid; grid-template-columns: 46px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; text-align: left; min-height: 56px; padding: 6px 8px;
  border-radius: var(--sx-rm); border: 1px solid var(--sx-line); background: rgba(3, 8, 26, .55); color: var(--sx-tx); }
.rn-fc .rn-ic { grid-row: span 2; } .rn-fc small { color: var(--sx-tx2); font-size: var(--sx-fs1); }
#pbody .rn-fc:hover { border-color: var(--sx-gold); }
/* slot strip */
.rn-slots { display: flex; gap: 6px; overflow-x: auto; padding: 3px 2px 4px; scrollbar-width: thin; }
#pbody .rn-slot { flex: 0 0 auto; width: 92px; min-height: 92px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px;
  border-radius: var(--sx-rm); border: 1px solid var(--sx-line); background: rgba(3, 8, 26, .55); color: var(--sx-tx2); }
.rn-slot .k { font: 800 var(--sx-fs1) var(--sx-font); color: var(--sx-tx3); } .rn-slot.line .k { color: #ffcf8a; } .rn-slot.skill .k { color: #9fe8ff; }
.rn-slot small { font-size: 10.5px; line-height: 1.2; text-align: center; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#pbody .rn-slot.on { border-color: var(--sx-gold); box-shadow: 0 0 0 1px var(--sx-gold) inset, 0 0 12px rgba(255, 214, 106, .35); }
.rn-slot.lock { opacity: .55; } .rn-slot.sleep .rn-ic { filter: grayscale(1) brightness(.7); }
/* the picked slot */
.rn-pick { padding: 10px; border-radius: var(--sx-rm); border: 1px solid var(--sx-line); background: rgba(3, 8, 26, .45); display: flex; flex-direction: column; gap: 6px; }
.rn-pick .ph b { color: var(--sx-tx); } .rn-pick .ph small { display: block; color: var(--sx-tx3); font-size: var(--sx-fs1); }
.rn-cur { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: var(--sx-fs2); color: var(--sx-tx2); } .rn-cur b { color: var(--sx-gold); }
.rn-sks { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; } .rn-sks > small, .rn-step { width: 100%; color: var(--sx-tx3); font-size: var(--sx-fs1); }
#pbody .rn-sk { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 3px 9px 3px 4px; border-radius: 999px; border: 1px solid var(--sx-line); background: rgba(3, 8, 26, .6); color: var(--sx-tx2); }
.rn-sk img { width: 30px; height: 30px; image-rendering: pixelated; border-radius: 50%; } .rn-sk b { font-size: var(--sx-fs1); font-weight: 700; } .rn-sk i { font-style: normal; }
#pbody .rn-sk.on { border-color: #7fe8ff; color: #fff; background: rgba(60, 170, 255, .2); }
.rn-list { display: grid; grid-template-columns: 1fr; gap: 5px; }
.rn-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--sx-rm); border: 1px solid var(--sx-line); background: rgba(3, 8, 26, .5); }
.rn-row .d b { color: var(--sx-tx); font-size: var(--sx-fs2); } .rn-row .d em { font-style: normal; color: #bff4ff; } .rn-row .d small { display: block; color: var(--sx-tx2); font-size: var(--sx-fs1); }
.rn-row.on { border-color: var(--sx-gold); } .rn-row.off { opacity: .6; }
#pbody .rn-row .u-btn { min-height: 40px; }
/* codex */
.rn-codex { display: grid; grid-template-columns: 1fr; gap: 6px; }
.rn-card { display: flex; flex-direction: column; gap: 5px; padding: 8px; border-radius: var(--sx-rm); border: 1px solid var(--sx-line); background: rgba(3, 8, 26, .5); }
.rn-card.own { border-color: rgba(150, 120, 255, .55); background: linear-gradient(180deg, rgba(120, 90, 255, .12), rgba(3, 8, 26, .5)); }
.rn-card.sleep { opacity: .6; }
.rn-card .h { display: flex; align-items: center; gap: 8px; } .rn-card .h .d { flex: 1; min-width: 0; } .rn-card .h b { color: var(--sx-tx); }
.rn-card .h small { display: block; color: var(--sx-tx3); font-size: var(--sx-fs1); } .rn-card .lv { font-size: var(--sx-fs2); color: var(--sx-tx2); white-space: nowrap; } .rn-card .lv b { color: #bff4ff; }
.rn-card p { margin: 0; font-size: var(--sx-fs1); color: var(--sx-tx2); line-height: 1.4; } .rn-card p em { font-style: normal; color: var(--sx-up); }
.rn-card .f { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; } .rn-card .have { flex: 1 1 auto; font-size: var(--sx-fs1); color: var(--sx-tx3); }
#pbody .rn-card .u-btn { min-height: 40px; padding: 0 10px; } .rn-card .u-btn small { opacity: .8; font-weight: 600; }
.rn-later { display: flex; flex-wrap: wrap; gap: 6px; font-size: var(--sx-fs1); color: var(--sx-tx3); } .rn-later span { padding: 3px 8px; border-radius: 999px; border: 1px dashed var(--sx-line); }
.rn-skline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 6px; padding: 6px 8px; border-radius: var(--sx-rm); background: rgba(120, 90, 255, .12); font-size: var(--sx-fs1); color: #e6d8ff; }
@media (min-width: 700px) {
  .rn-codex { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .rn-list { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}
@media (max-height: 500px) {
  #pbody .rn-slot { width: 84px; min-height: 80px; padding: 4px 3px; } .rn-top { padding: 5px 8px; } .rn-codex { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
/* ==========================================================================================================
   polish/eyes (2026-10-16, EYES-REPORT.md): fresh-eyes pass, small fixes only (markup and acts unchanged)
   ========================================================================================================== */
/* E1: a disabled gold button (stat + / +5 with no points, skill + at MAX, «ใช้แต้ม» / «ไม่มีแต้มเหลือ» with nothing staged) went
   grey-beige through the shared grayscale filter and became the brightest slab in the window; now a quiet navy plate */
#pbody .u-btn.gold:disabled, #pbody button.ok:disabled, .u-dlg .u-btn.gold:disabled {
  background: linear-gradient(180deg, rgba(36, 54, 108, .5), rgba(16, 26, 62, .5)) !important; color: var(--sx-tx3) !important;
  border-color: var(--sx-line) !important; box-shadow: none !important; text-shadow: none !important; filter: none; opacity: .8; }
/* E2: target bar (normal monsters): the name broke into two lines («Lv 75 Sun / Warden») beside a two-line element note. PC: a
   wider bar, both on one line; landscape phones: the name on its row, the element note on the next, cut with … if long */
body.pc #hud #target:not(.boss):not(.wb) { width: min(460px, 44vw); }
body:not(.m-port) #hud #target:not(.boss):not(.wb) #tgName { white-space: nowrap; flex: none; }
body:not(.m-port) #hud #target:not(.boss):not(.wb) #tgElem { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.m-land #hud #target:not(.boss):not(.wb) .tgh { flex-wrap: wrap; row-gap: 0; }
body.m-land #hud #target:not(.boss):not(.wb) #tgElem { flex-basis: 100%; }
/* E3: PC chat: the top line was still cut through its letters right under the tab pills; the cut part is now fully hidden
   and the line fades in below it */
body.pc #hud #log { -webkit-mask-image: linear-gradient(transparent 13px, #000 30px); mask-image: linear-gradient(transparent 13px, #000 30px); }
/* E4: skill detail costs on narrow columns broke inside the words («คูลดา / วน์», «2.4 / วิ»): label and value stay whole and
   the value drops under the label when the box is too narrow */
.sx-cost span { flex-wrap: wrap; row-gap: 0; } .sx-cost small, .sx-cost b { white-space: nowrap; }
/* E5: bag filters on PC: the last chip (🔒) wrapped onto a row of its own; the chips share one row */
@container (min-width: 641px) { #pbody .sx-cats { flex-wrap: nowrap; } #pbody .sx-cats button { min-width: 0; } }
/* Sigil Runes phase 2: view switch, the Sigil Board (7x7, 40 px tiles on phones), legendary cards, the rune total line */
.rn-views { display: flex; gap: 4px; }
#pbody .rn-views button { flex: 1; min-height: 40px; }
.rn-card.leg { border-color: rgba(255, 176, 64, .65); background: linear-gradient(180deg, rgba(255, 150, 40, .14), rgba(3, 8, 26, .5)); }
.rn-tot { display: block; width: 100%; margin-top: 2px; color: #bff4ff; font-weight: 700; }
.rn-pick .f { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; } .rn-pick .f small { color: var(--sx-tx3); font-size: var(--sx-fs1); }
.rn-bhead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.rn-bhead .rn-cap { display: flex; flex-direction: column; gap: 2px; min-width: 160px; flex: 1; } .rn-bhead small { color: var(--sx-tx3); font-size: var(--sx-fs1); }
.rn-board { --n: 7; display: grid; grid-template-columns: repeat(var(--n), minmax(40px, 52px)); gap: 4px; justify-content: center; padding: 10px;
  border-radius: var(--sx-rm); border: 1px solid var(--sx-line); background: radial-gradient(circle at 50% 50%, rgba(140, 100, 255, .2), rgba(3, 8, 26, .6) 70%); }
#pbody .rn-t { position: relative; aspect-ratio: 1; min-height: 40px; padding: 0; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid rgba(120, 140, 200, .35); background: rgba(4, 10, 30, .75); opacity: .45; }
.rn-t .ti { position: relative; width: 78%; height: 78%; display: grid; place-items: center; } .rn-t .ti img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.rn-t .ti i { font-style: normal; font-size: 15px; color: #c8d4ff; }
#pbody .rn-t.can { opacity: .9; border-color: #7fe8ff; box-shadow: 0 0 8px rgba(127, 232, 255, .45); }
#pbody .rn-t.own { opacity: 1; border-color: #c9a8ff; background: radial-gradient(circle, rgba(170, 120, 255, .55), rgba(20, 10, 50, .9)); box-shadow: 0 0 10px rgba(170, 120, 255, .6); }
#pbody .rn-t.t-r.own { border-color: #ffd36a; box-shadow: 0 0 12px rgba(255, 211, 106, .7); } #pbody .rn-t.t-g { border-style: dashed; }
#pbody .rn-t.t-S { opacity: 1; border-color: #ffd36a; }
#pbody .rn-t.sel { outline: 2px solid var(--sx-gold); outline-offset: 2px; }
.rn-t .rn-ic.xs { width: 80%; height: 80%; }
@media (max-height: 500px) { .rn-board { grid-template-columns: repeat(var(--n), 40px); gap: 3px; padding: 6px; } }
/* Sigil Runes round 3 (CLI play test RUNE-PLAY-REPORT.md R1-R7): numbers that show, the recommended path, phone fits */
.rn-fc .fit { grid-column: 2; color: #9ff6ff !important; font-weight: 700; } /* fix/text27: under the text, not in the icon column (it wrapped word by word) */
#pbody .rn-fc.rec { border-color: #7fe8ff; box-shadow: 0 0 10px rgba(127, 232, 255, .35); }
.rn-upb { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.rn-upb .rn-gain { color: #0a3a12; background: #b8ffcc; border-radius: 999px; padding: 0 6px; font-size: var(--sx-fs1); }
.rn-stat { margin: 0 0 6px; padding: 5px 8px; border-radius: var(--sx-rm); background: rgba(120, 90, 255, .14); color: #e6d8ff; font-size: var(--sx-fs1); }
.rn-in { color: #bff4ff; }
#pbody .rn-cur .u-btn { min-height: 40px; }
/* R6: narrow phones = the slot strip wraps (no hidden sideways scroll); landscape = the summary row folds so the list is near */
@media (max-width: 640px) { .rn-slots { flex-wrap: wrap; overflow-x: visible; justify-content: center; } #pbody .rn-slot { width: calc(25% - 5px); min-width: 76px; } }
@media (max-height: 500px) {
  .rn-top .rn-sum { display: none; } .rn-top { gap: 4px 10px; } .rn-free > small { display: none; }
  #pbody .rn-slot { min-height: 70px; } .rn-slot small { -webkit-line-clamp: 1; }
}
/* ---------- polish/eyes round 2 (owner: «ทำตามที่ทีมแนะนำมา ขอสวยๆ») ---------- */
/* R1: PC / tablet windows sit on a soft dark backdrop: the HUD around a window (portrait card cut by the window edge, quest card,
   rail) no longer peeks out at full strength. A plain gradient, no blur (cheap over the moving game canvas); phones keep their
   full-screen windows as they are */
body:is(.pc, .m-tab) #panel:not([hidden])::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 50%, rgba(3, 7, 24, .42), rgba(3, 7, 24, .74)); animation: eyesDim .18s ease-out; }
@keyframes eyesDim { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { body:is(.pc, .m-tab) #panel:not([hidden])::before { animation: none; } }
/* R2: upright phones, calmer HUD: the quest card drops its «📍 อยู่ที่ …» line and the tap hint under the call to action, lighter
   glass, buttons stay 40 px; the online counter (a number nobody acts on) leaves the top-right column; the guide tip is smaller */
body.m-port #hud #jqCard { background: linear-gradient(180deg, rgba(8, 16, 44, .62), rgba(4, 10, 32, .5)) !important; padding-top: 6px !important; padding-bottom: 6px !important; }
body.m-port #hud #jqCard .qloc, body.m-port #hud #jqCard .jcta small { display: none; }
body.m-port #hud #jqCard .aqb { min-height: 40px; margin-top: 4px; font-size: 12px; }
/* online count shows on upright phones too (owner, CBT 2026-10-18) */
body.m-port #coach.gd { font-size: 12px; padding: 6px 10px !important; background: rgba(6, 12, 34, .82) !important; }
/* R6: landscape phones: the boss warning is a slim see-through pill in its own row under the bar (it lay as a solid red block over
   the boss bar; ui.js stackTop) */
body.m-land #bossWarn#bossWarn { padding: 3px 12px; font-size: 12px; border-radius: 999px; border-color: rgba(255, 160, 150, .65);
  background: linear-gradient(90deg, rgba(130, 12, 34, .58), rgba(210, 50, 46, .58)); box-shadow: 0 0 12px rgba(255, 60, 60, .3); text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, .6); }
/* ---------- polish/eyes round 3 ---------- */
/* R3-2: the PC rail buttons stay out of the window backdrop (they work while a window is open and looked switched off): the dim
   fades out over the right-hand strip below the minimap; the minimap / clock above it stay dimmed */
body:is(.pc, .m-tab) #panel:not([hidden])::before {
  -webkit-mask-image: linear-gradient(to left, transparent 70px, #000 130px), linear-gradient(#000 230px, transparent 232px);
  mask-image: linear-gradient(to left, transparent 70px, #000 130px), linear-gradient(#000 230px, transparent 232px); }

/* ===== Endgame (feat/endgame 2026-10-16, ENDGAME-REPORT.md): forge meter, wing stars, Sigil Gate, dye shop ===== */
.rf-legend .guard { border-color: rgba(96, 214, 255, .5); background: rgba(96, 214, 255, .08); } .rf-legend .guard b { color: var(--sx-cyan); }
#pbody .rf-meter { position: relative; display: block; margin: 4px 0 2px; height: 20px; border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 150, 70, .45); }
#pbody .rf-meter > i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #a8321a, #ff8a3a 70%, #ffd36a); transition: width .3s; }
#pbody .rf-meter > b { position: relative; padding: 0 8px; font-size: var(--sx-fs1); line-height: 18px; color: #fff4e0; text-shadow: 0 1px 2px #000; }
#pbody .rf-meter > small { position: relative; float: right; padding: 0 8px; font-size: var(--sx-fs1); line-height: 18px; color: #ffe6c8; text-shadow: 0 1px 2px #000; }
#pbody .rf-meter.full { border-color: #ffd36a; box-shadow: 0 0 10px rgba(255, 196, 92, .55); }
#pbody .ws-stars { display: block; letter-spacing: 1px; color: #ffd34a; font-size: var(--sx-fs3); text-shadow: 0 0 6px rgba(255, 211, 74, .5); }
#pbody .ws-stars i { font-style: normal; color: rgba(255, 255, 255, .25); text-shadow: none; }
.eg-card { display: grid; gap: 8px; padding: 10px; margin: 6px 0; border-radius: var(--sx-rm); border: 1px solid rgba(160, 120, 255, .45); background: linear-gradient(135deg, rgba(110, 70, 200, .18), rgba(20, 24, 48, .6)); }
.eg-boss { display: flex; align-items: center; gap: 10px; } .eg-boss b { display: block; font-size: var(--sx-fs4); } .eg-boss small { color: var(--sx-tx2); }
.eg-bossic img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.eg-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.eg-facts span { display: flex; flex-direction: column; align-items: center; padding: 4px; border-radius: 8px; background: rgba(0, 0, 0, .25); font-size: var(--sx-fs1); color: var(--sx-tx2); }
.eg-facts b { font-size: var(--sx-fs3); color: var(--sx-tx); }
.eg-loot { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.eg-loot span { padding: 4px 8px; border-radius: 12px; background: rgba(255, 255, 255, .06); border: 1px solid var(--sx-line); font-size: var(--sx-fs2); }
.eg-dyes { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.eg-dye { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border-radius: var(--sx-rm); border: 1px solid var(--sx-line); background: var(--sx-card); text-align: center; }
.eg-dye.own { border-color: rgba(88, 240, 160, .45); } .eg-dye.on { border-color: #ffd34a; box-shadow: 0 0 0 1px #ffd34a inset; }
.eg-dye b { font-size: var(--sx-fs2); } .eg-dye button { min-height: 40px; width: 100%; }
.eg-prev { display: grid; place-items: center; width: 64px; height: 56px; font-size: 28px; }
.eg-prev img, .eg-prev canvas { max-width: 64px; max-height: 56px; object-fit: contain; image-rendering: pixelated; }
#panel[data-kind="sgate"] .big small { display: block; margin-top: 2px; font-weight: 700; color: #4a2c00; }
.eg-glow { width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle, #fff 0 12%, var(--gc) 30%, transparent 70%); box-shadow: 0 0 18px var(--gc); }
/* centred above the action bar: the right column holds the minimap, clock, gold and the menu rail */
.eg-gatebtn { position: fixed; left: 50%; transform: translateX(-50%); bottom: 132px; z-index: 30; min-height: 44px; padding: 6px 14px; border-radius: 10px; border: 1px solid #b48cff; background: linear-gradient(#3a2560, #1a1030); color: #f0e4ff; font: 700 13px Prompt, sans-serif; box-shadow: 0 2px 8px #000a; cursor: pointer; }
.eg-gatebtn[hidden] { display: none; } .eg-gatebtn small { display: block; font-weight: 400; font-size: 11px; color: #cdbbe8; }
@media (max-width: 520px) { .eg-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .eg-dyes { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); } }
@media (max-height: 500px) { .eg-gatebtn { bottom: 64px; min-height: 40px; padding: 4px 12px; } #panel[data-kind="dye"] .dq, #panel[data-kind="sgate"] .dq { display: none; } }
.eg-loot .eg-ic { width: 20px; height: 20px; vertical-align: -5px; image-rendering: auto; }

/* ---------- Daily mini-games (feat/minigames 2026-10-16): board window 'minigame', Panic HUD pill, live OX Quiz card ---------- */
.mg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; padding: 8px 10px; border-radius: var(--sx-rm); border: 1px solid var(--sx-line-au); background: linear-gradient(135deg, rgba(255, 170, 60, .16), rgba(20, 24, 48, .6)); }
.mg-tk { display: flex; align-items: baseline; gap: 6px; font-size: var(--sx-fs4); } .mg-tk b { color: var(--sx-gold); font-size: var(--sx-fs5); } .mg-tk small { color: var(--sx-tx2); font-size: var(--sx-fs1); }
.mg-week { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 140px; } .mg-week small { color: var(--sx-tx2); font-size: var(--sx-fs1); }
.mg-pips { display: flex; gap: 4px; } .mg-pips i { width: 16px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .12); } .mg-pips i.on { background: var(--sx-gold); }
.mg-head button { min-height: 40px; }
.mg-card { margin: 8px 0; padding: 10px; border-radius: var(--sx-rm); border: 1px solid var(--sx-line); background: var(--sx-card); }
.mg-card.done { opacity: .78; }
.mg-ch { display: flex; align-items: center; gap: 8px; } .mg-ch i { font-style: normal; font-size: 24px; } .mg-ch b { font-size: var(--sx-fs4); } .mg-ch small { margin-left: auto; color: var(--sx-tx2); font-size: var(--sx-fs2); text-align: right; }
.mg-how { margin: 6px 0; color: var(--sx-tx2); font-size: var(--sx-fs2); line-height: 1.45; }
.mg-half { display: block; color: var(--sx-warn, #ffb86a); font-size: var(--sx-fs1); margin-bottom: 4px; }
.mg-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; } .mg-btns button, .mg-card > button { min-height: 44px; }
.mg-grid { display: grid; gap: 4px; justify-content: center; margin: 6px 0; }
.mg-row { display: grid; grid-template-columns: repeat(4, 44px); gap: 4px; }
.mg-cell { display: grid; place-items: center; height: 44px; border-radius: 8px; border: 1px solid var(--sx-line); background: rgba(0, 0, 0, .28); font-size: 22px; }
.mg-cell.cur { border-color: var(--sx-gold3); } .mg-cell.g { background: #2f8f4e; border-color: #58d27e; } .mg-cell.y { background: #9a7a1c; border-color: #f0c84a; } .mg-cell.n { background: #2a2d3a; }
.mg-keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; max-width: 360px; margin: 6px auto; }
.mg-keys button { min-height: 48px; font-size: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.mg-keys button small { font-size: var(--sx-fs1); }
.mg-q { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 8px; background: rgba(0, 0, 0, .25); } .mg-q b { font-size: var(--sx-fs3); } .mg-q small { color: var(--sx-tx2); }
.mg-ox { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.mg-ox button { min-height: 56px; font: 800 26px Prompt, sans-serif; display: flex; flex-direction: column; align-items: center; } .mg-ox small { font-size: var(--sx-fs1); font-weight: 400; }
.mg-o { border-color: #58d8ff !important; color: #9feaff; } .mg-x { border-color: #ff7070 !important; color: #ffb0b0; }
.mg-shop { display: grid; gap: 6px; }
.mg-item { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--sx-line); background: var(--sx-card); }
.mg-item.on { border-color: #ffd34a; } .mg-item b { display: block; font-size: var(--sx-fs3); } .mg-item small { display: block; color: var(--sx-tx2); font-size: var(--sx-fs1); }
.mg-item button { min-height: 40px; min-width: 72px; } .mg-ic { display: grid; place-items: center; font-size: 24px; }
.mg-nc { font-weight: 800; font-size: var(--sx-fs3); } .mg-cb { display: inline-block; margin-top: 2px; padding: 2px 8px; border: 2px solid; border-radius: 10px; font-size: var(--sx-fs1); } .mg-tt { color: #ffd36a; font-size: var(--sx-fs2); }
.mg-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.mg-rank li { display: grid; grid-template-columns: 28px 1fr auto; gap: 6px; padding: 5px 8px; border-radius: 6px; background: rgba(255, 255, 255, .04); } .mg-rank li.me { outline: 1px solid var(--sx-gold); } .mg-rank em { font-style: normal; color: var(--sx-gold); }
.mg-rules p { margin: 6px 0; line-height: 1.5; color: var(--sx-tx2); }
.mg-hud { position: fixed; left: 50%; transform: translateX(-50%); bottom: 132px; z-index: 30; min-height: 44px; padding: 6px 16px; border-radius: 10px; border: 1px solid #ffb84a; background: linear-gradient(#5a3a10, #2a1a06); color: #fff1d0; font: 800 15px Prompt, sans-serif; box-shadow: 0 2px 8px #000a; cursor: pointer; }
.mg-hud[hidden], .mg-quiz[hidden] { display: none; } .mg-hud small { display: block; font-weight: 400; font-size: 11px; color: #e8cfa0; }
.mg-quiz { position: fixed; left: 50%; transform: translateX(-50%); top: 74px; z-index: 29; max-width: min(560px, calc(100vw - 32px)); padding: 8px 14px; border-radius: 12px; border: 1px solid #58d8ff; background: rgba(10, 22, 44, .92); color: #eaf6ff; text-align: center; pointer-events: none; box-shadow: 0 2px 10px #000a; }
.mg-quiz small { display: block; color: #9fd8ff; font-size: 12px; } .mg-quiz b { display: block; font: 700 16px Prompt, sans-serif; line-height: 1.35; } .mg-quiz b .o { color: #7fe8ff; } .mg-quiz b .x { color: #ff9a9a; }
@media (max-height: 500px) { .mg-hud { bottom: 64px; min-height: 40px; padding: 4px 12px; } .mg-quiz { top: 46px; padding: 4px 10px; } .mg-quiz b { font-size: 14px; } #panel[data-kind="minigame"] .dq { display: none; } .mg-row { grid-template-columns: repeat(4, 40px); } .mg-cell { height: 40px; } }
.mg-tki { width: 24px; height: 24px; vertical-align: -6px; image-rendering: auto; } .mg-item button .mg-tki { width: 18px; height: 18px; vertical-align: -4px; }
.mg-iti { width: 32px; height: 32px; object-fit: contain; image-rendering: auto; }

/* ---------- Black screen «🖤 จอดำ» (src/black.js, BLACK-SCREEN-REPORT.md): the game is not drawn, only text ---------- */
/* display:none = no layer, no paint, no compositing for the canvas / HUD / windows while AUTO plays on */
body.black #game, body.black #txt, body.black #hud, body.black #vigCss, body.black #bigMap, body.black #panel, body.black #pmenu,
body.black #pinv, body.black #deathBox, body.black #tame, body.black #tip { display: none !important; }
body.black { background: #000; }
#blackScr { position: fixed; inset: 0; z-index: 2147483000; background: #000; color: #d8dee9; display: flex; flex-direction: column;
  gap: 8px; padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  font: 14px/1.45 ui-monospace, Consolas, "Courier New", Prompt, Tahoma, monospace; }
#blackScr[hidden] { display: none; }
#blackScr .bk-top { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-start; justify-content: space-between; }
#blackScr .bk-st { margin: 0; white-space: pre-wrap; font: inherit; color: #e8f0ff; flex: 1 1 320px; }
#blackScr .bk-btns { display: flex; flex-wrap: wrap; gap: 6px; }
#blackScr button, #blackScr select, #blackScr input { font: 600 14px/1 Prompt, Tahoma, sans-serif; min-height: 40px; border-radius: 8px;
  border: 1px solid #2c3550; background: #0d111c; color: #e8ecf6; padding: 0 12px; }
#blackScr button.gold { background: #3a2c08; border-color: #8a6a1e; color: #ffe3a0; }
#blackScr .bk-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; border: 1px solid #1a2030; border-radius: 8px; padding: 6px 8px; overscroll-behavior: contain; }
#blackScr .bk-log > div { white-space: pre-wrap; word-break: break-word; }
#blackScr .bk-log > div[data-k="loot"] { opacity: .85; }
#blackScr .bk-ask { display: flex; gap: 8px; align-items: center; justify-content: center; }
#blackScr .bk-ask[hidden] { display: none; }
#blackScr .bk-chat { display: flex; gap: 6px; }
#blackScr .bk-chat input { flex: 1 1 auto; min-width: 0; font-weight: 400; }
#blackScr .bk-hint { color: #6b768f; font: 12px Prompt, Tahoma, sans-serif; }

/* ==========================================================================================================
   Phone UI fix r10 (ui/phone-fix 2026-10-18, Codex Astra review items 1-3 and 5-9; 4 and 10 wait for the owner).
   Touch screens only (body:not(.pc)); PC keeps its look. Switch for A/B: SIGIL.oldPhoneNums (numbers)
   ========================================================================================================== */
/* (1) one notice lane: notices waiting (a window open, another notice showing) are hidden and let taps through; in a fight the
   tame offer folds to a 48 px icon with its timer as a ring, on the left under the portrait (ui.js stackTop); a tap opens it */
body:not(.pc) #tame.held { visibility: hidden !important; pointer-events: none !important; }
body:not(.pc) #nq.held { pointer-events: none; }
body:not(.pc):is(.wpanel, .wmenu, .wbigmap) .qtick { display: none !important; } /* the quest tick (quest-ui.js) already running when a window opens */
body:not(.pc) #tame.fold { left: calc(10px + var(--sl, 0px)) !important; right: auto !important; transform: none !important; width: 48px !important; height: 48px !important;
  padding: 0 !important; display: flex !important; align-items: center; justify-content: center; overflow: visible !important; cursor: pointer; animation: none !important;
  border-radius: 50% !important; border: 0 !important; background: conic-gradient(#6fe39a var(--tp, 360deg), rgba(4, 10, 32, .92) 0) !important;
  box-shadow: 0 0 0 2px rgba(4, 10, 32, .92), 0 3px 10px rgba(0, 0, 0, .5) !important; }
body:not(.pc) #tame.fold::before { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: radial-gradient(circle at 40% 30%, #2a4a9a, #12245a); }
body:not(.pc) #tame.fold #tameImg { position: relative; width: 34px !important; height: 34px !important; }
body:not(.pc) #tame.fold > :is(p, div, i) { display: none !important; }
body:not(.pc) #tame.fold::after { content: '♥'; position: absolute; right: -4px; top: -4px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  font: 700 11px/1 var(--sx-font); color: #04281a; background: #6fe39a; box-shadow: 0 0 0 2px rgba(4, 10, 32, .92); }
/* (3) a slimmer fight HUD: the target bar = name + HP (the element line opens on a tap), narrower on landscape; clock, gold and
   the EXP / JOB pills step back (and further back in a fight); HP / MP and the buff icons keep their look */
body:not(.pc) #hud #target:not(.boss):not(.wb):not(.open) #tgElem { display: none !important; }
body:not(.pc) #hud #target:not(.boss):not(.wb) { cursor: pointer; }
body:not(.pc) #hud #target:not(.boss):not(.wb)::after { content: ""; position: absolute; inset: -6px 0; } /* tap area >= 40 px */
body:not(.pc) #hud #target:not(.boss):not(.wb):not(.open) .tgh::after { content: 'ⓘ'; margin-left: auto; font-size: 11px; color: var(--sx-tx3); }
body.m-land #hud #target:not(.boss):not(.wb) { width: min(280px, 34vw) !important; padding: 3px 12px 5px !important; }
body.m-port #hud #target:not(.boss):not(.wb) { width: min(260px, 66vw) !important; padding: 3px 12px 5px !important; }
body:not(.pc) #hud #topr .clk, body:not(.pc) #hud #topr .gold, body:not(.pc) #hud #crysBox { opacity: .78; font-size: 10.5px !important; padding: 0 8px !important; }
body:not(.pc) #hud #xp span { opacity: .7; font-size: 9.5px !important; padding: 0 6px !important; }
body.combat:not(.pc) #hud #topr .clk, body.combat:not(.pc) #hud #topr .gold, body.combat:not(.pc) #hud #crysBox { opacity: .4; }
body.combat:not(.pc) #hud #xp span { opacity: .35; }
/* (5) portrait window chrome: a lower header; the character windows drop their title row (the tab strip names them) and keep the
   ✕ at the end of the tab row, the same top-right spot as every other window and the menu; the tab strip scrolls sideways at
   natural widths, fading at the side that has more tabs (ui.js hubTabsView) */
body.m-port #panel .win > header { min-height: 0; padding: 3px 4px 3px 10px !important; }
body.m-port #panel .win h2 { font-size: 15px !important; }
body.m-port #panel .wic { width: 26px !important; height: 26px !important; }
body.m-port #panel:is([data-kind="bag"], [data-kind="equip"], [data-kind="stats"], [data-kind="skills"], [data-kind="cards"], [data-kind="fashion"]) .win > header {
  position: absolute; right: 4px; top: 2px; z-index: 3; padding: 0 !important; background: none; border: 0; min-height: 0; }
body.m-port #panel:is([data-kind="bag"], [data-kind="equip"], [data-kind="stats"], [data-kind="skills"], [data-kind="cards"], [data-kind="fashion"]) .win > header h2 { display: none; }
body.m-port #panel:is([data-kind="bag"], [data-kind="equip"], [data-kind="stats"], [data-kind="skills"], [data-kind="cards"], [data-kind="fashion"]) .win > header::after { display: none; }
body:not(.pc) #hubTabs { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
body:not(.pc) #hubTabs::-webkit-scrollbar { display: none; }
body.m-port #hubTabs { padding: 0 52px 0 6px !important; gap: 0 !important; }
body.m-port #hubTabs button { flex: 0 0 auto !important; min-height: 44px !important; padding: 0 12px !important; font-size: 13px !important; gap: 0; white-space: nowrap; }
body.m-port #hubTabs button i { margin-right: 6px; }
body:not(.pc) #hubTabs.mr { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 92px), transparent calc(100% - 52px)); mask-image: linear-gradient(90deg, #000 calc(100% - 92px), transparent calc(100% - 52px)); }
body:not(.pc) #hubTabs.ml { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 36px); mask-image: linear-gradient(90deg, transparent 0, #000 36px); }
body:not(.pc) #hubTabs.ml.mr { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 92px), transparent calc(100% - 52px)); mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 92px), transparent calc(100% - 52px)); }
body:not(.pc) #hud #menuX { margin-left: auto; } /* the menu's ✕ at the top-right like every window (it sat next to the title once the hint text hides) */
/* (5) the bag's worn strip folds away on upright phones (act eqfold, remembered in sigil.bagEqFold) */
.sx-eqfold { display: none; }
@container (max-width: 640px) {
  #pbody .sx-cs.m-bag .sx-eqfold { display: flex; flex: none; flex-direction: column; align-items: center; justify-content: center; gap: 0; width: 44px; min-height: 52px; padding: 0;
    font-size: 13px; line-height: 1; color: var(--sx-gold3); background: rgba(3, 8, 26, .5); border: 1px solid var(--sx-line); border-radius: 10px; }
  #pbody .sx-cs.m-bag .sx-eqfold small { font-size: 9px; color: var(--sx-tx3); margin-top: 3px; white-space: nowrap; }
  .sx-cs.m-bag.eqfold .sx-eql { display: none; }
  .sx-cs.m-bag.eqfold .sx-eqc { padding: 2px; background: none; border: 0; }
  #pbody .sx-cs.m-bag.eqfold .sx-eqfold { flex-direction: row; gap: 6px; width: auto; min-height: 40px; padding: 0 12px; }
  #pbody .sx-cs.m-bag.eqfold .sx-eqfold small { font-size: 11px; margin: 0; }
}
/* (6) skills on phones: compact header (job chips scroll, the chosen one in view: ui.js skAfter); idle (no point to spend, none
   staged) = the advice folds to one line, the greyed − / + rows and the footer go; landscape cards a row lower, three a row */
@media (max-width: 640px) {
  body:not(.pc) .sx-skh { gap: 6px; }
  body:not(.pc) #pbody .sx-jobs button { min-height: 40px; padding: 0 10px 0 6px; gap: 5px; }
  body:not(.pc) #pbody .sx-jobs button .em { width: 20px; height: 20px; font-size: 10px; }
  body:not(.pc) .sx-pts { flex: none; min-width: 0; padding: 3px 10px; justify-content: center; } body:not(.pc) .sx-pts .nx { display: none; } body:not(.pc) .sx-pts b { font-size: 18px; }
  body:not(.pc) .sx-sktools { flex: 1; min-width: 0; } body:not(.pc) #pbody .sx-sktools .u-btn { flex: 1 1 0; min-width: 0; padding: 0 6px; white-space: nowrap; }
  body:not(.pc) .sx-guide { padding: 5px 8px; }
}
body:not(.pc) .sx-sk.idle .sx-guide:not(.open) :is(.chain, .gh .u-btn) { display: none !important; }
body:not(.pc) .sx-sk.idle .sx-guide:not(.open) .gh { flex-wrap: nowrap; }
body:not(.pc) .sx-sk.idle .sx-guide:not(.open) .gh b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }
body:not(.pc) .sx-skc.nopm .pm { display: none; }
body:not(.pc) .sx-sk.idle .sx-skf:not(:has([data-act="cruse"])) { display: none; }
body:not(.pc) .sx-sk.idle .sx-sktools [data-act="hotsort"] { border-color: var(--sx-line-au) !important; color: var(--sx-gold3) !important; }
@media (max-height: 500px) {
  body:not(.pc) .sx-skg { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  body:not(.pc) .sx-skc { gap: 3px; padding: 5px 6px; }
  body:not(.pc) #pbody .sx-skc .main { grid-template-columns: 40px minmax(0, 1fr); gap: 3px 6px; } body:not(.pc) .sx-skic { width: 40px; height: 40px; } body:not(.pc) .sx-skic img { width: 30px; height: 30px; }
  body:not(.pc) .sx-skc .hd .sub { display: none; }
  body:not(.pc) .sx-sk.wide.idle:not(.cbmode) { grid-template-areas: "h h" "l d" "l d"; }
}
/* (7) equipment on phones: the loadout buttons each get their own 40 px save button (they overlapped in portrait, port-07); an
   empty slot with nothing in the bag = one short line and no empty detail column */
body:not(.pc) .sx-pre { gap: 6px; }
body:not(.pc) .sx-pre .pr { grid-template-columns: minmax(0, 1fr) 40px; gap: 3px; }
body:not(.pc) #pbody .sx-pre .pr .u-btn { min-height: 40px; min-width: 0 !important; }
/* upright phones: the hero column is ~76 px a loadout: «ชุด n» over its 💾, each a full 40 px row */
@container (max-width: 640px) { body:not(.pc) .sx-pre .pr { grid-template-columns: minmax(0, 1fr); } }
.sx-none1 { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--sx-rm); background: rgba(3, 8, 26, .45); border: 1px dashed var(--sx-line);
  font-size: var(--sx-fs2); color: var(--sx-tx3); line-height: 1.4; }
.sx-none1 b { color: var(--sx-tx2); } .sx-none1 > :first-child { flex: none; width: 28px; height: 28px; opacity: .6; }
body:not(.pc) .sx-cs.nodet > .sx-det { display: none !important; }
@container (min-width: 641px) and (max-width: 999px) { body:not(.pc) .sx-cs.m-eq.nodet { grid-template-columns: 58px 172px minmax(0, 1fr); grid-template-areas: "eq hero main"; } }
/* (8) status on phones: a shorter identity card and one-line stat rows (buttons stay 40 px), so landscape shows every stat a
   scroll shorter and the hero on the doll whole */
body:not(.pc) #pbody .cs2-id { padding: 7px 10px; gap: 4px; }
body:not(.pc) #pbody .cs2-id .nm { gap: 8px; } body:not(.pc) #pbody .cs2-id .nm small { display: none; }
body:not(.pc) #pbody .cs2-id .sx-bust.lg { width: 36px; height: 36px; }
body:not(.pc) #pbody .cs2-id .chips .u-chip { padding: 1px 8px; font-size: 11.5px; }
body:not(.pc) #pbody .pts2 { padding: 5px 12px; gap: 2px 10px; }
body:not(.pc) #pbody .pts2 br { display: none; } body:not(.pc) #pbody .pts2 b { font-size: 20px; margin-left: 6px; } body:not(.pc) #pbody .pts2 > small { font-size: 11px; }
body:not(.pc) #pbody .arow2 { padding: 2px 6px 2px 10px; margin-bottom: 4px; gap: 6px; }
body:not(.pc) #pbody .arow2 .k { min-height: 40px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 6px; }
body:not(.pc) #pbody .arow2 .k small { display: inline; font-size: 11px; color: var(--sx-tx3); }
body:not(.pc) #pbody .arow2 .v { font-size: 18px; }
body:not(.pc) #pbody .arow2 .u-btn { min-height: 40px; min-width: 40px; }
body:not(.pc) #pbody .cs2-base > .u-h { margin: 2px 0 0; }
@media (max-height: 500px) {
  body:not(.pc) #pbody .cs2-id .bars { display: none; }
  body:not(.pc) #pbody .cs2 .doll { gap: 8px 6px; padding: 0 2px 8px; grid-template-columns: 42px 1fr 42px; }
  body:not(.pc) #pbody .cs2 .doll .col { gap: 8px; }
  body:not(.pc) #pbody .cs2 .doll .u-slot { width: 42px; height: 42px; }
  body:not(.pc) #pbody .cs2 .doll .u-slot :is(.u-lab, small) { display: none; }
  body:not(.pc) #pbody .cs2 .doll .stage { height: 150px; }
}
/* (9) the 'here' map on upright phones opens on the whole map (worldmap.js) with clear «⤢ ทั้งแผนที่» / «📍 ตัวฉัน» buttons and a
   small ⓘ that shows the legend (it was hidden on upright phones); landscape keeps icons; PC is unchanged */
#bigMap .hm-tools :is(.hm-me, .hm-leg), #bigMap .hm-tools button span { display: none; }
body:not(.pc) #bigMap .hm-tools .hm-me { display: inline-grid; place-items: center; }
body.m-port #bigMap .hm-tools .hm-leg { display: inline-grid; place-items: center; }
body.m-port #bigMap .bm-main > .hm-tools { inset: auto 6px 6px 6px; justify-content: center; flex-wrap: wrap; }
body.m-port #bigMap .hm-tools :is(.hm-all, .hm-me) { width: auto; display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; font-size: 15px; }
body.m-port #bigMap .hm-tools :is(.hm-all, .hm-me) span { display: inline; font: 600 12px var(--sx-font); color: var(--sx-tx); }
body.m-port #bigMap .hm-tools .hm-leg[aria-pressed="true"] { border-color: var(--sx-gold) !important; color: var(--sx-gold3); }
body.m-port #bigMap.lgon[data-tab="here"] .wm-legend { display: flex !important; flex-direction: row; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 4px; }
/* ==========================================================================================================
   Skill preview stage (feat/skill-preview, src/skill-preview.js): the picked skill played on dummies at the top of the detail
   ========================================================================================================== */
.sx-skpv { position: relative; flex: none; aspect-ratio: 16 / 9; border-radius: var(--sx-rm); overflow: hidden; border: 1px solid var(--sx-line2);
  background: #16233a; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), 0 6px 18px rgba(0, 0, 0, .35); }
.sx-skpv canvas.skpv { display: block; width: 100%; height: 100%; }
.sx-skpv .pvtag { position: absolute; left: 8px; top: 8px; padding: 2px 10px; border-radius: 999px; font: 600 var(--sx-fs1)/1.6 var(--sx-font);
  color: var(--sx-gold3); background: rgba(6, 10, 24, .7); border: 1px solid rgba(255, 205, 96, .45); pointer-events: none; }
.sx-skpv .pvb { position: absolute; right: 6px; top: 6px; display: flex; gap: 4px; }
#pbody .sx-skpv .pvb button { min-width: 34px; min-height: 34px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; font-size: 15px; line-height: 1;
  color: var(--sx-tx); background: rgba(6, 10, 24, .72); border: 1px solid var(--sx-line2); cursor: pointer; }
#pbody .sx-skpv .pvb button.on { border-color: var(--sx-gold3); box-shadow: 0 0 10px rgba(255, 205, 96, .5); color: var(--sx-gold3); }
#pbody .sx-skpv .pvplay { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 22px; color: #1a1206; background: linear-gradient(180deg, #ffe7a0, #e8b44a); border: 2px solid #fff3c8; box-shadow: 0 4px 16px rgba(0, 0, 0, .5); cursor: pointer; }
#pbody .sx-skpv .pvplay[hidden] { display: none; }
.sx-skd.sheet .sx-skpv { aspect-ratio: 2 / 1; max-height: 34vh; }
@media (max-height: 500px) { .sx-skpv { aspect-ratio: 2 / 1; } }
@media (pointer: coarse) { #pbody .sx-skpv .pvb button { min-width: 40px; min-height: 40px; } }
.sx-skd.sheet .sx-skpv .pvb { right: auto; left: 6px; } /* the sheet's ✕ sits on the top-right corner */

/* ---------- Refine result popup + refine set line (owner 2026-10-17, branch feat/refine-set) ---------- */
/* over the smith window too (z above #panel), never takes a tap; gold = บวกติด, slate-red = บวกไม่ติด */
.rf-pop { position: fixed; left: 50%; top: 36%; z-index: 80; transform: translate(-50%, -50%); pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 30px 12px; border-radius: 14px;
  background: radial-gradient(ellipse at 50% 40%, rgba(22, 30, 52, .94), rgba(10, 14, 26, .9)); border: 2px solid var(--sx-gold2);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 10px 40px rgba(0, 0, 0, .6); animation: rfIn .32s cubic-bezier(.2, 1.6, .4, 1); transition: opacity .35s, transform .35s; }
.rf-pop.out { opacity: 0; transform: translate(-50%, -62%); }
.rf-pop b { font: 800 34px/1.1 var(--u-font, 'Prompt', sans-serif); letter-spacing: .5px; text-shadow: 0 3px 0 rgba(0, 0, 0, .55), 0 0 18px currentColor; }
.rf-pop .rf-it { font: 600 15px var(--u-font, 'Prompt', sans-serif); color: var(--sx-gold3); }
.rf-pop .rf-it em { font-style: normal; font-weight: 800; color: var(--sx-gold); }
.rf-pop small { font: 500 13px var(--u-font, 'Prompt', sans-serif); color: #c9d2e6; }
.rf-pop.ok b { color: var(--sx-gold); }
.rf-pop.ok { box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 0 36px rgba(255, 200, 90, .45), 0 10px 40px rgba(0, 0, 0, .6); }
.rf-pop.no { border-color: #8a4a52; }
.rf-pop.no b { color: #ff8a8a; }
@keyframes rfIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.6); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@media (max-height: 500px) { .rf-pop { top: 30%; padding: 10px 22px 9px; } .rf-pop b { font-size: 26px; } }
@media (prefers-reduced-motion: reduce) { .rf-pop { animation: none; transition: none; } }
#pbody .rf-setline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 8px; font-size: var(--sx-fs2, 12px); color: var(--sx-text2, #b8c3da); }

/* ---- Card socket caps (bal/cards 2026-10-17): src/card-ui.js cardCapBox on the card window's socket tab ---- */
#pbody .cdcap { margin: var(--sx-s2) 0; padding: var(--sx-s2) var(--sx-s3); }
#pbody .cdcap-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px var(--sx-s3); }
#pbody .cdcap-r { display: grid; grid-template-columns: auto 1fr; gap: 0 6px; align-items: baseline; min-width: 0; }
#pbody .cdcap-r span { color: var(--sx-text2, #b7c3de); }
#pbody .cdcap-r b { color: var(--sx-gold, #e8c26a); }
#pbody .cdcap-r small { grid-column: 1 / -1; color: var(--sx-text3, #8a96b4); font-size: var(--sx-fs1, 11px); line-height: 1.3; }
#pbody .cdcap-r.cut b { color: #ffb36b; }
#pbody .cdcap-n { display: block; margin-top: 4px; color: var(--sx-text3, #8a96b4); }
#pbody .cdout { margin: var(--sx-s2) 0; padding: var(--sx-s2) var(--sx-s3); border-color: var(--sx-gold2, #f2a93b); }
#pbody .cdout-l { display: grid; gap: 6px; margin-top: 6px; }
#pbody .cdout-r { display: flex; align-items: center; justify-content: space-between; gap: var(--sx-s2); min-width: 0; }
#pbody .cdout-r span { display: flex; flex-direction: column; min-width: 0; }
#pbody .cdout-r small { color: var(--sx-text3, #8a96b4); }
#pbody .cdout-r .u-btn { flex: none; min-height: 40px; }

/* ===== VIP (feat/vip-topup, VIP-REPORT.md): window 'vip' (src/vip-ui.js) + the chip by my name. --vc = the level's colour ===== */
.vip { display: flex; flex-direction: column; gap: var(--sx-s3); font-family: var(--sx-font); color: var(--sx-tx); }
.vip-lv { --vc: #8aa0c8; display: inline-flex; align-items: center; justify-content: center; min-width: 52px; padding: 2px 10px; border-radius: 999px;
  font: 800 var(--sx-fs2) var(--sx-font); letter-spacing: .5px; color: #120a20; background: linear-gradient(180deg, #fff, var(--vc) 55%);
  border: 1px solid rgba(255, 255, 255, .55); box-shadow: 0 0 10px color-mix(in srgb, var(--vc) 55%, transparent); white-space: nowrap; }
.vip-lv.big { min-width: 92px; height: 56px; font-size: var(--sx-fs6); border-radius: var(--sx-rm); }
.vip-top { display: flex; gap: var(--sx-s3); align-items: center; padding: var(--sx-s3); background: var(--sx-card); border: 1px solid var(--sx-line-au); border-radius: var(--sx-rm); }
.vip-prog { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.vip-tot { font-size: var(--sx-fs3); color: var(--sx-tx2); } .vip-tot b { color: var(--sx-gold); font-size: var(--sx-fs5); }
.vip-prog small, .vip-row small { color: var(--sx-tx3); font-size: var(--sx-fs1); }
.vip-bar { position: relative; height: 18px; border-radius: 999px; background: var(--sx-well); overflow: hidden; border: 1px solid var(--sx-line); }
.vip-bar i { position: absolute; inset: 0 auto 0 0; background: var(--sx-exp); border-radius: 999px; }
.vip-bar span { position: relative; display: block; text-align: center; font: 700 var(--sx-fs1)/16px var(--sx-font); color: var(--sx-tx); text-shadow: 0 1px 2px #000; }
.vip-day { display: flex; gap: var(--sx-s2); align-items: center; padding: var(--sx-s2) var(--sx-s3); background: var(--sx-card); border: 1px solid var(--sx-line); border-radius: var(--sx-rm); }
.vip-day.on { border-color: var(--sx-line-au); box-shadow: var(--sx-glow-au); }
.vip-day > i { font-style: normal; font-size: 22px; } .vip-day span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vip-day button, .vip-gift button { min-height: var(--sx-tap); }
.vip-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--sx-s2); }
.vip-row { --vc: #8aa0c8; display: flex; flex-direction: column; gap: 6px; padding: var(--sx-s3); border-radius: var(--sx-rm); background: var(--sx-card);
  border: 1px solid var(--sx-line); border-top: 3px solid var(--vc); opacity: .82; }
.vip-row.have { opacity: 1; } .vip-row.cur { box-shadow: 0 0 0 1px var(--vc), 0 0 16px color-mix(in srgb, var(--vc) 40%, transparent); }
.vip-rh { display: flex; align-items: center; gap: var(--sx-s2); } .vip-rh em { margin-left: auto; font: 700 var(--sx-fs1) var(--sx-font); font-style: normal; color: var(--sx-gold); }
.vip-perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: var(--sx-fs2); color: var(--sx-tx2); }
.vip-perks i { font-style: normal; display: inline-block; width: 20px; }
.vip-gift { display: flex; flex-direction: column; gap: 4px; padding: var(--sx-s2); border-radius: var(--sx-rs); background: var(--sx-well); font-size: var(--sx-fs2); }
.vip-gift span { color: var(--sx-tx); } .vip-ok { color: var(--sx-up) !important; font-weight: 700; } .vip-need { color: var(--sx-tx3) !important; }
.vip-fair { font-size: var(--sx-fs1); }
@media (max-height: 500px) { .vip-lv.big { height: 44px; min-width: 76px; font-size: var(--sx-fs5); } .vip-list { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
@media (max-width: 520px) { .vip-list { grid-template-columns: 1fr; } }
#hud #vipTag { --vc: #8aa0c8; margin-left: 4px; padding: 0 6px; border-radius: 999px; font: 800 9px/14px var(--sx-font); color: #120a20; cursor: pointer;
  background: linear-gradient(180deg, #fff, var(--vc) 60%); border: 1px solid rgba(255, 255, 255, .5); position: relative; vertical-align: middle; pointer-events: auto; }
#hud #vipTag[hidden] { display: none; }
#hud #vipTag.dot::after { content: ''; position: absolute; top: -2px; right: -2px; width: 6px; height: 6px; border-radius: 50%; background: var(--sx-rose); }
/* ===== VIP star before a sender's name in chat + the black screen log (src/vip-star.js starHtml; the world name layer draws its own) ===== */
.vstar { display: inline-block; margin-right: 3px; font-style: normal; font-weight: 900; line-height: 1; transform: translateY(-.5px);
  -webkit-text-stroke: .6px rgba(8, 10, 18, .9); }
.vstar.v1 { color: #cfe6ff; text-shadow: 0 0 3px rgba(160, 200, 255, .45); }
.vstar.v2 { color: #8ff0b4; text-shadow: 0 0 4px rgba(110, 240, 160, .6); }
.vstar.v3 { color: #d2b4ff; text-shadow: 0 0 5px rgba(190, 140, 255, .75); }
.vstar.v4 { color: #ffd56a; text-shadow: 0 0 5px rgba(255, 200, 90, .9), 0 0 10px rgba(255, 180, 60, .55); }
.vstar.v5 { color: transparent; -webkit-text-stroke: 0; background: linear-gradient(90deg, #ff6b8b, #ffb347, #fff36a, #7dff9a, #6fd8ff, #9b8cff, #ff7ce0, #ff6b8b);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 3px rgba(255, 255, 255, .8)) drop-shadow(0 0 6px rgba(255, 140, 220, .6));
  animation: vstar5 2.4s linear infinite; }
@keyframes vstar5 { to { background-position: 200% 0; } }
/* phones / quality low / reduced motion: the rainbow stays still (one picture, no repaint every frame) */
@media (pointer: coarse), (prefers-reduced-motion: reduce) { .vstar.v5 { animation: none; } }
.vip-mon { flex-wrap: wrap; } .vip-mon button { white-space: nowrap; }
/* VIP profile frame: my portrait glows in the level's colour (VIP 5: a turning rainbow, still on phones) */
#hud #me[data-vip="1"] #portrait { filter: drop-shadow(0 0 3px #9fd8ff); }
#hud #me[data-vip="2"] #portrait { filter: drop-shadow(0 0 4px #7cf29a); }
#hud #me[data-vip="3"] #portrait { filter: drop-shadow(0 0 5px #c79bff) drop-shadow(0 0 2px #fff); }
#hud #me[data-vip="4"] #portrait { filter: drop-shadow(0 0 6px #ffc85c) drop-shadow(0 0 2px #fff6d0); }
#hud #me[data-vip="5"] #portrait { filter: drop-shadow(0 0 6px #ff7ce0) drop-shadow(0 0 3px #6fd8ff); animation: vipFrame5 3s linear infinite; }
@keyframes vipFrame5 { 0% { filter: drop-shadow(0 0 6px #ff6b8b) drop-shadow(0 0 3px #fff36a); } 33% { filter: drop-shadow(0 0 6px #7dff9a) drop-shadow(0 0 3px #6fd8ff); } 66% { filter: drop-shadow(0 0 6px #9b8cff) drop-shadow(0 0 3px #ff7ce0); } 100% { filter: drop-shadow(0 0 6px #ff6b8b) drop-shadow(0 0 3px #fff36a); } }
@media (pointer: coarse), (prefers-reduced-motion: reduce) { #hud #me[data-vip="5"] #portrait { animation: none; } }
/* VIP top-up box (slip upload, server/slipok.js) */
.vip-slip { display: flex; gap: var(--sx-s2); align-items: center; flex-wrap: wrap; padding: var(--sx-s2) var(--sx-s3); background: var(--sx-card); border: 1px solid var(--sx-line); border-radius: var(--sx-rm); }
.vip-slip.on { border-color: var(--sx-line-au); }
.vip-slip > i { font-style: normal; font-size: 22px; } .vip-slip > span { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vip-slip small { color: var(--sx-tx3); font-size: var(--sx-fs1); } .vip-slip small b { color: var(--sx-gold); }
.vip-slip .vip-file, .vip-slip button { min-height: var(--sx-tap); display: inline-flex; align-items: center; cursor: pointer; }
.vip-slipmsg { margin: 2px 0 0; font-size: var(--sx-fs2); font-weight: 700; } .vip-slipmsg.ok { color: var(--sx-up); } .vip-slipmsg.bad { color: var(--sx-down); }
#pbody .vip-slip .vip-file { padding: 0 14px; border-radius: var(--sx-rs); background: var(--sx-btn); border: 1px solid var(--sx-line2); color: var(--sx-tx); font: 700 var(--sx-fs2) var(--sx-font); }

/* ---------- Fashion (feat/fashion 2026-10-17): the «แฟชั่น» character tab, src/fashion-ui.js ---------- */
.fs-win { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 12px; align-items: start; }
.fs-stage { position: sticky; top: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: var(--sx-rm); border: 1px solid var(--sx-line); background: radial-gradient(ellipse at 50% 70%, #2c3c66 0, #141a30 70%); }
.fs-prev { width: 100%; aspect-ratio: 1; display: block; }
.fs-ctl { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.fs-ctl button { min-height: var(--sx-tap); min-width: 44px; padding: 0 10px; border-radius: var(--sx-rs); }
.fs-ctl button.on { border-color: #ffd34a; color: #ffe9a0; }
.fs-trynote { font-size: var(--sx-fs1); color: #ffe9a0; text-align: center; } .fs-trynote button { min-height: 32px; margin-left: 6px; }
.fs-stage .note { margin: 0; font-size: var(--sx-fs1); }
.fs-main { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.fs-wallet { display: flex; gap: 14px; flex-wrap: wrap; }
.fs-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: var(--sx-fs2); }
.fs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.fs-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border-radius: var(--sx-rm); border: 1px solid var(--sx-line); background: var(--sx-card); text-align: center; cursor: pointer; }
.fs-card.own { border-color: rgba(88, 240, 160, .45); } .fs-card.on { border-color: #ffd34a; box-shadow: 0 0 0 1px #ffd34a inset; }
.fs-card.try { outline: 2px dashed #7ad8ff; outline-offset: -3px; }
.fs-card b { font-size: var(--sx-fs2); } .fs-card small { color: var(--sx-tx3); font-size: var(--sx-fs1); min-height: 2.4em; }
.fs-card button { min-height: 40px; width: 100%; }
.fs-pic { display: grid; place-items: center; width: 72px; height: 60px; }
.fs-pic img { max-width: 72px; max-height: 60px; object-fit: contain; }
.fs-sw { width: 44px; height: 44px; border-radius: 50%; background: hsl(var(--h) var(--s) var(--l)); box-shadow: 0 0 0 2px #0006, 0 0 12px hsl(var(--h) var(--s) var(--l) / .6); }
@media (max-width: 640px) { .fs-win { grid-template-columns: 1fr; } .fs-stage { position: static; max-width: 300px; margin: 0 auto; } .fs-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); } }
/* landscape phones: a small stage beside the list so the turn / pose buttons stay on screen */
@media (max-height: 500px) and (min-width: 641px) { .fs-win { grid-template-columns: 170px minmax(0, 1fr); gap: 8px; } .fs-stage { padding: 4px; } .fs-prev { width: 160px; height: 160px; margin: 0 auto; } .fs-stage .note { display: none; } .fs-ctl button { min-width: 40px; padding: 0 6px; font-size: var(--sx-fs1); } }

/* ---------- Gemini review r9 (2026-10-17): HUD readability. html.r9-old = the old look (A/B) ---------- */
/* (9) the chat / system log on touch layouts sat straight on the grass (light-green system lines on bright meadow): a dark
   glass backdrop. PC and tablets already have one; phones hide the log on coarse pointers, this covers the landscape layout
   on any pointer (narrow windows, phones that report a fine pointer) */
html:not(.r9-old) body:not(.pc):not(.m-tab) #hud #log { background: rgba(5, 9, 24, .46); border-radius: 10px; padding: 6px 10px 5px;
  -webkit-mask-image: none; mask-image: none; box-shadow: 0 0 0 1px rgba(132, 172, 255, .14); }
html:not(.r9-old) body.combat:not(.pc):not(.m-tab) #hud #log { opacity: .7; } /* the fight fade (.35) took the backdrop with it */
/* (10) buff time left: a clean dark pill centred under each buff icon (it was loose white digits over the ground) */
html:not(.r9-old) #hud #buffs { gap: 6px; padding-bottom: 6px; }
html:not(.r9-old) #hud #buffs .bf i { left: 50%; right: auto; bottom: -7px; transform: translateX(-50%); box-sizing: border-box; min-width: 18px; height: 13px; padding: 0 4px;
  border-radius: 999px; background: rgba(4, 10, 32, .92); box-shadow: 0 0 0 1px rgba(255, 213, 106, .5); font: 800 9.5px/13px var(--sx-font); font-style: normal;
  text-align: center; color: #fff; text-shadow: none; white-space: nowrap; }
html:not(.r9-old) #hud #buffs .bf.end i { color: #ffd0d0; box-shadow: 0 0 0 1px rgba(255, 110, 110, .8); }
/* (10) hotbar cooldowns: the icon keeps a little colour and the part still cooling is dark (ui.js sweep), so the sweep reads
   as a clock filling back in and ready skills stand out; the seconds sit on a dark halo */
html:not(.r9-old) #hud .sk.cooling .ic { filter: saturate(.5) brightness(.9); }
html:not(.r9-old) #hud .sk.cooling { border-color: rgba(95, 225, 255, .35) !important; }
html:not(.r9-old) #hud .sk.cooling .cd { text-shadow: 0 0 2px #000, 0 0 6px rgba(0, 0, 0, .95), 0 1px 2px #000 !important; }

/* ---------- Phone review 4 + 10 (2026-10-18, ui/phone-4-10: Codex Astra phone review, items 4 and 10) ---------- */
/* (4) landscape thumbs: dash + potions sit right of the joystick (left thumb), clear of its base and of the EXP labels under
   it; the AUTO row moves up against the wheel (right thumb). The middle of the bottom edge is free for the fight */
body.m-land #pills { left: calc(28px + var(--sl) + 124px * var(--hk) * var(--ctl) + 18px); right: auto; bottom: calc(30px + var(--sb)); transform-origin: left bottom; }
body.m-land #quick { right: calc(26px + var(--sr) + 250px * var(--hk) * var(--ctl)); bottom: calc(30px + var(--sb)); }
/* a long press on a HUD action button names it (ui.js initTips) */
#lpLbl { position: fixed; z-index: 60; pointer-events: none; padding: 5px 10px; border-radius: 8px; white-space: nowrap;
  background: rgba(10, 16, 32, .94); border: 1px solid var(--sx-line-au); color: var(--sx-gold3); font: 600 var(--sx-fs2) var(--sx-font);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
/* (10) compact category tabs on touch (settings + AUTO): one short row, icon beside the word */
body:not(.pc) #pbody .settabs > button { min-height: 40px; padding: 0 10px; font-size: var(--sx-fs1); white-space: nowrap; }
body:not(.pc) #pbody .sx-acats button { min-height: 40px; flex-direction: row; gap: 4px; padding: 2px 4px; }
body:not(.pc) .sx-acats i .uic { width: 20px; height: 20px; }
/* (10) "not chosen" reads as a live choice (outlined, full text colour); "can't be used" is dimmed and dashed */
#pbody :is(.seg, .sx-seg) > button:not(.on):not(:disabled) { border-color: var(--sx-line2); background: rgba(255, 255, 255, .035); color: var(--sx-tx); }
#pbody :is(.seg, .sx-seg) > button:disabled { opacity: .4; border: 1px dashed var(--sx-line); background: transparent; cursor: not-allowed; }
/* (4) the EXP / JOB labels sat right of the joystick, where the potions are now: one row under the joystick instead */
body.m-land #hud #expTxt { left: calc(28px + var(--sl)) !important; bottom: 10px !important; top: auto !important; }
body.m-land #hud #jexpTxt { left: calc(96px + var(--sl)) !important; bottom: 10px !important; top: auto !important; }

/* ---------- Boss board (2026-10-18, feat/boss-board: window 'bosses', ui.js bossBoard) ---------- */
#pbody .bb-h { margin: 12px 0 6px; font: 700 var(--sx-fs4) var(--sx-font); color: var(--sx-gold3); } #pbody .bb-h small { color: var(--sx-tx2); font-weight: 500; margin-left: 6px; }
#pbody .bb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px; }
#pbody .bbrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--sx-rm); background: var(--sx-well); border: 1px solid var(--sx-line); }
#pbody .bbrow.fit { border-color: var(--sx-line-au); }
#pbody .bbrow img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; flex: none; }
#pbody .bbrow .bb-t { flex: 1; min-width: 0; line-height: 1.35; font-size: var(--sx-fs2); }
#pbody .bbrow .bb-t small { color: var(--sx-tx2); }
#pbody .bb-up { color: #7dffa8; font-weight: 600; } #pbody .bb-down { color: var(--sx-tx2); } #pbody .bb-down b { color: #ffd56a; font-variant-numeric: tabular-nums; }
#pbody .bbrow .u-btn { flex: none; min-height: 40px; min-width: 64px; }
body.m-port #pbody .bb-list { grid-template-columns: 1fr; }
/* ===== Hall of Legends (feat/legends, LEGENDS-DESIGN.md): window 'legends' = hall / chronicle / castle reigns ===== */
#panel[data-kind="legends"] .dq { --npc: url(assets/icons/ui/rank.png); }
.lg-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 4px 0 6px; padding: 10px 14px; border-radius: var(--sx-rm);
  border: 1px solid var(--sx-line-au); background: linear-gradient(135deg, rgba(232, 192, 96, .16), rgba(20, 26, 52, .6)); }
.lg-sum b { font-size: var(--sx-fs5); color: var(--sx-gold); } .lg-sum small { color: var(--sx-tx2); }
.lg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 8px; margin-bottom: 8px; }
.lg-slot { display: flex; gap: 10px; align-items: flex-start; min-width: 0; padding: 8px 10px; border-radius: var(--sx-rm);
  border: 1px dashed var(--sx-line); background: rgba(12, 18, 38, .45); opacity: .72; }
.lg-slot.got { opacity: 1; border: 1px solid var(--sx-line-au); background: linear-gradient(160deg, rgba(232, 192, 96, .14), rgba(16, 22, 46, .75) 60%); box-shadow: var(--sx-glow-au); }
#pbody .lg-ic { width: 44px; height: 44px; font-size: 22px; } .lg-ic img { width: 38px; height: 38px; object-fit: contain; image-rendering: pixelated; }
.lg-slot:not(.got) .lg-ic img { filter: grayscale(1) brightness(.55); }
.lg-tx { display: grid; gap: 2px; min-width: 0; } .lg-tx em { font-style: normal; font-weight: 800; color: var(--sx-tx); overflow-wrap: anywhere; }
.lg-tx i { font-style: normal; font-size: var(--sx-fs1); color: var(--sx-tx3); }
.lg-who { display: flex; flex-wrap: wrap; gap: 2px 10px; } .lg-who span { white-space: nowrap; } .lg-who b { color: var(--sx-gold); } .lg-who small { color: var(--sx-tx2); font-size: var(--sx-fs1); margin-left: 4px; }
.lg-tx u { text-decoration: none; font-size: var(--sx-fs1); color: var(--sx-tx3); } .lg-none { color: var(--sx-tx3); font-size: var(--sx-fs2); }
.lg-chron { display: grid; gap: 4px; } .lg-day { margin: 8px 0 2px; font-weight: 800; color: var(--sx-gold); border-bottom: 1px solid var(--sx-line-au); padding-bottom: 2px; }
.lg-ev { display: flex; gap: 8px; align-items: flex-start; padding: 6px 10px; border-radius: var(--sx-rs); background: rgba(12, 18, 38, .45); }
.lg-ev i { font-style: normal; flex: none; width: 22px; text-align: center; } .lg-ev.leg { background: linear-gradient(90deg, rgba(232, 192, 96, .16), rgba(12, 18, 38, .45)); }
.lg-castle { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--sx-rm); border: 1px solid var(--sx-line-au); background: rgba(16, 22, 46, .7); }
.lg-castle > div { display: grid; gap: 4px; min-width: 0; } .lg-castle b { font-size: var(--sx-fs5); color: var(--sx-gold); } .lg-castle small { color: var(--sx-tx2); }
.lg-flag { flex: none; width: 72px; height: 120px; image-rendering: pixelated; }
.lg-reigns { display: grid; gap: 6px; }
.lg-reign { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 8px 10px; border-radius: var(--sx-rs); background: rgba(12, 18, 38, .45); }
.lg-reign i { grid-row: 1 / 3; width: 14px; height: 30px; border-radius: 3px; background: hsl(var(--h) 58% 42%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.lg-reign span { color: var(--sx-tx2); font-size: var(--sx-fs1); text-align: right; } .lg-reign small { grid-column: 2 / 4; color: var(--sx-tx3); font-size: var(--sx-fs1); }
.lg-reign.now { border: 1px solid var(--sx-line-au); }
@media (max-height: 500px) { #panel[data-kind="legends"] .dq { display: none; } .lg-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } .lg-flag { width: 48px; height: 80px; } }
@media (max-width: 520px) { .lg-grid { grid-template-columns: 1fr; } }
/* ===== Thai festivals (feat/festivals 2026-10-18, src/festival-ui.js): window 'fest' + the harbour pill ===== */
.fe-win { display: block; }
.fe-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; padding: 8px 10px; border-radius: var(--sx-rm); border: 1px solid #ff9cc4; background: linear-gradient(135deg, rgba(255, 120, 180, .18), rgba(20, 24, 48, .62)); }
.fe-tk { display: flex; align-items: baseline; gap: 6px; } .fe-tk b { color: #ffd0e6; font-size: var(--sx-fs5); } .fe-tk small, .fe-win > small { color: var(--sx-tx2); font-size: var(--sx-fs1); }
.fe-tki { width: 24px; height: 24px; vertical-align: -6px; image-rendering: auto; } .fe-item button .fe-tki, .fe-btns button .fe-tki { width: 18px; height: 18px; vertical-align: -4px; }
.fe-peak { padding: 3px 10px; border-radius: 999px; background: rgba(255, 214, 110, .18); color: #ffe29a; font-size: var(--sx-fs2); font-weight: 700; }
.fe-head .fe-until { margin-left: auto; color: var(--sx-tx2); font-size: var(--sx-fs1); }
.fe-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin: 6px 0; }
.fe-card { padding: 10px; border-radius: var(--sx-rm); border: 1px solid var(--sx-line); background: var(--sx-card); }
.fe-ch { display: flex; align-items: center; gap: 8px; } .fe-ch i { font-style: normal; font-size: 22px; } .fe-ch b { font-size: var(--sx-fs3); } .fe-ch em { margin-left: auto; font-style: normal; font-size: var(--sx-fs6, 26px); font-weight: 800; color: #ffd0e6; }
.fe-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .fe-btns button { min-height: 44px; flex: 1; }
.fe-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: var(--sx-fs2); } .fe-row span { min-width: 92px; } .fe-row small { margin-left: auto; color: var(--sx-tx2); }
.fe-pips { display: flex; gap: 4px; } .fe-pips i { width: 14px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .12); } .fe-pips i.on { background: #ff9cc4; }
.fe-styles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fe-style { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 44px; padding: 6px; text-align: center; }
.fe-style img { width: 56px; height: 48px; object-fit: contain; image-rendering: auto; } .fe-style b { font-size: var(--sx-fs2); } .fe-style small { font-size: var(--sx-fs1); color: var(--sx-tx2); line-height: 1.3; font-weight: 400; }
.fe-style.on, .fe-wishes button.on { border-color: #ff9cc4 !important; box-shadow: 0 0 0 1px #ff9cc4 inset, 0 0 12px rgba(255, 140, 190, .35); }
.fe-wishes { display: flex; flex-wrap: wrap; gap: 6px; } .fe-wishes button { min-height: 40px; padding: 4px 12px; font-size: var(--sx-fs2); }
.fe-go { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; } .fe-go .big { flex: 2; min-height: 52px; font-size: var(--sx-fs4); } .fe-go button:not(.big) { flex: 1; min-height: 52px; }
.fe-shop { display: grid; gap: 6px; }
.fe-item { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--sx-line); background: var(--sx-card); }
.fe-item.on { border-color: #ff9cc4; } .fe-item b { display: block; font-size: var(--sx-fs3); } .fe-item small { display: block; color: var(--sx-tx2); font-size: var(--sx-fs1); }
.fe-item button { min-height: 40px; min-width: 76px; } .fe-ic { display: grid; place-items: center; font-size: 24px; } .fe-ic img { width: 40px; height: 40px; object-fit: contain; image-rendering: auto; }
.fe-story p { margin: 6px 0; line-height: 1.55; color: var(--sx-tx2); } .fe-story p::before { content: '🪷 '; }
.fe-off { display: flex; flex-direction: column; gap: 4px; padding: 14px; margin: 6px 0; border-radius: var(--sx-rm); border: 1px dashed var(--sx-line2); text-align: center; } .fe-off small { color: var(--sx-tx2); }
.fe-hud { position: fixed; left: 50%; transform: translateX(-50%); bottom: 132px; z-index: 30; min-height: 44px; padding: 6px 18px; border-radius: 12px; border: 1px solid #ff9cc4; background: linear-gradient(#5a2240, #26101e); color: #ffe8f2; font: 800 15px Prompt, sans-serif; box-shadow: 0 2px 10px #000a; cursor: pointer; }
.fe-hud small { display: block; font-weight: 400; font-size: 11px; color: #ffc6dc; } .fe-hud[hidden] { display: none; }
.fe-hud.near { border-color: #ffd36a; box-shadow: 0 0 14px rgba(255, 200, 110, .55), 0 2px 10px #000a; animation: fe-pulse 1.6s ease-in-out infinite; }
body.pc .fe-hud { left: auto; right: 150px; transform: none; bottom: 150px; } body.m-port .fe-hud { bottom: 250px; } /* PC: off the water in front of the hero, by the right buttons */
@keyframes fe-pulse { 50% { box-shadow: 0 0 22px rgba(255, 210, 120, .8), 0 2px 10px #000a; } }
@media (prefers-reduced-motion: reduce) { .fe-hud.near { animation: none; } }
@media (max-height: 500px) { body.m-land .fe-hud { left: auto; right: 250px; transform: none; } .fe-hud { bottom: 150px; min-height: 40px; padding: 4px 14px; } .fe-cards { grid-template-columns: 1fr 1fr; } .fe-style img { width: 40px; height: 34px; } .fe-style small { display: none; } }
@media (max-width: 520px) { .fe-styles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fe-style small { display: none; } .fe-go .big { flex-basis: 100%; } }

/* ro-cards: a long effect line (autospell, status chance) spans both columns of the item tip grid */
.ic2-st { grid-auto-flow: row dense; }
.ic2-st .ic2-w { grid-column: 1 / -1; }

/* ro-cast: a spell's cast split under its time (variable + fixed, ui.js castParts) */
.sx-cost .cast-sub, .tipgrid .cast-sub, .cast-sub { display: block; flex-basis: 100%; text-align: center; font-size: var(--sx-fs1); font-style: normal; color: var(--sx-tx3); white-space: nowrap; }
/* ro-pet: pet bond in the pet window (tier chip, bar, owner bonus) + the field-token tab at the tavern */
.rbond { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; }
.rbond .rb-chip { padding: 1px 8px; border-radius: 999px; font-size: var(--sx-fs1, 12px); font-weight: 700; color: #10131c; background: var(--bc); white-space: nowrap; }
.rbond .u-bar { flex: 1 1 140px; min-width: 120px; }
.u-bar.u-bond > i { background: linear-gradient(90deg, #ff8fc8, var(--bc, #ffd86a)); }
.rbond .rb-on { color: #ffd86a; font-size: var(--sx-fs1, 12px); }
.rbond .rb-off { color: var(--sx-text-dim, #9aa3b5); font-size: var(--sx-fs1, 12px); }
.rbond .rb-day { width: 100%; color: var(--sx-text-dim, #9aa3b5); }
#pbody .rn2 .rn-t > .u-btn { margin-top: 4px; align-self: flex-start; min-height: 40px; }
#pbody .rn2 .rbond .u-bar { max-width: 320px; }
.ftok-ic { width: 22px; height: 22px; vertical-align: middle; image-rendering: pixelated; }
.ftok-it { width: 32px; height: 32px; vertical-align: middle; image-rendering: pixelated; margin-right: 4px; }
#pbody .ftok-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
#pbody .ftok-row { padding: 6px 10px; align-items: center; }
.ftok-tabs button b { margin-left: 4px; color: #ffd86a; }
.ftok-row button { min-width: 72px; }
/* the rune board's tile rule (#pbody .rn-t: round, square, dimmed) also caught the pet rows' text column (same class name):
   undo it inside the pet window so the bond block has room */
#pbody .rn2 .rn-t { aspect-ratio: auto; border-radius: 0; border: 0; background: none; opacity: 1; place-items: initial; flex: 1 1 auto; align-items: stretch; }
/* ===== Item combos (feat/ro-combo, src/combo-ui.js): tooltip section + character screen chips ===== */
.ic2-combo .cb-row { margin: 3px 0 5px; padding: 4px 6px; border-radius: 6px; background: rgba(20, 30, 60, .45); border: 1px solid var(--sx-line); }
.ic2-combo .cb-row.on, .cb-row.on { border-color: #e8c26a; background: rgba(232, 194, 106, .12); }
.cb-row b { color: #e8d6a6; font-weight: 700; } .cb-row.on b { color: #ffd86a; }
.cb-row small { color: #8d97ad; }
.cb-pcs { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 2px 0; }
.cb-pc { font-size: 11px; white-space: nowrap; }
.cb-pc.ok { color: #9affb0; }
.cb-pc.no { color: #ff8a9a; font-weight: 700; }
.cb-pc.opt { color: #8d97ad; }
.cb-bn { font-size: 11px; color: #c9d3ea; } .cb-row.on .cb-bn { color: #ffe9a8; }
.sx-pill.cb-pill:not(.au) { border-style: dashed; }

/* ===== RO achievements (feat/ro-achieve, src/achieve-ui.js): level card, reward track, recent strip, progress on cards ===== */
#pbody .achlv { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px;
  background: radial-gradient(80% 140% at 0% 0%, rgba(255, 213, 106, .18), transparent 60%), var(--sx-card); border: 1px solid var(--sx-line-au); }
#pbody .achlvb { display: grid; justify-items: center; min-width: 76px; } #pbody .achlvb small { font-size: var(--sx-fs1); color: var(--sx-tx3); }
#pbody .achlvb b { font-size: 34px; line-height: 1; color: var(--sx-gold3); text-shadow: 0 0 12px rgba(255, 205, 96, .5); } #pbody .achlvb em { font-style: normal; font-size: var(--sx-fs1); color: var(--sx-tx3); }
#pbody .achlvr { display: grid; gap: 6px; min-width: 0; } #pbody .achlvr .gbar { margin-top: 0; } #pbody .achlvr .gbar i { background: linear-gradient(90deg, #ffbf3a, #fff08a); }
#pbody .achlvr small { color: var(--sx-tx2); font-size: var(--sx-fs1); } #pbody .achlvr .big { margin: 0; }
#pbody .achtrack { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 4px; }
#pbody .achtrack span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; font: 700 11px/1 var(--sx-font);
  color: var(--sx-tx3); background: var(--sx-well); border: 1px solid var(--sx-line2); }
#pbody .achtrack span.big { border-color: rgba(200, 108, 255, .55); }
#pbody .achtrack span.ready { color: #221400; background: linear-gradient(#fff08a, #ffbf3a); border-color: #ffd36a; animation: achReady 1.2s ease-in-out infinite alternate; }
#pbody .achtrack span.paid { color: var(--sx-gold); background: rgba(255, 213, 106, .14); border-color: var(--sx-line-au); }
@keyframes achReady { to { box-shadow: 0 0 10px rgba(255, 205, 96, .8); } }
#pbody .achrec { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 6px; font-size: var(--sx-fs1); }
#pbody .achrec small { color: var(--sx-tx3); } #pbody .achrec span { padding: 3px 8px; border-radius: 999px; background: rgba(255, 213, 106, .12); color: var(--sx-gold3); border: 1px solid var(--sx-line-au); }
#pbody .achtabs small { opacity: .7; font-size: var(--sx-fs1); }
#pbody .ach .gbar { height: 12px; margin-top: 4px; } #pbody .ach .gbar span { font-size: 9px; line-height: 12px; }
#pbody .ach .achpt { float: right; font-style: normal; font-size: 10px; padding: 1px 6px; border-radius: 999px; background: rgba(120, 190, 255, .16); color: #9ad8ff; }
#pbody .ach.got .achpt { background: rgba(255, 213, 106, .18); color: var(--sx-gold); }
@media (prefers-reduced-motion: reduce) { #pbody .achtrack span.ready { animation: none; } }
#pbody .achtabs button { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 5px; }
#pbody .achtabs .achci { display: inline-block; width: 22px; height: 22px; margin: 0; } /* category badges (assets/icons/ui/ach-<cat>.png, Codex) */

/* ro-petpot: pet potential (★), the two pet skills, evolution needs + button; evolved rows glow gold */
.ppot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; }
.ppot .pp-rank { font-size: var(--sx-fs1, 12px); color: var(--sx-text-dim, #9aa3b5); white-space: nowrap; }
.ppot .pp-rank b { color: #ffd86a; letter-spacing: 1px; } .ppot .pp-rank b i { font-style: normal; color: #5a6480; }
.ppot .pp-sk { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 4px; border-radius: 8px; font-size: var(--sx-fs1, 12px);
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); color: var(--sx-text-dim, #9aa3b5); max-width: 100%; }
.ppot .pp-sk i { font-style: normal; filter: grayscale(1); opacity: .6; }
.ppot .pp-sk b { font-weight: 700; white-space: nowrap; }
.ppot .pp-sk small { opacity: .85; }
.ppot .pp-sk.on { color: #e8f6ff; border-color: rgba(154, 216, 255, .45); background: rgba(80, 160, 255, .12); }
.ppot .pp-sk.on i { filter: none; opacity: 1; }
.ppot .pp-evo { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: var(--sx-fs1, 12px); color: var(--sx-text-dim, #9aa3b5); }
.ppot .pp-evo em { font-style: normal; padding: 0 5px; border-radius: 6px; background: rgba(255, 120, 120, .12); color: #ffb0b0; white-space: nowrap; }
.ppot .pp-evo em.ok { background: rgba(120, 255, 160, .12); color: #a8ffbe; }
#pbody .ranch .pet .ppot img.pp-it { width: 18px; height: 18px; vertical-align: -4px; } /* (the row's 52 px pet-picture rule caught them) */
.ppot .pp-evo.done { color: #ffd86a; font-weight: 700; }
.ppot .u-btn { min-height: 32px; padding: 2px 10px; }
#pbody .rn2 .pet.evo > img { filter: drop-shadow(0 0 4px #ffd86a) drop-shadow(0 0 2px #ffb040) saturate(1.25); }
#pbody .rn2 .pet.evo { border-color: rgba(255, 216, 106, .55); box-shadow: inset 0 0 18px rgba(255, 216, 106, .10); }
#pbody .rn2 .pet > .rn-t { min-width: 0; flex: 1 1 auto; } #pbody .rn2 .pet > .pbtn { flex: 0 0 auto; } /* the longer skill chips squeezed the button column */

/* ---------- Sigil Tower (feat/ro-tower, src/tower-ui.js) ---------- */
.tw-btn { z-index: 3; border-color: #8f9cff; background: linear-gradient(#26305e, #121838); } /* under open windows (#panel z 4) */
#panel[data-kind="tower"] .tw-tabs { margin: 0 0 10px; }
#panel[data-kind="tower"] .tw-bar { height: 8px; margin-top: 8px; border-radius: 4px; background: #0b1230; overflow: hidden; }
#panel[data-kind="tower"] .tw-bar i { display: block; height: 100%; background: linear-gradient(90deg, #6b7cff, #c7a6ff); }
#panel[data-kind="tower"] .tw-mons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
#panel[data-kind="tower"] .tw-mon { padding: 4px 10px; border-radius: 8px; background: #16204a; border: 1px solid #2c3a78; font-size: 13px; }
#panel[data-kind="tower"] .tw-mon small { display: block; color: #9fb0e0; font-size: 11px; }
#panel[data-kind="tower"] .tw-shop .shoprow { display: flex; align-items: center; gap: 10px; }
#panel[data-kind="tower"] .tw-shop .shoprow > div { flex: 1; }
#panel[data-kind="tower"] .tw-shop button { min-width: 72px; min-height: 40px; }
@media (max-height: 500px) { #panel[data-kind="tower"] .dq { display: none; } }

/* ---------- RO trade (feat/ro-trade 2026-10-18, RO-TRADE-REPORT.md): anti-scam trade lines, buying store, history ---------- */
.trwarn { display: grid; gap: 2px; margin: 0 0 8px; padding: 8px 10px; border-radius: 8px; border: 2px solid #ff5a5a; background: rgba(120, 16, 16, .55);
  color: #ffd9d9; animation: trwarn 1s ease-in-out 3; }
.trwarn b { color: #ff8a8a; font-size: var(--sx-fs4, 14px); } .trwarn small { color: #ffc2c2; }
@keyframes trwarn { 50% { box-shadow: 0 0 0 4px rgba(255, 90, 90, .35); } }
@media (prefers-reduced-motion: reduce) { .trwarn { animation: none; } }
.trln.trchg, .trgold.trchg { border-color: #ff5a5a !important; background: rgba(255, 70, 70, .16); box-shadow: inset 0 0 0 1px rgba(255, 90, 90, .5); }
.trln.trg { align-items: flex-start; } .trln.trg span { white-space: normal; }
.trsub { display: block; font-size: 11px; line-height: 1.35; color: var(--sx-tx2, #b9c3d8); white-space: normal; }
.trsub .trr { color: #ffd86a; }
.trgold small { color: var(--sx-tx2, #b9c3d8); font-weight: 400; margin-left: 4px; }
#pbody .bsres { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); max-height: 168px; overflow: auto; }
#pbody .bsres .cell.bsadd { width: auto; height: 44px; display: flex; align-items: center; gap: 6px; padding: 0 8px; text-align: left; }
#pbody .bsres .cell.bsadd span { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#pbody .bsres .cell.bsadd .pxi { width: 28px; height: 28px; flex: none; }
#pbody .bsrow { grid-template-columns: 30px 1fr 74px 96px 40px; }
#pbody .bsrow .bsrm { min-width: 40px; min-height: 40px; padding: 0; }
#pbody .tlog .tlrow .mlatt { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 3px; }
#pbody .tlog .tlrow .mlatt span { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; }
#pbody .tlog .tlrow .mlatt .pxi { width: 22px; height: 22px; } #pbody .tlog .tlrow .mlatt .g { color: #ffd86a; }
#panel[data-kind="bstore"] .dq, #panel[data-kind="bshop"] .dq { --npc: url(assets/icons/ui/vshop.png); } /* ro-trade: the shop medallion */

/* cbt (feat/cbt-event): the «CBT EXP/ดรอป x2» pill in the top-right cluster, the CBT envoy's window, «VIP (CBT)» in the VIP window */
#hud #topr .cbt-pill { position: relative; padding: 1px 10px; min-height: 22px; border-radius: 999px; font: 800 11px var(--sx-font); color: #2a1300; cursor: pointer;
  background: linear-gradient(#ffe07a, #ffb03c); border: 1px solid #fff2b8; box-shadow: 0 0 8px rgba(255, 190, 80, .55); white-space: nowrap; }
#hud #topr .cbt-pill[hidden] { display: none; }
#hud #topr .cbt-pill.dot::after { content: ''; position: absolute; top: -2px; right: -2px; width: 7px; height: 7px; border-radius: 50%; background: var(--sx-rose); }
.cbt-win { display: flex; flex-direction: column; gap: var(--sx-s3); }
.cbt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--sx-fs5); }
.cbt-x2 { padding: 2px 10px; border-radius: 999px; font: 800 12px var(--sx-font); color: #2a1300; background: linear-gradient(#ffe07a, #ffb03c); }
.cbt-lines { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; color: var(--sx-text); }
.cbt-wipe { padding: 8px 12px; border-radius: var(--sx-rs); border: 1px solid rgba(255, 120, 120, .55); background: rgba(90, 20, 30, .45); color: #ffd6d6; }
.cbt-gift { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; border-radius: var(--sx-rm); border: 1px solid rgba(255, 213, 106, .5); background: rgba(40, 30, 10, .35); text-align: center; }
.cbt-gh { font-weight: 800; color: var(--sx-gold); }
.cbt-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; } .cbt-items span { padding: 4px 12px; border-radius: 999px; background: rgba(4, 10, 32, .6); border: 1px solid var(--sx-line); font-weight: 700; }
.cbt-gift small { color: var(--sx-text2, #b8c4e0); }
.vip-cbt { align-self: center; margin-left: -4px; padding: 2px 8px; border-radius: 999px; font: 800 11px var(--sx-font); color: #2a1300; background: linear-gradient(#ffe07a, #ffb03c); }
.vip-cbtl { display: block; color: #ffd98a; }

/* Online count (owner, CBT 2026-10-18): a green live dot, readable on every layout */
#hud #onlineN { color: #d8ffe4; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
#hud #onlineN[hidden] { display: none; }
#hud #onlineN::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #3ee07a; box-shadow: 0 0 6px #3ee07a; }

/* Chat scroll (owner, CBT 2026-10-18): the log scrolls up / down with the wheel, a drag on touch or the scrollbar; the first line
   sits on the bottom while the log is short (margin-top: auto instead of justify-content: flex-end, which cut off the top) */
#hud #log { overflow-y: auto !important; overflow-x: hidden; justify-content: flex-start !important; pointer-events: auto; overscroll-behavior: contain;
  touch-action: pan-y; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: rgba(232, 194, 106, .45) transparent;
  -webkit-mask-image: linear-gradient(transparent, #000 18px); mask-image: linear-gradient(transparent, #000 18px); }
#hud #log > :first-child { margin-top: auto; }
#hud #log::-webkit-scrollbar { width: 5px; }
#hud #log::-webkit-scrollbar-thumb { background: rgba(232, 194, 106, .45); border-radius: 3px; }

/* One-page status (owner, CBT 2026-10-18: «อยู่หน้าเดียวไม่ต้องขึ้นลง»): on PC / tablet windows the three columns fit the window
   without scrolling: tighter doll (labels kept), radar only on tall screens, compact stat rows and derived cards */
body.pc #pbody .cs2 .doll { gap: 8px 10px; padding: 8px 8px 10px; }
body.pc #pbody .cs2 .doll .col { gap: 10px; }
body.pc #pbody .cs2 .doll .stage { height: 190px; }
body.pc #pbody .cs2 .doll .bot { padding-top: 0; }
@media (max-height: 980px) { body.pc #pbody .cs2 .radarbox { display: none; } }
body.pc #pbody .cs2-base .u-h, body.pc #pbody .cs2-der .u-h { margin: 0 0 6px; }
body.pc #pbody .pts2 { padding: 6px 12px; gap: 2px 10px; }
body.pc #pbody .pts2 br { display: none; } body.pc #pbody .pts2 b { font-size: 24px; margin-left: 6px; }
body.pc #pbody .arow2 { padding: 3px 8px 3px 10px; margin-bottom: 5px; }
body.pc #pbody .arow2 .u-btn { min-height: 34px; height: 34px; }
body.pc #pbody .info2 { padding: 5px 10px; font-size: 11.5px; line-height: 1.35; }
body.pc #pbody .streset { margin-top: 6px; }
body.pc #pbody .cs2-der .der-key { display: none; }
body.pc #pbody .der2 .u-stat { padding: 5px 10px; }
body.pc #pbody .cs2-der .mast { font-size: 11px; margin-top: 6px; }
body.pc #pbody .cs2 .doll .col .u-slot { margin-top: 2px; margin-bottom: 14px; }
body.pc #pbody .cs2 .doll .bot .u-slot { margin-top: 0; margin-bottom: 14px; }
body.pc #pbody .cs2 .doll .stage { height: 170px; }

/* One-page skills (owner, CBT 2026-10-18): on PC every skill of a job fits the list without scrolling: small cards (icon, name,
   level, − / +), the cooldown / MP / badges live in the detail column; the advice strip is one row */
body.pc #pbody .sx-sk.wide .sx-guide { padding: 6px 10px; }
body.pc #pbody .sx-sk.wide .sx-guide .gh { margin-bottom: 4px; }
body.pc #pbody .sx-sk.wide .sx-guide .chain .ci img, body.pc #pbody .sx-sk.wide .sx-guide .chain .ci { width: 30px; height: 30px; }
body.pc #pbody .sx-sk.wide .u-h { margin: 8px 0 5px; }
body.pc #pbody .sx-sk.wide .sx-skg { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 6px; }
body.pc #pbody .sx-sk.wide .sx-skc { padding: 5px 6px 6px; gap: 4px; border-radius: 11px; }
body.pc #pbody .sx-sk.wide .sx-skc .main { grid-template-columns: 40px minmax(0, 1fr); gap: 2px 7px; }
body.pc #pbody .sx-sk.wide .sx-skic { width: 40px; height: 40px; } body.pc #pbody .sx-sk.wide .sx-skic img { width: 30px; height: 30px; }
body.pc #pbody .sx-sk.wide .sx-skc .hd b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.pc #pbody .sx-sk.wide .sx-skc .hd .sub, body.pc #pbody .sx-sk.wide .sx-skc .meta, body.pc #pbody .sx-sk.wide .sx-skc .pips, body.pc #pbody .sx-sk.wide .sx-skc .lk { display: none; }
body.pc #pbody .sx-sk.wide .sx-skc .pm .u-btn { min-height: 24px; height: 24px; padding: 0; }
body.pc #pbody .sx-sk.wide .sx-skg { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
body.pc #pbody .sx-sk.wide .sx-skc { flex-direction: row; align-items: center; min-height: 0; padding: 5px 5px 5px 6px; }
body.pc #pbody .sx-sk.wide .sx-skc .main { flex: 1 1 auto; min-width: 0; grid-template-columns: 38px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; }
body.pc #pbody .sx-sk.wide .sx-skic { width: 38px; height: 38px; grid-row: 1 / span 2; }
body.pc #pbody .sx-sk.wide .sx-skc .lv { grid-column: 2; min-height: 0; }
body.pc #pbody .sx-sk.wide .sx-skc .lv .n { font-size: 11px; }
body.pc #pbody .sx-sk.wide .sx-skc .pm { display: flex; flex-direction: column-reverse; gap: 3px; flex: 0 0 26px; width: 26px; margin: 0; }
body.pc #pbody .sx-sk.wide .sx-skc .pm .u-btn { width: 26px; min-width: 0; height: 21px; min-height: 21px; font-size: 13px; line-height: 1; }
body.pc #pbody .sx-sk.wide .sx-guide .chain { display: none; }
body.pc #pbody .sx-sk.wide .sx-guide.open .chain { display: flex; }
body.pc #pbody .sx-sk.wide .sx-skg { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
body.pc #pbody .sx-sk.wide .sx-skc .hd b { font-size: 12px; white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.15; }
body.pc #pbody .sx-sk.wide .u-h { margin: 4px 0 3px; font-size: 12px; }
body.pc #pbody .sx-sk.wide .sx-guide { padding: 4px 10px; }
body.pc #pbody .sx-sk.wide .sx-guide .gh { margin: 0; }
body.pc #pbody .sx-sk.wide .sx-skc { padding: 3px 4px 3px 5px; }
body.pc #pbody .sx-sk.wide .sx-skic { width: 34px; height: 34px; } body.pc #pbody .sx-sk.wide .sx-skic img { width: 27px; height: 27px; }
body.pc #pbody .sx-sk.wide .sx-skc .main { grid-template-columns: 34px minmax(0, 1fr); }
body.pc #pbody .sx-sk.wide .sx-skc .pm .u-btn { height: 19px; min-height: 19px; }
body.pc #pbody .sx-sk.wide .sx-pts { padding-block: 4px; }
body.pc #pbody .sx-sk.wide .sx-skf { padding-block: 5px; min-height: 0; }
body.pc #pbody .sx-sk.wide .sx-skf .u-btn { min-height: 36px; height: 36px; }

/* Bug reports + suggestions (CBT 2026-10-18, src/feedback-ui.js) */
#pbody .fb-win { display: flex; flex-direction: column; gap: 10px; max-width: 720px; margin: 0 auto; }
#pbody .fb-kind { align-self: flex-start; }
#pbody .fb-tip { font-size: var(--sx-fs2); color: var(--sx-tx2); }
#pbody .fb-win textarea { width: 100%; min-height: 150px; resize: vertical; padding: 10px 12px; border-radius: var(--sx-rm); background: rgba(4, 10, 32, .7); color: var(--sx-tx1, #eef3ff);
  border: 1px solid var(--sx-line); font: 400 14px/1.5 var(--sx-font); box-sizing: border-box; }
#pbody .fb-win textarea:focus { outline: none; border-color: var(--sx-cyan); }
#pbody .fb-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#pbody .fb-win .note.ok { color: #9cf5bf; border-color: rgba(62, 224, 122, .4); }
#pbody .fb-row .u-btn { flex: 0 0 auto; min-width: 220px; }

/* Skill tree on PC (player idea, CBT 2026-10-19, src/skill-tree.js + ui.js skTree): the job tab as an RO-style tree. Rows = the
   skills' Job level (label column on the left), stable columns, one SVG line from each prerequisite (gold = met, grey dashed =
   not met, arrow head, required level), the one-page cards above; must fit the list at 1280x720 without scrolling */
body.pc #pbody .sx-sk.tree .sx-skl { gap: 6px; padding-right: 0; }
body.pc #pbody .sx-tree { position: relative; flex: 1 1 auto; min-height: calc(var(--tr) * 52px); display: grid; grid-template-columns: 28px repeat(var(--tc), minmax(0, 1fr));
  grid-template-rows: repeat(var(--tr), minmax(0, 1fr)); gap: 6px 10px; padding: 2px 2px 0 0; }
body.pc #pbody .sx-tree::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 28px; border-radius: 9px; background: rgba(4, 10, 32, .35); border: 1px solid var(--sx-line); }
body.pc #pbody .sx-tlines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 0; opacity: 0; transition: opacity .15s; }
body.pc #pbody .sx-tree.drawn .sx-tlines { opacity: 1; }
.sx-tlines g path { fill: none; stroke-width: 2.2; stroke-linecap: round; }
.sx-tlines g.ok path { stroke: var(--sx-gold); filter: drop-shadow(0 0 3px rgba(255, 196, 80, .55)); }
.sx-tlines g.no path { stroke: rgba(150, 166, 204, .6); stroke-dasharray: 5 4; stroke-width: 1.8; }
.sx-tlines #skA-ok path { fill: var(--sx-gold); } .sx-tlines #skA-no path { fill: rgba(150, 166, 204, .75); }
.sx-tlines text { font: 700 9.5px/1 var(--sx-font); paint-order: stroke; stroke: #06102c; stroke-width: 3px; stroke-linejoin: round; }
.sx-tlines g.ok text { fill: var(--sx-gold3); } .sx-tlines g.no text { fill: var(--sx-tx3); }
body.pc #pbody .sx-tn { position: relative; z-index: 1; align-self: center; min-width: 0; }
body.pc #pbody .sx-trl { position: relative; z-index: 1; grid-column: 1; align-self: center; text-align: center; font: 700 11px/1.1 var(--sx-font); color: var(--sx-tx2); white-space: nowrap; letter-spacing: -.02em; }
body.pc #pbody .sx-trl b { display: block; font-size: 8.5px; font-weight: 600; color: var(--sx-tx3); text-transform: uppercase; letter-spacing: .04em; }
/* phones / narrow (no tree): the locked card's prerequisite hint stays one line */
#pbody .sx-sk:not(.tree) .sx-skc > .lk { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10.5px; letter-spacing: -.01em; }
/* tree cards: a size smaller than the one-page cards (6 rows + the gaps the lines run in): 30 px icon, name in two short lines */
body.pc #pbody .sx-sk.tree .sx-skc { padding: 3px 3px 3px 4px; gap: 3px; border-radius: 10px; }
body.pc #pbody .sx-sk.tree .sx-skic { width: 30px; height: 30px; } body.pc #pbody .sx-sk.tree .sx-skic img { width: 24px; height: 24px; }
body.pc #pbody .sx-sk.tree .sx-skc .main { grid-template-columns: 30px minmax(0, 1fr); gap: 1px 6px; }
body.pc #pbody .sx-sk.tree .sx-skc .hd b { font-size: 11px; line-height: 1.1; }
body.pc #pbody .sx-sk.tree .sx-skc .lv, body.pc #pbody .sx-sk.tree .sx-skc .lv .n { line-height: 13px; font-size: 10.5px; }
body.pc #pbody .sx-sk.tree .sx-skc .pm { flex: 0 0 22px; width: 22px; gap: 2px; }
body.pc #pbody .sx-sk.tree .sx-skc .pm .u-btn { width: 22px; height: 18px; min-height: 18px; font-size: 12px; }

/* Evolution trials (CBT 2026-10-19, src/sim/evotrial.js): the trial on the skill's branch cards + the shrine list */
#pbody .sx-etrial { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: var(--sx-rm, 10px);
  background: linear-gradient(180deg, rgba(150, 100, 255, .14), rgba(20, 16, 60, .35)); border: 1px solid rgba(190, 150, 255, .42); }
#pbody .sx-etrial.on { border-color: var(--sx-line-au); background: linear-gradient(180deg, rgba(255, 200, 90, .12), rgba(30, 20, 40, .35)); }
#pbody .sx-etrial .eth, #pbody .etrow .eth { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
#pbody .sx-etrial .eth b { color: #e6d2ff; font-size: var(--sx-fs3, 13px); } #pbody .sx-etrial.on .eth b { color: var(--sx-gold3); }
#pbody .sx-etrial .eth small, #pbody .etrow .eth small { color: var(--sx-tx3); font-size: var(--sx-fs1, 11px); }
#pbody .etst { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
#pbody .etst li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; font-size: var(--sx-fs2, 12px); color: var(--sx-tx2); }
#pbody .etst li .t { min-width: 0; } #pbody .etst li .t small { color: var(--sx-tx3); }
#pbody .etst li .n { font-weight: 700; color: var(--sx-tx); font-variant-numeric: tabular-nums; }
#pbody .etst li .b { grid-column: 1 / -1; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
#pbody .etst li .b > i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #a77bff, #d9b8ff); }
#pbody .etst li.full .n, #pbody .etst li.done .n { color: var(--sx-up); } #pbody .etst li.full .b > i, #pbody .etst li.done .b > i { background: linear-gradient(90deg, #2fd27a, #8af5b8); }
#pbody .etst li.done .t { text-decoration: line-through; opacity: .7; } #pbody .etst li.cur .t { color: var(--sx-gold3); }
#pbody .sx-etrial .etcta { display: flex; gap: 6px; } #pbody .sx-etrial .etcta .u-btn { flex: 1 1 auto; min-height: 34px; }
#pbody .skevo .evo.etlock { opacity: .55; } #pbody .skevo .evo .etl { color: #d9b8ff; }
#pbody .etbox .etrow { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(4, 10, 32, .45); border: 1px solid var(--sx-line);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; }
#pbody .etbox .etrow.on { border-color: rgba(190, 150, 255, .45); }
#pbody .etbox .etrow > .etst, #pbody .etbox .etrow > .skbtns { grid-column: 1 / -1; }
#pbody .etbox .etrow .sic { width: 28px; height: 28px; align-self: center; } #pbody .etbox .etrow .sic img { width: 24px; height: 24px; }
#pbody .etbox .etrow .eth b { color: var(--sx-tx); }
#pbody .etbox .etrow .ets { grid-column: 1; color: var(--sx-tx2); font-size: var(--sx-fs1, 11px); }
#pbody .etbox .etrow:not(.on) .eth { grid-column: 1; } #pbody .etbox .etrow:not(.on) > button { grid-column: 2; grid-row: 1 / span 2; min-height: 40px; }

/* ==================== cbt-retention (feat/cbt-retention 2026-10-19): lucky monster chip + line, bounty board, CBT souvenir ==================== */
#hud #topr .lucky-chip { position: relative; padding: 1px 10px; min-height: 22px; border-radius: 999px; font: 800 11px var(--sx-font); color: #0d2a10; cursor: pointer;
  background: linear-gradient(#c8ffb0, #6fdc6a); border: 1px solid #eaffd8; box-shadow: 0 0 8px rgba(120, 230, 110, .5); white-space: nowrap; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
#hud #topr .lucky-chip[hidden] { display: none; }
.lucky-line { display: flex; align-items: center; gap: 10px; margin: 6px 0; padding: 8px 12px; border-radius: var(--sx-rm, 12px);
  border: 1px solid rgba(140, 240, 120, .45); background: linear-gradient(90deg, rgba(60, 140, 60, .28), rgba(4, 10, 32, .35)); }
.lucky-line > div { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lucky-line small { color: var(--sx-text2, #b8c4e0); } .lucky-line .lk-gold { color: #ffe08a; }
.lucky-line .lk-ic { font-size: 24px; } .lucky-line .dqgo { min-height: 40px; }
/* follow-up: three lucky kinds a day (one per level band), mine first in the tavern */
.lucky-line .lk-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.lucky-line .lk-row > div { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lucky-line .lk-row + .lk-row { border-top: 1px solid rgba(140, 240, 120, .2); padding-top: 6px; }
.lucky-line .lk-row:not(.mine) { opacity: .78; } .lucky-line .lk-row.mine b { color: #c8ffb0; }
.lk-star { color: #9dff8a; text-shadow: 0 0 4px rgba(120, 255, 100, .7); }
/* bounty board */
#pbody .bty-wanted { display: flex; align-items: center; gap: 12px; margin: 8px 0; padding: 10px 12px; border-radius: var(--sx-rm, 12px);
  border: 1px solid rgba(255, 170, 90, .6); background: linear-gradient(90deg, rgba(120, 60, 20, .45), rgba(4, 10, 32, .4)); }
#pbody .bty-wanted.done { opacity: .65; }
#pbody .bty-poster { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; min-width: 108px; padding: 6px 8px; border-radius: 6px;
  background: #e9d3a4; color: #3a2108; box-shadow: inset 0 0 0 2px #b88a4a, 0 2px 6px rgba(0, 0, 0, .5); text-align: center; }
#pbody .bty-poster span { font: 900 13px/1 var(--sx-font); letter-spacing: 2px; color: #8a1c0c; } #pbody .bty-poster b { font-size: var(--sx-fs3); } #pbody .bty-poster small { color: #5a3a14; }
#pbody .bty-wbody { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#pbody .bty-wbody small { color: var(--sx-text2, #b8c4e0); } #pbody .bty-wbody .rw { color: #ffe3a0; }
#pbody .bty-wanted button { min-height: 44px; min-width: 96px; }
#pbody .bty-left { display: inline-block; padding: 1px 8px; border-radius: 999px; font: 700 11px var(--sx-font); background: rgba(4, 10, 32, .6); border: 1px solid var(--sx-line); color: #cfe0ff; }
#pbody .bty-left.last { border-color: rgba(255, 140, 120, .7); color: #ffc2b8; }
#pbody .dqrow .bty-drop { min-width: 44px !important; padding: 0 10px; margin-left: 4px; }
#pbody .dqrow .bty-drop.arm { background: rgba(140, 30, 40, .7); border-color: #ff9a9a; color: #fff; }
#pbody .bty-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 6px 0; }
#pbody .bty-offer { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border-radius: var(--sx-rs, 10px); border: 1px solid var(--sx-line); background: var(--sx-card, rgba(10, 18, 44, .7)); }
#pbody .bty-offer .rw { color: #ffe3a0; } #pbody .bty-offer small { color: var(--sx-text2, #b8c4e0); }
#pbody .bty-offer button { margin-top: auto; min-height: 40px; }
#pbody .bty-offer.taken { opacity: .55; } #pbody .bty-offer.lucky { border-color: rgba(140, 240, 120, .65); box-shadow: inset 0 0 12px rgba(120, 230, 110, .18); }
#pbody .u-h small { font-weight: 600; color: var(--sx-text2, #b8c4e0); margin-left: 6px; }
@media (max-width: 560px) { #pbody .bty-wanted { flex-wrap: wrap; } #pbody .bty-wbody { flex-basis: 100%; } #pbody .bty-poster { flex: 1; } #pbody .bty-wanted button { flex: 1; } #pbody .bty-board { grid-template-columns: 1fr 1fr; } }
@media (max-width: 380px) { #pbody .bty-board { grid-template-columns: 1fr; } }
/* lucky marks on the big map */
.wm-node .lucky { position: absolute; top: -6px; left: calc(50% - 40px); font-style: normal; font-size: 16px; filter: drop-shadow(0 1px 2px #000); }
.wm-a .wm-node .lucky { left: calc(50% - 30px); top: -10px; }
.wm-mons span.lucky { outline: 2px solid rgba(140, 240, 120, .8); border-radius: 8px; }
/* CBT tester souvenir */
.cbt-vet { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: var(--sx-s3, 10px); padding: 12px; border-radius: var(--sx-rm, 12px); text-align: center;
  border: 1px solid rgba(255, 213, 106, .6); background: linear-gradient(rgba(70, 50, 10, .45), rgba(20, 14, 4, .35)); }
.cbt-vet p { margin: 0; color: var(--sx-text, #e8eeff); line-height: 1.5; } .cbt-vet small { color: #ffc2b8; }
.cbt-vet-ok { color: #9cf5bf; }
.cbt-vet-card { position: fixed; z-index: 60; left: 50%; top: 18%; transform: translateX(-50%); width: min(420px, calc(100vw - 32px)); box-sizing: border-box;
  display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 14px; text-align: center; pointer-events: auto;
  border: 1px solid #ffe7a0; background: linear-gradient(#2a2148, #141030); color: #fff6dc; box-shadow: 0 10px 40px rgba(0, 0, 0, .6), 0 0 24px rgba(255, 200, 90, .35); }
.cbt-vet-card b { font-size: 17px; color: #ffd86a; } .cbt-vet-card p { margin: 0; line-height: 1.5; } .cbt-vet-card .warn { color: #ffd6d6; font-size: 13px; }
.cbt-vet-card button { align-self: center; min-width: 140px; min-height: 44px; border-radius: 10px; border: 1px solid #fff2b8; background: linear-gradient(#ffe07a, #ffb03c); color: #2a1300; font: 800 14px var(--sx-font); cursor: pointer; }

/* Chat resize (bugfix-1019, player Enzo: "the PC chat box is small and cannot be resized"): src/chat-size.js writes --chatw / --chath
   on body.pc (saved in localStorage sigil.chatSize); the log grows upward from the docked chat bar, the tab strip rides on top of it,
   the action dock moves right with --chatw (hud-v3.css) and the widest box still leaves it its natural width. Phones untouched. */
body.pc { --chath: 108px; --chatb: 60px; }
@media (max-width: 1000px) { body.pc { --chatb: 118px; } }
body.pc #hud #log { bottom: calc(var(--chatb) + var(--sb)) !important; height: var(--chath) !important; max-height: var(--chath) !important; }
body.pc #hud #logTabs { bottom: calc(var(--chatb) + var(--chath) + var(--sb)) !important; }
#chatGrip { display: none; }
body.pc #hud #chatGrip { display: block; position: absolute; z-index: 7; width: 22px; height: 22px; cursor: nesw-resize; touch-action: none;
  left: calc(12px + var(--sl) + var(--chatw) - 22px); bottom: calc(var(--chatb) + var(--chath) + var(--sb) - 22px);
  background: linear-gradient(45deg, transparent 45%, rgba(232, 194, 106, .55) 46%, rgba(232, 194, 106, .55) 54%, transparent 55%,
    transparent 68%, rgba(232, 194, 106, .55) 69%, rgba(232, 194, 106, .55) 77%, transparent 78%);
  opacity: .55; transition: opacity .15s; border-radius: 0 4px 0 0; }
body.pc #hud #chatGrip:hover, body.pc #hud #chatGrip.on { opacity: 1; background-color: rgba(4, 10, 32, .5); }
body.pc #hud #chatGrip[hidden], body.hudlite #chatGrip, body.black #chatGrip { display: none !important; }

/* Guest bind (bugfix-1019, src/guest-bind.js): the dialog (title screen + settings → account), the warning box above the title's
   character cards, the settings row's warning. Above the title screen (#title z-index 6) and every game window. */
#gbDlg { z-index: 80; padding: 12px; }
#gbDlg .gb-dlg { width: min(420px, 94vw); max-height: calc(100vh - 24px); overflow-y: auto; display: flex; flex-direction: column; gap: 9px;
  background: linear-gradient(180deg, #1c2747, #0e1428); border: 1px solid rgba(232, 194, 106, .45); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
#gbDlg h3 { margin: 0; }
#gbDlg p { margin: 0; font-size: 13.5px; line-height: 1.55; }
#gbDlg .gb-warn, .gb-box p { color: #ffe0a8; background: rgba(255, 170, 60, .1); border: 1px solid rgba(255, 170, 60, .4); border-radius: 10px; padding: 8px 10px; }
#gbDlg .gb-keep { color: #c6f2d4; }
#gbDlg .gb-f { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: #b9c1d6; }
#gbDlg .gb-f input { min-height: 42px; border-radius: 9px; padding: 0 12px; font: 15px var(--sx-font, Prompt, sans-serif); color: #eef0f6;
  background: rgba(4, 7, 16, .85); border: 1px solid rgba(150, 170, 220, .35); outline: none; }
#gbDlg .gb-f input:focus { border-color: #e8c26a; box-shadow: 0 0 0 2px rgba(232, 194, 106, .2); }
#gbDlg .gb-msg { min-height: 1.4em; color: #ff8f8a; font-size: 13px; }
#gbDlg .gb-msg.ok { color: #9fe8b6; }
#gbDlg .gb-google { min-height: 44px; background: #fff !important; color: #1f1f1f !important; border: 1px solid #dadce0 !important; font-weight: 600; }
#gbDlg .gb-or { display: flex; align-items: center; gap: 8px; color: #8992ab; font-size: 12px; }
#gbDlg .gb-or::before, #gbDlg .gb-or::after { content: ''; flex: 1; height: 1px; background: rgba(232, 194, 106, .25); }
#gbDlg .gb-or[hidden], #gbDlg .gb-google[hidden] { display: none; }
#gbDlg .u-dlgf .u-btn { min-height: 44px; }
#tsBind .gb-box { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
#tsBind .gb-box p { margin: 0; font-size: 13px; line-height: 1.5; }
#tsBind .gb-box .u-btn { min-height: 44px; font: 600 15px Prompt, sans-serif; border-radius: 10px; cursor: pointer;
  background: linear-gradient(180deg, #f6dc96, #c99a3c); color: #241a06; border: 1px solid #ffe7a8; }
.gb-rw { color: #ffcf7a; }

/* Quick potion slots (bugfix-1019, src/potslot.js + ui.js potPill / potPick): the PC right-click picker over a pill, the slot rows
   of AUTO → ยา/เอาตัวรอด (icon + name + count per tier) */
#potPick { position: fixed; z-index: 70; width: 250px; display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(22, 34, 63, .97), rgba(11, 18, 36, .98)); border: 1px solid rgba(232, 194, 106, .5); box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
  font: 13px var(--sx-font, Prompt, sans-serif); color: #eef0f6; }
#potPick > b { font-size: 12px; color: #f6dc96; padding: 0 4px 2px; }
#potPick button { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 8px; min-height: 42px;
  padding: 4px 8px; border-radius: 9px; text-align: left; color: inherit; background: rgba(255, 255, 255, .04); border: 1px solid transparent; cursor: pointer; font: inherit; }
#potPick button:hover { background: rgba(232, 194, 106, .12); }
#potPick button.on { border-color: rgba(232, 194, 106, .7); background: rgba(232, 194, 106, .16); }
#potPick button .pxi { grid-row: 1 / 3; width: 28px; height: 28px; }
#potPick button > span:first-child { grid-column: 1 / 3; }
#potPick button small { grid-column: 2; color: #8992ab; font-size: 11px; }
#pbody .sx-potseg button { display: inline-flex; align-items: center; gap: 4px; }
#pbody .sx-potseg button .pxi { width: 22px; height: 22px; }

/* ---------- Weapon shop (feat/weapon-shop 2026-10-19): the arms-stall merchant, window 'wshop' (src/wshop-ui.js) ---------- */
#panel[data-kind="wshop"] .dq { --npc: url(assets/icons/ui/smith.png); }
#pbody .ws-tier { font-weight: 700; margin-left: 4px; }
#pbody .ws-cmp { color: var(--sx-tx2); }
#pbody .ws-cmp span { margin-right: 8px; font-weight: 700; }
#pbody .ws-up { color: var(--sx-up); } #pbody .ws-dn { color: var(--sx-down); } #pbody .ws-eq { color: var(--sx-tx3); }
#panel[data-kind="wshop"] #pbody .shoprow > button { min-width: 104px; min-height: 46px; }
@media (max-height: 500px) { #panel[data-kind="wshop"] .dq { display: none; } }

/* ---------- Bulk sell (feat/bulk-sell 2026-10-22): multi-select gear sale in the shop window (src/bulksell-ui.js) ---------- */
#pbody .bs-entry { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
#pbody .bs-entry button { min-height: 44px; }
#pbody .bs-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
#pbody .bs-top .u-btn { min-height: 40px; }
#pbody .bs-filt { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
#pbody .bs-chip { min-height: 36px; padding: 0 12px; cursor: pointer; border: 1px solid var(--sx-line2); background: var(--sx-ink2); font: inherit; font-size: var(--sx-fs2); }
#pbody .bs-chip.on { border-color: var(--sx-gold); background: var(--sx-ink4); box-shadow: 0 0 0 1px var(--sx-gold) inset; }
#pbody .bs-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
#pbody .bs-bar .u-btn { min-height: 40px; }
#pbody .bs-bar small { color: var(--sx-tx3); flex: 1 1 200px; }
#pbody .bs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
#pbody .bs-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; min-height: 104px;
  border: 1px solid var(--sx-line); border-radius: var(--sx-rs, 8px); background: var(--sx-ink1); color: var(--sx-tx); font: inherit; cursor: pointer; }
#pbody .bs-tile.on { border-color: var(--sx-gold); background: var(--sx-ink3); box-shadow: 0 0 0 2px var(--sx-gold) inset; }
#pbody .bs-tile.no { opacity: .45; cursor: not-allowed; }
#pbody .bs-name { font-size: 11px; line-height: 1.2; text-align: center; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#pbody .bs-g { font-size: 11px; color: var(--sx-gold); }
#pbody .bs-tile.no .bs-g { color: var(--sx-tx3); }
#pbody .bs-tick { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--sx-line2);
  font-style: normal; font-weight: 800; font-size: 13px; line-height: 18px; text-align: center; background: var(--sx-ink0); }
#pbody .bs-tile.on .bs-tick { background: var(--sx-gold); color: var(--sx-gold-ink); border-color: var(--sx-gold); }
#pbody .bs-tile.no .bs-tick { display: none; }
#pbody .bs-warn { position: absolute; top: 4px; left: 4px; font-style: normal; font-size: 13px; color: var(--sx-gold2); }
#pbody .bs-foot > span { flex: 1; min-width: 0; font-size: var(--sx-fs2); color: var(--sx-tx2); }
#pbody .bs-foot .ok { min-height: 46px; min-width: 120px; }
#pbody .bs-risk { color: var(--sx-gold2); }
.u-dlgb .bs-icons { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-bottom: 8px; }
.u-dlgb .bs-mini img, .u-dlgb .bs-rlist img { width: 28px; height: 28px; image-rendering: pixelated; vertical-align: middle; }
.u-dlgb .bs-rlist { max-height: 40vh; overflow: auto; text-align: left; margin-bottom: 8px; }
.u-dlgb .bs-rlist small { color: var(--sx-tx3); }
@media (max-width: 480px) { #pbody .bs-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); } #pbody .bs-tile { min-height: 96px; } }
