
  #mha-live-app,
  #mha-live-app * {
    box-sizing: border-box;
  }

  #mha-live-app {
    --navy: #26243d;
    --navy-dark: #1b192d;
    --red: #bf222c;
    --bg: #f0f2f5;
    --surface: #ffffff;
    --border: #d8dee8;
    --text: #172033;
    --muted: #64748b;
    --green: #198754;
    --yellow: #f0ad4e;
    --info: #0aa2c0;

    min-height: 100vh;
    padding: 10px;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
  }

  #mha-live-app .mha-live-head {
    width: 100%;
    min-height: 62px;
    margin: 0 0 10px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: var(--navy);
    color: #ffffff;
    border-bottom: 4px solid var(--red);
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .12);
  }

  #mha-live-app .mha-live-title {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
  }

  #mha-live-app .mha-live-title h1 {
    margin: 0;
    color: #ffffff;
    font-size: 29px;
    line-height: 1;
  }

  #mha-live-app .mha-live-title span {
    color: #d9dbea;
    font-size: 12px;
  }

  #mha-live-app .mha-live-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
  }

  #mha-live-app .mha-live-actions > span {
    color: #d9dbea;
    font-size: 10px;
  }

  #mha-live-app .mha-live-actions button,
  #mha-live-app .mha-live-actions a {
    min-height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
  }

  #mha-live-app .mha-live-actions button {
    color: #ffffff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .55);
  }

  #mha-live-app .mha-live-actions a {
    color: var(--navy) !important;
    background: #ffffff;
    border: 1px solid #ffffff;
  }

  #mha-live-app .mha-live-tools {
    width: 100%;
    margin: 0 0 10px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
  }

  #mha-live-app .mha-live-tools > span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
  }

  #mha-live-app .mha-live-tools button {
    min-height: 32px;
    padding: 0 11px;
    color: #ffffff;
    background: var(--navy);
    border: 0;
    border-radius: 6px;
    font: inherit;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
  }

  #mha-live-app .mha-live-loading,
  #mha-live-app .mha-live-error,
  #mha-live-app .mha-live-empty {
    padding: 36px;
    text-align: center;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--muted);
    font-weight: 700;
  }

  #mha-live-app .mha-live-error {
    color: #842029;
    background: #f8d7da;
    border-color: #f5c2c7;
  }

  #mha-live-app .mha-live-spinner {
    width: 17px;
    height: 17px;
    margin-right: 8px;
    display: inline-block;
    vertical-align: middle;
    border: 2px solid #cbd5e1;
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: mhaLiveSpin .8s linear infinite;
  }

  @keyframes mhaLiveSpin {
    to { transform: rotate(360deg); }
  }

  #mha-live-app .mha-live-match {
    margin-bottom: 12px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 11px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .06);
    overflow: hidden;
  }

  #mha-live-app .mha-live-meta {
    min-height: 34px;
    padding: 7px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    font-size: 10px;
  }

  #mha-live-app .mha-live-meta-left,
  #mha-live-app .mha-live-meta-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }

  #mha-live-app .mha-live-badge {
    padding: 4px 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #ffffff;
    background: var(--red);
    border-radius: 999px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  #mha-live-app .mha-live-dot {
    width: 7px;
    height: 7px;
    background: #ffffff;
    border-radius: 50%;
    animation: mhaLivePulse 1.2s infinite;
  }

  @keyframes mhaLivePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .25; }
  }

  #mha-live-app .mha-scoreboard {
    min-height: 128px;
    padding: 14px 18px;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
    align-items: center;
    gap: 18px;
  }

  #mha-live-app .mha-live-team {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }

  #mha-live-app .mha-live-team.away {
    flex-direction: row-reverse;
    text-align: right;
  }

  #mha-live-app .mha-live-team img,
  #mha-live-app .mha-live-team-logo {
    width: 58px !important;
    height: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    max-height: 58px !important;
    flex: 0 0 58px !important;
    object-fit: contain;
    padding: 3px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
  }

  #mha-live-app .mha-live-team-logo {
    display: grid;
    place-items: center;
    padding: 0;
    background: #e2e8f0;
    font-weight: 900;
  }

  #mha-live-app .mha-live-team-name {
    min-width: 0;
    color: var(--navy);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.15;
  }

  #mha-live-app .mha-live-score-centre {
    min-width: 210px;
    text-align: center;
  }

  #mha-live-app .mha-live-half {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  #mha-live-app .mha-live-score {
    color: var(--red);
    font-size: 44px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
  }

  #mha-live-app .mha-live-clock {
    width: fit-content;
    margin: 7px auto 0;
    padding: 4px 10px;
    color: #854d0e;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
  }

  #mha-live-app .mha-live-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    background: #eeeaf2;
    border-top: 1px solid #cfc8d7;
    border-bottom: 1px solid #cfc8d7;
  }

  #mha-live-app .mha-live-tab {
    min-height: 39px;
    padding: 0 12px;
    color: var(--navy);
    background: transparent;
    border: 0;
    font: inherit;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
  }

  #mha-live-app .mha-live-tab.active {
    color: #ffffff;
    background: var(--navy);
  }

  #mha-live-app .mha-live-panel {
    display: none;
    padding: 10px;
  }

  #mha-live-app .mha-live-panel.active {
    display: block;
  }

  #mha-live-app .mha-live-feed {
    display: grid;
    gap: 6px;
  }

  #mha-live-app .mha-event {
    min-height: 42px;
    padding: 7px 9px;
    display: grid;
    grid-template-columns: 46px 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-left: 4px solid #adb5bd;
    border-radius: 7px;
  }

  #mha-live-app .mha-event.goal {
    background: #f1fbf5;
    border-left-color: var(--green);
  }

  #mha-live-app .mha-event.yellow {
    background: #fffaf0;
    border-left-color: var(--yellow);
  }

  #mha-live-app .mha-event.red {
    background: #fff5f5;
    border-left-color: var(--red);
  }

  #mha-live-app .mha-event.penalty {
    background: #f0fbff;
    border-left-color: var(--info);
  }

  #mha-live-app .mha-event.info {
    background: #eeeaf2;
    border-left-color: var(--navy);
  }

  #mha-live-app .mha-event-time {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
  }

  #mha-live-app .mha-event img,
  #mha-live-app .mha-event-logo {
    box-sizing: border-box;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    object-fit: contain;
    padding: 2px;
    background: #ffffff;
    border: 1px solid #d8dee8;
    border-radius: 50%;
  }

  #mha-live-app .mha-event-logo {
    display: block;
    background: #e9eef5;
  }

  /*
   * V4.5 EVENT BADGE / KIT SPACING RESTORE
   *
   * logoHtml() uses .mha-live-team-logo for real club badges.
   * The normal scoreboard badge is 58px, while a Live Feed event has only
   * a small logo column. Force the badge wrapper to the event size here so
   * it cannot cover the player's kit-number badge or name.
   */
  #mha-live-app .mha-event > .mha-live-team-logo {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    flex: 0 0 28px !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    align-self: center;
    justify-self: center;
  }

  #mha-live-app .mha-event > .mha-live-team-logo img {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    padding: 2px !important;
    object-fit: contain;
    box-sizing: border-box;
  }

  #mha-live-app .mha-event-copy {
    min-width: 0;
    font-size: 11px;
    line-height: 1.3;
  }

  #mha-live-app .mha-event-copy strong {
    color: var(--navy);
  }

  #mha-live-app .mha-event-team {
    color: var(--muted);
    font-size: 9px;
  }

  #mha-live-app .mha-event-type {
    color: #475569;
    font-size: 10px;
  }

  #mha-live-app .mha-event-icon {
    font-size: 17px;
  }

  /* Dense two-team lineups. */
  #mha-live-app .mha-lineups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #mha-live-app .mha-lineup-team {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
  }

  #mha-live-app .mha-lineup-title {
    min-height: 34px;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--navy);
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
  }

  #mha-live-app .mha-lineup-team.away .mha-lineup-title {
    background: var(--red);
  }

  #mha-live-app .mha-lineup-count {
    color: #d9dbea;
    font-size: 9px;
    font-weight: 700;
  }

  #mha-live-app .mha-player-row {
    min-height: 29px;
    padding: 4px 7px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #e8edf3;
    background: #ffffff;
  }

  #mha-live-app .mha-player-row:nth-child(even) {
    background: #f8fafc;
  }

  #mha-live-app .mha-player-row:last-child {
    border-bottom: 0;
  }

  #mha-live-app .mha-kit-number {
    min-width: 25px;
    height: 21px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    color: #ffffff;
    background: var(--navy);
    border-radius: 6px;
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
  }

  #mha-live-app .mha-player-name {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 10px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #mha-live-app .mha-player-stats {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    flex-wrap: wrap;
  }

  #mha-live-app .mha-stat {
    min-width: 22px;
    padding: 2px 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #ffffff;
    font-size: 8px;
    font-weight: 900;
  }

  #mha-live-app .mha-stat.goal { background: var(--green); }
  #mha-live-app .mha-stat.yellow {
    color: #3d2c00;
    background: var(--yellow);
  }
  #mha-live-app .mha-stat.red { background: var(--red); }
  #mha-live-app .mha-stat.susp { background: var(--info); }

  #mha-live-app .mha-no-lineup,
  #mha-live-app .mha-no-events {
    padding: 18px;
    color: var(--muted);
    text-align: center;
    font-size: 11px;
    font-style: italic;
  }

  #mha-live-app .mha-next-label {
    margin: 14px 0 8px;
    color: var(--navy);
    font-size: 14px;
    font-weight: 900;
    text-align: center;
  }

  #mha-live-app .mha-upcoming-card {
    padding: 14px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
  }

  #mha-live-app .mha-upcoming-scoreboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
  }

  /*
   * Keep the two teams visually balanced around VS:
   *
   *       Home Team  [logo]   VS   [logo]  Away Team
   *
   * The previous row-reverse/flex-end combination pushed one team towards the
   * edge of the card and the other towards the centre.
   */
  #mha-live-app .mha-upcoming-team {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: row-reverse;
    gap: 9px;
    min-width: 0;
    text-align: right;
    font-size: 13px;
    font-weight: 900;
  }

  #mha-live-app .mha-upcoming-team.away {
    justify-content: flex-start;
    flex-direction: row;
    text-align: left;
  }

  #mha-live-app .mha-upcoming-team span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  #mha-live-app .mha-upcoming-team img,
  #mha-live-app .mha-upcoming-team .mha-live-team-logo {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    max-height: 42px !important;
    flex: 0 0 42px !important;
  }

  #mha-live-app .mha-upcoming-vs {
    color: var(--red);
    font-size: 20px;
    font-weight: 900;
  }

  #mha-live-app .mha-upcoming-meta {
    margin-top: 10px;
    color: var(--muted);
    text-align: center;
    font-size: 10px;
  }

  @media (max-width: 760px) {
    #mha-live-app {
      padding: 6px;
    }

    #mha-live-app .mha-live-head {
      align-items: flex-start;
      flex-direction: column;
      padding: 9px 11px;
    }

    #mha-live-app .mha-live-title {
      display: block;
    }

    #mha-live-app .mha-live-title h1 {
      font-size: 23px;
    }

    #mha-live-app .mha-live-title span {
      display: block;
      margin-top: 3px;
      font-size: 9px;
    }

    #mha-live-app .mha-live-actions {
      width: 100%;
      justify-content: flex-start;
    }

    #mha-live-app .mha-live-updated {
      width: 100%;
    }

    #mha-live-app .mha-scoreboard {
      min-height: 112px;
      padding: 11px 9px;
      grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
      gap: 7px;
    }

    #mha-live-app .mha-live-team {
      flex-direction: column;
      gap: 6px;
      text-align: center;
    }

    #mha-live-app .mha-live-team.away {
      flex-direction: column;
      text-align: center;
    }

    #mha-live-app .mha-live-team img,
    #mha-live-app .mha-live-team-logo {
      width: 44px !important;
      height: 44px !important;
      min-width: 44px !important;
      max-width: 44px !important;
      max-height: 44px !important;
      flex: 0 0 44px !important;
    }

    #mha-live-app .mha-live-team-name {
      font-size: 11px;
    }

    #mha-live-app .mha-live-score-centre {
      min-width: 104px;
    }

    #mha-live-app .mha-live-score {
      font-size: 31px;
    }

    #mha-live-app .mha-lineups {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 5px;
    }

    #mha-live-app .mha-lineup-title {
      padding: 6px;
      font-size: 9px;
    }

    #mha-live-app .mha-lineup-count {
      display: none;
    }

    #mha-live-app .mha-player-row {
      min-height: 27px;
      padding: 3px 5px;
      gap: 3px;
    }

    #mha-live-app .mha-kit-number {
      min-width: 22px;
      height: 19px;
      padding: 0 4px;
      font-size: 8px;
      border-radius: 5px;
    }

    #mha-live-app .mha-player-name {
      font-size: 8px;
    }

    #mha-live-app .mha-stat {
      min-width: 18px;
      padding: 2px 3px;
      font-size: 7px;
    }

    #mha-live-app .mha-event {
      grid-template-columns: 39px 24px minmax(0, 1fr) auto;
      padding: 6px;
      gap: 6px;
    }

    #mha-live-app .mha-event img,
    #mha-live-app .mha-event-logo {
      width: 23px !important;
      height: 23px !important;
      min-width: 23px !important;
      max-width: 23px !important;
      max-height: 23px !important;
    }

    #mha-live-app .mha-event > .mha-live-team-logo {
      width: 23px !important;
      height: 23px !important;
      min-width: 23px !important;
      max-width: 23px !important;
      max-height: 23px !important;
      flex-basis: 23px !important;
    }

    #mha-live-app .mha-upcoming-card {
      padding: 12px 8px;
    }

    #mha-live-app .mha-upcoming-scoreboard {
      grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
      gap: 8px;
      max-width: 100%;
    }

    #mha-live-app .mha-upcoming-team,
    #mha-live-app .mha-upcoming-team.away {
      flex-direction: column;
      justify-content: center;
      gap: 5px;
      text-align: center;
      font-size: 10px;
      line-height: 1.15;
    }

    #mha-live-app .mha-upcoming-team img,
    #mha-live-app .mha-upcoming-team .mha-live-team-logo {
      width: 38px !important;
      height: 38px !important;
      min-width: 38px !important;
      max-width: 38px !important;
      max-height: 38px !important;
      flex: 0 0 38px !important;
    }

    #mha-live-app .mha-upcoming-vs {
      font-size: 17px;
    }

    #mha-live-app .mha-upcoming-meta {
      margin-top: 8px;
      padding: 0 4px;
      font-size: 9px;
      line-height: 1.35;
    }
  }


/* =========================================================
   V4 — FULL GREY PAGE CANVAS + CENTERED LIVE SCORES CONTENT
   ========================================================= */

/* Full page background, including the margins around the centred app. */
body:has(#mha-live-app),
body:has(#mha-live-app) #page,
body:has(#mha-live-app) .site,
body:has(#mha-live-app) .site-content,
body:has(#mha-live-app) main,
body:has(#mha-live-app) [data-elementor-type="wp-page"],
body:has(#mha-live-app) .elementor,
body:has(#mha-live-app) .elementor-section,
body:has(#mha-live-app) .e-con{
  background:#f0f2f5 !important;
}

/* The actual Live Scores content is centred and does NOT fill the screen. */
#mha-live-app{
  width:min(1360px, calc(100vw - 48px)) !important;
  max-width:1360px !important;
  min-height:calc(100vh - 170px) !important;
  margin:18px auto 28px !important;
  padding:10px !important;
  background:transparent !important;
}

/* Image wrapper used by the stronger logo fallback. */
#mha-live-app .mha-live-team-logo-image{
  padding:3px !important;
  background:#ffffff !important;
}
#mha-live-app .mha-live-team-logo-image img{
  width:100% !important;
  height:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  max-height:100% !important;
  padding:0 !important;
  border:0 !important;
  border-radius:50% !important;
  object-fit:contain !important;
}

@media(max-width:760px){
  #mha-live-app{
    width:calc(100vw - 12px) !important;
    max-width:none !important;
    margin:6px auto 18px !important;
    padding:6px !important;
  }
}



/* V4.1 — logo image sits over an always-available initial fallback. */
#mha-live-app .mha-live-team-logo-image{
  position:relative !important;
  overflow:hidden !important;
}
#mha-live-app .mha-live-logo-fallback{
  position:absolute !important;
  inset:0 !important;
  z-index:0 !important;
  display:grid !important;
  place-items:center !important;
  font-weight:900 !important;
}
#mha-live-app .mha-live-team-logo-image img{
  position:relative !important;
  z-index:1 !important;
  background:#ffffff !important;
}



/* =========================================================
   V4.2 — TRUE FULL-PAGE GREY CANVAS
   Covers the WordPress / Elementor wrappers outside #mha-live-app too.
   ========================================================= */
html:has(#mha-live-app),
body:has(#mha-live-app),
body:has(#mha-live-app) #page,
body:has(#mha-live-app) #content,
body:has(#mha-live-app) .site,
body:has(#mha-live-app) .site-content,
body:has(#mha-live-app) .content-area,
body:has(#mha-live-app) .site-main,
body:has(#mha-live-app) main,
body:has(#mha-live-app) [data-elementor-type="wp-page"],
body:has(#mha-live-app) .elementor,
body:has(#mha-live-app) .elementor-section,
body:has(#mha-live-app) .elementor-container,
body:has(#mha-live-app) .elementor-column,
body:has(#mha-live-app) .elementor-widget-wrap,
body:has(#mha-live-app) .elementor-element,
body:has(#mha-live-app) .elementor-widget-container,
body:has(#mha-live-app) .e-con,
body:has(#mha-live-app) .e-con-inner{
  background-color:#f0f2f5 !important;
  background-image:none !important;
}

/* Keep the Live Scores cards/controls white on the grey canvas. */
#mha-live-app .mha-live-tools,
#mha-live-app .mha-live-loading,
#mha-live-app .mha-live-empty,
#mha-live-app .mha-live-match,
#mha-live-app .mha-upcoming-card,
#mha-live-app .mha-player-row{
  background:#ffffff !important;
}

