/* Hallmark · component: match centre · genre: editorial · theme: BallTodayTH
 * states: default · hover · focus · active · disabled · loading · error · success
 * Component-scope: skipping macrostructure.
 * Hallmark · pre-emit critique: P5 H5 E4 S5 R5 V4
 */

/* The only palette and font definitions. These inherit into the open shadow root. */
.btth-live-hub {
  --btth-live-page: #07100d;
  --btth-live-panel: #101a17;
  --btth-live-raised: #14211d;
  --btth-live-hover: #1c2d25;
  --btth-live-rule: #2b4035;
  --btth-live-ink: #f7fff9;
  --btth-live-muted: #98aaa1;
  --btth-live-accent: #52d91f;
  --btth-live-accent-ink: #07100d;
  --btth-live-accent-wash: #172d18;
  --btth-live-live: #ffb57d;
  --btth-live-live-wash: #2b2119;
  --btth-live-error: #ffb8b0;
  --btth-live-error-wash: #2c1b1b;
  --btth-live-focus: #d8ffb0;
  --btth-live-transparent: transparent;
  --btth-live-font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
  color: var(--btth-live-ink);
  font-family: inherit;
  margin-block: 28px 40px;
  min-width: 0;
}

.btth-live-hub *,
.btth-live-hub *::before,
.btth-live-hub *::after { box-sizing: border-box; }

.btth-live-hub [hidden] { display: none !important; }

.btth-live-hub__panel {
  min-width: 0;
  border: 1px solid var(--btth-live-rule);
  border-radius: 16px;
  background: var(--btth-live-panel);
  color: var(--btth-live-ink);
  overflow: clip;
}

.btth-live-hub__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 28px 30px 25px;
}

.btth-live-hub__intro { min-width: 0; }

.btth-live-hub__eyebrow {
  display: block;
  margin-block-end: 12px;
  color: var(--btth-live-accent);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: 0.13em;
}

.btth-live-hub__intro h2 {
  margin: 0;
  color: var(--btth-live-ink);
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight: 750;
  font-style: normal;
  letter-spacing: -0.035em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.btth-live-hub__intro p {
  max-width: 46ch;
  margin: 10px 0 0;
  color: var(--btth-live-muted);
  font-size: 14px;
  line-height: 1.65;
}

.btth-live-hub__status {
  display: grid;
  justify-items: end;
  gap: 8px;
  flex-shrink: 0;
  color: var(--btth-live-ink);
  font-size: 13px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.btth-live-hub__status [data-btth-summary]::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-inline-end: 8px;
  border-radius: 50%;
  background: var(--btth-live-accent);
}

.btth-live-hub__status small { color: var(--btth-live-muted); font-size: 11px; }

.btth-live-hub__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 30px 22px;
  border-bottom: 1px solid var(--btth-live-rule);
}

.btth-live-hub__filters { display: flex; gap: 4px; min-width: 0; }

.btth-live-hub__filter,
.btth-live-hub__expand,
.btth-live-hub [data-btth-retry],
.btth-live-hub__empty button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--btth-live-transparent);
  border-radius: 7px;
  background: var(--btth-live-transparent);
  color: var(--btth-live-muted);
  font: 600 13px/1.4 var(--btth-live-font);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.btth-live-hub__filter span {
  min-width: 18px;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.btth-live-hub__filter[aria-pressed="true"] {
  background: var(--btth-live-accent);
  color: var(--btth-live-accent-ink);
}

.btth-live-hub__search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 290px;
  min-width: 0;
  color: var(--btth-live-muted);
}

.btth-live-hub__search svg {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  pointer-events: none;
}

.btth-live-hub__search .screen-reader-text,
.btth-live-hub__search .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.btth-live-hub__search input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 10px 32px 10px 39px;
  border: 1px solid var(--btth-live-rule);
  border-radius: 7px;
  background: var(--btth-live-page);
  color: var(--btth-live-ink);
  font: 400 13px/1.5 var(--btth-live-font);
  appearance: none;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.btth-live-hub__search input::placeholder { color: var(--btth-live-muted); opacity: 1; }
.btth-live-hub__search input::-webkit-search-decoration { appearance: none; }

.btth-live-hub button:focus-visible,
.btth-live-hub input:focus-visible,
.btth-live-hub .is-focus {
  outline: 2px solid var(--btth-live-focus);
  outline-offset: 3px;
}

.btth-live-hub__filter:active,
.btth-live-hub__expand:active,
.btth-live-hub [data-btth-retry]:active,
.btth-live-hub__empty button:active,
.btth-live-hub .is-active {
  background: var(--btth-live-accent-wash);
  color: var(--btth-live-ink);
}

.btth-live-hub button:disabled,
.btth-live-hub input:disabled,
.btth-live-hub [aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btth-live-hub__board { min-width: 0; }
.btth-live-hub #live-football { min-width: 0; --lhub-max-width: none; }

.btth-live-hub__empty {
  padding: 36px 24px;
  color: var(--btth-live-muted);
  text-align: center;
  font-size: 14px;
  line-height: 1.7;
}

.btth-live-hub__empty p { margin: 0 0 14px; }
.btth-live-hub__empty button { color: var(--btth-live-ink); border-color: var(--btth-live-rule); }

.btth-live-hub__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 30px;
  border-top: 1px solid var(--btth-live-rule);
  color: var(--btth-live-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

.btth-live-hub__expand { padding-inline: 12px; color: var(--btth-live-ink); }
.btth-live-hub__expand svg { width: 15px; height: 15px; flex: 0 0 15px; color: var(--btth-live-accent); }
.btth-live-hub__expand[aria-expanded="true"] svg { transform: rotate(180deg); }

.btth-live-hub[data-state="loading"] [data-btth-summary] { color: var(--btth-live-muted); }
.btth-live-hub[data-state="loading"] [data-btth-summary]::before { background: var(--btth-live-muted); }
.btth-live-hub[data-state="loading"] .btth-live-hub__board { min-height: 220px; }
.btth-live-hub[data-state="empty"] [data-btth-summary]::before { background: var(--btth-live-muted); }
.btth-live-hub[data-state="error"] .btth-live-hub__panel { border-color: var(--btth-live-error); }
.btth-live-hub[data-state="error"] [data-btth-summary] { color: var(--btth-live-error); }
.btth-live-hub[data-state="error"] [data-btth-summary]::before { background: var(--btth-live-error); }
.btth-live-hub[data-state="error"] [data-btth-retry] {
  border-color: var(--btth-live-error);
  background: var(--btth-live-error-wash);
  color: var(--btth-live-error);
}
.btth-live-hub [aria-invalid="true"] { border-color: var(--btth-live-error); }
.btth-live-hub [data-state="success"],
.btth-live-hub .is-success { border-color: var(--btth-live-accent); }
.btth-live-hub [data-state="loading"]:is(button, input) { cursor: progress; }

/* ShadowDOM: each selector begins at :host and cannot style the surrounding page. */
:host { display: block; color-scheme: dark; }
:host [hidden] { display: none !important; }
:host .w {
  --p: var(--btth-live-accent) !important;
  --bg: var(--btth-live-panel) !important;
  --sf: var(--btth-live-raised) !important;
  --sf2: var(--btth-live-hover) !important;
  --bd: var(--btth-live-rule) !important;
  --tx: var(--btth-live-ink) !important;
  --mu: var(--btth-live-muted) !important;
  --lv: var(--btth-live-live) !important;
  --ff: var(--btth-live-font) !important;
  --r: 0px !important;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--btth-live-panel);
  color: var(--btth-live-ink);
  font-family: var(--btth-live-font);
  overflow: clip;
}

:host .hd,
:host .ft { display: none; }
:host .duo { display: grid; grid-template-columns: minmax(0, 1fr); }
:host .duo > .ls { max-height: none; overflow: visible; border-left: 0; }
:host .duo > div:first-child { min-width: 0; border-bottom: 1px solid var(--btth-live-rule); }

:host .bar {
  min-height: 56px;
  padding: 10px 24px;
  border-color: var(--btth-live-rule);
  background: var(--btth-live-raised);
  color: var(--btth-live-ink);
  gap: 10px;
}
:host .ttl { min-width: 0; font-size: 14px; line-height: 1.5; }
:host .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--btth-live-rule);
  border-radius: 6px;
  background: var(--btth-live-panel);
  color: var(--btth-live-ink);
  font-family: var(--btth-live-font);
  line-height: 1.4;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}
:host .btn.on { background: var(--btth-live-accent); color: var(--btth-live-accent-ink); border-color: var(--btth-live-accent); }
:host .btn.bad { opacity: 0.55; }
:host .btn:disabled,
:host .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
:host .pv { background: var(--btth-live-page); }
:host .ov { background: var(--btth-live-page); color: var(--btth-live-muted); }
:host .ov .big { color: var(--btth-live-ink); }
:host .spin { display: none; }
:host .msg { padding: 44px 24px; font-size: 14px; line-height: 1.7; color: var(--btth-live-muted); }
:host .ann { padding: 12px 24px; background: var(--btth-live-raised); color: var(--btth-live-muted); }

:host .lg,
:host .cp .lg,
:host .duo > .ls > div > .lg:first-child {
  padding: 13px 24px;
  border-top: 1px solid var(--btth-live-rule);
  border-bottom: 1px solid var(--btth-live-rule);
  background: var(--btth-live-raised);
  color: var(--btth-live-muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: 0.015em;
}

:host .m,
:host .cp .m {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 64px minmax(0, 1fr) 116px 10px;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 18px 24px;
  border-top: 0;
  border-bottom: 1px solid var(--btth-live-rule);
  background: var(--btth-live-panel);
  color: var(--btth-live-ink);
  transition: background-color 120ms ease;
}
:host .m:last-child { border-bottom: 0; }
:host .m.is-live { background: var(--btth-live-accent-wash); color: var(--btth-live-ink); }
:host .m > .tt,
:host .m > div:last-child { display: contents; }
:host .m .tm { grid-column: 1; grid-row: 1; color: var(--btth-live-muted); font-size: 12px; font-weight: 550; }
:host .m.is-live .tm { color: var(--btth-live-ink); }
:host .m .t { display: flex; min-width: 0; gap: 10px; font-size: 14px; font-weight: 550; line-height: 1.5; }
:host .m .t:first-child { grid-column: 2; grid-row: 1; flex-direction: row-reverse; text-align: right; }
:host .m .t:last-child { grid-column: 4; grid-row: 1; }
:host .m .t img,
:host .cp .m .t img { width: 26px; height: 26px; flex: 0 0 26px; object-fit: contain; }
:host .m .t span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:host .m .sc {
  grid-column: 3;
  grid-row: 1;
  margin: 0;
  padding: 0;
  color: var(--btth-live-ink);
  font-size: 19px;
  font-weight: 750;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
:host .m:not(:has(.sc))::before {
  content: "VS";
  grid-column: 3;
  grid-row: 1;
  color: var(--btth-live-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
}
:host .m .b {
  grid-column: 5;
  grid-row: 1;
  justify-self: end;
  min-width: 0;
  max-width: 100%;
  padding: 5px 8px;
  border: 0;
  border-radius: 4px;
  background: var(--btth-live-raised);
  color: var(--btth-live-muted);
  font-size: 10px;
  font-weight: 550;
  line-height: 1.5;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
:host .m .b.live { background: var(--btth-live-live-wash); color: var(--btth-live-live); animation: none; }
:host .m .b.wait { background: var(--btth-live-raised); color: var(--btth-live-muted); }
:host .m::after {
  content: "›";
  grid-column: 6;
  grid-row: 1;
  justify-self: end;
  color: var(--btth-live-muted);
  font-size: 22px;
  line-height: 1;
}
:host .pin { color: var(--btth-live-accent); }
:host .m:focus-visible,
:host .btn:focus-visible,
:host .m.is-focus,
:host .btn.is-focus {
  outline: 2px solid var(--btth-live-focus);
  outline-offset: -3px;
  z-index: 1;
}
:host .m:active,
:host .btn:active,
:host .m.is-active,
:host .btn.is-active { background: var(--btth-live-hover); color: var(--btth-live-ink); }
:host .m[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
:host .more { min-height: 44px; padding: 14px 24px; color: var(--btth-live-accent); }

@media (hover: hover) {
  .btth-live-hub__filter:hover,
  .btth-live-hub__expand:hover,
  .btth-live-hub__empty button:hover,
  .btth-live-hub [data-btth-retry]:hover,
  .btth-live-hub .is-hover {
    background: var(--btth-live-hover);
    color: var(--btth-live-ink);
  }
  .btth-live-hub__filter[aria-pressed="true"]:hover { background: var(--btth-live-focus); color: var(--btth-live-accent-ink); }
  .btth-live-hub__search input:hover { background: var(--btth-live-raised); color: var(--btth-live-ink); }
  :host .m:hover,
  :host .btn:hover { background: var(--btth-live-hover); color: var(--btth-live-ink); }
  :host .btn.on:hover { background: var(--btth-live-focus); color: var(--btth-live-accent-ink); }
}

/* Deterministic component-state preview hooks also work on touch-sized previews. */
.btth-live-hub .is-hover { background: var(--btth-live-hover); color: var(--btth-live-ink); }
.btth-live-hub__filter.is-hover[aria-pressed="true"] { background: var(--btth-live-focus); color: var(--btth-live-accent-ink); }
:host .m.is-hover,
:host .btn.is-hover { background: var(--btth-live-hover); color: var(--btth-live-ink); }
:host .btn.on.is-hover { background: var(--btth-live-focus); color: var(--btth-live-accent-ink); }

@media (max-width: 767px) {
  .btth-live-hub { margin-block: 20px 28px; }
  .btth-live-hub__heading { align-items: start; padding: 23px 20px 20px; gap: 20px; }
  .btth-live-hub__intro p { max-width: 30ch; font-size: 13px; }
  .btth-live-hub__status { max-width: 140px; font-size: 12px; }
  .btth-live-hub__toolbar { padding: 0 20px 20px; gap: 12px; }
  .btth-live-hub__filter { padding-inline: 12px; }
  .btth-live-hub__search { flex-basis: 240px; }
  .btth-live-hub__footer { padding: 10px 20px; }
  :host .m,
  :host .cp .m { grid-template-columns: 44px minmax(0, 1fr) 52px minmax(0, 1fr) 76px 8px; gap: 9px; padding-inline: 16px; }
  :host .m .t { font-size: 13px; gap: 6px; }
  :host .m .t img,
  :host .cp .m .t img { width: 22px; height: 22px; flex-basis: 22px; }
  :host .m .b.up { font-size: 0; }
  :host .m .b.up::after { content: "รอแข่ง"; font-size: 10px; }
  :host .lg,
  :host .cp .lg,
  :host .duo > .ls > div > .lg:first-child { padding-inline: 16px; }
}

@media (max-width: 540px) {
  .btth-live-hub__panel { border-radius: 12px; }
  .btth-live-hub__heading { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 22px 16px 18px; }
  .btth-live-hub__eyebrow { margin-block-end: 9px; font-size: 9px; letter-spacing: 0.11em; }
  .btth-live-hub__intro h2 { font-size: 30px; }
  .btth-live-hub__intro p { max-width: none; margin-block-start: 8px; }
  .btth-live-hub__status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; max-width: none; width: 100%; gap: 10px; font-size: 12px; }
  .btth-live-hub__status small { font-size: 10px; }
  .btth-live-hub__toolbar { display: grid; grid-template-columns: minmax(0, 1fr); padding: 0 16px 18px; gap: 12px; }
  .btth-live-hub__filters { gap: 5px; }
  .btth-live-hub__filter { flex: 1; padding-inline: 10px; }
  .btth-live-hub__search { width: 100%; }
  .btth-live-hub__footer { align-items: center; gap: 8px; padding: 9px 10px 9px 16px; font-size: 10px; }
  .btth-live-hub__expand { gap: 6px; padding-inline: 9px; font-size: 12px; }
  :host .bar { padding: 10px 14px; }
  :host .ttl { flex-basis: 100%; font-size: 13px; }
  :host .lg,
  :host .cp .lg,
  :host .duo > .ls > div > .lg:first-child { padding: 11px 14px; font-size: 10px; }
  :host .m,
  :host .cp .m {
    grid-template-columns: minmax(0, 1fr) 60px;
    grid-template-rows: 22px 25px 25px;
    column-gap: 12px;
    row-gap: 4px;
    min-height: 110px;
    padding: 14px;
  }
  :host .m .tm { grid-column: 1; grid-row: 1; font-size: 10px; }
  :host .m .t { gap: 7px; font-size: 13px; line-height: 1.5; }
  :host .m .t:first-child { grid-column: 1; grid-row: 2; flex-direction: row; text-align: left; }
  :host .m .t:last-child { grid-column: 1; grid-row: 3; }
  :host .m .t img,
  :host .cp .m .t img { width: 21px; height: 21px; flex-basis: 21px; }
  :host .m .sc { grid-column: 2; grid-row: 2 / 4; font-size: 19px; letter-spacing: -0.035em; }
  :host .m:not(:has(.sc))::before { grid-column: 2; grid-row: 2 / 4; font-size: 10px; }
  :host .m .b { grid-column: 2; grid-row: 1; padding: 3px 6px; font-size: 10px; }
  :host .m .b.up { font-size: 0; }
  :host .m .b.up::after { font-size: 10px; }
  :host .m::after { display: none; }
  :host .msg { padding: 32px 16px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .btth-live-hub *,
  .btth-live-hub *::before,
  .btth-live-hub *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  :host *,
  :host *::before,
  :host *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* hub-fix 20261112: the central hub board brings its own filters and counters, so hide the old adapter chrome that stayed on "กำลังโหลดรายการ". */
.btth-live-hub[data-board="hub"] .btth-live-hub__status,
.btth-live-hub[data-board="hub"] .btth-live-hub__toolbar,
.btth-live-hub[data-board="hub"] .btth-live-hub__footer,
.btth-live-hub[data-board="hub"] [data-btth-empty] { display: none !important; }
/* hub-fix 20261112: the hub board is the one schedule on the home page; hide the theme's own "ตารางบอลวันนี้" list (sidebar kept). */
#today-fixtures .dashboard-main { display: none !important; }
#today-fixtures .dashboard-grid { grid-template-columns: minmax(0, 1fr) !important; }
@media (min-width: 981px) { #today-fixtures .dashboard-sidebar { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } }
