/* checkphonhuay.com — results board (category-standard look) */
:root {
  --ground: #f1f2f4;
  --card: #fff;
  --line: #e4e6ea;
  --line2: #eef0f3;
  --tile: #f6f7f9;
  --ink: #15171c;
  --ink2: #474c56;
  --mute: #646a75;
  --red: #d0112b;
  --red-ink: #ae0d23;
  --red-soft: #fdecee;
  --live: #16a34a;
  --amber: #d97706;
  --font: "Anuphan", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  --gutter: 16px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }
body {
  min-height: 100dvh; background: var(--ground); color: var(--ink);
  font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--red); color: #fff; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 6px; }
.num, strong, td, time { font-variant-numeric: tabular-nums lining-nums; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html { scrollbar-color: #c5cad2 transparent; }

/* ---------- header ---------- */
.top { background: var(--card); padding-top: env(safe-area-inset-top); }
.top__in {
  max-width: 1160px; margin: 0 auto; height: 56px; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.logo { display: flex; align-items: center; gap: 9px; font-size: 22px; font-weight: 700; letter-spacing: -0.025em; }
.logo__w { white-space: nowrap; }
.logo__w b { color: var(--red); font-weight: 700; }
.logo__w i { font-style: normal; font-weight: 600; color: var(--ink2); letter-spacing: -0.01em; }
.logo svg { width: 32px; height: 32px; flex: none; }
.status { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--ink2); white-space: nowrap; }
.status__dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa0a9; }
.status[data-state="live"] .status__dot { background: var(--red); box-shadow: 0 0 0 3px rgba(208, 17, 43, 0.16); animation: beat 2.4s ease-in-out infinite; }
.status[data-state="connecting"] .status__dot { background: var(--amber); }
.status time { color: var(--ink); font-weight: 600; font-size: 13.5px; }
@media (prefers-reduced-motion: reduce) { .status[data-state="live"] .status__dot { animation: none; } }
@keyframes beat { 50% { box-shadow: 0 0 0 6px rgba(208, 17, 43, 0); } }

/* ---------- tabs ---------- */
.tabs { position: sticky; top: 0; z-index: 10; background: var(--card); border-bottom: 1px solid var(--line); }
.tabs.is-stuck { box-shadow: 0 6px 16px -12px rgba(16, 24, 40, 0.35); }
.tabs__in {
  max-width: 1160px; margin: 0 auto; padding: 4px var(--gutter) 10px;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.tabs__in::-webkit-scrollbar { display: none; }
.tab {
  flex: none; height: 40px; padding: 0 16px; display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  font-size: 15px; font-weight: 500; color: var(--ink2); white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.12s var(--ease-out);
}
.tab:active { transform: scale(0.97); }
.tab[aria-current="page"] { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
@media (hover: hover) { .tab:not([aria-current="page"]):hover { border-color: #c5cad2; color: var(--ink); } }

/* ---------- layout ---------- */
.wrap { max-width: 1160px; margin: 0 auto; padding: 12px var(--gutter) 32px; }
.layout { display: grid; gap: 18px; }
main { display: grid; gap: 12px; align-content: start; min-width: 0; }
@media (min-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
  .side { align-self: stretch; }
  .ad--side { position: sticky; top: 64px; }
  .big { font-size: 68px; }
  .big--6 { font-size: 64px; }
}

/* ---------- ads ---------- */
.ad { display: grid; justify-items: center; gap: 3px; }
.ad__tag { font-size: 11px; color: var(--mute); justify-self: end; }
.ad a, .ad > img { width: 100%; max-width: 728px; }
.ad img { width: 100%; height: auto; border-radius: 10px; }
.ad__empty {
  width: 100%; max-width: 320px; height: 100px; display: grid; place-content: center; justify-items: center;
  border: 1px dashed #c5cad2; border-radius: 10px; background: #e9ebee; color: var(--mute);
}
.ad__empty b { font-size: 14px; font-weight: 500; color: var(--ink2); }
.ad__empty span { font-size: 11.5px; }
.sz-d { display: none; }
@media (min-width: 760px) {
  .ad__empty { max-width: 728px; height: 90px; }
  .sz-m { display: none; }
  .sz-d { display: inline; }
}
.ad--side .ad__empty { max-width: 300px; height: 600px; }

/* top row: three big 2:1 slots; side by side from 760px, a native swipe row on phones */
.adrow { display: grid; gap: 3px; margin-bottom: 12px; }
.adrow__track {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); scroll-padding-inline: var(--gutter); scrollbar-width: none;
}
.adrow__track::-webkit-scrollbar { display: none; }
.adrow__track > .ad { flex: 0 0 86%; scroll-snap-align: start; }
@media (min-width: 760px) {
  .adrow__track { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; overflow: visible; margin: 0; padding: 0; }
}
.ad--big a, .ad--big > img { max-width: none; }
.ad--big img { aspect-ratio: 2 / 1; object-fit: cover; border-radius: 12px; }
.ad--big .ad__empty { max-width: none; height: auto; aspect-ratio: 2 / 1; border-radius: 12px; gap: 2px; }
.ad--big .ad__empty b { font-size: 16px; }
/* in-feed: full column width, 4:1 */
.ad--wide a, .ad--wide > img { max-width: none; }
.ad--wide img { aspect-ratio: 4 / 1; object-fit: cover; border-radius: 12px; }
.ad--wide .ad__empty { max-width: none; height: auto; aspect-ratio: 4 / 1; border-radius: 12px; }
@media (min-width: 760px) { .ad--wide .ad__empty b { font-size: 16px; } }
.ad--big .ad__empty span { font-size: 13px; }
@media (max-width: 1023px) { .ad--side { display: none; } }

/* ---------- big cards ---------- */
.featured { display: grid; gap: 12px; }
@media (min-width: 760px) {
  .featured { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  /* an odd last card takes the full row and sets its number beside the smaller ones */
  .featured > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .featured > .card:last-child:nth-child(odd) .card__body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; padding: 4px 0; }
  .featured > .card:last-child:nth-child(odd) .tiles { padding: 12px 14px; }
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  overflow: hidden; scroll-margin-top: 64px;
}
.card__hd { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-bottom: 1px solid var(--line2); }
.card__t { flex: 1; min-width: 0; }
.card__t h2 { font-size: 16.5px; font-weight: 600; line-height: 1.25; }
.card__t h2 a:hover { color: var(--red-ink); }
.card__t p { font-size: 12.5px; color: var(--mute); line-height: 1.35; }
.flag { width: 30px; height: 21px; flex: none; border-radius: 4px; background-size: cover; background-position: center; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.flag--none { background: var(--tile); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.3;
  background: var(--red-soft); color: var(--red-ink);
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--red); flex: none; }
.pill--muted { background: var(--tile); color: var(--mute); font-weight: 500; border: 1px solid var(--line2); }
.pill--wait { background: var(--tile); color: var(--ink2); font-weight: 500; border: 1px dashed #c5cad2; }
.pill--wait svg { width: 14px; height: 14px; }
.pill--new { background: var(--red); color: #fff; }
.pill--new i { background: #fff; }

.hero { text-align: center; padding: 10px 14px 2px; }
.hero small { display: block; font-size: 13px; font-weight: 500; color: var(--mute); line-height: 1.3; }
.big {
  display: block; font-size: clamp(50px, 15.5vw, 62px); font-weight: 700; line-height: 1.08;
  letter-spacing: 0.05em; margin-right: -0.05em; color: var(--red); font-variant-numeric: tabular-nums;
}
.big--6 { font-size: clamp(44px, 13vw, 56px); }
.hero--wait { padding: 18px 14px 14px; display: grid; justify-items: center; gap: 6px; }
.hero--wait .pill { font-size: 14px; padding: 7px 14px; }
.hero--wait p { font-size: 12.5px; color: var(--mute); }

.tiles { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 8px; padding: 8px 14px 12px; }
.tiles div { background: var(--tile); border-radius: 10px; padding: 5px 4px 6px; text-align: center; min-width: 0; }
.tiles > div > span { display: block; font-size: 13px; font-weight: 500; color: var(--mute); line-height: 1.35; white-space: nowrap; }
.tiles strong { display: block; font-size: 23px; font-weight: 700; line-height: 1.15; letter-spacing: 0.03em; }
.tiles--thai strong { font-size: 18.5px; letter-spacing: 0.02em; }
.blank { color: #8b919b; font-weight: 600; letter-spacing: 0.1em; }

.tbl { width: calc(100% - 28px); margin: 0 14px 6px; border-collapse: collapse; font-size: 13.5px; }
.tbl caption { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink2); padding: 9px 0 0; border-top: 1px solid var(--line2); }
.tbl th { padding: 6px 0 4px; font-size: 12.5px; font-weight: 500; color: var(--mute); text-align: right; border-bottom: 1px solid var(--line2); }
.tbl td { padding: 6px 0; text-align: right; color: var(--ink2); border-bottom: 1px solid var(--line2); }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.n { font-size: 15.5px; font-weight: 700; color: var(--ink); letter-spacing: 0.03em; }
.tbl td.nm { font-weight: 600; color: var(--ink); }
.tbl td small { display: block; font-size: 11.5px; color: var(--mute); font-weight: 500; letter-spacing: 0; }
.tbl td .pill { font-size: 11.5px; padding: 2px 9px; }
.card__more {
  display: flex; align-items: center; justify-content: center; gap: 2px; min-height: 42px;
  border-top: 1px solid var(--line2); font-size: 13.5px; font-weight: 600; color: var(--red-ink);
}
.card__more svg { width: 16px; height: 16px; transition: transform 0.15s var(--ease-out); }
@media (hover: hover) { .card__more:hover svg { transform: translateX(2px); } .card__more:hover { background: #fffafa; } }

/* ---------- category sections ---------- */
.sec { display: grid; gap: 10px; scroll-margin-top: 64px; }
.sec__hd { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 2px 0; }
.sec__hd h2 { font-size: 18px; font-weight: 700; line-height: 1.3; }
.sec__hd p { font-size: 12.5px; color: var(--mute); }
.sec__hd a { font-size: 13px; font-weight: 600; color: var(--red-ink); white-space: nowrap; display: inline-flex; align-items: center; }
.sec__hd a svg { width: 15px; height: 15px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- compact cards ---------- */
.mini {
  display: grid; grid-template-rows: auto 1fr auto; gap: 6px; min-width: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  padding: 10px 11px 9px; transition: border-color 0.15s, transform 0.12s var(--ease-out);
}
.mini:active { transform: scale(0.985); }
@media (hover: hover) { .mini:hover { border-color: #c9ced6; } }
.mini__hd { display: flex; align-items: center; gap: 7px; min-width: 0; }
.mini__hd .flag { width: 22px; height: 15px; border-radius: 3px; }
.mini__hd b { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini__nums { display: grid; grid-template-columns: 1.25fr 1fr; gap: 6px; }
.mini__nums div { background: var(--tile); border-radius: 9px; padding: 3px 4px 4px; text-align: center; min-width: 0; }
.mini__nums > div > span { display: block; font-size: 12.5px; color: var(--mute); font-weight: 500; line-height: 1.35; white-space: nowrap; }
.mini__nums strong { display: block; font-size: 22px; font-weight: 700; line-height: 1.15; letter-spacing: 0.04em; }
.mini__nums .r { color: var(--red); }
.mini__wait { display: grid; place-items: center; align-content: center; gap: 2px; min-height: 52px; border: 1px dashed #d3d7de; border-radius: 9px; background: var(--tile); color: var(--ink2); font-size: 12.5px; font-weight: 500; text-align: center; }
.mini__wait strong { font-size: 16px; font-weight: 700; color: var(--ink); }
.mini__wait small { font-size: 12.5px; color: var(--mute); }
.mini__ft { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; color: var(--ink2); min-width: 0; }
.mini__ft .pill { font-size: 12px; padding: 1px 7px; }
.mini.is-old .mini__nums strong { color: var(--ink2); }
.mini.is-old .mini__nums .r { color: #9c1b2c; }

/* ---------- search ---------- */
.search { position: relative; }
.search input {
  width: 100%; height: 44px; padding: 0 14px 0 40px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); font-size: 16px; color: var(--ink); box-shadow: var(--shadow);
}
.search input::placeholder { color: var(--mute); }
.search input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(208, 17, 43, 0.12); }
.search svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--mute); pointer-events: none; }
.empty { padding: 28px 12px; text-align: center; color: var(--mute); background: var(--card); border: 1px dashed var(--line); border-radius: 14px; }

/* ---------- detail page ---------- */
.back { display: inline-flex; align-items: center; gap: 2px; min-height: 36px; font-size: 14px; font-weight: 600; color: var(--ink2); justify-self: start; }
.back svg { width: 18px; height: 18px; }
.note { font-size: 12.5px; color: var(--mute); padding: 0 2px; }

/* ---------- sidebar ---------- */
.side { display: grid; gap: 12px; align-content: start; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.box h2 { font-size: 14.5px; font-weight: 600; padding: 11px 14px 9px; border-bottom: 1px solid var(--line2); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.box h2 small { font-size: 12px; font-weight: 500; color: var(--mute); }
.box ol { list-style: none; }
.box li a { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px 14px; border-bottom: 1px solid var(--line2); font-size: 13.5px; }
.box li:last-child a { border-bottom: 0; }
.box li .flag { width: 22px; height: 15px; border-radius: 3px; }
.box li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.box li time { font-weight: 600; color: var(--ink2); }
.box li strong { font-weight: 700; color: var(--red); letter-spacing: 0.03em; }
.box li strong small { color: var(--ink); font-size: inherit; font-weight: 700; margin-left: 6px; }
@media (hover: hover) { .box li a:hover { background: #fafbfc; } }

/* ---------- footer ---------- */
.foot { margin-top: 26px; padding: 18px 2px calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: grid; gap: 4px; color: var(--mute); font-size: 12.5px; }
.foot .logo { font-size: 17px; }
.foot .logo svg { width: 24px; height: 24px; }
.foot__tag { margin: 4px 0 2px; font-size: 14px; font-weight: 600; color: var(--ink2); text-wrap: balance; }

/* ---------- live arrival: the signature move ---------- */
@media (prefers-reduced-motion: no-preference) {
  .is-landing { animation: ring 2.4s ease-out both; }
  .is-landing .land { display: inline-block; animation: settle 0.7s var(--ease-out) both; }
}
@keyframes ring {
  0%, 20% { border-color: var(--red); box-shadow: 0 0 0 3px rgba(208, 17, 43, 0.16), var(--shadow); }
  100% { border-color: var(--line); box-shadow: var(--shadow); }
}
@keyframes settle {
  from { opacity: 0; filter: blur(6px); transform: translateY(-6px) scale(1.06); }
  to { opacity: 1; filter: none; transform: none; }
}

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 20;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px);
  padding: 10px 16px; border-radius: 12px; background: var(--ink); color: #fff;
  font-size: 14.5px; font-weight: 500; box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.45);
  transition: transform 0.35s var(--ease-out), opacity 0.25s;
}
.toast b { font-size: 19px; color: #ffd1d7; letter-spacing: 0.04em; }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }

.loading { padding: 60px 0; text-align: center; color: var(--mute); }
@media (max-width: 359px) {
  :root { --gutter: 12px; }
  .grid { gap: 8px; }
  .mini { padding: 9px 9px 8px; }
  .mini__nums strong { font-size: 19px; }
}

/* ---------- live broadcasts ---------- */
.tab--onair i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-right: 7px; flex: none; }
.tab--onair[aria-current="page"] i { background: #fff; }
@media (prefers-reduced-motion: no-preference) { .tab--onair i, .livebar i, .card__live.is-live i, .player__badge i { animation: blink 1.6s ease-in-out infinite; } }
@keyframes blink { 50% { opacity: 0.35; } }

.livebars { display: grid; gap: 8px; }
.livebars:empty { display: none; }
.livebar {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; border-radius: 12px;
  background: var(--red); color: #fff; font-size: 15px; font-weight: 500; box-shadow: var(--shadow);
}
.livebar i { width: 9px; height: 9px; border-radius: 50%; background: #fff; flex: none; }
.livebar span:first-of-type { flex: 1; min-width: 0; }
.livebar b { font-weight: 700; }
.livebar__go { display: inline-flex; align-items: center; font-weight: 700; white-space: nowrap; }
.livebar__go svg { width: 16px; height: 16px; }

.card__live {
  display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 14px 12px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--tile); color: var(--ink);
  font-size: 14.5px; font-weight: 600; transition: background-color 0.15s, transform 0.12s var(--ease-out);
}
.card__live span { flex: 1; }
.card__live svg { width: 16px; height: 16px; flex: none; color: var(--red); }
.card__live svg:last-child { color: var(--mute); }
.card__live:active { transform: scale(0.98); }
.card__live.is-live { background: var(--red); border-color: var(--red); color: #fff; }
.card__live.is-live svg { color: #fff; }
.card__live.is-live i { width: 9px; height: 9px; border-radius: 50%; background: #fff; flex: none; }
@media (hover: hover) { .card__live:not(.is-live):hover { background: #eceef1; } }

.card__src {
  display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 14px 12px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--tile); font-size: 14.5px; font-weight: 600; color: var(--ink);
  transition: background-color 0.15s, transform 0.12s var(--ease-out);
}
.card__src svg { width: 16px; height: 16px; color: var(--red); flex: none; }
.card__src span { flex: 1; }
.card__src b { font-weight: 600; font-size: 13.5px; color: var(--red-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.card__src:active { transform: scale(0.98); }
@media (hover: hover) { .card__src:hover { background: #eceef1; } }

.pagetitle { font-size: 22px; font-weight: 700; line-height: 1.3; }
.lv-list { display: grid; gap: 14px; }
@media (min-width: 1200px) { .lv-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.player { position: relative; aspect-ratio: 16 / 9; background: #0f1115; overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player__poster { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; color: #fff; }
.player__poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.player__play {
  position: relative; display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%;
  background: var(--red); box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.5); transition: transform 0.15s var(--ease-out);
}
.player__play svg { width: 30px; height: 30px; margin-left: 4px; }
.player__poster:active .player__play { transform: scale(0.94); }
@media (hover: hover) { .player__poster:hover .player__play { transform: scale(1.06); } }
.player__badge {
  position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; background: var(--red); font-size: 13px; font-weight: 700;
}
.player__badge i { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.player__empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 16px; text-align: center; color: #c9ced6; background: #1a1d23; }
.player__empty svg { width: 34px; height: 34px; opacity: 0.4; }
.player__empty p { font-size: 15px; font-weight: 500; line-height: 1.5; }
.player__empty small { display: block; font-size: 13px; color: #8b919b; font-weight: 400; }
.lv__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line2); font-size: 13px; color: var(--mute); }
.lv__links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.lv__links a { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; font-weight: 600; color: var(--red-ink); }
.lv__links svg { width: 15px; height: 15px; }
.lv__cap { padding: 10px 14px 0; font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.lv__res .hero { padding-top: 2px; }
.lv__res { padding-bottom: 4px; }

.links { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.links + .links { margin-top: 10px; }
.links h3 { font-size: 14.5px; font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line2); background: var(--tile); }
.links ul { list-style: none; display: grid; }
@media (min-width: 760px) { .links ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } .links li:nth-child(odd) a { border-right: 1px solid var(--line2); } }
.links li a { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto 16px; align-items: center; gap: 9px; min-height: 48px; padding: 6px 14px; border-bottom: 1px solid var(--line2); font-size: 14px; }
.links .flag { width: 22px; height: 15px; border-radius: 3px; }
.links__n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links time { font-size: 13px; color: var(--ink2); font-weight: 600; }
.links__h { font-size: 12.5px; color: var(--red-ink); max-width: 9.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links li a svg { width: 15px; height: 15px; color: var(--mute); }
@media (max-width: 420px) { .links__h { display: none; } }
@media (hover: hover) { .links li a:hover { background: #fafbfc; } }

/* Small phones: the longer checkphonhuay.com wordmark keeps its row; the status keeps its dot and clock. */
@media (max-width: 419px) {
  .top .logo { font-size: 19px; gap: 8px; }
  .top .logo svg { width: 28px; height: 28px; }
}
@media (max-width: 399px) {
  #statusText { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ---------- "สนใจลงโฆษณา": the button under ads, the popup ad, the contact sheet ---------- */
.adcta {
  justify-self: center; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin-top: 4px; padding: 0 12px 0 11px;
  border-radius: 999px; background: var(--red-soft); color: var(--red-ink); font-size: 13px; font-weight: 600;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: background-color 0.15s ease, transform 0.12s var(--ease-out);
}
.adcta svg { width: 16px; height: 16px; flex: none; }
.adcta svg:last-child:not(:first-child) { width: 14px; height: 14px; margin-left: -2px; opacity: 0.7; }
.adcta:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .adcta:hover { background: #fbdde1; } }
.adrow > .adcta { margin-top: 6px; }
.ad__hit { display: block; width: 100%; padding: 0; border-radius: 12px; cursor: pointer; touch-action: manipulation; }
button.ad__empty { font: inherit; cursor: pointer; touch-action: manipulation; transition: border-color 0.15s ease, background-color 0.15s ease; }
.ad__empty em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--red-ink); }
@media (hover: hover) and (pointer: fine) { button.ad__empty:hover { border-color: var(--red); background: var(--red-soft); } }
.ad--side .adcta { margin-top: 8px; }
.foot__ad { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--red-ink); font-weight: 600; font-size: 13px; }
.foot__ad svg { width: 15px; height: 15px; }

html:has(dialog[open]) { overflow: hidden; }
dialog { padding: 0; border: 0; background: transparent; color: inherit; max-width: none; max-height: none; width: 100%; height: 100%; overscroll-behavior: contain; }
dialog[open] { display: grid; }
dialog::backdrop { background: rgba(15, 17, 21, 0.58); }
.xbtn {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%;
  color: var(--ink2); background: var(--tile); touch-action: manipulation; transition: transform 0.12s var(--ease-out), background-color 0.15s ease;
}
.xbtn svg { width: 20px; height: 20px; }
.xbtn:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .xbtn:hover { background: #e6e8ec; color: var(--ink); } }

/* popup ad: a 4:5 picture that always fits the screen, with its close button outside the artwork */
.popad[open] { place-items: center; padding: calc(12px + env(safe-area-inset-top)) 16px calc(12px + env(safe-area-inset-bottom)); }
.popad__box {
  width: min(100%, 440px, calc((100dvh - 200px) * 0.8)); min-width: 260px; display: grid; gap: 8px; padding: 8px 10px 12px;
  background: var(--card); border-radius: 20px; box-shadow: 0 24px 60px -12px rgba(16, 24, 40, 0.45);
}
.popad__bar { display: flex; align-items: center; justify-content: space-between; padding-left: 4px; }
.popad__bar .ad__tag { justify-self: start; }
.popad__media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; background: var(--tile); }
.popad__media a, .popad__media .ad__hit { display: block; }
.adcta--solid { justify-self: stretch; justify-content: center; min-height: 48px; margin: 2px 0 0; border-radius: 12px; background: var(--red); color: #fff; font-size: 15px; }
.adcta--solid svg { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .adcta--solid:hover { background: var(--red-ink); } }

/* contact: a bottom sheet on phones, a centred card from 640px */
.sheet[open] { align-items: end; justify-items: center; }
.sheet__box {
  width: 100%; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 14px; align-content: start;
  background: var(--card); border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px -12px rgba(16, 24, 40, 0.3);
}
@media (min-width: 640px) {
  .sheet[open] { align-items: center; padding: 24px; }
  .sheet__box { max-width: 460px; border-radius: 20px; padding: 22px; box-shadow: 0 24px 60px -12px rgba(16, 24, 40, 0.45); }
}
.sheet__hd { display: flex; align-items: flex-start; gap: 12px; }
.sheet__hd > div { flex: 1; display: grid; gap: 4px; }
.sheet__hd h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.sheet__hd p { font-size: 13.5px; color: var(--ink2); line-height: 1.55; text-wrap: pretty; }
#contactForm { display: grid; gap: 14px; }
.cf { display: grid; gap: 6px; border: 0; min-width: 0; }
.cf > span, .cf > legend { font-size: 13.5px; font-weight: 600; color: var(--ink2); padding: 0; }
.cf > span small { font-weight: 400; color: var(--mute); }
.cf input, .cf textarea {
  width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #d5d9df; border-radius: 12px; background: #fff;
  font: inherit; font-size: 16px; line-height: 1.45; color: var(--ink); caret-color: var(--red);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cf textarea { resize: vertical; min-height: 84px; }
.cf input::placeholder, .cf textarea::placeholder { color: #8a909a; }
.cf input:focus, .cf textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(208, 17, 43, 0.12); }
.cf [aria-invalid="true"] { border-color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid #d5d9df; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--ink2); background: #fff; transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.chip input:checked + span { background: var(--red-soft); border-color: var(--red); color: var(--red-ink); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
.chip input[aria-invalid="true"] + span { border-color: var(--red); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf__msg { font-size: 13.5px; font-weight: 600; color: var(--red-ink); }
.cf__msg:empty { display: none; }
.cf__note { font-size: 12px; color: var(--mute); text-align: center; }
.cbtn {
  min-height: 50px; border-radius: 12px; background: var(--red); color: #fff; font-size: 16px; font-weight: 600;
  touch-action: manipulation; transition: background-color 0.15s ease, transform 0.12s var(--ease-out);
}
.cbtn:active { transform: scale(0.98); }
.cbtn:disabled { opacity: 0.6; cursor: progress; }
@media (hover: hover) and (pointer: fine) { .cbtn:not(:disabled):hover { background: var(--red-ink); } }
.cbtn--ghost { background: var(--tile); color: var(--ink); border: 1px solid var(--line); }
@media (hover: hover) and (pointer: fine) { .cbtn--ghost:not(:disabled):hover { background: #eceef1; } }
.cdone { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 10px 0 4px; }
.cdone__ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #eaf7ef; color: var(--live); margin-bottom: 4px; }
.cdone__ic svg { width: 28px; height: 28px; }
.cdone h3 { font-size: 19px; font-weight: 700; }
.cdone p { font-size: 14px; color: var(--ink2); max-width: 32ch; margin-bottom: 8px; }
.cdone .cbtn { width: 100%; }

/* motion: one short entrance each, a quicker exit */
@media (prefers-reduced-motion: no-preference) {
  dialog[open]::backdrop { animation: dimIn 0.2s ease-out; }
  .popad[open] .popad__box { animation: popIn 0.24s var(--ease-out); }
  .sheet[open] .sheet__box { animation: sheetIn 0.34s cubic-bezier(0.32, 0.72, 0, 1); }
  @media (min-width: 640px) { .sheet[open] .sheet__box { animation: popIn 0.24s var(--ease-out); } }
  dialog.is-closing::backdrop { animation: dimOut 0.16s ease-out forwards; }
  dialog.is-closing .popad__box, dialog.is-closing .sheet__box { animation: fadeOut 0.16s ease-out forwards; }
}
@keyframes dimIn { from { opacity: 0; } }
@keyframes dimOut { to { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(6px); } }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes fadeOut { to { opacity: 0; transform: scale(0.98); } }
