/* Omgångens och säsongens tippare (tippare.js): rutorna under kupongen på
   förstasidan. Laddas efter kupong.css och använder dess tokens (--kp-ok,
   --kp-no) och .kp-eyebrow/.kp-line. Plus = bättre än modellen (grönt),
   minus = sämre (rött). */

#tippare:empty { display: none; }
#tippare { margin-top: 16px; }

.tp-card { display: grid; gap: 12px; padding: 22px 24px; }
/* Tabellen och etiketterna får inte göra rutan bredare än skärmen. */
.tp-card > * { min-width: 0; }

.tp-list { list-style: none; margin: 0; padding: 0; }
.tp-row {
  display: grid;
  grid-template-columns: 1.6em minmax(0, 1fr) auto 4.2em;
  align-items: center;
  gap: 4px 14px;
  padding: 11px 0;
  border-top: 1px solid var(--hair);
}
.tp-row:first-child { border-top: 0; }
.tp-rank {
  font-family: var(--display);
  font-size: 20px;
  color: var(--muted);
  text-align: center;
}
.tp-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.tp-name b { font-size: 16px; font-weight: 650; color: var(--fg); }
.tp-name .sub { font-size: 12.5px; }
.tp-ok { font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 650; color: var(--ink-soft); }
.tp-ok span { color: var(--muted); font-weight: 500; }
.tp-pts {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--ink-soft);
}

.tp-badge {
  display: inline-block;
  padding: 2px 9px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
}
.tp-badge.best { color: #1a1408; background: var(--gold-grad); }
.tp-badge.worst { color: var(--kp-no); background: var(--down-soft); }
.tp-row.is-best .tp-rank { color: var(--gold-hi); }

.tp-model .tp-name b { font-weight: 500; color: var(--ink-soft); }
.tp-model .tp-pts { font-size: 19px; }
.tp-model { opacity: 0.8; }

.tp-card .pos { color: var(--kp-ok); }
.tp-card .neg { color: var(--kp-no); }

.tp-missing, .tp-status { margin: 0; }

/* ---------- poäng per match ---------- */

.tp-more > summary { font-size: 13.5px; color: var(--ink-soft); }
.tp-more .legend { margin: 10px 0; }
.tp-more .table-wrap { margin: 0; }
.tp-table th, .tp-table td { padding: 0.45rem 0.6rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tp-table thead th:not(:first-child), .tp-table td { text-align: right; }
.tp-table tbody th, .tp-table tfoot th {
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg);
  white-space: normal;
  min-width: 11em;
}
.tp-table tbody th .sub, .tp-table tbody th .sp-chip { display: block; font-size: 12px; margin-top: 2px; }
.tp-table tbody tr:last-child > * { border-bottom: 0; }
.tp-table tfoot th, .tp-table tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--border); }
.tp-sign {
  display: inline-block;
  min-width: 2.1em;
  margin-right: 6px;
  padding: 1px 5px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  border-radius: 5px;
  border: 1px solid var(--pill-line);
  color: var(--ink-soft);
}
.tp-sign.ok { border-color: var(--kp-ok); color: var(--kp-ok); }
.tp-sign.no { border-color: var(--kp-no); color: var(--kp-no); }
.tp-none { color: var(--muted); }

/* ---------- säsongens tippare ---------- */

.tp-card + .tp-card { margin-top: 16px; }
.tp-swrap { overflow-x: auto; }
.tp-stable { width: 100%; border-collapse: collapse; font-size: 14px; }
.tp-stable th, .tp-stable td {
  padding: 11px 0 11px 14px;
  border-bottom: 0;
  border-top: 1px solid var(--hair);
  vertical-align: middle;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tp-stable thead th { padding-top: 0; padding-bottom: 8px; border-top: 0; border-bottom: 1px solid var(--border); }
.tp-stable tbody tr:first-child > * { border-top: 0; }
.tp-stable tr > :first-child { padding-left: 0; }
.tp-stable .tp-c, .tp-stable .tp-ok, .tp-stable .tp-pts { text-align: right; }
.tp-stable .tp-rank { width: 1.6em; font-size: 20px; }
.tp-stable .tp-who {
  width: 100%;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
}
.tp-stable td.tp-c { font-size: 15px; font-weight: 650; color: var(--ink-soft); }
.tp-srow.is-lead .tp-rank { color: var(--gold-hi); }
.tp-stable .tp-model .tp-name b { font-weight: 500; color: var(--ink-soft); }
.tp-stable .tp-model .tp-pts { font-size: 19px; }
.tp-stable .tp-model { opacity: 0.8; }
.tp-vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.tp-show {
  margin-left: 10px;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--ink-soft);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.tp-show:hover { color: var(--fg); }
.tp-table .tp-aw { display: inline-block; padding: 0 5px; border: 1px solid; border-radius: 5px; }
.tp-table .tp-aw.best { border-color: var(--gold-hi); }
.tp-table .tp-aw.worst { border-color: var(--kp-no); }
.tp-rounds .tp-table tbody th { white-space: nowrap; }
.tp-rounds .tp-table tbody th .sub { display: block; font-size: 12px; margin-top: 2px; }

@media (max-width: 520px) {
  .tp-card { padding: 18px 16px; }
  .tp-given { display: none; }
  .tp-stable th, .tp-stable td { padding-left: 10px; }
  .tp-stable .tp-rank { width: 1.3em; font-size: 18px; }
  .tp-rounds .tp-table tbody th, .tp-rounds .tp-table tfoot th { min-width: 5.5em; }
  .tp-rounds .tp-table th, .tp-rounds .tp-table td { padding-left: 0.35rem; padding-right: 0.35rem; }
  .tp-row { grid-template-columns: 1.3em minmax(0, 1fr) auto 3.6em; gap: 4px 10px; }
  .tp-name b { font-size: 15px; }
  .tp-pts { font-size: 21px; }
  .tp-table tbody th, .tp-table tfoot th { min-width: 8.5em; }
}
