/* Shared Quant Analytics Primitives across all 4 Regional Architectures:
   1. Dark-safe PNG Crest & Tennis Portrait Medallion (alpha-contour white halo)
   2. 5x5 Poisson Exact Scoreline Heatmap Matrix
   3. Verified Model Accuracy Banner & Settled Hit/Miss Pills
   4. Confidence Index (X.X / 10) & % <-> Fair 1/P Unit Switcher
*/

/* 1. Crest & Player Medallions — solves dark/black transparent PNGs on dark themes */
.pw-crest {
  inline-size: 2.1rem;
  block-size: 2.1rem;
  border-radius: 8px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.08) 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: inline-grid;
  place-items: center;
  padding: 3px;
  flex: none;
  overflow: clip;
  aspect-ratio: 1;
}

.pw-crest--lg {
  inline-size: 4rem;
  block-size: 4rem;
  border-radius: 14px;
  padding: 6px;
}

.pw-crest--light {
  background: radial-gradient(circle, #ffffff 0%, #f1f5f9 100%);
  border-color: #cbd5e1;
}

.pw-crest img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
  /* Alpha-channel luminous rim makes dark crests (Tottenham, Juventus, Newcastle, Gladbach) pop cleanly */
  filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.92)) drop-shadow(0 2px 5px rgba(0, 0, 0, 0.38));
}

.pw-crest--tennis img {
  object-fit: cover;
  object-position: top center;
  border-radius: 6px;
}

.pw-crest--light img {
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.16));
}

.pw-crest-fallback {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  display: grid;
  place-items: center;
  inline-size: 100%;
  block-size: 100%;
  border-radius: 6px;
}

.pw-crest--lg .pw-crest-fallback {
  font-size: 1.05rem;
  border-radius: 10px;
}

.pw-comp-icon {
  inline-size: 1.15rem;
  block-size: 1.15rem;
  object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(0 0 1.2px rgba(255, 255, 255, 0.9));
}

/* 2. Unit Switcher (% Prob <-> Fair 1/P) */
.pw-unit-switch {
  display: inline-flex;
  border-radius: 8px;
  padding: 2px;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.25);
  gap: 2px;
}

.pw-unit-btn {
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.72;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.26rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.pw-unit-btn[aria-pressed="true"] {
  opacity: 1;
  background: #38bdf8;
  color: #041019;
}

/* 3. Verified Model Accuracy Strip */
.pw-accuracy-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: safe center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.8rem 1.1rem;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.14), rgba(56, 189, 248, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.35);
  margin-block-end: 1rem;
}

.pw-accuracy-bar--light {
  background: linear-gradient(90deg, #ecfdf5, #eff6ff);
  border-color: #6ee7b7;
  color: #0f172a;
}

.pw-acc-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.1rem;
  font-size: 0.84rem;
}

.pw-acc-kpi {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
}

.pw-acc-kpi strong {
  font-size: 1.08rem;
  font-weight: 900;
  color: #10b981;
}

.pw-accuracy-bar--light .pw-acc-kpi strong {
  color: #047857;
}

.pw-hit-pill,
.pw-miss-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.pw-hit-pill {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.pw-miss-pill {
  background: rgba(244, 63, 94, 0.16);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

/* 4. Confidence Rating Badge (X.X / 10) & Recommended Primary Call Banner */
.pw-conf-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.32);
}

.pw-conf-pill--high {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.38);
}

.pw-conf-pill--light {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.pw-call-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-block-end: 1.15rem;
}

.pw-call-card {
  padding: 0.95rem 1.1rem;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.28);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.pw-call-card--light {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.pw-call-kicker {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.72;
  display: block;
  margin-block-end: 0.2rem;
}

/* 5. 5x5 Poisson Scoreline Heatmap Matrix */
.pw-matrix-wrap {
  overflow-x: auto;
}

.pw-matrix-grid {
  display: grid;
  grid-template-columns: auto repeat(5, minmax(52px, 1fr));
  gap: 5px;
  min-inline-size: 320px;
}

.pw-matrix-hdr {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.7;
  display: grid;
  place-items: center;
  padding: 0.3rem;
}

.pw-matrix-cell {
  border-radius: 8px;
  padding: 0.45rem 0.3rem;
  text-align: center;
  border: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  background: rgba(56, 189, 248, calc(0.05 + var(--heat, 0.1) * 0.48));
}

.pw-matrix-cell--draw {
  background: rgba(148, 163, 184, calc(0.06 + var(--heat, 0.1) * 0.38));
}

.pw-matrix-cell--p2 {
  background: rgba(52, 211, 153, calc(0.05 + var(--heat, 0.1) * 0.48));
}

.pw-matrix-cell strong {
  font-size: 0.76rem;
}

.pw-matrix-cell span {
  font-size: 0.74rem;
  font-weight: 700;
}

/* Clickable sidebar & day filter links */
.pw-click-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.48rem 0.65rem;
  border-radius: 8px;
  transition: background 0.15s, border-color 0.15s;
  border: 1px solid transparent;
  cursor: pointer;
}

.pw-click-row:hover,
.pw-click-row[aria-current="true"] {
  background: rgba(56, 189, 248, 0.13);
  border-color: rgba(56, 189, 248, 0.42);
}

.pw-day-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-block-end: 0.75rem;
}

.pw-day-pill {
  padding: 0.34rem 0.72rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid rgba(148, 163, 184, 0.28);
  opacity: 0.82;
}

.pw-day-pill[aria-current="true"],
.pw-day-pill:hover {
  opacity: 1;
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.16);
}
