/* ════════════════════════════════════════════════════════════════════════
   LIVE SCREEN — the Claude Design "Live" file (19.10.2026).
   A title with the state of the data, a chip per league, a section per league
   and a card per game. Everything follows the width of the screen's own box,
   not the window, as the design measures it: sizes step at 560 (phone) and
   1000 (desktop); columns are 1 under 640, 2 up to 1100, 3 from there.
   ════════════════════════════════════════════════════════════════════════ */

#dash-screen { inline-size: 100%; }
.lv {
  --lv-z: 38px;       /* crest */
  --lv-mid: 132px;    /* the middle column */
  --lv-sc: 46px;      /* score digits */
  container-type: inline-size;
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px clamp(10px, 3vw, 24px) 60px;
  color: var(--ds-ink);
  font-family: var(--ds-font);
  font-size: var(--ds-fs-15);
  line-height: 1.5;
}

/* ── Title ── */
.lv-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 12px 20px;
  padding-bottom: 18px; margin-bottom: 20px;
  border-bottom: 2px solid var(--ds-ink);
}
.lv-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.lv-title h1 {
  margin: 0; font: 900 var(--ds-fd-80)/.9 var(--ds-font); letter-spacing: -.035em; color: var(--ds-ink);
}
.lv-dot {
  flex: none; box-sizing: border-box; width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid var(--ds-ink2); background: transparent;
}
.lv-dot.is-on {
  border: 0; background: var(--ds-live);
  animation: lv-pulse 1.8s ease-out infinite;
}
.lv-upd { display: flex; align-items: center; gap: 12px; }
.lv-stamp {
  display: flex; align-items: center; gap: 8px;
  font: 600 var(--ds-fs-14)/1.2 var(--ds-font); color: var(--ds-ink2); white-space: nowrap;
}
.lv-ring { flex: none; transform: rotate(-90deg); }
.lv-ring-fill { animation: lv-ring 30s linear forwards; }
.lv-spin { flex: none; animation: lv-spin .9s linear infinite; }
.lv-refresh {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 44px; min-height: 44px; padding: 0 14px;
  border: 1.5px solid var(--ds-ink); border-radius: 0; background: transparent; color: var(--ds-ink);
  font: 800 var(--ds-fs-14) var(--ds-font); cursor: pointer;
  transition: background var(--ds-t-ctrl) ease;
}
.lv-refresh:hover:not(:disabled) { background: var(--ds-soft); }
.lv-refresh:disabled { cursor: progress; opacity: .55; }

/* ── Buttons ── */
.lv-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1.5px solid var(--ds-ink); border-radius: 0; background: transparent; color: var(--ds-ink);
  font: 800 var(--ds-fs-14) var(--ds-font); cursor: pointer;
  transition: background var(--ds-t-ctrl) ease;
}
.lv-btn:hover { background: var(--ds-soft); }
.lv-btn--solid { background: var(--ds-ink); color: var(--ds-card); }
.lv-btn--solid:hover { background: var(--ds-ink); opacity: .9; }
html[dir="ltr"] .lv-flip, .lv-flip:dir(ltr) { transform: scaleX(-1); }

/* ── No live game / empty / error ── */
.lv-nolive {
  display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 14px 16px;
  background: var(--ds-card); border: 1px solid var(--ds-line);
}
.lv-nolive i { flex: none; box-sizing: border-box; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ds-ink2); }
.lv-nolive span { font: 800 var(--ds-fs-15)/1.35 var(--ds-font); color: var(--ds-ink); }
.lv-empty {
  display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 52px 20px;
  background: var(--ds-card); border: 1px solid var(--ds-line); text-align: center;
}
.lv-empty h2 { margin: 0; font: 900 var(--ds-fs-24)/1.15 var(--ds-font); color: var(--ds-ink); }
.lv-error {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 18px;
  padding: 22px 24px; background: var(--ds-card); border: 1.5px solid var(--ds-live);
}
.lv-error p { margin: 0; font: 600 var(--ds-fs-15)/1.45 var(--ds-font); text-wrap: pretty; }

/* ── League chips ── */
.lv-nav {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 8px 0; background: var(--ds-bg); border-bottom: 1px solid var(--ds-line);
}
.lv-nav::-webkit-scrollbar { display: none; }
.lv-chip {
  flex: none; display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 1.5px solid var(--ds-line); border-radius: 0; background: transparent; color: var(--ds-ink);
  font: 800 var(--ds-fs-14) var(--ds-font); white-space: nowrap; cursor: pointer;
  transition: background var(--ds-t-ctrl) ease, border-color var(--ds-t-ctrl) ease;
}
.lv-chip:hover { border-color: var(--ds-ink); }
.lv-chip.is-on { border-color: var(--ds-ink); background: var(--ds-ink); color: var(--ds-bg); }
.lv-chip i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ds-live); }
.lv-chip.is-on i { background: var(--ds-bg); }

/* ── A league ── */
.lv-lg { margin-top: 30px; scroll-margin-top: 70px; }
.lv-lg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 14px; }
.lv-lg-head .ui-lg-mark { align-self: center; }
.lv-lg-head h2 { margin: 0; font: 900 var(--ds-fs-24)/1.15 var(--ds-font); letter-spacing: -.015em; color: var(--ds-ink); }
.lv-lg-head span { font: 600 var(--ds-fs-14)/1.3 var(--ds-font); color: var(--ds-ink2); }
.lv-lg-err {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 12px; padding: 12px 14px;
  background: var(--ds-card); border: 1.5px solid var(--ds-live);
}
.lv-lg-err svg { flex: none; }
.lv-lg-msg { flex: 1 1 200px; min-width: 0; font: 700 var(--ds-fs-14)/1.4 var(--ds-font); text-wrap: pretty; }
.lv-lg-when { font: 600 var(--ds-fs-13)/1.3 var(--ds-font); color: var(--ds-ink2); }

/* ── The grid and a card ── */
.lv-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: stretch; }
@container (min-width: 640px)  { .lv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 1100px) { .lv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.lv-card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--ds-card); border: 1px solid var(--ds-line);
}
.lv-card.lv-in { animation: lv-up .35s ease-out both; }
.lv-card.is-on { box-shadow: inset 0 3px 0 var(--ds-live); background: color-mix(in srgb, var(--ds-live) 4%, var(--ds-card)); }
.lv-card.is-half { box-shadow: inset 0 3px 0 var(--ds-warn); background: var(--ds-card); }
.lv-card.is-stale { box-shadow: inset 0 3px 0 var(--ds-ink2); background: var(--ds-card); }
/* A close fourth quarter: a thin red frame, and first in its league. */
.lv-card.is-close { border-color: var(--ds-live); box-shadow: inset 0 3px 0 var(--ds-live), 0 0 0 1px color-mix(in srgb, var(--ds-live) 45%, transparent); }

/* The middle column is the design's width, and grows when a score needs more: the design
   was drawn with two-digit scores, and an NBA score of three digits (129px at the phone
   size) ran 25px over the clubs' names. */
.lv-main {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(var(--lv-mid), max-content) minmax(0, 1fr);
  align-items: center; align-content: center; column-gap: 10px;
  width: 100%; flex: 1 1 0; padding: 18px 14px 16px;
  border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit;
  text-align: center; cursor: pointer;
}
.lv-main:hover { background: var(--ds-soft); }
.lv-main:focus-visible { outline: 2px solid var(--ds-ink); outline-offset: -2px; }
.lv-side { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.lv-side .team-crest { width: var(--lv-z) !important; height: var(--lv-z) !important; font-size: calc(var(--lv-z) * .28) !important; }
.lv-name {
  max-width: 100%; font: 700 16px/1.25 var(--ds-font); color: var(--ds-ink);
  overflow-wrap: break-word; text-wrap: balance;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lv-name.is-dim { color: var(--ds-ink2); }
.lv-code { font: 600 var(--ds-fs-13)/1 var(--ds-font-num); letter-spacing: .08em; color: var(--ds-ink2); }
.lv-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; min-width: 0; }
.lv-score { display: flex; align-items: baseline; justify-content: center; gap: 7px; }
.lv-score b {
  font: 800 var(--lv-sc)/.9 var(--ds-font-num); font-style: normal; font-variant-numeric: tabular-nums;
  direction: ltr; unicode-bidi: isolate;
}
.lv-score i { font: 600 calc(var(--lv-sc) * .62)/1 var(--ds-font-num); font-style: normal; color: var(--ds-ink2); position: relative; top: -.08em; }
.lv-time { font: 800 32px/.95 var(--ds-font-num); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; color: var(--ds-ink); }
.lv-cd { font: 700 var(--ds-fs-13)/1.2 var(--ds-font); color: var(--ds-ink2); font-variant-numeric: tabular-nums; }

/* ── State under the score: a pill only for live and half-time ── */
.lv-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--ds-r-pill);
  font: 800 var(--ds-fs-13)/1.1 var(--ds-font); white-space: nowrap;
}
.lv-pill i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.lv-pill--live { background: var(--ds-live); color: #fff; }
.lv-pill--live i { animation: lv-breathe 1.6s ease-in-out infinite; }
html[data-theme="dark"] .lv-pill--live { color: #0C111C; }
.lv-pill--half { padding: 3px 9px; border: 1.5px solid var(--ds-warn); color: var(--ds-warn); }
/* A league whose last load failed: its live label goes grey and still. */
.lv-pill--live.is-stale { padding: 3px 9px; border: 1.5px solid var(--ds-ink2); background: transparent; color: var(--ds-ink2); }
.lv-pill--live.is-stale i { animation: none; }
.lv-state { font: 800 var(--ds-fs-13)/1.1 var(--ds-font); white-space: nowrap; }
.lv-state--final { letter-spacing: .02em; color: var(--ds-ink2); }
.lv-state--soon { line-height: 1.2; color: var(--ds-warn); }
.lv-cd { font: 700 var(--ds-fs-13)/1.2 var(--ds-font); color: var(--ds-ink2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── The insight tag under a live card ── */
.lv-ins-slot:empty { display: none; }

/* ── Loading ── */
.lv-skel { margin-top: 8px; }
.lv-skel i {
  display: block; background: linear-gradient(90deg, var(--ds-line) 0%, var(--ds-card) 50%, var(--ds-line) 100%);
  background-size: 200% 100%; animation: lv-shim 1.2s linear infinite;
}
.lv-skel-chips { display: flex; gap: 6px; margin: 0 0 22px; }
.lv-skel-chips i { width: 92px; height: 44px; }
.lv-skel-chips i + i { width: 120px; }
.lv-skel-h { width: 150px; height: 22px; margin-bottom: 14px; }
.lv-skel-card {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--lv-mid) minmax(0, 1fr); align-items: center; column-gap: 10px;
  padding: 18px 14px; background: var(--ds-card); border: 1px solid var(--ds-line); min-height: 140px; box-sizing: border-box;
}
.lv-skel-card > div { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lv-skel-card .c { width: var(--lv-z); height: var(--lv-z); border-radius: 50%; }
.lv-skel-card .t { height: 12px; width: 64%; }
.lv-skel-card .s { width: 80%; height: calc(var(--lv-sc) * .8); }
.lv-skel-card .p { width: 60%; height: 18px; border-radius: 999px; }
.lv-skel .lv-grid > :nth-child(n+2) { display: none; }
@container (min-width: 640px)  { .lv-skel .lv-grid > :nth-child(2) { display: grid; } }
@container (min-width: 1100px) { .lv-skel .lv-grid > :nth-child(3) { display: grid; } }

/* ── Sizes by the width of the screen's own box (after the rules they change) ── */
/* A tablet: the design's middle size. (A container query cannot restyle the box
   it measures, so the sizes go on its children and are inherited from there.) */
@container (max-width: 999px) {
  .lv > * { --lv-z: 34px; --lv-mid: 116px; --lv-sc: 42px; }
  .lv-title h1 { font-size: var(--ds-fd-64); line-height: .92; }
}
/* A phone. */
@container (max-width: 559px) {
  .lv > * { --lv-z: 32px; --lv-mid: 104px; --lv-sc: 38px; }
  .lv-head { padding-bottom: 14px; margin-bottom: 14px; }
  .lv-title h1 { font-size: 40px; line-height: 1; }
  .lv-dot { width: 12px; height: 12px; }
  .lv-refresh { padding: 0; }
  .lv-refresh span { display: none; }      /* the icon alone; its name stays as the label */
  .lv-grid { gap: 12px; }
  .lv-lg { margin-top: 22px; }
  .lv-lg-head { margin-bottom: 10px; }
  .lv-lg-head h2 { font-size: 21px; }
  .lv-main { column-gap: 6px; padding: 16px 10px 14px; }
  .lv-name { font-size: var(--ds-fs-15); }
  .lv-score { gap: 5px; }
  .lv-time { font-size: 28px; }
  .lv-skel-card { min-height: 128px; }
}
/* Not in the design: on a 320 screen a three-digit score leaves the names too little
   room even with the middle column grown, so its digits step down one size there. */
@container (max-width: 359px) {
  .lv > * { --lv-sc: 32px; }
}

@keyframes lv-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ds-live) 45%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes lv-ring { to { stroke-dashoffset: 0; } }
@keyframes lv-spin { to { transform: rotate(360deg); } }
@keyframes lv-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes lv-shim { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes lv-breathe { 50% { transform: scale(.55); opacity: .6; } }
@media (prefers-reduced-motion: reduce) {
  .lv *, .lv-card { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .lv-ring-fill { animation: none; stroke-dashoffset: 0; }
}
