/* Public live scoreboard + embed widget */

#app {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px 32px;
}
.l-head {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  gap: 10px;
  margin: 0 -16px 14px;
  padding: 14px 16px 12px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.l-head.embed {
  position: static;
  backdrop-filter: none;
  background: transparent;
}
.l-head-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.l-title {
  font-size: clamp(18px, 3.4vw, 26px);
  font-weight: 800;
  letter-spacing: -0.02em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.l-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 1.4s ease-in-out infinite;
}
.live-dot.stale {
  background: var(--warn);
  animation: none;
}
.l-controls {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}
.l-controls select {
  width: auto;
  min-width: 110px;
}
.l-tabs {
  justify-self: start;
}
.l-summary {
  margin-bottom: 10px;
}

.l-courts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.l-court {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border-top: 4px solid var(--court);
  transition: opacity 0.2s;
}
.l-court.is-live {
  border-top-color: var(--live);
}
.l-court.dim {
  opacity: 0.4;
}
.l-court.hit,
.l-result.hit,
.l-sched li.hit {
  box-shadow: 0 0 0 2px var(--brand), var(--shadow);
}
.lc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.lc-head h2 {
  font-size: 17px;
}
.lc-empty {
  margin: 6px 0;
}
.lc-next {
  padding-top: 8px;
  border-top: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.l-court .scoreline {
  font-size: 16px;
}
.l-court .games .g.cur {
  font-size: 18px;
}

.l-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}
.l-result {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
}
.lr-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.l-none {
  padding: 40px 0;
  text-align: center;
}

.l-schedule {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.l-sched {
  padding: 14px;
}
.l-sched h2 {
  font-size: 16px;
  margin-bottom: 8px;
}
.l-sched ol,
.l-sched ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: q;
}
.l-sched li {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-weight: 600;
}
.l-sched ol li {
  counter-increment: q;
  position: relative;
  padding-left: 36px;
}
.l-sched ol li::before {
  content: counter(q);
  position: absolute;
  left: 10px;
  top: 9px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  font-size: 11px;
  color: var(--muted);
}
.l-sched ol li:first-child::before {
  content: '▶';
  background: var(--court);
  color: var(--accent);
  font-size: 8px;
}
.l-waiting {
  margin-top: 12px;
}

.l-found {
  margin-bottom: 18px;
}
.l-found:empty {
  display: none;
}
.l-found-title {
  font-size: 16px;
  margin-bottom: 10px;
}
.l-found-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}
.l-found-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-left: 4px solid var(--brand);
}
.where {
  font-weight: 800;
}
.where-live {
  color: var(--live);
}
.where-next {
  color: var(--warn);
}
.where-done {
  color: var(--brand);
}
.where-wait {
  color: var(--muted);
}
.l-foot {
  margin-top: 16px;
  text-align: right;
  font-size: 12px;
}

@media (max-width: 560px) {
  .l-controls {
    grid-template-columns: 1fr 1fr;
  }
  .l-search {
    grid-column: 1 / -1;
  }
  .l-controls select {
    width: 100%;
  }
  .l-tabs {
    justify-self: stretch;
  }
  .l-tabs button {
    flex: 1;
  }
  .l-courts,
  .l-results,
  .l-found-list,
  .l-schedule {
    grid-template-columns: 1fr;
  }
}

/* Embed: no full-height tricks so the iframe can size itself to content. */
body[data-mode='embed'] {
  background: transparent;
}
body[data-mode='embed'] #app {
  padding: 0 12px 12px;
}
body[data-mode='embed'] .l-head {
  margin: 0 -12px 12px;
  padding: 12px;
}
