/* ===== Mobile-first styles ===== */
  :root{
    --bg: #f2f3f7;
    --card: #ffffff;
    --muted: #8e929a;
    --text: #25272d;
    --accent: #344cff;
    --accent-2: #10b981;
    --danger: #ef4444;
    --radius: 16px;
    --shadow: 0 8px 22px rgba(22,31,55,.08);
  }
  /* Chrome's mobile font-boosting inflates font-size inconsistently per block; lock it off */
  #hb-match-root{ font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial; color: var(--text); background: var(--bg); padding: 14px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  #hb-match-root *{ -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

  .hb-card{ max-width: 100%; margin: 0 auto; background: var(--card); border: 1px solid #e1e4eb; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

  .hb-top{ display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; padding: 14px; border-bottom: 1px solid #edf0f5; }

  /* Team rows stack on mobile */
  .hb-team{ display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content:center; text-align:center; }
  .hb-team img{ width: 44px; height: 44px; border-radius: 12px; object-fit: contain; background: #f0f2f6; border: 1px solid #e1e4eb; }
  .hb-team .name{ overflow-wrap:anywhere; font-weight: 800; font-size: 16px; line-height: 1.1 }
  .hb-team .meta{ color: var(--muted); font-size: 12px }

  /* Score block centered and touch-friendly */
  .hb-vs{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding: 6px 0; }
  .hb-score{ display:flex; align-items: baseline; gap: 8px; font-weight: 900; letter-spacing: .5px; }
  .hb-score .home, .hb-score .away{ font-size: 28px }
  .hb-score .dash{ color: var(--muted); font-size: 22px }

  .hb-badge{ font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 6px 10px; border-radius: 999px; background: rgba(58,160,255,.15); color: var(--accent); border: 1px solid rgba(58,160,255,.35); }
  .hb-badge.live{ background: rgba(239,68,68,.12); color: #ffb3b3; border-color: rgba(239,68,68,.35) }
  .hb-badge.final{ background: rgba(16,185,129,.14); color: #a6f3d7; border-color: rgba(16,185,129,.35) }

  .hb-meta{ display:grid; gap: 10px; padding: 12px 14px; }
  .hb-rows{ display:grid; grid-template-columns: 1fr; gap: 10px; }
  .hb-pill{ background: #f6f7fa; border: 1px solid #e6e9ef; padding: 12px; border-radius: 12px; }
  .hb-pill .label{ color: var(--muted); font-size: 12px; letter-spacing:.02em }
  .hb-pill .value{ font-size: clamp(14px, 4.2vw, 14px); margin-top: 4px }

  .hb-footer{ display:flex; flex-wrap: wrap; gap:8px; align-items:center; justify-content: space-between; padding: 12px 14px; background: #fafbfc; border-top: 1px solid #edf0f5; }
  .hb-tags{ display:flex; gap:8px; flex-wrap:wrap }
  .hb-tag{ font-size: 12px; color: var(--muted); background: #f1f3f7; border: 1px solid #e3e6ed; padding: 6px 10px; border-radius: 999px; }
  .hb-time{ color: var(--muted); font-size: 13px }

  .hb-tabs{ max-width:100%; margin: 6px auto; display:flex; overflow-x:auto; gap: 2px; border-bottom: 1px solid #dfe3ea; background: #ffffff; scrollbar-width: none; }
  .hb-tabs::-webkit-scrollbar{ display:none; }
  .hb-tab{ flex: 1 0 auto; min-width: max-content; appearance:none; border:0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); padding: 14px 16px 11px; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
  .hb-tab:hover,
  .hb-tab:focus,
  .hb-tab.is-active,
  .hb-tab.is-active:hover,
  .hb-tab.is-active:focus{ background:transparent!important; }
  .hb-tab:hover,
  .hb-tab:focus{ color:var(--muted)!important; }
  .hb-tab.is-active{ color: var(--accent); border-bottom-color: var(--accent); }
  .hb-tab.is-active:hover,
  .hb-tab.is-active:focus{ color:var(--accent)!important; }
  .hb-tab:focus-visible{ outline: 2px solid var(--accent); outline-offset: -4px; }
  .hb-panel{ display:none; }
  .hb-panel.is-active{ display:block; }
  .hb-panel[hidden]{ display:none!important; }
  .hb-empty{ padding: 16px 14px; color: var(--muted); font-size: 14px; }

  /* match statistics container */
  /* same background as your card */
  .hb-stats {
    max-width: 100%;
    margin: 8px auto;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #e1e4eb;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  /* column headings */
  .hb-col h4 {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: .08em;
  }

  /* tables styled like scoreboard */
  .hb-stats table{
    width: 100%;
    border-collapse: collapse;
    background: #f7f8fb;
    border: 1px solid #e6e9ef;
    border-radius: 10px;
    overflow: hidden;
    table-layout: fixed;  /* important */
  }
  .hb-stats td {
    border: none;
  }
  .hb-stats tr:not(:last-child) td {
    border-bottom: 1px solid #e6e9ef;
  }
  .hb-stats td + td {
    border-left: none;   /* make sure no vertical line between name & score */
  }
  .hb-stats tr:last-child td{ border-bottom: none; }
  /* .hb-stats td:first-child{ text-align:left; } */

  /* name column: take remaining space, never wrap; ellipsize instead */
  .hb-stats td:first-child{
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  /* .hb-stats td:last-child{
    text-align:right; font-weight:800; font-variant-numeric: tabular-nums;
  } */

  /* score column: right aligned, no wrap, fixed width that fits "10 / 2" */
  .hb-stats td:last-child{
    width: 8ch;                  /* fits "10 / 2" or "12" comfortably */
    white-space: nowrap;
    text-align: right;
    font-weight: 800;
  }

  .hb-panel-box-score { padding-top: 8px; }
  .hb-panel-box-score .hb-stats {
    padding: 16px;
    background: #f8f9fc;
  }
  .hb-panel-box-score .hb-row { gap: 18px; }
  .hb-panel-box-score section { min-width: 0; }
  .hb-panel-box-score section h4 {
    display: flex;
    align-items: center;
    min-height: 32px;
    margin: 0 0 8px;
    padding: 0 2px 8px;
    color: var(--text);
    border-bottom: 2px solid #e5e8f0;
    font-size: 12px;
    letter-spacing: .06em;
  }
  .hb-panel-box-score section h4::before {
    content: '';
    width: 4px;
    height: 18px;
    margin-right: 8px;
    border-radius: 2px;
    background: var(--accent);
  }
  .hb-panel-box-score table {
    background: #ffffff;
    border: 1px solid #e3e7ef;
    border-radius: 10px;
  }
  .hb-panel-box-score td {
    padding: 11px 12px;
    font-size: 14px;
  }
  .hb-panel-box-score td:first-child {
    color: #3b3f48;
    font-weight: 650;
  }
  .hb-panel-box-score td:last-child {
    color: var(--accent);
    font-size: 15px;
  }
  .hb-panel-box-score tr:hover td { background: #f7f8ff; }

  /* roster table: shirt number first (narrow, blue), name second (black, fills space) */
  .hb-panel-box-score .hb-roster-table td:first-child {
    width: 6ch;
    white-space: nowrap;
    color: var(--accent);
    text-align: left;
  }
  .hb-panel-box-score .hb-roster-table td:last-child {
    width: auto;
    color: #3b3f48;
    text-align: left;
    font-weight: 650;
    font-size: 14px;
  }
  /* staff rows show role name (e.g. "Þjálfari") instead of a shirt number, needs more width */
  .hb-panel-box-score .hb-roster-table-staff td:first-child {
    width: 34%;
    cursor: help;
  }

  .hb-standings {
    max-width: 100%;
    margin: 8px auto;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #e1e4eb;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }
  .hb-panel-box-score .hb-stats,
  .hb-standings.hb-standings-empty {
    padding: 16px;
    background: #f8f9fc;
  }
  .hb-standings.hb-standings-empty { margin-top: 16px; }
  .hb-standings h4 {
    display: flex;
    align-items: center;
    min-height: 32px;
    margin: 0 0 12px;
    padding: 0 2px 8px;
    color: var(--text);
    border-bottom: 2px solid #e5e8f0;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
  }
  .hb-standings h4::before {
    content: '';
    width: 4px;
    height: 18px;
    margin-right: 8px;
    border-radius: 2px;
    background: var(--accent);
    flex: 0 0 4px;
  }
  .hb-standings-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e3e7ef;
    border-radius: 10px;
  }
  .hb-standings-table {
    width: 100%;
    min-width: 380px;
    border-collapse: collapse;
    background: #ffffff;
  }
  .hb-standings-table th,
  .hb-standings-table td {
    padding: 4px 8px;
    text-align: right;
    white-space: nowrap;
    vertical-align: middle !important;
    line-height: 1;
    color: #3b3f48 !important;
    font-weight: 400 !important;
    font-size: 14px !important;
  }
  .hb-standings-table tbody tr:not(:last-child) td {
    border-bottom: 1px solid #e6e9ef;
  }
  .hb-standings-table th {
    color: var(--muted) !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    background: #f7f8fb;
    border-bottom: 1px solid #e3e7ef;
    position: sticky;
    top: 0;
  }
  .hb-standings-table tbody tr:hover td { background: #f7f8ff; }
  .hb-standings-table tr.is-match-team td { background: rgba(52,76,255,.07); }
  .hb-standings-table tr.is-match-team:hover td { background: rgba(52,76,255,.12); }
  .hb-standings-table tr.is-match-team .hb-standings-pos { box-shadow: inset 3px 0 0 var(--accent); }
  .hb-standings-table th:first-child,
  .hb-standings-table td:first-child { width: 28px; padding-left: 12px; padding-right: 4px; text-align: left; vertical-align: middle !important; }
  .hb-standings-table td:first-child { color: var(--muted) !important; font-weight: 700 !important; }
  .hb-standings-table th:nth-child(2),
  .hb-standings-table td:nth-child(2) { width: auto; padding-left: 10px; padding-top: 6px; padding-bottom: 6px; text-align: left; vertical-align: middle !important; }
  .hb-standings-table th:nth-child(3),
  .hb-standings-table td:nth-child(3),
  .hb-standings-table th:nth-child(4),
  .hb-standings-table td:nth-child(4),
  .hb-standings-table th:nth-child(5),
  .hb-standings-table td:nth-child(5),
  .hb-standings-table th:nth-child(6),
  .hb-standings-table td:nth-child(6) { width: 30px; }
  .hb-standings-table td:nth-child(3),
  .hb-standings-table td:nth-child(4),
  .hb-standings-table td:nth-child(5),
  .hb-standings-table td:nth-child(6) { color: #3b3f48 !important; font-weight: 400 !important; font-size: 14px !important; }
  .hb-standings-table th:nth-child(7),
  .hb-standings-table td:nth-child(7) { width: 42px; }
  .hb-standings-table td:nth-child(7) { color: #3b3f48 !important; font-weight: 400 !important; font-size: 14px !important; }
  .hb-standings-table th:nth-child(8),
  .hb-standings-table td:nth-child(8) { width: 38px; padding-right: 12px; }
  .hb-standings-table td.hb-standings-points { color: #3b3f48 !important; font-size: 14px !important; font-weight: 400 !important; }
  .hb-standings-team { white-space: nowrap; margin-top: 5px; }
  .hb-standings-logo { display: inline-block !important; vertical-align: middle !important; width: 25px !important; height: 25px !important; margin-right: 8px; overflow: hidden; }
  .hb-standings-logo img { width: 100%!important; height: 100%!important; max-width: 100%!important; max-height: 100%!important; object-fit: contain; display: block !important; }
  .hb-standings-team span { display: inline-block !important; vertical-align: middle !important; overflow: hidden; max-width: calc(100% - 33px); white-space: nowrap; text-overflow: ellipsis; font-weight: 650; }


  /* rows container */
  .hb-stats-rows {
    display: grid;
    gap: 16px;
  }

  .hb-row {
    display: grid;
    grid-template-columns: 1fr;  /* one column on mobile */
    gap: 16px;
    align-items: start;
  }
  @media (min-width: 680px) {
    .hb-row { grid-template-columns: 1fr 1fr; }
  }

  /* keep your existing .hb-stats table styles */
  .hb-stats section h4 {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: .08em;
    /*color: rgba(255,255,255,.85);*/
  }  

  #hb-events-root{ max-width:100%; margin:16px auto 0; }
  #hb-pointbypoint-root{ max-width:100%; margin:16px auto; }
  .hb-debug-controls{ max-width:100%; margin:16px auto 0; padding: 10px 14px; display:flex; flex-wrap:wrap; gap:8px; align-items:center; justify-content:center; background: #ffffff; border:1px solid #e1e4eb; border-radius:12px; box-shadow: var(--shadow); }
  .hb-debug-controls button{ appearance:none; border:1px solid #dfe3ea; border-radius:10px; background: #f3f5f9; color: var(--text); min-width:44px; min-height:38px; padding:8px 12px; font:inherit; font-weight:800; cursor:pointer; }
  .hb-debug-controls button:hover{ background: #e9edf5; }
  .hb-debug-controls .hb-debug-minute{ min-width:112px; text-align:center; font-weight:800; }
  .hb-events{ display:grid; gap:10px; }
  .hb-pointbypoint{ display:grid; gap:0; }
  .hb-pointbypoint-row{ display:grid; grid-template-columns:1fr auto 1fr; align-items:center; min-height:44px; border-bottom:1px solid #edf0f5; background:#ffffff; }
  .hb-pointbypoint-row:last-child{ border-bottom:none; }
  .hb-pointbypoint-divider{
    display:flex; align-items:center; justify-content:center;
    gap:10px; padding:10px 8px; margin: 2px 0;
  }
  .hb-pointbypoint-divider::before,
  .hb-pointbypoint-divider::after{ content:''; flex:1; height:1px; background:#e1e4eb; }
  .hb-pointbypoint-divider span{
    font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.06em;
    color: var(--muted); white-space:nowrap;
  }
  .hb-pointbypoint-side{ display:flex; align-items:center; min-width:0; padding:5px 8px; }
  .hb-pointbypoint-side.is-home{ justify-content:flex-end; }
  .hb-pointbypoint-side.is-away{ justify-content:flex-start; }
  .hb-pointbypoint .score{ font-weight:800; font-size:17px; line-height:1; white-space:nowrap; padding:6px 10px; }
  .hb-pointbypoint .score .scoring-team{ color:#e11d48; }
  .hb-pointbypoint .score .opposing-team{ color:#111827; }
  .hb-pointbypoint .score-difference{ font-weight:800; font-size:11px; line-height:1; color:#1da463; white-space:nowrap; background:#f1fbf5; border:1px solid #d9f1e2; border-radius:5px; padding:4px 6px; }
  .hb-ev{
    display:flex; align-items:center;
    background: #ffffff; border:1px solid #e1e4eb;
    border-radius:12px; padding:10px 12px;
  }
  .hb-ev.is-home{ justify-content:flex-start; }
  .hb-ev.is-away{ justify-content:flex-end; text-align:right; }
  .hb-ev-content{ display:grid; grid-template-columns:44px 20px 42px 74px minmax(0, 1fr); gap:10px; align-items:center; max-width:100%; }
  .hb-ev.is-away .hb-ev-content{ grid-template-columns:minmax(0, 1fr) 74px 42px 20px 44px; }
  .hb-ev .clock{ font-weight:800; font-size:14px; white-space:nowrap; }
  .hb-ev .team-logo-slot{ width:20px; height:20px; display:flex; align-items:center; justify-content:center; }
  .hb-ev .team-logo{ width:20px!important; height:20px!important; max-width:20px!important; max-height:20px!important; object-fit:contain; display:block; }
  .hb-ev .kind{ font-size:12px; padding:6px 10px; border-radius:999px;
    border:1px solid #e1e4eb; background: #f3f5f9; }
  .hb-ev .kind .hb-event-icon{ width:20px!important; height:20px!important; max-width:20px!important; max-height:20px!important; object-fit:contain; display:block; }
  .hb-ev .main{ line-height:1.2 }
  .hb-ev .title{ font-weight:700; font-size:14px }
  .hb-ev .score{ font-weight:800; font-size:18px; line-height:1; white-space:nowrap; background:#eef0f4; border-radius:999px; padding:6px 10px; }
  .hb-ev .score-difference{ font-weight:800; font-size:14px; line-height:1; color:#1da463; white-space:nowrap; background:#f1fbf5; border:1px solid #d9f1e2; border-radius:6px; padding:6px 8px; }
  
  /* ===== Responsive upsizes ===== */
  @media (min-width: 480px){
    #hb-match-root{ padding: 18px }
    .hb-top{ padding: 16px }
    .hb-team img{ width: 56px; height: 56px }
    .hb-team .name{ font-size: 18px }
    .hb-score .home, .hb-score .away{ font-size: 34px }
    .hb-score .dash{ font-size: 24px }
  }
  @media (min-width: 680px){
    .hb-top{ grid-template-columns: 1fr auto 1fr; text-align: left }
    .hb-rows{ grid-template-columns: repeat(3, minmax(0,1fr)); }
  }
  @media (max-width: 479px){
    .hb-tabs{ overflow-x:auto; }
    .hb-tab{
      flex:1 1 0;
      min-width:0;
      min-height:48px;
      padding:10px 3px 7px;
      font-size:11px;
      letter-spacing:0;
      line-height:1.15;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }
    .hb-ev-content{ grid-template-columns:44px 20px 42px 74px; }
    .hb-ev.is-away .hb-ev-content{ grid-template-columns:74px 42px 20px 44px; }
    .hb-ev .main{ grid-column:1 / -1; }
    .hb-ev.is-away .main{ text-align:left; }
    .hb-standings-table{ min-width: 0; }
    .hb-standings-table th,
    .hb-standings-table td{ padding-top:3px; padding-bottom:3px; padding-left:3px; padding-right:3px; }
    .hb-standings-table td{ font-size:11px !important; }
    .hb-standings-table th:first-child,
    .hb-standings-table td:first-child{ width:18px; padding-left:6px; padding-right:2px; }
    .hb-standings-table th:nth-child(2),
    .hb-standings-table td:nth-child(2){ padding-left:6px; }
    .hb-standings-table th:nth-child(3),
    .hb-standings-table td:nth-child(3),
    .hb-standings-table th:nth-child(4),
    .hb-standings-table td:nth-child(4),
    .hb-standings-table th:nth-child(5),
    .hb-standings-table td:nth-child(5),
    .hb-standings-table th:nth-child(6),
    .hb-standings-table td:nth-child(6){ width:20px; }
    .hb-standings-table th:nth-child(7),
    .hb-standings-table td:nth-child(7){ width:30px; }
    .hb-standings-table th:nth-child(8),
    .hb-standings-table td:nth-child(8){ width:26px; padding-right:6px; }
    .hb-standings-logo{ width:20px !important; height:20px !important; margin-right:6px; }
    .hb-standings-team span{ max-width: calc(100% - 26px); }
  }

  /* Accessibility: reduce motion */
  @media (prefers-reduced-motion: reduce){ *{ animation: none!important; transition: none!important } }

