/* Credit line — bottom-right */
.design-ui-credit {
  position: fixed;
  bottom: 12px;
  right: 12px;
  font: 11px/1 system-ui, sans-serif;
  color: rgba(128,128,128,0.5);
  pointer-events: none;
  z-index: 2147483647;
  transition: opacity 0.4s ease;
  user-select: none;
  letter-spacing: 0.02em;
}

/* Hide chrome on touch devices */
@media (hover: none) {
  .design-ui-credit { display: none; }
}

/* Print fixes */
@media print {
  * {
    transition: none !important;
    animation: none !important;
    box-shadow: none !important;
  }
  body {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .design-ui-credit { display: none !important; }
}

/* ========================================================================
   CricBun Match Overview — Design System
   Extracted from html/cricbun-match-overview.html
   ======================================================================== */

:root {
  --bg: oklch(96% .007 230);
  --paper: oklch(99.5% .004 230);
  --ink: oklch(22% .025 236);
  --muted: oklch(52% .018 236);
  --soft: oklch(72% .012 236);
  --line: oklch(89% .01 236);
  --cyan: oklch(63% .13 221);
  --cyan-d: oklch(47% .115 221);
  --cyan-p: oklch(94% .035 221);
  --red: oklch(60% .2 27);
  --green: oklch(57% .13 150);
  --amber: oklch(72% .14 78);
  --navy: oklch(28% .045 238);
  --shadow: 0 5px 18px oklch(24% .02 235/.07);
  --ease: cubic-bezier(.16,1,.3,1);
}

/* Body-content utilities used by the match-overview panels.
   Global chrome selectors (.mast/.navrow/.brand/.ball/.nav/.actions/.ib/
   .mobile-nav/.wrap) are intentionally NOT defined here — global-shell.css
   owns them and the header/nav/scorebar/footer come from partials. */
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
.nums { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse 1.6s infinite;
}
.scorehead {
  position: sticky;
  top: 0;
  z-index: 25;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 3px 10px oklch(24% .02 235/.05);
}
.crumb {
  padding-top: 12px;
  font-size: .6rem;
  color: var(--muted);
}
.matchtitle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 15px;
}
.matchtitle h1 { font-size: .82rem; }
.matchtitle p {
  font-size: .58rem;
  color: var(--muted);
  margin-top: 3px;
}
.live {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--red);
  font-size: .62rem;
  font-weight: 800;
}
.teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  padding: 0 0 17px;
}
.team {
  display: flex;
  align-items: center;
  gap: 12px;
}
.team.right {
  justify-content: flex-end;
  text-align: right;
}
.flag {
  width: 45px;
  height: 35px;
  border-radius: 7px;
  background: var(--cyan-p);
  color: var(--cyan-d);
  display: grid;
  place-items: center;
  font-size: .62rem;
  font-weight: 800;
}
.teamname {
  display: block;
  font-size: .73rem;
  font-weight: 700;
}
.score {
  display: block;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -.055em;
}
.overs {
  display: block;
  font-size: .57rem;
  color: var(--muted);
}
.versus {
  text-align: center;
  color: var(--soft);
  font-size: .58rem;
  font-weight: 800;
}
.status {
  text-align: center;
  padding: 9px;
  background: oklch(97.4% .008 230);
  border-radius: 8px;
  font-size: .65rem;
  color: var(--red);
  font-weight: 700;
}
.tabs {
  display: flex;
  overflow: auto;
  scrollbar-width: none;
  margin-top: 12px;
}
.tab {
  flex: none;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  padding: 11px 17px;
  color: var(--muted);
  font-size: .67rem;
  font-weight: 700;
}
.tab.active {
  color: var(--cyan-d);
  border-color: var(--cyan);
}
main { padding: 18px 0 80px; }
.layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 300px;
  gap: 17px;
}
.stack {
  display: grid;
  gap: 17px;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.head {
  min-height: 47px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.head h2 { font-size: .82rem; }
.head a { font-size: .59rem; color: var(--cyan-d); font-weight: 700; }
.snapshot {
  display: grid;
  grid-template-columns: repeat(4,1fr);
}
.metric {
  padding: 17px;
  border-right: 1px solid var(--line);
}
.metric:last-child { border: 0; }
.metric b { display: block; font-size: 1.18rem; letter-spacing: -.04em; }
.metric span { display: block; font-size: .55rem; color: var(--muted); margin-top: 3px; }
.metric em { font-style: normal; color: var(--green); font-size: .55rem; }
.partnership { padding: 17px; }
.pair { display: flex; justify-content: space-between; align-items: center; }
.batters { display: flex; align-items: center; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--cyan-p);
  color: var(--cyan-d);
  font-size: .58rem;
  font-weight: 800;
  border: 2px solid var(--paper);
}
.avatar + .avatar { margin-left: -8px; }
.pair h3 { font-size: .72rem; }
.pair p { font-size: .58rem; color: var(--muted); margin-top: 3px; }
.pairscore { text-align: right; }
.pairscore b { display: block; font-size: 1.25rem; }
.pairscore span { font-size: .55rem; color: var(--muted); }
.progress {
  height: 8px;
  border-radius: 9px;
  background: var(--line);
  overflow: hidden;
  margin-top: 14px;
}
.progress span {
  display: block;
  width: 74%;
  height: 100%;
  background: var(--cyan);
}
.commentary { padding: 0 15px; }
.ballrow {
  display: grid;
  grid-template-columns: 44px 34px 1fr;
  gap: 9px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.ballrow:last-child { border: 0; }
.over {
  font-size: .63rem;
  font-weight: 800;
  color: var(--cyan-d);
}
.ballbadge {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--cyan-p);
  font-size: .6rem;
  font-weight: 800;
}
.ballbadge.four { background: var(--cyan-d); color: var(--paper); }
.ballbadge.wicket { background: var(--red); color: var(--paper); }
.ballrow h3 { font-size: .66rem; }
.ballrow p { font-size: .58rem; color: var(--muted); margin-top: 4px; }
.chart { height: 210px; padding: 16px; position: relative; }
.bars {
  height: 145px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to top, transparent 0, transparent 35px, var(--line) 36px);
}
.bar {
  flex: 1;
  max-width: 28px;
  background: var(--cyan);
  border-radius: 4px 4px 0 0;
  transform-origin: bottom;
  animation: rise .55s var(--ease) both;
}
.bar.wicket { background: var(--red); }
.axis {
  display: flex;
  justify-content: space-between;
  color: var(--soft);
  font-size: .52rem;
  margin-top: 7px;
}
.keymoments { display: grid; grid-template-columns: repeat(3,1fr); }
.moment {
  padding: 15px;
  border-right: 1px solid var(--line);
}
.moment:last-child { border: 0; }
.momenttime { font-size: .55rem; color: var(--cyan-d); font-weight: 800; }
.moment h3 { font-size: .68rem; margin-top: 7px; }
.moment p { font-size: .57rem; color: var(--muted); margin-top: 5px; }
.xi { display: grid; grid-template-columns: 1fr 1fr; }
.xiteam { padding: 14px; }
.xiteam:first-child { border-right: 1px solid var(--line); }
.xiteam h3 { font-size: .67rem; margin-bottom: 8px; }
.player {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: .6rem;
}
.player:last-child { border: 0; }
.role { color: var(--muted); }
.sidebody { padding: 14px; }
.winlabel { display: flex; justify-content: space-between; font-size: .61rem; }
.winbar {
  height: 9px;
  border-radius: 10px;
  background: var(--line);
  overflow: hidden;
  margin: 10px 0;
}
.winbar span { display: block; width: 64%; height: 100%; background: var(--cyan); }
.wintext { font-size: .58rem; color: var(--muted); }
.info { display: grid; gap: 11px; }
.inforow {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
}
.inforow h3 { font-size: .64rem; }
.inforow p { font-size: .56rem; color: var(--muted); margin-top: 2px; }
.weather {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.temp { font-size: 1.55rem; font-weight: 800; }
.weather p { font-size: .57rem; color: var(--muted); }
.poll button {
  width: 100%;
  height: 36px;
  margin-top: 7px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  padding: 0 10px;
  font-size: .62rem;
}
.stories { padding: 0 14px; }
.story { padding: 11px 0; border-bottom: 1px solid var(--line); }
.story:last-child { border: 0; }
.story h3 { font-size: .64rem; }
.story p { font-size: .55rem; color: var(--muted); margin-top: 4px; }
.stale {
  display: none;
  background: oklch(96% .04 78);
  color: oklch(45% .09 78);
  padding: 9px;
  text-align: center;
  font-size: .61rem;
}
.skeleton { display: none; padding: 15px; }
.sk {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--line), oklch(95% .01 230), var(--line));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  margin: 10px;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 7px oklch(60% .2 27/0); }
}
@keyframes rise { from { transform: scaleY(0); opacity: 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 960px) {
  .nav { display: none; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 700px) {
  .matchtitle { padding-bottom: 10px; }
  .matchtitle h1 { font-size: .7rem; }
  .teams { gap: 5px; }
  .team { display: grid; gap: 5px; }
  .team.right { justify-items: end; }
  .flag { width: 34px; height: 27px; }
  .score { font-size: 1.18rem; }
  .overs { font-size: .52rem; }
  .status { font-size: .59rem; }
  .tab { padding: 10px 13px; }
  .layout, .stack { gap: 9px; }
  .panel { border-radius: 10px; }
  .snapshot { display: flex; overflow: auto; }
  .metric { min-width: 42vw; }
  .keymoments { display: flex; overflow: auto; }
  .moment { min-width: 72vw; }
  .xi { grid-template-columns: 1fr; }
  .xiteam:first-child { border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .crumb { display: none; }
  .scorehead { top: 0; }
  .teamname { font-size: .62rem; }
  .score { font-size: 1rem; }
  .overs { font-size: .52rem; }
  .ballrow { grid-template-columns: 36px 28px 1fr; gap: 7px; }
  .ballbadge { width: 25px; height: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}