/* Layout follows a cricket stats site: a slim dark-navy bar on top, then a centred column (max 820px) of
   white cards with soft shadows on an off-white page. One sans family (Inter); weight does the work.
   Tiny uppercase grey labels, outlined chips for filters, blue result text, scorecard tables with a pale
   header row. IPL orange is kept for the main action only; team colours appear as thin stripes. */
:root {
  --navy: #050e2b;
  --navy-2: #0d1d4a;
  --navy-ink: #ffffff;
  --bid-bg: #050e2b;
  --bg: #f5f4f1;
  --surface: #ffffff;
  --surface-2: #f6f6f6;
  --surface-3: #ebebeb;
  --line: rgba(0, 0, 0, 0.14);
  --line-soft: rgba(0, 0, 0, 0.07);
  --text: #0f1014;
  --body: #4b5166;
  --muted: #6b7185;
  --faint: #9aa0b0;
  --accent: #e8590c;
  --accent-hover: #cf4f0a;
  --accent-ink: #ffffff;
  --accent-2: #d99a00;
  --data: #0860c4;
  --purple: #6a3fa3;
  --good: #11804a;
  --warn: #b26a00;
  --bad: #e5332a;
  --shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08);
  --font: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --font-display: var(--font);
  --font-body: var(--font);
  --font-mono: ui-monospace, Menlo, monospace;
  --r: 12px;
  --r-sm: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #030a20; --navy-2: #0d1d4a; --navy-ink: #ffffff; --bid-bg: #0f2560;
    --bg: #040b1f; --surface: #08132e; --surface-2: #0c1a3c; --surface-3: #14254d;
    --line: rgba(255, 255, 255, 0.16); --line-soft: rgba(255, 255, 255, 0.08); --text: #f2f4f8; --body: #c3cbe0; --muted: #98a3c2; --faint: #6f7ca3;
    --accent: #ff7a2f; --accent-hover: #ff8d4d; --accent-ink: #1b0b00; --accent-2: #f5b82e; --data: #5ea3ff; --purple: #b18cf0;
    --good: #43c47f; --warn: #f0b33a; --bad: #ff6b6b; --shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --navy: #030a20; --navy-2: #0d1d4a; --navy-ink: #ffffff; --bid-bg: #0f2560;
  --bg: #040b1f; --surface: #08132e; --surface-2: #0c1a3c; --surface-3: #14254d;
  --line: rgba(255, 255, 255, 0.16); --line-soft: rgba(255, 255, 255, 0.08); --text: #f2f4f8; --body: #c3cbe0; --muted: #98a3c2; --faint: #6f7ca3;
  --accent: #ff7a2f; --accent-hover: #ff8d4d; --accent-ink: #1b0b00; --accent-2: #f5b82e; --data: #5ea3ff; --purple: #b18cf0;
  --good: #43c47f; --warn: #f0b33a; --bad: #ff6b6b; --shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--body); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--data); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--data); outline-offset: 2px; }
.num, .money, td.r { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: 0.8em; }
.muted { color: var(--muted); }
.good { color: var(--good); } .bad { color: var(--bad); } .gold, .accent { color: var(--accent); } .warn { color: var(--warn); }
strong { color: var(--text); font-weight: 600; }

#app { max-width: 820px; margin: 0 auto; padding-inline: 16px; padding-block: 0 64px; }

/* ---------- type ---------- */
h1, h2, h3 { color: var(--text); margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font: 700 clamp(1.6rem, 4.5vw, 2.1rem)/1.15 var(--font); }
h2 { font: 700 1.35rem/1.2 var(--font); }
h3 { font: 600 1.05rem/1.3 var(--font); }
.display { font-weight: 700; color: var(--text); }
/* Small uppercase grey labels, as on match cards ("RESULT", "LIVE"). */
.eyebrow { font: 600 0.69rem/1.2 var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
p { margin: 0; max-width: 68ch; }

/* ---------- structure ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 32px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.panel { background: var(--surface); border-radius: var(--r); padding: 16px; min-width: 0; box-shadow: var(--shadow); }
.panel-flat { background: var(--surface); border-radius: var(--r); padding: 12px 16px; min-width: 0; box-shadow: var(--shadow); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 2px; }
.section-head h3 { font: 700 1.2rem/1.25 var(--font); color: var(--text); }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Header: slim dark-navy bar across the full width. */
.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; margin-bottom: 24px;
  background: var(--navy); color: var(--navy-ink); box-shadow: 0 0 0 100vmax var(--navy); clip-path: inset(0 -100vmax);
}
.masthead .tag { color: #c7d0ea; font-weight: 500; font-size: 0.85rem; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--navy-ink); }
.brand:hover { text-decoration: none; }
.brand-name { font: 700 1.2rem/1 var(--font); letter-spacing: -0.02em; }
.brand-sub { font: 500 0.78rem/1 var(--font); color: #a9b5da; }

/* ---------- controls ---------- */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: var(--r-sm);
  padding: 8px 16px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; text-align: center; transition: background 0.12s, border-color 0.12s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--data); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-sm { min-height: 32px; padding: 4px 12px; font-size: 0.86rem; }
.btn-block { width: 100%; }

/* Filters and toggles are a row of outlined chips. */
.seg { align-self: flex-start; display: inline-flex; flex-wrap: wrap; gap: 8px; }
.seg button { border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; cursor: pointer; font-weight: 500; font-size: 0.88rem; min-height: 34px; color: var(--text); border-radius: var(--r-sm); }
.seg button:hover { background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--navy-ink); }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--navy-ink); border-color: var(--navy-ink); color: var(--navy); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { background: var(--navy-ink); border-color: var(--navy-ink); color: var(--navy); } }

/* Choices: one card, rows inside with a radio marker. */
.choice-grid { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.choice {
  position: relative; text-align: left; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; border-radius: 0;
  padding: 13px 16px 13px 44px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.choice:last-child { border-bottom: 0; }
.choice::before { content: ''; position: absolute; left: 16px; top: 16px; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--faint); background: var(--surface); }
.choice:hover:not(:disabled) { background: var(--surface-2); }
.choice[aria-pressed="true"]::before { border-color: var(--data); box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 8px var(--data); }
.choice:disabled { cursor: not-allowed; opacity: 0.5; }
.choice .title { font: 600 0.98rem/1.3 var(--font); color: var(--text); }
.choice small { color: var(--muted); font-size: 0.86rem; line-height: 1.45; }
.choice small.when { color: var(--data); font-weight: 500; font-size: 0.8rem; }

/* Labels are quiet text separated by dots. */
.tag { display: inline; font: 500 0.78rem/1.3 var(--font); color: var(--muted); white-space: nowrap; }
.tag + .tag::before { content: '·'; margin: 0 6px; color: var(--faint); }
.tag-gold, .tag-accent { color: var(--accent); }
.tag-good { color: var(--good); }
.tag-bad { color: var(--bad); }
.tag-warn { color: var(--warn); }
.tag-data { color: var(--data); }
.os { font: 600 0.62rem/1 var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 3px; vertical-align: 0.15em; margin-left: 4px; }

/* Team picks: chips with a team-colour stripe. */
.team-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 560px) { .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.team-pick { text-align: left; border: 1px solid var(--line); border-left: 4px solid var(--c1, var(--line)); border-radius: var(--r-sm); background: var(--surface); padding: 8px 10px; cursor: pointer; display: flex; gap: 8px; align-items: flex-start; }
.team-pick .badge { display: none; }
.team-pick:hover { background: var(--surface-2); }
.team-pick[aria-pressed="true"] { border-color: var(--data); border-left-color: var(--c1); box-shadow: 0 0 0 1px var(--data); }
.team-pick strong { font: 700 0.98rem/1.1 var(--font); }
.team-pick .nm { font-size: 0.76rem; line-height: 1.3; color: var(--muted); margin-top: 2px; }

/* Team colour mark: a thin two-tone stripe. */
.badge { --c1: #444; --c2: #888; flex: none; display: inline-block; width: 5px; height: 32px; border-radius: 2px; background: linear-gradient(var(--c1) 0 72%, var(--c2) 72%); vertical-align: middle; }
.badge-sm { width: 4px; height: 1.1em; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--text); }

/* ---------- tables (scorecard style) ---------- */
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th { text-align: left; font: 600 0.7rem/1.2 var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; padding: 8px; background: var(--surface-2); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; color: var(--text); }
td.r, th.r { text-align: right; }
td.muted, td .muted { color: var(--muted); }
tr.me td { background: color-mix(in srgb, var(--data) 7%, var(--surface)); }
tr.me td:first-child { box-shadow: inset 3px 0 0 var(--data); }
tr:last-child td { border-bottom: 0; }

/* ---------- purse strip ---------- */
.strip { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; margin-inline: -16px; margin-top: -24px; margin-bottom: 4px; padding: 9px 16px; background: var(--surface); box-shadow: 0 1px 0 var(--line-soft), 0 4px 10px -8px rgba(0, 0, 0, 0.3); }
.strip-inner { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stat .k { font: 600 0.66rem/1.2 var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.stat .v { font: 700 1.2rem/1 var(--font); color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.stat .v.accent, .stat .v.gold { color: var(--data); }
.stats { display: flex; gap: 24px; flex-wrap: wrap; }

/* ---------- meters (form, fitness, chemistry) ---------- */
.meter { display: inline-grid; grid-template-columns: repeat(10, 1fr); gap: 2px; width: 64px; height: 6px; vertical-align: middle; }
.meter > i { background: var(--surface-3); border-radius: 1px; }
.meter > i.on { background: var(--m, var(--data)); }
.meter-lg { width: 130px; height: 8px; }
.meter-l { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; font-size: 0.76rem; color: var(--muted); white-space: nowrap; }
.meter-l .ml { font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; font-size: 0.64rem; }
.meter-l .mv { color: var(--text); font-weight: 600; min-width: 2.4em; }
tr.group td { background: transparent; padding: 14px 8px 6px; font: 700 0.7rem/1.2 var(--font); text-transform: uppercase; letter-spacing: 0.04em; color: var(--data); border-bottom: 1px solid var(--line-soft); }
.meter-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 0.86rem; }

/* ---------- lot card ---------- */
.lot { position: relative; background: var(--surface); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.lot-top { padding: 16px 18px 12px; display: flex; flex-direction: column; gap: 8px; }
.lot-meta { display: flex; gap: 0; flex-wrap: wrap; align-items: center; }
.lot-name { font: 800 clamp(1.9rem, 6.5vw, 2.6rem)/1.05 var(--font); color: var(--text); letter-spacing: -0.025em; }
.lot-sub { color: var(--muted); font-size: 0.92rem; }
.bars { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: center; font-size: 0.84rem; color: var(--muted); }
.bars .num { color: var(--text); font-weight: 600; }
.bar { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--faint); border-radius: 3px; }
.bar.hi > i { background: var(--data); }
.lot-bid { padding: 14px 18px 16px; display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: end; background: var(--bid-bg); color: var(--navy-ink); }
.lot-bid .eyebrow, .lot-bid .muted, .lot-bid .why { color: #b4bfdf; }
.lot-bid strong, .lot-bid .holder { color: var(--navy-ink); }
.lot-bid .tag { color: #9ec5ff; }
.lot-bid .btn:not(.btn-primary) { background: transparent; color: var(--navy-ink); border-color: rgba(255, 255, 255, 0.28); }
.lot-bid .btn:not(.btn-primary):hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
.price { font: 800 clamp(2.4rem, 10vw, 3.4rem)/0.95 var(--font); font-variant-numeric: tabular-nums; color: #ffffff; letter-spacing: -0.03em; }
.holder { display: flex; align-items: center; gap: 8px; min-height: 30px; font-weight: 600; }
.clock { height: 3px; background: var(--surface-3); }
.clock > i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; }
.bid-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.bid-btn { font: 700 1rem/1 var(--font); min-height: 50px; }
.why { font-size: 0.84rem; color: var(--muted); min-height: 1.3em; }

/* Sold banner in the buying team's colours. */
.stamp { position: absolute; inset: 0; display: flex; align-items: center; pointer-events: none; background: color-mix(in srgb, var(--surface) 55%, transparent); }
.stamp > div {
  width: 100%; padding: 14px 18px; background: var(--c1, var(--navy)); color: #fff; border-bottom: 4px solid var(--c2, var(--accent));
  font: 700 clamp(1.15rem, 4vw, 1.5rem)/1.2 var(--font); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); animation: slide 0.22s ease-out both;
}
.stamp.unsold > div { background: var(--surface-3); color: var(--muted); border-bottom-color: var(--line); text-shadow: none; }
.stamp.paused { background: color-mix(in srgb, var(--surface) 80%, transparent); }
.stamp.paused > div { background: var(--navy); border-bottom-color: var(--data); animation: none; }
.stamp small { display: block; font: 500 0.85rem/1.3 var(--font); margin-top: 4px; opacity: 0.9; }
@keyframes slide { from { transform: translateX(-12px); opacity: 0; } to { transform: none; opacity: 1; } }

.rtm-panel { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--surface) 88%, transparent); }
.rtm-panel > div { max-width: 460px; width: 100%; display: flex; flex-direction: column; gap: 12px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow), 0 0 0 1px var(--line-soft); padding: 18px; }

/* Tabs: text with a blue underline. */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line-soft); overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--data); }
.tab-body { border-top-left-radius: 0; border-top-right-radius: 0; }

.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.9rem; color: var(--text); }
.feed-item:last-child { border-bottom: 0; }

.notice { background: var(--surface); border-radius: var(--r-sm); box-shadow: inset 3px 0 0 var(--data), 0 0 0 1px var(--line-soft); padding: 9px 12px; font-size: 0.9rem; }
.notice.bad { box-shadow: inset 3px 0 0 var(--bad), 0 0 0 1px var(--line-soft); }
.notice.warn { box-shadow: inset 3px 0 0 var(--warn), 0 0 0 1px var(--line-soft); }
.notice.good { box-shadow: inset 3px 0 0 var(--good), 0 0 0 1px var(--line-soft); }

/* ---------- results ---------- */
.grade { font: 800 5rem/0.9 var(--font); color: var(--text); letter-spacing: -0.04em; }
.prob { display: grid; grid-template-columns: 56px 1fr 52px 1fr; gap: 8px 10px; align-items: center; font-size: 0.88rem; }
.prob .bar { height: 8px; }
.share-img { width: 100%; max-width: 100%; border-radius: var(--r); box-shadow: var(--shadow); display: block; }

/* ---------- season ---------- */
.match-card { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; text-align: center; }
.match-card .side { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.match-card .badge { width: 36px; height: 4px; background: linear-gradient(90deg, var(--c1) 0 72%, var(--c2) 72%); }
.vs { font: 600 0.8rem/1 var(--font); color: var(--faint); text-transform: uppercase; }
.score { font: 800 1.8rem/1 var(--font); font-variant-numeric: tabular-nums; color: var(--text); letter-spacing: -0.02em; }
.pick-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.pick-row:last-child { border-bottom: 0; }
.pick-row input { width: 18px; height: 18px; accent-color: var(--data); }
.pick-row.out { opacity: 0.5; }
.order-btns { display: flex; gap: 4px; }
.drag-handle { display: inline-flex; align-items: center; gap: 4px; width: 34px; padding: 6px 0; cursor: grab; touch-action: none; user-select: none; }
.drag-handle::before { content: ''; width: 8px; height: 14px; background: radial-gradient(circle, var(--faint) 1.2px, transparent 1.6px) 0 0 / 4px 4.6px; }
.xi-row { position: relative; background: var(--surface); }
.xi-row.dragging { z-index: 2; box-shadow: var(--shadow); opacity: 0.95; cursor: grabbing; }
.xi-row.drop-here { box-shadow: inset 0 2px 0 var(--data); }
.order-btns button { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--text); }
.order-btns button:hover:not(:disabled) { background: var(--surface-2); }
.card-table td:first-child { max-width: 0; width: 55%; }
.card-table .how { display: block; color: var(--muted); font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trophy { text-align: center; padding: 26px 16px; background: var(--navy); color: var(--navy-ink); border-radius: var(--r); box-shadow: var(--shadow); }
.trophy h1, .trophy .eyebrow { color: #ffffff; }
.trophy .muted { color: #b4bfdf; }
.trophy .tag { color: #ffd38a; }
.trophy .badge { width: 44px; height: 4px; background: linear-gradient(90deg, var(--c1) 0 72%, var(--c2) 72%); }
.sub-line { display: block; color: var(--muted); font-size: 0.8rem; line-height: 1.4; }

.footer { margin-top: 48px; color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--line-soft); padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 480px) {
  .lot-bid { grid-template-columns: 1fr; }
  .stats { gap: 14px; }
  .prob { grid-template-columns: 46px 1fr 44px 1fr; }
  .hide-sm { display: none; }
  .pick-row { grid-template-columns: auto 1fr auto; }
  .brand-sub { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
