/* 🐉 มังกรแนะนำ (lib_dragon.php): แถบบนกระดาน + ป๊อปอัปวันละครั้ง */
.dg-strip { position: relative; overflow: hidden; isolation: isolate; border-radius: 20px; padding: 18px 18px 20px; margin: 0 0 18px;
  background: #04140d; border: 1px solid rgba(245, 197, 66, .45); box-shadow: 0 18px 50px rgba(0, 0, 0, .45), inset 0 0 60px rgba(245, 197, 66, .08); }
.dg-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; z-index: -2; opacity: .55; animation: dgKen 26s ease-in-out infinite alternate; }
.dg-strip::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(4, 20, 13, .96) 0%, rgba(4, 20, 13, .7) 45%, rgba(4, 20, 13, .45) 100%); }
.dg-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.dg-ava { width: 74px; height: 74px; object-fit: contain; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .6)); animation: dgBob 3.2s ease-in-out infinite; }
.dg-head h2 { margin: 0; font-size: 26px; line-height: 1.15; background: linear-gradient(180deg, #fff6c8, #f5c542 60%, #c99a1c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dg-head p { margin: 2px 0 0; color: var(--soft); font-size: 14px; }
.dg-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.dg-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; text-decoration: none; color: var(--text);
  background: rgba(8, 30, 21, .82); border: 1px solid var(--line2); backdrop-filter: blur(4px); transition: transform .18s, border-color .18s, box-shadow .18s; }
.dg-card:hover { transform: translateY(-3px); border-color: #f5c542; box-shadow: 0 12px 30px rgba(245, 197, 66, .18); }
.dg-card.first { border-color: #f5c542; box-shadow: 0 0 0 1px rgba(245, 197, 66, .4), 0 0 40px rgba(245, 197, 66, .2); }
.dg-crown, .dg-no { align-self: flex-start; font-size: 12.5px; font-weight: 700; padding: 2px 10px; border-radius: 20px; }
.dg-crown { background: linear-gradient(180deg, #fff3b0, #f5c542 55%, #c99a1c); color: #2a1a00; }
.dg-no { background: var(--panel2); color: var(--soft); }
.dg-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 6px; }
.dg-teams > i, .dgp-teams > i { font-style: normal; font-weight: 800; color: #ff7a59; align-self: center; font-size: 15px; }
.dg-t { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; min-width: 0; transition: opacity .2s; }
.dg-t .bd { width: 54px; height: 54px; }
.dg-t .bd.mono { font-size: 18px; }
.dg-t small { font-size: 12.5px; font-weight: 600; line-height: 1.2; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dg-t.win .bd { filter: drop-shadow(0 0 12px rgba(245, 197, 66, .9)); }
.dg-t.win small { color: #f5c542; }
.dg-t.lose { opacity: .55; }
.dg-pick { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 10px; border-radius: 12px; background: rgba(245, 197, 66, .1); border: 1px solid rgba(245, 197, 66, .45); }
.dg-pick em { font-style: normal; font-size: 12.5px; color: var(--soft); }
.dg-pick b { font-size: 18px; line-height: 1.25; color: #fff3b0; }
.dg-meta { display: flex; align-items: center; gap: 8px; }
.dg-conf { --p: 50; position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(#f5c542 calc(var(--p) * 1%), rgba(255, 255, 255, .1) 0); }
.dg-conf::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: #0a1e18; }
.dg-conf b { position: relative; font-size: 13px; font-family: var(--mono); }
.dg-conf.big { width: 92px; height: 92px; } .dg-conf.big::before { inset: 9px; }
.dg-conf.big b { font-size: 24px; margin-top: -10px; } .dg-conf small { position: absolute; bottom: 20px; font-size: 11px; color: var(--soft); }
.dg-ko { margin-left: auto; font-size: 13px; color: var(--soft); white-space: nowrap; }

/* ---------- ป๊อปอัป ---------- */
.dgp { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 16px; background: rgba(0, 6, 3, .72); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .3s; }
.dgp.on { opacity: 1; }
.dgp-box { position: relative; width: min(470px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px 20px 16px; border-radius: 24px; text-align: center;
  background: radial-gradient(120% 70% at 50% 0%, #15402c 0%, #0a1e18 55%, #051310 100%); border: 2px solid #f5c542;
  box-shadow: 0 0 0 6px rgba(245, 197, 66, .12), 0 30px 80px rgba(0, 0, 0, .7), 0 0 80px rgba(245, 197, 66, .25);
  transform: translateY(40px) scale(.92); transition: transform .45s cubic-bezier(.34, 1.56, .64, 1); }
.dgp.on .dgp-box { transform: none; }
.dgp-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line2); background: rgba(0, 0, 0, .4); color: var(--text); font-size: 16px; cursor: pointer; z-index: 2; }
.dgp-dragon { width: 190px; height: 190px; object-fit: contain; margin: -6px auto -18px; display: block; filter: drop-shadow(0 14px 24px rgba(0, 0, 0, .6)); animation: dgBob 3s ease-in-out infinite; }
.dgp-say { position: relative; display: inline-flex; flex-direction: column; padding: 10px 18px; border-radius: 16px; background: #fff8dc; color: #2a1a00; box-shadow: 0 8px 20px rgba(0, 0, 0, .4); }
.dgp-say::before { content: ''; position: absolute; top: -9px; left: 50%; margin-left: -9px; border: 9px solid transparent; border-top: 0; border-bottom-color: #fff8dc; }
.dgp-say small { font-size: 13px; font-weight: 600; opacity: .75; } .dgp-say b { font-size: 21px; line-height: 1.25; }
.dgp-match { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; padding: 14px; border-radius: 18px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line2); }
.dgp-lg { font-size: 13px; color: var(--soft); }
.dgp-teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; }
.dgp-teams .bd { width: 72px; height: 72px; }
.dgp-teams .dg-t small { font-size: 14px; }
.dgp-pick { display: flex; flex-direction: column; padding: 10px; border-radius: 14px; background: linear-gradient(180deg, rgba(245, 197, 66, .22), rgba(245, 197, 66, .06)); border: 2px solid #f5c542; }
.dgp-pick em { font-style: normal; font-size: 13px; color: var(--soft); } .dgp-pick b { font-size: 24px; color: #fff3b0; line-height: 1.25; }
.dgp-row { display: flex; gap: 14px; align-items: center; text-align: left; }
.dgp-why { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.dgp-why li { position: relative; padding-left: 24px; }
.dgp-why li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: #22c55e; color: #032; font-weight: 800; font-size: 11px; display: grid; place-items: center; }
.dgp-tier { font-size: 13px; color: var(--soft); }
.dgp-cta { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.dgp-btn { display: block; padding: 12px 16px; border-radius: 14px; font-weight: 700; text-decoration: none; font-size: 16px; }
.dgp-btn.gold { background: linear-gradient(180deg, #fff3b0, #f5c542 55%, #c99a1c); color: #2a1a00; box-shadow: 0 6px 0 #6b4e05, 0 0 30px rgba(245, 197, 66, .4); }
.dgp-btn.ghost { color: #fff; border: 1px solid rgba(245, 197, 66, .6); background: rgba(0, 0, 0, .3); }
.dgp-later { margin-top: 10px; background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.dgp-note { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }
.dgp-fab { position: fixed; left: 14px; bottom: 16px; z-index: 8000; display: flex; align-items: center; gap: 6px; padding: 4px 14px 4px 4px; border-radius: 40px; cursor: pointer;
  background: linear-gradient(180deg, #15402c, #0a1e18); border: 2px solid #f5c542; color: #fff3b0; font: inherit; font-weight: 700; font-size: 14px; box-shadow: 0 10px 26px rgba(0, 0, 0, .5); }
.dgp-fab img { width: 46px; height: 46px; object-fit: contain; animation: dgBob 3s ease-in-out infinite; }
@keyframes dgBob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }
@keyframes dgKen { from { transform: scale(1.02) } to { transform: scale(1.12) } }
@media (max-width: 900px) {
  .dg-cards { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .dg-card { scroll-snap-align: start; }
  .dg-head h2 { font-size: 21px; } .dg-ava { width: 58px; height: 58px; }
}
@media (prefers-reduced-motion: reduce) { .dg-bg, .dg-ava, .dgp-dragon, .dgp-fab img { animation: none; } .dgp-box { transition: none; } }

/* 🏆 คู่ดังวันนี้ */
.bg-strip { margin: 0 0 18px; padding: 14px 16px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line2); }
.bg-strip h2 { margin: 0 0 10px; font-size: 20px; } .bg-strip h2 small { font-size: 13px; color: var(--soft); font-weight: 400; margin-left: 6px; }
.bg-row { display: grid; grid-auto-flow: column; grid-auto-columns: 210px; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.bg-it { scroll-snap-align: start; display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line2); text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.bg-it:hover { border-color: #f5c542; transform: translateY(-2px); }
.bg-it.live { border-color: #ef4444; }
.bg-ko { font-family: var(--mono); font-weight: 700; color: #f5c542; font-size: 15px; }
.bg-tm { display: flex; align-items: center; gap: 8px; min-width: 0; } .bg-tm .bd { width: 26px; height: 26px; }
.bg-tm b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bg-it small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bg-it em { font-style: normal; font-size: 12.5px; font-weight: 700; color: #2a1a00; background: #f5c542; border-radius: 8px; padding: 2px 8px; align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bg-it em.soft { background: var(--line2); color: var(--soft); }

/* ปิดป๊อปอัปแล้ว = หายจริง ไม่บังการแตะทั้งหน้า (display ของ .dgp ทับ [hidden] ของเบราว์เซอร์) */
.dgp[hidden], .dgp-fab[hidden] { display: none !important; }
.dgp:not(.on) { pointer-events: none; }
