:root {
  --bg: #ffffff;
  --section-bg: #1e4d7d;
  --section-text: #ffffff;
  --border: #d9dee3;
  --text: #1a2330;
  --muted: #6b7280;
  --green: #2c9f6f;
  --green-dark: #1f7a55;
  --info: #2d8c8c;

  --back-1: #d9eaf6;
  --back-2: #b8d8ee;
  --back-3: #8fc1e2;
  --lay-1: #fad9dd;
  --lay-2: #f7c0c6;
  --lay-3: #f3a4ad;

  --suspended-bg: #3a3a3a;
  --suspended-text: #ff4d4d;
  --pitch: linear-gradient(180deg, #6a8f60 0%, #527749 100%);

  --sidebar-bg: #14233a;
  --sidebar-bg-hover: #1d3354;
  --sidebar-active: #2563a8;
  --sidebar-text: #c4d2e4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: #eef1f4;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

/* ---------- App shell ---------- */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar-header {
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #e53935; display: inline-block; margin-right: 6px;
  animation: blink 1.4s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }
.refresh-note { font-size: 10px; color: #6b7da0; font-weight: 400; text-transform: none; }

.match-list { list-style: none; flex: 1; }
.match-item {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.12s;
}
.match-item:hover { background: var(--sidebar-bg-hover); }
.match-item.active { background: var(--sidebar-active); }
.match-item.active .mi-comp { color: #cfe3ff; }
.mi-comp { font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; color: #7d8fae; margin-bottom: 3px; }
.mi-title { font-size: 13px; font-weight: 600; color: #fff; }
.mi-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.mi-status {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  padding: 1px 6px; border-radius: 8px; letter-spacing: 0.4px;
}
.mi-status.live { background: #e53935; color: #fff; }
.mi-status.upcoming { background: #455a7a; color: #cdd9ec; }
.mi-status.result { background: #2c9f6f; color: #fff; }
.mi-time { font-size: 10px; color: #6b7da0; }
.sidebar-empty, .sidebar-loading { padding: 20px 16px; color: #6b7da0; font-size: 12px; }

/* ---------- Content area ---------- */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}
.content-inner {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  min-height: 200px;
}
.placeholder {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 60vh; color: var(--muted); text-align: center; padding: 40px;
}
.placeholder h2 { font-size: 18px; color: #44546a; margin-bottom: 8px; font-weight: 600; }
.placeholder p { font-size: 13px; max-width: 360px; }

.conn-status {
  font-size: 11px; padding: 5px 12px; text-align: right; color: var(--muted);
}
.conn-status .dot { display:inline-block; width:7px; height:7px; border-radius:50%; margin-right:5px; vertical-align: middle; }
.conn-status.connected .dot { background: var(--green); }
.conn-status.connecting .dot { background: #d9a300; animation: blink 1s infinite; }
.conn-status.disconnected .dot { background: #c0392b; }

/* ---------- Match header ---------- */
.match-title-bar {
  background: linear-gradient(180deg, #234f7a 0%, #1c4068 100%);
  color: #fff; padding: 7px 14px; font-weight: 600; font-size: 13px;
  display: flex; justify-content: space-between; align-items: center; letter-spacing: 0.3px;
}
.match-title-bar .datetime { font-weight: 400; font-size: 12px; }

.scorebox { background: var(--pitch); color: #fff; padding: 14px 18px; position: relative; min-height: 96px; }
.scorebox::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,0.04) 0 2px, transparent 2px 80px);
  pointer-events: none;
}
.score-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; position: relative; z-index: 1; }
.team-short { font-weight: 700; font-size: 15px; width: 50px; }
.team-score { flex: 1; font-size: 14px; }
.team-score .crr { color: #d9eed3; font-size: 11px; margin-left: 8px; }
.needs { font-size: 13px; font-weight: 500; color: #fff8d0; }
.last-balls { display: flex; gap: 4px; margin-top: 4px; justify-content: flex-end; }
.ball {
  width: 22px; height: 22px; border-radius: 50%; background: #1c6fb8; color: #fff;
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.15);
}
.ball.boundary-4 { background: #d97706; }
.ball.boundary-6 { background: #b91c1c; }
.ball.wicket { background: #111; }

/* ---------- Market sections ---------- */
.section { border-top: 1px solid var(--border); }
.section-header {
  background: var(--section-bg); color: var(--section-text); padding: 7px 12px;
  font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
  display: flex; justify-content: space-between; align-items: center;
}
.section-header .cashout-btn {
  background: var(--green); color: #fff; border: none; padding: 3px 10px;
  font-size: 11px; border-radius: 2px; font-weight: 600; cursor: pointer; text-transform: none; letter-spacing: 0;
}
.section-header .cashout-btn:hover { background: var(--green-dark); }
.subsection-header { background: #5b87b0; color: #fff; padding: 5px 12px; font-size: 12px; font-weight: 600; }
.minmax-bar { color: var(--info); font-size: 11px; padding: 4px 12px; background: #fafbfc; border-bottom: 1px solid #eef0f3; font-weight: 600; }

/* Odds provider picker in the sidebar. */
.provider-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; background: #f4f6f8; border-bottom: 1px solid #e3e7ec;
}
.provider-bar label {
  font-size: 10.5px; font-weight: 700; color: #6b7a8d;
  text-transform: uppercase; letter-spacing: .4px; white-space: nowrap;
}
.provider-bar select {
  flex: 1; min-width: 0; font: inherit; font-size: 12px; font-weight: 600;
  color: #1c2b3a; padding: 4px 6px; border: 1px solid #cbd3dc;
  border-radius: 3px; background: #fff; cursor: pointer;
}
.provider-bar select:focus { outline: 2px solid #5b87b0; outline-offset: -1px; }

/* Provider/plan condition banner (e.g. in-play odds need a live-enabled plan). */
.notice {
  background: #fff8e1; border: 1px solid #f0d089; border-left: 3px solid #d9a300;
  color: #6b5300; font-size: 12px; line-height: 1.5; padding: 8px 12px; margin-bottom: 10px;
  border-radius: 2px;
}

table.market { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.market th, table.market td {
  padding: 6px 8px; text-align: center; border-right: 1px solid #e8ebee; border-bottom: 1px solid #eef0f3; vertical-align: middle;
}
table.market th { font-size: 11px; font-weight: 700; padding: 5px 8px; color: #1a2330; }
table.market th.h-back { background: var(--back-3); }
table.market th.h-lay { background: var(--lay-3); }
table.market td.label { text-align: left; font-weight: 600; padding-left: 12px; color: #1a2330; width: 28%; }
table.market td.price { font-weight: 700; font-size: 13px; cursor: pointer; transition: filter 0.1s; position: relative; }
table.market td.price:hover { filter: brightness(1.05); }
table.market td.price .vol { display: block; font-size: 10px; font-weight: 400; color: #555; margin-top: 1px; }
td.b1 { background: var(--back-1); }
td.b2 { background: var(--back-2); }
td.b3 { background: var(--back-3); }
td.l1 { background: var(--lay-3); }
td.l2 { background: var(--lay-2); }
td.l3 { background: var(--lay-1); }
td.empty { background: #f5f6f7; color: #c1c5cc; cursor: default; }
td.minmax { background: #fafbfc; color: var(--info); font-size: 10.5px; font-weight: 600; text-align: left; padding-left: 10px; width: 100px; }
td.minmax small { display: block; color: #444; font-weight: 500; }
.suspended { background: var(--suspended-bg) !important; color: var(--suspended-text) !important; font-weight: 700; letter-spacing: 1px; cursor: not-allowed !important; }
.ball-running { background: linear-gradient(45deg, #b91c1c, #7a1414) !important; color: #fff !important; font-weight: 700; letter-spacing: 1px; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.55} }

.split-2 { display: flex; flex-direction: row; width: 100%; }
.split-2 > table.market { flex: 1 1 50%; width: 50%; border-right: 1px solid var(--border); }
.split-2 > table.market:last-child { border-right: none; }
.bookmaker-pair { display: flex; flex-direction: row; width: 100%; border-top: 1px solid var(--border); }
.bookmaker-pair > .bm-block { flex: 1 1 50%; width: 50%; border-right: 1px solid var(--border); }
.bookmaker-pair > .bm-block:last-child { border-right: none; }
.bookmaker-pair .section-header { background: #2C5282; }

.flash { animation: flashUpdate 0.6s ease; }
@keyframes flashUpdate { 0%{box-shadow: inset 0 0 0 2px #ffd700;} 100%{box-shadow: inset 0 0 0 0 transparent;} }
