/*!
 * live-sports.css: the look of public/js/live-sports.js ([HQ-1120-O], round [AU-1120-B2], 20 Nov 2026).
 * Featurelog: docs/featurelog/live-sports-20261120.md
 * Scopes: every selector starts with .ls-…, [data-live-sports-player] or [data-live-sports-open]; nothing global.
 * Colours: only the theme contract tokens (--surface-modal, --ink-on-modal, --surface-card, --ink-on-card, --accent,
 * --ink-on-action, --line, --seed-danger, --ink-on-danger, --ink-dim) and --radius. The one block of literal colours is
 * the player fallback below; the player page replaces it whole with the parent page's tokens when it can read them.
 * z-index 100000 for the dialog: above theme1's nav (9999), lucky-draw modal (10050), reward toasts (30050) and web-chat
 * root (99999); below SweetAlert (2147483647), so alerts stay on top.
 * The scroll lock while the dialog is open is set by the script on <html> (CSSOM), not here.
 */

/* ── player fallback palette: the only literal colours (contrast checked: text ≥ 4.5 : 1, UI ≥ 3 : 1) ── */
[data-live-sports-player] {
  --surface-modal: #121417;
  --ink-on-modal: #f1f2f4;
  --surface-card: #1d2026;
  --ink-on-card: #f1f2f4;
  --accent: #ffc24a;
  --ink-on-action: #1a1300;
  --line: #757c88;
  --seed-danger: #ff7a66;
  --ink-on-danger: #1a0500;
  --ink-dim: #aeb4bd;
  --radius: 12px;
}

/* ── theme page: entries ── */
.ls-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--ink-on-action);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
}

.ls-more:hover,
.ls-more:focus {
  color: var(--ink-on-action);
  text-decoration: none;
}

[data-live-sports-open]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── theme page: the dialog ── */
.ls-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  background: var(--surface-modal);
  color: var(--ink-on-modal);
  font-family: Tahoma, "Leelawadee UI", Leelawadee, "Noto Sans Thai", sans-serif;
  font-size: 15px;
  line-height: 1.4;
  overscroll-behavior: contain;
}

.ls-overlay *,
.ls-overlay *::before,
.ls-overlay *::after {
  box-sizing: border-box;
}

.ls-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 4px 8px 4px 14px;
  border-bottom: 1px solid var(--line);
}

.ls-bar-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.ls-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 17px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ls-close {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--ink-dim); /* a control's edge: >= 3 : 1 (theme1's --line hairline is about 1 : 1) */
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-on-modal);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.ls-frame {
  flex: 1 1 auto;
  display: block;
  width: 100%;
  min-height: 0;
  margin: 0;
  border: 0;
  background: var(--surface-modal);
}

.ls-overlay--max .ls-bar {
  display: none;
}

.ls-overlay :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── player page (inside the dialog) ── */
[data-live-sports-player].ls-app {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--surface-modal);
  color: var(--ink-on-modal);
  font-family: Tahoma, "Leelawadee UI", Leelawadee, "Noto Sans Thai", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

[data-live-sports-player].ls-app *,
[data-live-sports-player].ls-app *::before,
[data-live-sports-player].ls-app *::after {
  box-sizing: border-box;
}

[data-live-sports-player] [hidden] {
  display: none;
}

[data-live-sports-player] :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ls-status {
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-card);
  color: var(--ink-on-card);
}

.ls-status-main {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.ls-status-amount {
  margin: 8px 0 0;
  font-size: 15px;
}

.ls-rules {
  margin: 8px 0 0;
  padding: 0 0 0 20px;
  font-size: 14px;
}

.ls-rule + .ls-rule {
  margin-top: 4px;
}

.ls-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.ls-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.ls-chips {
  display: flex;
  gap: 8px;
  min-width: 0;
  padding: 2px 2px 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.ls-chip {
  flex: 0 0 auto;
  min-height: 44px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid var(--ink-dim);
  border-radius: 999px;
  background: var(--surface-card);
  color: var(--ink-on-card);
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}

.ls-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--ink-on-action);
  font-weight: 700;
}

.ls-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.ls-player {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-card);
  color: var(--ink-on-card);
}

.ls-player-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ls-player-facts {
  margin: 2px 0 0;
  color: var(--ink-dim);
  font-size: 13px;
}

.ls-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-modal);
}

.ls-video,
.ls-embed {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  background: var(--surface-modal);
}

.ls-player-msg {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.ls-player-msg:empty {
  display: none;
}

/* ── [BF-1124-M] "ดูสด" full screen: the Fullscreen API state and the layer (iPhone Safari). Separate rules, since one
   unknown pseudo-class drops a whole selector list; two classes or a class and a pseudo-class beat the 900 px
   block's .ls-player max-width without touching that block. ── */
.ls-player.ls-player--max {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 8px;
  border: 0;
  border-radius: 0;
  background: var(--surface-modal);
  color: var(--ink-on-modal);
}

.ls-player:fullscreen {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 8px;
  border: 0;
  border-radius: 0;
  background: var(--surface-modal);
  color: var(--ink-on-modal);
}

.ls-player:-webkit-full-screen {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 8px;
  border: 0;
  border-radius: 0;
  background: var(--surface-modal);
  color: var(--ink-on-modal);
}

.ls-player--max .ls-stage {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: auto;
  border-radius: 0;
}

.ls-player:fullscreen .ls-stage {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: auto;
  border-radius: 0;
}

.ls-player:-webkit-full-screen .ls-stage {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: auto;
  border-radius: 0;
}

.ls-player--max .ls-video {
  object-fit: contain;
}

.ls-player:fullscreen .ls-video {
  object-fit: contain;
}

.ls-player:-webkit-full-screen .ls-video {
  object-fit: contain;
}

.ls-player--max .ls-player-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ls-player:fullscreen .ls-player-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ls-player:-webkit-full-screen .ls-player-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ls-player--max .ls-player-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ls-player:fullscreen .ls-player-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ls-player:-webkit-full-screen .ls-player-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ls-player--max .ls-player-facts {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ls-player:fullscreen .ls-player-facts {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ls-player:-webkit-full-screen .ls-player-facts {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ls-player-close {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  margin-left: auto;
  border: 1px solid var(--ink-dim);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-on-modal);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ls-player-close[hidden] {
  display: none;
}

.ls-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ls-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-card);
  color: var(--ink-on-card);
}

.ls-row-teams {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ls-team {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ls-team--away {
  flex-direction: row-reverse;
  text-align: right;
}

.ls-team-name {
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ls-vs {
  flex: 0 0 auto;
  color: var(--ink-dim);
  font-size: 13px;
}

.ls-logo {
  flex: 0 0 28px;
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: contain;
}

.ls-logo--empty {
  border: 1px solid var(--ink-dim);
  background: transparent;
}

.ls-logo--initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: var(--accent);
  color: var(--ink-on-action);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  white-space: nowrap;
}

.ls-logo--initials::before {
  content: attr(data-initials);
}

.ls-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  min-width: 0;
  color: var(--ink-dim);
  font-size: 13px;
}

.ls-league {
  overflow-wrap: anywhere;
}

.ls-row-act {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.ls-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-on-card);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ls-badge--live {
  border-color: var(--seed-danger);
  background: var(--seed-danger);
  color: var(--ink-on-danger);
}

.ls-badge--live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: ls-pulse 1.4s ease-in-out infinite;
}

.ls-watch {
  min-width: 64px;
  min-height: 44px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--ink-on-action);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}

.ls-watch:disabled {
  border-color: var(--line);
  background: transparent;
  color: var(--ink-dim);
  cursor: not-allowed;
}

@keyframes ls-pulse {
  50% {
    opacity: .35;
  }
}

/* ── wide screens: sports and leagues in a left sidebar ── */
@media (min-width: 900px) {
  [data-live-sports-player].ls-app {
    padding: 16px 20px;
  }

  .ls-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    align-items: start;
    gap: 16px;
  }

  .ls-side {
    position: sticky;
    top: 0;
  }

  .ls-chips {
    flex-direction: column;
    overflow-x: visible;
    padding: 0;
  }

  .ls-chip {
    width: 100%;
    border-radius: var(--radius);
    text-align: left;
    white-space: normal;
  }

  .ls-chips--league {
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }

  .ls-player {
    max-width: 960px;
  }

  .ls-row {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  }

  .ls-row-teams {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ls-badge--live::before {
    animation: none;
  }

  .ls-chip,
  .ls-watch {
    transition: none;
  }
}
