/* ═══ เมนูบน 4 หัวข้อ + แผงเมนูย่อยกระจก (2026-10-26 · เดิม 9 ช่องจนล้น) — prefix nav-dd / nav-mega / mg- ═══
   เดสก์ท็อป: ชี้เมาส์/กด/คีย์บอร์ดเปิดแผง · มือถือ (≤1080): อยู่ในเมนูแฮมเบอร์เกอร์ กดหัวข้อเพื่อกาง */
.nav-links { gap: 6px; }
.nav-links > li { position: relative; }
.nav-links a, .nav-dd-btn { font-size: .95rem; }
.nav-dd-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 99px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 500; white-space: nowrap; transition: color .2s, background .2s; }
.nav-dd-btn:hover, .nav-dd.open .nav-dd-btn, .nav-dd-btn.on { color: #fff; background: rgba(33, 160, 64, .16); }
.nav-dd-btn.on { box-shadow: inset 0 0 0 1px rgba(182, 240, 156, .25); }
.nav-caret { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .3s cubic-bezier(.22, 1, .36, 1); opacity: .8; }
.nav-dd.open .nav-caret, .nav-dd:hover .nav-caret { transform: translateY(1px) rotate(225deg); }

/* แผง */
.nav-mega { position: absolute; top: calc(100% + 14px); left: 50%; z-index: 60; width: 300px; translate: -50% 0; padding: 10px; border-radius: 20px;
  background: linear-gradient(160deg, #0c2418, #06120d 70%); border: 1px solid var(--border-hi); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .03) inset, 0 0 40px rgba(33, 160, 64, .18);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.98); transform-origin: top center; transition: opacity .22s ease, transform .3s cubic-bezier(.22, 1, .36, 1), visibility 0s .3s; }
.nav-mega.wide { width: 560px; }
.nav-mega::before { content: ""; position: absolute; top: -16px; left: 0; right: 0; height: 16px; } /* สะพานให้เมาส์เลื่อนลงแผงไม่หลุด */
.nav-mega::after { content: ""; position: absolute; top: -7px; left: 50%; width: 12px; height: 12px; translate: -50% 0; rotate: 45deg; background: #0c2418; border-left: 1px solid var(--border-hi); border-top: 1px solid var(--border-hi); }
.nav-dd.open .nav-mega { opacity: 1; visibility: visible; transform: none; transition: opacity .22s ease, transform .3s cubic-bezier(.22, 1, .36, 1), visibility 0s; }
@media (hover: hover) and (min-width: 1081px) {
  .nav-dd:hover .nav-mega, .nav-dd:focus-within .nav-mega { opacity: 1; visibility: visible; transform: none; transition: opacity .22s ease, transform .3s cubic-bezier(.22, 1, .36, 1), visibility 0s; }
}
.nav-mega-in { display: grid; grid-template-columns: 1fr; gap: 4px; }
.nav-mega.wide .nav-mega-in { grid-template-columns: 1fr 1fr; }
.mg-item { display: flex !important; align-items: center; gap: 12px; padding: 10px 12px !important; border-radius: 14px !important; color: var(--text) !important; background: none; white-space: normal !important; transition: background .2s, transform .25s cubic-bezier(.22, 1, .36, 1) !important; }
.mg-item:hover, .mg-item:focus-visible, .mg-item.on { background: linear-gradient(120deg, rgba(33, 160, 64, .22), rgba(33, 160, 64, .05)) !important; transform: translateX(3px); }
.mg-item.on { box-shadow: inset 2px 0 0 0 transparent, 0 0 0 1px rgba(182, 240, 156, .25) inset; }
.nav-dd.open .mg-item, .nav-dd:hover .mg-item { animation: mg-in .4s cubic-bezier(.22, 1, .36, 1) both; animation-delay: calc(var(--i) * 35ms); }
@keyframes mg-in { from { opacity: 0; transform: translateY(6px); } }
.mg-ic { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem; color: var(--accent);
  background: radial-gradient(circle at 30% 25%, rgba(182, 240, 156, .25), rgba(33, 160, 64, .12) 60%); border: 1px solid rgba(182, 240, 156, .22); position: relative; overflow: hidden; }
.mg-ic::after { content: ""; position: absolute; inset: -40% auto -40% -60%; width: 40%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); transform: skewX(-20deg); opacity: 0; }
.mg-item:hover .mg-ic { box-shadow: 0 0 18px rgba(102, 221, 79, .55); color: #fff; }
.mg-item:hover .mg-ic::after { animation: mg-shine .7s ease; }
.mg-item:hover .mg-ic .ico { animation: mg-pop .5s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes mg-shine { from { left: -60%; opacity: 1; } to { left: 130%; opacity: 0; } }
@keyframes mg-pop { 40% { transform: scale(1.25) rotate(-8deg); } }
.mg-tx { display: grid; min-width: 0; line-height: 1.3; }
.mg-tx b { font-size: .92rem; font-weight: 600; }
.mg-tx small { font-size: .74rem; color: var(--muted); }
.mg-foot { display: flex !important; align-items: center; gap: 8px; margin-top: 8px; padding: 9px 12px !important; border-radius: 12px !important; font-size: .78rem !important; color: var(--muted) !important; background: rgba(255, 255, 255, .03) !important; border: 1px dashed rgba(182, 240, 156, .2); white-space: normal !important; }
.mg-foot b { color: #ffe08a; font-family: var(--mono); font-weight: 600; }
.mg-foot:hover { color: #fff !important; border-color: rgba(182, 240, 156, .45); }

/* เมนู 4 หัวข้อไม่ต้องย่อแล้ว — คืนกฎย่อเดิมของเมนู 9 ช่อง */
@media (min-width: 1081px) {
  .nav-links a, .nav:has(.me) .nav-links a { padding: 8px 14px; font-size: .95rem; }
  .nav .live-pill { display: inline-grid; }
}
@media (min-width: 1081px) and (max-width: 1180px) { .nav:has(.me) .live-pill { display: none; } }

/* มือถือ: หัวข้อกางเป็นรายการในเมนูแฮมเบอร์เกอร์ */
@media (max-width: 1080px) {
  .nav-links { gap: 2px; min-width: 0; max-width: 100%; }
  .nav-links > li, .nav-mega, .nav-mega-in, .mg-item, .mg-tx { min-width: 0; max-width: 100%; }
  .nav-dd-btn { width: 100%; justify-content: space-between; padding: 12px 14px; border-radius: 14px; }
  .nav-mega, .nav-mega.wide { position: static; width: auto; translate: none; padding: 0 0 6px; margin: 2px 0 6px; border: 0; box-shadow: none; background: none; backdrop-filter: none; -webkit-backdrop-filter: none;
    display: none; opacity: 1; visibility: visible; transform: none; transition: none; }
  .nav-mega::before, .nav-mega::after { display: none; }
  .nav-dd.open .nav-mega { display: block; }
  .nav-mega.wide .nav-mega-in { grid-template-columns: 1fr; }
  .mg-item { padding: 9px 10px !important; }
  .mg-foot { margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-mega, .nav-caret, .mg-item { transition: none !important; }
  .mg-item, .mg-ic::after, .mg-ic .ico { animation: none !important; }
}
