/* =========================================================================
   Liverättning / resultattabell (ny design, dec 2026)
   Markup: plugins/sport-shortcodes/liverattning-markup.php
   JS:     js/plugins/roundinfo.js
   Mobil = max-width 639px (samma som Foundations small).
   ========================================================================= */

.lr {
  --lr-ink: #1E2430;
  --lr-ink-2: #5B6474;
  --lr-faint: #9AA1AD;
  --lr-green: #17663A;
  --lr-green-bg: #E3F4E9;
  --lr-red: #C2334D;
  --lr-accent: #D13B62;
  --lr-line: #E3E6EB;
  --lr-line-2: #EEF0F3;
  --lr-surface: #F7F8FA;
  font-family: "FoundersGrotesk", "Hanken Grotesk", sans-serif;
  color: var(--lr-ink);
  margin-top: 20px;
}
.lr *, .lr *::before, .lr *::after { box-sizing: border-box; }
.lr [hidden] { display: none !important; }

/* Visa/dölj per brytpunkt */
.lr .lr-m, .lr .lr-m-flex, .lr .lr-m-block { display: none; }
.lr .lr-d { display: inline; }
.lr .lr-d-flex { display: flex; }

/* ---------- Huvud: titel, knappar, chips ---------- */
.lr-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.lr-head--notitle { align-items: center; margin-bottom: 16px; }
.lr .lr-title {
  margin: 0;
  min-width: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--lr-ink);
  text-transform: none;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lr-tools { display: flex; gap: 8px; flex-shrink: 0; }
.lr .lr-tool {
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 10px;
  background: var(--lr-ink);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color .15s ease;
}
.lr .lr-tool[aria-pressed="true"] { background: var(--lr-accent); }
.lr .lr-tool:focus-visible { outline: 2px solid var(--lr-accent); outline-offset: 2px; }
.lr .lr-tool .lr-ico-off { display: none; }
.lr .lr-tool[aria-pressed="true"] .lr-ico-on { display: none; }
.lr .lr-tool[aria-pressed="true"] .lr-ico-off { display: block; }

.lr-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.lr-chips--row { margin-bottom: 16px; }
.lr-chip {
  padding: 7px 12px;
  border-radius: 999px;
  background: #FFFFFF;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}
.lr-chip strong { font-weight: 700; }
.lr-chip--game { background: #01407A; color: #FFFFFF; font-weight: 700; }
.lr-chip--europatipset { background: #00843D; }
.lr-chip--topptipset { background: #E25A1C; }
.lr-chip--powerplay { background: #A00813; }
.lr-muted { color: var(--lr-ink-2); }
.lr-faint { color: var(--lr-faint); font-weight: 400; }

/* ---------- Kortet ---------- */
.lr-card {
  background: #FFFFFF;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(30, 36, 48, 0.08);
}
.lr-canceled { margin: 0; padding: 14px 24px; color: #B0123A; font-weight: 700; border-bottom: 1px solid var(--lr-line); }
.lr-scroll { overflow-x: auto; }

/* ---------- Tabellen (nollställer Foundations tabellstil) ---------- */
.lr table.lr-table {
  width: 100%;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  background: transparent;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.lr .lr-table thead, .lr .lr-table tbody { border: 0; background: transparent; }
.lr .lr-table tr { background: #FFFFFF; }
.lr .lr-table tbody tr:nth-child(even) { background: #FAFBFC; }
.lr .lr-table tbody tr { border-top: 1px solid var(--lr-line-2); }
.lr .lr-table th, .lr .lr-table td {
  padding: 10px 8px;
  vertical-align: middle;
  text-align: left;
  line-height: 1.3;
  border: 0;
}
.lr .lr-table thead tr { background: var(--lr-surface); }
.lr .lr-table th {
  padding-top: 12px;
  padding-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--lr-ink-2);
  white-space: nowrap;
  text-transform: none;
  letter-spacing: normal;
}
/* Fast bredd för två siffror, så att matchkolumnen hamnar på samma ställe
   oavsett om omgången har 8 eller 13 matcher. */
.lr .lr-table .lr-c-nr { padding-left: 24px; padding-right: 4px; width: 50px; min-width: 50px; }
.lr .lr-table td.lr-c-nr { color: var(--lr-ink-2); font-weight: 700; }
.lr .lr-table .lr-c-time { text-align: center; width: 64px; }
.lr .lr-table .lr-c-res { text-align: center; width: 72px; }
.lr .lr-table .lr-c-sign { text-align: center; width: 116px; }
.lr .lr-table .lr-c-picks {
  border-left: 1px solid var(--lr-line-2);
  padding-left: 16px;
  padding-right: 24px;
  width: 1%;
}

tr.lr-goal { animation: lr-goal 2.4s ease-out; }
@keyframes lr-goal { 0%, 40% { background: #FFF4CC; } 100% { background: inherit; } }

/* Match */
.lr .lr-teams {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: inherit;
  text-decoration: none;
}
.lr a.lr-teams:hover .lr-team { text-decoration: underline; text-decoration-color: var(--lr-line); }
.lr-team { display: inline-flex; align-items: center; gap: 4px; font-weight: 400; }
.lr-team.is-win { font-weight: 700; }
.lr-dash { color: var(--lr-faint); }
.lr-card-red {
  display: inline-block;
  width: 7px;
  height: 10px;
  border-radius: 1px;
  background: #E2001A;
}

/* %-chips och 1X2-bubblor */
.lr-chiprow { display: flex; gap: 3px; margin-top: 6px; }
.lr-pct { display: none; }
.lr--pct .lr-pct { display: flex; }
.lr-mini {
  width: 32px;
  height: 22px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 400;
  background: #F0F2F5;
  color: #4A5160;
}
.lr-mini.is-hi { background: var(--lr-green-bg); color: var(--lr-green); }
.lr-mini.is-lo { background: #FDE8EA; color: #B0123A; }
.lr-mini.is-sign { font-weight: 700; }
.lr-mini--dark { background: var(--lr-ink); color: #FFFFFF; font-weight: 700; }

/* Tid */
.lr-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #E6F4EA;
  color: var(--lr-green);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.lr-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: #1FA05A;
  animation: lr-pulse 1.6s ease-in-out infinite;
}
@keyframes lr-pulse { 50% { opacity: .35; } }
.lr-info { font-size: 13px; font-weight: 700; color: var(--lr-ink-2); }

/* Resultat */
.lr-res {
  display: inline-block;
  min-width: 46px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #F0F2F5;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color .3s, color .3s;
}
.lr-res.is-goal { background: #1FA05A; color: #FFFFFF; }

/* Tecken (desktop) */
.lr-signs { justify-content: center; align-items: flex-start; gap: 2px; }
.lr-signcol { width: 32px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.lr-sign {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 400;
  background: #FFFFFF;
  color: #8A919C;
  border: 1px solid var(--lr-line);
}
.lr-sign.is-on { background: var(--lr-ink); color: #FFFFFF; border-color: var(--lr-ink); font-weight: 700; }

.lr-sys { display: none; }
.lr--sys .lr-sysbar { display: flex; }
.lr-sysbar { width: 32px; flex-direction: column; align-items: center; gap: 3px; }
.lr-bar { display: block; width: 28px; height: 4px; border-radius: 2px; background: var(--lr-line-2); overflow: hidden; }
.lr-bar > span { display: block; height: 4px; background: var(--lr-ink-2); }
.lr-barpct { font-size: 11px; line-height: 1; font-weight: 400; color: var(--lr-ink-2); }
.lr-sysbar.is-on .lr-bar > span { background: var(--lr-green); }
.lr-sysbar.is-on .lr-barpct { color: var(--lr-green); font-weight: 700; }

.lr--anim-sys .lr-sys, .lr--anim-pct .lr-pct { animation: lr-in .22s ease-out both; }
@keyframes lr-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* Tkn (mobil) */
.lr-tkn {
  width: 26px;
  height: 26px;
  margin: 0 auto;
  border-radius: 6px;
  line-height: 26px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  background: #F0F2F5;
  color: var(--lr-faint);
}
.lr-tkn.is-on { background: var(--lr-ink); color: #FFFFFF; }

/* Dina rader */
.lr-picks { display: flex; gap: 8px; }
.lr-pick, .lr-total {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.lr-pick.is-ok { background: var(--lr-green-bg); color: var(--lr-green); }
.lr-pick.is-bad { color: var(--lr-red); }
.lr-pick.is-wait { color: var(--lr-faint); font-weight: 400; }

.lr-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lr-pager-btns { display: flex; gap: 4px; }
.lr .lr-page {
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--lr-line);
  border-radius: 6px;
  background: #FFFFFF;
  color: var(--lr-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lr .lr-page:disabled { opacity: .35; cursor: default; }

.lr .lr-table tr.lr-sum { background: var(--lr-surface); border-top: 1px solid var(--lr-line); }
.lr .lr-table td.lr-sum-label {
  padding: 12px 8px 12px 24px;
  font-size: 13px;
  font-weight: 700;
  color: var(--lr-ink-2);
}
.lr .lr-table tr.lr-sum td { padding-top: 12px; padding-bottom: 12px; }
.lr-total { border-radius: 14px; font-size: 12px; background: var(--lr-ink-2); color: #FFFFFF; }
.lr-total.is-good { background: var(--lr-green); }

/* ---------- Vinstfält ---------- */
.lr-tiers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--lr-line);
}
.lr-tiers[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.lr-tiers[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lr-tiers[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lr-tier { padding: 16px 24px; border-right: 1px solid var(--lr-line); }
.lr-tier:last-child { border-right: 0; }
.lr-tier-label { font-size: 12px; font-weight: 700; color: var(--lr-ink-2); }
.lr-tier-pay { font-size: 20px; font-weight: 700; margin-top: 2px; }
.lr-tier-mine {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--lr-surface);
  color: var(--lr-ink-2);
  font-size: 13px;
}
.lr-tier-mine strong { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lr-tier-mine.is-won { background: var(--lr-green-bg); color: var(--lr-green); }

.lr-win {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-top: 1px solid var(--lr-line);
  background: var(--lr-surface);
  color: var(--lr-ink);
}
.lr-win.is-won { border-top: 0; background: var(--lr-green); color: #FFFFFF; }
.lr-win-title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.lr-win-sub { font-size: 13px; margin-top: 2px; color: var(--lr-ink-2); }
.lr-win.is-won .lr-win-sub { color: #D5EEDD; }
.lr-win-sum { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Svenska Spel-box och banner under kortet */
.lr-after { margin-top: 8px; }
.lr-after .svsbox { margin-top: 24px; margin-bottom: 24px; }

/* =========================================================================
   Mobil
   ========================================================================= */
@media screen and (max-width: 639px) {
  .lr { margin-top: 12px; }
  .lr .lr-d, .lr .lr-d-flex { display: none; }
  .lr .lr-m { display: inline; }
  .lr .lr-m-flex { display: flex; }
  .lr .lr-m-block { display: block; }

  .lr-head { gap: 10px; margin-bottom: 10px; }
  .lr .lr-title { font-size: 18px; }
  .lr-tools { gap: 6px; }
  .lr .lr-tool { width: 36px; height: 36px; border-radius: 9px; font-size: 12px; }
  .lr .lr-tool svg { width: 17px; height: 17px; }
  .lr-chips { gap: 6px; }
  .lr-chips--row, .lr-head--notitle { margin-bottom: 10px; }
  .lr-chip { padding: 6px 10px; font-size: 12px; }

  .lr-card { border-radius: 12px; }
  .lr table.lr-table { font-size: 14px; }
  .lr .lr-table th { padding: 8px 6px; font-size: 11px; }
  .lr .lr-table td { padding: 9px 6px; }
  .lr .lr-table .lr-c-nr { padding-left: 12px; padding-right: 4px; width: 34px; min-width: 34px; }
  .lr .lr-table td.lr-c-nr { font-size: 13px; }
  .lr .lr-table .lr-c-time { width: 30px; padding-left: 2px; padding-right: 2px; }
  .lr .lr-table .lr-c-res { width: 40px; padding-left: 4px; padding-right: 4px; }
  .lr .lr-table .lr-c-sign { width: 28px; padding-left: 4px; padding-right: 4px; }
  .lr .lr-table .lr-c-picks { padding-left: 6px; padding-right: 8px; }
  .lr .lr-table th.lr-c-picks { padding-top: 4px; padding-bottom: 4px; }

  .lr .lr-teams { flex-direction: column; align-items: flex-start; gap: 0; flex-wrap: nowrap; }
  .lr-team { max-width: 100%; }
  .lr-dash { display: none; }
  .lr-card-red { width: 6px; height: 9px; }

  .lr-mini { width: 28px; height: 20px; font-size: 11px; }
  .lr--sys .lr-sys.lr-m-flex { display: flex; }
  .lr-sys.lr-m-flex { display: none; }

  .lr-live { padding: 0; background: none; gap: 3px; font-size: 12px; }
  .lr-live-dot { width: 5px; height: 5px; }
  .lr-info { font-size: 12px; }
  .lr-res { min-width: 34px; padding: 3px; font-size: 13px; }

  .lr-picks { gap: 4px; justify-content: space-around; }
  .lr-pick, .lr-total { width: 26px; height: 26px; border-radius: 6px; }
  .lr-total { border-radius: 13px; }
  .lr-pager { gap: 2px; }
  .lr .lr-page { width: 22px; height: 22px; border: 0; }
  .lr .lr-table td.lr-sum-label { padding: 10px 6px 10px 12px; font-size: 12px; }
  .lr .lr-table td.lr-sum-label .lr-faint { display: none; }

  .lr-tiers, .lr-tiers[data-count="3"], .lr-tiers[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lr-tier { padding: 12px 14px; border-bottom: 1px solid var(--lr-line); }
  .lr-tier:nth-child(2n) { border-right: 0; }
  .lr-tiers[data-count="1"] .lr-tier { border-right: 0; }
  .lr-tiers[data-count="4"] .lr-tier:nth-child(n+3),
  .lr-tiers[data-count="2"] .lr-tier,
  .lr-tiers[data-count="1"] .lr-tier { border-bottom: 0; }
  .lr-tier-label { font-size: 11px; }
  .lr-tier-pay { font-size: 16px; margin-top: 1px; }
  .lr-tier-mine { margin-top: 8px; padding: 5px 8px; border-radius: 7px; font-size: 12px; gap: 6px; }

  .lr-win { padding: 14px; gap: 12px; }
  .lr-win > div:first-child { min-width: 0; }
  .lr-win-title { font-size: 13px; }
  .lr-win-sub { font-size: 12px; }
  .lr-win-sum { font-size: 22px; }
}
