  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f4f6f9; color: #1a1a2e; min-height: 100vh;
  }
  /* ── Header ── */
  .header { background: #1a2e1a; padding: 20px 40px; color: #faf7f0; }
  .header h1 { font-size: 22px; font-weight: 600; }
  .header p  { font-size: 13px; color: rgba(250,247,240,0.55); margin-top: 4px; }
  /* ── Controls bar ── */
  .sim-controls-bar {
    background: white; border-bottom: 1px solid #e0e0e0;
    padding: 14px 40px; display: flex; gap: 20px;
    flex-wrap: wrap; align-items: flex-end;
  }
  .control-group { display: flex; flex-direction: column; gap: 5px; }
  .control-group label {
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.8px; text-transform: uppercase; color: rgba(250,247,240,0.75);
  }
  .control-group select {
    padding: 8px 32px 8px 12px; border: 1px solid #d0d0d0; border-radius: 6px;
    font-size: 14px; background: white; color: #1a1a2e; cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
    min-width: 160px;
  }
  .control-group select:focus {
    outline: none; border-color: #2d4a2d;
    box-shadow: 0 0 0 3px rgba(45,74,45,0.1);
  }
  /* ── Buttons ── */
  .sim-btn {
    padding: 9px 24px; background: #2d4a2d; color: white;
    border: none; border-radius: 6px; font-size: 14px; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: background 0.2s; white-space: nowrap;
  }
  .sim-btn:hover { background: #1a2e1a; }
  .sim-btn-secondary {
    padding: 9px 20px; background: white; color: #2d4a2d;
    border: 1px solid #2d4a2d; border-radius: 6px;
    font-size: 13px; font-weight: 500;
    cursor: pointer; font-family: inherit; transition: all 0.2s;
  }
  .sim-btn-secondary:hover { background: #f0f5f0; }
  /* ── Main ── */
  .main { padding: 24px 40px; max-width: 1400px; }
  /* ── Matchup bar ── */
  .matchup-bar {
    background: #f0f5f0; border: 1px solid #c8e0c8; border-radius: 8px;
    padding: 12px 18px; font-size: 13px; color: #2d4a2d; margin-bottom: 24px;
    display: flex; gap: 24px; flex-wrap: wrap; align-items: center;
  }
  .matchup-tag {
    display: inline-block; background: #2d4a2d; color: white;
    font-size: 11px; font-weight: 500; padding: 3px 10px;
    border-radius: 12px; letter-spacing: 0.5px;
  }
  /* ── Summary grid ── */
  .sim-summary-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 16px; margin-bottom: 24px;
  }
  .sim-summary-card {
    background: white; border-radius: 10px; border: 1px solid #e8e8e8;
    padding: 16px 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  }
  .sim-summary-label {
    font-size: 11px; font-weight: 600; letter-spacing: 0.8px;
    text-transform: uppercase; color: #888; margin-bottom: 6px;
  }
  .sim-summary-value { font-size: 28px; font-weight: 700; color: #1a2e1a; line-height: 1; }
  /* ── Main two-column grid ── */
  .sim-main-grid {
    display: grid; grid-template-columns: 1.35fr 1fr;
    gap: 24px; align-items: start;
  }
  /* ── Card ── */
  .card {
    background: white; border-radius: 10px; border: 1px solid #e8e8e8;
    overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  }
  .card-header {
    background: #f8f8f8; border-bottom: 1px solid #e8e8e8;
    padding: 12px 16px; font-size: 12px; font-weight: 600;
    letter-spacing: 0.8px; text-transform: uppercase; color: #555;
  }
  /* ── Ball list ── */
  .ball-row {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 11px 16px; border-bottom: 1px solid #f0f0f0;
    cursor: pointer; transition: background 0.12s;
  }
  .ball-row:last-child { border-bottom: none; }
  .ball-row:hover { background: #fafff8; }
  .ball-row.selected {
    background: #fff8f0; border-left: 3px solid #c8842a; padding-left: 13px;
  }
  .ball-row.extra-row { background: #fcfcff; }
  .ball-label {
    font-size: 10px; font-weight: 600; color: #bbb; min-width: 56px;
    padding-top: 4px; letter-spacing: 0.3px; text-transform: uppercase;
  }
  .ball-outcome { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 46px; }
  .ball-outcome-icon { width: 30px; height: 30px; flex-shrink: 0; }
  .ball-outcome-text { font-size: 13px; font-weight: 700; line-height: 1; }
  .ball-meta { display: flex; flex-direction: column; gap: 4px; min-width: 65px; }
  .ball-score { font-size: 11px; color: #777; }
  .ball-commentary { font-size: 12.5px; color: #444; line-height: 1.55; flex: 1; }
  /* ── Over summary bar ── */
  .over-summary {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    background: #1a2e1a; color: white;
    padding: 12px 18px; gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .over-summary-label {
    font-size: 10px; font-weight: 600; letter-spacing: 0.8px;
    text-transform: uppercase; color: rgba(255,255,255,0.5);
    margin-bottom: 4px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
  }
  .over-summary-value {
    font-size: 18px; font-weight: 700; color: white; line-height: 1;
  }
  .over-summary-sub {
    font-size: 10px; color: rgba(255,255,255,0.45); margin-top: 3px;
  }
  .over-summary-pre {
    background: #f8f8f8; border-bottom: 1px solid #e8e8e8;
    padding: 12px 16px; font-size: 12px; font-weight: 600;
    letter-spacing: 0.8px; text-transform: uppercase; color: #555;
  }
  /* ── Tier badges ── */
  .tier-badge {
    display: inline-block; font-size: 9px; font-weight: 600;
    padding: 2px 6px; border-radius: 8px;
    letter-spacing: 0.3px; text-transform: uppercase;
  }
  .tier-1 { background: #e8f0e8; color: #1a5c1a; }
  .tier-2 { background: #e8f5e8; color: #2d7a2d; }
  .tier-3 { background: #fff3e0; color: #8a5c00; }
  .tier-4 { background: #f0f0f0; color: #555; }
  /* ── Chart / dist ── */
  .dist-info { font-size: 11px; color: #888; padding: 8px 16px 0; font-style: italic; line-height: 1.55; }
  .chart-wrap { padding: 16px; }
  /* ── Tier key ── */
  .tier-key {
    display: flex; flex-wrap: wrap; gap: 10px;
    padding: 10px 16px; font-size: 11px; border-top: 1px solid #f0f0f0;
  }
  .tier-key-item { display: flex; align-items: center; gap: 6px; color: #666; }
  /* ── Autocomplete ── */
  .autocomplete-wrapper { position: relative; }
  .autocomplete-input {
    padding: 8px 12px; border: 1px solid #d0d0d0; border-radius: 6px;
    font-size: 14px; color: #1a1a2e; font-family: inherit;
    width: 210px; background: white;
  }
  .autocomplete-input:focus {
    outline: none; border-color: #2d4a2d;
    box-shadow: 0 0 0 3px rgba(45,74,45,0.1);
  }
  .autocomplete-dropdown {
    display: none; position: absolute; top: calc(100% + 4px); left: 0;
    background: white; border: 1px solid #d0d0d0; border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12); z-index: 999;
    min-width: 210px; max-width: 320px; max-height: 240px; overflow-y: auto;
  }
  .autocomplete-item {
    padding: 9px 14px; font-size: 13px; cursor: pointer;
    color: #1a1a2e; border-bottom: 1px solid #f0f0f0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .autocomplete-item:last-child { border-bottom: none; }
  .autocomplete-item:hover { background: #f0f5f0; color: #2d4a2d; font-weight: 500; }
  .ac-hl { font-weight: 700; color: #2d4a2d; }
  .autocomplete-no-results { padding: 10px 14px; font-size: 13px; color: #999; font-style: italic; }

  /* ── Mode tabs ── */
  .mode-tabs {
    background: #1a2e1a; padding: 0 40px; display: flex; gap: 4px;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .mode-tab {
    background: none; border: none;
    padding: 11px 20px; font-size: 13px; font-weight: 500;
    color: rgba(250,247,240,0.5); cursor: pointer;
    border-bottom: 2px solid transparent; transition: all 0.2s;
    font-family: inherit;
  }
  .mode-tab:hover { color: rgba(250,247,240,0.85); }
  .mode-tab.active { color: #faf7f0; border-bottom-color: #c8842a; }

  /* ── Full-match outer wrapper ── */
  .match-outer { padding: 24px 40px; max-width: 1400px; }
  .match-ds-bar {
    background: white; border: 1px solid #e0e0e0; border-radius: 8px;
    padding: 14px 20px; display: flex; align-items: center;
    gap: 20px; margin-bottom: 24px;
  }
  .match-ds-bar label {
    font-size: 11px; font-weight: 600; letter-spacing: 0.8px;
    text-transform: uppercase; color: #666;
  }

  /* ── Team selection grid ── */
  .team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
  .team-panel {
    background: white; border-radius: 10px; border: 1px solid #e8e8e8;
    overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  }
  .team-panel-head {
    background: #1a2e1a; padding: 14px 18px;
    display: flex; align-items: center; gap: 12px;
  }
  .team-badge {
    background: #c8842a; color: white; font-size: 11px; font-weight: 700;
    padding: 3px 9px; border-radius: 10px; white-space: nowrap;
  }
  .team-name-input {
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
    border-radius: 5px; padding: 5px 10px; font-size: 14px; font-weight: 600;
    color: white; font-family: inherit; flex: 1;
  }
  .team-name-input::placeholder { color: rgba(255,255,255,0.4); }
  .team-name-input:focus { outline: none; border-color: #c8842a; }

  /* ── Position table ── */
  .pos-table { width: 100%; border-collapse: collapse; }
  .pos-table thead tr { background: #f8f8f8; }
  .pos-table th {
    padding: 8px 12px; font-size: 10px; font-weight: 600;
    letter-spacing: 0.8px; text-transform: uppercase; color: #888;
    border-bottom: 1px solid #e8e8e8; text-align: left;
  }
  .pos-row td { padding: 4px 8px; border-bottom: 1px solid #f5f5f5; }
  .pos-row:last-child td { border-bottom: none; }
  .pos-num {
    font-size: 12px; font-weight: 700; color: #888;
    min-width: 32px; text-align: center;
  }
  .pos-num.bat-pos { color: #2d4a2d; }
  .pos-player { min-width: 180px; }
  .pos-player .autocomplete-input { width: 100%; font-size: 13px; padding: 5px 10px; }
  .pos-role {
    font-size: 11px; color: #888; white-space: nowrap;
    padding-left: 6px; min-width: 100px;
  }
  .role-tag {
    display: inline-block; font-size: 9px; font-weight: 600; padding: 1px 5px;
    border-radius: 6px; margin-right: 3px; letter-spacing: 0.3px;
  }
  .tag-wk   { background: #fff0e0; color: #8a5000; }
  .tag-bat  { background: #e8f5e8; color: #2d7a2d; }
  .tag-bowl { background: #e8e8f5; color: #3a3a9a; }
  .pos-row.invalid-pos td { background: #fff5f5; }

  /* ── Validation bar ── */
  .validation-bar {
    padding: 12px 16px; border-top: 1px solid #f0f0f0;
    display: flex; flex-wrap: wrap; gap: 8px; background: #fafafa;
  }
  .val-item {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; color: #555;
  }
  .val-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  }
  .val-ok  .val-dot { background: #2d7a2d; }
  .val-err .val-dot { background: #c0392b; }
  .val-warn .val-dot { background: #e67e22; }

  /* ── Start match button ── */
  .start-match-bar {
    margin-top: 24px; display: flex; justify-content: flex-end; gap: 16px;
    align-items: center;
  }
  .start-match-err { font-size: 12px; color: #c0392b; }
  .btn-start-match {
    padding: 11px 32px; background: #c8842a; color: white;
    border: none; border-radius: 8px; font-size: 15px; font-weight: 700;
    cursor: pointer; font-family: inherit; transition: background 0.2s;
  }
  .btn-start-match:hover { background: #a86818; }
  .btn-start-match:disabled {
    background: #ccc; cursor: not-allowed;
  }

  /* ── Toss screen ── */
  .toss-outer {
    max-width: 560px; margin: 60px auto; text-align: center;
  }
  .toss-card {
    background: white; border-radius: 16px; padding: 40px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.1); border: 1px solid #e8e8e8;
  }
  .toss-title {
    font-size: 22px; font-weight: 700; color: #1a2e1a; margin-bottom: 8px;
  }
  .toss-subtitle {
    font-size: 13px; color: #888; margin-bottom: 32px;
  }
  .toss-coin-btn {
    width: 100px; height: 100px; border-radius: 50%;
    background: #c8842a; border: none; cursor: pointer;
    font-size: 36px; margin: 0 auto 28px; display: flex;
    align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(200,132,42,0.4);
    transition: transform 0.15s, box-shadow 0.15s; color: white;
  }
  .toss-coin-btn:hover { transform: scale(1.06); box-shadow: 0 6px 20px rgba(200,132,42,0.5); }
  .toss-coin-btn:disabled { background: #ccc; box-shadow: none; cursor: not-allowed; }
  .toss-timer {
    font-size: 48px; font-weight: 700; color: #c8842a;
    margin-bottom: 12px; min-height: 60px;
  }
  .toss-instruction { font-size: 13px; color: #666; margin-bottom: 20px; }
  .toss-calls { display: flex; gap: 16px; justify-content: center; margin-bottom: 24px; }
  .toss-call-btn {
    padding: 14px 36px; border-radius: 8px; font-size: 16px; font-weight: 700;
    cursor: pointer; font-family: inherit; border: 2px solid;
    transition: all 0.2s;
  }
  .toss-call-btn.heads {
    background: white; color: #1a2e1a; border-color: #1a2e1a;
  }
  .toss-call-btn.heads:hover { background: #1a2e1a; color: white; }
  .toss-call-btn.tails {
    background: white; color: #c8842a; border-color: #c8842a;
  }
  .toss-call-btn.tails:hover { background: #c8842a; color: white; }
  .toss-call-btn:disabled { opacity: 0.4; cursor: not-allowed; }
  .toss-result-box {
    background: #f0f5f0; border: 1px solid #c8e0c8; border-radius: 10px;
    padding: 20px; margin-top: 20px; font-size: 15px; color: #1a2e1a;
    font-weight: 500;
  }
  .toss-bat-bowl { display: flex; gap: 16px; justify-content: center; margin-top: 20px; }
  .toss-bb-btn {
    padding: 12px 28px; border-radius: 8px; font-size: 14px; font-weight: 600;
    cursor: pointer; font-family: inherit; border: none; transition: all 0.2s;
  }
  .toss-bb-btn.bat { background: #2d4a2d; color: white; }
  .toss-bb-btn.bat:hover { background: #1a2e1a; }
  .toss-bb-btn.bowl { background: #3a3a9a; color: white; }
  .toss-bb-btn.bowl:hover { background: #2a2a7a; }

  /* ── LHB/RHB badge ── */
  .bat-hand-badge { font-size:10px; background:#e8f0e8; color:#2d4a2d; padding:2px 6px;
    border-radius:10px; font-weight:600; margin-left:6px; }
  /* ── Batter name in ball row ── */
  .ball-batter-tag { font-size:10px; color:#999; font-style:italic;
    padding:0 14px 5px 14px; margin-top:-3px; }
  /* ── Simulation mode toggle ── */
  .mode-toggle { display:flex; gap:6px; margin-bottom:12px; }
  .mode-btn { padding:5px 14px; border:1px solid #c0c0c0; background:white;
    border-radius:6px; font-size:12px; font-weight:500; cursor:pointer; color:#666;
    font-family:inherit; transition:all 0.15s; }
  .mode-btn.active { background:#1a2e1a; color:white; border-color:#1a2e1a; }
  /* ── Bowler preview section ── */
  .preview-section { border-top:1px solid #f0f0f0; padding-top:12px; margin-top:10px; }
  .preview-arch { font-size:12px; color:#555; margin-bottom:4px; }
  .preview-arch strong { color:#1a2e1a; }
  .preview-label { font-size:11px; color:#999; margin-bottom:6px; }
  /* ── BBB controls ── */
  .bbb-controls-bar { display:flex; align-items:center; gap:12px; flex-wrap:wrap;
    padding:12px 14px; border-top:1px solid #f0f0f0; background:#fafafa; }
  /* ── Multi-over summary table ── */
  .multi-over-table { width:100%; border-collapse:collapse; font-size:12px; }
  .multi-over-table th { background:#1a2e1a; color:rgba(255,255,255,0.7); padding:7px 10px;
    text-align:right; font-size:10px; font-weight:600; letter-spacing:0.5px; }
  .multi-over-table th:first-child { text-align:left; }
  .multi-over-table td { padding:7px 10px; border-bottom:1px solid #f5f5f5;
    text-align:right; color:#444; }
  .multi-over-table td:first-child { text-align:left; color:#1a2e1a; font-weight:500; }
  .multi-over-table tr:last-child td { border-bottom:none; }
  .multi-over-total { padding:8px 10px; font-size:11px; font-weight:600; color:#444;
    border-top:2px solid #e0e0e0; background:#fafafa; }
  /* ── Preset batter row ── */
  .preset-batter-row { display:flex; align-items:center; gap:12px;
    padding:8px 0; border-top:1px solid #f0f0f0; margin-top:4px; }
  /* ── Quality label in dropdown ── */
  .qual-label { font-size:10px; padding:2px 6px; border-radius:10px;
    font-weight:600; margin-left:4px; white-space:nowrap; }
  .qual-elite  { background:#d4edda; color:#155724; }
  .qual-good   { background:#d1ecf1; color:#0c5460; }
  .qual-avg    { background:#fff3cd; color:#856404; }
  .qual-weak   { background:#f8d7da; color:#721c24; }
  /* ── Team auto-fill bar ── */
  .team-auto-bar { display:flex; align-items:center; gap:8px;
    padding:8px 0 12px 0; flex-wrap:wrap; }
  .team-auto-select { padding:6px 28px 6px 10px; border:1px solid #d0d0d0;
    border-radius:6px; font-size:12px; background:white; appearance:none;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23666' d='M5 7L0 2h10z'/%3E%3C/svg%3E");
    background-repeat:no-repeat; background-position:right 8px center;
    font-family:inherit; cursor:pointer; min-width:160px; max-width:240px; }
  .team-fill-btn { padding:6px 14px; background:#2d4a2d; color:white;
    border:none; border-radius:6px; font-size:12px; font-weight:600;
    cursor:pointer; font-family:inherit; }
  .team-fill-btn:hover { background:#1a2e1a; }
  /* ── Role display in role cell ── */
  .role-display { font-size:11px; color:#555; }
  .role-display .role-name { font-weight:600; color:#1a2e1a; margin-right:4px; }
  .role-display .role-arch { color:#888; font-size:10px; }

  /* ── Over Simulator (os) ── */
  .os-settings-row {
    display:flex; flex-wrap:wrap; gap:16px; align-items:flex-end;
    padding:16px 0 12px 0; border-bottom:1px solid #f0f0f0;
  }
  .os-players-row {
    display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end;
    padding:12px 0 16px 0;
  }
  .os-player-col { display:flex; flex-direction:column; gap:4px; flex:1; min-width:140px; }
  .os-player-label { font-size:11px; font-weight:600; color:rgba(250,247,240,0.75); letter-spacing:0.5px;
    text-transform:uppercase; }
  .os-btn-col { flex:0; align-self:flex-end; }
  .os-num-input { padding:7px 10px; border:1px solid #d0d0d0; border-radius:6px;
    font-size:13px; font-family:inherit; width:72px; }
  .os-num-sm { width:52px !important; }
  .os-score-row { display:flex; align-items:center; gap:6px; font-size:13px; color:#555; }
  .os-score-sep { font-size:16px; font-weight:600; color:#999; }

  .os-result-header { display:flex; flex-wrap:wrap; align-items:center; gap:12px;
    padding:14px 0 12px 0; border-bottom:1px solid #e8e8e8; margin-bottom:16px; }
  .os-result-over { font-size:13px; font-weight:700; color:#1a2e1a; }
  .os-result-matchup { font-size:12px; color:#666; flex:1; min-width:0; }
  .os-result-avg { font-size:12px; background:#f0f5f0; padding:5px 14px;
    border-radius:20px; color:#2d4a2d; white-space:nowrap; }

  .os-sim-card { background:white; border:1px solid #e8e8e8; border-radius:10px;
    margin-bottom:12px; overflow:hidden; }
  .os-sim-header { display:flex; align-items:center; gap:12px; padding:10px 14px;
    background:#f8f8f8; border-bottom:1px solid #f0f0f0; }
  .os-sim-num { font-size:10px; font-weight:700; color:#aaa; letter-spacing:0.6px;
    text-transform:uppercase; }
  .os-sim-score { font-size:14px; font-weight:700; color:#1a2e1a; }
  .os-sim-total { font-size:12px; color:#888; margin-left:auto; }

  .os-sim-badges { display:flex; flex-wrap:wrap; gap:6px; padding:12px 14px; align-items:center; }
  .os-outcome-badge { display:inline-block; padding:4px 9px; border-radius:6px;
    font-size:13px; font-weight:700; }
  .os-wkt-note { width:100%; font-size:11px; color:#c0392b; padding:2px 2px 0 2px;
    font-style:italic; margin-top:2px; }

  .os-avg-row { background:#1a2e1a; color:white; padding:14px 18px; border-radius:10px;
    display:flex; justify-content:space-between; align-items:center; margin-top:4px; }
  .os-avg-label { font-size:12px; color:rgba(255,255,255,0.65); }
  .os-avg-val { font-size:15px; font-weight:600; color:white; }

  /* ── Best Bowler tab ── */
  .bb-bowlers-grid {
    display:grid; grid-template-columns: repeat(5, 1fr); gap:10px;
    padding:12px 0 16px 0; border-top:1px solid #f0f0f0; margin-top:4px;
  }
  .bb-bowler-col { display:flex; flex-direction:column; gap:4px; }
  .bb-section-label {
    font-size:10px; font-weight:700; color:#888; letter-spacing:0.7px;
    text-transform:uppercase; padding:8px 0 4px 0;
  }
  .bb-results-table {
    width:100%; border-collapse:collapse; margin-top:8px; font-size:13px;
  }
  .bb-results-table th {
    background:#1a2e1a; color:white; padding:9px 12px; text-align:left;
    font-size:11px; font-weight:600; letter-spacing:0.5px;
    text-transform:uppercase;
  }
  .bb-results-table th.right, .bb-results-table td.right { text-align:right; }
  .bb-results-table th.center, .bb-results-table td.center { text-align:center; }
  .bb-results-table td { padding:9px 12px; border-bottom:1px solid #f0f0f0; }
  .bb-results-table tr:last-child td { border-bottom:none; }
  .bb-results-table tr:nth-child(even) { background:#fafafa; }
  .bb-results-table tr.bb-rank-1 { background:#fffde7; }
  .bb-results-table tr.bb-rank-2 { background:#f5f5f5; }
  .bb-results-table tr.bb-rank-3 { background:#fef6ee; }
  .bb-rank-badge {
    display:inline-block; width:22px; height:22px; border-radius:50%;
    text-align:center; line-height:22px; font-size:11px; font-weight:700;
    margin-right:6px;
  }
  .bb-rank-1 .bb-rank-badge { background:#f5c518; color:#5a4000; }
  .bb-rank-2 .bb-rank-badge { background:#b0b0b0; color:#fff; }
  .bb-rank-3 .bb-rank-badge { background:#cd7f32; color:#fff; }
  .bb-rank-other .bb-rank-badge { background:#e8e8e8; color:#666; }
  .bb-composite {
    font-weight:700; font-size:14px;
  }
  .bb-composite.good  { color:#1a7a1a; }
  .bb-composite.avg   { color:#8a5c00; }
  .bb-composite.poor  { color:#c0392b; }
  .bb-bowler-name { font-weight:600; }
  .bb-qual-tag { font-size:11px; color:#888; margin-left:4px; }
  .bb-note {
    font-size:11px; color:#888; padding:8px 0 4px 0; font-style:italic;
  }
  /* ── Match placeholder (Phase 3) ── */
  .match-placeholder { display:none; }

  /* ── Match header ── */
  .match-hdr {
    background:#1a2e1a; color:white; padding:16px 40px;
    display:grid; grid-template-columns:1fr auto 1fr; gap:16px;
    align-items:center; border-bottom:1px solid rgba(255,255,255,0.1);
  }
  .mhdr-team { display:flex; flex-direction:column; gap:3px; }
  .mhdr-team:last-child { text-align:right; }
  .mhdr-name { font-size:11px; font-weight:600; letter-spacing:0.8px;
    text-transform:uppercase; color:rgba(255,255,255,0.55); }
  .mhdr-score { font-size:26px; font-weight:700; color:white; line-height:1; }
  .mhdr-score-sub { font-size:11px; color:rgba(255,255,255,0.5); margin-top:2px; }
  .mhdr-mid { text-align:center; }
  .mhdr-inn { font-size:12px; font-weight:600; color:#c8842a;
    letter-spacing:0.5px; text-transform:uppercase; }
  .mhdr-over { font-size:11px; color:rgba(255,255,255,0.5); margin-top:2px; }
  .mhdr-rrr { font-size:11px; color:#f0c060; margin-top:2px; }

  /* ── Match body layout ── */
  .match-body { padding:20px 40px; max-width:1400px;
    display:grid; grid-template-columns:1.35fr 1fr; gap:24px; }
  .match-over-panel { display:flex; flex-direction:column; gap:16px; }

  /* ── Over setup panel ── */
  .setup-batters { display:flex; gap:16px; margin-bottom:16px; flex-wrap:wrap; }
  .setup-batter-card {
    background:#f8f8f8; border-radius:8px; padding:10px 14px;
    border:1px solid #e0e0e0; flex:1; min-width:140px;
  }
  .setup-batter-role { font-size:10px; font-weight:600; letter-spacing:0.6px;
    text-transform:uppercase; color:#888; margin-bottom:3px; }
  .setup-batter-name { font-size:14px; font-weight:600; color:#1a2e1a; }
  .setup-batter-score { font-size:12px; color:#666; margin-top:2px; }
  .setup-batter-card.striker { border-color:#2d4a2d; background:#f0f5f0; }

  .setup-bowler-row { display:flex; align-items:center; gap:12px;
    padding:10px 0; border-top:1px solid #f0f0f0; margin-top:4px; flex-wrap:wrap; }
  .setup-label { font-size:11px; font-weight:600; letter-spacing:0.6px;
    text-transform:uppercase; color:#888; min-width:70px; }
  .setup-select {
    padding:7px 28px 7px 10px; border:1px solid #d0d0d0; border-radius:6px;
    font-size:13px; background:white; appearance:none;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23666' d='M5 7L0 2h10z'/%3E%3C/svg%3E");
    background-repeat:no-repeat; background-position:right 8px center;
    min-width:160px; font-family:inherit; cursor:pointer;
  }
  .setup-select:focus { outline:none; border-color:#2d4a2d; }
  .setup-auto-tag {
    font-size:11px; color:#2d4a2d; background:#e8f5e8;
    padding:3px 8px; border-radius:10px; font-weight:500;
  }

  /* ── Over result area ── */
  .m-over-summary {
    display:grid; grid-template-columns:repeat(4,1fr);
    background:#1a2e1a; color:white; padding:12px 16px; gap:10px;
    border-radius:8px 8px 0 0;
  }
  .m-summary-label { font-size:10px; font-weight:600; letter-spacing:0.8px;
    text-transform:uppercase; color:rgba(255,255,255,0.5); margin-bottom:3px;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .m-summary-value { font-size:17px; font-weight:700; color:white; line-height:1; }
  .m-summary-sub { font-size:10px; color:rgba(255,255,255,0.45); margin-top:2px; }

  /* ── Scorecard ── */
  .sc-tab-bar { display:flex; border-bottom:1px solid #e8e8e8; }
  .sc-tab { padding:9px 16px; font-size:12px; font-weight:600; cursor:pointer;
    border-bottom:2px solid transparent; color:#888; transition:all 0.15s;
    background:none; border-top:none; border-left:none; border-right:none;
    font-family:inherit; }
  .sc-tab.active { color:#1a2e1a; border-bottom-color:#c8842a; }
  .sc-table { width:100%; border-collapse:collapse; font-size:12px; }
  .sc-table th { background:#f8f8f8; padding:7px 10px; text-align:right;
    font-size:10px; font-weight:600; letter-spacing:0.5px; color:#888;
    border-bottom:1px solid #e8e8e8; }
  .sc-table th:first-child { text-align:left; }
  .sc-table td { padding:7px 10px; border-bottom:1px solid #f5f5f5;
    text-align:right; color:#444; }
  .sc-table td:first-child { text-align:left; color:#1a2e1a; font-weight:500; }
  .sc-table tr:last-child td { border-bottom:none; }
  .sc-table .sc-active { font-style:italic; }
  .sc-table .sc-out { color:#888; }
  .sc-extras { padding:7px 10px; font-size:11px; color:#888;
    border-top:1px solid #f0f0f0; }
  .sc-fow { padding:8px 10px; font-size:11px; color:#666;
    border-top:1px solid #f0f0f0; }
  .sc-inn-header { padding:8px 10px; font-size:11px; font-weight:600;
    color:#555; background:#f8f8f8; border-bottom:1px solid #e8e8e8;
    letter-spacing:0.5px; text-transform:uppercase; }

  /* ── Next over actions ── */
  .m-actions { display:flex; gap:12px; align-items:center;
    padding:12px 0; flex-wrap:wrap; }
  .m-action-note { font-size:12px; color:#666; flex:1; }

  /* ── Wicket replacement ── */
  .wicket-replace-row { display:flex; align-items:center; gap:12px;
    padding:8px 0; border-bottom:1px solid #f0f0f0; }
  .wicket-replace-row:last-child { border-bottom:none; }
  .wicket-out-name { font-size:13px; color:#888; text-decoration:line-through;
    flex:1; }
  .wicket-in-label { font-size:11px; color:#666; white-space:nowrap; }

  /* ── Match end ── */
  .match-end-wrap { padding:60px 40px; text-align:center; max-width:600px; margin:0 auto; }
  .match-result-box { background:white; border-radius:16px; padding:40px;
    box-shadow:0 4px 24px rgba(0,0,0,0.1); border:1px solid #e8e8e8; }
  .match-result-title { font-size:24px; font-weight:700; color:#1a2e1a;
    margin-bottom:12px; }
  .match-result-detail { font-size:14px; color:#666; margin-bottom:8px; }
  .match-result-margin { font-size:16px; font-weight:600; color:#2d4a2d;
    margin-top:16px; }

</head>
<body>

<div class="header">
  <h1>Cricket Simulation \u00b7 Over Simulator</h1>
  <p>Simulate any over for any batter vs bowler matchup</p>
</div>
