/* Poisson Score Predictor — structural styles.
 * ---------------------------------------------------------------------
 * EVERY visual decision routes through an --sp-* custom property with a
 * neutral fallback. Sites MUST override these (footprint rule — see
 * ADAPT.md). Never edit this file per site; skin via variables only.
 * --------------------------------------------------------------------- */

score-predictor {
  display: block;
  font-family: var(--sp-font, inherit);
  color: var(--sp-ink, #222833);
}

/* SEO fallback: visible until JS upgrades, then sr-only for crawlers. */
score-predictor.sp-enhanced .sp-fallback,
.sp-vh {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

.sp-stage {
  border: var(--sp-border, 1px solid #d9dde4);
  border-radius: var(--sp-radius, 10px);
  background: var(--sp-bg, #fbfbfc);
  padding: var(--sp-pad, 1.1rem);
}

.sp-sec-title {
  margin: 0 0 .55rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--sp-muted, #6a7280);
}
.sp-stage section + section { margin-top: 1.35rem; }

/* ------------------------------------------------------------- inputs */
.sp-modes { display: flex; gap: .4rem; margin-bottom: .8rem; }
.sp-mode {
  font: inherit;
  font-size: .85rem;
  padding: .38rem .8rem;
  cursor: pointer;
  color: var(--sp-ink, #222833);
  background: var(--sp-chip-bg, #eef0f4);
  border: var(--sp-chip-border, 1px solid #d9dde4);
  border-radius: var(--sp-chip-radius, 999px);
}
.sp-mode-on {
  background: var(--sp-accent, #31567f);
  color: var(--sp-accent-ink, #fff);
  border-color: transparent;
}
.sp-mode:focus-visible,
.sp-input:focus-visible {
  outline: 2px solid var(--sp-focus, #31567f);
  outline-offset: 2px;
}

.sp-names, .sp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.sp-grid2 { margin-top: .6rem; }
@media (max-width: 560px) { .sp-names, .sp-grid2 { grid-template-columns: 1fr; } }

.sp-field { display: flex; flex-direction: column; gap: .25rem; }
.sp-field-label { font-size: .8rem; color: var(--sp-muted, #6a7280); }

.sp-input {
  font: inherit;
  font-size: .95rem;
  padding: .45rem .6rem;
  color: var(--sp-ink, #222833);
  background: var(--sp-input-bg, #fff);
  border: var(--sp-input-border, 1px solid #c9cfd8);
  border-radius: var(--sp-input-radius, 7px);
  width: 100%;
  box-sizing: border-box;
}
.sp-name { font-weight: 600; }

.sp-derived {
  margin: .7rem 0 0;
  font-size: .9rem;
  color: var(--sp-accent, #31567f);
  font-weight: 600;
}

.sp-team-select { cursor: pointer; font-weight: 600; }

.sp-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-top: .7rem;
}
.sp-preset {
  font: inherit;
  font-size: .82rem;
  padding: .28rem .7rem;
  cursor: pointer;
  color: var(--sp-ink, #222833);
  background: var(--sp-chip-bg, #eef0f4);
  border: var(--sp-chip-border, 1px solid #d9dde4);
  border-radius: var(--sp-chip-radius, 999px);
}
.sp-preset:hover {
  border-color: var(--sp-accent, #31567f);
}
.sp-preset:focus-visible {
  outline: 2px solid var(--sp-focus, #31567f);
  outline-offset: 2px;
}

.sp-summary {
  margin: .8rem 0 0;
  font-size: .92rem;
  line-height: 1.5;
  padding: .6rem .75rem;
  background: var(--sp-tile-bg, #f2f4f7);
  border: var(--sp-tile-border, 1px solid #e2e5ea);
  border-radius: var(--sp-tile-radius, 8px);
}

/* -------------------------------------------------------- outcome bar */
.sp-bar {
  display: flex;
  height: var(--sp-bar-height, 14px);
  border-radius: var(--sp-bar-radius, 7px);
  overflow: hidden;
  background: var(--sp-chip-bg, #eef0f4);
}
.sp-seg { min-width: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .sp-seg { transition: flex-grow .35s ease; }
}
.sp-seg-home { background: var(--sp-home, #31567f); }
.sp-seg-draw { background: var(--sp-draw, #a3adba); }
.sp-seg-away { background: var(--sp-away, #b06542); }

.sp-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin-top: .65rem; }
.sp-legend-item { display: flex; align-items: baseline; gap: .4rem; font-size: .9rem; }
.sp-dot {
  width: .65em; height: .65em;
  border-radius: 50%;
  display: inline-block;
  align-self: center;
}
.sp-legend-label { color: var(--sp-muted, #6a7280); }
.sp-legend-p { font-variant-numeric: tabular-nums; }
.sp-legend-odds {
  font-size: .8rem;
  color: var(--sp-muted, #6a7280);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------- top scores */
.sp-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.sp-chip {
  font-size: .9rem;
  padding: .3rem .65rem;
  background: var(--sp-chip-bg, #eef0f4);
  border: var(--sp-chip-border, 1px solid #d9dde4);
  border-radius: var(--sp-chip-radius, 999px);
  font-variant-numeric: tabular-nums;
}
.sp-chip strong { margin-right: .3rem; }
.sp-chip-top {
  background: var(--sp-accent, #31567f);
  color: var(--sp-accent-ink, #fff);
  border-color: transparent;
}
.sp-note { margin: .55rem 0 0; font-size: .82rem; color: var(--sp-muted, #6a7280); }

/* ------------------------------------------------------------ heatmap */
.sp-heat-scroll { overflow-x: auto; }
.sp-heat {
  border-collapse: collapse;
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  min-width: 320px;
}
.sp-heat th, .sp-heat td {
  padding: .3rem .45rem;
  text-align: center;
  border: var(--sp-heat-line, 1px solid #e4e7ec);
}
.sp-heat th {
  color: var(--sp-muted, #6a7280);
  font-weight: 600;
  background: var(--sp-chip-bg, #eef0f4);
}
.sp-heat td {
  /* --sp-heat is set per cell (0..1) by the engine; the color is themeable */
  background: color-mix(in srgb,
    var(--sp-heat-color, #31567f) calc(var(--sp-heat, 0) * 82%),
    var(--sp-heat-base, transparent));
}
.sp-heat td.sp-heat-hot { color: var(--sp-accent-ink, #fff); }

/* ------------------------------------------------------------ markets */
.sp-markets {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.sp-markets th {
  text-align: left;
  font-size: .78rem;
  color: var(--sp-muted, #6a7280);
  border-bottom: var(--sp-table-line, 2px solid #d9dde4);
  padding: .35rem .5rem;
}
.sp-markets td {
  padding: .42rem .5rem;
  border-bottom: var(--sp-table-line-light, 1px solid #e9ecf0);
  font-variant-numeric: tabular-nums;
}
.sp-markets td:nth-child(2), .sp-markets td:nth-child(3),
.sp-markets th:nth-child(2), .sp-markets th:nth-child(3) { text-align: right; }

/* -------------------------------------------------------- value check */
.sp-value-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: .7rem; }
@media (max-width: 560px) { .sp-value-grid { grid-template-columns: 1fr; } }
.sp-value-cell {
  background: var(--sp-tile-bg, #f2f4f7);
  border: var(--sp-tile-border, 1px solid #e2e5ea);
  border-radius: var(--sp-tile-radius, 8px);
  padding: .65rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.sp-value-name { font-size: .85rem; font-weight: 600; }
.sp-value-verdict { font-size: .82rem; min-height: 1.2em; font-variant-numeric: tabular-nums; }
.sp-value-yes { color: var(--sp-good, #2c6e49); font-weight: 700; }
.sp-value-no { color: var(--sp-bad, #9c3f3f); }

/* --------------------------------------------------------- compact + CTA */
.sp-compact section + section { margin-top: 1rem; }
.sp-cta {
  display: block;
  margin-top: 1.1rem;
  text-align: center;
  font-family: var(--sp-cta-font, inherit);
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  padding: .75rem 1rem;
  color: var(--sp-cta-ink, #fff);
  background: var(--sp-cta-bg, var(--sp-accent, #31567f));
  border: var(--sp-cta-border, 0);
  border-radius: var(--sp-input-radius, 7px);
}
.sp-cta:hover { background: var(--sp-cta-bg-hover, var(--sp-ink, #222833)); }
.sp-cta:focus-visible { outline: 2px solid var(--sp-focus, #31567f); outline-offset: 2px; }

/* --------------------------------------------------------- disclaimer */
.sp-disclaimer {
  margin: 1.3rem 0 0;
  font-size: .78rem;
  color: var(--sp-muted, #6a7280);
  border-top: var(--sp-table-line-light, 1px solid #e9ecf0);
  padding-top: .7rem;
}
