:root {
  --bg: #07140e;
  --card: #0f2419;
  --card2: #143022;
  --line: rgba(74, 222, 128, 0.22);
  --text: #ecfdf5;
  --muted: #86a899;
  --green: #4ade80;
  --amber: #fde68a;
  --red: #f87171;
  --live: #ef4444;
  --btn: #166534;
  --btn-text: #ecfdf5;
  --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}
body { padding-bottom: calc(52px + var(--safe-bottom)); }

#app { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + var(--safe-top)) 14px 10px;
  background: rgba(7, 20, 14, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.02em;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #86efac, #166534 70%);
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.35);
}
.nav { display: flex; flex-wrap: wrap; gap: 6px; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
}
.nav a.active, .nav a:hover { color: var(--text); background: var(--card2); }
.nav-muted { opacity: 0.75; }

.main {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 14px 28px;
}
.main--live {
  max-width: none;
  padding: 0;
}

h1 {
  font-size: 1.55rem;
  margin: 0 0 8px;
  line-height: 1.2;
}
.lead {
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.45;
  font-size: 0.98rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.card h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  color: var(--btn-text);
  background: var(--card2);
  border: 1px solid var(--line);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--btn); border-color: #15803d; }
.btn-live {
  background: linear-gradient(180deg, #ef4444, #b91c1c);
  border-color: #991b1b;
  color: #fff;
  font-size: 1.15rem;
  padding: 16px 18px;
  width: 100%;
}
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.row-actions .btn { flex: 1 1 auto; min-width: 120px; }

.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.9em; }

/* Match cards */
.match-list { display: flex; flex-direction: column; gap: 12px; }
.match-card {
  text-align: left;
  width: 100%;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.match-card.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.35);
  background: var(--card2);
}
.match-card .teams {
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.3;
  margin-bottom: 6px;
}
.match-card .meta {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 8px;
}
.match-card .scores {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
  color: var(--green);
  font-size: 1.1rem;
}
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.badge-live { background: var(--live); color: #fff; }
.badge-demo { background: #854d0e; color: var(--amber); }
.badge-done { background: #334155; color: #e2e8f0; }

.selected-bar {
  position: sticky;
  bottom: calc(52px + var(--safe-bottom));
  z-index: 15;
  background: rgba(15, 36, 25, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 8px;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.35);
}
.selected-bar strong { display: block; margin-bottom: 8px; }

/* Fields */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #06110c;
  color: var(--text);
  font-size: 1rem;
}
.hint {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.howto-card h2 { margin-bottom: 8px; }
.howto-steps {
  margin: 0;
  padding: 0 0 0 1.2rem;
  color: var(--text);
  line-height: 1.45;
}
.howto-steps li { margin: 0 0 8px; }
.howto-steps li:last-child { margin-bottom: 0; }
.step-kicker {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 6px;
}
.settings-advanced {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #06110c;
}
.settings-advanced summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
}

/* Go Live stage */
.live-stage {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  background: #000;
  display: flex;
  flex-direction: column;
}
.live-video-wrap {
  position: relative;
  flex: 1;
  min-height: 50vh;
  background: #000;
  overflow: hidden;
}
.live-video-wrap video,
.live-video-wrap canvas.preview-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.live-overlay-dom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  padding: 12px;
}
.live-controls {
  padding: 12px 14px calc(14px + var(--safe-bottom));
  background: rgba(7, 20, 14, 0.95);
  border-top: 1px solid var(--line);
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: #334155;
  margin-bottom: 10px;
}
.live-pill.on { background: var(--live); }
.live-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.live-match-label {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 10px;
}

/* Overlay bar (shared look) */
.overlay-bar {
  background: rgba(6, 20, 13, 0.78);
  border: 1px solid rgba(74, 222, 128, 0.4);
  border-radius: 14px;
  padding: 10px 12px;
  color: #ecfdf5;
  backdrop-filter: blur(6px);
  max-width: 720px;
  margin: 0 auto;
}
.overlay-bar.compact { font-size: 0.9rem; }
.ob-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.ob-live {
  color: #fff;
  background: var(--live);
  padding: 2px 8px;
  border-radius: 999px;
}
.ob-live.ob-demo { background: #854d0e; color: var(--amber); }
.ob-status { color: var(--amber); font-weight: 700; }
.ob-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.ob-team .ob-name {
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ob-team.away { text-align: right; }
.ob-score {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--green);
}
.ob-vs {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--muted);
}
.ob-detail { font-size: 0.82rem; color: #bbf7d0; }
.ob-players, .ob-bowler, .ob-balls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 4px;
}
.ob-role { color: var(--muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; }
.ob-pname { font-weight: 700; }
.ob-pruns strong { color: var(--amber); }
.ob-balls { display: flex; gap: 4px; flex-wrap: wrap; }
.ob-ball {
  min-width: 22px;
  text-align: center;
  padding: 2px 5px;
  border-radius: 6px;
  background: #14532d;
  font-weight: 800;
  font-size: 0.75rem;
}
.ob-ball.w { background: #7f1d1d; }
.ob-ball.four, .ob-ball.six { background: #1d4ed8; }
.ob-ball.last { outline: 1px solid var(--amber); }
.ob-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--muted);
}
.ob-muted { color: var(--muted); }

/* Watch */
.watch-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.watch-frame--live {
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35);
}
.watch-frame iframe,
.watch-frame .yt-live-host,
.watch-frame iframe.yt-live-host {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.yt-live-host {
  background: #000;
}
.live-feed-card h2 { margin-top: 0; }
.live-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.btn-sm {
  padding: 8px 12px;
  font-size: 0.85rem;
}

/* ── Viewer Live feed: video + scores only ── */
body.viewer-mode .topbar,
body.viewer-mode .footer,
body.viewer-mode .nav {
  display: none !important;
}
body.viewer-mode {
  padding-bottom: 0;
}
body.viewer-mode .main--viewer {
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 10px calc(12px + var(--safe-bottom));
}
.viewer-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.viewer-page--watch {
  gap: 14px;
  min-height: min(70vh, 640px);
}
.watch-brand {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(12, 48, 28, 0.95), rgba(8, 28, 18, 0.98));
  border: 1px solid rgba(125, 255, 179, 0.22);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
.watch-brand__kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(125, 255, 179, 0.85);
}
.watch-brand__title {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #f2fff7;
}
.watch-brand__sub {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.4;
  color: rgba(230, 245, 236, 0.88);
}
.watch-brand__sub a {
  color: #7dffb3;
  font-weight: 700;
  text-decoration: none;
}
.watch-brand__sub a:hover {
  text-decoration: underline;
}
.watch-club-cta {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(125, 255, 179, 0.35);
}
.watch-club-cta__title {
  margin: 0 0 6px;
  font-size: 0.92rem;
  font-weight: 800;
  color: #e8fff1;
}
.watch-club-cta__body {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: rgba(220, 235, 226, 0.9);
}
.watch-club-cta__body a {
  color: #7dffb3;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}
.viewer-toolbar--bottom {
  justify-content: center;
  margin-top: 4px;
  padding-bottom: 4px;
}
.btn-return-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  color: #0a1f14;
  background: linear-gradient(135deg, #7dffb3, #3dd68c);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(61, 214, 140, 0.35);
}
.btn-return-home:active {
  transform: scale(0.98);
}
.btn-return-home__chev {
  font-size: 1.1rem;
  line-height: 1;
}
.viewer-video-stage {
  position: relative;
  width: 100%;
}
.viewer-video-slot,
.viewer-video {
  margin: 0;
}
.viewer-page--watch .watch-frame--live,
.viewer-page--video-only .watch-frame--live {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.viewer-page--watch .watch-frame--live iframe,
.viewer-page--video-only .watch-frame--live iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.viewer-scoreboard-wrap {
  margin: 0;
  padding: 0;
}
.viewer-score-heading {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.viewer-score-sub {
  margin: 0 0 10px;
  font-size: 0.8rem;
  line-height: 1.35;
}
.viewer-scores {
  margin: 0;
}
.viewer-scores .overlay-bar {
  max-width: 100%;
  position: relative;
}
.viewer-yt-fallback {
  text-align: center;
  margin: 8px 0 0;
  font-size: 0.9rem;
}
.viewer-yt-fallback a {
  color: var(--green);
  font-weight: 700;
}

/* Settings — horizontal scroll fixture picker (scoreboard) */
.fixture-scroll {
  display: flex;
  flex-direction: row;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding: 4px 2px 12px;
  margin: 0 -4px;
}
.fixture-scroll::-webkit-scrollbar {
  height: 6px;
}
.fixture-scroll::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 99px;
}
.fixture-chip {
  flex: 0 0 auto;
  width: min(260px, 78vw);
  scroll-snap-align: start;
  text-align: left;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--card2);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.fixture-chip.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.4);
  background: #143022;
}
.fixture-chip-title {
  display: block;
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.3;
  margin: 6px 0 4px;
}
.fixture-chip-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.watch-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: flex;
  justify-content: center;
  padding: 8px 12px calc(8px + var(--safe-bottom));
  background: rgba(7, 20, 14, 0.94);
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(64px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 50;
  background: #14532d;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  max-width: min(92vw, 400px);
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* ── Moblin / OBS clean capture — bar always bottom of the *page* ── */
html.overlay-only,
body.overlay-only {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  height: 100dvh !important;
  background: transparent !important;
  overflow: hidden !important;
}
body.overlay-only .topbar,
body.overlay-only .footer,
body.overlay-only .nav { display: none !important; }
body.overlay-only #app,
body.overlay-only .main {
  max-width: none !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  position: relative !important;
}

/* Widget page = full transparent canvas; bar fixed to bottom */
body.overlay-only .overlay-stage {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  background: transparent !important;
  pointer-events: none !important;
}
body.overlay-only .overlay-stage-inner,
body.overlay-only #pure-overlay {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: none !important;
  bottom: 0 !important;
  top: auto !important;
  margin: 0 !important;
  transform: none !important;
  background: transparent !important;
}
/* Full-bleed stream scoreboard (Moblin full-screen widget) — bottom, full width */
body.overlay-only .overlay-stage--stream,
body.overlay-only #overlay-stage {
  position: fixed !important;
  inset: 0 !important;
  background: transparent !important;
}

.overlay-bar--stream {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: clamp(10px, 2vw, 16px) clamp(12px, 3vw, 18px) !important;
  padding-bottom: calc(clamp(10px, 2vw, 16px) + env(safe-area-inset-bottom, 0px)) !important;
  background: rgba(6, 20, 13, 0.92) !important;
  border: none !important;
  border-top: 2px solid rgba(74, 222, 128, 0.55) !important;
  border-radius: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.45) !important;
}
.overlay-bar--stream .ob-stream-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(6px, 1.5vw, 16px);
  width: 100%;
}
.overlay-bar--stream .ob-live {
  flex: 0 0 auto;
  font-size: clamp(10px, 1.8vw, 14px);
  padding: 3px 8px;
}
.overlay-bar--stream .ob-stream-side {
  flex: 1 1 40%;
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.2vw, 12px);
  min-width: 0;
}
.overlay-bar--stream .ob-stream-side.away {
  justify-content: flex-end;
  text-align: right;
}
.overlay-bar--stream .ob-name {
  font-size: clamp(15px, 4.2vw, 26px) !important;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.overlay-bar--stream .ob-score {
  font-size: clamp(20px, 6vw, 34px) !important;
  font-weight: 900;
  color: var(--green);
  white-space: nowrap;
  flex: 0 0 auto;
}
.overlay-bar--stream .ob-vs {
  flex: 0 0 auto;
  font-size: clamp(10px, 1.6vw, 14px);
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}
.overlay-bar--stream .ob-stream-sub {
  margin-top: 4px;
  font-size: clamp(10px, 1.6vw, 13px);
  color: var(--amber);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.ob-live.ob-live-now,
.overlay-bar.is-live .ob-live {
  background: var(--live) !important;
  color: #fff !important;
}

.empty-state {
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
}
.empty-state strong { color: var(--text); display: block; margin-bottom: 8px; }

.steps {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.5;
}
.steps li { margin-bottom: 6px; }
.steps strong { color: var(--text); }

/* NV Play-style score bar + stat cards */
.nv-bar {
  display: grid;
  grid-template-columns: minmax(7.5rem, 22%) minmax(0, 1fr) minmax(8.5rem, 28%);
  width: 100%;
  min-height: 64px;
  color: #fff;
  font-family: Outfit, "DM Sans", system-ui, sans-serif;
  overflow: hidden;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.35);
}
.nv-bar__players {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 14px 8px;
  background: #071018;
  min-width: 0;
}
.nv-bar__plist,
.nv-bar__pbowl {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  font-size: clamp(0.72rem, 1.7vw, 1.05rem);
  font-weight: 700;
}
.nv-bar__plab {
  font-size: 0.68em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  flex: 0 0 auto;
}
.nv-bar__pname {
  white-space: nowrap;
}
.nv-bar__pname.is-strike::after {
  content: "*";
  color: #fde68a;
}
.nv-bar__pstat {
  color: #9fd4ff;
  font-variant-numeric: tabular-nums;
}
.nv-bar__bat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #1398a2;
}
.nv-bar__bowl {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 10px;
  background: #1d3f99;
}
.nv-bar__mid {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 8px 12px;
  background: #0b1624;
  min-width: 0;
}
.nv-bar__score {
  font-size: clamp(1.35rem, 4.6vw, 2rem);
  font-weight: 800;
  line-height: 1;
}
.nv-bar__overs {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.92;
}
.nv-bar__fixture {
  font-size: clamp(0.68rem, 2.1vw, 0.95rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nv-bar__note {
  font-size: clamp(0.62rem, 1.8vw, 0.78rem);
  font-weight: 600;
  color: #dbe7f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nv-bar__bowl-name {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-align: right;
  line-height: 1.2;
}
.nv-bar__bowl-score {
  font-size: clamp(1.15rem, 3.6vw, 1.7rem);
  font-weight: 800;
  text-align: right;
  line-height: 1;
}
.nv-crest {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #12305c;
  font-size: 0.68rem;
  font-weight: 900;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.nv-crest--img {
  padding: 2px;
}
.nv-crest--img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 50%;
}
.nv-crest--lg {
  width: 52px;
  height: 52px;
  font-size: 0.85rem;
}

.nv-pack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 14px 0 0;
}
.nv-card {
  background: #f4f6f8;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  color: #102033;
}
.nv-card__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 8px;
  background: #fff;
  border-bottom: 4px solid #1d3f99;
}
.nv-card__titles {
  text-align: center;
}
.nv-card__titles h3 {
  margin: 0;
  font-size: clamp(1.2rem, 4vw, 1.7rem);
  letter-spacing: 0.06em;
  font-weight: 900;
}
.nv-card__titles p {
  margin: 2px 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #4b5d73;
}
.nv-card__body {
  padding: 8px 10px 4px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(236, 240, 244, 0.92));
}
.nv-card__foot {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px 10px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5b6b7c;
  background: #e6eaee;
}
.nv-svg {
  width: 100%;
  height: auto;
  display: block;
}
.nv-axis {
  fill: #6b7c8d;
  font-size: 11px;
  font-family: system-ui, sans-serif;
}
.nv-line {
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.nv-line--1 { stroke: #1d3f99; }
.nv-line--2 { stroke: #1398a2; }
.nv-bar1 { fill: #1d3f99; }
.nv-bar2 { fill: #1398a2; }
.nv-dot {
  fill: #fff;
  stroke-width: 2.4;
}
.nv-dot--1 { stroke: #1d3f99; }
.nv-dot--2 { stroke: #1398a2; }
.nv-sum-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 8px 10px;
  background: #1d3f99;
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
}
.nv-sum-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.nv-sum-col { padding: 8px 10px 12px; }
.nv-sum-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 5px 0;
  font-size: 0.82rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(16, 32, 51, 0.06);
}
.nv-sum-foot {
  margin: 0;
  padding: 10px 12px 4px;
  text-align: center;
  font-size: 0.78rem;
  color: #3d4d5e;
}
.nv-empty { margin: 8px 0; font-size: 0.8rem; color: #5b6b7c; }

.nv-rotate {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 6%;
  bottom: 72px;
  z-index: 12;
  display: flex;
  pointer-events: none;
}
.nv-rotate[hidden] {
  display: none !important;
}
.nv-rotate__frame {
  flex: 1;
  min-height: 0;
  display: flex;
}
.nv-rotate .nv-card {
  flex: 1;
  background: rgba(244, 246, 248, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
}
.nv-rotate .nv-card__head,
.nv-rotate .nv-card__foot {
  background: rgba(255, 255, 255, 0.45);
}
.nv-rotate .nv-card__body {
  background: rgba(255, 255, 255, 0.28);
}
body.overlay-only .nv-rotate {
  position: fixed;
  left: 4%;
  right: 4%;
  top: 5%;
  bottom: 72px;
  z-index: 15;
}
body.overlay-only .nv-bar,
body.overlay-only #pure-overlay .nv-bar,
.nv-bar.nv-bar--full {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  transform: none !important;
  box-sizing: border-box !important;
  z-index: 20;
  min-height: clamp(96px, 13vh, 168px);
  grid-template-columns: minmax(9.5rem, 24%) minmax(0, 1fr) minmax(10.5rem, 30%);
}
body.overlay-only .nv-bar__bat,
body.overlay-only .nv-bar__mid,
body.overlay-only .nv-bar__bowl,
.nv-bar.nv-bar--full .nv-bar__bat,
.nv-bar.nv-bar--full .nv-bar__mid,
.nv-bar.nv-bar--full .nv-bar__bowl {
  padding: clamp(10px, 1.6vh, 18px) clamp(12px, 2vw, 22px);
}
body.overlay-only .nv-bar__score,
.nv-bar.nv-bar--full .nv-bar__score {
  font-size: clamp(2.1rem, 5.8vw, 4.2rem);
}
body.overlay-only .nv-bar__overs,
.nv-bar.nv-bar--full .nv-bar__overs {
  font-size: clamp(0.9rem, 2vw, 1.35rem);
}
body.overlay-only .nv-bar__fixture,
.nv-bar.nv-bar--full .nv-bar__fixture {
  font-size: clamp(1rem, 2.5vw, 1.85rem);
}
body.overlay-only .nv-bar__note,
.nv-bar.nv-bar--full .nv-bar__note {
  font-size: clamp(0.8rem, 1.8vw, 1.2rem);
}
body.overlay-only .nv-bar__bowl-name,
.nv-bar.nv-bar--full .nv-bar__bowl-name {
  font-size: clamp(0.78rem, 1.7vw, 1.15rem);
}
body.overlay-only .nv-bar__bowl-score,
.nv-bar.nv-bar--full .nv-bar__bowl-score {
  font-size: clamp(1.7rem, 4.4vw, 3.2rem);
}
body.overlay-only .nv-crest,
.nv-bar.nv-bar--full .nv-crest {
  width: clamp(48px, 6.2vw, 76px);
  height: clamp(48px, 6.2vw, 76px);
  font-size: clamp(0.8rem, 1.8vw, 1.15rem);
}
body.overlay-only .nv-rotate {
  bottom: clamp(96px, 13vh, 168px);
}
body.viewer-mode .viewer-scores .nv-bar {
  overflow: hidden;
}
.viewer-scores--on-video {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  pointer-events: none;
}
.viewer-scores--on-video .nv-bar,
.viewer-scores--on-video .nv-bar.nv-bar--full {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  border-radius: 0;
}
.nv-plist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 6px 12px;
}
.nv-prow {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: baseline;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(16, 32, 51, 0.08);
  font-size: clamp(1.05rem, 3.2vw, 1.55rem);
  font-weight: 800;
}
.nv-prow .nv-pstat {
  font-variant-numeric: tabular-nums;
  color: #1d3f99;
}
.nv-prow .nv-pmeta {
  font-size: 0.72em;
  font-weight: 700;
  color: #5b6b7c;
}
.nv-prow.is-strike .nv-pname::after {
  content: " *";
  color: #c9a227;
}

.in-app-browser {
  position: fixed;
  inset: 0;
  z-index: 400 !important;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: rgba(4, 10, 8, 0.82);
}
.in-app-browser[hidden] {
  display: none;
}
.in-app-browser__sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #0b1612;
  color: #ecfdf5;
}
.in-app-browser__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 10px 12px;
  border-bottom: 1.5px solid #d4af37;
}
.in-app-browser__head-text {
  min-width: 0;
}
.in-app-browser__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.in-app-browser__hint {
  margin: 2px 0 0;
  font-size: 0.72rem;
  opacity: 0.72;
}
.in-app-browser__close {
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 10px;
}
.in-app-browser__frame-wrap {
  flex: 1 1 auto;
  min-height: 0;
  background: #fff;
}
.in-app-browser__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
body.in-app-browser-open {
  overflow: hidden;
}

@media (max-width: 520px) {
  body:not(.overlay-only) .nv-bar:not(.nv-bar--full) {
    grid-template-columns: 1fr 1fr;
  }
  body:not(.overlay-only) .nv-bar:not(.nv-bar--full) .nv-bar__mid {
    grid-column: 1 / -1;
    order: 3;
  }
}
