:root{
      --gap: 10px;
      --bg: #1e1e2f;
      --bg2:#252538;
      --bg3:#29293f;
      --head:#2e2e4f;
      --pill:#444666;
      --pill-light:#505276;
      --pill-dark:#3f415f;
      --pill-on:#00aced;
      --result-draw:#8a6a22;
      --result-draw-text:#fff1b8;
      --text:#eee;
    }

    /* Layout & iOS scroll behavior hardening */
    html, body { height:100%; background:var(--bg); color:var(--text); }
    html, body { overscroll-behavior-y: auto; }
    body {
      font-family: Arial, sans-serif;
      padding:20px;
      text-align:center;
      font-size:14px;
      line-height:1.35;
      min-height:100dvh;
      -webkit-overflow-scrolling: touch;
    }
    #tableContainer, #regionalsContainer { overflow-anchor: none; }

    .site-header{
      width:100%;
      margin:0 auto 18px;
    }

    .brand-lockup{
      display:inline-flex;
      align-items:center;
      justify-content:center;
      gap:12px;
      margin:2px auto 8px;
      line-height:1;
    }

    .brand-logo{
      display:block;
      width:48px;
      height:48px;
      flex:0 0 48px;
      filter:drop-shadow(0 3px 8px rgba(0,172,237,0.18));
    }

    .brand-logo svg{
      display:block;
      width:100%;
      height:100%;
    }

    .brand-name{
      display:flex;
      align-items:baseline;
      gap:8px;
      color:#f4f6fb;
      font-size:34px;
      font-weight:800;
      letter-spacing:0.5px;
      white-space:nowrap;
    }

    .brand-name .tracker{
      color:var(--pill-on);
    }

    h1 {
      margin:0 0 10px;
      font-size:22px;
      font-weight:700;
      line-height:1.25;
    }

    .site-intro{
      width:90%;
      max-width:760px;
      margin:0 auto 18px;
      color:#d6d8e2;
      font-size:13px;
      line-height:1.5;
    }

    .controls { margin-bottom:20px; }
    .btn-group{
      display:flex; flex-wrap:wrap; justify-content:center;
      margin:10px -5px;
      gap:0;
    }
    .btn-group button{
      margin:5px;
      padding:6px 12px;
      border:none; border-radius:20px;
      background:var(--pill); color:#fff; cursor:pointer; font-size:14px;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
      transition: transform .06s ease;
    }
    .btn-group button:active { transform: scale(0.98); }
    @supports (gap: 10px){
      .btn-group{ margin:10px 0; gap: var(--gap); }
      .btn-group button{ margin:0; }
    }
    /* Alternate inactive shades by control row. The cyan selected state
       remains identical everywhere, so the colour meaning stays consistent. */
    #seasonButtons button:not(.selected),
    #countryButtons button:not(.selected),
    #leagueButtons button:not(.selected),
    #playerMarketButtons button:not(.selected),
    #typeButtons button:not(.selected) {
      background: var(--pill-light);
    }

    #regionButtons button:not(.selected),
    #modeButtons button:not(.selected),
    #bookieButtons button:not(.selected) {
      background: var(--pill-dark);
    }

    .btn-group button.selected { background:var(--pill-on); }

    /* Region -> country -> competition hierarchy. Country buttons are kept
       compact because this row is designed to scale to many more leagues. */
    #seasonButtons button,
    #countryButtons button,
    #leagueButtons button,
    #playerMarketButtons button,
    #typeButtons button {
      border-radius: 8px;
    }

    #regionButtons button,
    #modeButtons button,
    #bookieButtons button {
      border-radius: 999px;
    }

    #countryButtons{
      display:flex;
      flex-wrap:wrap;
      justify-content:center;
      align-items:center;
      gap:6px;
      margin-top:6px;
      margin-bottom:6px;
    }
    #countryButtons button{
      width:auto;
      min-width:0;
      padding:4px 7px;
      font-size:11px;
    }
    #countryButtons.uk-countries button{
      min-width:76px;
      padding-left:8px;
      padding-right:8px;
    }

    .country-button-content,
    .region-button-content{
      display:inline-flex;
      align-items:center;
      justify-content:center;
      gap:4px;
      white-space:nowrap;
    }

    .country-flag,
    .region-flag{
      display:block;
      width:18px;
      height:12px;
      flex:0 0 auto;
      overflow:hidden;
      border-radius:2px;
      box-shadow:0 0 0 1px rgba(255,255,255,0.28);
    }

    .country-flag svg,
    .region-flag svg{
      display:block;
      width:100%;
      height:100%;
    }


    /* Keep the UK competition selector on one row on phones. Europe switches
       to a clear three-column country grid instead of cramped abbreviations. */
    @media (max-width: 700px) {
      .site-header{
        margin-bottom:14px;
      }

      .brand-lockup{
        gap:9px;
        margin:0 auto 8px;
      }

      .brand-logo{
        width:39px;
        height:39px;
        flex-basis:39px;
      }

      .brand-name{
        gap:6px;
        font-size:26px;
        letter-spacing:0.25px;
      }

      h1{
        max-width:560px;
        margin:0 auto 10px;
        font-size:21px;
        line-height:1.25;
      }

      .site-intro{
        width:100%;
        margin-bottom:14px;
        padding:0 2px;
        box-sizing:border-box;
        font-size:12px;
      }

      #regionButtons .region-button-content{
        gap:5px;
      }

      #regionButtons .region-flag{
        width:16px;
        height:11px;
      }

      #countryButtons{
        width:min(100%, 430px);
        margin:8px auto;
        display:flex;
        flex-wrap:wrap;
        justify-content:center;
        gap:6px;
      }
      #countryButtons.uk-countries{
        flex-wrap:nowrap;
      }
      #countryButtons button{
        width:auto;
        min-width:0;
        padding:5px 7px;
        font-size:11px;
      }
      #countryButtons.europe-countries button,
      #countryButtons.world-countries button{
        flex:0 0 auto;
      }
      #countryButtons .country-flag{
        width:16px;
        height:11px;
      }

      #leagueButtons{
        flex-wrap:wrap;
        gap:6px;
        width:min(100%, 520px);
        margin:8px auto;
      }
      #leagueButtons button{
        flex:0 1 auto;
        min-width:0;
        padding:6px 8px;
        font-size:12px;
        white-space:nowrap;
      }
      #leagueButtons.england-leagues{
        flex-wrap:wrap;
        max-width:430px;
      }
      #leagueButtons.england-leagues button{
        padding:6px 7px;
        font-size:11px;
      }

      #tableContainer.top-scorer-mode{
        width:100%;
        max-width:none;
        overflow-x:hidden;
      }
      #handicapTable.top-scorer-table{
        width:100% !important;
        min-width:0 !important;
        table-layout:fixed !important;
      }
      #handicapTable.top-scorer-table th,
      #handicapTable.top-scorer-table td{
        padding:7px 5px !important;
        font-size:12.5px;
      }
      #handicapTable.top-scorer-table th:nth-child(1),
      #handicapTable.top-scorer-table td:nth-child(1){
        width:50% !important;
      }
      #handicapTable.top-scorer-table th:nth-child(2),
      #handicapTable.top-scorer-table td:nth-child(2){
        width:9% !important;
      }
      #handicapTable.top-scorer-table th:nth-child(3),
      #handicapTable.top-scorer-table td:nth-child(3){
        width:11% !important;
      }
      #handicapTable.top-scorer-table th:nth-child(4),
      #handicapTable.top-scorer-table td:nth-child(4){
        width:15% !important;
      }
      #handicapTable.top-scorer-table th:nth-child(5),
      #handicapTable.top-scorer-table td:nth-child(5){
        width:15% !important;
      }
      #handicapTable.top-scorer-table .top-scorer-meta{
        display:block;
        white-space:normal;
        line-height:1.3;
        font-size:11.5px;
      }
      #handicapTable.top-scorer-table .top-scorer-name{
        font-size:13.5px;
        line-height:1.25;
      }
      #handicapTable.top-scorer-table .top-scorer-name{
        display:block;
      }
      #handicapTable.top-scorer-table thead th.top-scorer-num{
        font-size:10px;
        letter-spacing:-0.1px;
      }
      #handicapTable.top-scorer-table tbody td.top-scorer-num{
        text-align:center !important;
      }

      #handicapTable.top-scorer-table.reduced-player-table th,
      #handicapTable.top-scorer-table.reduced-player-table td{
        padding:6px 7px !important;
      }
      #handicapTable.top-scorer-table.reduced-player-table th:nth-child(1),
      #handicapTable.top-scorer-table.reduced-player-table td:nth-child(1){
        width:82% !important;
        text-align:left !important;
      }
      #handicapTable.top-scorer-table.reduced-player-table th:nth-child(2),
      #handicapTable.top-scorer-table.reduced-player-table td:nth-child(2){
        width:18% !important;
        text-align:center !important;
      }
      #handicapTable.top-scorer-table.reduced-player-table .top-scorer-meta{
        display:block;
        font-size:12.5px;
        line-height:1.3;
        margin-top:2px;
      }
      #handicapTable.top-scorer-table.reduced-player-table th{
        font-size:13px !important;
      }
      #handicapTable.top-scorer-table.reduced-player-table td{
        font-size:13px !important;
      }
      #handicapTable.top-scorer-table.reduced-player-table .top-scorer-name{
        font-size:14px;
        line-height:1.25;
      }
      .competition-format-note{
      display:none;
      width:min(92%, 820px);
      margin:7px auto 0;
      padding:0 6px;
      box-sizing:border-box;
      color:#c9cbe0;
      font-size:11.5px;
      line-height:1.4;
      text-align:center;
    }
    .competition-format-note.is-visible{
      display:block;
    }
    @media (max-width:700px){
      .competition-format-note{
        width:100%;
        margin-top:8px;
        padding:0 8px;
        font-size:12px;
        line-height:1.45;
      }
    }

    .top-scorer-note{
        width:100%;
        max-width:none;
        margin:8px auto 0;
        padding:0 4px;
        box-sizing:border-box;
        font-size:10px;
        text-align:center;
      }
    }

    .bookie-note{
      display:none;
      margin: -4px auto 12px;
      width: 90%;
      max-width: 700px;
      color:#cfd3e0;
      font-size:12px;
      opacity:0.85;
    }

    #placeholder { padding:40px; color:#ccc; font-size:16px; }

    #tableContainer { width:90%; max-width:700px; margin:0 auto; overflow-x:auto; }
    #tableContainer.top-scorer-mode { max-width:1040px; }

    .top-scorer-note{
      display:none;
      width:90%;
      max-width:980px;
      margin:9px auto 0;
      color:#cfd3e0;
      font-size:11px;
      line-height:1.35;
      text-align:center;
      opacity:0.82;
    }
    .top-scorer-note.is-visible{
      display:block;
    }
    .top-scorer-name{
      color:#fff;
      font-weight:600;
    }
    .top-scorer-meta{
      display:none;
      margin-top:2px;
      color:#cfd3e0;
      font-size:10px;
      font-weight:400;
    }
    .xg-positive{ color:#76e3a5; font-weight:600; }
    .xg-negative{ color:#ff8e9b; font-weight:600; }
    .xg-level{ color:#d7d9e3; }
    #handicapTable.top-scorer-table tbody tr.top-scorer-leader{
      background:#34345c !important;
    }
    #handicapTable.top-scorer-table{
      table-layout:fixed;
    }
    #handicapTable.top-scorer-table th,
    #handicapTable.top-scorer-table td{
      box-sizing:border-box;
      vertical-align:middle;
    }
    #handicapTable.top-scorer-table th.top-scorer-num,
    #handicapTable.top-scorer-table td.top-scorer-num{
      text-align:center !important;
      font-variant-numeric:tabular-nums;
    }
    #handicapTable.top-scorer-table th.top-scorer-player,
    #handicapTable.top-scorer-table td.top-scorer-player,
    #handicapTable.top-scorer-table th.top-scorer-team,
    #handicapTable.top-scorer-table td.top-scorer-team{
      text-align:left !important;
      white-space:normal;
    }
    #handicapTable.top-scorer-table th.top-scorer-num,
    #handicapTable.top-scorer-table td.top-scorer-num{
      padding-left:6px !important;
      padding-right:6px !important;
    }

    table.dataTable { border-collapse:collapse; width:100% !important; }
    table.dataTable thead { background:var(--head); }
    table.dataTable tbody tr:nth-child(odd)  { background:var(--bg3); }
    table.dataTable tbody tr:nth-child(even) { background:var(--bg2); }
    table.dataTable th, table.dataTable td {
      color:#fff; padding:4px !important; font-size:12.5px; text-align:center; white-space:nowrap;
    }

    .text-left { text-align:left !important; }

    /* Standard league and handicap table alignment.
       DataTables no longer creates separate scrolling header/body tables;
       the normal table and its headings therefore share the exact same grid. */
    #handicapTable.standard-table,
    #handicapTable.handicap-table{
      width:100% !important;
      table-layout:fixed !important;
    }

    #handicapTable.standard-table th,
    #handicapTable.standard-table td,
    #handicapTable.handicap-table th,
    #handicapTable.handicap-table td{
      box-sizing:border-box;
      vertical-align:middle;
    }

    #handicapTable.standard-table th.standard-num,
    #handicapTable.standard-table td.standard-num,
    #handicapTable.handicap-table th.handicap-num,
    #handicapTable.handicap-table td.handicap-num{
      text-align:center !important;
      font-variant-numeric:tabular-nums;
    }

    #handicapTable.standard-table th.standard-team,
    #handicapTable.standard-table td.standard-team,
    #handicapTable.handicap-table th.handicap-team,
    #handicapTable.handicap-table td.handicap-team{
      text-align:left !important;
    }

    @media (min-width: 701px) {
      #tableContainer.standard-table-mode{
        width:82%;
        max-width:740px;
        overflow-x:auto;
      }

      #tableContainer.handicap-table-mode{
        width:90%;
        max-width:960px;
        overflow-x:auto;
      }

      #tableContainer.standard-table-mode .dataTables_wrapper,
      #tableContainer.handicap-table-mode .dataTables_wrapper{
        width:100% !important;
      }

      #handicapTable.standard-table{
        min-width:680px;
      }

      #handicapTable.handicap-table{
        min-width:860px;
      }

      #handicapTable.standard-table th,
      #handicapTable.standard-table td,
      #handicapTable.handicap-table th,
      #handicapTable.handicap-table td{
        padding:5px 5px !important;
        font-size:13px;
      }
    }

    @media (max-width: 700px) {
      #tableContainer.standard-table-mode,
      #tableContainer.handicap-table-mode{
        width:100%;
        max-width:none;
        overflow-x:hidden;
      }

      #handicapTable.standard-table,
      #handicapTable.handicap-table{
        min-width:0 !important;
        width:100% !important;
      }

      #handicapTable.standard-table th,
      #handicapTable.standard-table td,
      #handicapTable.handicap-table th,
      #handicapTable.handicap-table td{
        padding:7px 5px !important;
        font-size:12.5px;
      }

      #handicapTable.standard-table td.standard-team,
      #handicapTable.handicap-table td.handicap-team{
        font-size:13px;
      }
    }

    /* Top-goalscorer desktop alignment.
       These rules intentionally come after the generic handicap-table column
       rules so they win the cascade and keep every value under its heading. */
    @media (min-width: 701px) {
      #tableContainer.top-scorer-mode{
        width:90%;
        max-width:980px;
        overflow-x:visible;
      }

      #tableContainer.top-scorer-mode.reduced-player-mode{
        width:82%;
        max-width:700px;
      }

      #tableContainer.top-scorer-mode .dataTables_wrapper{
        width:100% !important;
      }

      #handicapTable.top-scorer-table{
        width:100% !important;
        min-width:900px;
        table-layout:fixed !important;
      }

      #handicapTable.top-scorer-table th,
      #handicapTable.top-scorer-table td{
        padding:6px 8px !important;
        font-size:12.5px;
        vertical-align:middle;
      }

      #handicapTable.top-scorer-table th:nth-child(1),
      #handicapTable.top-scorer-table td:nth-child(1){
        width:5% !important;
        text-align:center !important;
      }

      #handicapTable.top-scorer-table th:nth-child(2),
      #handicapTable.top-scorer-table td:nth-child(2){
        width:22% !important;
        text-align:left !important;
      }

      #handicapTable.top-scorer-table th:nth-child(3),
      #handicapTable.top-scorer-table td:nth-child(3){
        width:19% !important;
        text-align:left !important;
      }

      #handicapTable.top-scorer-table th:nth-child(4),
      #handicapTable.top-scorer-table td:nth-child(4){
        width:5% !important;
      }

      #handicapTable.top-scorer-table th:nth-child(5),
      #handicapTable.top-scorer-table td:nth-child(5){
        width:6% !important;
      }

      #handicapTable.top-scorer-table th:nth-child(6),
      #handicapTable.top-scorer-table td:nth-child(6){
        width:7% !important;
      }

      #handicapTable.top-scorer-table th:nth-child(7),
      #handicapTable.top-scorer-table td:nth-child(7){
        width:8% !important;
      }

      #handicapTable.top-scorer-table th:nth-child(8),
      #handicapTable.top-scorer-table td:nth-child(8){
        width:7% !important;
      }

      #handicapTable.top-scorer-table th:nth-child(9),
      #handicapTable.top-scorer-table td:nth-child(9){
        width:7% !important;
      }

      #handicapTable.top-scorer-table th:nth-child(10),
      #handicapTable.top-scorer-table td:nth-child(10){
        width:8% !important;
      }

      #handicapTable.top-scorer-table th:nth-child(11),
      #handicapTable.top-scorer-table td:nth-child(11){
        width:6% !important;
      }

      #handicapTable.top-scorer-table th:nth-child(n+4),
      #handicapTable.top-scorer-table td:nth-child(n+4){
        text-align:center !important;
        font-variant-numeric:tabular-nums;
      }

      #handicapTable.top-assists-table th:nth-child(1),
      #handicapTable.top-assists-table td:nth-child(1){ width:5% !important; }
      #handicapTable.top-assists-table th:nth-child(2),
      #handicapTable.top-assists-table td:nth-child(2){ width:22% !important; }
      #handicapTable.top-assists-table th:nth-child(3),
      #handicapTable.top-assists-table td:nth-child(3){ width:20% !important; }
      #handicapTable.top-assists-table th:nth-child(4),
      #handicapTable.top-assists-table td:nth-child(4){ width:6% !important; }
      #handicapTable.top-assists-table th:nth-child(5),
      #handicapTable.top-assists-table td:nth-child(5){ width:8% !important; }
      #handicapTable.top-assists-table th:nth-child(6),
      #handicapTable.top-assists-table td:nth-child(6){ width:9% !important; }
      #handicapTable.top-assists-table th:nth-child(7),
      #handicapTable.top-assists-table td:nth-child(7){ width:8% !important; }
      #handicapTable.top-assists-table th:nth-child(8),
      #handicapTable.top-assists-table td:nth-child(8){ width:8% !important; }
      #handicapTable.top-assists-table th:nth-child(9),
      #handicapTable.top-assists-table td:nth-child(9){ width:8% !important; }
      #handicapTable.top-assists-table th:nth-child(10),
      #handicapTable.top-assists-table td:nth-child(10){ width:6% !important; }

      #handicapTable.golden-glove-table th:nth-child(1),
      #handicapTable.golden-glove-table td:nth-child(1){ width:5% !important; }
      #handicapTable.golden-glove-table th:nth-child(2),
      #handicapTable.golden-glove-table td:nth-child(2){ width:22% !important; }
      #handicapTable.golden-glove-table th:nth-child(3),
      #handicapTable.golden-glove-table td:nth-child(3){ width:18% !important; }
      #handicapTable.golden-glove-table th:nth-child(4),
      #handicapTable.golden-glove-table td:nth-child(4){ width:6% !important; }
      #handicapTable.golden-glove-table th:nth-child(5),
      #handicapTable.golden-glove-table td:nth-child(5){ width:7% !important; }
      #handicapTable.golden-glove-table th:nth-child(6),
      #handicapTable.golden-glove-table td:nth-child(6){ width:8% !important; }
      #handicapTable.golden-glove-table th:nth-child(7),
      #handicapTable.golden-glove-table td:nth-child(7){ width:7% !important; }
      #handicapTable.golden-glove-table th:nth-child(8),
      #handicapTable.golden-glove-table td:nth-child(8){ width:8% !important; }
      #handicapTable.golden-glove-table th:nth-child(9),
      #handicapTable.golden-glove-table td:nth-child(9){ width:9% !important; }
      #handicapTable.golden-glove-table th:nth-child(10),
      #handicapTable.golden-glove-table td:nth-child(10){ width:10% !important; }

      #handicapTable.top-scorer-table.reduced-player-table{
        min-width:0;
      }
      #handicapTable.top-scorer-table.reduced-player-table th:nth-child(1),
      #handicapTable.top-scorer-table.reduced-player-table td:nth-child(1){
        width:8% !important;
        text-align:center !important;
      }
      #handicapTable.top-scorer-table.reduced-player-table th:nth-child(2),
      #handicapTable.top-scorer-table.reduced-player-table td:nth-child(2){
        width:36% !important;
        text-align:left !important;
      }
      #handicapTable.top-scorer-table.reduced-player-table th:nth-child(3),
      #handicapTable.top-scorer-table.reduced-player-table td:nth-child(3){
        width:44% !important;
        text-align:left !important;
      }
      #handicapTable.top-scorer-table.reduced-player-table th:nth-child(4),
      #handicapTable.top-scorer-table.reduced-player-table td:nth-child(4){
        width:12% !important;
        text-align:center !important;
      }
      #handicapTable.top-scorer-table.reduced-player-table th{
        font-size:13px !important;
      }
      #handicapTable.top-scorer-table.reduced-player-table td{
        font-size:13px !important;
      }
    }

    #regionalsContainer { width:90%; max-width:700px; margin:0 auto; text-align:left; display:none; }
    #regionalsContainer h3 { margin:18px 0 8px; color:#aee1ff; text-align:center; font-weight:600; }
    #regionalsContainer table { margin:0 auto 16px; width:100% !important; }
    #regionalsContainer table.dataTable th:nth-child(2),
    #regionalsContainer table.dataTable td:nth-child(2) { text-align:left; }
    #regionalsContainer table.dataTable th:nth-child(3),
    #regionalsContainer table.dataTable td:nth-child(3) { text-align:center; }

    @media (max-width:700px){
      #regionalsContainer table.dataTable th,
      #regionalsContainer table.dataTable td{
        font-size:12.5px;
        padding:7px 5px !important;
      }
      #regionalsContainer table.dataTable td:nth-child(2){
        font-size:13px;
      }
    }

    .site-footer{
      margin-top: 32px;
      padding: 16px 0 28px;
      background: #161625;
      color: #cfd3e0;
      border-top: 1px solid rgba(255,255,255,0.06);
    }
    .site-footer .inner{
      width: 90%;
      max-width: 700px;
      margin: 0 auto;
      text-align: center;
    }
    .site-footer .season{
      display: block;
      margin-top: 6px;
      font-size: 12px;
      opacity: 0.85;
    }
    .site-footer .contact-note{
      margin: 0 0 8px;
      font-size: 13px;
    }
    .site-footer .footer-links{
      display:flex;
      align-items:center;
      justify-content:center;
      gap:8px;
      margin:0 0 10px;
      font-size:13px;
    }
    .site-footer a.mail,
    .site-footer .about-link{
      border:0;
      padding:0;
      background:none;
      color:#aee1ff;
      text-decoration:none;
      font:inherit;
      font-weight:600;
      cursor:pointer;
    }
    .site-footer a.mail:hover,
    .site-footer .about-link:hover{ text-decoration:underline; }

    .about-dialog{
      width:min(92vw, 720px);
      max-height:min(86vh, 760px);
      padding:0;
      border:1px solid rgba(255,255,255,0.12);
      border-radius:16px;
      background:#202034;
      color:#eef0f6;
      box-shadow:0 24px 80px rgba(0,0,0,0.55);
    }
    .about-dialog::backdrop{
      background:rgba(8,8,18,0.76);
      backdrop-filter:blur(3px);
    }
    .about-dialog-card{
      position:relative;
      max-height:min(86vh, 760px);
      overflow-y:auto;
      padding:28px 30px 30px;
      box-sizing:border-box;
      text-align:left;
    }
    .about-dialog h2{
      margin:0 42px 18px 0;
      color:#fff;
      font-size:24px;
      line-height:1.2;
    }
    .about-dialog p{
      margin:0 0 15px;
      color:#d7d9e4;
      font-size:14px;
      line-height:1.62;
    }
    .about-dialog p:last-of-type{ margin-bottom:0; }
    .about-dialog a{
      color:#aee1ff;
      font-weight:600;
      text-decoration:none;
    }
    .about-dialog a:hover{ text-decoration:underline; }
    .about-dialog-close{
      position:absolute;
      top:16px;
      right:16px;
      width:34px;
      height:34px;
      border:0;
      border-radius:50%;
      background:#3f415f;
      color:#fff;
      font-size:22px;
      line-height:1;
      cursor:pointer;
    }
    .about-dialog-close:hover{ background:#505276; }
    @media (max-width:700px){
      .about-dialog{
        width:calc(100vw - 24px);
        max-height:88vh;
        border-radius:14px;
      }
      .about-dialog-card{
        max-height:88vh;
        padding:24px 20px 26px;
      }
      .about-dialog h2{ font-size:21px; }
      .about-dialog p{ font-size:13px; }
    }
    .site-footer .ppg-note{
     display:block;
     margin-top:4px;
     font-size:11px;
     opacity:0.7;
    }


    /* Favourite team feature */
    table.dataTable th.star-cell,
    table.dataTable td.star-cell{
      width:4% !important;
      min-width:0 !important;
      max-width:none !important;
      padding-left:1px !important;
      padding-right:1px !important;
      text-align:center !important;
      box-sizing:border-box;
    }
    table.dataTable th.star-cell{
      color:#bfc3d3;
      font-size:9px !important;
      font-weight:600;
      letter-spacing:-0.15px;
      cursor:default;
    }
    table.dataTable td.star-cell{ cursor:pointer; }
    @media (max-width:700px){
      table.dataTable th.star-cell,
      table.dataTable td.star-cell{
        width:7% !important;
      }
    }
    .star-cell .star{
      display:inline-block;
      min-width:16px;
      color:#666;
      font-size:14px;
      line-height:1;
      cursor:pointer;
    }
    tr.fav-row   { background:#343450!important; }
    tr.fav-row .star { color:#ffd23f; }


/* Player competitions with minutes but no xG
   (currently Eerste Divisie and Chinese Super League). Keep this separate from both the full xG
   layout and the reduced goals-only layout. */
@media (min-width: 701px) {
  #tableContainer.top-scorer-mode.minutes-player-mode{
    width:90%;
    max-width:900px;
  }

  #handicapTable.top-scorer-table.minutes-player-table{
    min-width:760px;
  }

  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(1),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(1){
    width:6% !important;
    text-align:center !important;
  }
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(2),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(2){
    width:24% !important;
    text-align:left !important;
  }
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(3),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(3){
    width:24% !important;
    text-align:left !important;
  }
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(4),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(4){
    width:7% !important;
  }
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(5),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(5){
    width:8% !important;
  }
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(6),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(6){
    width:9% !important;
  }
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(7),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(7){
    width:11% !important;
  }
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(8),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(8){
    width:11% !important;
  }
}

@media (max-width: 700px) {
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(1),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(1){
    width:57% !important;
    text-align:left !important;
  }
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(2),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(2){
    width:12% !important;
    text-align:center !important;
  }
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(3),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(3){
    width:14% !important;
    text-align:center !important;
  }
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(4),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(4){
    width:17% !important;
    text-align:center !important;
  }
}


/* ───────────────── Grouped / automatic split-phase league tables ─────────────────
   Keep these visually consistent with BetTracker's ordinary league tables. */
#splitTablesContainer {
  display: none;
  width: 100%;
}

#splitTablesContainer.is-visible {
  display: block;
}

.split-table-section {
  margin: 0 0 22px;
}

.split-table-heading {
  margin: 0 0 8px;
  padding: 0;
  color: #fff;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
  text-align: center;
}

.split-table-scroll {
  width: 100%;
  overflow-x: hidden;
}

.split-phase-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.split-phase-table thead {
  background: var(--head);
}

.split-phase-table tbody tr:nth-child(odd) {
  background: var(--bg3);
}

.split-phase-table tbody tr:nth-child(even) {
  background: var(--bg2);
}

.split-phase-table th,
.split-phase-table td {
  box-sizing: border-box;
  padding: 5px 5px !important;
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.split-phase-table th {
  font-weight: 700;
}

.split-phase-table .split-team-cell {
  text-align: left;
}

/* Desktop widths mirror the normal standard-table grid. */
@media (min-width: 701px) {
  .split-phase-table th:nth-child(1),
  .split-phase-table td:nth-child(1) { width: 4%; }
  .split-phase-table th:nth-child(2),
  .split-phase-table td:nth-child(2) { width: 7%; }
  .split-phase-table th:nth-child(3),
  .split-phase-table td:nth-child(3) { width: 26%; }
  .split-phase-table th:nth-child(4),
  .split-phase-table td:nth-child(4),
  .split-phase-table th:nth-child(5),
  .split-phase-table td:nth-child(5),
  .split-phase-table th:nth-child(6),
  .split-phase-table td:nth-child(6),
  .split-phase-table th:nth-child(7),
  .split-phase-table td:nth-child(7),
  .split-phase-table th:nth-child(8),
  .split-phase-table td:nth-child(8),
  .split-phase-table th:nth-child(9),
  .split-phase-table td:nth-child(9) { width: 7%; }
  .split-phase-table th:nth-child(10),
  .split-phase-table td:nth-child(10),
  .split-phase-table th:nth-child(11),
  .split-phase-table td:nth-child(11) { width: 10.5%; }
}

/* Completed earlier stages sit beneath the live/current groups, just as on
   upstream, but retain the same table styling. */
.split-table-completed-start {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.09);
}

/* Existing automatic split renderer uses this for its frozen regular table. */
.split-table-legacy {
  margin-top: 28px;
}

.split-table-legacy .split-table-heading {
  font-size: 15px;
}

@media (max-width: 700px) {
  .split-table-section {
    margin-bottom: 18px;
  }

  .split-table-heading {
    margin-bottom: 7px;
    font-size: 15px;
  }

  .split-phase-table th,
  .split-phase-table td {
    padding: 7px 5px !important;
    font-size: 12.5px;
  }

  .split-phase-table td.split-team-cell {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .split-phase-table th:nth-child(1),
  .split-phase-table td:nth-child(1) { width: 7%; }
  .split-phase-table th:nth-child(2),
  .split-phase-table td:nth-child(2) { width: 9%; }
  .split-phase-table th:nth-child(3),
  .split-phase-table td:nth-child(3) { width: 36%; }
  .split-phase-table th:nth-child(4),
  .split-phase-table td:nth-child(4),
  .split-phase-table th:nth-child(5),
  .split-phase-table td:nth-child(5),
  .split-phase-table th:nth-child(6),
  .split-phase-table td:nth-child(6) { width: 16%; }

  .split-table-completed-start {
    margin-top: 26px;
    padding-top: 20px;
  }
}


/* ───────────────── League position cut-off markers ─────────────────
   No coloured zones: just restrained separators.
   Automatic promotion/relegation = clearer dashed line.
   Play-off boundary = softer dotted line.
   Regular-phase split boundary = neutral subtle dashed line. */
#handicapTable.standard-table tbody tr.table-cutoff-automatic td,
.split-phase-table tbody tr.table-cutoff-automatic td {
  border-top: 1px dashed rgba(218, 222, 232, 0.66) !important;
}

#handicapTable.standard-table tbody tr.table-cutoff-playoff td,
.split-phase-table tbody tr.table-cutoff-playoff td {
  border-top: 1px dotted rgba(188, 194, 208, 0.43) !important;
}

#handicapTable.standard-table tbody tr.table-cutoff-split td,
.split-phase-table tbody tr.table-cutoff-split td {
  border-top: 1px dashed rgba(190, 196, 209, 0.50) !important;
}

/* Fallback for a future marker without an explicit kind. */
#handicapTable.standard-table tbody tr.table-cutoff-before:not(.table-cutoff-automatic):not(.table-cutoff-playoff):not(.table-cutoff-split) td,
.split-phase-table tbody tr.table-cutoff-before:not(.table-cutoff-automatic):not(.table-cutoff-playoff):not(.table-cutoff-split) td {
  border-top: 1px dashed rgba(210, 214, 224, 0.58) !important;
}

@media (max-width: 700px) {
  #handicapTable.standard-table tbody tr.table-cutoff-automatic td,
  .split-phase-table tbody tr.table-cutoff-automatic td {
    border-top-color: rgba(226, 229, 237, 0.76) !important;
  }

  #handicapTable.standard-table tbody tr.table-cutoff-playoff td,
  .split-phase-table tbody tr.table-cutoff-playoff td {
    border-top-color: rgba(199, 204, 216, 0.52) !important;
  }

  #handicapTable.standard-table tbody tr.table-cutoff-split td,
  .split-phase-table tbody tr.table-cutoff-split td {
    border-top-color: rgba(207, 212, 223, 0.60) !important;
  }
}


/* ───────────────── Separate tournament / final-stage views ───────────────── */
#tournamentButtons,
#tableStageButtons,
#playerTournamentButtons {
  display: none;
  margin-top: 6px;
  margin-bottom: 6px;
}

#tournamentButtons button,
#tableStageButtons button,
#playerTournamentButtons button {
  padding: 5px 11px;
  font-size: 12px;
}

#tournamentButtons button:not(.selected),
#playerTournamentButtons button:not(.selected) { background: var(--pill-light); }
#tableStageButtons button:not(.selected) { background: var(--pill-dark); }

.final-stage-view {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
}

.final-stage-champion {
  margin: 0 auto 18px;
  padding: 9px 12px;
  background: var(--head);
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
}

.final-stage-round { margin: 0 0 22px; }
.final-stage-round h3 {
  margin: 0 0 8px;
  color: #fff;
  text-align: center;
  font-size: 15px;
}

.final-stage-tie {
  margin: 0 0 8px;
  overflow: hidden;
  background: var(--bg2);
  border-radius: 7px;
}
.final-stage-tie:nth-of-type(even) { background: var(--bg3); }

.final-stage-aggregate {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--head);
  text-align: center;
  font-size: 13px;
}
.final-stage-aggregate strong:first-child { text-align: right; }
.final-stage-aggregate strong:last-child { text-align: left; }
.final-stage-aggregate span {
  min-width: 46px;
  font-size: 14px;
  font-weight: 700;
}

.final-stage-leg {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  padding: 6px 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 12px;
}
.final-stage-leg span { color: #cfd3e0; opacity: 0.78; }
.final-stage-leg strong { font-weight: 500; }
.final-stage-decider {
  padding: 6px 12px 8px;
  color: #cfd3e0;
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
}

@media (max-width:700px) {
  #tournamentButtons, #tableStageButtons, #playerTournamentButtons { gap: 6px; }
  #tournamentButtons button, #tableStageButtons button, #playerTournamentButtons button {
    padding: 5px 9px;
    font-size: 11.5px;
  }
  .final-stage-view { max-width: none; }
  .final-stage-aggregate {
    gap: 6px;
    padding: 8px 7px;
    font-size: 11.5px;
  }
  .final-stage-aggregate span { min-width: 38px; font-size: 12.5px; }
  .final-stage-leg {
    grid-template-columns: 45px 1fr;
    padding: 6px 8px;
    font-size: 11px;
  }
}

/* ───────────────── Team xG v1 ─────────────────
   Mobile-first: never hide xG fields. Use compact sub-tabs instead. */
#xgViewButtons,
#xgWindowButtons {
  display:none;
  margin-top:6px;
  margin-bottom:6px;
}

#xgViewButtons button,
#xgWindowButtons button {
  padding:5px 11px;
  font-size:12px;
}

#xgViewButtons button:not(.selected) { background:var(--pill-light); }
#xgWindowButtons button:not(.selected) { background:var(--pill-dark); }

.xg-note{
  display:none;
  width:90%;
  max-width:760px;
  margin:9px auto 0;
  color:#cfd3e0;
  font-size:11px;
  line-height:1.4;
  text-align:center;
  opacity:0.82;
}
.xg-note.is-visible{ display:block; }

#tableContainer.xg-table-mode{
  width:82%;
  max-width:760px;
  overflow-x:hidden;
}

#handicapTable.xg-table{
  width:100% !important;
  min-width:0 !important;
  table-layout:fixed !important;
}

#handicapTable.xg-table th,
#handicapTable.xg-table td{
  box-sizing:border-box;
  vertical-align:middle;
  padding:6px 7px !important;
  font-size:13px;
}
#handicapTable.xg-table th{font-size:14px;}

#handicapTable.xg-table th.xg-team,
#handicapTable.xg-table td.xg-team{
  text-align:left !important;
  white-space:normal;
}

#handicapTable.xg-table th.xg-num,
#handicapTable.xg-table td.xg-num{
  text-align:center !important;
  font-variant-numeric:tabular-nums;
}

@media (max-width:700px){
  #xgViewButtons,
  #xgWindowButtons{
    gap:6px;
  }
  #xgViewButtons button,
  #xgWindowButtons button{
    padding:5px 9px;
    font-size:11.5px;
  }

  #tableContainer.xg-table-mode{
    width:100%;
    max-width:none;
    overflow-x:hidden;
  }

  #handicapTable.xg-table th,
  #handicapTable.xg-table td{
    padding:7px 5px !important;
    font-size:12.5px;
  }
  #handicapTable.xg-table th{font-size:13px;}

  #handicapTable.xg-table td.xg-team{
    font-size:13px;
  }

  .xg-note{
    width:100%;
    padding:0 8px;
    box-sizing:border-box;
    font-size:10.5px;
  }
}

.xg-team-name{ display:block; }
.xg-team-meta{
  display:block;
  margin-top:1px;
  color:#cfd3e0;
  font-size:10px;
  font-weight:400;
  opacity:0.78;
}
@media (max-width:700px){
  .xg-team-meta{ font-size:10.5px; }
}


/* ───────────────── Team / fixture analysis ─────────────────
   Production additions layered over the current BetTracker stylesheet. */

#tableInsightButtons{
  display:none;
  margin-top:6px;
  margin-bottom:6px;
}
#tableInsightButtons button{
  padding:5px 11px;
  font-size:12px;
}
#tableInsightButtons button:not(.selected){ background:var(--pill-dark); }

.desktop-only-label{display:inline;}
.mobile-only-label{display:none;}

#tableInsightContainer,
#experimentalTeamView{
  display:none;
  width:82%;
  max-width:760px;
  margin:0 auto;
  text-align:left;
}
#tableInsightContainer.is-visible,
#experimentalTeamView.is-visible{ display:block; }

.insight-panel,
.team-view-panel{
  width:100%;
  overflow:hidden;
  background:var(--bg2);
  border-radius:8px;
  border:1px solid rgba(255,255,255,.055);
}
.insight-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:9px 10px;
  background:var(--head);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.insight-title{font-size:14px;font-weight:700;color:#fff;}
.insight-note{font-size:10.5px;color:#cfd3e0;opacity:.8;text-align:right;}

.insight-table,
.team-match-table{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
}
.insight-table thead,
.team-match-table thead{background:var(--head);}
.insight-table tbody tr:nth-child(odd),
.team-match-table tbody tr:nth-child(odd){background:var(--bg3);}
.insight-table tbody tr:nth-child(even),
.team-match-table tbody tr:nth-child(even){background:var(--bg2);}
.insight-table th,.insight-table td,
.team-match-table th,.team-match-table td{
  box-sizing:border-box;
  padding:6px 7px;
  color:#fff;
  font-size:12.5px;
  line-height:1.3;
  vertical-align:middle;
  white-space:nowrap;
  border-bottom:1px solid rgba(255,255,255,.035);
  font-variant-numeric:tabular-nums;
}
.insight-table th,.team-match-table th{font-size:12px;font-weight:700;}
.insight-table .rank-col{width:8%;text-align:center;color:#d7d9e3;}
.insight-table .team-col{width:42%;text-align:left;}
.insight-table .metric-col{text-align:center;}
.insight-table.strength-view .metric-col{width:25%;}
.insight-table.form-view .rank-col{width:7%;}
.insight-table.form-view .team-col{width:33%;}
.insight-table.form-view .metric-col{width:12%;}

.insight-sort{
  border:0;
  padding:0;
  background:none;
  color:inherit;
  font:inherit;
  font-weight:700;
  cursor:pointer;
}
.insight-sort:hover,.insight-sort:focus,
.insight-sort.is-active{color:#67d9f4;outline:none;text-decoration:underline;}
.insight-team-button,
.team-opponent-button{
  border:0;
  padding:0;
  background:none;
  color:#fff;
  font:inherit;
  font-weight:600;
  cursor:pointer;
  text-align:left;
}
.insight-team-button:hover,.insight-team-button:focus,
.team-opponent-button:hover,.team-opponent-button:focus{
  color:#67d9f4;
  text-decoration:underline;
  outline:none;
}

.insight-foot{
  padding:7px 10px 8px;
  color:#cfd3e0;
  font-size:10px;
  line-height:1.35;
  opacity:.78;
  text-align:center;
}

/* The normal production standings remain visually unchanged; team cells simply
   become an unobtrusive drill-down target in the team drill-down. */
body.team-drilldown-active #handicapTable.standard-table td.standard-team{
  cursor:pointer;
  font-weight:600;
}
body.team-drilldown-active #handicapTable.standard-table td.standard-team:hover{
  color:#67d9f4;
  text-decoration:underline;
}

.team-view-header{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:10px;
  margin:0 0 9px;
}
.team-view-kicker{color:var(--pill-on);font-size:11px;font-weight:700;}
.team-view-name{margin:1px 0 0;color:#fff;font-size:23px;line-height:1.2;}
.team-back{
  border:0;
  border-radius:8px;
  padding:6px 10px;
  background:var(--pill-light);
  color:#fff;
  font-size:11px;
  font-weight:700;
  cursor:pointer;
}
.team-back:hover{background:#5a5d82;}

.team-stat-grid{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:6px;
  margin:0 0 8px;
}
.team-stat-card,
.team-strength-card{
  min-width:0;
  padding:8px 9px;
  background:var(--bg3);
  border:1px solid rgba(255,255,255,.055);
  border-radius:7px;
}
.team-stat-key,
.team-strength-key{
  color:#cfd3e0;
  font-size:9px;
  line-height:1.15;
  text-transform:uppercase;
  letter-spacing:.03em;
  opacity:.78;
}
.team-stat-value,
.team-strength-value{
  margin-top:2px;
  color:#fff;
  font-size:17px;
  line-height:1.1;
  font-weight:800;
}
.team-stat-sub,
.team-strength-sub{
  display:block;
  margin-top:2px;
  color:#cfd3e0;
  font-size:9.5px;
  opacity:.75;
}
.team-form-strip{display:flex;gap:3px;margin-top:4px;}
.team-form-chip{
  min-width:19px;
  padding:2px 4px;
  border-radius:4px;
  text-align:center;
  font-size:9px;
  font-weight:800;
}
.team-form-chip.w{background:#1f7054;color:#d9fff0;}
.team-form-chip.d{background:var(--result-draw);color:var(--result-draw-text);}
.team-form-chip.l{background:#743b48;color:#ffdce3;}
.team-strength-grid{
  display:grid;
  grid-template-columns:minmax(0,1.3fr) minmax(0,1.3fr) minmax(0,.9fr) minmax(0,.9fr);
  gap:6px;
  margin:0 0 10px;
}
.team-strength-card{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.team-strength-card>div:first-child{min-width:0;}
.team-strength-value{font-size:16px;flex:0 0 auto;}

.matches-panel{margin-top:0;}
.matches-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px 10px;
  color:#fff;
  background:var(--head);
  border-bottom:1px solid rgba(255,255,255,.06);
  border-top:1px solid rgba(255,255,255,.06);
}
.matches-section-head:first-child{border-top:0;}
.matches-section-title{font-size:12px;font-weight:700;}
.matches-section-note{font-size:10px;color:#cfd3e0;opacity:.78;}
.team-match-table th{text-align:center;}
.team-match-table td{text-align:center;}
.team-match-table .date-cell{width:15%;text-align:left;color:#d7d9e3;}
.team-match-table .opp-cell{width:29%;text-align:left;}
.team-match-table.results .date-cell{width:18%;}
.team-match-table.results .opp-cell{width:58%;}
.team-match-table.results .score-cell{width:24%;font-weight:700;}
.team-match-table .pos-cell{width:10%;}
.team-match-table .ppg-cell{width:18%;}
.team-match-table .xgd-cell{width:18%;}
.team-match-date-sub{display:block;margin-top:1px;font-size:9px;color:#cfd3e0;opacity:.72;}
.team-ha{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:19px;
  height:17px;
  margin-left:4px;
  border-radius:4px;
  background:#444666;
  color:#fff;
  font-size:8.5px;
  font-weight:800;
  vertical-align:middle;
}
.match-result-chip{
  display:inline-block;
  min-width:18px;
  margin-left:3px;
  padding:2px 3px;
  border-radius:4px;
  font-size:8.5px;
  font-weight:800;
  text-align:center;
}
.match-result-chip.w{background:#1f7054;color:#d9fff0;}
.match-result-chip.d{background:var(--result-draw);color:var(--result-draw-text);}
.match-result-chip.l{background:#743b48;color:#ffdce3;}
.mobile-match-context{display:none;}

@media (max-width:700px){
  #tableInsightButtons{gap:6px;}
  #tableInsightButtons button{padding:5px 9px;font-size:11.5px;}
  .desktop-only-label{display:none;}
  .mobile-only-label{display:inline;}
  #tableInsightContainer,#experimentalTeamView{width:100%;max-width:none;}
  .insight-head{padding:8px 7px;}
  .insight-title{font-size:13px;}
  .insight-note{font-size:9.5px;}
  .insight-table th,.insight-table td{padding:7px 4px;font-size:11.5px;}
  .insight-table th{font-size:10.5px;}
  .insight-table.strength-view .rank-col{width:8%;}
  .insight-table.strength-view .team-col{width:48%;}
  .insight-table.strength-view .metric-col{width:22%;}
  .insight-table.form-view .rank-col{width:7%;}
  .insight-table.form-view .team-col{width:35%;}
  .insight-table.form-view .metric-col{width:11.6%;}
  .insight-team-button{font-size:12px;}

  .team-view-header{padding:0 3px;margin-bottom:8px;}
  .team-view-name{font-size:20px;}
  .team-back{padding:6px 8px;font-size:10.5px;}
  .team-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;}
  .team-stat-card{padding:7px 8px;}
  .team-stat-key{font-size:8.5px;}
  .team-stat-value{font-size:16px;}
  .team-strength-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;}
  .team-strength-card{display:block;min-height:72px;padding:7px 8px;box-sizing:border-box;}
  .team-strength-card .team-strength-key{font-size:8.5px;line-height:1.2;}
  .team-strength-card .team-strength-sub{font-size:9px;line-height:1.2;}
  .team-strength-card .team-strength-value{margin-top:6px;font-size:17px;}

  /* Mobile matches preserve every metric without horizontal scrolling: the
     opponent-strength figures collapse onto a second line under the opponent. */
  .team-match-table{table-layout:fixed;}
  .team-match-table thead{display:none;}
  .team-match-table tbody,.team-match-table tr{display:block;width:100%;}
  .team-match-table tr{
    position:relative;
    min-height:52px;
    padding:7px 66px 7px 64px;
    border-bottom:1px solid rgba(255,255,255,.045);
  }
  .team-match-table td{
    display:block;
    width:auto!important;
    padding:0!important;
    border:0!important;
    white-space:normal;
    font-size:11.5px;
  }
  .team-match-table .date-cell{
    position:absolute;
    left:6px;
    top:8px;
    width:54px!important;
    text-align:left;
    font-size:10.5px;
  }
  .team-match-table .opp-cell{width:100%!important;text-align:left;}
  .team-match-table .score-cell{
    position:absolute;
    right:6px;
    top:17px;
    width:56px!important;
    text-align:right;
    white-space:nowrap;
  }
  .team-match-table.results tr{padding-right:66px;}
  .team-match-table.fixtures tr{padding-right:8px;}
  .team-match-table .pos-cell,
  .team-match-table .ppg-cell,
  .team-match-table .xgd-cell{display:none;}
  .mobile-match-context{
    display:block;
    margin-top:3px;
    color:#cfd3e0;
    font-size:9.5px;
    line-height:1.25;
    opacity:.8;
  }
}

/* ───────────────── Teams information architecture ─────────────────
   Teams becomes the umbrella for table / SOS / form / xG. */
#modeButtons .mode-btn{
  font-weight:600;
}
#tableInsightButtons .table-insight-btn{
  min-width:0;
}
#xgViewButtons{
  margin-top:4px;
}
#xgViewButtons::before{
  content:'xG:';
  align-self:center;
  margin-right:1px;
  color:#cfd3e0;
  font-size:10px;
  font-weight:600;
  opacity:.72;
}
body.team-drilldown-active #handicapTable.xg-table td.xg-team{
  cursor:pointer;
}
body.team-drilldown-active #handicapTable.xg-table td.xg-team:hover .xg-team-name{
  color:#aee1ff;
}
@media (max-width:700px){
  #modeButtons{
    gap:6px;
  }
  #modeButtons .mode-btn{
    padding:6px 9px;
    font-size:11.5px;
  }
  #tableInsightButtons{
    gap:5px;
  }
  #tableInsightButtons .table-insight-btn{
    padding:5px 8px;
    font-size:11px;
  }
  #xgViewButtons::before{
    font-size:9.5px;
  }
}

/* ───────────────── Teams form lens ─────────────────
   One six-match window everywhere, switchable Overall / Home / Away. */
.form-scope-bar{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  padding:7px 8px;
  background:rgba(30,30,47,.52);
  border-bottom:1px solid rgba(255,255,255,.05);
}
.form-scope-btn,
.team-form-scope-btn{
  border:0;
  border-radius:999px;
  padding:4px 10px;
  background:var(--pill-dark);
  color:#fff;
  font-size:10.5px;
  font-weight:700;
  cursor:pointer;
}
.form-scope-btn.selected,
.team-form-scope-btn.selected{background:var(--pill-on);}
.form-scope-btn:hover,
.team-form-scope-btn:hover{background:var(--pill-light);}
.form-scope-btn.selected:hover,
.team-form-scope-btn.selected:hover{background:var(--pill-on);}

.insight-table.form-view .rank-col{width:6%;}
.insight-table.form-view .team-col{width:27%;}
.insight-table.form-view .form-run-col{width:22%;text-align:center;}
.insight-table.form-view .metric-col{width:9%;}
.mobile-form-run{display:none;}
.form-run{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:3px;
  white-space:nowrap;
}
.form-run-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:21px;
  height:19px;
  box-sizing:border-box;
  border-radius:4px;
  font-size:9.5px;
  font-weight:800;
  line-height:1;
}
.form-run-chip.w{background:#1f7054;color:#d9fff0;}
.form-run-chip.d{background:var(--result-draw);color:var(--result-draw-text);}
.form-run-chip.l{background:#743b48;color:#ffdce3;}
.form-run.compact .form-run-chip{width:19px;height:18px;font-size:9px;}
.form-run-empty{color:#cfd3e0;opacity:.7;}

.team-form-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0 0 8px;
  padding:7px 9px;
  background:var(--bg3);
  border:1px solid rgba(255,255,255,.055);
  border-radius:7px;
}
.team-form-toolbar-left{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.team-form-toolbar-label{
  color:#cfd3e0;
  font-size:9.5px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.03em;
  white-space:nowrap;
}
.team-form-scope-buttons{display:flex;gap:4px;}
.team-form-scope-btn{padding:4px 8px;font-size:9.5px;}
.team-form-metrics{
  color:#e8eaf2;
  font-size:10.5px;
  line-height:1.3;
  text-align:right;
  font-variant-numeric:tabular-nums;
}
.team-stat-card #teamFormStrip{justify-content:flex-start;}

@media (max-width:700px){
  .form-scope-bar{padding:6px 6px;gap:4px;}
  .form-scope-btn{padding:4px 9px;font-size:10px;}
  .insight-table.form-view .rank-col{width:7%;}
  .insight-table.form-view .team-col{width:35%;}
  .insight-table.form-view .form-run-col{display:none;}
  .insight-table.form-view .metric-col{width:11.6%;}
  .mobile-form-run{
    display:block;
    margin-top:4px;
    line-height:1;
  }
  .mobile-form-run .form-run{justify-content:flex-start;gap:2px;}
  .mobile-form-run .form-run-chip{width:16px;height:15px;font-size:7.5px;border-radius:3px;}
  .team-form-toolbar{
    align-items:flex-start;
    flex-direction:column;
    gap:6px;
    padding:7px 8px;
  }
  .team-form-toolbar-left{
    width:100%;
    justify-content:space-between;
  }
  .team-form-toolbar-label{font-size:9px;}
  .team-form-scope-btn{padding:4px 7px;font-size:9px;}
  .team-form-metrics{
    width:100%;
    text-align:left;
    font-size:9.5px;
  }
}


/* ───────────────── Team match orientation ─────────────────
   One league-season match file feeds every club view. The selected club is
   always bold and jumps between Home and Away columns, making venue runs
   visible at a glance. */
.team-match-table .home-team-cell,
.team-match-table .away-team-cell{
  text-align:left;
  overflow:hidden;
  text-overflow:ellipsis;
}
.team-selected-name{
  color:#fff;
  font-weight:800;
}
.team-match-table .team-opponent-button{
  font-weight:500;
}
.team-match-table.results .date-cell{width:16%;}
.team-match-table.results .home-team-cell,
.team-match-table.results .away-team-cell{width:30%;}
.team-match-table.results .score-cell{width:24%;}
.team-match-table.fixtures .date-cell{width:13%;}
.team-match-table.fixtures .home-team-cell,
.team-match-table.fixtures .away-team-cell{width:20%;}
.team-match-table.fixtures .pos-cell{width:9%;}
.team-match-table.fixtures .ppg-cell{width:20%;}
.team-match-table.fixtures .xgd-cell{width:18%;}

@media (max-width:700px){
  /* Preserve the SoccerStats-style left/right venue pattern on phones too.
     Date stays at the left; Home and Away occupy stable side-by-side columns. */
  .team-match-table thead{display:none;}
  .team-match-table tbody{display:block;width:100%;}
  .team-match-table tr{
    display:grid;
    width:100%;
    min-height:55px;
    padding:7px 7px;
    box-sizing:border-box;
    grid-template-columns:56px minmax(0,1fr) minmax(0,1fr);
    grid-template-rows:auto auto;
    column-gap:6px;
    row-gap:2px;
    align-items:center;
  }
  .team-match-table.results tr{
    grid-template-columns:56px minmax(0,1fr) minmax(0,1fr) 54px;
    padding-right:7px;
  }
  .team-match-table.fixtures tr{padding-right:7px;}
  .team-match-table td{
    position:static!important;
    display:block;
    width:auto!important;
    padding:0!important;
    border:0!important;
    white-space:normal;
    min-width:0;
  }
  .team-match-table .date-cell{
    grid-column:1;
    grid-row:1 / span 2;
    width:auto!important;
    text-align:left;
    font-size:10.5px;
  }
  .team-match-table .home-team-cell{
    grid-column:2;
    grid-row:1;
    text-align:left;
    font-size:11.5px;
  }
  .team-match-table .away-team-cell{
    grid-column:3;
    grid-row:1;
    text-align:left;
    font-size:11.5px;
  }
  .team-match-table.results .score-cell{
    grid-column:4;
    grid-row:1;
    width:auto!important;
    text-align:right;
    white-space:nowrap;
  }
  .team-match-table .pos-cell,
  .team-match-table .ppg-cell,
  .team-match-table .xgd-cell{display:none;}
  .mobile-match-context{
    display:block;
    position:absolute;
    left:69px;
    right:7px;
    top:31px;
    margin:0;
    color:#cfd3e0;
    font-size:9.5px;
    line-height:1.25;
    opacity:.8;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .team-match-table.fixtures tr{position:relative;}
  .team-selected-name{font-weight:800;}
  .team-ha{margin-left:3px;}
}

/* ───────────────── Main-table form glance ─────────────────
   Keep the production standings grid intact: Last-6 overall form sits under
   the team name rather than consuming a new column. */
#handicapTable.standard-table td.standard-team .exp-standings-team-name{
  display:block;
  line-height:1.18;
}
#handicapTable.standard-table td.standard-team .standings-form-mini{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:2px;
  width:max-content;
  margin-top:3px;
  line-height:1;
}
#handicapTable.standard-table td.standard-team .standings-form-dot{
  display:block;
  width:7px;
  height:5px;
  border-radius:2px;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.08);
}
#handicapTable.standard-table td.standard-team .standings-form-dot.w{background:#1f7054;}
#handicapTable.standard-table td.standard-team .standings-form-dot.d{background:var(--result-draw);}
#handicapTable.standard-table td.standard-team .standings-form-dot.l{background:#743b48;}

@media (max-width:700px){
  #handicapTable.standard-table td.standard-team .standings-form-mini{
    gap:2px;
    margin-top:3px;
  }
  #handicapTable.standard-table td.standard-team .standings-form-dot{
    width:6px;
    height:5px;
    border-radius:2px;
  }
}


/* Teams rollout v22: the old xG table's small "P 1" metadata means matches
   played, not position. The main Teams table now provides form/context, so the
   extra line is visual noise; hide it consistently in xG subviews. */
#handicapTable.xg-table .xg-team-meta,
#handicapTable td.xg-team .xg-team-meta{
  display:none!important;
}

/* Non-xG team pages reclaim the space that would otherwise belong to xGD. */
@media (min-width:701px){
  .team-match-table.fixtures.no-xg .date-cell{width:14%;}
  .team-match-table.fixtures.no-xg .home-team-cell,
  .team-match-table.fixtures.no-xg .away-team-cell{width:23%;}
  .team-match-table.fixtures.no-xg .pos-cell{width:10%;}
  .team-match-table.fixtures.no-xg .ppg-cell{width:30%;}
}


/* Teams rollout v28: analytical column headings are intentionally one notch
   larger than before. This improves CS% / SR% / O2.5% scanning without
   changing the compact production market tables. */


/* Teams rollout v29: make the Form sample unambiguous near the venue selector. */
.form-sample-note{
  margin:-1px 8px 7px;
  text-align:center;
  font-size:10.5px;
  line-height:1.25;
  color:var(--muted,#b8bbcf);
}
@media (max-width:700px){
  .form-sample-note{font-size:10px;margin:0 6px 6px;}
}

/* ───────────────── Teams rollout v36: Run-in analysis ─────────────────
   Desktop gets the full SoccerStats-inspired analytical grid. Mobile uses
   compact cards so none of the information requires horizontal scrolling. */
@media (min-width:701px){
  #tableInsightContainer.runin-wide{width:92%;max-width:980px;}
}
.insight-panel.runin-panel .insight-head{align-items:flex-start;}
.insight-table.runin-view{table-layout:fixed;}
.insight-table.runin-view th{white-space:normal;line-height:1.12;font-size:11.5px;}
.insight-table.runin-view td{font-size:12px;}
.insight-table.runin-view .rank-col{width:5%;text-align:center;}
.insight-table.runin-view .team-col{width:20%;text-align:left;}
.insight-table.runin-view .gp-col{width:5%;text-align:center;}
.insight-table.runin-view .pts-col{width:6%;text-align:center;}
.insight-table.runin-view .metric-col{width:8%;text-align:center;}
.insight-table.runin-view .played-col{width:14%;}
.insight-table.runin-view .remaining-col{width:15%;}
.insight-table.runin-view .comparison-col{width:14%;}
.insight-table.runin-view .next4-col{width:13%;}
.runin-comparison{font-weight:800;font-variant-numeric:tabular-nums;}
.runin-comparison.easier{color:#76e3a5;}
.runin-comparison.harder{color:#ff8e9b;}
.runin-comparison.level{color:#d7d9e3;}
.runin-mobile-sort,.runin-mobile-list{display:none;}

@media (max-width:700px){
  #tableInsightContainer.runin-wide{width:100%;max-width:none;}
  .insight-table.runin-view{display:none;}
  .runin-mobile-sort{
    display:flex;
    align-items:center;
    justify-content:center;
    flex-wrap:wrap;
    gap:4px;
    padding:6px 6px;
    background:rgba(30,30,47,.52);
    border-bottom:1px solid rgba(255,255,255,.05);
    color:#cfd3e0;
    font-size:9px;
  }
  .runin-mobile-sort>span{margin-right:2px;font-weight:700;opacity:.75;}
  .runin-mobile-sort .insight-sort{
    padding:4px 6px;
    border-radius:999px;
    background:var(--pill-light);
    color:#fff;
    text-decoration:none;
    font-size:9.5px;
    line-height:1;
  }
  .runin-mobile-sort .insight-sort.is-active{background:var(--pill-on);color:#fff;text-decoration:none;}
  .runin-mobile-list{display:block;}
  .runin-card{
    padding:8px 7px 7px;
    border-bottom:1px solid rgba(255,255,255,.045);
  }
  .runin-card:nth-child(odd){background:var(--bg3);}
  .runin-card:nth-child(even){background:var(--bg2);}
  .runin-card-head{
    display:grid;
    grid-template-columns:24px minmax(0,1fr) auto;
    align-items:center;
    gap:5px;
    min-width:0;
  }
  .runin-card-pos{font-size:10px;color:#d7d9e3;text-align:center;font-variant-numeric:tabular-nums;}
  .runin-card-team{font-size:12px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .runin-card-summary{font-size:9px;color:#cfd3e0;opacity:.78;white-space:nowrap;font-variant-numeric:tabular-nums;}
  .runin-card-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:4px;
    margin:6px 0 0 29px;
  }
  .runin-card-grid>div{
    min-width:0;
    padding:4px 2px;
    border-radius:4px;
    background:rgba(255,255,255,.025);
    text-align:center;
  }
  .runin-card-grid span{display:block;font-size:7.5px;line-height:1.1;color:#cfd3e0;opacity:.72;white-space:nowrap;}
  .runin-card-grid b{display:block;margin-top:2px;font-size:10.5px;line-height:1.1;color:#fff;font-variant-numeric:tabular-nums;}
  .runin-card-grid b.runin-comparison.easier{color:#76e3a5;}
  .runin-card-grid b.runin-comparison.harder{color:#ff8e9b;}
}

/* v36 Player Stats: desktop gains a proper MPG column. On mobile G/90 and
   MPG are appended to the existing player metadata line instead of forcing a
   sixth narrow numeric column into the table. */
@media (min-width:701px){
  #tableContainer.top-scorer-mode.minutes-player-mode{max-width:980px;}
  #handicapTable.top-scorer-table.minutes-player-table{min-width:820px;}
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(1),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(1){width:6% !important;}
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(2),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(2){width:20% !important;}
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(3),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(3){width:20% !important;}
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(4),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(4){width:7% !important;}
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(5),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(5){width:8% !important;}
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(6),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(6){width:8% !important;}
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(7),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(7){width:10% !important;}
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(8),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(8){width:10% !important;}
  #handicapTable.top-scorer-table.minutes-player-table th:nth-child(9),
  #handicapTable.top-scorer-table.minutes-player-table td:nth-child(9){width:11% !important;}
}


/* v37 mobile readability pass + compact team season map. */
.season-map-panel{margin:0 0 10px;overflow:hidden;}
.season-map-table{width:100%;border-collapse:collapse;table-layout:fixed;}
.season-map-table th,
.season-map-table td{padding:6px 7px;border-bottom:1px solid rgba(255,255,255,.045);font-size:11px;vertical-align:middle;}
.season-map-table th{background:rgba(30,30,47,.46);color:#dfe2ec;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.02em;text-align:center;}
.season-map-table .season-map-pos{width:7%;text-align:center;color:#cfd3e0;font-variant-numeric:tabular-nums;}
.season-map-table .season-map-opponent{width:39%;text-align:left;}
.season-map-table .season-map-home,
.season-map-table .season-map-away{width:27%;text-align:center;}
.season-map-cell-stack{display:flex;align-items:center;justify-content:center;gap:3px;flex-wrap:wrap;}
.season-map-chip{display:inline-flex;align-items:center;justify-content:center;gap:3px;min-width:45px;padding:3px 5px;border-radius:5px;font-size:9.5px;line-height:1;font-variant-numeric:tabular-nums;white-space:nowrap;}
.season-map-chip b{font-size:10.5px;}
.season-map-chip small{font-size:8px;font-weight:900;}
.season-map-chip.result.w{background:#1f7054;color:#e4fff4;}
.season-map-chip.result.d{background:var(--result-draw);color:var(--result-draw-text);}
.season-map-chip.result.l{background:#743b48;color:#ffe2e7;}
.season-map-chip.date{background:rgba(255,255,255,.055);color:#e3e5ed;}
.season-map-chip.cancelled{background:rgba(255,255,255,.04);color:#cfd3e0;}
.season-map-empty{color:#aeb3c2;opacity:.7;}

@media (max-width:700px){
  /* Small supporting copy was too fine on real phones. Increase it one notch
     without changing the established card sizes or primary hierarchy. */
  .insight-note{font-size:10.5px;line-height:1.25;}
  .runin-mobile-sort{font-size:10.5px;padding:7px 6px;}
  .runin-mobile-sort .insight-sort{font-size:10.5px;padding:5px 7px;}
  .runin-card-pos{font-size:11px;}
  .runin-card-team{font-size:13px;}
  .runin-card-summary{font-size:10.5px;opacity:.86;}
  .runin-card-grid span{font-size:9px;line-height:1.15;opacity:.84;}
  .runin-card-grid b{font-size:11.5px;}

  .team-view-kicker{font-size:12px;}
  .team-stat-key,.team-strength-key{font-size:10px;font-weight:700;opacity:.86;}
  .team-stat-sub,.team-strength-sub{font-size:10.5px;line-height:1.25;opacity:.84;}
  .team-form-toolbar-label{font-size:10px;}
  .team-form-scope-btn{font-size:10px;padding:5px 8px;}
  .team-form-metrics{font-size:11px;line-height:1.35;}
  .matches-section-note{font-size:10.5px;opacity:.86;}
  .team-match-date-sub{font-size:10px;opacity:.82;}
  .mobile-match-context{font-size:10.5px;line-height:1.3;opacity:.88;}

  .season-map-table th,.season-map-table td{padding:7px 4px;}
  .season-map-table th{font-size:9.5px;}
  .season-map-table td{font-size:11px;}
  .season-map-table .season-map-pos{width:8%;}
  .season-map-table .season-map-opponent{width:38%;}
  .season-map-table .season-map-home,
  .season-map-table .season-map-away{width:27%;}
  .season-map-chip{min-width:0;width:auto;padding:4px 5px;font-size:9.5px;border-radius:4px;}
  .season-map-chip b{font-size:10.5px;}
  .season-map-chip small{font-size:8px;}
  .season-map-panel .insight-foot{font-size:9.5px;line-height:1.3;}
}


/* ───────────────── v38: team summary Last-6 containment ─────────────────
   Six form chips could overflow the sixth summary card on desktop because the
   old min-width + horizontal padding made each chip wider than it appeared.
   Give the summary strip true fixed-size indicators while retaining the larger
   mobile treatment where there is ample room. */
.team-stat-card .team-form-strip{
  gap:2px;
  flex-wrap:nowrap;
  max-width:100%;
  overflow:hidden;
}
.team-stat-card .team-form-chip{
  box-sizing:border-box;
  flex:0 0 14px;
  min-width:14px;
  width:14px;
  height:14px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:3px;
  font-size:7px;
  line-height:1;
}
@media (max-width:700px){
  .team-stat-card .team-form-strip{gap:4px;overflow:visible;}
  .team-stat-card .team-form-chip{
    flex-basis:25px;
    min-width:25px;
    width:25px;
    height:25px;
    border-radius:5px;
    font-size:11px;
  }
}

/* ───────────────── v39: desktop team-page breathing room ─────────────────
   The team drill-down had accumulated useful information but was still using
   the original 760px prototype width. Widen desktop only and restore readable
   fixed-size Last-6 chips. Mobile is intentionally unchanged. */
@media (min-width:701px){
  #experimentalTeamView{
    width:94%;
    max-width:940px;
  }

  .team-view-header{margin-bottom:11px;}
  .team-view-kicker{font-size:12px;}
  .team-view-name{font-size:25px;}

  .team-stat-grid{
    gap:8px;
    margin-bottom:10px;
  }
  .team-stat-card{
    padding:10px 11px;
  }
  .team-stat-key{font-size:9.5px;}
  .team-stat-value{font-size:18px;}
  .team-stat-sub{font-size:10px;}

  /* Six letters must always remain fully visible. With the wider summary row
     there is now room to use proper readable chips instead of clipping them. */
  .team-stat-card .team-form-strip{
    gap:3px;
    flex-wrap:nowrap;
    max-width:none;
    overflow:visible;
  }
  .team-stat-card .team-form-chip{
    box-sizing:border-box;
    flex:0 0 18px;
    min-width:18px;
    width:18px;
    height:18px;
    padding:0;
    border-radius:4px;
    font-size:9px;
    line-height:1;
    font-weight:900;
  }

  .team-form-toolbar{
    padding:8px 11px;
    margin-bottom:10px;
  }
  .team-form-toolbar-label{font-size:10px;}
  .team-form-metrics{font-size:11px;}

  .team-strength-grid{
    gap:8px;
    margin-bottom:12px;
  }
  .team-strength-card{padding:10px 11px;}

  .season-map-panel{margin-bottom:12px;}
  .season-map-table th,
  .season-map-table td{padding:7px 9px;font-size:11.5px;}
  .season-map-table th{font-size:10.5px;}
  .season-map-chip{min-width:50px;padding:4px 7px;font-size:10px;}
  .season-map-chip b{font-size:11px;}
  .season-map-chip small{font-size:8.5px;}

  .matches-section-head{padding:9px 11px;}
  .matches-section-title{font-size:13px;}
  .matches-section-note{font-size:10.5px;}
  .team-match-table th,.team-match-table td{padding:7px 8px;font-size:12.5px;}
  .team-match-table th{font-size:12px;}
}

/* ───────────────── v40: guarantee Last-6 room on desktop ─────────────────
   The form card must never depend on six 18px chips just barely fitting in an
   equal-width summary grid. Give the final form card intentionally more room.
   Five-card (no xG) and six-card (xG) summaries are handled separately.
   Mobile remains unchanged. */
@media (min-width:701px){
  .team-stat-grid{
    grid-template-columns:
      repeat(4,minmax(0,1fr))
      minmax(150px,1.6fr);
  }
  .team-stat-grid:has(> .team-stat-card:nth-child(6)){
    grid-template-columns:
      repeat(4,minmax(0,1fr))
      minmax(112px,1.1fr)
      minmax(155px,1.6fr);
  }
  .team-stat-card:last-child .team-form-strip{
    display:flex;
    gap:3px;
    flex-wrap:nowrap;
    width:max-content;
    max-width:100%;
    overflow:visible;
  }
  .team-stat-card:last-child .team-form-chip{
    box-sizing:border-box;
    flex:0 0 17px;
    min-width:17px;
    width:17px;
    height:17px;
    padding:0;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:4px;
    font-size:9px;
    line-height:1;
    font-weight:900;
  }
}


/* ───────────────── v41: clearer team-page run-in summary ─────────────────
   Mirror the terminology used by the sortable Run-in table. Desktop uses two
   wider opponent-PPG cards plus two compact context cards; phones use a stable
   2×2 grid so every metric remains readable without horizontal scrolling. */
@media (min-width:701px){
  .team-strength-grid{
    grid-template-columns:minmax(0,1.35fr) minmax(0,1.35fr) minmax(0,.9fr) minmax(0,.9fr);
    gap:8px;
  }
  .team-strength-card{padding:10px 11px;}
  .team-strength-card-main .team-strength-key{font-size:9.5px;}
  .team-strength-card-compact .team-strength-key{font-size:9px;}
  .team-strength-card-compact .team-strength-sub{font-size:9px;}
  .team-strength-card .team-strength-value{font-size:17px;}
}

@media (max-width:700px){
  .team-strength-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:5px;
    margin-bottom:10px;
  }
  .team-strength-card{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    justify-content:space-between;
    min-height:78px;
    padding:8px;
  }
  .team-strength-card>div:first-child{width:100%;}
  .team-strength-card .team-strength-key{
    font-size:8.5px;
    line-height:1.2;
    white-space:normal;
  }
  .team-strength-card .team-strength-sub{
    margin-top:3px;
    font-size:9px;
    line-height:1.2;
    white-space:normal;
  }
  .team-strength-card .team-strength-value{
    margin-top:7px;
    font-size:17px;
    line-height:1;
  }
}


/* ───────────────── v42: clearer team stats + expandable results ─────────────────
   Promote the season-stat line to readable supporting data, spell out the least
   obvious scoring metric, explain the remaining betting abbreviations, and make
   the default Latest-5 results view expandable without crowding phones. */
.team-form-key{
  margin:-5px 10px 10px;
  color:#cfd3e0;
  font-size:10.5px;
  line-height:1.35;
  text-align:right;
  opacity:.82;
}
.matches-section-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  min-width:0;
}
.matches-section-toggle{
  border:0;
  border-radius:999px;
  padding:4px 9px;
  background:var(--pill);
  color:#fff;
  font:inherit;
  font-size:10px;
  line-height:1.2;
  font-weight:700;
  white-space:nowrap;
  cursor:pointer;
  touch-action:manipulation;
}
.matches-section-toggle:hover{background:var(--pill-light);}
.matches-section-toggle:active{transform:scale(.98);}

@media (min-width:701px){
  .team-form-metrics{
    font-size:13px;
    line-height:1.4;
    font-weight:600;
  }
}

@media (max-width:700px){
  .team-form-metrics{
    font-size:12px;
    line-height:1.4;
    font-weight:600;
  }
  .team-form-key{
    margin:-3px 8px 10px;
    font-size:10.5px;
    line-height:1.35;
    text-align:left;
  }
  .matches-section-actions{gap:6px;}
  .matches-section-toggle{
    padding:5px 8px;
    font-size:10.5px;
  }
}


/* v43 result language: green = win, amber = draw, red = loss.
   Neutral/future information remains blue-grey so amber keeps one meaning. */

/* ───────────────── Championship outright odds — draft 1 ───────────────── */
#outrightOddsMarketButtons{
  display:none;
  margin-top:4px;
  margin-bottom:8px;
}
#outrightOddsMarketButtons .outright-odds-market-btn{
  padding:4px 10px;
  font-size:11.5px;
  border-radius:14px;
}
#outrightOddsMarketButtons .outright-odds-market-btn:not(.selected){
  background:var(--pill-light);
}

.outright-odds-price{
  display:block;
  color:#fff;
  font-weight:800;
  line-height:1.05;
  font-variant-numeric:tabular-nums;
}
.outright-odds-price.is-empty{
  color:#9aa2b4;
  font-weight:600;
}
.outright-odds-book{
  display:block;
  margin-top:2px;
  color:#9fdcf6;
  font-size:9px;
  font-weight:700;
  line-height:1;
  letter-spacing:.01em;
}

#handicapTable.standard-table th.outright-team-odds,
#handicapTable.standard-table td.outright-team-odds,
#handicapTable.top-scorer-table th.outright-player-odds,
#handicapTable.top-scorer-table td.outright-player-odds{
  text-align:center !important;
  vertical-align:middle !important;
  white-space:nowrap;
}

.outright-odds-note{
  display:none;
  width:90%;
  max-width:760px;
  margin:8px auto 14px;
  color:#9da7ba;
  font-size:10.5px;
  line-height:1.35;
  text-align:center;
}
.outright-odds-note.is-visible{display:block;}

@media (min-width:701px){
  #tableContainer.standard-table-mode:has(#handicapTable.outright-team-odds-table){
    width:88%;
    max-width:820px;
  }
  #handicapTable.standard-table.outright-team-odds-table{min-width:760px;}
  #handicapTable.standard-table.outright-team-odds-table th.standard-team,
  #handicapTable.standard-table.outright-team-odds-table td.standard-team{
    width:22% !important;
  }
  #handicapTable.standard-table.outright-team-odds-table th.outright-team-odds,
  #handicapTable.standard-table.outright-team-odds-table td.outright-team-odds{
    width:10% !important;
  }
  #handicapTable.standard-table.outright-team-odds-table td.outright-team-odds .outright-odds-price{
    font-size:12.5px;
  }

  #tableContainer.top-scorer-mode:has(#handicapTable.outright-player-odds-table){
    width:94%;
    max-width:1040px;
  }
  #handicapTable.top-scorer-table.outright-player-odds-table{
    min-width:980px;
  }
  #handicapTable.top-scorer-table.outright-player-odds-table th:nth-child(1),
  #handicapTable.top-scorer-table.outright-player-odds-table td:nth-child(1){width:4% !important;}
  #handicapTable.top-scorer-table.outright-player-odds-table th:nth-child(2),
  #handicapTable.top-scorer-table.outright-player-odds-table td:nth-child(2){width:17% !important;}
  #handicapTable.top-scorer-table.outright-player-odds-table th:nth-child(3),
  #handicapTable.top-scorer-table.outright-player-odds-table td:nth-child(3){width:14% !important;}
  #handicapTable.top-scorer-table.outright-player-odds-table th:nth-child(4),
  #handicapTable.top-scorer-table.outright-player-odds-table td:nth-child(4){width:5% !important;}
  #handicapTable.top-scorer-table.outright-player-odds-table th:nth-child(5),
  #handicapTable.top-scorer-table.outright-player-odds-table td:nth-child(5){width:5% !important;}
  #handicapTable.top-scorer-table.outright-player-odds-table th:nth-child(6),
  #handicapTable.top-scorer-table.outright-player-odds-table td:nth-child(6){width:6% !important;}
  #handicapTable.top-scorer-table.outright-player-odds-table th:nth-child(7),
  #handicapTable.top-scorer-table.outright-player-odds-table td:nth-child(7){width:7% !important;}
  #handicapTable.top-scorer-table.outright-player-odds-table th:nth-child(8),
  #handicapTable.top-scorer-table.outright-player-odds-table td:nth-child(8){width:6% !important;}
  #handicapTable.top-scorer-table.outright-player-odds-table th:nth-child(9),
  #handicapTable.top-scorer-table.outright-player-odds-table td:nth-child(9){width:7% !important;}
  #handicapTable.top-scorer-table.outright-player-odds-table th:nth-child(10),
  #handicapTable.top-scorer-table.outright-player-odds-table td:nth-child(10){width:7% !important;}
  #handicapTable.top-scorer-table.outright-player-odds-table th:nth-child(11),
  #handicapTable.top-scorer-table.outright-player-odds-table td:nth-child(11){width:7% !important;}
  #handicapTable.top-scorer-table.outright-player-odds-table th:nth-child(12),
  #handicapTable.top-scorer-table.outright-player-odds-table td:nth-child(12){width:6% !important;}
  #handicapTable.top-scorer-table.outright-player-odds-table th.outright-player-odds,
  #handicapTable.top-scorer-table.outright-player-odds-table td.outright-player-odds{
    width:9% !important;
  }
}

@media (max-width:700px){
  #outrightOddsMarketButtons{
    flex-wrap:nowrap;
    justify-content:flex-start;
    overflow-x:auto;
    scrollbar-width:none;
    padding:0 8px 2px;
    margin-left:-8px;
    margin-right:-8px;
  }
  #outrightOddsMarketButtons::-webkit-scrollbar{display:none;}
  #outrightOddsMarketButtons .outright-odds-market-btn{
    flex:0 0 auto;
    padding:4px 9px;
    font-size:11px;
  }

  #handicapTable.standard-table.outright-team-odds-table th.standard-team,
  #handicapTable.standard-table.outright-team-odds-table td.standard-team{
    width:29% !important;
  }
  #handicapTable.standard-table.outright-team-odds-table th.outright-team-odds,
  #handicapTable.standard-table.outright-team-odds-table td.outright-team-odds{
    width:16% !important;
    padding-left:2px !important;
    padding-right:2px !important;
  }
  #handicapTable.standard-table.outright-team-odds-table .outright-odds-price{font-size:12px;}
  #handicapTable.standard-table.outright-team-odds-table .outright-odds-book{font-size:8.5px;}

  #handicapTable.top-scorer-table.outright-player-odds-table th:nth-child(1),
  #handicapTable.top-scorer-table.outright-player-odds-table td:nth-child(1){width:40% !important;}
  #handicapTable.top-scorer-table.outright-player-odds-table th:nth-child(2),
  #handicapTable.top-scorer-table.outright-player-odds-table td:nth-child(2){width:8% !important;}
  #handicapTable.top-scorer-table.outright-player-odds-table th:nth-child(3),
  #handicapTable.top-scorer-table.outright-player-odds-table td:nth-child(3){width:10% !important;}
  #handicapTable.top-scorer-table.outright-player-odds-table th:nth-child(4),
  #handicapTable.top-scorer-table.outright-player-odds-table td:nth-child(4){width:14% !important;}
  #handicapTable.top-scorer-table.outright-player-odds-table th:nth-child(5),
  #handicapTable.top-scorer-table.outright-player-odds-table td:nth-child(5){width:14% !important;}
  #handicapTable.top-scorer-table.outright-player-odds-table th.outright-player-odds,
  #handicapTable.top-scorer-table.outright-player-odds-table td.outright-player-odds{
    width:14% !important;
    padding-left:2px !important;
    padding-right:2px !important;
  }
  #handicapTable.top-scorer-table.outright-player-odds-table .outright-odds-price{font-size:11.5px;}
  #handicapTable.top-scorer-table.outright-player-odds-table .outright-odds-book{font-size:8px;}
  .outright-odds-note{width:94%;font-size:10px;margin-top:6px;}
}
