:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f0f1f4;
  --border: rgba(15, 20, 30, 0.08);
  --text: #0d1117;
  --text-2: #5b6270;
  --text-3: #6b7280;
  --live: #ff3b30;
  --four: #1f7cff;
  --six: #a855f7;
  --wicket: #f0352b;
  --extra: #f59e0b;
  --success: #22a559;
  --rain: #3b9eff;
  --shadow: 0 1px 2px rgba(15, 20, 30, .04), 0 8px 24px rgba(15, 20, 30, .06);
  --radius: 18px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d12;
    --surface: #141821;
    --surface-2: #1b2029;
    --border: rgba(255, 255, 255, 0.07);
    --text: #f2f4f8;
    --text-2: #a4abb8;
    --text-3: #8a919e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv11" 1;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── Top bar ───────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px max(16px, calc((100vw - 1120px) / 2));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; font-size: 17px; }
.brand-mark { width: 26px; height: 26px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2);
}
.pill-live { color: var(--live); background: color-mix(in srgb, var(--live) 12%, transparent); }
.pill-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 8px var(--live); animation: pulse 2s ease-in-out infinite; }
.pill-warn { color: var(--extra); background: color-mix(in srgb, var(--extra) 14%, transparent); }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--live); }

/* ───────── Match rail ───────── */
.rail {
  min-height: 71px; /* chip height + padding, reserved so the page doesn't jump when matches load */
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 14px max(16px, calc((100vw - 1120px) / 2)) 4px;
  scroll-snap-type: x proximity;
}
.rail::-webkit-scrollbar { display: none; }
.chip {
  flex: none; scroll-snap-align: start;
  display: grid; grid-template-columns: auto 1fr; column-gap: 8px; row-gap: 1px; align-items: center;
  min-width: 150px; padding: 9px 12px; border-radius: 14px; cursor: pointer; text-align: left;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
.chip:hover { transform: translateY(-1px); }
.chip[aria-pressed="true"] { border-color: color-mix(in srgb, var(--text) 35%, transparent); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); grid-row: span 2; }
.chip .dot.live { background: var(--live); box-shadow: 0 0 6px var(--live); }
.chip .dot.inningsBreak { background: var(--extra); }
.chip .dot.rainDelay { background: var(--rain); }
.chip .dot.completed { background: var(--success); }
.chip-title { font-weight: 700; font-size: 13px; white-space: nowrap; }
.chip-sub { font-size: 12px; color: var(--text-2); white-space: nowrap; font-family: var(--mono); }

/* ───────── Layout ───────── */
.layout {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px;
  max-width: 1120px; margin: 12px auto 24px; padding: 0 16px;
}
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }
.col-main, .col-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.card h2, .section-label {
  margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3);
}
.skeleton { color: var(--text-2); padding: 40px 0; text-align: center; min-height: 292px; display: grid; place-items: center; } /* ≈ a loaded scoreboard, so nothing jumps */

/* ───────── Scoreboard ───────── */
.scoreboard { position: relative; overflow: hidden; }
.sb-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.status.live { color: var(--live); }
.status.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 10px var(--live); animation: pulse 2s ease-in-out infinite; }
.status.inningsBreak { color: var(--extra); }
.status.rainDelay { color: var(--rain); }
.status.completed { color: var(--success); }
.status.upcoming, .status.abandoned { color: var(--text-2); }
.sb-link { font-size: 12px; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.sb-link:hover { color: var(--text); }
.sb-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.sb-sub { color: var(--text-2); font-size: 13px; margin-top: 3px; }
.teams { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 14px; }
.team { display: flex; align-items: center; gap: 12px; }
.team.dim { opacity: .8; }
.badge {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff;
  background: var(--c, #6b7280); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
  text-shadow: 0 1px 1px rgba(0,0,0,.25);
}
.team-name { font-weight: 600; font-size: 16px; flex: 1; min-width: 0; display: flex; align-items: center; white-space: nowrap; }
.team-name .tn { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.team-name .bat-icon, .team-name .fav { flex: none; }
.bat-icon { font-size: 13px; margin-left: 6px; opacity: .7; }
.team-score { font-family: var(--mono); font-weight: 700; font-size: 26px; letter-spacing: -.02em; white-space: nowrap; }
.team-score .prev { font-size: .66em; font-weight: 600; color: var(--text-2); }
.tn-short { display: none; }
@media (max-width: 520px) {
  /* Phones: score and overs stack on the right so the team name keeps its room. */
  .team { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "badge name score" "badge name overs"; column-gap: 10px; row-gap: 0; }
  .team .badge { grid-area: badge; }
  .team-name { grid-area: name; }
  .team-score { grid-area: score; text-align: right; font-size: 24px; line-height: 1.1; }
  .team.dim .team-score { font-size: 19px; }
  .team-overs { grid-area: overs; min-width: 0; font-size: 11.5px; }
  .team .yet { grid-area: score / score / overs / overs; align-self: center; }
}
@media (max-width: 420px) { .tn-full { display: none; } .tn-short { display: inline; } }
.team.dim .team-score { font-size: 20px; }
.team-overs { font-family: var(--mono); font-size: 13px; color: var(--text-2); min-width: 64px; text-align: right; }
.yet { color: var(--text-3); font-size: 13px; }
.bump { display: inline-block; animation: bump .5s cubic-bezier(.2, .9, .3, 1.3); }
.equation { font-size: 15px; font-weight: 500; }
.equation b { font-family: var(--mono); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.stat { display: inline-flex; gap: 6px; align-items: baseline; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); font-size: 12px; }
.stat span { color: var(--text-3); font-weight: 700; font-size: 10.5px; letter-spacing: .06em; }
.stat b { font-family: var(--mono); }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 14px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--four), var(--six)); transition: width .8s ease; }
.banner { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-weight: 600; margin-top: 4px; }
.flash-four { animation: cardflash-four 1.2s ease; }
.flash-six { animation: cardflash-six 1.4s ease; }
.flash-wicket { animation: shake .5s cubic-bezier(.36,.07,.19,.97), cardflash-wicket 1.4s ease; }

/* ───────── Players ───────── */
.ptable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ptable th { text-transform: uppercase; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--text-3); text-align: right; padding: 0 0 8px 10px; }
.ptable th:first-child, .ptable td:first-child { text-align: left; padding-left: 0; }
.ptable td { text-align: right; padding: 6px 0 6px 10px; font-family: var(--mono); color: var(--text-2); }
.ptable td:first-child { font-family: inherit; color: var(--text); max-width: 0; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptable td.hi { color: var(--text); font-weight: 700; }
.ptable tr.gap td { padding: 6px 0; }
.striker::after { content: " ●"; color: var(--live); font-size: 9px; vertical-align: 2px; }
.lastwkt { margin-top: 10px; font-size: 12.5px; color: var(--text-2); }

/* ───────── Balls ───────── */
.ball-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 10px; }
.ball {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  background: var(--surface-2); color: var(--text);
}
.ball.dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border); color: var(--text-3); }
.ball.runs { background: color-mix(in srgb, var(--text) 9%, transparent); }
.ball.four { background: var(--four); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--four) 45%, transparent); }
.ball.six { background: var(--six); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--six) 45%, transparent); }
.ball.wicket { background: var(--wicket); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--wicket) 45%, transparent); }
.ball.extra { background: color-mix(in srgb, var(--extra) 16%, transparent); color: var(--extra); font-size: 11px; }
.ball.new { animation: pop .55s cubic-bezier(.2, 1.4, .4, 1); }
.over-sep { width: 1px; height: 22px; background: var(--border); margin: 0 3px; }

/* ───────── Commentary feed ───────── */
.commentary { position: sticky; top: 76px; }
@media (max-width: 860px) { .commentary { position: static; } }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-height: 70vh; overflow-y: auto; scrollbar-width: thin; }
.feed li { display: grid; grid-template-columns: 44px 30px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--border); font-size: 13.5px; line-height: 1.4; }
.feed li:first-child { border-top: 0; }
.feed li.new { animation: slidein .5s ease; }
.feed .ov { font-family: var(--mono); color: var(--text-3); font-size: 12.5px; padding-top: 6px; }
.feed .ball { width: 28px; height: 28px; font-size: 11px; }
.feed .txt { padding-top: 4px; }
.feed .dismissal { display: block; color: var(--wicket); font-size: 12px; margin-top: 2px; }
.empty { color: var(--text-2); text-align: center; padding: 28px 8px; font-size: 14px; }

.footer { text-align: center; color: var(--text-3); font-size: 12px; padding: 12px 16px 32px; }
.footer a { color: var(--text-2); }

.preview { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 12px; color: var(--text-2); }
.preview button { border: 0; border-radius: 9px; padding: 6px 12px; font-weight: 700; cursor: pointer; color: #fff; }
.preview [data-kind="four"] { background: var(--four); }
.preview [data-kind="six"] { background: var(--six); }
.preview [data-kind="wicket"] { background: var(--wicket); }

/* ───────── Celebrations ───────── */
.fx { position: fixed; inset: 0; z-index: 50; pointer-events: none; display: grid; place-items: center; overflow: hidden; }
.burst { position: absolute; display: grid; place-items: center; text-align: center; }
.burst .big {
  font-family: Inter, system-ui, sans-serif; font-weight: 900; line-height: .9; letter-spacing: -.06em;
  font-size: clamp(140px, 26vw, 280px);
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 18px 40px var(--glow));
}
.burst .word {
  margin-top: 6px; font-weight: 900; font-size: clamp(22px, 4vw, 40px); letter-spacing: .32em; padding-left: .32em;
  color: #fff; text-shadow: 0 4px 24px var(--glow), 0 1px 2px rgba(0,0,0,.4);
}
.burst .sub { margin-top: 10px; font-size: 15px; font-weight: 600; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.6); max-width: min(90vw, 560px); }
.fx .veil { position: absolute; inset: 0; background: radial-gradient(circle at center, var(--glow) 0%, transparent 62%), rgba(6, 8, 12, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: veil var(--dur) ease forwards; }
.fx .ring { position: absolute; width: 180px; height: 180px; border-radius: 50%; border: 6px solid var(--c); opacity: 0; animation: ring 1.2s cubic-bezier(.1,.7,.3,1) forwards; }
.fx .ring:nth-child(3) { animation-delay: .12s; }
.fx .ring:nth-child(4) { animation-delay: .24s; }

.fx-four { --c: var(--four); --glow: rgba(31, 124, 255, .45); --grad: linear-gradient(160deg, #7cc0ff, #1f7cff 55%, #0a4fd6); --dur: 1.9s; }
.fx-four .burst { animation: zoom-in var(--dur) cubic-bezier(.2, 1.2, .3, 1) forwards; }

.fx-six { --c: var(--six); --glow: rgba(168, 85, 247, .5); --grad: linear-gradient(160deg, #f0abfc, #a855f7 50%, #6d28d9); --dur: 2.3s; }
.fx-six .burst { animation: launch var(--dur) cubic-bezier(.2, 1, .3, 1) forwards; }
.fx .spark { position: absolute; width: 10px; height: 10px; border-radius: 3px; background: var(--sc); opacity: 0; animation: spark 1.5s cubic-bezier(.1, .8, .3, 1) forwards; animation-delay: var(--d); }

.fx-wicket { --c: var(--wicket); --glow: rgba(240, 53, 43, .5); --grad: linear-gradient(160deg, #ffb4a8, #f0352b 55%, #b91c1c); --dur: 2.5s; }
.fx-wicket .burst { animation: slam var(--dur) cubic-bezier(.2, 1.1, .3, 1) forwards; }
.stumps { width: 150px; height: 170px; margin-bottom: 4px; overflow: visible; filter: drop-shadow(0 10px 30px var(--glow)); }
.stumps .stump { fill: #fff; }
.stumps .bail { fill: #ffd4cf; transform-box: fill-box; transform-origin: center; }
.stumps .bail.l { animation: bail-l 1s .15s cubic-bezier(.2, .8, .3, 1) forwards; }
.stumps .bail.r { animation: bail-r 1s .15s cubic-bezier(.2, .8, .3, 1) forwards; }
.stumps .stump.mid { transform-box: fill-box; transform-origin: bottom center; animation: knock .7s .1s cubic-bezier(.2, .8, .3, 1) forwards; }

/* Reduced motion: a calm banner instead of bursts */
.toast {
  position: absolute; top: 90px; padding: 12px 20px; border-radius: 14px; font-weight: 800; letter-spacing: .12em; color: #fff;
  background: var(--c); box-shadow: 0 10px 30px var(--glow); animation: fade 2.2s ease forwards;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes bump { 0% { transform: translateY(40%); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes pop { 0% { transform: scale(.2); opacity: 0; } 60% { transform: scale(1.25); opacity: 1; } 100% { transform: scale(1); } }
@keyframes slidein { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes veil { 0% { opacity: 0; } 15% { opacity: 1; } 70% { opacity: .8; } 100% { opacity: 0; } }
@keyframes ring { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes zoom-in {
  0% { transform: scale(.2) rotate(-8deg); opacity: 0; }
  18% { transform: scale(1.12) rotate(2deg); opacity: 1; }
  30% { transform: scale(1) rotate(0); }
  78% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.35); opacity: 0; }
}
@keyframes launch {
  0% { transform: translateY(55vh) scale(.5); opacity: 0; }
  22% { transform: translateY(-4vh) scale(1.08); opacity: 1; }
  34% { transform: translateY(0) scale(1); }
  78% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-30vh) scale(.9); opacity: 0; }
}
@keyframes slam {
  0% { transform: scale(2.2); opacity: 0; }
  14% { transform: scale(.94); opacity: 1; }
  24% { transform: scale(1); }
  80% { transform: scale(1); opacity: 1; }
  100% { transform: scale(.96); opacity: 0; }
}
@keyframes spark {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}
@keyframes bail-l { to { transform: translate(-70px, -90px) rotate(-220deg); opacity: 0; } }
@keyframes bail-r { to { transform: translate(80px, -70px) rotate(250deg); opacity: 0; } }
@keyframes knock { to { transform: rotate(14deg); } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
@keyframes cardflash-four { 0% { box-shadow: 0 0 0 0 var(--four); } 30% { box-shadow: 0 0 0 4px var(--four), var(--shadow); } 100% { box-shadow: var(--shadow); } }
@keyframes cardflash-six { 0% { box-shadow: 0 0 0 0 var(--six); } 30% { box-shadow: 0 0 0 4px var(--six), var(--shadow); } 100% { box-shadow: var(--shadow); } }
@keyframes cardflash-wicket { 0% { box-shadow: 0 0 0 0 var(--wicket); } 30% { box-shadow: 0 0 0 4px var(--wicket), var(--shadow); } 100% { box-shadow: var(--shadow); } }
@keyframes fade { 0% { opacity: 0; transform: translateY(-10px); } 12% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .toast { animation: fade 2.2s ease forwards !important; }
}

/* ───────── Get the app ───────── */
.get-app { font-size: 13px; font-weight: 600; text-decoration: none; padding: 6px 12px; border-radius: 999px; background: var(--text); color: var(--bg); white-space: nowrap; }
@media (max-width: 520px) { .get-app { display: none; } }
.getapp {
  max-width: 1088px; margin: 8px auto 24px; padding: 28px; border-radius: var(--radius);
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: center;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--six) 18%, transparent), transparent 60%), var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
@media (max-width: 860px) { .getapp { grid-template-columns: 1fr; margin: 8px 16px 24px; } }
.getapp-title { margin: 0 0 8px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; text-transform: none; color: var(--text); }
.getapp p { margin: 0; line-height: 1.55; font-size: 14.5px; }
.getapp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.download { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; text-decoration: none; background: var(--text); color: var(--bg); }
.download.is-disabled { background: var(--surface-2); color: var(--text-2); cursor: default; pointer-events: none; }
.getapp-shots { display: flex; flex-direction: column; gap: 14px; align-items: center; padding: 22px 12px; border-radius: 14px; background: #1a1f2a; overflow: hidden; }
.getapp-shots img { max-width: 100%; height: auto; }
.feed li.empty { display: block; text-align: center; }

.first-open { margin-top: 16px; font-size: 13.5px; color: var(--text-2); }
.first-open summary { cursor: pointer; font-weight: 600; color: var(--text); }
.first-open ol { padding-left: 20px; line-height: 1.6; margin: 10px 0; }
.first-open code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; user-select: all; }

/* ───────── Header tools ───────── */
.brand { text-decoration: none; color: inherit; }
.tool {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600;
  transition: background .15s, border-color .15s;
}
.tool svg { width: 16px; height: 16px; }
.tool:hover { border-color: color-mix(in srgb, var(--text) 30%, transparent); }
.tool[aria-pressed="true"] { background: color-mix(in srgb, var(--live) 14%, var(--surface)); border-color: color-mix(in srgb, var(--live) 40%, transparent); color: var(--live); }
.tool-primary { background: var(--text); color: var(--bg); border-color: transparent; }
.tool-primary:hover { opacity: .9; }
.toggle .short { display: none; }
@media (max-width: 760px) {
  .tool span, .toggle .long { display: none; }
  .toggle .short { display: inline; }
  .tool { padding: 0 9px; }
  .topbar-right { gap: 8px; }
}

/* ───────── Favorites ───────── */
.fav {
  border: 0; background: none; cursor: pointer; font-size: 17px; line-height: 1; padding: 2px 4px; margin-left: 4px;
  color: var(--text-3); transition: transform .15s, color .15s;
}
.fav:hover { transform: scale(1.15); color: #f5b400; }
.fav[aria-pressed="true"] { color: #f5b400; }
.chip .star { color: #f5b400; font-size: 11px; margin-left: 4px; }

/* ───────── Anywhere section ───────── */
.everywhere { max-width: 1120px; margin: 8px auto 20px; padding: 0 16px; }
.section-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 8px 0 14px; color: var(--text); text-transform: none; }
.cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .cards3 { grid-template-columns: 1fr; } }
.feature h3 { margin: 8px 0 6px; font-size: 16px; }
.feature p { margin: 0 0 10px; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.feature-icon { font-size: 26px; }
.linkish { border: 0; background: none; padding: 0; color: var(--four); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }
.linkish:hover { text-decoration: underline; }

/* ───────── Mac section ───────── */
.getapp { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
.eyebrow { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.getapp-demo { display: flex; flex-direction: column; gap: 10px; }
.demo-caption { margin: 0; text-align: center; }

/* Animated MacBook-notch demo (pure CSS, loops every 10 s) */
.mac { border-radius: 16px; padding: 10px; background: #1b1e25; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 20px 40px rgba(0,0,0,.35); }
.mac-screen { position: relative; height: 230px; border-radius: 8px; overflow: hidden;
  background: radial-gradient(120% 90% at 20% 110%, #3b2a6b 0%, transparent 60%), radial-gradient(100% 80% at 90% 0%, #0f4c75 0%, transparent 55%), #121826; }
.mac-menubar { position: absolute; inset: 0 0 auto 0; height: 22px; display: flex; align-items: center; gap: 14px; padding: 0 12px;
  font: 600 10.5px -apple-system, system-ui, sans-serif; color: rgba(255,255,255,.85); background: rgba(0,0,0,.25); }
.mm-apple { width: 9px; height: 11px; border-radius: 3px 3px 5px 5px; background: rgba(255,255,255,.85); }
.mm-right { margin-left: auto; }
.mac-notch { position: absolute; top: 0; left: 50%; width: 90px; height: 22px; transform: translateX(-50%); background: #000; border-radius: 0 0 9px 9px; z-index: 3; }
.mac-window { position: absolute; left: 12%; right: 12%; top: 70px; bottom: -10px; border-radius: 8px; background: rgba(255,255,255,.06);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); display: flex; gap: 5px; padding: 8px; }
.mac-window span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.18); }
.dw { position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 2; background: #000; color: #fff;
  width: 290px; height: 22px; border-radius: 0 0 12px 12px; overflow: hidden; font-family: -apple-system, system-ui, sans-serif;
  animation: dw-size 10s cubic-bezier(.3,.9,.3,1) infinite; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.dw-bar { height: 22px; display: grid; grid-template-columns: 1fr 98px 1fr; align-items: center; padding: 0 12px; font-size: 10.5px; }
.dw-bar .dw-l { grid-column: 1; justify-self: start; white-space: nowrap; }
.dw-bar .dw-r { grid-column: 3; justify-self: end; white-space: nowrap; }
.dw-l, .dw-r { display: flex; align-items: center; gap: 5px; }
.dw-dot { width: 6px; height: 6px; border-radius: 50%; background: #ff453a; box-shadow: 0 0 6px #ff453a; animation: dw-dot 10s infinite; }
.dw-four { display: inline-block; overflow: hidden; max-width: 0; opacity: 0; padding: 1px 0; font-style: normal; font-weight: 900; font-size: 9px;
  background: #1f7cff; border-radius: 6px; animation: dw-four 10s infinite; }
.dw-score, .dw-r { position: relative; font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 700; }
.dw-score { display: inline-grid; } .dw-score span, .dw-r .o1, .dw-r .o2 { grid-area: 1 / 1; }
.dw-r { display: inline-grid; grid-auto-flow: column; } .dw-r small { color: #9aa0ab; font-weight: 500; margin-left: 4px; }
.s1, .o1 { animation: dw-old 10s infinite; } .s2, .o2 { animation: dw-new 10s infinite; opacity: 0; }
.dw-more { padding: 6px 14px 10px; font-size: 10.5px; opacity: 0; animation: dw-more 10s infinite; }
.dw-line { margin-bottom: 6px; color: #d6dbe4; } .dw-line b { font-family: "JetBrains Mono", ui-monospace, monospace; }
.dw-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; color: #d6dbe4; margin: 2px 0; }
.dw-row b { font-family: "JetBrains Mono", ui-monospace, monospace; }
.dw-balls { display: flex; gap: 4px; margin-top: 7px; }
.dw-balls i { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font: 700 8.5px ui-monospace, monospace; font-style: normal; background: rgba(255,255,255,.12); }
.dw-balls i.d { background: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); } .dw-balls i.f { background: #1f7cff; }
@keyframes dw-size {
  0%, 38% { width: 290px; height: 22px; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
  22%, 28% { box-shadow: 0 0 0 2px #1f7cff, 0 6px 22px rgba(31,124,255,.6); }
  44%, 78% { width: 300px; height: 118px; border-radius: 0 0 16px 16px; }
  86%, 100% { width: 290px; height: 22px; }
}
@keyframes dw-dot { 0%, 20%, 32%, 100% { opacity: 1; width: 6px; } 21%, 31% { opacity: 0; width: 0; } }
@keyframes dw-four { 0%, 20% { max-width: 0; opacity: 0; padding: 1px 0; } 21%, 31% { max-width: 22px; opacity: 1; padding: 1px 5px; } 32%, 100% { max-width: 0; opacity: 0; padding: 1px 0; } }
@keyframes dw-old { 0%, 22% { opacity: 1; transform: none; } 25%, 96% { opacity: 0; transform: translateY(-6px); } 100% { opacity: 1; } }
@keyframes dw-new { 0%, 22% { opacity: 0; transform: translateY(6px); } 25%, 96% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes dw-more { 0%, 44% { opacity: 0; } 50%, 76% { opacity: 1; } 80%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .dw, .dw * { animation: none !important; } .s2, .o2 { opacity: 0; } }

/* Walkthrough */
.walkthrough { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.walkthrough h3 { margin: 0 0 4px; font-size: 15px; }
.steps { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 12px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.steps li b { color: var(--text); }
@media (max-width: 520px) { .steps li { grid-template-columns: 1fr; } }
.step-art { height: 84px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; position: relative; }
.art-dmg { display: flex; gap: 10px; }
.app-ico { width: 34px; height: 34px; border-radius: 9px; background: radial-gradient(circle at 50% 45%, #ff453a 0 34%, #111 36%); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.folder-ico { width: 38px; height: 30px; border-radius: 5px; background: linear-gradient(#5aa8ff, #2f7ff0); position: relative; }
.folder-ico::before { content: ""; position: absolute; top: -5px; left: 3px; width: 15px; height: 7px; border-radius: 3px 3px 0 0; background: #5aa8ff; }
.arrow { font-size: 20px; color: var(--text-3); }
.dlg, .set { width: 136px; padding: 7px 8px; border-radius: 9px; background: var(--surface); box-shadow: 0 4px 14px rgba(0,0,0,.18); font-size: 8.5px; line-height: 1.3; color: var(--text); display: flex; flex-direction: column; gap: 3px; }
.dlg small, .set small { color: var(--text-2); font-size: 7.5px; }
.dlg-ico { width: 14px; height: 14px; border-radius: 4px; background: #f59e0b; color: #fff; font-weight: 900; display: grid; place-items: center; font-size: 9px; }
.dlg-btns { display: flex; gap: 4px; margin-top: 2px; }
.dlg-btns span { flex: 1; text-align: center; border-radius: 5px; padding: 2px 0; background: var(--surface-2); }
.hl { background: #1f7cff !important; color: #fff; border-radius: 5px; padding: 2px 6px; text-align: center; box-shadow: 0 0 0 2px color-mix(in srgb, #1f7cff 35%, transparent); animation: pulse 1.6s ease-in-out infinite; }
.set .hl { align-self: flex-end; }
.walkthrough code { font-family: var(--mono); font-size: 11.5px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; user-select: all; }

/* ───────── Install dialog & toasts ───────── */
.modal { border: 0; border-radius: 18px; padding: 22px 24px; max-width: 420px; width: calc(100% - 32px); background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.modal::backdrop { background: rgba(0,0,0,.45); backdrop-filter: blur(2px); }
.modal h3 { margin: 0 0 10px; }
.modal ol { padding-left: 20px; line-height: 1.6; font-size: 14.5px; }
.modal .download { border: 0; cursor: pointer; margin-top: 6px; }
.toasts { position: fixed; top: 70px; right: 16px; z-index: 40; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast-item { pointer-events: auto; max-width: 320px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow); font-size: 13px; animation: slidein .35s ease; }
.toast-item b { display: block; margin-bottom: 2px; }
.toast-item.wicket b { color: var(--wicket); } .toast-item.started b { color: var(--live); } .toast-item.result b { color: var(--success); } .toast-item.info b { color: var(--four); }
.brand span { white-space: nowrap; }
@media (max-width: 440px) { .brand { font-size: 15px; gap: 7px; } .brand-mark { width: 22px; height: 22px; } .topbar-right { gap: 6px; } .tool { padding: 0 8px; } }

/* ───────── Watch while you work ───────── */
.workbar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--radius);
  background: linear-gradient(90deg, color-mix(in srgb, var(--four) 14%, var(--surface)), var(--surface)); border: 1px solid var(--border); box-shadow: var(--shadow); }
.work-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; padding: 10px 16px; border-radius: 12px;
  background: #1667dc; color: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; box-shadow: 0 6px 18px color-mix(in srgb, var(--four) 40%, transparent); }
.work-btn svg { width: 18px; height: 18px; }
.work-btn[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: none; }
.workbar-text { font-size: 13px; color: var(--text-2); line-height: 1.4; }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface-2); }

/* ───────── Share ───────── */
.share-btn-inline { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.share-btn-inline:hover { color: var(--text); }
.share-preview { white-space: pre-wrap; font-family: inherit; font-size: 13.5px; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; color: var(--text); }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.share-btn { display: flex; align-items: center; justify-content: center; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; }
.share-btn.wa { background: #25d366; color: #052e16; border-color: transparent; }
.share-btn.x { background: #0f1419; color: #fff; border-color: transparent; }
.toast-item .toast-action { margin-top: 8px; border: 0; border-radius: 8px; padding: 5px 10px; font-weight: 700; font-size: 12.5px; cursor: pointer; background: var(--text); color: var(--bg); }

/* ───────── Team picker sheet ───────── */
.sheet { position: fixed; inset: auto 0 0 0; z-index: 35; display: flex; justify-content: center; padding: 0 12px 12px; animation: sheet-in .35s cubic-bezier(.2,.9,.3,1); }
.sheet-inner { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px 18px 14px; box-shadow: 0 -10px 40px rgba(0,0,0,.35); }
.sheet h3 { margin: 0 0 4px; font-size: 18px; }
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
@media (max-width: 480px) { .team-grid { grid-template-columns: repeat(3, 1fr); } }
.team-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 12px; border: 1.5px solid var(--border);
  background: var(--surface-2); cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text); }
.team-opt .badge { width: 36px; height: 36px; font-size: 11px; }
.team-opt[aria-pressed="true"] { border-color: #f5b400; background: color-mix(in srgb, #f5b400 12%, var(--surface-2)); }
.sheet-actions { display: flex; justify-content: space-between; align-items: center; }
.sheet-actions .download[disabled] { opacity: .4; cursor: default; }
@keyframes sheet-in { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
.sb-actions { display: flex; align-items: center; gap: 10px; }
#sheet-desc { line-height: 1.6; }
@media (max-width: 760px) { .workbar { flex-direction: column; align-items: stretch; text-align: center; } .work-btn { justify-content: center; } }

/* FAQ */
.faq { max-width: 1120px; margin: 8px auto 24px; padding: 0 16px; }
.faq-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; align-items: start; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 16px; }
.faq-item summary { cursor: pointer; list-style: none; padding: 14px 0; font-weight: 600; font-size: 15px; display: flex; justify-content: space-between; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--text-3); font-weight: 400; font-size: 18px; line-height: 1; transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin: 0 0 14px; color: var(--text-2); font-size: 14px; line-height: 1.55; }
@media (max-width: 760px) { .faq-list { grid-template-columns: 1fr; } }

/* Phones: the connection pill becomes a status dot (text stays for screen readers). */
@media (max-width: 440px) {
  .pill { font-size: 0; gap: 0; padding: 0; width: 14px; height: 14px; justify-content: center; background: none; }
  .pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
}
@media (max-width: 400px) { .topbar-right { gap: 4px; } .tool { padding: 0 7px; } .topbar { gap: 8px; } }
@media (max-width: 350px) { .brand-name { display: none; } }
.getapp code { overflow-wrap: anywhere; }
.booting .col-side, .booting #players, .booting #balls, .booting .everywhere, .booting .getapp, .booting .faq, .booting .footer { display: none; }
