/* เซียนล้มโต๊ะ: โทนดำทอง รูปแบบเดียวกันทุกหน้า (หัวเว็บ ปุ่ม การ์ด ตาราง) */
:root {
  --bg: #07090d;
  --bg-2: #0d1420;
  --card: #0e141f;
  --surface: rgba(255, 255, 255, .045);
  --surface-hi: rgba(255, 255, 255, .08);
  --gold: #2f9bff;
  --gold-soft: #1f6fc0;
  --gold-hi: #7cc4ff;
  --blue: #7cc4ff;
  --fg: #eef3fa;
  --muted: #9aa9bd;
  --line: rgba(47, 155, 255, .28);
  --live: #ff4d4d;
  --font-display: "Prompt", system-ui, sans-serif;
  --font-body: "Bai Jamjuree", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; font-family: var(--font-body); font-size: 16px; line-height: 1.55; color: var(--fg);
  background-color: var(--bg);
  background-image: radial-gradient(900px 420px at 50% -120px, rgba(47, 155, 255, .14), transparent 70%);
  background-repeat: no-repeat;
}
.wrap, .bar { max-width: 1120px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)); }
a { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* หัวเว็บ + เมนู */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(7, 9, 13, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 18px; padding-block: 10px; }
.brand { display: block; line-height: 0; flex: none; }
.brand img { height: 44px; width: auto; display: block; }
.menu { display: flex; gap: 8px; margin-left: auto; overflow-x: auto; scrollbar-width: none; padding-block: 2px; }
.menu::-webkit-scrollbar { display: none; }
.menu a {
  white-space: nowrap; text-decoration: none; color: var(--fg); font-family: var(--font-display); font-weight: 500; font-size: .92rem;
  padding: 8px 16px; border: 1px solid transparent; border-radius: 8px; background: var(--surface);
}
.menu a:hover { border-color: var(--gold-soft); }
.menu a[aria-current] { color: var(--gold); border-color: var(--gold); background: rgba(47, 155, 255, .1); }
@media (max-width: 640px) { .brand img { height: 36px; } .menu a { padding: 7px 12px; font-size: .85rem; } }

/* ส่วนหัวเรื่องของหน้าตารางบอล/ผลบอล */
.intro { padding-block: 28px 12px; }
.eyebrow { color: var(--gold); letter-spacing: .18em; font-size: .75rem; text-transform: uppercase; margin: 0 0 10px; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1.15; margin: 0 0 6px; text-wrap: balance; }
h1 b, h1 em { font-style: normal; color: var(--gold); }
h2 { font-family: var(--font-display); text-wrap: balance; }
.date { color: var(--muted); margin: 0; }

footer { border-top: 1px solid var(--line); margin-top: 48px; padding-block: 28px; color: var(--muted); font-size: .85rem; }

/* ปุ่ม */
.btn {
  display: inline-block; font: inherit; font-family: var(--font-display); font-weight: 600; text-decoration: none; cursor: pointer;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #04121f; border: 0; border-radius: 8px; padding: 11px 22px;
  transition: transform .15s, filter .15s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--gold); border: 1px solid var(--gold); }
.btn.ghost:hover { background: rgba(47, 155, 255, .12); }

/* หน้าแรก */
.home { padding-top: 24px; }
.banner {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; align-items: center; padding: 28px;
  background: linear-gradient(135deg, #0f1a2b, #0a0f18); border: 1px solid var(--line); border-radius: 16px;
}
.banner > * { min-width: 0; }
.banner h1 { font-size: clamp(2rem, 6vw, 3.6rem); }
.lead { margin: 0 0 20px; color: var(--muted); max-width: 52ch; }
.banner .btns { display: flex; flex-wrap: wrap; gap: 10px; }
.banner img { width: 100%; max-width: 340px; height: auto; justify-self: center; display: block; }
@media (max-width: 760px) { .banner { grid-template-columns: 1fr; padding: 20px; } .banner img { max-width: 220px; order: -1; } }

.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.quick a {
  display: block; text-decoration: none; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  transition: border-color .15s, background .15s;
}
.quick a:hover { border-color: var(--gold); background: #122033; }
.quick strong { display: block; color: var(--gold); font-family: var(--font-display); }
.quick span { color: var(--muted); font-size: .9rem; }

.home section { padding-block: 40px 8px; }
.home h2 { font-weight: 700; font-size: clamp(1.4rem, 3.4vw, 1.9rem); margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.home h2::before { content: ""; width: 5px; height: 1.1em; border-radius: 3px; background: var(--gold); }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; min-width: 0; }
.card h3 { font-family: var(--font-display); margin: 0 0 6px; color: var(--gold); }
.card p { margin: 0; color: var(--muted); }
.rules { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; counter-reset: r; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.rules li::before {
  content: counter(r); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(47, 155, 255, .14); border: 1px solid var(--gold); color: var(--gold); font-family: var(--font-display); font-weight: 700;
}

/* ตารางทีเด็ด */
.tips-meta { margin: -6px 0 14px; color: var(--muted); font-size: .9rem; }
.tips-scroll { border-radius: 14px; background: var(--card); border: 1px solid var(--line); padding: 4px; }
.tips { border-collapse: separate; border-spacing: 4px; width: 100%; table-layout: fixed; }
.tips th, .tips td { text-align: center; padding: 8px 4px; vertical-align: middle; overflow-wrap: anywhere; }
.tips thead th { background: rgba(47, 155, 255, .08); font-family: var(--font-display); font-weight: 500; font-size: .8rem; line-height: 1.3; border-radius: 8px; }
.tips thead th a { color: var(--fg); text-decoration: none; }
.tips thead th a:hover { text-decoration: underline; color: var(--gold); }
.tips .src-logo { height: 32px; width: auto; max-width: 100%; object-fit: contain; display: block; margin: 0 auto 6px; background: #fff; border-radius: 6px; padding: 2px 4px; }
.tips .corner { width: 19%; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #04121f; font-family: var(--font-display); font-weight: 700; font-size: .9rem; border-radius: 8px; }
.tips .game { display: grid; grid-template-columns: 1fr auto 1fr; gap: 4px; align-items: center; font-size: .8rem; line-height: 1.3; }
.tips .game img { width: 38px; height: 38px; object-fit: contain; display: block; margin: 0 auto 4px; }
.tips .game .vs { font-weight: 800; color: var(--gold); }
.tips tbody td.pick { border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .03); font-weight: 500; font-size: .85rem; line-height: 1.3; }
.tips tbody td.none { opacity: .4; }
@media (max-width: 800px) {
  .tips, .tips tbody, .tips tr, .tips td { display: block; width: 100%; }
  .tips thead { display: none; }
  .tips tbody tr { border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-bottom: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .tips tbody td:first-child { grid-column: 1 / -1; }
  .tips .game { font-size: .95rem; }
  .tips tbody td.pick::before { content: attr(data-label); display: block; font-size: .72rem; color: var(--muted); margin-bottom: 2px; }
  .tips tbody td.none { display: none; }
}
.tips-empty { padding: 24px; background: var(--surface); border-radius: 10px; color: var(--muted); }

/* ป๊อปอัปทรรศนะประจำวัน */
.daily-fab {
  position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 20;
  font: inherit; font-family: var(--font-display); font-weight: 600; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #04121f;
  border: 0; border-radius: 999px; padding: 12px 20px; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .5);
}
.daily-fab:hover { transform: translateY(-2px); }
.daily-fab[hidden] { display: none; }
dialog.daily {
  width: min(92vw, 420px); max-height: 92vh; overflow: auto; margin: auto; padding: 22px; position: relative;
  background: #0e1621; color: #fff; border: 1px solid rgba(47, 155, 255, .4); border-radius: 16px; box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
}
dialog.daily::backdrop { background: rgba(2, 4, 8, .75); backdrop-filter: blur(3px); }
.daily .eyebrow { margin: 0 0 4px; }
.daily .x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; border: 0; font-size: 1.2rem; cursor: pointer; }
.daily .x:hover { background: rgba(255,255,255,.2); }
.daily .yt { display: block; text-align: center; margin-top: 14px; }
.tg { background: #182533; border-radius: 14px; overflow: hidden; color: #e9eef3; }
.tg-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.tg-head img { width: 32px; height: 32px; border-radius: 50%; object-fit: contain; background: #0e1621; }
.tg-head strong { color: #6ccf8b; font-size: .95rem; line-height: 1.2; }
.tg-media { position: relative; display: block; background: #000; line-height: 0; }
.tg-media img { width: 100%; height: auto; max-height: 56vh; object-fit: contain; display: block; margin: 0 auto; }
.tg-dur { position: absolute; top: 10px; left: 10px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .78rem; line-height: 1.4; padding: 2px 8px; border-radius: 999px; }
.tg-play { position: absolute; inset: 0; margin: auto; width: 60px; height: 60px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; display: grid; place-items: center; padding-left: 4px; font-size: 1.4rem; line-height: 1; }
.tg-text { padding: 12px 14px 4px; font-size: .95rem; line-height: 1.5; }
.tg-text p { margin: 0 0 6px; }
.tg-foot { display: flex; justify-content: flex-end; gap: 12px; padding: 0 14px 10px; font-size: .75rem; color: #7f91a4; border: 0; margin: 0; }
@media (prefers-reduced-motion: reduce) { .btn, .daily-fab { transition: none; } }

/* โปรแกรมการแข่งขันบนหน้าแรก */
.fx-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: -4px 0 8px; }
.fx-days { display: flex; gap: 6px; }
.fx-day { font: inherit; color: var(--muted); background: var(--surface); border: 1px solid transparent; border-radius: 8px; padding: 7px 18px; cursor: pointer; }
.fx-day:hover { border-color: var(--gold-soft); }
.fx-day[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); background: rgba(47, 155, 255, .1); }
.fx-all { font-size: .9rem; }
.fxl { margin-top: 20px; }
.fxl h3 { font-family: var(--font-display); font-weight: 600; font-size: 1rem; margin: 0 0 8px; color: var(--gold); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fxl h3 small { color: var(--muted); font-family: var(--font-body); font-weight: 400; font-size: .8rem; }
.fxrows { display: grid; gap: 6px; }
.fxr { display: grid; grid-template-columns: 56px minmax(0, 1fr) 84px minmax(0, 1fr); gap: 10px; align-items: center; padding: 11px 14px; background: var(--surface); border: 1px solid rgba(255, 255, 255, .07); border-radius: 10px; }
.fxr:hover { background: var(--surface-hi); border-color: var(--line); }
.fxr time { font-family: var(--font-display); font-weight: 500; color: var(--gold); font-variant-numeric: tabular-nums; }
.fxt { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 500; }
.fxt span { overflow-wrap: anywhere; line-height: 1.25; }
.fxt img { width: 28px; height: 28px; object-fit: contain; flex: none; }
.fxt.away { flex-direction: row-reverse; text-align: right; }
.fxm { text-align: center; font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.fxm.vs { color: var(--gold-hi); font-size: .85rem; }
.fxm small { display: block; font-family: var(--font-body); font-weight: 400; font-size: .7rem; color: var(--muted); }
.fxm small.live { color: #fff; background: var(--live); border-radius: 999px; padding: 0 8px; display: inline-block; }
.fx-more { margin: 14px 0 0; text-align: center; }
.fx-note { margin: 14px 0 0; color: var(--muted); font-size: .8rem; }
@media (max-width: 600px) {
  .fxr { grid-template-columns: 46px minmax(0, 1fr) 60px minmax(0, 1fr); gap: 6px; padding: 10px 8px; font-size: .85rem; }
  .fxt, .fxt.away { flex-direction: column; text-align: center; gap: 2px; }
}

/* ดูวิเคราะห์ */
.fxr { grid-template-columns: 56px minmax(0, 1fr) 84px minmax(0, 1fr) auto; }
.fx-ana { font: inherit; font-size: .78rem; font-weight: 600; color: #04121f; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); border: 0; border-radius: 6px; padding: 5px 12px; cursor: pointer; white-space: nowrap; }
.fx-ana:hover { filter: brightness(1.1); }
@media (max-width: 600px) { .fxr { grid-template-columns: 46px minmax(0, 1fr) 60px minmax(0, 1fr); } .fx-ana { grid-column: 1 / -1; justify-self: center; margin-top: 4px; } }
dialog.ana {
  width: min(94vw, 560px); max-height: 92vh; overflow: auto; margin: auto; padding: 18px; position: relative; color: var(--fg);
  background: linear-gradient(160deg, #12233b, #0a0f18 60%); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 80px rgba(0, 0, 0, .65);
}
dialog.ana::backdrop { background: rgba(2, 4, 8, .75); backdrop-filter: blur(3px); }
.ana .x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; border: 0; font-size: 1.1rem; cursor: pointer; }
.ana .x:hover { background: rgba(255,255,255,.2); }
.an-h { margin: 6px 36px 4px 0; font-family: var(--font-display); font-size: 1.15rem; }
.an-meta { margin: 0 0 12px; color: var(--muted); font-size: .85rem; }
.an-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; background: #07090d; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.an-home, .an-away { display: flex; align-items: center; gap: 8px; padding: 10px 16px; min-width: 0; font-weight: 600; font-size: .9rem; }
.an-home { background: linear-gradient(90deg, #1d4f8c, #0f2744); justify-content: flex-end; text-align: right; }
.an-home img, .an-away img { width: 26px; height: 26px; object-fit: contain; flex: none; }
.an-home span, .an-away span { overflow-wrap: anywhere; line-height: 1.2; }
.an-vs { display: grid; place-items: center; width: 36px; height: 36px; margin: 0 -6px; z-index: 1; border-radius: 50%; background: #07090d; border: 2px solid var(--gold); color: var(--gold); font-family: var(--font-display); font-weight: 700; font-size: .75rem; }
.an-sec { margin-top: 14px; padding: 12px 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; }
.an-sec h4 { margin: 0 0 10px; font-family: var(--font-display); font-size: .95rem; color: var(--gold); }
.an-sec h4 small { color: var(--muted); font-family: var(--font-body); font-weight: 400; font-size: .75rem; }
.an-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.an-two > div { min-width: 0; font-size: .85rem; }
.an-two small { display: block; color: var(--muted); margin-top: 4px; font-size: .75rem; }
.fms { display: flex; gap: 4px; margin-top: 6px; }
.fm { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-style: normal; font-size: .72rem; font-weight: 700; color: #04121f; background: #7f8ea3; }
.fm-W { background: #3ecf8e; }
.fm-D { background: #aab4c3; }
.fm-L { background: #ff6b6b; }
.an-big { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--gold-hi); line-height: 1.2; }
.an-h2h { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .82rem; }
.an-h2h li { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.an-h2h time { color: var(--muted); font-size: .75rem; }
.an-h2h span:last-child { text-align: right; }
.an-h2h b { font-family: var(--font-display); color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.an-sum ul { margin: 0; padding-left: 1.1em; font-size: .88rem; display: grid; gap: 4px; }
.an-na { color: var(--muted); text-align: center; padding: 16px 0; margin: 0; }
.an-disc { margin: 12px 0 0; color: var(--muted); font-size: .75rem; text-align: center; }
@media (max-width: 480px) { .an-two { grid-template-columns: 1fr; } .an-h2h li { grid-template-columns: 54px minmax(0, 1fr) auto minmax(0, 1fr); font-size: .78rem; } }
