/* ═══ ป้ายแจ้งมาตรฐานเดียวทั้งเกม (notify.js · popup-std-1022 · ผู้ใช้ 22 ต.ค. "ขนาดเดียว ตำแหน่งเดียว คลีน ดูง่าย") ═══
   ไฟล์นี้ไฟล์เดียวเป็นเจ้าของตำแหน่ง/ขนาด/หน้าตาของ #toast (กล่องซ้อน) และ .ntf (ป้าย) — ห้ามตั้งกฎ #toast ในไฟล์อื่น
   หน้าตา = ป้ายเป้าหมายมอน (ui-pop.css #target · ผู้ใช้ชม): พื้นกระจกเข้ม · ขอบทองบาง · วงไอคอนซ้าย · ชื่อทอง + บรรทัดรองเทาอ่อน
   ขนาด: กว้างคงที่ (มือถือแนวนอน 320 · แท็บเล็ต/คอม 380 · ไม่คูณ --ui) · สูง ≤ 2 บรรทัด + วงไอคอน 34px
   ตำแหน่ง: จอสัมผัส = กลางจอ ใต้โซนบนกลางและใต้มินิแมพ (--hz-tc-b / --hz-tr-b จาก ui-root.js)
            คอม = กลางบนใต้ป้ายมอน · เปิดหน้าต่าง/บทสอน (จอสัมผัส) = ล่างกลางเหนือแถบปุ่มท้ายหน้าต่าง
   ไม่มี animation ค้าง — เข้า/ออกด้วย opacity (ผู้ใช้ 7 ต.ค.: ป้ายต้องนิ่ง ไม่เด้ง) */
#toast.ntf-stack {
  --ntf-w: 380px;
  position: fixed; z-index: var(--z-popup, 300); left: 50%; top: 96px; bottom: auto; translate: -50% 0; transform: none;
  width: min(var(--ntf-w), calc(100vw - 16px)); max-width: none; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  margin: 0; padding: 0; background: none; border: 0; box-shadow: none; opacity: 1; pointer-events: none;
  font: 500 12px/1.3 var(--font); color: var(--pop-ink, #fff); text-align: left; -webkit-text-stroke: 0; text-shadow: none;
}
#toast.ntf-stack:empty { display: none; }

/* ── จอสัมผัส ── */
html.touch-ui #toast.ntf-stack {
  /* แถวบนสุดระหว่างการ์ดตัวละครกับปุ่มเมนู/มินิแมพแคบเกิน (844×390 เหลือ ~150px · iPad ~180px) → ลงใต้แถวนั้น
     (ใต้โซนบนกลางและใต้มินิแมพ) กลางจอ — ระหว่างแผงเป้าหมายซ้ายกับปุ่มสกิลขวา (วัด 23 ต.ค. tools/shot-popup-std.mjs) */
  left: 50%;
  top: calc(max(var(--hz-tc-b, 0px), var(--hz-tr-b, 0px), var(--sa-t, 0px)) + 6px);
  width: min(var(--ntf-w), max(240px, calc(100vw - 2 * var(--hz-tl-r, 240px) - 12px)));   /* ไม่ทับแผงเป้าหมายซ้าย (กว้างเท่าการ์ด --hz-tl-r) */
}
@media (max-height: 599px) { html.touch-ui #toast.ntf-stack { --ntf-w: 320px; } }
/* บทสอน: บนเป็นของการ์ดบทสอน → ล่างกลาง */
html.touch-ui.tut-on #toast.ntf-stack { left: 50%; top: auto; bottom: calc(var(--sa-b, 0px) + 66px); flex-direction: column-reverse; }
/* เปิดหน้าต่าง (Screen Shell): ใต้หัวหน้าต่าง (หัว 44 + ขอบ) — ไม่ทับแท็บ/ปุ่มปิดบนหัว (skill-easy-1105 · หัวหน้างาน 5 พ.ย.) และไม่ทับแถบปุ่มท้ายหน้าต่าง (bag2 G6)
   ย้ายจาก ui-bag2.css (เดิมขอบบนสุด = ทับแท็บหัวหน้าต่าง) มาไว้ไฟล์เจ้าของ #toast */
html.touch-ui.win-open:not(.tut-on) #toast.ntf-stack { left: 50%; top: calc(var(--sa-t, 0px) + 60px); bottom: auto; flex-direction: column; }
/* ตู้ระฆังโชค/ร้านเพชร/แผนที่ใหญ่ (overlay) ไม่มีแถบปุ่มล่าง แต่หัวตู้อยู่บน → ใต้หัวตู้ */
html.touch-ui.overlay-open:not(.win-open) #toast.ntf-stack { left: 50%; top: calc(var(--sa-t, 0px) + 60px); bottom: auto; flex-direction: column; }
/* หอระฆัง (belfry): ใต้การ์ดภารกิจ · มีฉากชนะ = ชิดบน (z 9200 = ค่าเดิมของ ui-belfry.css ให้ลอยเหนือฉากชนะ) */
html.in-bf:not(.win-open):not(.overlay-open) #toast.ntf-stack { left: 50%; top: calc(var(--bf-hud-b, 96px) + 6px); }
html.in-bf[data-bf]:not(.win-open):not(.overlay-open) #toast.ntf-stack { top: calc(var(--sa-t, 0px) + 8px); z-index: 9200; }
/* โหมดเดินเล่นแนวตั้ง (portrait-walk-1024 · #hud ซ่อนทั้งชั้น): ป้ายแจ้งยังเห็น — ใต้แถวไอคอนโปรไฟล์/ปุ่มวิธีเล่นเต็มจอ · ล่างเป็นของจอย
   (ตัวแปร --hz-* ตอนนี้มาจากโซน HUD ที่ซ่อนอยู่ ใช้ไม่ได้) */
/* notify-calm-1026 (ผู้ใช้ 26 ต.ค. "ป้ายรกจอ บังเกม · หอระฆังในมือถือยังแอบบัง"): มือถือแนวนอนระหว่างเล่น = ล่างกลาง
   ระหว่างจอย/แชทซ้ายกับปุ่มสกิลขวา — ใต้เท้าตัวละคร ไม่ทับตัวละคร/มอนข้างหน้า/การ์ดภารกิจ (เดิมกลางบนใต้มินิแมพ ≈ หัวตัวละคร)
   ขึ้นทีละใบ (notify-core MAX_VISIBLE.phone) · ฉากชนะหอระฆัง [data-bf] คงที่เดิม · ?ntf2=0 = แบบเดิม (ไม่มีคลาส ntf2) */
@media (max-height: 599px) {
  html.ntf2.touch-ui:not(.win-open):not(.tut-on):not(.overlay-open):not(.pwalk):not([data-bf]) #toast.ntf-stack {
    --ntf-w: 360px;   /* รอบ 2: ล่างกลางมีที่ ~400px (ระหว่างจอยกับปุ่มสกิล) — กว้างขึ้นให้ข้อความป้ายมีปุ่มไม่ถูกตัดสั้น */
    left: 50%; top: auto; bottom: calc(var(--sa-b, 0px) + 8px); flex-direction: column-reverse;
    width: min(var(--ntf-w), max(240px, calc(100vw - 2 * max(var(--hz-bl-r, 240px), var(--hz-br-l, 240px)) - 12px)));
  }
}
html.touch-ui.pwalk #toast.ntf-stack { visibility: visible; left: 50%; top: calc(var(--sa-t, 0px) + 140px); bottom: auto; flex-direction: column; width: min(var(--ntf-w), calc(100vw - 24px)); }

/* ── ป้าย ── */
.ntf {
  display: flex; align-items: center; gap: 9px; min-height: 46px; box-sizing: border-box; padding: 6px 10px 6px 6px;
  border-radius: 14px; background: var(--pop-bg, #15202ee6); color: var(--pop-ink, #fff);
  box-shadow: 0 4px 14px #0006, inset 0 0 0 1.5px var(--ntf-ring, #e8b64a);
  pointer-events: none; opacity: 1; transition: opacity .16s ease-out; animation: ntfIn .14s ease-out;
}
@keyframes ntfIn { from { opacity: 0; } }
.ntf.out { opacity: 0; transition-duration: .16s; }
.ntf.tap, .ntf.act { pointer-events: auto; }
.ntf.tap { cursor: pointer; }
.ntf.k-good { --ntf-ring: #6cc58e; } .ntf.k-warn { --ntf-ring: #ff8a6a; } .ntf.k-hint { --ntf-ring: #7cc6ff; }
.ntf.k-reward { --ntf-ring: #ffd76a; box-shadow: 0 4px 14px #0006, 0 0 12px #ffd76a55, inset 0 0 0 1.5px #ffd76a; }
.ntf-ic {
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 38%, #43566c, #1c2634 72%); box-shadow: 0 0 0 2px var(--ntf-ring, #e8b64a);
}
.ntf-ic > img, .ntf-ic > svg { width: 30px; height: 30px; object-fit: contain; display: block; }
.ntf-ic > .ui-ic { width: 27px; height: 27px; }   /* ไอคอนชุดเกมในวง 34px — อ่านออกบนมือถือ (รอบ 2) */
.ntf-ic .ntf-em { font-style: normal; font-size: 19px; line-height: 1; }
.ntf-ic .stp-env { --ew: 26px; }
.ntf-tx { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; }
.ntf-tx b { color: #ffd97a; font: 600 14px/1.25 var(--font-head, var(--font)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ntf-tx small { color: var(--pop-soft, #c9d4e2); font: 500 12px/1.3 var(--font); white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
/* บรรทัดเดียว (ไม่มีบรรทัดรอง) = หัวยาวได้ 2 บรรทัด */
.ntf.one .ntf-tx b { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.ntf-tx kbd { font: 600 11px/1 var(--font); padding: 1px 5px; border-radius: 4px; background: #ffffff22; box-shadow: inset 0 0 0 1px #ffffff44; }
.ntf-n { flex: none; font: 700 12px/1 var(--font); font-style: normal; color: #15202e; background: var(--ntf-ring, #e8b64a); border-radius: 9px; padding: 3px 6px; }
.ntf-go { flex: none; font: 700 20px/1 var(--font); font-style: normal; color: var(--ntf-ring, #e8b64a); padding: 0 2px; }
.ntf-b {
  flex: none; min-height: 34px; padding: 0 12px; border-radius: 10px; border: 0; cursor: pointer; white-space: nowrap;
  font: 600 13px/1 var(--font-head, var(--font)); color: #fff; background: linear-gradient(#3d8a8e, #2f6f73); box-shadow: 0 2px 0 #1d4a4d;
}
.ntf-b.alt { background: #ffffff1a; box-shadow: inset 0 0 0 1px #ffffff40; }
.ntf-x { flex: none; width: 30px; height: 30px; margin: -4px -6px -4px -4px; border: 0; border-radius: 50%; background: transparent; color: #c9d4e2; font-size: 18px; line-height: 1; cursor: pointer; }
/* จอสัมผัส: ปุ่มกดโดนง่าย ≥ 44px (ด่าน check-hud-cover) */
html.touch-ui .ntf.act { min-height: 48px; padding-block: 2px; }
html.touch-ui .ntf-b { min-height: 44px; min-width: 52px; }
html.touch-ui .ntf-x { width: 44px; height: 44px; margin: -2px -8px -2px -6px; }
/* notify-calm-1026 รอบ 2 (ผู้ใช้: "ปุ่มในนั้นกดได้ แต่ปุ่มแอบใหญ่ติดกรอบไปนิด"): ป้ายมีปุ่ม = ระยะในเท่ากันทุกด้าน 6px
   (เดิมจอสัมผัส บน/ล่าง 2px · × ติดลบล้นขอบขวา) · ปุ่ม ≥ 44px ยังคงไว้ · ใบสูงตามปุ่ม 44 + 6 + 6 · ?ntf2=0 = แบบเดิม */
html.ntf2 .ntf.act { padding: 6px; }
html.ntf2 .ntf.act .ntf-tx { padding-right: 2px; }
html.ntf2 .ntf-x { margin: 0; border-radius: 10px; }
html.ntf2 .ntf-x:hover { background: #ffffff14; }
html.ntf2.touch-ui .ntf.act { min-height: 56px; padding: 6px; }
html.ntf2.touch-ui .ntf-x { margin: 0; }
html.ntf2.touch-ui .ntf-b { padding: 0 12px; }
@media (prefers-reduced-motion: reduce) { .ntf { animation: none; transition: none; } }
/* ป้ายนำทาง/สอน (kind hint) บรรทัดเดียวยาว = คำแนะนำ ไม่ใช่หัวข่าว — ตัวขาวอุ่น 13px อ่านง่ายกว่าทองตัวหนา */
.ntf.one.k-hint .ntf-tx b { color: #fff3d6; font: 500 13px/1.3 var(--font); }
/* มือถือแนวนอน (ใบกว้าง 320): ปุ่มรองซ่อน — เหลือปุ่มหลัก 1 + × ให้ข้อความยังอ่านได้ (ปุ่มรองทำได้จากหน้าต่างปกติ) */
@media (max-height: 599px) { html.touch-ui .ntf-b.alt { display: none; } }
/* ไอคอนพิเศษในวง: ตราค้นพบคอมโบ (stamp-window.js comboToast) = ตรา + ไอคอนหมวดซ้อนกลาง */
.ntf-ic .stt-seal { position: relative; width: 32px; height: 32px; display: block; }
.ntf-ic .stt-seal > img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ntf-ic .stt-sgi { position: absolute; left: 50%; top: 40%; width: 15px; height: 15px; translate: -50% -50%; }
/* หน้าประตูหอระฆัง (belfry.js · ใบ belfry-reward-1024 E): กล่อง toast ลงล่างจอขณะเปิด — ป้ายแนะนำตัวละครใหม่เคยทับชื่อดัน */
html:has(#windows .win[data-win="belfry"]:not([hidden]) .bfe) #toast.ntf-stack { top: auto; bottom: 8px; }   /* ล่างสุด (ทับแถบลัดชั่วครู่) — ไม่ทับชื่อดัน/ปุ่มหาปาร์ตี้ */

/* info-tags-1108: ป้ายสั้น "คอมโบแสตมป์ (ไม่ใช่สกิล)" ครั้งแรกต่อรอบเล่น (stamp-combo-ui comboProcHint) — บรรทัดผลยาว 2 บรรทัดได้ */
.ntf.ntf-cbx .ntf-tx small { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.ntf.ntf-cbx .ntf-tx b { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }

/* player-fixes-1115: คำใบ้ตั้งค่า AUTO — ข้อความตัดบรรทัดใหม่ได้ ไม่มี ellipsis (ผู้เล่นต้องอ่านครบ) */
.ntf.ntf-auto .ntf-tx b, .ntf.ntf-auto .ntf-tx small { white-space: normal; overflow: visible; text-overflow: clip; display: block; -webkit-line-clamp: unset; line-clamp: unset; overflow-wrap: break-word; }
/* ปุ่มลงบรรทัดล่างเต็มแถว — ข้อความได้ความกว้างเกือบทั้งการ์ด (จอ 667 การ์ดแคบ 240px · ห้ามหักคำทีละตัวอักษร) */
.ntf.ntf-auto { flex-wrap: wrap; align-items: flex-start; }
.ntf.ntf-auto .ntf-tx { flex: 1 1 110px; min-width: 110px; }
.ntf.ntf-auto .ntf-x { order: 2; }
.ntf.ntf-auto .ntf-b { order: 3; flex: 1 1 100%; }
