:root {
  --bg: #f3f7f3;
  --card: #ffffff;
  --text: #14201a;
  --muted: #5b6a60;
  --line: #dce5dd;
  --soft: #eaf1eb;
  --brand: #0b7a43;
  --brand-deep: #05492a;
  --brand-ink: #ffffff;
  --amber: #ffb300;
  --live: #e53935;
  --danger: #c62828;
  --shadow: 0 10px 24px rgba(5, 73, 42, 0.28);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1511;
    --card: #16201a;
    --text: #e8efe9;
    --muted: #9aa99f;
    --line: #2b3a31;
    --soft: #1b2720;
    --brand: #4fc47f;
    --danger: #ef5350;
    --shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Bengali", sans-serif;
}

a { color: var(--brand); }

/* ---- top bar --------------------------------------------------------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #0b7a43, #05492a);
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.2px;
}
.brand img { width: 30px; height: 30px; border-radius: 9px; }
.net {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
}

main { max-width: 600px; margin: 0 auto; padding: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---- cards ----------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 14px;
}
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 800; }
h2 { font-size: 16px; margin: 0 0 10px; font-weight: 800; }

/* ---- the dark-green score card ---------------------------------------- */
.hero {
  background: linear-gradient(135deg, #0b7a43, #05492a);
  color: #fff;
  border-radius: 24px;
  padding: 18px 16px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  text-align: center;
}
.hero .sub { color: rgba(255, 255, 255, 0.72); font-size: 14px; font-weight: 600; }
.hero h1 { color: #fff; font-size: 17px; margin: 10px 0 0; font-weight: 700; opacity: 0.9; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}
.pill.live { background: var(--live); }
.pill.live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.25; } }

.statusrow { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 28px; }
.clock { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.elapsed { margin-top: 8px; font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, 0.72); }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--s, 44px);
  height: var(--s, 44px);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  font-weight: 800;
  font-size: calc(var(--s, 44px) * 0.36);
  letter-spacing: 0.5px;
  flex: none;
}

.versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 8px;
  margin-top: 16px;
}
.versus .team { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.versus .name { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.versus .num { font-size: 64px; font-weight: 900; line-height: 1; }
.versus .dash { font-size: 36px; font-weight: 800; color: rgba(255, 255, 255, 0.5); padding-top: 130px; }

.batting { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; font-size: 18px; font-weight: 800; }
.big { font-size: 68px; font-weight: 900; line-height: 1.05; margin: 6px 0 0; }

.stats {
  display: flex;
  margin-top: 14px;
  padding: 10px 0;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 14px;
}
.stats > div { flex: 1; }
.stats b { display: block; font-size: 20px; font-weight: 800; }
.stats span { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.72); }

.bar { height: 8px; margin-top: 14px; border-radius: 99px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--amber); border-radius: 99px; transition: width 0.4s; }
.chase { margin: 8px 0 0; color: var(--amber); font-weight: 800; font-size: 16px; }

.result {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--amber);
  color: #000;
  font-weight: 900;
}

/* ---- this over, at the crease ------------------------------------------ */
.over { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--soft);
  font-weight: 800;
  font-size: 15px;
}
.chip.four { background: var(--amber); color: #000; }
.chip.w { background: var(--danger); color: #fff; }

.crease { width: 100%; border-collapse: collapse; }
.crease td { padding: 6px 0; }
.crease td:last-child { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.crease .strike { font-weight: 800; }
.crease .sep td { border-top: 1px solid var(--line); padding-top: 10px; }

/* ---- scorecard --------------------------------------------------------- */
details { border-top: 1px solid var(--line); padding: 8px 0; }
details:first-of-type { border-top: 0; }
summary { cursor: pointer; font-weight: 800; padding: 6px 0; }

.rows { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 6px; }
.rows th { text-align: left; color: var(--muted); font-weight: 700; padding: 4px 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.rows td { padding: 7px 0; border-top: 1px solid var(--line); vertical-align: top; }
.rows .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 8px; }
.rows .how { color: var(--muted); font-size: 12px; display: block; }

/* ---- feed / fixtures ------------------------------------------------------ */
ul.feed { list-style: none; margin: 0; padding: 0; }
ul.feed li { padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; }
ul.feed li:first-child { border-top: 0; }
ul.feed li.hit { font-weight: 800; }
ul.feed li.out { font-weight: 800; color: var(--danger); }

.round { margin: 14px 0 2px; font-weight: 800; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }

.league { margin-top: 0; }
.league th { background: var(--soft); padding: 8px 6px; font-size: 11px; }
.league td { padding: 10px 6px; }
.league th:first-child, .league td:first-child { padding-left: 12px; }
.league th:last-child, .league td:last-child { padding-right: 12px; }
.league .rank { color: var(--muted); font-weight: 700; text-align: left; padding-left: 12px; }
.league .tname { font-weight: 600; width: 100%; word-break: break-word; }
.league tr.first { background: rgba(11, 122, 67, 0.1); }
.league tr.first .rank { color: var(--brand); }
.tablecard { padding: 0; overflow: hidden; border-radius: 14px; }
.tablecard h2.pad { padding: 12px 12px 4px; margin: 0; }
.tablecard .foot { padding: 8px 12px 12px; margin: 0; border-top: 1px solid var(--line); }

/* ---- the leader card above the table ----------------------------------- */
.leader { display: flex; align-items: center; gap: 12px; background: #05492a; color: #fff; border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.leader .badge { border: 2px solid rgba(255, 255, 255, 0.5); }
.leader .who { flex: 1; min-width: 0; }
.leader .tag { display: block; color: #4fc47f; font-size: 10.5px; letter-spacing: 1px; font-weight: 700; }
.leader .who b { font-size: 17px; font-weight: 700; line-height: 1.2; }
.leader .lp { text-align: right; }
.leader .lp b { display: block; font-size: 28px; line-height: 1; font-weight: 700; }
.leader .lp span { color: #4fc47f; font-size: 10.5px; }
.league td.pts b { display: inline-block; min-width: 30px; padding: 2px 6px; border-radius: 8px; background: var(--soft); color: var(--brand); font-weight: 900; text-align: center; }
.team-cell { display: flex; align-items: center; gap: 8px; }
.team-cell .badge { --s: 28px; border-width: 0; }

a.fixture {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  color: inherit;
  text-decoration: none;
}
a.fixture .vs { overflow-wrap: anywhere; font-weight: 600; }
a.fixture .st { font-size: 12px; font-weight: 800; color: var(--muted); align-self: center; }
a.fixture .st.live { color: var(--live); }
a.fixture .muted { grid-column: 1 / -1; }

/* ---- home form ------------------------------------------------------------ */
.landing {
  background: linear-gradient(135deg, #0b7a43, #05492a);
  color: #fff;
  border-radius: 24px;
  padding: 22px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.landing h1 { color: #fff; font-size: 30px; line-height: 1.1; font-weight: 900; }
.landing p { color: rgba(255, 255, 255, 0.78); margin: 8px 0 0; }

form.code { display: flex; gap: 8px; margin-top: 16px; }
form.code input {
  flex: 1;
  min-width: 0;
  padding: 13px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 5px;
  text-transform: uppercase;
  border-radius: 14px;
  border: 0;
  background: #fff;
  color: #14201a;
}
button {
  padding: 13px 20px;
  font-size: 16px;
  font-weight: 800;
  border: 0;
  border-radius: 14px;
  background: var(--amber);
  color: #000;
  cursor: pointer;
}
button:disabled { opacity: 0.6; }
.error { color: #ffcdd2; margin: 10px 0 0; font-weight: 600; }
.card .error { color: var(--danger); }

.footer { text-align: center; font-size: 12px; color: var(--muted); padding: 8px 0 24px; }

/* ---- home feed ------------------------------------------------------------- */
.feed h2 { font-size: 18px; margin: 18px 4px 8px; }
a.feedcard {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 10px;
  color: inherit;
  text-decoration: none;
}
a.feedcard:hover { border-color: var(--brand); }
.feedcard .ftitle { color: var(--muted); font-size: 13px; margin: 8px 0; }
.feedcard .frow { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.feedcard .fname { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feedcard .frow b { font-size: 20px; font-weight: 900; }
.feedcard .fnote { color: var(--brand); font-weight: 700; font-size: 13px; margin-top: 8px; }
.feedcard .fplace { color: var(--muted); font-size: 13px; margin-top: 6px; }
/* ---- a count with a small card icon (yellow or red) ----------------------- */
.cd { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; }
.cd::before { content: ""; width: 10px; height: 14px; border-radius: 2px; display: inline-block; }
.cd.y::before { background: #ffb300; }
.cd.r::before { background: #e53935; }
/* ---- links to a player, and the player's page ----------------------------- */
a.plink { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
a.plink:hover { color: var(--brand); border-bottom-color: var(--brand); }
.pcard { display: flex; align-items: center; gap: 14px; }
.pcard h1 { margin: 0; font-size: 20px; }
.pcard p { margin: 2px 0 0; }
.notice { background: #fff0c2; color: #6b4700; border-radius: 12px; padding: 10px 12px; font-weight: 600; margin: 0 0 10px; }
@media (prefers-color-scheme: dark) { .notice { background: #3a2c00; color: #ffb300; } }
.pstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.pstats > div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 4px; text-align: center; }
.pstats b { display: block; font-size: 22px; line-height: 1.1; font-weight: 800; }
.pstats b.cd { display: flex; justify-content: center; }
.pstats span { color: var(--muted); font-size: 12px; }

.lineup p { margin: 4px 0; }
.lineup .round { margin-top: 10px; }

/* ---- home: landing, code card, how it works ---------------------------------- */
.landing { text-align: center; background: #05492a; padding: 26px 18px 22px; }
.landing img { border-radius: 16px; }
.landing h1 { margin: 12px 0 0; }
.btnrow { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 11px 20px; border-radius: 12px; font-weight: 800; text-decoration: none; }
.btn.amber { background: var(--amber); color: #14201a; }
.btn.ghost { border: 1.5px solid rgba(255, 255, 255, 0.7); color: #fff; }
.codecard h2 { margin-bottom: 2px; }
.codecard p { margin: 0; }
.codecard form.code input { border: 1.5px solid var(--line); background: var(--bg); color: var(--text); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.step { display: flex; flex-direction: column; gap: 3px; text-align: center; background: var(--soft); border-radius: 14px; padding: 10px 6px; }
.step b { color: var(--brand); font-size: 18px; }
.step .st { font-weight: 800; font-size: 13px; }
/* ---- league table rows with badges, and the scorers line ---------------------- */
.league .tcell { display: flex; align-items: center; gap: 8px; }
.league .tcell .how { margin-top: 1px; }
.hero .scorers { margin: 12px 0 0; font-size: 13px; }
/* ---- legal pages and the site footer ------------------------------------------ */
main.doc h3 { font-size: 14px; margin: 14px 0 2px; font-weight: 800; }
main.doc p, main.doc li { line-height: 1.55; }
main.doc ul, main.doc ol { padding-left: 22px; margin: 8px 0; }
.sitefoot { max-width: 600px; margin: 0 auto; padding: 8px 16px 28px; text-align: center; font-size: 13px; color: var(--muted); }
.sitefoot a { color: var(--muted); }
.sitefoot p { margin: 6px 0 0; }
/* ---- football events with icons, like the app ----------------------------------- */
ul.feed li.ev { display: flex; align-items: center; gap: 10px; }
ul.feed li.ev .emin { width: 38px; text-align: right; font-weight: 800; color: var(--muted); font-size: 14px; flex: none; }
ul.feed li.ev .ei { width: 22px; flex: none; text-align: center; font-size: 17px; line-height: 1; }
ul.feed li.ev .cardi { width: 14px; height: 20px; margin: 0 4px; border-radius: 3px; display: inline-block; }
ul.feed li.ev .cardi.y { background: #ffb300; }
ul.feed li.ev .cardi.r { background: #e53935; }
ul.feed li.ev .sub { color: var(--brand); font-weight: 900; }
ul.feed li.ev .etext { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
ul.feed li.ev.red .etext b, ul.feed li.ev.own .etext b { color: var(--danger); }
/* ---- cricket balls with round icons, like the app ------------------------------- */
ul.feed li.ball .bi { width: 30px; height: 30px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 900; background: var(--soft); color: var(--muted); }
ul.feed li.ball.wicket .bi { background: rgba(229, 57, 53, 0.16); color: var(--danger); }
ul.feed li.ball.boundary .bi { background: rgba(255, 179, 0, 0.22); color: #b37700; }
ul.feed li.ball.wicket .etext { font-weight: 800; color: var(--danger); }
ul.feed li.ball.boundary .etext { font-weight: 800; }
@media (prefers-color-scheme: dark) { ul.feed li.ball.boundary .bi { color: var(--amber); } }
/* ---- cricket score card laid out like the app ------------------------------------ */
.chero { text-align: left; }
.chero .left { text-align: left; }
.chero h1 { margin: 6px 0 14px; opacity: 0.95; font-size: 16px; }
.chero .crow { display: flex; align-items: center; gap: 10px; }
.chero .crow.ctop { justify-content: space-between; }
.chero .statusrow { justify-content: flex-start; min-height: 0; }
.chero .main .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chero .main .who b { font-size: 18px; }
.chero .main .score { text-align: right; display: flex; flex-direction: column; }
.chero .main .score b { font-size: 34px; font-weight: 900; line-height: 1.05; }
.chero .other { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.22); }
.chero .other .oname { flex: 1; font-weight: 600; }
.chero .chase { margin: 10px 0 0; }
.chero .result { display: block; margin-top: 14px; text-align: center; }
.rows.crease { margin-bottom: 8px; }
.rows.crease td.n, .rows.crease th.n { width: 38px; }
.rows.crease .strike { font-weight: 800; }
.inhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 6px; }
.rows .how { font-weight: 400; }
/* ---- football score card in rows, like the app ----------------------------------- */
.chero .fteam { margin-top: 10px; }
.chero .fteam .fname { flex: 1; min-width: 0; font-size: 18px; }
.chero .fteam .fscore { font-size: 34px; font-weight: 900; line-height: 1; min-width: 40px; text-align: right; }
.chero .scorers { margin: 14px 0 0; font-size: 13px; }
.chero .ctop .sub { text-align: right; }
/* ---- league fixtures as rows with badges and scores, like the app ------------------ */
.rhead { background: var(--soft); margin: 0; padding: 10px 14px; font-size: 15px; }
a.fxrow { display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 4px 8px; padding: 10px 14px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
a.fxrow:hover { background: var(--soft); }
.fxst { display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 12px; line-height: 1.25; }
.fxst b { font-size: 12px; }
.fxst.live { color: var(--live); font-weight: 800; font-size: 13px; }
.fxteams, .fxscores { display: flex; flex-direction: column; gap: 6px; }
.fxteam { display: flex; align-items: center; gap: 8px; min-width: 0; height: 26px; }
.fxname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fxscores { align-items: flex-end; }
.fxsc { height: 26px; display: flex; align-items: center; font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; }
a.fxrow.live .fxsc:not(.muted) { color: var(--live); }
.fxnote { grid-column: 2 / -1; color: var(--brand); font-size: 13px; font-weight: 700; }
.league td { vertical-align: middle; }
