/* ============================================================
   FILE   : spectator_web/styles.css
   Cric Era — Spectator Web Viewer. All styling lives here (no inline styles),
   so a strict `style-src 'self'` CSP holds. Mobile-first, system fonts only
   (no third-party fonts), dark theme to match the app.
   ============================================================ */

:root {
  --bg: #0f0f10;
  --card: #1b1b1e;
  --surface: #242429;
  --border: #303036;
  --text-hi: #f4f4f5;
  --text-mid: #c2c2c8;
  --text-low: #8a8a92;
  --green: #21c257;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-hi);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

.viewer {
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
}

.brand {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--text-low);
  text-transform: uppercase;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-low);
}

.dot[data-on="true"] {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(33, 194, 87, 0.15);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-hi);
}

.scoreline {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 8px;
}

.score {
  font-size: 40px;
  font-weight: 900;
  color: var(--green);
  letter-spacing: -0.5px;
}

.overs {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-mid);
}

.status {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-mid);
}

.meta {
  margin: 0;
  font-size: 13px;
  color: var(--text-mid);
}

.updated {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-low);
}

.message {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-low);
}

/* When a live/completed scoreboard is showing, the generic message is hidden. */
body[data-phase="live"] .message,
body[data-phase="completed"] .message {
  display: none;
}

/* When no scoreboard is available, hide the empty score/meta rows. */
body[data-phase="loading"] .scoreline,
body[data-phase="loading"] .status,
body[data-phase="loading"] .meta,
body[data-phase="loading"] .updated,
body[data-phase="unavailable"] .scoreline,
body[data-phase="unavailable"] .status,
body[data-phase="unavailable"] .meta,
body[data-phase="unavailable"] .updated,
body[data-phase="revoked"] .scoreline,
body[data-phase="revoked"] .status,
body[data-phase="revoked"] .meta,
body[data-phase="revoked"] .updated,
body[data-phase="error"] .scoreline,
body[data-phase="error"] .status,
body[data-phase="error"] .meta,
body[data-phase="error"] .updated {
  display: none;
}

.foot {
  margin-top: auto;
  padding: 8px 2px;
  font-size: 11px;
  color: var(--text-low);
}
