:root {
  --bg: #061a2d;
  --panel: #0b2540;
  --panel-soft: #102f50;
  --border: rgba(255,255,255,0.09);
  --text: #f4f7fb;
  --muted: #9eb2c7;
  --accent: #6ea7ff;
  --accent-2: #8b71ff;
  --warning: #ffd46b;
  --success: #7af0b7;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, Arial, sans-serif;
  background: radial-gradient(circle at top, #0d3155, var(--bg) 40%);
  color: var(--text);
}
.page-shell { max-width: 1400px; margin: 0 auto; padding: 22px; }
.hero, .grid-main { display: grid; gap: 18px; }
.hero { grid-template-columns: 2fr 1fr; align-items: stretch; margin-bottom: 18px; }
.eyebrow { margin: 0 0 6px; color: #8fb6ff; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }
h1 { margin: 0 0 10px; font-size: 38px; line-height: 1.08; }
.sub { color: var(--muted); max-width: 760px; margin: 0; }
.hero-card, .card {
  background: rgba(8, 28, 49, 0.92);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 14px 38px rgba(0,0,0,.22);
}
.hero-card { padding: 20px; display:flex; flex-direction:column; justify-content:center; }
.speech-preview { font-size: 30px; font-weight: 800; color: var(--warning); margin-top: 12px; }
.card { padding: 18px; }
.label, h2, h3 { margin: 0 0 12px; }
.url-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
input, select, button {
  border-radius: 16px; border: 1px solid var(--border); font: inherit;
}
input, select {
  background: #102947; color: white; padding: 14px 16px; width: 100%;
}
button {
  cursor: pointer; padding: 13px 18px; background: #173452; color: white;
  transition: .18s ease;
}
button:hover { transform: translateY(-1px); background: #1b4066; }
button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none; font-weight: 700;
}
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; align-items: center;
}
.select-wrap, .toggle {
  display: inline-flex; align-items: center; gap: 10px; background: #102947;
  border: 1px solid var(--border); padding: 8px 12px; border-radius: 16px; color: var(--muted);
}
.toggle input { width: 16px; height: 16px; accent-color: #82a8ff; }
.status-row { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 14px; color: var(--muted); }
.muted { color: var(--muted); }
.grid-main { grid-template-columns: minmax(0, 2.25fr) minmax(300px, 0.95fr); }
.title-row, .section-head { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.live-pill {
  background: rgba(122,240,183,0.12); color: var(--success); border: 1px solid rgba(122,240,183,.22);
  padding: 8px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.scoreboard-grid {
  display:grid; grid-template-columns: 1.4fr 180px 1fr; gap:18px; align-items:center;
}
.team-block { display:flex; align-items:center; gap:14px; }
.team-logo { width: 62px; height: 62px; object-fit: contain; border-radius: 50%; background:#0d2947; }
.team-name { font-size: 34px; font-weight: 800; }
.score-line { font-size: 24px; font-weight: 800; display:flex; gap:10px; align-items:baseline; }
.overs { color: var(--muted); font-size: 19px; }
.ball-box {
  background: linear-gradient(180deg, rgba(255,212,107,.08), rgba(255,212,107,.03));
  border: 1px solid rgba(255,212,107,.15); padding: 14px; border-radius: 20px; text-align:center;
}
.ball-value { font-size: 60px; font-weight: 900; color: #f2e38f; line-height: 1; }
.run-rate { font-size: 18px; margin-bottom: 12px; text-align:right; }
.result-text { font-size: 24px; font-weight: 800; color: #ffb347; text-align:right; }
.snapshot-grid { display:grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.tiny-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.snapshot-big { font-size: 28px; font-weight: 800; margin-top: 8px; }
.players-row { display:grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.player-layout { display:flex; gap: 14px; align-items:center; }
.player-image { width: 88px; height: 88px; object-fit: contain; border-radius: 18px; background:#fff; }
.player-name { font-size: 22px; font-weight: 700; }
.player-score { font-size: 30px; font-weight: 900; color: #fff0ae; }
.player-meta { color: var(--muted); margin-top: 4px; }
.overs-card { margin-top: 16px; }
.overs-list { display:flex; gap: 10px; overflow:auto; padding-bottom: 4px; }
.over-chip {
  min-width: 170px; background:#102947; border:1px solid var(--border); border-radius: 18px; padding: 12px;
}
.over-title { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.over-balls { display:flex; flex-wrap:wrap; gap: 6px; }
.ball-chip { min-width: 28px; text-align:center; padding: 6px 8px; border-radius: 12px; background:#173452; font-weight: 700; }
.ball-chip.four { background:#275eae; }
.ball-chip.six { background:#5535d9; }
.ball-chip.wicket { background:#8b2431; }
.ball-chip.wd, .ball-chip.nb { background:#ad7a21; }
.over-total { margin-top: 8px; color: #cbd7e5; font-weight:700; }
.snapshot-list { margin: 0; display:grid; gap:14px; }
.snapshot-list div { display:flex; justify-content:space-between; gap:12px; padding-bottom:10px; border-bottom:1px solid var(--border); }
.snapshot-list div:last-child { border-bottom:0; padding-bottom:0; }
.snapshot-list dt { color: var(--muted); }
.snapshot-list dd { margin:0; font-weight: 700; text-align:right; }
.activity-log {
  height: 420px; overflow:auto; background:#102947; border-radius:18px; padding: 12px; border:1px solid var(--border);
}
.log-line { margin: 0 0 8px; color:#cbd7e5; word-break: break-word; }
.small-btn { padding: 8px 12px; border-radius: 12px; }
.empty-state { color: var(--muted); padding: 12px; }
@media (max-width: 1100px) {
  .hero, .grid-main, .scoreboard-grid, .players-row, .snapshot-grid { grid-template-columns: 1fr; }
  .result-text, .run-rate { text-align:left; }
}


/* Premium layout refresh */
body {
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 28%),
    radial-gradient(circle at 88% 0%, color-mix(in srgb, var(--accent-2) 24%, transparent), transparent 24%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel-soft) 60%, var(--bg)) 0%, var(--bg) 100%);
}
.page-shell { max-width: 1480px; }
.hero-card, .card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)),
    color-mix(in srgb, var(--panel) 92%, black);
  backdrop-filter: blur(12px);
}
h1 {
  background: linear-gradient(135deg, #ffffff, color-mix(in srgb, var(--accent) 70%, white), color-mix(in srgb, var(--accent-2) 60%, white));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.control-panel.card {
  border-color: color-mix(in srgb, var(--accent) 28%, rgba(255,255,255,0.08));
}
.players-row { margin-top: 12px; }
.partnership-strip-card {
  margin-top: 16px;
  padding: 10px 18px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent 20%, transparent 80%, color-mix(in srgb, var(--accent-2) 22%, transparent)),
    color-mix(in srgb, var(--panel) 94%, black);
}
.partnership-strip {
  min-height: 48px;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between;
  white-space: nowrap;
}
.partnership-inline {
  font-size: 18px;
  line-height: 1;
}

.compact-overs .section-head h3 { margin-bottom: 0; }
.overs-card { margin-top: 16px; padding: 14px 16px; }
.overs-list {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.over-chip {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 14px;
}
.over-title, .over-total {
  margin: 0;
  white-space: nowrap;
}
.over-title { font-size: 11px; }
.over-balls {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 4px;
}
.ball-chip {
  min-width: 20px;
  padding: 4px 6px;
  border-radius: 10px;
  font-size: 12px;
}
.over-total {
  font-size: 12px;
  opacity: .95;
}

.bottom-snapshot-grid { 
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
  order: 99;
}
.snapshot-card {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 55%),
    color-mix(in srgb, var(--panel) 95%, black);
}
.snapshot-big { font-size: 24px; }

.side-column .hidden { display:none !important; }
.side-column { display:none; }
.grid-main { grid-template-columns: 1fr; }

body[data-theme="blue"] {
  --accent: #52a8ff;
  --accent-2: #7a5cff;
}
body[data-theme="emerald"] {
  --accent: #3bf1b0;
  --accent-2: #10b981;
}
body[data-theme="purple"] {
  --accent: #b57cff;
  --accent-2: #7c3aed;
}
body[data-theme="crimson"] {
  --accent: #ff668d;
  --accent-2: #ff2f6d;
}
body[data-theme="gold"] {
  --accent: #ffcf4a;
  --accent-2: #ff9720;
}

@media (max-width: 900px) {
  .page-shell { padding: 12px; }
  .hero { grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
  h1 { font-size: 26px; line-height: 1.12; }
  .sub { font-size: 14px; }
  .url-row { grid-template-columns: 1fr; }
  .toolbar { gap: 8px; }
  .toolbar > * { width: 100%; }
  .select-wrap, .toggle { width: 100%; justify-content: space-between; }
  .status-row { gap: 10px; font-size: 13px; }
  .match-header.card, .card { padding: 14px; border-radius: 18px; }
  .scoreboard-grid { grid-template-columns: 1fr; gap: 12px; }
  .team-block { align-items: center; }
  .team-logo { width: 48px; height: 48px; }
  .team-name { font-size: 26px; }
  .score-line { font-size: 20px; }
  .ball-box { padding: 12px; }
  .ball-value { font-size: 46px; }
  .run-rate, .result-text { text-align: left; }
  .result-text { font-size: 20px; }
  .players-row { grid-template-columns: 1fr; gap: 10px; }
  .player-card-lg h3 { margin-bottom: 8px; }
  .player-layout { gap: 12px; }
  .player-image { width: 64px; height: 64px; border-radius: 14px; }
  .player-name { font-size: 18px; }
  .player-score { font-size: 24px; }
  .player-meta { font-size: 13px; }
  .partnership-strip-card { padding: 10px 14px; margin-top: 12px; }
  .partnership-inline { font-size: 16px; }
  .overs-card { padding: 12px; }
  .bottom-snapshot-grid { grid-template-columns: 1fr; gap: 10px; }
  .snapshot-big { font-size: 22px; }
}
