/* =====================================================================
   online.css — ปุ่มบัญชี / เมนูบัญชี / หน้าต่างเลือกหมู่บ้าน / เกมหยุดเพราะเปิดที่อื่น (2 ต.ค. 2026 · online.js)
   หน้าตาตามหน้าร่าง tools/mockup/login.html ที่จ๊อบโอเค · ปุ่มพิกเซลชุดเดียวกับ Export/Import (ui2.css)
   ===================================================================== */

/* ปุ่มพิกเซล (ก๊อปจากชุดปุ่มใน ui2.css · ตัวหนังสือสูงกว่ากลาง 2 px เพราะขอบล่างหนา เหมือนทุกปุ่ม) */
body[data-zone] .tt-btn {
  --img: url(../assets/ui/v2/ice_n.png); --img-h: url(../assets/ui/v2/ice_h.png); --img-p: url(../assets/ui/v2/ice_p.png);
  font-family: var(--pix) !important; letter-spacing: .5px; cursor: pointer;
  display: inline-flex !important; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box;
  background: none !important; box-shadow: none !important; outline: none !important; border-radius: 0 !important;
  border-style: solid !important; border-width: 6px 4px !important; border-color: transparent !important;
  border-image: var(--img) 3 2 3 2 fill / 6px 4px stretch !important; image-rendering: pixelated;
  color: #eef7fd !important; text-shadow: 1px 1px 0 #06101c; font-weight: normal !important;
  height: 30px; min-width: 0; padding: 0 10px 4px !important; font-size: 13px !important; line-height: 1 !important;
}
body[data-zone] .tt-btn:hover { border-image-source: var(--img-h) !important; }
body[data-zone] .tt-btn:active { border-image-source: var(--img-p) !important; padding-top: 2px !important; padding-bottom: 2px !important; }
body[data-zone="desert"] .tt-btn {
  --img: url(../assets/ui/v2/desert_n.png); --img-h: url(../assets/ui/v2/desert_h.png); --img-p: url(../assets/ui/v2/desert_p.png);
  color: #fff6e6 !important; text-shadow: 1px 1px 0 #1a0f06; }
.tt-g { width: 16px; height: 16px; border-radius: 50%; background: #fff; color: #4285f4; font: 700 12px/16px Arial, sans-serif; text-align: center; flex: none; text-shadow: none; }
.tt-full { width: 100% !important; height: 34px !important; }

/* ล็อกอินแล้ว: รูปโปรไฟล์ + จุดสถานะ (เขียว = เซฟออนไลน์แล้ว · เหลือง = กำลังส่ง · แดง = ส่งไม่ได้ เซฟในเครื่องยังอยู่) */
#btn-account.tt-av { position: relative; width: 34px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.tt-pic, .tt-bigpic { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; overflow: hidden; background: #2a3b4f; box-shadow: 0 0 0 2px #06101c, 0 0 0 3px #2c5070; }
.tt-pic { width: 24px; height: 24px; }
.tt-bigpic { width: 40px; height: 40px; flex: none; }
.tt-pic img, .tt-bigpic img { width: 100%; height: 100%; object-fit: cover; }
.tt-ini { font: 13px var(--pix, monospace); color: #eef7fd; }
.tt-dot { position: absolute; right: 2px; bottom: 2px; width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 2px #0a1826; }
.tt-dot.ok, .tt-st i.ok, .tt-row i.ok { background: #5fd06a; }
.tt-dot.sending, .tt-st i.sending, .tt-row i.sending { background: #e0c04c; }
.tt-dot.error, .tt-st i.error, .tt-row i.error { background: #e0453a; }
.tt-dot.off, .tt-st i.off, .tt-row i.off { background: #6b7c8f; }

/* เมนูบัญชี: ห้อยใต้ปุ่มรูป มีหางชี้ที่ปุ่ม (จ๊อบ: ไม่ลอยแยก) */
#acct-menu { position: absolute; z-index: 450; width: 250px !important; text-align: left; padding: 12px 14px 10px !important; overflow: visible !important; }
#acct-menu .tt-tip { position: absolute; top: -9px; width: 0; height: 0; border: 8px solid transparent; border-top: 0; border-bottom: 9px solid #2c5070; }
#acct-menu .tt-tip::after { content: ''; position: absolute; left: -6px; top: 3px; border: 6px solid transparent; border-top: 0; border-bottom: 7px solid #0a1826; }
#acct-menu .tt-mail { font: 12px var(--pix, monospace); color: #eef7fd; margin-bottom: 4px; word-break: break-all; }
.tt-st { font: 11px/1.4 var(--pix, monospace); color: #9fbad2; display: flex; align-items: flex-start; gap: 6px; margin-bottom: 10px; }
.tt-st i, .tt-row i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; margin-top: 3px; }

/* หน้าต่าง */
.c-btns .tt-wide { flex: 1; }
.tt-gsi { display: flex; justify-content: center; min-height: 44px; align-items: center; margin: 4px 0 6px; }
.tt-priv { display: block; text-align: center; margin: 2px 0 4px; font: 10px var(--pix, monospace); color: #7f9ab3; }
.tt-priv a { color: #7f9ab3; text-decoration: underline; }
#acct-menu .tt-priv { margin: 8px 0 0; }
/* ลบบัญชี: ลิงก์ตัวเล็กสีแดง ไม่ใช่ปุ่มใหญ่ กันกดพลาด (ถามยืนยันสองชั้นอีกที) */
body[data-zone] button.tt-del { display: block; margin: 8px auto 0; padding: 2px 4px; background: none; border: 0; cursor: pointer;
  font: 11px var(--pix, monospace); color: #ff9a80; text-decoration: underline; text-shadow: none !important; }
.tt-muted { font: 11px var(--pix, monospace); color: #9fbad2; }
.tt-warn { font: 11px/1.5 var(--pix, monospace); color: #ff9a80; }
.tt-pick { display: flex; gap: 10px; margin: 2px 0 10px; }
.tt-pick > div { flex: 1; padding: 8px; border: 2px solid #2c5070; border-radius: 6px; background: rgba(0,0,0,.25); font: 11px/1.5 var(--pix, monospace); color: #cfe0ee; text-align: left; }
.tt-pick b { display: block; color: #ffd27a; font-weight: 400; margin-bottom: 2px; }
#halt { z-index: 700; }
/* ปุ่มชื่อยาว (เลือกหมู่บ้าน) เรียงลงทีละแถวเต็มกว้าง ตัวหนังสือไม่ล้นปุ่มบนมือถือ */
body[data-zone] .confirm-box .c-btns.tt-stack { flex-direction: column; }
body[data-zone] .confirm-box .c-btns.tt-stack .c-btn { width: 100%; flex: none; }

/* มือถือ: หัวข้อ Account บนสุดของหน้า Menu · ปุ่มบนแถบบนซ่อน */
.tt-macct { display: flex; flex-direction: column; gap: 8px; }
.tt-row { display: flex; align-items: center; gap: 10px; padding: 8px; background: var(--in-bg, #0a1826); border: 2px solid var(--in-edge, #06101c); border-radius: 6px; }
.tt-row .t { flex: 1; min-width: 0; font: 12px/1.4 var(--pix, monospace); color: #eef7fd; word-break: break-all; }
.tt-row .t span { color: #9fbad2; display: flex; align-items: flex-start; gap: 6px; word-break: normal; }
body.m-mode #btn-account { display: none !important; }

/* ---------- ชื่อหมู่บ้าน (5 ต.ค. · villagename.js) ---------- */
#vname-tag { flex: 1 1 0; min-width: 0; display: flex; justify-content: flex-end; align-items: center; align-self: center;
  margin: 0 4px 0 0; padding: 0; border: 0; background: none; pointer-events: none; }
#vname-tag .vn-box { pointer-events: auto; cursor: pointer; min-width: 0; max-width: 100%; height: 40px; box-sizing: border-box; padding: 0 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 13px/36px var(--pix, monospace); letter-spacing: 1px; color: #eef7fd;
  background: #08131f; border: 2px solid #06101c; box-shadow: inset 0 2px 0 #183049, inset 0 -1px 0 #2c5070; }
#vname-tag .vn-box:hover { color: #fff; box-shadow: inset 0 2px 0 #24476a, inset 0 -1px 0 #4a7cab, 0 0 0 1px #4a7cab; }
body[data-zone="desert"] #vname-tag .vn-box { background: #170e06; box-shadow: inset 0 2px 0 #3a2814, inset 0 -1px 0 #6e5030; }
body[data-zone="desert"] #vname-tag .vn-box:hover { box-shadow: inset 0 2px 0 #54391c, inset 0 -1px 0 #9a7444, 0 0 0 1px #9a7444; }
#vname-tag.hidden { display: none; }
.vname-box .vname-why { margin-bottom: 8px; color: var(--bad); }
.vname-row { display: flex; gap: 6px; margin-top: 4px; }
.vname-row input { flex: 1; min-width: 0; height: 34px; box-sizing: border-box; padding: 4px 8px; font: 14px var(--pix, monospace); letter-spacing: 1px; text-align: center;
  color: var(--text); background: rgba(8,10,16,.85); border: 2px solid var(--frame-dark); }
.vname-row input:focus { outline: 2px solid var(--ice); outline-offset: 0; }
body[data-zone] .confirm-box .vname-row .c-btn, .vname-row .c-btn { flex: none !important; width: 44px !important; min-width: 0 !important; font-size: 15px; }
.vname-err { min-height: 16px; margin-top: 6px; font-size: 11px; color: var(--bad); }
.vname-box .c-btns { margin-top: 6px; }
body.m-mode #vname-tag { display: none; }
.m-vname { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 2px 0 8px; padding: 8px 10px; cursor: pointer;
  font: 13px var(--pix, monospace); letter-spacing: 1px; color: #e9d6a8; background: rgba(8,10,16,.6); border: 2px solid var(--frame-dark); }
.m-vname span { font-size: 11px; color: var(--muted); }
