/* =====================================================================
   NEO MIDGARD — HUD "Visor Soft"
   แทบไม่มีกรอบ: ตัวอักษรลอยบนฉาก + เงา, HP/SP เป็นวงแหวนรอบรูป, แถบลัด/หน้าต่างเป็นกระจกฝ้ามุมโค้ง,
   EXP เป็นเส้นเดียวล่างสุดของจอ • เปิดเมื่อ <body class="visor"> (ตั้งค่า → รูปแบบ HUD)
   แก้เฉพาะหน้าตา ตำแหน่ง/เลย์เอาต์มือถือยังใช้ของ style.css
   ===================================================================== */
body.visor {
  --font: "IBM Plex Sans Thai", "Noto Sans Thai", Tahoma, sans-serif;
  --display: "IBM Plex Sans Thai", "Noto Sans Thai", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --cy: #6ff3ff; --cy-2: #38b9d2; --cy-glow: rgba(111, 243, 255, 0.4);
  --ink: #f4f7fb; --ink-dim: #c6d0dc; --ink-faint: #8a98aa;
  --hp-a: #ff6b7d; --hp-b: #ff6b7d; --sp-a: #6ff3ff; --sp-b: #6ff3ff; --exp: #ffe08a; --jexp: #c9b0ff;
  --line: rgba(244, 247, 251, 0.2); --line-2: rgba(244, 247, 251, 0.4);
  --glass: rgba(6, 10, 18, 0.5); --glass-2: rgba(6, 10, 18, 0.72);
  --sh: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 1px rgba(0, 0, 0, 0.9);
}
#bi-rings, #exp-line { display: none; }

/* เงาไล่ระดับบน/ล่างของจอ ให้อ่านตัวหนังสือบนฉากสว่างได้ */
body.visor #hud::before, body.visor #hud::after { content: ""; position: fixed; left: 0; right: 0; pointer-events: none; z-index: 5; }
body.visor #hud::before { top: 0; height: 150px; background: linear-gradient(180deg, rgba(6, 10, 18, 0.55), rgba(6, 10, 18, 0)); }
body.visor #hud::after { bottom: 0; height: 190px; background: linear-gradient(0deg, rgba(6, 10, 18, 0.7), rgba(6, 10, 18, 0)); }

/* ---------- การ์ดตัวละคร: รูปกลม + วงแหวน HP/SP ---------- */
body.visor #basic-info { background: none; clip-path: none; border: 0; box-shadow: none; align-items: center; gap: 12px; text-shadow: var(--sh); }
body.visor #basic-info::after { display: none; }
body.visor .bi-face { width: 88px; height: 88px; }
body.visor .bi-face::before { display: none; }
body.visor .bi-face canvas { position: absolute; left: 13px; top: 13px; width: 62px; height: 62px; border-radius: 50%; clip-path: none; background: #18202c; }
body.visor #bi-rings { display: block; position: absolute; inset: 0; width: 88px; height: 88px; pointer-events: none; }
#bi-rings circle { fill: none; transition: stroke-dasharray 0.18s ease-out; }
#bi-rings .rb { stroke: rgba(255, 255, 255, 0.16); }
#ring-hp { stroke: var(--hp-a); stroke-width: 4; stroke-linecap: round; }
#ring-sp { stroke: var(--sp-a); stroke-width: 3; stroke-linecap: round; }
#ring-hp.low { stroke: #ff3048; animation: pulse 0.9s infinite; }
body.visor .bi-face em { bottom: -4px; min-width: 0; padding: 0 6px; clip-path: none; border-radius: var(--rad-pill, 4px); background: rgba(6, 10, 18, 0.85);
  border: 1px solid var(--cy); color: var(--cy); font: 600 10.5px/15px var(--mono); }
body.visor .bi-main { gap: 3px; }
body.visor .bi-id { flex-direction: column; align-items: flex-start; gap: 0; }
body.visor .bi-id b { order: 2; font: 600 20px/1.15 var(--display); text-shadow: var(--sh); }
body.visor .bi-id span { order: 1; font: 500 10.5px var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--cy); }
/* HP/SP เป็นตัวเลขล้วน (หลอดอยู่ที่วงแหวนแล้ว) */
body.visor #basic-info .gauge.hp, body.visor #basic-info .gauge.sp { height: auto; background: none; clip-path: none; overflow: visible; box-shadow: none; display: flex; gap: 6px; align-items: baseline; }
body.visor #basic-info .gauge.hp::before, body.visor #basic-info .gauge.sp::before { display: none; }
body.visor #basic-info .gauge .fill { display: none; }
body.visor #basic-info .gauge i, body.visor #basic-info .gauge span { position: static; font: 500 12.5px/1.25 var(--mono); text-shadow: var(--sh); }
body.visor #basic-info .gauge.hp i { color: #ff9aa8; } body.visor #basic-info .gauge.sp i { color: var(--cy); }
body.visor #basic-info .gauge.sp i, body.visor #basic-info .gauge.sp span { font-size: 12px; }
body.visor .xrow { gap: 6px; }
body.visor .xrow label { font: 500 9.5px var(--mono); letter-spacing: 0.08em; }
body.visor .gauge.thin { height: 2px; background: rgba(255, 255, 255, 0.18); }
body.visor .gauge.thin .fill { box-shadow: none; }
body.visor .gauge .fill::after { display: none; }
body.visor .xrow > span { font: 500 9.5px var(--mono); }
body.visor .bi-foot { font: 500 12px var(--mono); color: var(--exp); }
body.visor #bi-zeny::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 5px; vertical-align: -1px; background: var(--exp);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13 2L4 14h7l-1 8 9-12h-7l1-8z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13 2L4 14h7l-1 8 9-12h-7l1-8z'/%3E%3C/svg%3E") center/contain no-repeat; }
body.visor #bi-zeny.has-ic::before { content: ""; }
body.visor #bi-zeny img { display: none; }
body.visor .pt { clip-path: none; background: rgba(255, 224, 138, 0.14); border: 1px solid rgba(255, 224, 138, 0.55); color: var(--exp); font: 600 10px var(--mono); border-radius: var(--rad-pill, 4px); padding: 2px 9px; box-shadow: 0 0 12px -4px rgba(255, 224, 138, 0.6); animation: none; }
body.visor .pt:hover { background: rgba(255, 224, 138, 0.26); }

/* ---------- เควสต์: ตัวอักษรล้วน ---------- */
body.visor #quest-track { background: none; border-left: 0; padding-left: 0; text-shadow: var(--sh); }
body.visor #quest-track:hover { background: none; }
body.visor #quest-track::before { content: attr(data-ch); display: block; font: 500 10.5px var(--mono); letter-spacing: 0.2em; color: var(--cy); margin-bottom: 1px; }
body.visor .qt-ic { display: none; }
body.visor .qt-title { color: var(--ink); font-size: 15px; }
body.visor .qt-obj { color: var(--ink-dim); font-family: var(--mono); font-size: 12px; }
body.visor .qt-bar { height: 2px; background: rgba(255, 255, 255, 0.25); }
body.visor .qt-bar i { background: var(--cy); }

/* ---------- เป้าหมาย: เส้นบาง ---------- */
body.visor #target { background: none; clip-path: none; border: 0; padding: 0; gap: 8px; text-shadow: var(--sh); }
body.visor #tg-cv { width: 34px; height: 34px; clip-path: none; border-radius: 50%; background: rgba(6, 10, 18, 0.5); }
body.visor #target .gauge { height: 3px; background: rgba(255, 255, 255, 0.22); clip-path: none; box-shadow: none; overflow: visible; }
body.visor #target .gauge::before { display: none; }
body.visor #target .gauge .fill { box-shadow: none; }
body.visor #target .gauge span { top: 5px; right: 0; font: 500 10px var(--mono); line-height: 1; }
body.visor .tg-id b { font: 500 14px var(--display); }
body.visor .tg-id span { font: 500 11px var(--mono); color: #ff9aa8; }
body.visor #target.boss { background: none; }
body.visor #target.boss .gauge .fill { background: #ffd05a; }

/* ---------- มินิแมพ: กระจกฝ้ามุมโค้ง ไม่มีขอบเหลี่ยม ---------- */
body.visor .mm-ring { border-radius: 18px; padding: 0; overflow: hidden; background: var(--glass-s); border: 1px solid var(--edge-2);
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.08); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
body.visor .mm-ring::after { inset: 0; border-radius: inherit; background: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 0 26px rgba(0, 0, 0, 0.35); }
body.visor #minimap-cv { border-radius: 18px; box-shadow: none; background: transparent; }
body.visor .mm-n { display: none; }
body.visor .mm-head { background: none; border: 0; clip-path: none; padding: 0; font: 500 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; text-shadow: var(--sh); }
body.visor .mm-sub { font: 500 10.5px var(--mono); }
body.visor .mm-btn, body.visor #minimap .fold-btn { background: rgba(10, 16, 26, 0.6); border-color: var(--edge-2); box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }
body.visor .mm-btn:hover { background: rgba(111, 243, 255, 0.14); border-color: rgba(111, 243, 255, 0.5); box-shadow: var(--glow-soft); }

/* ---------- เมนู: ไอคอนเส้นล้วน + โฮเวอร์มุมโค้ง ---------- */
body.visor #menubar button { background: transparent; border: 0; clip-path: none; box-shadow: none; border-radius: 14px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
  transition: background 0.15s, color 0.15s; }
body.visor #menubar button span { color: var(--ink-dim); font-size: 9px; text-shadow: var(--sh); }
body.visor #menubar button small { display: none; }
body.visor #menubar button:hover { background: rgba(10, 16, 26, 0.55); color: var(--cy); }
body.visor #menubar button.on { background: rgba(111, 243, 255, 0.16); color: var(--cy); box-shadow: inset 0 0 0 1px rgba(111, 243, 255, 0.35); }
body.visor #menubar button.on span { color: var(--cy); }
body.visor #hud-toggle, body.visor .pad-mode #chat-btn, body.visor.pad-mode #chat-btn { background: rgba(10, 16, 26, 0.6); border-color: var(--edge-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08); }

/* ---------- แชท: ตัวอักษรจาง + ช่องพิมพ์แคปซูล ---------- */
body.visor #chat { background: none; border: 0; box-shadow: none; clip-path: none; text-shadow: var(--sh); }
body.visor #chat-log { color: rgba(244, 247, 251, 0.85); }
body.visor #chat-input { background: rgba(10, 16, 26, 0.5); border: 1px solid var(--edge); border-radius: var(--rad-pill, 4px); padding: 6px 14px; text-shadow: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s; }
body.visor #chat-input:hover { border-color: var(--edge-2); }
body.visor #chat-input:focus { background: rgba(111, 243, 255, 0.07); border-color: rgba(111, 243, 255, 0.6); box-shadow: var(--glow-soft); }
body.visor.pad-mode #chat-input { border-radius: 16px; padding: 10px 16px; }

/* ---------- แถบลัด: สี่เหลี่ยมมุมโค้งกระจกฝ้า / ยา: วงกลม / AUTO: แคปซูล ---------- */
body.visor #dock { background: none; border: 0; }
body.visor #dock::before { display: none; }
body.visor #hotbar { gap: 6px; }
body.visor .hb { clip-path: none; border-radius: 16px; overflow: hidden; background: var(--glass-s); border: 1px solid var(--edge-2);
  box-shadow: 0 10px 22px -12px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, transform 0.12s; }
body.visor .hb::before { content: none; }
body.visor .hb.blank { background: rgba(10, 16, 26, 0.42); border-style: solid; border-color: var(--edge-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
body.visor .hb:hover { background: rgba(111, 243, 255, 0.12); border-color: rgba(111, 243, 255, 0.55); box-shadow: var(--glow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
body.visor .hb.press, body.visor .hb:active { background: rgba(111, 243, 255, 0.2); border-color: var(--cy); box-shadow: 0 0 0 3px rgba(111, 243, 255, 0.18), 0 0 24px -4px rgba(111, 243, 255, 0.7); }
body.visor .hb.blank:hover { background: rgba(10, 16, 26, 0.4); border-color: var(--edge-2); box-shadow: none; }
body.visor #hotbar .hb .ic { inset: 6px; }
body.visor #hotbar .hb .ic img { width: 34px; height: 34px; }
body.visor #hotbar .hb .k { left: 6px; top: 3px; font: 600 9px var(--mono); color: var(--ink-dim); text-shadow: var(--sh); }
body.visor .hb .q { font: 600 10px var(--mono); }
body.visor .hb .cd { background: rgba(6, 10, 18, 0.65); }
body.visor:not(.pad-mode) #potbar { padding-left: 10px; border-left: 1px solid var(--edge-2); }
body.visor #potbar .hb { border-radius: 50%; background: var(--glass-s); border-color: var(--edge-2); }
body.visor #potbar .hb .k { font: 600 9px var(--mono); color: var(--ink-dim); }
body.visor #potbar .hb:hover { border-color: rgba(111, 243, 255, 0.55); }
body.visor .sicon { clip-path: none; border-radius: 32%; }
body.visor #auto-btn { width: auto; height: 40px; padding: 0 14px; border-radius: var(--rad-pill, 4px); flex-direction: row; gap: 6px; border: 1px solid rgba(111, 243, 255, 0.5);
  background: rgba(111, 243, 255, 0.1); color: #c8fbff; align-self: center; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 20px -10px rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: background 0.15s, border-color 0.15s, box-shadow 0.15s; }
body.visor #auto-btn:hover { background: rgba(111, 243, 255, 0.18); border-color: rgba(111, 243, 255, 0.7); box-shadow: var(--glow-soft); }
body.visor #auto-btn svg { width: 15px; height: 15px; }
body.visor #auto-btn b { font: 600 12px var(--mono); letter-spacing: 0.14em; color: #c8fbff; margin: 0; }
body.visor #auto-btn small { font: 500 10px var(--mono); color: var(--ink-dim); }
body.visor #auto-btn.on { border-color: rgba(125, 255, 180, 0.7); background: rgba(125, 255, 180, 0.18); box-shadow: 0 0 0 4px rgba(125, 255, 180, 0.12), 0 0 28px -6px rgba(125, 255, 180, 0.6); animation: none; }
body.visor #auto-btn.on b, body.visor #auto-btn.on small { color: #d8ffe8; }
body.visor #auto-btn.locked { opacity: 0.6; filter: grayscale(0.7); border-color: var(--edge); border-style: dashed; background: rgba(10, 16, 26, 0.45); box-shadow: none; cursor: not-allowed; }
body.visor #auto-btn.locked b, body.visor #auto-btn.locked small { color: var(--ink-faint); }
/* โหมด PAD: สกิลเป็นวงกลม */
body.visor.pad-mode #hotbar .hb { border-radius: 50%; border: 1px solid var(--edge-2); box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
body.visor.pad-mode #hotbar .hb .ic { inset: 8px; }
body.visor.pad-mode #hotbar .hb:nth-child(n+5) .ic { inset: 6px; }
body.visor.pad-mode #auto-btn { width: 54px; height: 54px; padding: 0; flex-direction: column; gap: 1px; border-radius: 50%; }
body.visor.pad-mode #auto-btn b { font-size: 10px; letter-spacing: 0.08em; }
body.visor.pad-mode #auto-btn small { font-size: 8.5px; }
@media (max-width: 1100px) { body.visor:not(.pad-mode) #dock .hb { border-radius: 14px; } body.visor:not(.pad-mode) #hotbar .hb .ic { inset: 5px; } body.visor:not(.pad-mode) #hotbar .hb .ic img { width: 30px; height: 30px; } }
@media (max-width: 760px) { body.visor:not(.pad-mode) #dock .hb { border-radius: 12px; } body.visor:not(.pad-mode) #hotbar .hb .ic img { width: 26px; height: 26px; } }

/* ---------- EXP: เส้นเดียวล่างสุดของจอ ---------- */
body.visor #exp-line { display: block; position: fixed; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.12); z-index: 26; pointer-events: none; }
#exp-line i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cy), var(--exp)); transition: width 0.3s; }

/* ---------- ชิ้นเล็กบน HUD: บัฟ นำทาง ประกาศ ---------- */
body.visor .buff { clip-path: none; border-radius: 50%; box-shadow: 0 0 0 2px rgba(6, 10, 18, 0.5), 0 4px 10px -4px rgba(0, 0, 0, 0.8); }
body.visor #nav-pill { clip-path: none; border-radius: var(--rad-pill, 4px); padding: 5px 6px 5px 14px; background: var(--glass-s); border: 1px solid var(--edge-2); border-left-width: 1px;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.08); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); font: 500 12.5px var(--font); }
body.visor #nav-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cy); box-shadow: 0 0 8px var(--cy); flex-shrink: 0; }
body.visor #nav-cancel { border-radius: 50%; border-color: var(--edge); background: var(--fill); }
body.visor #nav-cancel:hover { background: rgba(255, 107, 125, 0.25); border-color: rgba(255, 107, 125, 0.6); color: #fff; }
/* ---------- ล้มลง: ฉากฟื้นคืนชีพแบบแฟนตาซี ใบไม้ Yggdrasil เรืองแสง ---------- */
body.visor #death { background: radial-gradient(ellipse at 50% 42%, rgba(30, 24, 12, 0.25), rgba(4, 6, 10, 0.82) 72%);
  -webkit-backdrop-filter: saturate(0.2) brightness(0.75); backdrop-filter: saturate(0.2) brightness(0.75); animation: dIn 0.9s ease both; }
body.visor .death-box { clip-path: none; width: min(380px, calc(100vw - 32px)); padding: 6px 24px 20px; border: 0; border-radius: 32px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(255, 226, 150, 0.09), rgba(0, 0, 0, 0) 60%), linear-gradient(180deg, rgba(20, 22, 30, 0.55), rgba(10, 12, 18, 0.72));
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 240, 200, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); display: flex; flex-direction: column; align-items: center; animation: dBox 0.9s cubic-bezier(.2, .8, .2, 1) both 0.15s; }
body.visor .death-core { position: relative; width: 132px; height: 120px; margin: -2px 0 2px; }
body.visor .dc-halo { position: absolute; left: 50%; top: 54%; width: 96px; height: 96px; margin: -48px 0 0 -48px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 232, 160, 0.42), rgba(180, 240, 170, 0.14) 45%, rgba(0, 0, 0, 0) 70%); animation: dHalo 3.2s ease-in-out infinite; }
body.visor .dc-mote { position: absolute; bottom: 18px; width: 4px; height: 4px; border-radius: 50%; background: #fff3c4; box-shadow: 0 0 8px 2px rgba(255, 230, 150, 0.7); opacity: 0; animation: dMote 3.6s ease-in infinite; }
body.visor .dc-mote.m1 { left: 40%; } body.visor .dc-mote.m2 { left: 58%; animation-delay: 1.2s; } body.visor .dc-mote.m3 { left: 49%; animation-delay: 2.4s; }
body.visor .dc-glyph { position: absolute; inset: 0; display: grid; place-items: center; padding-top: 10px; }
body.visor .death-box svg, body.visor #death-mini svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
body.visor .death-box svg .lf, body.visor #death-mini svg .lf { fill: rgba(190, 240, 160, 0.22); }
body.visor .dc-glyph svg { width: 54px; height: 54px; color: #f3e6b0; filter: drop-shadow(0 0 10px rgba(255, 225, 140, 0.75)); animation: dLeaf 3.2s ease-in-out infinite; }
body.visor .death-t { font: 600 30px/1.2 var(--display); letter-spacing: 0.01em; color: #fbf3df; text-shadow: 0 2px 24px rgba(255, 210, 130, 0.35); }
body.visor .death-s { margin: 6px 0 14px; color: var(--ink-dim); font-size: 13.5px; line-height: 1.5; text-wrap: balance; }
body.visor .death-info { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 18px; }
body.visor .death-info span { font: 500 11.5px var(--mono); padding: 4px 11px; border-radius: var(--rad-pill, 4px); background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); color: var(--ink-dim); }
body.visor .death-info span:empty { display: none; }
body.visor .death-info span:first-child { color: #ffd2a8; }
body.visor .death-btns { flex-direction: column; width: 100%; gap: 8px; }
body.visor .death-btns .btn { width: 100%; min-height: 46px; border-radius: var(--rad-pill, 4px); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; }
body.visor .death-btns .btn.primary { background: linear-gradient(180deg, #fff1c8, #f2d48a); color: #2a1d05; border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 14px 32px -12px rgba(255, 210, 120, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
body.visor .death-btns .btn.primary:hover { background: linear-gradient(180deg, #fff6da, #f6dc9c); }
body.visor .death-btns .btn:not(.primary) { background: rgba(255, 255, 255, 0.06); color: var(--ink); border: 1px solid var(--edge-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
body.visor .death-btns .btn:not(.primary):hover { background: rgba(255, 255, 255, 0.12); }
body.visor #death-hide { margin-top: 12px; color: var(--ink-dim); font-size: 12.5px; }
body.visor #death-mini { display: inline-flex; align-items: center; gap: 8px; border-radius: var(--rad-pill, 4px); padding: 10px 20px 10px 14px; color: #fbf3df; font-weight: 600;
  border: 1px solid rgba(255, 225, 150, 0.45); background: rgba(16, 16, 20, 0.72); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 0 0 0 rgba(255, 225, 150, 0.45); animation: dPing 2s ease-out infinite; }
body.visor #death-mini.hidden { display: none; }
body.visor #death-mini svg { width: 18px; height: 18px; color: #f3e6b0; }
body.visor.pad-mode #death-mini, body.visor .pad-mode #death-mini { bottom: calc(232px + var(--sb, 0px)); }
@keyframes dIn { from { opacity: 0; } }
@keyframes dBox { from { opacity: 0; transform: translateY(18px); } }
@keyframes dHalo { 0%, 100% { transform: scale(0.92); opacity: 0.75; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes dLeaf { 0%, 100% { transform: translateY(2px) rotate(-4deg); } 50% { transform: translateY(-4px) rotate(3deg); } }
@keyframes dMote { 0% { opacity: 0; transform: translateY(0) scale(0.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-78px) scale(1); } }
@keyframes dPing { 70% { box-shadow: 0 0 0 12px rgba(255, 225, 150, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 225, 150, 0); } }
@media (prefers-reduced-motion: reduce) { body.visor .dc-halo, body.visor .dc-mote, body.visor .dc-glyph svg, body.visor #death-mini { animation: none; } }

/* ---------- หน้าต่าง: การ์ดกระจกฝ้ามุมโค้ง เงาฟุ้ง ---------- */
body.visor .win { clip-path: none; overflow: hidden; border-radius: 20px; background: linear-gradient(160deg, rgba(16, 24, 38, 0.8), rgba(8, 12, 20, 0.74)); border: 1px solid var(--edge-2);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.85), 0 0 90px -40px rgba(111, 243, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(24px) saturate(1.3); backdrop-filter: blur(24px) saturate(1.3); }
body.visor .win::before { content: ""; position: absolute; inset: 0; left: 0; top: 0; width: auto; height: auto; border: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(120% 40% at 50% -10%, rgba(111, 243, 255, 0.14), rgba(111, 243, 255, 0) 60%); }
body.visor .win::after { content: none; }
body.visor .win > * { position: relative; z-index: 1; }
body.visor .win-title { background: none; border-bottom: 1px solid var(--edge); padding: 4px 6px 4px 14px; min-height: 34px; } /* หัวหน้าต่างบาง */
body.visor .win-title span { font: 600 13.5px var(--display); display: flex; align-items: center; }
body.visor .win-title span::before { width: 6px; height: 6px; transform: none; border-radius: 50%; box-shadow: 0 0 10px var(--cy); }
body.visor .win-x { width: 24px; height: 24px; margin-right: 2px; font-size: 16px; border: 1px solid transparent; background: var(--fill); border-radius: 50%; color: var(--ink-dim); line-height: 22px; transition: background 0.15s, color 0.15s, border-color 0.15s; }
body.visor .win-x:hover { background: rgba(255, 107, 125, 0.22); border-color: rgba(255, 107, 125, 0.5); color: #fff; }
body.visor .win-body { padding: 12px 14px 14px; }
body.visor .win.dialog { border-radius: 22px; }
/* ปุ่ม: แคปซูล */
body.visor .btn { clip-path: none; border-radius: var(--rad-pill, 4px); padding: 6px 14px; background: var(--fill); border: 1px solid var(--edge-2); color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s; }
body.visor .btn:hover { background: rgba(111, 243, 255, 0.14); border-color: rgba(111, 243, 255, 0.55); color: #fff; box-shadow: 0 0 20px -6px rgba(111, 243, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
body.visor .btn.small { padding: 4px 11px; }
body.visor .btn.danger { color: #ffb3bb; }
body.visor .btn.danger:hover { background: rgba(255, 107, 125, 0.18); border-color: rgba(255, 107, 125, 0.6); }
body.visor .btn.big { padding: 11px 30px; color: #04121f; background: linear-gradient(180deg, #8ff6ff, #62e6f6); border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 14px 30px -10px rgba(111, 243, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.55); }
body.visor .btn.big:hover { background: linear-gradient(180deg, #a9f9ff, #78ecf9); color: #04121f; }
body.visor .btn.gp-sel { background: rgba(111, 243, 255, 0.18); border-color: var(--cy); }
body.visor .st-up { border-radius: var(--rad-pill, 4px); border-color: var(--edge-2); background: var(--fill); }
body.visor .st-up:hover:not(:disabled) { background: rgba(111, 243, 255, 0.16); border-color: var(--cy); }
body.visor .tag { border-radius: var(--rad-pill, 4px); padding: 0 7px; }
body.visor .win .seg button { padding: 7px 8px; font-size: 12.5px; }
/* แท็บ: สวิตช์แคปซูล */
body.visor .tabs { gap: 4px; padding: 4px; border-radius: var(--rad-pill, 4px); background: var(--fill); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); }
body.visor .tab { border: 0; border-radius: var(--rad-pill, 4px); background: transparent; padding: 6px 8px; color: var(--ink-dim); box-shadow: none; transition: color 0.18s, background 0.18s, box-shadow 0.18s; }
body.visor .tab:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
body.visor .tab.on { background: rgba(111, 243, 255, 0.18); color: #fff; box-shadow: inset 0 0 0 1px rgba(111, 243, 255, 0.4), 0 0 22px -6px rgba(111, 243, 255, 0.6); }
/* ช่องกรอก / เลือก */
body.visor .win input[type=text], body.visor .win input[type=number], body.visor .win select, body.visor .qty { border-radius: 10px; padding: 4px 8px; background: var(--fill); border: 1px solid var(--edge-2); color: var(--ink); outline: none; }
body.visor .win input[type=text]:focus, body.visor .win input[type=number]:focus, body.visor .qty:focus { border-color: rgba(111, 243, 255, 0.6); box-shadow: var(--glow-soft); }
body.visor .opt-lbl { font: 600 10.5px var(--mono); letter-spacing: 0.18em; text-transform: uppercase; }
/* ช่อง/แถวไอเทม อุปกรณ์ สกิล ร้านค้า */
body.visor .inv-cell { border-radius: 12px; border-color: var(--edge); background: var(--fill); transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }
body.visor .inv-cell:not(.empty):hover { border-color: rgba(111, 243, 255, 0.45); background: var(--fill-2); }
body.visor .inv-cell.empty { background: rgba(255, 255, 255, 0.025); border-color: rgba(255, 255, 255, 0.05); }
body.visor .inv-cell.sel { border-color: var(--cy); background: rgba(111, 243, 255, 0.14); box-shadow: 0 0 0 1px rgba(111, 243, 255, 0.5) inset, var(--glow-soft); }
body.visor .inv-detail, body.visor .sk-row, body.visor .eq-slot, body.visor .shop-row, body.visor .dlg-text, body.visor .bot-stats > div, body.visor .q-card, body.visor .nav-row, body.visor .emote-b, body.visor .mb-mvp {
  background: var(--fill); border: 1px solid var(--edge); }
body.visor .inv-detail, body.visor .dlg-text, body.visor .q-card { border-radius: 14px; }
body.visor .inv-detail { padding: 10px 12px; }
body.visor .sk-row, body.visor .shop-row, body.visor .nav-row, body.visor .bot-stats > div, body.visor .emote-b, body.visor .mb-mvp { border-radius: 12px; }
body.visor .eq-slot { border-radius: 10px; }
body.visor .eq-slot.empty { background: rgba(255, 255, 255, 0.025); border-color: rgba(255, 255, 255, 0.05); }
body.visor .eq-slot:not(.empty):hover { border-color: rgba(255, 107, 125, 0.55); background: rgba(255, 107, 125, 0.08); }
body.visor .shop-row { padding: 5px 8px; }
body.visor .shop-row.sellall { background: rgba(255, 224, 138, 0.08); border-color: rgba(255, 224, 138, 0.25); }
body.visor .nav-row:hover, body.visor .emote-b:hover { border-color: rgba(111, 243, 255, 0.5); background: rgba(111, 243, 255, 0.1); }
body.visor .nav-row.here { border-left: 1px solid var(--edge); box-shadow: inset 3px 0 0 var(--cy); }
body.visor .mb-mvp { border-left: 1px solid rgba(255, 208, 90, 0.35); background: rgba(255, 208, 90, 0.08); }
body.visor #bigmap-cv { border-radius: 14px; }
body.visor .eq-prev, body.visor .mb-cv, body.visor .pt-cv, body.visor .wm-card { border-radius: 14px; border-color: var(--edge); overflow: hidden; }
body.visor .wm-card.here { border-color: rgba(255, 211, 74, 0.8); box-shadow: 0 0 0 1px rgba(255, 211, 74, 0.6), 0 0 20px -4px rgba(255, 211, 74, 0.5); }
body.visor .wm-tags i { border-radius: var(--rad-pill, 4px); padding: 1px 7px; border-color: var(--edge-2); background: rgba(6, 10, 18, 0.7); }
/* ---------- ต้นไม้พาสซีฟ: ผืน canvas มุมโค้ง + การ์ดรายละเอียด + คำอธิบายไอคอน ---------- */
body.visor .pt-head { margin-bottom: 8px; }
body.visor #pt-pts { font: 500 13px var(--mono); color: var(--ink-dim); letter-spacing: 0.04em; }
body.visor #pt-pts b { color: var(--exp); font-size: 16px; }
body.visor .pt-cv { border-radius: 18px; border: 1px solid var(--edge-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 40px -24px rgba(0, 0, 0, 0.9); }
body.visor .pt-info { --pc: var(--cy); border-radius: 16px; border: 1px solid var(--edge-2); background: rgba(10, 16, 26, 0.86); padding: 11px 13px 12px; gap: 5px; max-width: min(320px, calc(100% - 16px));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); font: 500 12.5px var(--font); line-height: 1.35;
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 3px 0 0 var(--pc); }
body.visor .pt-i-head { display: flex; align-items: center; gap: 10px; margin-bottom: 3px; }
body.visor .pt-i-ic { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--pc); background: color-mix(in srgb, var(--pc) 16%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--pc) 55%, transparent); }
body.visor .pt-i-ic.pt-i-key { border-radius: 12px; }
body.visor .pt-i-ic.pt-i-notable { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--pc) 55%, transparent), 0 0 0 3px color-mix(in srgb, var(--pc) 22%, transparent); }
body.visor .pt-i-ic svg { stroke-width: 1.9; }
body.visor .pt-i-t { display: grid; gap: 1px; min-width: 0; }
body.visor .pt-i-t b { color: var(--pc); font: 600 15px/1.2 var(--display); }
body.visor .pt-i-t small { color: var(--ink-dim); font: 500 11px var(--mono); }
body.visor .pt-i-st { flex: none; margin-left: auto; font: 600 10px var(--mono); letter-spacing: 0.08em; border-radius: var(--rad-pill, 4px); padding: 2px 8px; font-style: normal; color: var(--ink-dim); border: 1px solid var(--edge-2); background: var(--fill); white-space: nowrap; }
body.visor .pt-i-st.on { color: #0a1020; background: var(--exp); border-color: var(--exp); }
body.visor .pt-i-st.can { color: var(--cy); border-color: rgba(111, 243, 255, 0.55); background: rgba(111, 243, 255, 0.12); }
body.visor .pt-i-row { display: flex; align-items: center; gap: 7px; color: var(--ink); }
body.visor .pt-i-row svg { flex: none; color: var(--pc); stroke-width: 2; }
body.visor .pt-info .ks { padding: 6px 9px; border-radius: 10px; background: rgba(255, 176, 138, 0.1); border: 1px solid rgba(255, 176, 138, 0.3); color: #ffc9ad; font-size: 12px; }
body.visor .pt-info .dim { font-size: 11.5px; }
body.visor .pt-info > b { font: 600 14px var(--display); color: var(--exp); }
body.visor .pt-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; }
body.visor .pt-lg { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px; border-radius: var(--rad-pill, 4px); background: var(--fill); border: 1px solid var(--edge); color: var(--ink-dim); font: 500 10.5px var(--mono); letter-spacing: 0.04em; white-space: nowrap; }
body.visor .pt-lg svg { color: var(--cy); stroke-width: 2; }
body.visor .pt-lg i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid rgba(220, 232, 245, 0.7); background: rgba(220, 232, 245, 0.12); }
body.visor .pt-lg-notable i { width: 12px; height: 12px; box-shadow: 0 0 0 2px rgba(220, 232, 245, 0.25); }
body.visor .pt-lg-key i { width: 13px; height: 13px; border-radius: 4px; transform: rotate(45deg) scale(0.88); border-color: var(--exp); background: rgba(255, 224, 138, 0.18); }
body.visor .pt-lg-sep { width: 1px; height: 14px; background: var(--edge-2); margin: 0 2px; }
body.visor #w-tree .hint { font: 500 10.5px var(--mono); color: var(--ink-faint); margin-top: 7px; }
body.visor .bot-toggle { border-radius: var(--rad-pill, 4px); padding: 8px 14px; }
body.visor .bot-sec, body.visor .st-h, body.visor .mb-h { font: 600 10.5px var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--cy); }
/* บทสนทนา NPC: แถวตัวเลือกมุมโค้ง */
body.visor .dlg-text { padding: 11px 14px; }
body.visor .dlg-menu { gap: 5px; }
body.visor .dlg-opt { display: flex; align-items: center; gap: 10px; border-radius: 12px; background: var(--fill); border: 1px solid var(--edge); padding: 8px 12px; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s; }
body.visor .dlg-opt::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cy); opacity: 0.55; flex-shrink: 0; transition: opacity 0.15s, box-shadow 0.15s; }
body.visor .dlg-opt:hover, body.visor .dlg-opt.gp-sel { background: rgba(111, 243, 255, 0.12); border-color: rgba(111, 243, 255, 0.5); color: #fff; box-shadow: 0 0 20px -8px rgba(111, 243, 255, 0.5); }
body.visor .dlg-opt:hover::before, body.visor .dlg-opt.gp-sel::before { opacity: 1; box-shadow: 0 0 8px var(--cy); }
/* ยืนยัน */
body.visor .cf-btns { gap: 8px; }

/* ไม่เบลอฉากด้านหลังของชิ้นตัวอักษร (ให้เห็นฉากชัด) */
body.visor #menubar button, body.visor #chat, body.visor #basic-info, body.visor #quest-track, body.visor #target, body.visor .mm-head { -webkit-backdrop-filter: none; backdrop-filter: none; }
body.visor .bi-foot { flex-wrap: wrap; row-gap: 3px; }
body.visor #bi-zeny { white-space: nowrap; }
body.visor .pt { white-space: nowrap; }
body.visor #quest-track, body.visor.pad-mode #quest-track, body.visor .pad-mode #quest-track { border: 0; background: none; }

/* =====================================================================
   หน้าไตเติล / ล็อกอิน / สร้างตัวละคร — "Visor Soft"
   โทนเดียวกับ HUD (เข้ม + ฟ้า + IBM Plex) แต่นุ่ม: กระจกฝ้ามุมโค้ง เงาฟุ้ง แสงเรือง ปุ่ม/ช่องกรอกทรงแคปซูล
   ===================================================================== */
body.visor {
  --r-card: 10px; --r-ctl: 4px;
  --glass-s: linear-gradient(160deg, rgba(18, 26, 40, 0.66), rgba(8, 12, 20, 0.58));
  --edge: rgba(255, 255, 255, 0.1); --edge-2: rgba(255, 255, 255, 0.16);
  --fill: rgba(255, 255, 255, 0.06); --fill-2: rgba(255, 255, 255, 0.1);
  --glow-soft: 0 0 0 4px rgba(111, 243, 255, 0.12), 0 0 28px -6px rgba(111, 243, 255, 0.45);
  --chev: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M6 3l5 5-5 5' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
body.visor #title { background: #04060f; }
/* ม่านไล่มืด: ซ้าย/ล่าง/บน ให้ตัวหนังสืออ่านได้บนภาพหน้าปก */
body.visor #title::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; transition: background 0.45s;
  background:
    linear-gradient(90deg, rgba(6, 10, 18, 0.86) 0%, rgba(6, 10, 18, 0.62) 28%, rgba(6, 10, 18, 0.12) 56%, rgba(6, 10, 18, 0) 70%),
    linear-gradient(0deg, rgba(6, 10, 18, 0.72), rgba(6, 10, 18, 0) 34%),
    linear-gradient(180deg, rgba(6, 10, 18, 0.5), rgba(6, 10, 18, 0) 22%); }
body.visor #title.creating::before, body.visor #title.selecting::before { background: radial-gradient(60% 70% at 50% 60%, rgba(6, 10, 18, 0.5), rgba(6, 10, 18, 0.72)); }
body.visor .title-inner { z-index: 2; }
body.visor #title-ver { right: calc(28px + var(--sr)); bottom: calc(20px + var(--sb)); z-index: 3; display: flex; align-items: center; gap: 8px;
  font: 500 10.5px var(--mono); letter-spacing: 0.14em; color: rgba(198, 208, 220, 0.75); text-shadow: var(--sh); }
body.visor #title-ver::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cy); box-shadow: 0 0 10px var(--cy); animation: verPulse 2.4s ease-in-out infinite; }
@keyframes verPulse { 50% { opacity: 0.35; box-shadow: none; } }

/* โลโก้ + คำโปรย */
body.visor .title-inner { padding: calc(26px + var(--st)) 16px calc(26px + var(--sb)) max(6.5vw, 36px); width: min(620px, 100%); gap: 16px; }
body.visor .logo.logo-img { animation: none; filter: drop-shadow(0 0 26px rgba(111, 243, 255, 0.24)) drop-shadow(0 14px 24px rgba(0, 0, 0, 0.65)); }
body.visor .logo.logo-img img { width: min(440px, 46vh, 100%); }
body.visor .logo-sub { display: flex; align-items: center; gap: 12px; margin-top: 4px; font: 500 12.5px var(--mono); letter-spacing: 0.1em; color: var(--ink-dim); text-shadow: var(--sh); }
body.visor .logo-sub::before { content: ""; display: block; width: 28px; height: 2px; margin: 0; border-radius: 2px; background: var(--cy); box-shadow: 0 0 8px var(--cy); flex-shrink: 0; }
body.visor .hero-cap { font-family: var(--mono); }

/* ---------- การ์ด: กระจกฝ้ามุมโค้ง แสงฟุ้งจากด้านบน ---------- */
body.visor .card { position: relative; clip-path: none; border-radius: var(--r-card); padding: 24px 26px 20px; overflow: hidden;
  background: var(--glass-s); border: 1px solid var(--edge);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.85), 0 0 120px -40px rgba(111, 243, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(26px) saturate(1.3); backdrop-filter: blur(26px) saturate(1.3); }
body.visor .card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(120% 55% at 50% -12%, rgba(111, 243, 255, 0.16), rgba(111, 243, 255, 0) 60%); }
body.visor .card > * { position: relative; z-index: 1; }
.card-kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font: 600 10.5px var(--mono); letter-spacing: 0.22em; color: var(--cy); white-space: nowrap; }
.card-kicker span { font: 500 11.5px var(--font); letter-spacing: 0; color: var(--ink-faint); }
.card-kicker::after { content: ""; flex: 1; height: 1px; border-radius: 1px; background: linear-gradient(90deg, rgba(111, 243, 255, 0.4), rgba(111, 243, 255, 0)); }

/* ป้าย + ช่องกรอก: ทรงแคปซูลโปร่ง */
body.visor .cr-right label, body.visor .auth label { display: flex; align-items: center; gap: 8px; margin: 10px 0 5px 14px; font: 600 10.5px var(--mono); letter-spacing: 0.18em; color: var(--cy); }
body.visor #cr-name, body.visor .auth input { font: 16px/1.3 var(--font); padding: 11px 16px; border-radius: var(--r-ctl); background: var(--fill); border: 1px solid var(--edge); color: var(--ink);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s; }
body.visor #cr-name::placeholder, body.visor .auth input::placeholder { color: var(--ink-faint); }
body.visor #cr-name:hover, body.visor .auth input:hover { border-color: var(--edge-2); }
body.visor #cr-name:focus, body.visor .auth input:focus { background: rgba(111, 243, 255, 0.07); border-color: rgba(111, 243, 255, 0.6); box-shadow: var(--glow-soft); }
body.visor .auth input:-webkit-autofill { -webkit-text-fill-color: var(--ink); -webkit-box-shadow: 0 0 0 1000px #121b28 inset; transition: background-color 9999s; border-radius: var(--r-ctl); }
body.visor .err { font: 500 12px/1.4 var(--font); color: #ff9aa4; min-height: 18px; margin: 6px 0 0 14px; }

/* ตัวเลือกแบบสวิตช์แคปซูล (แท็บล็อกอิน/สมัคร, โครงร่าง) */
body.visor .seg { gap: 4px; padding: 4px; border: 0; border-radius: var(--rad-pill, 4px); background: var(--fill); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); }
body.visor .seg button { position: relative; border: 0; margin: 0; border-radius: var(--rad-pill, 4px); padding: 9px 10px; background: transparent; color: var(--ink-dim); font: 600 13.5px var(--font);
  transition: color 0.18s, background 0.18s, box-shadow 0.18s; }
body.visor .seg button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
body.visor .seg button.on { background: rgba(111, 243, 255, 0.18); color: #fff; box-shadow: inset 0 0 0 1px rgba(111, 243, 255, 0.4), 0 0 22px -6px rgba(111, 243, 255, 0.6); text-shadow: 0 0 10px rgba(111, 243, 255, 0.35); }
body.visor .seg-wrap { border-radius: 18px; }
body.visor .seg-wrap button { border-radius: 12px; }
body.visor .swatches { gap: 8px; padding: 4px 0 0 2px; }
body.visor .swatch { border-color: rgba(8, 12, 20, 0.9); box-shadow: 0 0 0 1px var(--edge-2); }
body.visor .swatch.on { box-shadow: 0 0 0 2px var(--cy), 0 0 14px rgba(111, 243, 255, 0.5); }

/* ---------- ปุ่ม: หลัก = ฟ้าเรือง, รอง = กระจกฝ้า ---------- */
body.visor .tbtn { position: relative; clip-path: none; min-width: 0; width: min(400px, 100%); padding: 14px 56px 14px 22px; gap: 2px; align-items: flex-start; text-align: left; border-radius: 22px;
  font: 600 18px/1.2 var(--font); color: var(--ink); background: rgba(10, 16, 26, 0.55); border: 1px solid var(--edge-2);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  transition: background 0.18s, border-color 0.18s, transform 0.18s, box-shadow 0.18s; }
body.visor .tbtn small { font: 500 11.5px var(--font); letter-spacing: 0.02em; color: var(--ink-dim); }
body.visor .tbtn::after { content: ""; display: block; position: absolute; inset: auto; left: auto; right: 20px; top: 50%; width: 16px; height: 16px; background: currentColor; animation: none; opacity: 0.75;
  -webkit-mask: var(--chev) center / contain no-repeat; mask: var(--chev) center / contain no-repeat; transform: translateY(-50%); transition: transform 0.18s, opacity 0.18s; }
body.visor .tbtn:hover { filter: none; transform: translateY(-1px); border-color: rgba(111, 243, 255, 0.45); background: rgba(111, 243, 255, 0.1); box-shadow: 0 24px 48px -22px rgba(0, 0, 0, 0.85), 0 0 30px -8px rgba(111, 243, 255, 0.4); }
body.visor .tbtn:hover::after { opacity: 1; transform: translate(3px, -50%); }
body.visor .tbtn:active { transform: translateY(1px); }
body.visor .tbtn.primary { background: linear-gradient(180deg, #8ff6ff, #62e6f6); border-color: rgba(255, 255, 255, 0.35); color: #04121f;
  box-shadow: 0 18px 40px -12px rgba(111, 243, 255, 0.65), 0 24px 48px -24px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.55); }
body.visor .tbtn.primary:hover { background: linear-gradient(180deg, #a9f9ff, #78ecf9); border-color: rgba(255, 255, 255, 0.5); box-shadow: 0 20px 46px -10px rgba(111, 243, 255, 0.8), 0 24px 48px -24px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
body.visor .tbtn.primary small { color: rgba(4, 18, 31, 0.72); }
body.visor .tbtn.primary::after { opacity: 0.85; }
body.visor .tbtn.small { width: auto; border-radius: var(--rad-pill, 4px); font-size: 14px; padding: 11px 22px; align-items: center; }
body.visor .tbtn.small::after { display: none; }
body.visor .tbtn.small.primary { padding-right: 42px; }
body.visor .tbtn.small.primary::after { display: block; right: 16px; width: 15px; height: 15px; }
body.visor .tbtn.small:not(.primary) { background: var(--fill); color: var(--ink-dim); border-color: var(--edge); box-shadow: none; }
body.visor .tbtn.small:not(.primary):hover { color: var(--ink); background: var(--fill-2); border-color: var(--edge-2); box-shadow: none; }
body.visor .linkbtn { font: 500 12.5px var(--font); text-decoration: none; color: var(--cy); padding: 6px 2px; letter-spacing: 0.01em; border-radius: var(--rad-pill, 4px); transition: color 0.15s; }
body.visor .linkbtn::after { content: " →"; font-family: var(--mono); }
body.visor .linkbtn:hover { color: #c8fbff; }

/* ---------- การ์ดล็อกอิน ---------- */
body.visor .auth { width: min(400px, 100%); gap: 0; }
body.visor .auth .seg { margin-bottom: 4px; }
body.visor .auth .tbtn { width: 100%; margin-top: 14px; min-height: 50px; padding: 0 44px 0 22px; border-radius: var(--rad-pill, 4px); justify-content: center; align-items: center; text-align: center; font-size: 15.5px; letter-spacing: 0.02em; }
body.visor .auth .tbtn:hover { transform: translateY(-1px); }
body.visor .auth .tbtn:active { transform: translateY(1px); }
body.visor .auth .linkbtn { margin-top: 8px; }
body.visor .au-note { font: 500 10.5px var(--mono); letter-spacing: 0.04em; color: var(--ink-faint); opacity: 1; margin-top: 2px; }
/* แถบบัญชี */
body.visor .acct { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 7px 15px 7px 12px; border-radius: var(--rad-pill, 4px); font: 500 12.5px var(--font); color: var(--ink-dim);
  background: rgba(10, 16, 26, 0.55); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
body.visor .acct::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #7dffb4; box-shadow: 0 0 10px #7dffb4; flex-shrink: 0; }
body.visor .acct b { color: #fff; font-weight: 600; }
body.visor .acct .linkbtn { padding: 0; font-size: 12px; }

/* ---------- เมนูหลัก ---------- */
body.visor .title-menu { gap: 10px; }
body.visor .title-menu .linkbtn { padding: 8px 2px; }
body.visor .title-foot { display: block; margin-top: 10px; max-width: 480px; font: 400 12px/1.7 var(--font); color: var(--ink-dim); text-shadow: var(--sh); }
body.visor .chip { display: inline-block; vertical-align: 1px; margin-right: 8px; padding: 1px 10px; border-radius: var(--rad-pill, 4px); font: 600 10px/1.6 var(--mono); letter-spacing: 0.18em; color: #d9fdff;
  background: rgba(111, 243, 255, 0.16); border: 1px solid rgba(111, 243, 255, 0.4); box-shadow: 0 0 14px -4px rgba(111, 243, 255, 0.6); }

/* ---------- สร้างตัวละคร: เวทีพรีวิว (ซ้าย) + แบบฟอร์ม (ขวา) ---------- */
body.visor #title.creating .title-inner, body.visor #title.selecting .title-inner { width: min(860px, 100%); gap: 16px; padding-left: 16px; }
body.visor #title.creating .logo.logo-img img, body.visor #title.selecting .logo.logo-img img { width: min(250px, 56vw); }
body.visor .create { width: min(800px, 100%); padding: 12px; gap: 14px; max-height: calc(100dvh - 48px - var(--st) - var(--sb)); }
body.visor .cr-left { position: relative; width: 268px; flex-shrink: 0; align-items: center; gap: 10px; padding: 18px 16px 16px; border-radius: 20px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 80%, rgba(111, 243, 255, 0.2), rgba(111, 243, 255, 0) 60%), rgba(4, 8, 14, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
body.visor .cr-left::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(rgba(244, 247, 251, 0.16) 1px, transparent 1.4px) 0 0 / 18px 18px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 55%, #000 20%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 55%, #000 20%, transparent 70%); }
body.visor .cr-left::before { content: "UNIT PREVIEW"; position: relative; z-index: 1; align-self: flex-start; font: 600 10.5px var(--mono); letter-spacing: 0.22em; color: var(--cy); }
body.visor .cr-left > * { position: relative; z-index: 1; }
body.visor .cr-left canvas { width: 220px; height: 260px; margin: auto 0; border: 0; background: transparent; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.6)); }
body.visor .cr-right { padding: 8px 12px 6px 4px; gap: 0; counter-reset: cr; }
body.visor .cr-right label::before { counter-increment: cr; content: counter(cr, decimal-leading-zero); font: 600 10px var(--mono); letter-spacing: 0.1em; color: var(--ink-faint); }
body.visor .cr-right .card-kicker { margin-bottom: 0; }
body.visor .cr-btns { margin-top: auto; padding: 14px 0 6px; margin-bottom: -6px; bottom: -6px; gap: 10px; border-top: 1px solid var(--edge);
  background: linear-gradient(rgba(10, 15, 24, 0), rgba(10, 15, 24, 0.94) 30%); }

/* ---------- มือถือแนวตั้ง ---------- */
@media (max-width: 760px) {
  body.visor #title::before { background:
    linear-gradient(0deg, rgba(6, 10, 18, 0.9), rgba(6, 10, 18, 0.45) 36%, rgba(6, 10, 18, 0) 58%),
    linear-gradient(180deg, rgba(6, 10, 18, 0.62), rgba(6, 10, 18, 0) 26%); }
  body.visor #title.creating::before, body.visor #title.selecting::before { background: rgba(6, 10, 18, 0.7); }
  body.visor .title-inner { width: 100%; padding: calc(22px + var(--st)) 16px calc(44px + var(--sb)); gap: 0; }
  body.visor .logo.logo-img img { width: min(320px, 78vw); }
  body.visor .logo-sub { justify-content: center; font-size: 11.5px; letter-spacing: 0.06em; }
  body.visor .card { padding: 20px 20px 16px; border-radius: 24px; }
  body.visor .auth { width: 100%; max-height: calc(100dvh - 150px - var(--st) - var(--sb)); overflow-y: auto; }
  body.visor .auth .tbtn { margin-top: 12px; min-height: 48px; }
  body.visor .title-menu { padding: 24px 0 8px; gap: 10px; background: none; }
  body.visor .acct { margin-top: auto; margin-bottom: -10px; }
  body.visor .tbtn { width: 100%; }
  body.visor .title-foot { margin-top: 6px; font-size: 11.5px; text-align: center; max-width: 100%; }
  body.visor #title-ver { right: auto; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--sb)); white-space: nowrap; }
  body.visor #title.creating .title-inner, body.visor #title.selecting .title-inner { gap: 12px; padding-top: calc(16px + var(--st)); }
  body.visor #title.creating .logo.logo-img img, body.visor #title.selecting .logo.logo-img img { width: min(200px, 52vw); }
  body.visor .create { flex-direction: column; padding: 10px; gap: 10px; max-height: calc(100dvh - 120px - var(--st) - var(--sb)); }
  body.visor .cr-left { width: 100%; padding: 14px 16px 12px; border-radius: 18px; }
  body.visor .cr-left canvas { width: 150px; height: 176px; margin: 0; }
  body.visor .cr-right { padding: 4px 8px 6px; }
  body.visor .cr-right label { margin-top: 8px; }
  body.visor .cr-btns { padding: 12px 0 6px; }
  body.visor .cr-btns .tbtn.small { flex: 1; justify-content: center; }
}

/* ---------- มือถือแนวนอน (จอเตี้ย): โลโก้ซ้าย การ์ดขวา ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  body.visor #title::before { background:
    linear-gradient(90deg, rgba(6, 10, 18, 0.88) 0%, rgba(6, 10, 18, 0.76) 44%, rgba(6, 10, 18, 0.3) 70%, rgba(6, 10, 18, 0) 84%),
    linear-gradient(0deg, rgba(6, 10, 18, 0.6), rgba(6, 10, 18, 0) 40%); }
  body.visor .title-inner { flex-direction: row; align-items: center; justify-content: flex-start; gap: 32px; width: 100%;
    padding: calc(12px + var(--st)) calc(20px + var(--sr)) calc(12px + var(--sb)) calc(28px + var(--sl)); }
  body.visor .title-top { flex: 0 0 auto; }
  body.visor .logo.logo-img img { width: min(270px, 34vw); }
  body.visor .logo-sub { font-size: 11px; }
  body.visor .card { padding: 12px 20px 10px; border-radius: 22px; }
  body.visor .auth { width: min(380px, 100%); max-height: calc(100dvh - 24px - var(--st) - var(--sb)); overflow-y: auto; gap: 0; }
  body.visor .auth .card-kicker { display: none; }
  body.visor .auth label { margin: 4px 0 3px 14px; font-size: 10px; }
  body.visor .auth input { padding: 7px 14px; font-size: 15px; border-radius: 12px; }
  body.visor .auth .seg { padding: 3px; }
  body.visor .auth .seg button { padding: 6px 8px; font-size: 13px; }
  body.visor .auth .err { min-height: 16px; margin-top: 3px; }
  body.visor .auth .tbtn { margin-top: 8px; min-height: 40px; font-size: 14.5px; }
  body.visor .auth .linkbtn { margin-top: 2px; padding: 4px 2px; font-size: 12px; }
  body.visor .au-note { font-size: 10px; }
  body.visor .acct { position: absolute; left: calc(28px + var(--sl)); top: calc(14px + var(--st)); }
  body.visor #title-ver { right: auto; left: calc(30px + var(--sl)); bottom: calc(16px + var(--sb)); }
  body.visor .title-menu { gap: 8px; }
  body.visor .tbtn { width: min(340px, 100%); padding: 11px 50px 11px 20px; font-size: 15px; border-radius: 18px; }
  body.visor .title-foot { margin-top: 6px; max-width: 360px; font-size: 11px; line-height: 1.5; }
  body.visor #title.creating .title-top, body.visor #title.selecting .title-top { display: none; }
  body.visor #title.creating .title-inner, body.visor #title.selecting .title-inner { justify-content: center; padding-left: calc(16px + var(--sl)); padding-right: calc(16px + var(--sr)); }
  body.visor .create { width: min(760px, 100%); padding: 10px; gap: 12px; max-height: calc(100dvh - 20px - var(--st) - var(--sb)); }
  body.visor .cr-left { width: 200px; padding: 12px 14px 10px; border-radius: 16px; }
  body.visor .cr-left canvas { width: 150px; height: 176px; }
  body.visor .cr-right { padding: 4px 8px 4px 2px; }
  body.visor .cr-right label { margin-top: 6px; }
  body.visor .cr-btns { padding: 10px 0 4px; margin-bottom: -4px; bottom: -4px; }
}

@media (prefers-reduced-motion: reduce) {
  body.visor #title-ver::before { animation: none; }
  body.visor .tbtn, body.visor .tbtn::after, body.visor .seg button { transition: none; }
}

/* ---------- มือถือแนวตั้ง: กรอบเป้าหมายลงใต้มินิแมพ (แทนที่เควสต์ชั่วคราวขณะล็อกเป้า) ---------- */
@media (max-width: 760px) and (orientation: portrait) {
  body.visor #target { left: auto; right: calc(var(--gap) + var(--sr) + 44px); top: calc(178px + var(--st)); transform: none; width: min(54vw, 206px);
    padding: 5px 12px 7px 5px; border-radius: 24px; background: rgba(10, 16, 26, 0.55); border: 1px solid var(--edge-2);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.8); }
  body.visor #target.boss { width: min(58vw, 226px); background: rgba(40, 26, 8, 0.6); }
  body.visor #hud:has(#target:not([hidden])) #quest-track { display: none; }
  body.visor .pad-mode #chat, body.visor.pad-mode #chat { top: calc(238px + var(--st)); }
}

/* ---------- บัฟ: แคปซูลกระจกใต้กรอบตัวละคร (ไอคอนสกิล + ชื่อ + เวลาเหลือ) ---------- */
body.visor #buffs { top: calc(162px + var(--st)); gap: 6px; max-width: 300px; pointer-events: auto; }
body.visor .buff .bf-n { display: none; }
body.visor #hud:has(#buffs .buff) #quest-track { top: calc(198px + var(--st)); }
body.visor .buff { clip-path: none; width: auto; height: 28px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px 0 2px; border-radius: var(--rad-pill, 4px);
  background: rgba(10, 16, 26, 0.62); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
body.visor .buff .bf-ic { width: 24px; height: 24px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex: none;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--c) 70%, #fff 10%), color-mix(in srgb, var(--c) 60%, #000 40%)); box-shadow: 0 0 10px -2px var(--c); }
body.visor .buff .bf-ic img { width: 24px; height: 24px; object-fit: cover; }
body.visor .buff .bf-ic b { font-size: 12px; line-height: 1; color: #fff; }
body.visor .buff .bf-n { font: 500 11.5px var(--font); color: var(--ink); white-space: nowrap; }
body.visor .buff i { position: static; font: 500 11px var(--mono); font-style: normal; color: var(--ink-dim); text-shadow: none; font-variant-numeric: tabular-nums; }
body.visor .buff.ending { animation: bfEnd 0.9s ease-in-out infinite; }
body.visor .buff.ending i { color: #ffb48a; }
body.visor .buff.debuff { border-color: rgba(190, 120, 255, 0.6); }
@keyframes bfEnd { 50% { opacity: 0.55; } }
@media (max-width: 760px) {
  body.visor .buff { padding-right: 8px; }
}
@media (max-width: 760px) and (orientation: portrait) {
  body.visor #buffs { top: calc(222px + var(--st)); max-width: calc(100vw - 24px); }
  body.visor.pad-mode #hud:has(#buffs .buff) #chat { top: calc(262px + var(--st)); }
  body.visor #hud:has(#buffs .buff) #quest-track { top: calc(146px + var(--st)); }
}
@media (max-height: 520px) and (orientation: landscape) {
  body.visor #buffs { top: calc(118px + var(--st)); }
  body.visor .buff { height: 24px; padding-right: 7px; } body.visor .buff .bf-ic, body.visor .buff .bf-ic img { width: 20px; height: 20px; }
}
@media (prefers-reduced-motion: reduce) { body.visor .buff.ending { animation: none; } }

/* ---------- เมนูขวา: ไม่ล้นจอเตี้ย • บนมือถือเป็นแผงกระจกทึบที่ไม่ทับเควสต์ ---------- */
body.visor:not(.pad-mode) #menubar:not(.folded) { max-height: calc(100dvh - 232px - var(--st) - var(--sb) - 12px); overflow-y: auto; overflow-x: hidden; scrollbar-width: none; flex-wrap: nowrap; }
body.visor:not(.pad-mode) #menubar::-webkit-scrollbar { display: none; }
body.visor:not(.pad-mode) #menubar > button { flex-shrink: 0; }
@media (max-height: 760px) {
  body.visor:not(.pad-mode) #menubar { gap: 2px; }
  body.visor:not(.pad-mode) #menubar button:not(.menu-fold) { height: 40px; }
}
body.visor.pad-mode #menubar:not(.folded) { padding: 6px; width: calc(44px * 5 + 5px * 4 + 14px); border-radius: 22px; background: rgba(10, 16, 26, 0.86);
  border: 1px solid var(--edge-2); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
body.visor.pad-mode #menubar:not(.folded) button { filter: none; }
body.visor.pad-mode #hud:has(#menubar:not(.folded)) #quest-track { visibility: hidden; }

/* ---------- เรื่องราว: บทนำ (บทที่ 0) โทน Visor Soft ---------- */
body.visor #prologue { background: #04060f; }
body.visor .pl-line { font-family: var(--display); color: var(--ink); }
body.visor .pl-line.pl-final { color: #f8fbff; }
body.visor .pl-kicker, body.visor .pl-hint { font-family: var(--mono); }
body.visor .pl-kicker span { font-family: var(--font); color: var(--ink-dim); }
body.visor .pl-skip { background: rgba(10, 16, 26, 0.55); border-color: var(--edge-2); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
body.visor .pl-skip:hover { background: rgba(111, 243, 255, 0.12); border-color: rgba(111, 243, 255, 0.5); }
body.visor .mb-story { font-family: var(--font); }
body.visor .q-chapter { font-family: var(--mono); }

/* =====================================================================
   ปาร์ตี้ — "Visor Soft"
   แถบสมาชิก: การ์ดกระจกฝ้ามุมโค้งใต้เควสต์ (มือถือ: ขวาใต้มินิแมพ) • ชื่อ + หลอด HP/SP บาง ๆ
   หน้าต่าง Y: แถวสมาชิกมุมโค้ง ปุ่มแคปซูล • โทสต์คำเชิญ: กระจกฝ้า + แถบนับถอยหลัง
   สีประจำปาร์ตี้ = เขียวฟ้า (--pty) ตรงกับป้ายชื่อเพื่อนร่วมปาร์ตี้ในฉาก
   ===================================================================== */
body.visor { --pty: #3dffc8; }
body.visor #party-hud { top: calc(242px + var(--st)); width: 212px; padding: 5px; gap: 1px; border: 1px solid var(--edge); border-left-width: 1px; border-radius: 18px;
  background: linear-gradient(160deg, rgba(14, 22, 36, 0.6), rgba(8, 12, 20, 0.42)); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.06); text-shadow: var(--sh); }
body.visor #hud:has(#buffs .buff) #party-hud { top: calc(280px + var(--st)); }
body.visor #hud:has(#quest-track[hidden]) #party-hud { top: calc(164px + var(--st)); }
body.visor #hud:has(#buffs .buff):has(#quest-track[hidden]) #party-hud { top: calc(202px + var(--st)); }
body.visor .ph-head { padding: 3px 8px 4px; border-radius: 12px; }
body.visor .ph-head:hover { background: rgba(255, 255, 255, 0.05); }
body.visor .ph-k { font: 500 10px var(--mono); letter-spacing: 0.2em; color: var(--pty); }
body.visor .ph-name { font: 500 12px var(--display); color: var(--ink-dim); }
body.visor .ph-n { font: 500 10.5px var(--mono); color: var(--ink-faint); }
body.visor #party-hud.folded { width: auto; max-width: 212px; padding: 3px; }
body.visor .ph-row { padding: 5px 8px 6px; border-radius: 12px; transition: background 0.15s; }
body.visor .ph-row:hover { background: rgba(61, 255, 200, 0.08); }
body.visor .ph-top b { font: 500 13px var(--display); color: var(--ink); }
body.visor .ph-top small { font: 500 10.5px var(--mono); color: var(--ink-dim); }
body.visor .ph-bars { gap: 2px; }
body.visor .ph-bars i { height: 3px; background: rgba(255, 255, 255, 0.16); box-shadow: none; }
body.visor .ph-bars i.sp { height: 2px; }
body.visor .ph-bars b { background: #6ff0a0; box-shadow: 0 0 6px -1px rgba(111, 240, 160, 0.7); }
body.visor .ph-bars i.low b { background: var(--hp-a); box-shadow: 0 0 6px -1px var(--hp-a); }
body.visor .ph-bars i.sp b { background: var(--cy); box-shadow: none; }
body.visor .ph-row.off .ph-top b { color: var(--ink-dim); }
body.visor .ph-row.off .ph-top small { color: #c6b0ff; }
body.visor .ph-add { border: 1px dashed rgba(61, 255, 200, 0.35); margin-top: 2px; }
body.visor .ph-add .ph-top { color: var(--pty); } body.visor .ph-add .ph-top b { font: 500 12px var(--font); color: #c8fff0; }
@media (max-width: 760px) {
  body.visor #party-hud, body.visor #hud:has(#buffs .buff) #party-hud, body.visor #hud:has(#quest-track[hidden]) #party-hud,
  body.visor #hud:has(#buffs .buff):has(#quest-track[hidden]) #party-hud { top: calc(236px + var(--st)); }
  body.visor #party-hud { width: 140px; padding: 4px; border-radius: 16px; }
  body.visor #party-hud.folded { width: auto; }
  body.visor .ph-head { padding: 2px 6px 3px; }
  body.visor .ph-name { display: none; }
  body.visor .ph-n { margin-left: auto; }
  body.visor .ph-row { padding: 4px 6px 5px; border-radius: 10px; }
  body.visor .ph-top b { font-size: 12px; }
  body.visor.pad-mode #hud:has(#party-hud:not([hidden])) #chat { width: min(58vw, 236px); }
}
@media (max-height: 520px) and (orientation: landscape) {
  body.visor #party-hud, body.visor #hud:has(#buffs .buff) #party-hud, body.visor #hud:has(#quest-track[hidden]) #party-hud,
  body.visor #hud:has(#buffs .buff):has(#quest-track[hidden]) #party-hud { top: calc(112px + var(--st)); }
  body.visor #party-hud { width: 132px; padding: 3px; border-radius: 14px; }
  body.visor #party-hud[data-n="3"], body.visor #party-hud[data-n="4"] { width: 256px; }
  body.visor #party-hud[data-n="5"] { width: 378px; }
  body.visor #party-hud.folded { width: auto; }
  body.visor .ph-name { display: none; }
  body.visor .ph-n { margin-left: auto; }
  body.visor .ph-head { padding: 1px 6px 2px; }
  body.visor .ph-row { padding: 2px 6px 3px; border-radius: 9px; }
  body.visor .ph-top b { font-size: 11.5px; }
}

/* หน้าต่างปาร์ตี้ */
body.visor .py-hero { color: var(--pty); }
body.visor .py-empty > b { font: 600 16px var(--display); }
body.visor .py-create { gap: 8px; }
body.visor .py-create input { border-radius: var(--rad-pill, 4px); padding: 8px 14px; background: var(--fill); border: 1px solid var(--edge-2); font: 13px var(--font);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s; }
body.visor .py-create input:focus { background: rgba(111, 243, 255, 0.07); border-color: rgba(111, 243, 255, 0.6); box-shadow: var(--glow-soft); }
body.visor .btn.py-go { padding: 8px 16px; color: #04121f; font-weight: 600; background: linear-gradient(180deg, #8ff6ff, #62e6f6); border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 24px -10px rgba(111, 243, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.55); }
body.visor .btn.py-go:hover { background: linear-gradient(180deg, #a9f9ff, #78ecf9); color: #04121f; }
body.visor .py-sec { margin: 16px 4px 7px; }
body.visor .py-sec span { font: 600 12.5px var(--display); letter-spacing: 0.01em; color: var(--cy); }
body.visor .py-sec small { font: 500 11px var(--font); color: var(--ink-faint); }
body.visor .py-nrow, body.visor .py-row { background: var(--fill); border: 1px solid var(--edge); border-radius: 14px; }
body.visor .py-nrow { padding: 6px 8px 6px 7px; }
body.visor .py-row { padding: 8px 10px 8px 9px; align-items: center; }
body.visor .py-row.me { border-color: rgba(111, 243, 255, 0.32); box-shadow: inset 0 0 0 1px rgba(111, 243, 255, 0.08), 0 0 22px -12px rgba(111, 243, 255, 0.6); }
body.visor .py-mid > b, body.visor .py-n b { font: 600 13.5px var(--display); }
body.visor .py-mid > small, body.visor .py-s { font: 500 11px var(--mono); color: var(--ink-dim); }
body.visor .py-n em { font: 600 9.5px var(--mono); color: var(--cy); background: rgba(111, 243, 255, 0.12); border: 1px solid rgba(111, 243, 255, 0.3); }
body.visor .py-lead { font: 600 9.5px var(--mono); color: var(--exp); background: rgba(255, 224, 138, 0.1); border: 1px solid rgba(255, 224, 138, 0.3); }
body.visor .py-av .py-crown { color: var(--exp); background: #0b111c; box-shadow: 0 0 0 1px rgba(255, 224, 138, 0.55), 0 0 10px -2px rgba(255, 224, 138, 0.6); }
body.visor .py-av .py-crown svg { fill: rgba(255, 224, 138, 0.45); }
body.visor .py-bar i { height: 4px; background: rgba(255, 255, 255, 0.12); }
body.visor .py-bar.sp i { height: 3px; }
body.visor .py-bar b { background: #6ff0a0; }
body.visor .py-bar.low b { background: var(--hp-a); }
body.visor .py-bar.sp b { background: var(--cy); }
body.visor .py-bar em { font: 500 10px var(--mono); color: var(--ink-faint); }
body.visor .py-head { padding: 2px 4px 0; }
body.visor .py-count { font: 500 13px var(--mono); color: var(--ink-faint); }
body.visor .py-count b { font: 600 26px/1 var(--display); color: var(--ink); margin-right: 1px; }
body.visor .py-share b { font: 600 12.5px var(--display); color: var(--pty); }
body.visor .py-share small { font: 500 11px var(--font); color: var(--ink-dim); }
body.visor .btn.py-inv { padding: 5px 14px; color: #c8fff0; background: rgba(61, 255, 200, 0.1); border-color: rgba(61, 255, 200, 0.45); }
body.visor .btn.py-inv:hover:not(:disabled) { background: rgba(61, 255, 200, 0.2); border-color: var(--pty); box-shadow: 0 0 18px -6px rgba(61, 255, 200, 0.6); color: #fff; }
body.visor .btn.py-inv.wait { color: var(--ink-dim); background: var(--fill); border-color: var(--edge-2); border-style: dashed; opacity: 0.8; }
body.visor .btn.py-kick { padding: 4px 11px; }
body.visor .py-none { font: 500 12px/1.55 var(--font); color: var(--ink-faint); padding: 10px 6px 4px; }
body.visor .py-foot { border-top-color: var(--edge); }
body.visor .py-foot .hint { font: 500 11px var(--font); color: var(--ink-faint); }
body.visor .btn.py-leave { padding: 7px 16px; }

/* โทสต์คำเชิญ */
body.visor #party-invite { border-radius: 22px; padding: 12px 14px 15px 12px; border: 1px solid rgba(61, 255, 200, 0.4);
  background: linear-gradient(160deg, rgba(16, 28, 36, 0.86), rgba(8, 12, 20, 0.82)); -webkit-backdrop-filter: blur(20px) saturate(1.3); backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.9), 0 0 60px -24px rgba(61, 255, 200, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
body.visor .pinv-ic { color: var(--pty); }
body.visor .pinv-t { font: 500 13.5px/1.45 var(--font); }
body.visor .pinv-t small { font: 600 11.5px var(--display); color: var(--pty); }
body.visor .pinv-t .pinv-pn { color: #c8fff0; }
body.visor .pinv-btns .btn { border-radius: var(--rad-pill, 4px); padding: 8px 16px; font-weight: 600; }
body.visor .pinv-yes { background: linear-gradient(180deg, #9dffe6, #4fe3bd) !important; box-shadow: 0 10px 24px -10px rgba(61, 255, 200, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
body.visor .pinv-yes:hover { background: linear-gradient(180deg, #b8fff0, #6aedcb) !important; }
body.visor .pinv-bar { left: 22px; right: 22px; bottom: 6px; }
body.visor .pinv-bar b { background: var(--pty); box-shadow: 0 0 6px var(--pty); }
@media (max-width: 760px) { body.visor .pinv-btns .btn { padding: 10px 16px; } }
@media (prefers-reduced-motion: reduce) { #party-invite { animation: none; } }

/* =====================================================================
   แลกเปลี่ยน (Trade) — js/trade.js
   โครงสร้างใช้ได้ทั้ง HUD Visor/คลาสสิก (ผูกกับ #w-trade) • ผิวนุ่มกระจกฝ้าเฉพาะ body.visor
   ===================================================================== */
@media (min-width: 761px) and (min-height: 521px) { #w-trade.tr-wide { width: min(600px, calc(100vw - 24px)) !important; } }
#w-trade button { font: inherit; }
#w-trade .tr-list, #w-trade .tr-trade, #w-trade .tr-pick { display: flex; flex-direction: column; gap: 8px; }
#w-trade .tr-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--ink-dim); }
#w-trade .tr-sec small { font: 500 10.5px var(--mono); color: var(--ink-faint); }
#w-trade .tr-none { padding: 14px 10px; text-align: center; font-size: 12px; color: var(--ink-dim); }
#w-trade .tr-prow { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 7px; }
#w-trade .tr-prow.far { opacity: 0.62; }
#w-trade .tr-av { flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
#w-trade .tr-av.big { width: 52px; height: 52px; font-size: 22px; }
#w-trade .tr-pn { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
#w-trade .tr-pn b, #w-trade .tr-col-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#w-trade .tr-pn small { font-size: 11px; color: var(--ink-dim); }
#w-trade .tr-wait { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 6px 2px; text-align: center; }
#w-trade .tr-wait-t { font-size: 14px; line-height: 1.45; }
#w-trade .tr-sub { font: 500 11.5px var(--mono); color: var(--ink-dim); }
#w-trade .tr-ring { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 2px; }
#w-trade .tr-btns { display: flex; gap: 8px; justify-content: center; margin-top: 4px; }
#w-trade .tr-btns .btn { min-width: 104px; min-height: 38px; }
#w-trade .tr-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px 8px; text-align: center; }
#w-trade .tr-empty b { font-size: 15px; }
#w-trade .tr-empty p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-dim); max-width: 280px; }
#w-trade .tr-empty-ic { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 4px; }
#w-trade .tr-empty-ic svg { width: 34px; height: 34px; }
#w-trade .tr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 22px; }
#w-trade .tr-step { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.35; color: var(--ink-dim); }
#w-trade .tr-timer { flex: none; font: 600 11px/1.5 var(--mono); }
#w-trade .tr-bar { height: 0; margin: -4px 0 0; border-radius: 3px; overflow: hidden; transition: height 0.2s; }
#w-trade .tr-bar.on { height: 3px; }
#w-trade .tr-bar i { display: block; height: 100%; width: 0; border-radius: inherit; }
#w-trade .tr-bar.full i { width: 100%; }
#w-trade .tr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#w-trade .tr-col { min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px; }
#w-trade .tr-col-h { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
#w-trade .tr-col-t { min-width: 0; font-weight: 600; }
#w-trade .tr-st { flex: none; font: 600 10px/1.6 var(--mono); padding: 0 8px; white-space: nowrap; }
#w-trade .tr-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
#w-trade .tr-slot, #w-trade .tr-icell { padding: 0; min-width: 0; color: inherit; }
#w-trade .tr-slot img, #w-trade .tr-icell img { width: 74%; height: 74%; }
#w-trade .tr-holes { position: absolute; left: 0; right: 0; bottom: 3px; display: flex; justify-content: center; gap: 2px; pointer-events: none; }
#w-trade .tr-holes i { width: 4px; height: 4px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); }
#w-trade .tr-holes i.on { background: var(--cy); box-shadow: 0 0 4px var(--cy); }
#w-trade .tr-volt { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 5px 12px; }
#w-trade .tr-vi { flex: none; display: inline-flex; }
#w-trade .tr-vi svg { width: 13px; height: 13px; fill: var(--exp); stroke: none; }
#w-trade .tr-volt input, #w-trade .tr-volt b { flex: 1; min-width: 0; width: 100%; font: 600 13px/1.4 var(--mono); color: var(--exp); }
#w-trade .tr-volt small { flex: none; font: 500 10.5px var(--mono); color: var(--ink-faint); white-space: nowrap; }
#w-trade .tr-detail { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
#w-trade .tr-detail > img { flex: none; width: 34px; height: 34px; }
#w-trade .tr-dt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
#w-trade .tr-dt small { font-size: 11px; color: var(--ink-dim); }
#w-trade .tr-inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 5px; max-height: 144px; overflow-y: auto; padding: 2px; scrollbar-width: thin; }
#w-trade .tr-icell.used { opacity: 0.28; cursor: default; }
#w-trade .tr-qty { display: flex; align-items: center; gap: 8px; padding: 7px 10px; }
#w-trade .tr-qty > img { flex: none; width: 26px; height: 26px; }
#w-trade .tr-qty-n { flex: 1 1 0; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#w-trade .tr-step-btns { display: flex; align-items: center; gap: 4px; }
#w-trade .tr-step-btns .btn { min-width: 30px; }
#w-trade .tr-qn { width: 62px; text-align: center; }
#w-trade .tr-acts { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
#w-trade .tr-acts .btn { min-height: 38px; }
#w-trade .btn:disabled { cursor: default; }
#w-trade .hint { margin-top: 2px; }
@media (max-width: 520px) {
  #w-trade .tr-cols { gap: 6px; }
  #w-trade .tr-col { padding: 8px 6px; gap: 7px; }
  #w-trade .tr-slots { gap: 3px; }
  #w-trade .tr-st { padding: 0 6px; }
  #w-trade .tr-volt { padding: 4px 9px; }
  #w-trade .tr-volt small { display: none; }
  #w-trade .tr-acts .btn { min-height: 42px; }
  #w-trade .tr-qty { gap: 6px; padding: 6px 8px; }
  #w-trade .tr-qn { width: 46px; }
  #w-trade .tr-step-btns { gap: 3px; }
  #w-trade .tr-step-btns .btn, #w-trade .tr-add { padding-left: 9px; padding-right: 9px; }
}

body.visor #w-trade .tr-prow, body.visor #w-trade .tr-col, body.visor #w-trade .tr-detail, body.visor #w-trade .tr-qty { background: var(--fill); border: 1px solid var(--edge); }
body.visor #w-trade .tr-prow { border-radius: 14px; transition: border-color 0.15s, background 0.15s; }
body.visor #w-trade .tr-prow:not(.far):hover { border-color: rgba(111, 243, 255, 0.35); background: rgba(111, 243, 255, 0.06); }
body.visor #w-trade .tr-col { border-radius: 18px; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; }
body.visor #w-trade .tr-detail, body.visor #w-trade .tr-qty { border-radius: 14px; }
body.visor #w-trade .tr-av { color: var(--cy); font-family: var(--display); background: radial-gradient(circle at 35% 30%, rgba(111, 243, 255, 0.32), rgba(111, 243, 255, 0.06)); border: 1px solid rgba(111, 243, 255, 0.32); }
body.visor #w-trade .tr-ring { border: 1px solid rgba(111, 243, 255, 0.28); box-shadow: 0 0 0 7px rgba(111, 243, 255, 0.05), 0 0 36px -10px rgba(111, 243, 255, 0.6); animation: tr-pulse 1.8s ease-in-out infinite; }
body.visor #w-trade .tr-ring.in { border-color: rgba(255, 224, 138, 0.4); box-shadow: 0 0 0 7px rgba(255, 224, 138, 0.05), 0 0 36px -10px rgba(255, 224, 138, 0.6); animation-name: tr-pulse-in; }
@keyframes tr-pulse { 50% { box-shadow: 0 0 0 13px rgba(111, 243, 255, 0), 0 0 46px -8px rgba(111, 243, 255, 0.75); } }
@keyframes tr-pulse-in { 50% { box-shadow: 0 0 0 13px rgba(255, 224, 138, 0), 0 0 46px -8px rgba(255, 224, 138, 0.75); } }
body.visor #w-trade .tr-empty-ic { color: var(--cy); background: rgba(111, 243, 255, 0.08); border: 1px solid rgba(111, 243, 255, 0.22); box-shadow: 0 0 36px -12px rgba(111, 243, 255, 0.6); }
body.visor #w-trade .tr-note { padding: 8px 12px; border-radius: 14px; background: rgba(255, 107, 125, 0.1); border: 1px solid rgba(255, 107, 125, 0.3); color: #ffc2c9; font-size: 12.5px; }
body.visor #w-trade .tr-timer { padding: 1px 9px; border-radius: var(--rad-pill, 4px); color: var(--ink-dim); background: var(--fill); border: 1px solid var(--edge); }
body.visor #w-trade .tr-timer.warn { color: #ffb3bb; border-color: rgba(255, 107, 125, 0.45); background: rgba(255, 107, 125, 0.08); }
body.visor #w-trade .tr-wait .tr-timer { background: none; border: 0; padding: 0; }
body.visor #w-trade .tr-count { color: var(--cy); font-weight: 600; text-shadow: 0 0 12px rgba(111, 243, 255, 0.5); }
body.visor #w-trade .tr-bar { background: rgba(255, 255, 255, 0.07); }
body.visor #w-trade .tr-bar i { background: linear-gradient(90deg, var(--cy), #8ff0b4); box-shadow: 0 0 10px rgba(111, 243, 255, 0.8); }
/* สถานะของแต่ละฝั่ง: กำลังเลือก (จาง) → ล็อก (ฟ้า) → ตกลง (เขียว) */
body.visor #w-trade .tr-st { border-radius: var(--rad-pill, 4px); color: var(--ink-faint); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--edge); }
body.visor #w-trade .tr-col.lock { border-color: rgba(111, 243, 255, 0.42); background: rgba(111, 243, 255, 0.055); box-shadow: 0 0 30px -14px rgba(111, 243, 255, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
body.visor #w-trade .tr-col.lock .tr-st { color: var(--cy); border-color: rgba(111, 243, 255, 0.45); background: rgba(111, 243, 255, 0.12); }
body.visor #w-trade .tr-col.ok { border-color: rgba(126, 240, 170, 0.48); background: rgba(126, 240, 170, 0.055); box-shadow: 0 0 30px -14px rgba(126, 240, 170, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
body.visor #w-trade .tr-col.ok .tr-st { color: #8ff0b4; border-color: rgba(126, 240, 170, 0.5); background: rgba(126, 240, 170, 0.12); }
body.visor #w-trade .tr-col.their .tr-col-t { color: var(--ink-dim); }
body.visor #w-trade .tr-slot { border-radius: 11px; }
body.visor #w-trade .tr-slot.empty { background: rgba(255, 255, 255, 0.025); border-color: rgba(255, 255, 255, 0.05); }
body.visor #w-trade .tr-icell.used:hover { border-color: var(--edge); background: var(--fill); }
body.visor #w-trade .tr-volt { border-radius: var(--rad-pill, 4px); background: rgba(255, 224, 138, 0.06); border: 1px solid rgba(255, 224, 138, 0.18); transition: border-color 0.15s, box-shadow 0.15s; }
body.visor #w-trade .tr-volt.edit:hover { border-color: rgba(255, 224, 138, 0.35); }
body.visor #w-trade .tr-volt.edit:focus-within { border-color: rgba(255, 224, 138, 0.6); box-shadow: 0 0 0 3px rgba(255, 224, 138, 0.1), 0 0 22px -8px rgba(255, 224, 138, 0.6); }
body.visor #w-trade .tr-volt input { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; outline: none; -moz-appearance: textfield; appearance: textfield; }
body.visor #w-trade .tr-volt input::-webkit-inner-spin-button, body.visor #w-trade .tr-volt input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
body.visor #w-trade .tr-qn { -moz-appearance: textfield; appearance: textfield; }
body.visor #w-trade .tr-qn::-webkit-inner-spin-button, body.visor #w-trade .tr-qn::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
body.visor #w-trade .tr-primary { color: #04121f; background: linear-gradient(180deg, #8ff6ff, #62e6f6); border-color: rgba(255, 255, 255, 0.35); box-shadow: 0 10px 24px -10px rgba(111, 243, 255, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.55); font-weight: 600; }
body.visor #w-trade .tr-primary:hover { color: #04121f; background: linear-gradient(180deg, #a9f9ff, #78ecf9); }
body.visor #w-trade .btn:disabled { opacity: 0.42; box-shadow: none; }
body.visor #w-trade .btn:disabled:hover { background: var(--fill); border-color: var(--edge-2); color: var(--ink); }
body.visor #w-trade .tr-lock.on, body.visor #w-trade .tr-lock.on:hover { opacity: 1; color: var(--cy); border-color: rgba(111, 243, 255, 0.5); background: rgba(111, 243, 255, 0.12); }
body.visor #w-trade .tr-ok.on, body.visor #w-trade .tr-ok.on:hover { opacity: 1; color: #8ff0b4; border-color: rgba(126, 240, 170, 0.5); background: rgba(126, 240, 170, 0.12); }
body.visor #w-trade .sealing .tr-col { border-color: rgba(126, 240, 170, 0.55); }
@media (prefers-reduced-motion: reduce) { body.visor #w-trade .tr-ring { animation: none; } }

/* ======================================================================
   QA รอบ 1 (ทดสอบแล้วทุกขนาดจอ): แถบเล็งสกิล, วงปุ่มสกิลบนจอสัมผัส, เควสต์จอแนวนอน,
   ยาบนมือถือจอเตี้ย, กรอบตัวละครแบบพับ, เมนู 2 คอลัมน์, บทสนทนาไม่กระโดด, การ์ดล้มลงจอเตี้ย
   ====================================================================== */
/* ===== F1 skill-aim: no left:50% shrink-to-fit, one line, out of the crowded top band ===== */
#skill-aim { left: 0; right: 0; margin-inline: auto; width: max-content; max-width: min(520px, calc(100vw - 24px)); transform: none; }
#skill-aim .sa-t { white-space: nowrap !important; }
body:not(.pad-mode) #skill-aim { top: auto; bottom: calc(92px + var(--sb)); }
@media (max-width: 760px) { body:not(.pad-mode) #skill-aim { bottom: calc(150px + var(--sb)); } }
@media (orientation: portrait) { .pad-mode #skill-aim { top: calc(262px + var(--st)); bottom: auto; } }
@media (max-height: 520px) and (orientation: landscape) { .pad-mode #skill-aim, #skill-aim { top: calc(102px + var(--st)); bottom: auto; max-width: calc(100vw - 500px); } }

/* ===== F2 pad skill arc: radius 112 so the 4 big buttons stop overlapping ===== */
.pad-mode #hotbar .hb:nth-child(1) { right: calc(155px + var(--sr)); bottom: calc(43px + var(--sb)); }
.pad-mode #hotbar .hb:nth-child(2) { right: calc(140px + var(--sr)); bottom: calc(99px + var(--sb)); }
.pad-mode #hotbar .hb:nth-child(3) { right: calc(99px + var(--sr)); bottom: calc(140px + var(--sb)); }
.pad-mode #hotbar .hb:nth-child(4) { right: calc(43px + var(--sr)); bottom: calc(155px + var(--sb)); }
.pad-mode #hotbar .hb:nth-child(5) { right: calc(205px + var(--sr)); bottom: calc(112px + var(--sb)); }
.pad-mode #hotbar .hb:nth-child(6) { right: calc(176px + var(--sr)); bottom: calc(168px + var(--sb)); }
.pad-mode #hotbar .hb:nth-child(7) { right: calc(126px + var(--sr)); bottom: calc(206px + var(--sb)); }
.pad-mode #hotbar .hb:nth-child(8) { right: calc(64px + var(--sr)); bottom: calc(220px + var(--sb)); }
.pad-mode #auto-btn { bottom: calc(278px + var(--sb)); }
@media (max-width: 400px) { #joy { left: calc(70px + var(--sl)); top: calc(100% - 74px - var(--sb)); width: 100px; height: 100px; } #joy-knob { width: 44px; height: 44px; } }

/* ===== F3 landscape: quest tracker leaves the skill-arc corner -> top strip between target and menu ===== */
@media (max-height: 520px) and (orientation: landscape) {
  body.visor.pad-mode #hud #quest-track, body.visor.pad-mode #hud:has(#buffs .buff) #quest-track { top: calc(6px + var(--st)); right: calc(182px + var(--sr)); width: 136px; padding: 0; }
  .pad-mode #quest-track .qt-obj { display: none; }
  .pad-mode #auto-btn { bottom: calc(14px + var(--sb)); }
}

/* ===== F4 short portrait phones: potion column starts below buffs + chat ===== */
@media (orientation: portrait) and (max-height: 760px) {
  .pad-mode #potbar { bottom: calc(146px + var(--sb)); gap: 6px; }
  .pad-mode #potbar .hb { width: 42px; height: 42px; }
  .pad-mode #chat-btn { left: calc(66px + var(--sl)); bottom: calc(150px + var(--sb)); }
}

/* ===== F5 Visor + folded unit card ===== */
body.visor #basic-info.folded { width: min(250px, 62vw); gap: 8px; }
body.visor #basic-info.folded .bi-face { width: 52px; height: 52px; }
body.visor #basic-info.folded #bi-rings { width: 52px; height: 52px; }
body.visor #basic-info.folded .bi-face canvas { left: 8px; top: 8px; width: 36px; height: 36px; }
body.visor #basic-info.folded .bi-face em { display: none; }

/* ===== F6 long names stay inside the card ===== */
body.visor .bi-id b { max-width: 100%; }

/* ===== F7 desktop menu: 2 columns when the column would not fit ===== */
@media (max-height: 800px) {
  body.visor:not(.pad-mode) #menubar:not(.folded) { display: grid; grid-template-columns: repeat(2, 44px); gap: 4px; max-height: none; overflow: visible; justify-items: end; }
  body.visor:not(.pad-mode) #menubar:not(.folded) .menu-fold { grid-column: 1 / -1; justify-self: end; }
}

/* ===== F9 NPC dialog: pin the TOP edge (title never jumps), body scrolls ===== */
@media (min-width: 761px) and (min-height: 521px) { .win.dialog { top: clamp(12px, calc(100dvh - 640px), 140px); bottom: auto; max-height: calc(100dvh - clamp(12px, calc(100dvh - 640px), 140px) - 96px); } }
@media (max-width: 760px) { .win.dialog { height: min(500px, 60dvh); } .win.dialog .win-body { flex: 1; } }

/* ===== F10 death card on short landscape ===== */
@media (max-height: 520px) {
  body.visor .death-box { max-height: calc(100dvh - 16px); overflow-y: auto; padding: 4px 22px 12px; }
  body.visor .death-core { height: 64px; margin: 0; } body.visor .dc-glyph svg { width: 38px; height: 38px; } body.visor .dc-halo { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
  body.visor .death-t { font-size: 22px; } body.visor .death-s { margin: 2px 0 8px; }
  body.visor .death-info { margin-bottom: 10px; }
  body.visor .death-btns { flex-direction: row; } body.visor .death-btns .btn { min-height: 42px; }
  body.visor #death-hide { margin-top: 6px; }
}
@media (max-height: 520px) and (orientation: landscape) { .win.dialog { height: calc(100dvh - 12px - var(--st) - var(--sb)); } .win.dialog .win-body { flex: 1; } }

/* ===== F11 landscape top-left stack: nav pill joins the top-centre column, buffs clear the card ===== */
@media (max-height: 520px) and (orientation: landscape) {
  #nav-pill { top: calc(54px + var(--st)); left: 50%; transform: translateX(-50%); max-width: min(46vw, 360px); }
  #hud:has(#nav-pill:not([hidden])) #chat { top: calc(96px + var(--st)); }
  body.visor #buffs { top: calc(122px + var(--st)); }
  body.visor .buff { height: 22px; }
}
/* ===== F12 portrait: buffs row clears the target capsule ===== */
@media (max-width: 760px) and (orientation: portrait) { body.visor #buffs { top: calc(230px + var(--st)); } }
/* QA 14: ภาพ NPC อยู่ใต้ HUD และหน้าต่าง • ระหว่างคุย HUD จางลงให้อ่านบทพูดชัด */
#illust { z-index: 14; }
#hud:has(#w-dialog:not(.hidden)) :is(#chat, #quest-track, #buffs, #dock, #party-hud) { opacity: .2; transition: opacity .2s; }
/* QA 13: ล้มอยู่ ปุ่มโจมตี/สกิลจาง กดไม่ได้ */
#hud:has(#death-mini:not(.hidden)) :is(#pad-atk, #hotbar) { opacity: .35; pointer-events: none; }
/* QA 19: ประกาศ/ป้ายนำทางไม่หดครึ่งจอ */
#nav-pill { width: max-content; max-width: calc(100vw - 24px); }
/* QA 21: ร้านค้า — ซื้อไม่ไหวเป็นสีแดง */
.shop-p.poor { color: #ff9aa8 !important; }
/* QA 16: ปุ่มเล็กบนจอสัมผัสขยายพื้นที่กด */
@media (pointer: coarse) {
  #nav-cancel, .tg-info, .hunt-info, .pt { position: relative; } /* ปุ่มที่วางแบบ absolute/fixed อยู่แล้ว (fold, minimap, hud-toggle) ห้ามเปลี่ยน position */
  .fold-btn::after, .mm-btn::after, #hud-toggle::after, #nav-cancel::after, .tg-info::after, .hunt-info::after, .pt::after { content: ''; position: absolute; inset: -10px; }
  .opt input[type=checkbox] { width: 22px; height: 22px; }
  .st-up { min-height: 34px; } .tab { min-height: 36px; }
}

/* ===== ฉากบอสปรากฏ: การ์ดภาพครอปกลางจอ (ไม่บังเต็มจอ) ===== */
#splash.boss { background: radial-gradient(ellipse 60% 45% at 50% 46%, rgba(60,0,10,.42), transparent 70%); padding: 0 16px 10vh; }
#splash.boss.show { animation: bossFade 3.6s ease forwards; }
#splash.boss .sp-card { position: relative; width: min(640px, 100%); aspect-ratio: 16 / 7; border-radius: 24px; overflow: hidden;
  background: #12060a; box-shadow: 0 0 0 1px rgba(255,150,160,.38), 0 0 0 5px rgba(255,60,80,.08), 0 0 46px rgba(255,40,64,.38), 0 24px 60px rgba(0,0,0,.6);
  animation: bossCard 3.6s cubic-bezier(.2,.8,.2,1) forwards; }
#splash.boss.noimg .sp-card { aspect-ratio: auto; }
#splash.boss .sp-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%;
  -webkit-mask-image: none; mask-image: none; animation: bossZoom 3.6s ease-out forwards; }
#splash.boss .sp-sheen { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,220,225,.22) 50%, transparent 65%); transform: translateX(-120%); animation: bossSheen 1.4s .35s ease-out forwards; }
#splash.boss .sp-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; margin: 0; padding: 30px 22px 16px; text-align: center;
  background: linear-gradient(180deg, transparent, rgba(24,0,6,.62) 40%, rgba(16,0,4,.9)); }
#splash.boss.noimg .sp-text { position: relative; padding: 18px 22px; }
#splash.boss .sp-text small { color: #ffb8c0; font-size: 12px; letter-spacing: .2em; }
#splash.boss .sp-text b { font-size: clamp(22px, 4.6vw, 38px); text-shadow: 0 0 18px rgba(255,48,72,.85), 0 2px 6px rgba(0,0,0,.7); }
@keyframes bossFade { 0% { opacity: 0; } 8% { opacity: 1; } 84% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bossCard { 0% { transform: translateY(14px) scale(.92); } 12% { transform: none; } 84% { transform: none; } 100% { transform: translateY(-8px) scale(.98); } }
@keyframes bossZoom { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes bossSheen { to { transform: translateX(120%); } }
@media (max-height: 520px) and (orientation: landscape) { #splash.boss .sp-card { width: min(520px, 100%); } #splash.boss { padding-bottom: 4vh; } }
.bot-row.off { opacity: .45; }
#w-options .bot-row { margin: 2px 0 6px; }

/* ===== เมนู (Tab) บนคอม: แผงกระจก 3 คอลัมน์ ไม่เป็นแถวตรงยาว อ่านง่ายทุกความสูงจอ ===== */
body.visor:not(.pad-mode) #menubar:not(.folded) { display: grid; grid-template-columns: repeat(3, 52px); gap: 4px; padding: 6px; max-height: none; overflow: visible;
  justify-items: stretch; border-radius: 20px; background: rgba(10, 16, 26, 0.62); border: 1px solid var(--edge-2);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.06); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
body.visor:not(.pad-mode) #menubar:not(.folded) .menu-fold { grid-column: 1 / -1; justify-self: end; width: 44px; height: 28px; }
body.visor:not(.pad-mode) #menubar:not(.folded) button:not(.menu-fold) { width: 52px; height: 48px; filter: none; }
body.visor:not(.pad-mode) #menubar:not(.folded) button span { font-size: 10px; }

/* ===== การ์ดข้อมูลไอเทม (เอาเมาส์ชี้) ===== */
#item-tip { position: fixed; z-index: 5000; pointer-events: none; width: max-content; max-width: 280px; padding: 10px 12px; border-radius: 16px;
  background: rgba(10, 16, 26, 0.93); border: 1px solid var(--edge-2, rgba(160,220,255,.25)); color: #e6eef8; font-size: 12px; line-height: 1.45;
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.06); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
#item-tip .tip-head { display: flex; gap: 9px; align-items: center; margin-bottom: 6px; }
#item-tip .tip-head img { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); image-rendering: auto; }
#item-tip .tip-head b { display: block; font-size: 13.5px; color: #fff; }
#item-tip .tip-head small { color: #8fd8ff; font-size: 11px; }
#item-tip .tip-desc { color: #b8c4d4; margin-bottom: 5px; }
#item-tip .tip-line { color: #d8e2ee; }
#item-tip .tip-bon { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px; }
#item-tip .tip-bon span { padding: 2px 8px; border-radius: var(--rad-pill, 4px); background: rgba(111, 243, 255, 0.12); color: #8ff4ff; font-size: 11px; }
#item-tip .cmp-row { margin-top: 7px; padding-top: 7px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
/* ป้าย World Boss ใต้มินิแมพ: เลื่อนเมนูลงไม่ให้ทับ */
body:not(.pad-mode) #hud:has(#mm-wb:not([hidden])) #menubar { top: calc(258px + var(--st)); }

/* ===== ปุ่มสลับภาษา (หน้าแรก) ===== */
#lang-pill { position: fixed; z-index: 9500; top: calc(12px + env(safe-area-inset-top, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); display: flex; gap: 2px; padding: 3px;
  border-radius: var(--rad-pill, 4px); background: rgba(10, 16, 26, 0.7); border: 1px solid rgba(160, 220, 255, 0.25); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
#lang-pill[hidden] { display: none; }
#lang-pill button { border: 0; background: transparent; color: #b8c8dc; font: 600 12px/1 system-ui, sans-serif; padding: 7px 12px; border-radius: var(--rad-pill, 4px); cursor: pointer; min-height: 30px; }
#lang-pill button.on { background: rgba(111, 243, 255, 0.18); color: #8ff4ff; }

/* ===== คู่มืออาชีพ (Class Guide) ===== */
#w-classbook { max-width: calc(100vw - 24px); }
#w-classbook .win-body { padding: 0; overflow: hidden; display: flex; }
.cb-wrap { display: grid; grid-template-columns: 196px 1fr; width: 100%; height: min(620px, calc(100dvh - 140px)); min-height: 0; }
.cb-toc { overflow-y: auto; padding: 10px 8px 14px; border-right: 1px solid rgba(255, 255, 255, 0.07); background: rgba(0, 0, 0, 0.18); display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.cb-th { font: 700 12px/1 var(--display, system-ui); letter-spacing: .14em; text-transform: uppercase; color: #8ff4ff; padding: 4px 8px 8px; }
.cb-tg { font-size: 10.5px; color: #8a9ab0; padding: 8px 8px 3px; letter-spacing: .04em; }
.cb-ti { display: flex; align-items: center; gap: 7px; width: 100%; text-align: left; border: 0; background: transparent; color: #d6e0ec; font-size: 12.5px; padding: 6px 8px; border-radius: 10px; cursor: pointer; min-height: 30px; }
.cb-ti i { width: 8px; height: 8px; border-radius: 50%; background: var(--g); box-shadow: 0 0 8px var(--g); flex: none; }
.cb-ti.l2 { padding-left: 24px; font-size: 12px; color: #b8c6d6; }
.cb-ti.l2 i { width: 6px; height: 6px; }
.cb-ti.l2::before { content: '└'; color: #4a5a6e; margin-left: -12px; margin-right: -2px; }
.cb-ti span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-ti em { font-style: normal; font-size: 9.5px; color: #0a1018; background: #8ff4ff; padding: 1px 6px; border-radius: var(--rad-pill, 4px); }
.cb-ti:hover { background: rgba(255, 255, 255, 0.06); }
.cb-ti.on { background: rgba(111, 243, 255, 0.14); color: #fff; box-shadow: inset 0 0 0 1px rgba(111, 243, 255, 0.3); }
.cb-det { overflow-y: auto; padding: 0 18px 18px; min-height: 0; min-width: 0; }
.cb-hero { position: relative; display: flex; align-items: flex-end; gap: 14px; margin: 0 -18px 4px; padding: 18px 18px 14px; min-height: 140px; overflow: hidden;
  background: radial-gradient(ellipse at 20% 0%, color-mix(in srgb, var(--g) 30%, transparent), transparent 70%), linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent); border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.cb-art { position: absolute; right: 8px; bottom: -40px; height: 230px; width: auto; opacity: .55; pointer-events: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%); mask-image: linear-gradient(90deg, transparent, #000 40%); }
.cb-hd { position: relative; min-width: 0; }
.cb-hd small { color: #8fd8ff; font-size: 11px; letter-spacing: .06em; }
.cb-hd h3 { margin: 2px 0 0; font: 700 24px/1.15 var(--display, system-ui); color: #fff; text-shadow: 0 0 18px var(--g); display: flex; align-items: center; gap: 8px; text-wrap: balance; }
.cb-hd h3 img { width: 28px; height: 28px; }
.cb-thai { color: #c8d4e2; font-size: 13px; margin-top: 2px; }
.cb-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.cb-chips span { font-size: 11px; padding: 3px 9px; border-radius: var(--rad-pill, 4px); background: rgba(10, 16, 26, 0.6); border: 1px solid rgba(255, 255, 255, 0.1); color: #dfe8f2; }
.cb-desc { color: #c4d0de; font-size: 13px; line-height: 1.55; margin: 10px 0 2px; }
.cb-sec { margin-top: 14px; }
.cb-sec h4 { margin: 0 0 6px; font: 700 11.5px/1 var(--display, system-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--g); }
.cb-sec p { margin: 0; color: #d0dae6; font-size: 12.5px; line-height: 1.55; }
.cb-note { color: #9fb0c4 !important; font-size: 11.5px !important; margin-bottom: 6px !important; }
.cb-pc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.cb-pc > div { padding: 8px 10px; border-radius: 12px; font-size: 12px; color: #d6e0ea; line-height: 1.45; }
.cb-pc b { display: block; font-size: 11px; margin-bottom: 2px; }
.cb-pc .pro { background: rgba(80, 200, 120, 0.1); } .cb-pc .pro b { color: #8ff0b0; }
.cb-pc .con { background: rgba(255, 110, 120, 0.1); } .cb-pc .con b { color: #ffa0a8; }
.cb-stats { display: grid; gap: 5px; }
.cb-st { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; font: 600 11.5px var(--mono, monospace); color: #dfe8f2; }
.cb-st i { height: 8px; border-radius: var(--rad-pill, 4px); background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.cb-st i b { display: block; height: 100%; border-radius: inherit; }
.cb-st em { font-style: normal; text-align: right; color: #9fb0c4; font-variant-numeric: tabular-nums; }
.cb-build { margin: 0; padding: 0; list-style: none; counter-reset: cb; display: grid; gap: 6px; }
.cb-build li { counter-increment: cb; display: grid; grid-template-columns: 22px 34px 1fr; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 12px; background: rgba(255, 255, 255, 0.035); }
.cb-build li::before { content: counter(cb); font: 700 12px var(--mono, monospace); color: var(--g); text-align: center; }
.cb-build .sicon, .cb-sk .sicon { width: 34px; height: 34px; }
.cb-build b, .cb-sk b { font-size: 12.5px; color: #fff; }
.cb-build b span { color: var(--g); font-size: 11.5px; }
.cb-build em, .cb-sk em { font-style: normal; font-size: 9.5px; margin-left: 6px; padding: 1px 6px; border-radius: var(--rad-pill, 4px); background: rgba(255, 255, 255, 0.1); color: #c8d4e2; }
.cb-build small, .cb-sk small { display: block; color: #a8b6c6; font-size: 11px; line-height: 1.4; margin-top: 1px; }
.cb-all { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cb-sk { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: start; padding: 6px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); min-width: 0; }
.cb-next { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cb-next button { text-align: left; border: 1px solid color-mix(in srgb, var(--g) 45%, transparent); background: color-mix(in srgb, var(--g) 10%, rgba(10, 16, 26, 0.6)); color: #fff; border-radius: 14px; padding: 9px 12px; cursor: pointer; }
.cb-next button b { display: block; font-size: 13px; } .cb-next button small { color: #b8c6d6; font-size: 11px; }
.cb-tip { padding: 8px 10px; border-radius: 12px; background: rgba(255, 220, 120, 0.08); }
@media (max-width: 760px) {
  .cb-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: calc(100dvh - 120px); }
  .cb-toc { flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); padding: 8px; gap: 4px; }
  .cb-th, .cb-tg { display: none; }
  .cb-ti, .cb-ti.l2 { width: auto; flex: none; padding: 6px 10px; white-space: nowrap; }
  .cb-ti.l2::before { content: none; }
  .cb-all, .cb-pc, .cb-next { grid-template-columns: 1fr; }
  .cb-art { opacity: .35; height: 180px; }
}

/* ===== มือถือแนวตั้ง: เควสต์ไม่ทับการ์ดตัวละคร/มินิแมพ (ป้าย MVP + บอสโลกทำให้คอลัมน์มินิแมพยาวขึ้น) ===== */
@media (orientation: portrait) {
  body.visor.pad-mode #hud #quest-track, body.visor.pad-mode #hud:has(#buffs .buff) #quest-track { top: calc(292px + var(--st)); right: calc(var(--gap) + var(--sr)); width: min(46vw, 190px); }
}
#item-tip .tip-k { color: #8fa4bc; }
#item-tip .tip-mas { color: #8ff4ff; margin-top: 4px; }
#item-tip .tip-bad { color: #ffa0a8; }
#item-tip .tip-src { margin-top: 7px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.08); display: grid; gap: 1px; }
#item-tip .tip-src b { font-size: 11px; color: #ffd98a; letter-spacing: .04em; }
#item-tip .tip-src div { color: #e6eef8; }
#item-tip .tip-src small { color: #9fb0c4; }
#item-tip .tip-head .sicon { width: 34px; height: 34px; flex: none; }
.hunt-r small.exp-low { color: #ff9aa8; } .hunt-r small.exp-hi { color: #8ff0b0; }

/* =====================================================================
   หน้าเลือกตัวละคร: เวทีตัวละครที่เลือก (ซ้าย) + รายการช่องตัวละคร 5 ช่อง (ขวา)
   ===================================================================== */
body.visor .acct.offline::before { background: #ffd27a; box-shadow: 0 0 10px #ffd27a; }
body.visor .charsel { width: min(820px, 100%); padding: 12px; gap: 14px; max-height: calc(100dvh - 190px - var(--st) - var(--sb)); min-height: 0; }
body.visor .cs-stage { width: 268px; justify-content: flex-start; }
body.visor .cs-stage::before { content: "UNIT " attr(data-slot); }
body.visor .charsel.empty .cs-stage::before { content: "UNIT"; }
body.visor .cs-stage canvas { width: 200px; height: 236px; margin: 0; }
body.visor .cs-info { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; margin-top: -6px; }
body.visor .cs-name { font: 700 20px/1.2 var(--font); color: #fff; text-shadow: 0 0 18px rgba(111, 243, 255, 0.35); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.visor .cs-job { display: inline-flex; align-items: center; gap: 6px; font: 500 13px var(--font); color: var(--ink-dim); }
body.visor .cs-job img, body.visor .cs-main small img { width: 18px; height: 18px; object-fit: contain; filter: drop-shadow(0 0 4px rgba(111, 243, 255, 0.4)); }
body.visor .cs-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; margin-top: 8px; }
body.visor .cs-stats span { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 8px; border-radius: 12px; background: var(--fill); border: 1px solid var(--edge); min-width: 0; }
body.visor .cs-stats .wide { grid-column: 1 / -1; }
body.visor .cs-stats small { font: 600 9.5px var(--mono); letter-spacing: 0.16em; color: var(--ink-faint); text-transform: uppercase; }
body.visor .cs-stats b { font: 600 15px var(--font); color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.visor .cs-empty { font: 500 13px/1.6 var(--font); color: var(--ink-dim); padding: 0 6px; }

body.visor .cs-right { padding: 8px 6px 4px 4px; gap: 0; }
body.visor .cs-right .card-kicker b { order: 3; font: 600 10.5px var(--mono); letter-spacing: 0.14em; color: var(--ink-dim); }
body.visor .cs-list { gap: 7px; padding: 4px 4px 4px 2px; margin: 0 -4px 0 -2px; flex: 1 1 auto; }
body.visor .cs-slot { position: relative; min-height: 62px; padding: 8px 16px 8px 9px; border-radius: 18px; gap: 12px; background: var(--fill); border: 1px solid var(--edge); color: var(--ink);
  font: inherit; cursor: pointer; flex-shrink: 0; transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.18s; }
body.visor .cs-slot:hover { background: var(--fill-2); border-color: var(--edge-2); }
body.visor .cs-slot:focus-visible { outline: none; box-shadow: var(--glow-soft); }
body.visor .cs-slot.on { background: linear-gradient(90deg, rgba(111, 243, 255, 0.16), rgba(111, 243, 255, 0.05)); border-color: rgba(111, 243, 255, 0.55);
  box-shadow: 0 0 26px -10px rgba(111, 243, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.07); }
body.visor .cs-slot.on::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--cy); box-shadow: 0 0 10px var(--cy); }
body.visor .cs-face { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; background: #18202c; box-shadow: 0 0 0 1px var(--edge-2); }
body.visor .cs-slot.on .cs-face { box-shadow: 0 0 0 2px var(--cy), 0 0 14px rgba(111, 243, 255, 0.5); }
body.visor .cs-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
body.visor .cs-main b { font: 600 15.5px/1.25 var(--font); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.visor .cs-main small { display: flex; align-items: center; gap: 5px; min-width: 0; font: 500 12px/1.3 var(--font); color: var(--ink-dim); white-space: nowrap; overflow: hidden; }
body.visor .cs-main small i { font-style: normal; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; }
body.visor .cs-lv { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; flex-shrink: 0; }
body.visor .cs-lv b { font: 600 13px var(--mono); color: var(--cy); letter-spacing: 0.04em; }
body.visor .cs-lv small { font: 500 11px var(--mono); color: var(--ink-faint); letter-spacing: 0.04em; }
body.visor .cs-slot.empty { background: transparent; border-style: dashed; border-color: var(--edge-2); color: var(--ink-faint); min-height: 54px; }
body.visor .cs-slot.empty:hover { background: rgba(111, 243, 255, 0.06); border-color: rgba(111, 243, 255, 0.45); }
body.visor .cs-slot.empty b { color: var(--ink-dim); font-weight: 500; font-size: 14px; }
body.visor .cs-slot.empty small { color: var(--ink-faint); font-size: 11.5px; }
body.visor .cs-slot.empty:hover b { color: var(--cy); }
body.visor .cs-plus { width: 44px; height: 36px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; font: 300 24px/1 var(--font); color: var(--cy); opacity: 0.85; }
body.visor .cs-wait { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px 12px; font: 500 13.5px/1.5 var(--font); color: var(--ink-dim); }
body.visor .charsel.loading .cs-stage canvas { opacity: 0.25; }

/* ปุ่มล่าง: ลบ (ซ้าย) • สร้างใหม่ + เข้าเกม (ขวา) */
body.visor .cs-btns { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--edge); gap: 10px; align-items: center; }
body.visor .cs-btns #cs-delete { margin-right: auto; }
body.visor .cs-btns .tbtn.small { min-height: 44px; white-space: nowrap; justify-content: center; }
body.visor #btn-continue { flex-direction: row; align-items: center; gap: 8px; min-width: 150px; justify-content: center; }
body.visor #btn-continue small { font-size: 12px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.visor .tbtn.small.danger { background: transparent; color: #ffb3bb; border-color: rgba(255, 107, 125, 0.35); box-shadow: none; }
body.visor .tbtn.small.danger:hover { background: rgba(255, 107, 125, 0.16); border-color: rgba(255, 107, 125, 0.65); color: #ffd6da; }
body.visor .tbtn.small.danger:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
body.visor .cs-links { align-items: flex-start; margin-top: 4px; }
body.visor .cs-links .linkbtn { padding: 6px 2px 0; text-align: left; }
body.visor .cs-right .err { margin: 6px 0 0 6px; min-height: 0; }
body.visor .cs-right .err:empty { display: none; }

/* ยืนยันลบ: พิมพ์ชื่อตัวละคร */
body.visor .cs-confirm { margin-top: 10px; padding: 14px 16px; border-radius: 18px; background: rgba(255, 70, 90, 0.08); border: 1px solid rgba(255, 107, 125, 0.4);
  display: flex; flex-direction: column; gap: 10px; animation: fadeUp 0.2s ease-out both; }
body.visor .cs-cf-text { display: flex; flex-direction: column; gap: 4px; font: 500 12.5px/1.55 var(--font); color: var(--ink-dim); }
body.visor .cs-cf-text b { font: 600 15px var(--font); color: #ffd6da; }
body.visor .cs-confirm input { font: 16px/1.3 var(--font); padding: 10px 14px; border-radius: var(--r-ctl); background: var(--fill); border: 1px solid rgba(255, 107, 125, 0.4); color: var(--ink); outline: none; width: 100%; }
body.visor .cs-confirm input:focus { border-color: rgba(255, 107, 125, 0.75); box-shadow: 0 0 0 4px rgba(255, 107, 125, 0.12); }
body.visor .cs-cf-btns { display: flex; justify-content: flex-end; gap: 10px; }
body.visor .charsel.confirming .cs-btns { display: none; }

/* มือถือแนวตั้ง: เวทีตัวละครเป็นแถบแนวนอนด้านบน รายการอยู่ล่าง ปุ่มติดล่างการ์ด */
@media (max-width: 760px) {
  body.visor #title.selecting .title-inner { justify-content: flex-start; }
  body.visor #title.selecting .acct { margin: 0; }
  body.visor .charsel { flex-direction: column; padding: 10px; gap: 8px; width: 100%; max-height: calc(100dvh - 176px - var(--st) - var(--sb)); }
  body.visor .cs-stage { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 14px 12px; border-radius: 18px; flex-shrink: 0; }
  body.visor .cs-stage::before { flex-basis: 100%; }
  body.visor .cs-stage canvas { width: 104px; height: 123px; flex-shrink: 0; }
  body.visor .cs-info { flex: 1; min-width: 0; align-items: flex-start; text-align: left; margin: 0; }
  body.visor .cs-name { font-size: 18px; }
  body.visor .cs-stats { margin-top: 6px; gap: 5px; }
  body.visor .cs-stats span { padding: 4px 6px; border-radius: 10px; }
  body.visor .cs-stats b { font-size: 13.5px; }
  body.visor .cs-right { padding: 2px 4px 2px; min-height: 0; flex: 1 1 auto; }
  body.visor .cs-right .card-kicker { margin-bottom: 6px; }
  body.visor .cs-slot { min-height: 56px; padding: 6px 14px 6px 7px; border-radius: 16px; }
  body.visor .cs-slot.empty { min-height: 46px; }
  body.visor .cs-face { width: 40px; height: 40px; }
  body.visor .cs-btns { padding-top: 10px; gap: 8px; flex-wrap: nowrap; }
  body.visor .cs-btns .tbtn.small { padding: 10px 14px; font-size: 13.5px; }
  body.visor .cs-btns .tbtn.small.primary { flex: 1; min-width: 0; padding-right: 36px; }
  body.visor .cs-btns .tbtn.small.primary::after { right: 13px; }
  body.visor #btn-continue small { display: none; }
  body.visor .cs-btns #cs-delete { margin-right: 0; }
}
/* มือถือแนวนอน (จอเตี้ย) */
@media (max-height: 520px) and (orientation: landscape) {
  body.visor #title.selecting .title-inner { flex-direction: column; justify-content: center; gap: 6px; }
  body.visor #title.selecting .acct { position: static; }
  body.visor #title.selecting #title-ver { display: none; }
  body.visor .charsel { width: min(760px, 100%); padding: 8px; gap: 10px; max-height: calc(100dvh - 56px - var(--st) - var(--sb)); }
  body.visor .cs-stage { width: 220px; padding: 10px 12px; }
  body.visor .cs-stage canvas { width: 110px; height: 130px; }
  body.visor .cs-stats { display: none; }
  body.visor .cs-slot { min-height: 46px; padding: 4px 12px 4px 6px; }
  body.visor .cs-face { width: 34px; height: 34px; }
  body.visor .cs-plus { height: 28px; }
}
/* ===== World Boss: ตารางดาเมจ (ข้างมินิแมพ) + การ์ดสรุปตอนบอสตาย ===== */
#wb-top { position: fixed; z-index: 19; top: calc(var(--gap) + var(--st) + 190px); right: calc(var(--gap) + var(--sr) + 172px); width: 212px; padding: 8px 10px 7px; border-radius: 16px;
  background: linear-gradient(160deg, rgba(16, 24, 38, 0.72), rgba(8, 12, 20, 0.62)); border: 1px solid rgba(255, 200, 80, 0.28);
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.07); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  color: #f4f7fb; font: 500 11.5px var(--mono, monospace); font-variant-numeric: tabular-nums; pointer-events: none; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); }
#wb-top[hidden], #wb-result[hidden] { display: none; }
#hud.hud-min #wb-top { display: none; }
.wbt-h { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 4px; font: 600 12px var(--display, sans-serif); letter-spacing: 0.04em; color: #ffe08a; }
.wbt-h small { font: 500 9.5px var(--mono, monospace); letter-spacing: 0.14em; text-transform: uppercase; color: #c8a868; }
.wbt-r { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto 40px; align-items: center; gap: 6px; padding: 2px 4px; border-radius: 8px; line-height: 16px; }
.wbt-r i { font-style: normal; text-align: center; color: #8a98aa; font-weight: 600; }
.wbt-r.r1 i { color: #ffd84a; } .wbt-r.r2 i { color: #d6e2ee; } .wbt-r.r3 i { color: #e8a26a; }
.wbt-r b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font, sans-serif); }
.wbt-r b em { font-style: normal; margin-left: 5px; padding: 0 5px; border-radius: var(--rad-pill, 4px); font: 600 9px/13px var(--mono, monospace); color: #061018; background: #6ff3ff; vertical-align: 1px; }
.wbt-r span { color: #ffe08a; }
.wbt-r small { text-align: right; color: #a8b6c6; font-size: 10px; }
.wbt-r.me { background: rgba(111, 243, 255, 0.12); box-shadow: inset 0 0 0 1px rgba(111, 243, 255, 0.35); }
.wbt-e { color: #a8b6c6; font-size: 11px; padding: 2px 0; }
#wb-result { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; pointer-events: none; }
.wbr-card { position: relative; pointer-events: auto; width: min(380px, 100%); padding: 18px 18px 14px; border-radius: 22px; color: #f4f7fb;
  background: linear-gradient(160deg, rgba(16, 24, 38, 0.86), rgba(8, 12, 20, 0.8)); border: 1px solid rgba(255, 200, 80, 0.35);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.9), 0 0 90px -40px rgba(255, 200, 80, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(24px) saturate(1.3); backdrop-filter: blur(24px) saturate(1.3); animation: wbrIn 0.35s ease-out; font: 500 12px var(--mono, monospace); font-variant-numeric: tabular-nums; }
@keyframes wbrIn { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
.wbr-x { position: absolute; top: 10px; right: 12px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.06); color: #c6d0dc; font-size: 18px; line-height: 1; cursor: pointer; }
.wbr-x:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.wbr-k { font: 500 10.5px var(--mono, monospace); letter-spacing: 0.2em; text-transform: uppercase; color: #ffd98a; }
.wbr-t { font: 600 20px/1.25 var(--display, sans-serif); margin: 2px 34px 12px 0; }
.wbr-me { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.wbr-me > div { padding: 8px 10px; border-radius: 14px; background: rgba(111, 243, 255, 0.08); border: 1px solid rgba(111, 243, 255, 0.25); }
.wbr-me small { display: block; font-size: 9.5px; letter-spacing: 0.1em; color: #8fb8c8; text-transform: uppercase; }
.wbr-me b { font: 600 17px var(--mono, monospace); color: #6ff3ff; }
.wbr-me b i { font-style: normal; font-size: 11px; color: #8a98aa; margin-left: 2px; }
.wbr-list { display: grid; gap: 2px; font-size: 12.5px; }
.wbr-list .wbt-r { grid-template-columns: 20px minmax(0, 1fr) auto 46px; line-height: 20px; }
@media (max-width: 760px) {
  #wb-top { top: calc(196px + var(--st)); right: calc(var(--gap) + var(--sr)); width: 168px; padding: 6px 7px 5px; font-size: 10px; border-radius: 12px; }
  #wb-top .wbt-r:nth-child(n+5):not(.me) { display: none; } /* จอเล็ก: 3 อันดับแรก + แถวของเรา (ไม่ทับเควสต์) */
  .wbt-h { font-size: 11px; margin-bottom: 2px; } .wbt-h small { display: none; }
  .wbt-r { grid-template-columns: 12px minmax(0, 1fr) auto 34px; gap: 4px; line-height: 14px; padding: 1px 3px; }
  .wbt-r small { font-size: 9px; }
  .wbr-t { font-size: 17px; } .wbr-me b { font-size: 15px; }
}

/* มือถือแนวตั้ง: แถบเควสต์กะทัดรัด (บรรทัดเดียวต่อหัวข้อ) — ตำแหน่งหลบปุ่ม AUTO จัดใน js: UI.stackTop */
@media (orientation: portrait) and (max-width: 760px) {
  body.visor.pad-mode #quest-track .qt-title, body.visor.pad-mode #quest-track .qt-obj { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.visor.pad-mode #quest-track::before { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.08em; }
}

/* ตัวเลือกช่องปุ่มลัด (ปุ่ม 📌 ในหน้าต่างสกิล / ตั้งปุ่มลัดในกระเป๋า) */
.slot-pick { position: fixed; z-index: 100000; padding: 10px 12px 9px; border-radius: 14px; background: rgba(10, 16, 26, 0.94); border: 1px solid rgba(111, 243, 255, 0.45);
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.85); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); max-width: calc(100vw - 16px); }
.slot-pick .sp-h { font: 600 12px var(--font); color: #c8fbff; letter-spacing: .04em; margin-bottom: 8px; }
.slot-pick .sp-row { display: flex; gap: 6px; flex-wrap: wrap; }
.slot-pick .sp-slot { width: 44px; display: grid; justify-items: center; gap: 3px; padding: 4px 0 3px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04); color: #e6eef8; cursor: pointer; }
.slot-pick .sp-slot:hover, .slot-pick .sp-slot:focus-visible { border-color: #6ff3ff; background: rgba(111, 243, 255, 0.14); outline: none; }
.slot-pick .sp-slot.cur { border-color: #ffd56a; }
.slot-pick .sp-ic { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: rgba(0, 0, 0, 0.35); overflow: hidden; }
.slot-pick .sp-ic img, .slot-pick .sp-ic .sicon { width: 32px; height: 32px; }
.slot-pick .sp-slot.empty .sp-ic { border: 1px dashed rgba(255, 255, 255, 0.18); background: none; }
.slot-pick .sp-slot b { font: 600 11px var(--mono); color: #9fdcff; }
.slot-pick .sp-tip { margin-top: 8px; font-size: 11px; color: #9fb0c4; max-width: 400px; }

/* ===== มือถือแนวตั้ง: HUD กะทัดรัด (กรอบตัวละคร / แถบเป้าหมาย / ปุ่มข้างมินิแมพ เล็กลง ให้เห็นฉากมากขึ้น) ===== */
@media (max-width: 760px) and (orientation: portrait) {
  body.visor #basic-info { gap: 8px; width: auto; max-width: min(230px, 60vw); }
  body.visor .bi-face, body.visor #bi-rings { width: 62px; height: 62px; }
  body.visor .bi-face canvas { left: 9px; top: 9px; width: 44px; height: 44px; }
  body.visor .bi-face em { font-size: 9.5px; line-height: 13px; padding: 0 5px; bottom: -3px; }
  body.visor .bi-main { gap: 1px; }
  body.visor .bi-id b { font-size: 15px; }
  body.visor .bi-id span { font-size: 9px; letter-spacing: 0.12em; }
  body.visor #basic-info .gauge i, body.visor #basic-info .gauge span, body.visor #basic-info .gauge.sp i, body.visor #basic-info .gauge.sp span { font-size: 11px; line-height: 1.2; }
  body.visor .xrow label, body.visor .xrow > span { font-size: 8.5px; }
  body.visor .bi-foot { font-size: 10.5px; row-gap: 2px; }
  body.visor .pt { font-size: 9px; padding: 1px 7px; }
  body.visor #target { width: min(46vw, 176px); padding: 3px 10px 5px 3px; gap: 6px; right: calc(var(--gap) + var(--sr) + 40px); }
  body.visor #tg-cv { width: 26px; height: 26px; }
  body.visor .tg-id b { font-size: 12px; }
  body.visor .tg-id span { font-size: 9.5px; }
  body.visor #target .gauge span { font-size: 9px; }
  .mm-btn { width: 24px; height: 24px; }
  .mm-btn svg { width: 13px; height: 13px; }
  #zoom-ctl button:nth-child(1) { left: -12px; top: 4px; }
  #zoom-ctl button:nth-child(2) { left: -16px; top: 32px; }
  #map-open { left: -10px; top: 62px; }
}

/* ===== มือถือแนวตั้ง: จัดระเบียบ ลดของบนจอ (ซูมใช้สองนิ้ว • แตะมินิแมพเปิดแผนที่ • ช่องไอเทมว่างซ่อน • ข้อความหายเองใน 6 วิ) ===== */
@media (max-width: 760px) and (orientation: portrait) {
  .pad-mode #zoom-ctl, .pad-mode #map-open { display: none; }
  #minimap .mm-ring { cursor: pointer; }
  body.visor #bi-zeny { display: none; }
  body.visor .bi-foot:has(#bi-points:empty) { display: none; }
  .pad-mode #potbar .hb.blank { display: none; }
  .pad-mode #chat-log { max-height: 52px; }
  .pad-mode #chat-log .cl.old { display: none; }
  body.visor.pad-mode #quest-track::before { display: none; }
  body.visor.pad-mode #quest-track .qt-obj { display: none; }
  body.visor.pad-mode #quest-track .qt-ic { display: none; }
}
@media (max-width: 760px) and (orientation: portrait) {
  body.visor #target { top: calc(134px + var(--st)); }
}
/* มือถือแนวตั้ง: แถวเดียวใต้กรอบตัวละคร — บัฟ (ซ้าย) | เป้าหมาย (ขวา ใต้มินิแมพ) • เมนูลงไปใต้แถวนี้ */
@media (max-width: 760px) and (orientation: portrait) {
  body.visor #buffs { top: calc(140px + var(--st)); max-width: calc(100vw - 246px - var(--sl) - var(--sr)); gap: 4px; }
  body.visor .buff { padding: 0 6px 0 2px; gap: 4px; }
  body.visor #target { top: calc(140px + var(--st)); }
  body.visor #menubar { top: calc(184px + var(--st)); }
  body.visor .buff { height: 26px; }
  body.visor .buff .bf-ic, body.visor .buff .bf-ic img { width: 22px; height: 22px; }
  body.visor .buff i { font-size: 10px; letter-spacing: -0.02em; }
}
/* เลือกสกิล/ไอเทมใส่ช่อง (แตะช่องว่าง / แตะค้าง) */
.slot-pick.choose { width: min(340px, calc(100vw - 16px)); }
.slot-pick .sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; max-height: min(46vh, 300px); overflow-y: auto; }
.slot-pick .sp-opt { display: grid; justify-items: center; gap: 4px; padding: 6px 4px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.04); color: #e6eef8; cursor: pointer; min-height: 72px; }
.slot-pick .sp-opt:active, .slot-pick .sp-opt:hover { border-color: #6ff3ff; background: rgba(111, 243, 255, 0.14); }
.slot-pick .sp-opt.cur { border-color: #ffd56a; }
.slot-pick .sp-opt .sp-ic { width: 38px; height: 38px; }
.slot-pick .sp-opt .sp-ic img, .slot-pick .sp-opt .sp-ic .sicon { width: 38px; height: 38px; }
.slot-pick .sp-opt span { font-size: 10.5px; line-height: 1.2; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.slot-pick .sp-foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.pad-mode #hotbar .hb.blank { opacity: .55; }
.pad-mode #hotbar .hb.blank .ic::after { content: '+'; display: grid; place-items: center; width: 100%; height: 100%; font: 300 22px/1 var(--font); color: rgba(200, 240, 255, 0.8); }
/* ===== โหมดติดตั้งสกิล/ไอเทม: ช่องจริงบนจอสว่าง ให้แตะเลือก ===== */
body.equip-mode::before { content: ''; position: fixed; inset: 0; z-index: 25; background: rgba(4, 8, 14, 0.55); pointer-events: none; }
body.equip-hotbar #hotbar .hb, body.equip-potbar #potbar .hb { z-index: 27; opacity: 1 !important; border-color: #6ff3ff !important; box-shadow: 0 0 0 2px rgba(111, 243, 255, 0.45), 0 0 18px rgba(111, 243, 255, 0.55) !important; animation: eqPulse 1.1s ease-in-out infinite; cursor: pointer; }
body.equip-hotbar.pad-mode #hotbar .hb.blank:nth-child(n+5), body.equip-potbar.pad-mode #potbar .hb.blank { display: flex !important; }
body.equip-hotbar #hotbar .hb.blank .ic::after, body.equip-potbar #potbar .hb.blank .ic::after { content: '+'; display: grid; place-items: center; width: 100%; height: 100%; font: 300 22px/1 var(--font); color: #c8fbff; }
body.equip-mode #hotbar .hb .k, body.equip-mode #potbar .hb .k { display: block !important; color: #c8fbff; }
@keyframes eqPulse { 50% { box-shadow: 0 0 0 4px rgba(111, 243, 255, 0.25), 0 0 26px rgba(111, 243, 255, 0.75); } }
#equip-banner { position: fixed; z-index: 28; left: 50%; top: calc(14px + var(--st, 0px)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px;
  border-radius: 16px; background: rgba(10, 16, 26, 0.94); border: 1px solid rgba(111, 243, 255, 0.5); box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.9); width: max-content; max-width: calc(100vw - 16px); }
#equip-banner .eb-ic { width: 40px; height: 40px; display: grid; place-items: center; flex: none; }
#equip-banner .eb-ic img, #equip-banner .eb-ic .sicon { width: 40px; height: 40px; }
#equip-banner .eb-t { display: grid; gap: 1px; min-width: 0; }
#equip-banner .eb-t b { font: 600 14px var(--font); color: #fff; }
#equip-banner .eb-t span { font-size: 12px; color: #9fdcff; }
.sk-equip.on { border-color: #ffd56a; color: #ffe8a8; }
/* ===== หน้าต่างสกิล: แถวขนาดเท่ากันทุกแถว (รายละเอียดอยู่ในปุ่ม ⓘ) ===== */
.sk-row.uni { height: 58px; box-sizing: border-box; padding: 6px 8px; overflow: hidden; }
.sk-row.uni .sicon { width: 42px; height: 42px; flex: none; }
.sk-row.uni .sk-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.sk-row.uni .sk-mas { margin-top: 4px; font-size: 10.5px; white-space: nowrap; }
.sk-row.uni .sk-mas em { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sk-row.uni .sk-sub { margin-top: 4px; font-size: 10.5px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk-row.uni .sk-sub.bad { color: #ff9aa4; }
.sk-row.uni .sk-acts { flex-direction: row; align-items: center; gap: 4px; flex: none; }
.sk-row.uni .sk-acts .btn.small { padding: 4px 8px; }
.sk-info-btn { min-width: 30px; font-size: 14px; line-height: 1; }
.sk-detail { position: fixed; z-index: 100000; width: min(320px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow-y: auto; padding: 12px 14px 10px; border-radius: 14px;
  background: rgba(10, 16, 26, 0.96); border: 1px solid rgba(111, 243, 255, 0.45); box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.85); color: #e6eef8; font-size: 12.5px; display: grid; gap: 4px; }
.sk-detail .tip-head { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.sk-detail .tip-head .sicon { width: 40px; height: 40px; flex: none; }
.sk-detail .tip-head b { display: block; font-size: 14px; }
.sk-detail .tip-head small { color: #9fb0c4; }
.sk-detail .tip-desc { color: #d6e2ee; line-height: 1.45; }
.sk-detail .tip-k { color: #8fa4bc; }
.sk-detail .tip-bon { display: flex; flex-wrap: wrap; gap: 4px 8px; color: #9ff0ff; }
.sk-detail .tip-mas { color: #8ff4ff; }
.sk-detail .tip-bad { color: #ffa0a8; }
.sk-detail-x { justify-self: end; margin-top: 4px; }
@media (max-width: 760px) { .sk-row.uni { height: 56px; } .sk-row.uni .sk-acts .btn.small { padding: 4px 7px; } }
/* แท็บสกิลตามคลาส */
.sk-tabs { display: flex; gap: 6px; margin: 0 0 8px; flex-wrap: wrap; }
.sk-tabs .tab { position: relative; flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk-tab-dot { position: absolute; top: 4px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: #ffd56a; box-shadow: 0 0 6px #ffd56a; }
.sk-tabs .tab { display: grid; gap: 0; line-height: 1.15; padding: 5px 8px; text-align: center; }
.sk-tabs .tab small { font: 600 9px var(--mono, monospace); letter-spacing: 0.12em; opacity: .7; }
.sk-tabs .tab b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.visor .sk-tabs { border-radius: 16px; }
body.visor .sk-tabs .tab { border-radius: 12px; }
details.sk-mas-help { padding: 6px 12px; }
details.sk-mas-help summary { cursor: pointer; list-style: none; }
details.sk-mas-help summary::-webkit-details-marker { display: none; }
details.sk-mas-help[open] .sk-mh-more { display: none; }
.sk-mh-more { color: var(--ink-dim); font-size: 11px; }

/* ---------- มิติ/เงา (เจ้าของ: "เพิ่มเงา เพิ่มมิติ") — หน้าต่างลอย ช่องยุบลง ปุ่มนูน ไอคอนมีเงา ---------- */
body.visor .win { box-shadow: 0 34px 70px -24px rgba(0, 0, 0, 0.9), 0 10px 22px -10px rgba(0, 0, 0, 0.7), 0 0 90px -40px rgba(111, 243, 255, 0.3),
  inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -2px 0 rgba(0, 0, 0, 0.35); }
body.visor .win-title { background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 70%); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45), 0 6px 10px -8px rgba(0, 0, 0, 0.8); }
body.visor .win-title span { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); }
/* ช่องเก็บของ/ช่องสวมใส่/แถวรายการ = ยุบลงในแผง */
body.visor .inv-cell, body.visor .eq-slot, body.visor .sk-row, body.visor .shop-row, body.visor .nav-row, body.visor .q-card {
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.45), inset 0 -1px 0 rgba(255, 255, 255, 0.05); }
body.visor .inv-cell img, body.visor .eq-slot img, body.visor .sk-row canvas, body.visor .sk-row img { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.65)); }
body.visor .inv-cell.sel { box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(111, 243, 255, 0.5) inset, var(--glow-soft); }
/* ปุ่ม = นูน (กดแล้วยุบ) */
body.visor .btn { box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), 0 4px 10px -4px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
body.visor .btn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(0, 0, 0, 0.4); }
/* แถบแท็บ = ร่องยุบ • แท็บที่เลือก = นูนขึ้นมา */
body.visor .tabs { box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5), inset 0 -1px 0 rgba(255, 255, 255, 0.05); }
body.visor .tab.on { box-shadow: inset 0 0 0 1px rgba(111, 243, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 6px -1px rgba(0, 0, 0, 0.6), 0 0 22px -6px rgba(111, 243, 255, 0.6); }
/* หน้าต่าง Equipment (โทนหนัง): ช่องยุบ + ตัวละครอยู่ในหลุมเงา */
body.visor #w-equip .eq-slot { box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.55), inset 0 -1px 0 rgba(255, 226, 170, 0.06); }
body.visor #w-equip .eq-prev { box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.7), inset 0 -1px 0 rgba(255, 226, 170, 0.08), 0 1px 0 rgba(255, 226, 170, 0.06); }
body.visor #w-equip .eq-turn { box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 226, 170, 0.15); }

/* ---------- ความสะใจ (js/feel.js) ---------- */
#chain { position: fixed; text-align: left !important; left: calc(50% + 150px); top: calc(96px + var(--st)); /* กลางค่อนขวาบน: ไม่ทับเมนู/มินิแมพ */ z-index: 30; pointer-events: none; text-align: right;
  opacity: 0; transform: translateX(14px); transition: opacity .2s, transform .2s; font-family: var(--display); }
#chain.on { opacity: 1; transform: none; }
#chain b { display: block; font: 800 30px/1 var(--display); color: #fff; letter-spacing: .02em; text-shadow: 0 0 12px rgba(111, 243, 255, .8), 0 2px 0 rgba(0, 0, 0, .6); }
#chain.hot b { color: #ffd76a; text-shadow: 0 0 14px rgba(255, 170, 60, .9), 0 2px 0 rgba(0, 0, 0, .6); }
#chain small { font: 700 10px var(--display); letter-spacing: .3em; color: var(--cy); }
#chain.hot small { color: #ffb84a; }
#chain i { display: block; height: 3px; width: 70px; margin: 3px auto 0 0; background: rgba(255, 255, 255, .15); border-radius: 2px; overflow: hidden; }
#chain i s { display: block; height: 100%; background: currentColor; color: var(--cy); animation: chainDecay 3s linear forwards; }
#chain.hot i s { color: #ffb84a; }
#chain.pop b { animation: chainPop .16s ease-out; }
@keyframes chainPop { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }
@keyframes chainDecay { from { width: 100%; } to { width: 0; } }
@media (max-width: 760px) { #chain { top: calc(170px + var(--st)); left: auto; right: calc(var(--gap) + var(--sr) + 8px); text-align: right !important; } #chain i { margin-left: auto; } #chain b { font-size: 24px; } }
#lv-banner { position: fixed; left: 50%; top: 22%; z-index: 40; pointer-events: none; text-align: center; transform: translate(-50%, 0) scale(2.2); opacity: 0; }
#lv-banner.show { animation: lvIn 1.7s cubic-bezier(.2, .9, .3, 1) forwards; }
#lv-banner b { display: block; font: 900 56px/1 var(--display); color: #ffe7a0; letter-spacing: .04em;
  text-shadow: 0 0 24px rgba(255, 200, 80, .9), 0 0 60px rgba(255, 160, 40, .6), 0 3px 0 rgba(90, 50, 0, .8); }
#lv-banner small { font: 700 13px var(--display); letter-spacing: .4em; color: #fff3c8; text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }
#lv-banner.job b { color: #bfe9ff; text-shadow: 0 0 24px rgba(100, 200, 255, .9), 0 3px 0 rgba(0, 40, 80, .8); }
@keyframes lvIn { 0% { opacity: 0; transform: translate(-50%, 0) scale(2.2); } 13% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  80% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -14px) scale(1); } }
#bi-lvbadge.lvpop { animation: lvPop .4s ease-out; }
@keyframes lvPop { 0% { transform: scale(1); } 40% { transform: scale(1.6); box-shadow: 0 0 16px #ffd66a; } 100% { transform: scale(1); } }
#bi-bexp.gain, #exp-line-fill.gain { animation: expGain .25s ease-out; }
@keyframes expGain { 0% { filter: brightness(2.2) drop-shadow(0 0 6px #9fe7ff); } 100% { filter: none; } }
@media (prefers-reduced-motion: reduce) { #lv-banner.show { animation-duration: 1.2s; } #chain.pop b { animation: none; } }
/* ไม้ตาย RAGNARÖK: ปุ่มวงกลมเติมเกจ (conic) สีประจำ Class • เต็ม = เรืองแสงเต้น */
#ult-btn { position: relative; width: 56px; height: 56px; border-radius: 50%; padding: 0; flex-shrink: 0; cursor: pointer; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .25); color: #fff; display: grid; place-content: center; gap: 0; line-height: 1;
  background: conic-gradient(var(--uc, #ffd76e) calc(var(--k, 0) * 360deg), rgba(10, 14, 24, .78) 0); box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .7); }
#ult-btn i { position: absolute; inset: 4px; border-radius: 50%; background: rgba(8, 12, 20, .86); }
#ult-btn b, #ult-btn small { position: relative; font-family: var(--display); }
#ult-btn b { font-size: 13px; font-weight: 800; letter-spacing: .06em; }
#ult-btn small { font-size: 9px; opacity: .75; }
#ult-btn.ready { animation: ultReady 1s ease-in-out infinite; border-color: var(--uc); }
#ult-btn.ready b { color: var(--uc); text-shadow: 0 0 8px var(--uc); }
@keyframes ultReady { 0%, 100% { box-shadow: 0 0 0 0 var(--uc), 0 4px 12px -4px rgba(0, 0, 0, .7); } 50% { box-shadow: 0 0 22px 4px var(--uc), 0 4px 12px -4px rgba(0, 0, 0, .7); } }
.pad-mode #ult-btn { position: fixed; right: calc(14px + var(--sr)); bottom: calc(326px + var(--sb)); width: 54px; height: 54px; z-index: 26; }
@media (max-width: 760px) and (orientation: landscape) { .pad-mode #ult-btn { right: calc(310px + var(--sr)); bottom: calc(14px + var(--sb)); } }
#lv-banner.ult b { color: #fff; font-size: 64px; text-shadow: 0 0 26px var(--uc), 0 0 70px var(--uc), 0 3px 0 rgba(0, 0, 0, .7); letter-spacing: .08em; }
#lv-banner.ult small { color: var(--uc); }

/* ---- GAME_FEEL 12: สกิลคูลดาวน์ยาวกลับมาพร้อมใช้ ---- */
.hb.ready { animation: hbReady .45s ease-out; }
@keyframes hbReady {
  0% { box-shadow: inset 0 0 0 2px #fff, 0 0 0 0 rgba(120,230,255,.95); filter: brightness(1.9); }
  100% { box-shadow: inset 0 0 0 0 rgba(255,255,255,0), 0 0 18px 8px rgba(120,230,255,0); filter: brightness(1); }
}
/* ---- GAME_FEEL 13: ใกล้เลเวลแล้ว ---- */
#bi-bexp.near, #exp-line-fill.near { animation: expNear 1.2s ease-in-out infinite; }
@keyframes expNear { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.7) drop-shadow(0 0 6px #ffe08a); } }
#bi-lvbadge.near { animation: lvNear .9s ease-in-out infinite; }
@keyframes lvNear { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); box-shadow: 0 0 12px 2px rgba(255,214,106,.75); } }
@media (prefers-reduced-motion: reduce) { .hb.ready, #bi-bexp.near, #exp-line-fill.near, #bi-lvbadge.near { animation: none; } }
/* ---- GAME_FEEL 14: เด้งเลข stat / ค่ารองที่เปลี่ยนวาบเขียว / เงินวาบเหลือง ---- */
.st-v.bump { display: inline-block; animation: stBump .2s ease-out; }
@keyframes stBump { 0% { transform: scale(1); } 50% { transform: scale(1.4); color: #ffe08a; } 100% { transform: scale(1); } }
.st-row2.chg b { animation: stChg .5s ease-out; }
@keyframes stChg { 0% { color: #8dffb0; text-shadow: 0 0 8px rgba(141,255,176,.8); } 100% { } }
#bi-zeny.zup { animation: zUp .45s ease-out; }
@keyframes zUp { 0% { color: #ffe08a; text-shadow: 0 0 10px rgba(255,214,106,.9); } 100% { } }
@media (prefers-reduced-motion: reduce) { .st-v.bump, .st-row2.chg b, #bi-zeny.zup { animation: none; } }

/* คำเตือนบอสเกิด: ป้ายแคบด้านบนจอ ไม่บังกลางจอ/ตัวละคร (เจ้าของสั่ง 2026-10-02) */
#splash.boss { inset: auto 0 auto 0; top: calc(env(safe-area-inset-top, 0px) + 64px); height: auto; background: none; padding: 0 16px; align-items: flex-start; }
#splash.boss .sp-card { width: min(460px, 92vw); aspect-ratio: auto; height: 84px; border-radius: 14px; display: flex; align-items: center; box-shadow: 0 0 0 1px rgba(255,90,100,.6), 0 0 22px rgba(255,40,60,.35); }
#splash.boss .sp-card img { position: relative; inset: auto; width: 128px; height: 100%; flex: none; object-fit: cover; object-position: center 25%; -webkit-mask-image: linear-gradient(90deg, #000 70%, transparent); mask-image: linear-gradient(90deg, #000 70%, transparent); }
#splash.boss .sp-text { position: relative; flex: 1; padding: 0 16px 0 6px; text-align: left; background: none; }
#splash.boss .sp-card { background: linear-gradient(90deg, rgba(40,4,10,.92), rgba(70,8,16,.85)); }
#splash.boss .sp-text small { font-size: 10.5px; letter-spacing: .14em; }
#splash.boss .sp-text b { font-size: clamp(17px, 3.4vw, 22px); }
#splash.boss.show { animation: bossBar 3.4s ease forwards; }
@keyframes bossBar { 0% { opacity: 0; transform: translateY(-14px); } 10% { opacity: 1; transform: none; } 82% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
#splash.boss { top: calc(env(safe-area-inset-top, 0px) + 100px); }
@media (max-height: 520px) {
  #splash.boss { top: calc(env(safe-area-inset-top, 0px) + 72px); }
  #splash.boss .sp-card { height: 50px; width: min(340px, 70vw); border-radius: 10px; }
  #splash.boss .sp-card img { width: 78px; }
  #splash.boss .sp-text small { font-size: 9px; }
  #splash.boss .sp-text b { font-size: 15px; }
}
/* วาร์ป: ม่านหมุนดูดแสงเข้ากลาง → แฟลช → จาง (feel.js warpFx) */
#warp-ov { position: fixed; inset: 0; z-index: 3990; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.95) 0%, rgba(var(--wc),.75) 12%, rgba(var(--wc),.25) 34%, transparent 60%),
              conic-gradient(from 0deg at 50% 50%, transparent, rgba(var(--wc),.35), transparent 25%, rgba(var(--wc),.35), transparent 50%, rgba(var(--wc),.35), transparent 75%, rgba(var(--wc),.35), transparent); }
#warp-ov.go { animation: warpGo .75s ease-out forwards; }
@keyframes warpGo { 0% { opacity: .9; transform: scale(1.6) rotate(0deg); } 30% { opacity: 1; transform: scale(.9) rotate(140deg); } 100% { opacity: 0; transform: scale(2.4) rotate(220deg); } }
@media (prefers-reduced-motion: reduce) { #warp-ov.go { animation: warpGoRm .4s ease-out forwards; } @keyframes warpGoRm { 0% { opacity: .6; } 100% { opacity: 0; } } }

/* ป้ายชื่อแมพตอนเข้าแมพ: แถบเล็กด้านบน ไม่บังกลางจอ (เจ้าของสั่ง 2026-10-02) */
#map-banner, #map-banner.has-img { top: calc(env(safe-area-inset-top, 0px) + 58px); width: min(520px, 88vw); max-width: 88vw; aspect-ratio: auto; height: auto; max-height: none;
  padding: 10px 18px 10px 150px; border-radius: 14px; text-align: left; background-size: auto 100%; background-position: left center; background-repeat: no-repeat;
  background-color: rgba(6,10,18,.78); box-shadow: 0 0 0 1px rgba(111,243,255,.25), 0 8px 24px rgba(0,0,0,.45); }
#map-banner:not(.has-img) { padding-left: 18px; text-align: center; background-color: rgba(6,10,18,.6); }
#map-banner.has-img::before { background: linear-gradient(90deg, transparent 0, transparent 110px, rgba(6,10,18,.95) 150px); border-radius: 14px; }
#map-banner .mb-en { font-size: clamp(17px, 3.2vw, 22px); }
#map-banner .mb-en::after { margin: 4px 0 0; width: 60%; }
#map-banner:not(.has-img) .mb-en::after { margin: 4px auto 0; }
#map-banner .mb-th { font-size: 12px; }
#map-banner .mb-story, #map-banner.has-img .mb-story { font-size: 11.5px; max-width: 100%; margin-top: 4px; line-height: 1.4; }
#map-banner.has-img.show { animation: mapBar 3.6s ease forwards; }
#map-banner.story.show { animation-duration: 4.8s; }
@keyframes mapBar { 0% { opacity: 0; transform: translateX(-50%) translateY(-10px); } 10% { opacity: 1; transform: translateX(-50%); } 82% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-6px); } }
#map-banner.mini { transform: translateX(-50%); }
/* คำเตือนบอสใช้ช่องเดียวกับป้ายชื่อแมพ (ui.js splash รอป้ายชื่อแมพจบก่อน) */
#splash.boss { top: calc(env(safe-area-inset-top, 0px) + 58px); }
@media (max-height: 520px) {
  #map-banner, #map-banner.has-img { top: calc(env(safe-area-inset-top, 0px) + 46px); width: min(400px, 60vw); padding: 6px 12px 6px 100px; }
  #map-banner.has-img::before { background: linear-gradient(90deg, transparent 0, transparent 70px, rgba(6,10,18,.95) 100px); }
  #map-banner .mb-story { display: none; }
  #splash.boss { top: calc(env(safe-area-inset-top, 0px) + 46px); }
}
#map-banner, #map-banner.has-img { background-image: none !important; padding: 9px 22px; text-align: center; width: max-content; min-width: min(300px, 80vw); }
#map-banner.has-img::before { display: none; }
#map-banner .mb-en::after { margin: 4px auto 0; }
@media (max-height: 520px) { #map-banner, #map-banner.has-img { top: calc(env(safe-area-inset-top, 0px) + 74px); padding: 5px 16px; min-width: 0; } #splash.boss { top: calc(env(safe-area-inset-top, 0px) + 74px); } }
@media (max-height: 520px) { #map-banner, #map-banner.has-img { top: calc(env(safe-area-inset-top, 0px) + 62px); padding: 3px 14px; } #map-banner .mb-th { display: none; } #map-banner .mb-en { font-size: 15px; } #map-banner .mb-en::after { display: none; } #splash.boss { top: calc(env(safe-area-inset-top, 0px) + 62px); } }
/* แจกแต้ม: − ค่า + แล้วยืนยัน */
.st-row.st-row3 { grid-template-columns: 38px 26px 1fr 26px 24px; }
.st-dn, .st-up { border: 1px solid var(--edge-2); background: var(--fill); color: var(--cy); font: 700 13px/1 var(--font); padding: 4px 0; border-radius: var(--rad-pill, 4px); }
.st-dn { color: #ff9aa6; }
.st-dn:disabled, .st-up:disabled { opacity: .28; cursor: default; }
.st-dn:hover:not(:disabled) { background: rgba(255,107,125,.16); border-color: #ff6b7d; }
.st-row3 .st-v { text-align: center; }
.st-plus { color: #8dffb0; font-style: normal; font-weight: 700; }
.st-row.drafted { background: rgba(141,255,176,.06); }
.st-row2.preview b { color: #8dffb0; }
.st-row2.preview s { color: var(--ink-faint); text-decoration-thickness: 1px; }
.st-confirm { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.st-confirm .btn { min-width: 96px; }
.st-confirm .btn.primary:not(:disabled) { background: linear-gradient(180deg, rgba(111,243,255,.28), rgba(56,185,210,.18)); border-color: var(--cy); color: #fff; box-shadow: 0 0 14px -4px var(--cy); }
@media (pointer: coarse) { .st-dn, .st-up { padding: 7px 0; font-size: 15px; } .st-row.st-row3 { grid-template-columns: 38px 34px 1fr 34px 24px; } }
