/* ===============================
   Root (aislado por namespace)
================================= */
.h2h2v2-widget {
    font-family: 'Inter', sans-serif;
    max-width: 960px;
    margin: 40px auto;
    padding: 10px;
    background: #1f1f1f;
    border-radius: 12px;
    color: #eee;
  }
  
  /* ===============================
     Section titles
  ================================= */
  .h2h2v2-section-title {
    background: #262626;
    color: #d1d1d1;
    padding: 10px 16px;
    border-radius: 6px;
    margin: 32px 0 24px;
    font-size: 1.05rem;
    text-align: center;
    font-weight: 400;
    box-shadow: 0 1px 2px rgba(0,0,0,0.4);
  }
  
  /* ===============================
     Match Header
  ================================= */
  .h2h2v2-match-header {
    background: #1f1f1f;
    padding: 20px 16px;
    border-bottom: 1px solid #333;
    border-radius: 0 0 10px 10px;
    max-width: 960px;
    margin: 0 auto 32px;
    text-align: center;
    position: relative;
    z-index: 10;
    transition: all 0.3s ease-in-out;
  }
  .h2h2v2-header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
    margin-bottom: 8px;
  }
  .h2h2v2-header-row .team-logo { max-height: 36px; object-fit: contain; }
  .h2h2v2-header-row .team-name { font-size: 1rem; font-weight: 600; color: #fff; }
  .h2h2v2-header-row .vs-text { font-size: 0.95rem; color: #ccc; font-weight: 500; }
  .h2h2v2-subtitle-row { font-size: 0.9rem; color: #aaa; }
  .h2h2v2-date-time { margin-top: 4px; font-size: 0.9rem; color: #bbb; }
  
  /* ===============================
     Current Form and Positions (compat)
  ================================= */
  .h2h2v2-summary-overview {
    padding: 24px 1px;
    margin-bottom: 32px;
    background: #1f1f1f;
    border-radius: 12px;
    text-align: center;
  }
  .h2h2v2-summary-overview .h2h2v2-section-title { margin-bottom: 24px; }
  .h2h2v2-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
  }
  .h2h2v2-team-overview {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 0;
    justify-content: center;
  }
  .h2h2v2-team-overview.left { flex-direction: row; text-align: left; }
  .h2h2v2-team-overview.right { flex-direction: row-reverse; text-align: right; }
  .h2h2v2-team-overview img { max-height: 28px; object-fit: contain; }
  .h2h2v2-team-info { display: flex; flex-direction: column; justify-content: center; }
  .h2h2v2-team-info .name { font-size: 0.95rem; font-weight: 600; color: #fff; line-height: 1.2; }
  .h2h2v2-team-info .sub { font-size: 0.9rem; color: #bbb; margin-top: 4px; }
  
  /* ===============================
     Tabs (aisladas)
  ================================= */
  .h2h2v2-tab-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    list-style: none;
    padding: 0;
  }
  .h2h2v2-tab-list li {
    background-color: #333;
    color: #fff;
    padding: 8px 16px;
    font-size: 0.9rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
    user-select: none;
    outline: none;
  }
  .h2h2v2-tab-list li:hover { background-color: #444; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.25); }
  .h2h2v2-tab-list li:focus-visible { background-color: #444; box-shadow: 0 0 0 3px rgba(0,123,255,0.35); transform: translateY(-2px); }
  .h2h2v2-tab-list li:active { transform: translateY(0); box-shadow: 0 3px 10px rgba(0,0,0,0.2); }
  .h2h2v2-tab-list li.active { background-color: #555; box-shadow: 0 4px 12px rgba(0,0,0,0.22); }
  .h2h2v2-tab-content { display: none; }
  .h2h2v2-tab-content.active { display: block; }
  
  /* ===============================
     Tables (genéricas)
  ================================= */
  .h2h2v2-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 0.95rem;
    text-align: center;
  }
  .h2h2v2-table th,
  .h2h2v2-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #444;
    vertical-align: middle;
  }
  .h2h2v2-table th { color: #ccc; font-weight: 600; }
  .h2h2v2-table td { background: #222; color: #eee; }
  .h2h2v2-td-muted { color: #bbb; }
  .h2h2v2-loser { opacity: 0.6; }
  
  /* ===============================
     AVG Goals (Scored / Conceded) partial
  ================================= */
  .h2h2v2-avg {
    background: #1f1f1f;
    border-radius: 12px;
    padding: 10px 8px 18px;
  }
  .h2h2v2-avg .h2h2v2-avg-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 14px;
  }
  .h2h2v2-avg .avg-card {
    background: #222;
    border: 1px solid #2b2b2b;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
  }
  .h2h2v2-avg .avg-card .title {
    font-size: 0.9rem;
    color: #bbb;
    margin-bottom: 8px;
  }
  .h2h2v2-avg .avg-card .value {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: .4px;
    color: #22c55e;
  }
  .h2h2v2-avg .team-strip {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
  }
  .h2h2v2-avg .team {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 0;
  }
  .h2h2v2-avg .team img { width: 22px; height: 22px; object-fit: contain; }
  .h2h2v2-avg .team .label { font-size: 0.9rem; color: #ddd; }
  
  /* ===============================
     Last 10 Match Stats Overall (Over KPI badges)
  ================================= */
  .h2h2v2-overall {
    background: #1f1f1f;
    border-radius: 12px;
    padding: 12px;
  }
  .h2h2v2-overall .overall-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 14px;
  }
  .h2h2v2-overall .overall-item {
    background: #222;
    border: 1px solid #2b2b2b;
    border-radius: 10px;
    padding: 12px 10px;
    text-align: center;
  }
  .h2h2v2-overall .overall-item .label {
    font-size: 0.9rem;
    color: #bbb;
    margin-bottom: 6px;
    min-height: 1.25em;
  }
  .h2h2v2-overall .overall-item .kpi {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-weight: 700;
  }
  .h2h2v2-overall .overall-item .kpi .pct {
    font-size: 1.25rem;
    color: #22c55e;
  }
  .h2h2v2-overall .overall-item .kpi .frac {
    font-size: 0.9rem;
    color: #aaa;
  }
  .h2h2v2-overall .overall-foot {
    margin-top: 8px;
    text-align: center;
    font-size: 0.85rem;
    color: #a9a9a9;
  }
  
  /* ===============================
     Players Stats (Top-3 por categoría)
  ================================= */
  .h2h2v2-players {
    background: #1f1f1f;
    border-radius: 12px;
    padding: 12px;
  }
  .h2h2v2-players .blocks {
    display: grid;
   an grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 16px;
  }
  .h2h2v2-players .block {
    background: #222;
    border: 1px solid #2b2b2b;
    border-radius: 10px;
    padding: 10px;
  }
  .h2h2v2-players .block .block-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #eaeaea;
    margin-bottom: 10px;
    text-align: center;
  }
  .h2h2v2-players .list {
    display: grid;
    grid-template-rows: repeat(3, auto);
    gap: 8px;
  }
  .h2h2v2-players .item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    background: #1f1f1f;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 8px 10px;
  }
  .h2h2v2-players .item .name {
    font-size: 0.95rem;
    color: #f1f1f1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .h2h2v2-players .item .val {
    font-size: 1rem;
    font-weight: 700;
    color: #22c55e;
    padding-left: 8px;
  }
  
  /* Variante compacta (por equipo lado a lado) */
  .h2h2v2-players.twocol .blocks {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
  
  /* ===============================
     Goals by Time (compat con tu look)
  ================================= */
  .h2h2v2-goals-table { width: 100%; max-width: 720px; margin: 0 auto; font-size: 14px; }
  .h2h2v2-goals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    margin-bottom: 12px;
    font-weight: bold;
  }
  .h2h2v2-goals-header .team { flex: 1; }
  .h2h2v2-goals-header .team img { width: 36px; height: 36px; object-fit: contain; margin-bottom: 4px; }
  .h2h2v2-goals-header .title-center { flex: 1; text-align: center; font-weight: 600; }
  .h2h2v2-goals-body .goal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    border-bottom: 1px solid #3a3a3a;
    padding: 6px 0;
  }
  .h2h2v2-goals-body .goal-value { width: 30%; text-align: center; font-weight: 500; }
  .h2h2v2-goals-body .goal-label { width: 40%; text-align: center; font-weight: 400; color: #bbb; }
  
  /* ===============================
     Predictions (cruz de separadores)
  ================================= */
  .h2h2v2-predictions {
    margin: 24px auto;
    padding: 10px;
    max-width: 720px;
    text-align: center;
  }
  .h2h2v2-pred-grid {
    display: grid;
    gap: 0;
  }
  .h2h2v2-pred-card {
    background: transparent;
    border: none;
    padding: 14px 10px;
    color: #eee;
  }
  .h2h2v2-pred-card .head { font-size: 0.95rem; font-weight: 700; color: #eaeaea; margin-bottom: 6px; }
  .h2h2v2-pred-card .body {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  }
  .h2h2v2-pred-card .label { font-size: 0.95rem; line-height: 1.25; color: #f1f1f1; }
  .h2h2v2-pred-card .value { font-size: 1.35rem; font-weight: 800; letter-spacing: .4px; color: #22c55e; white-space: nowrap; }
  .h2h2v2-pred-logo { height: 22px; width: auto; object-fit: contain; vertical-align: middle; }
  .h2h2v2-pred-logos { display: inline-flex; align-items: center; gap: 8px; }
  
  /* Cruz de separadores (+) */
  .h2h2v2-pred-grid.plus .col-right { border-left: 1px solid #3a3a3a; }
  .h2h2v2-pred-grid.plus .row-2 { border-top: 1px solid #3a3a3a; }
  
  /* ===============================
     Responsive
  ================================= */
  @media screen and (max-width: 768px) {
    .h2h2v2-match-header {
      position: sticky;
      top: 0;
      z-index: 1000;
      background-color: #1f1f1f;
      border-radius: 0;
      border-bottom: 2px solid #333;
      box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    }
    .h2h2v2-header-row { flex-wrap: nowrap; overflow-x: auto; justify-content: center; }
  
    .h2h2v2-team-overview img { max-height: 24px; }
    .h2h2v2-team-info .name { font-size: 0.9rem; }
    .h2h2v2-team-info .sub { font-size: 0.75rem; }
  
    .h2h2v2-overall .overall-grid { grid-template-columns: 1fr 1fr; }
    .h2h2v2-players .blocks { grid-template-columns: 1fr; }
  }
  
  /* Pequeño fix visual para badges */
  .h2h2v2-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #2a2a2a;
    color: #e7e7e7;
    font-size: 0.85rem;
    border: 1px solid #333;
  }
  .h2h2v2-badge .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #22c55e;
  }
  