/**
 * OddsDrops – Formation pitch (flat 2D top-down + badges)
 */
.od-fp {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(220px, 2.2fr) minmax(140px, 1fr);
  gap: 12px 16px;
  align-items: start;
  color: #e2e8f0;
  font-size: 13px;
}

.od-fp-compact {
  grid-template-columns: 1fr;
  gap: 10px;
}

.od-fp-side {
  min-width: 0;
}

.od-fp-side-away .od-fp-list li {
  flex-direction: row;
}

.od-fp-side-home .od-fp-list li {
  flex-direction: row-reverse;
  text-align: right;
}

.od-fp-side-home .od-fp-list-num {
  margin-left: 0;
  margin-right: 8px;
  text-align: left;
}

.od-fp-side-away .od-fp-list-num {
  margin-right: 0;
  margin-left: 8px;
  text-align: right;
}

.od-fp-team-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.od-fp-team-id {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.od-fp-badge-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.25);
}

.od-fp-team-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #f1f5f9;
  text-transform: capitalize;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.od-fp-side-home .od-fp-team-name { color: #34d399; }
.od-fp-side-away .od-fp-team-name { color: #fb7185; }

/* Score / live header above pitch */
.od-fp-scorehead {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 8px;
  min-height: 1.5rem;
}

.od-fp-scoreline {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 1.55rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: 0.02em;
}

.od-fp-score-h { color: #34d399; }
.od-fp-score-a { color: #fb7185; }
.od-fp-score-sep { color: #94a3b8; font-weight: 600; }

.od-fp-ht {
  font-size: 12px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.od-fp-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #4ade80;
  text-transform: uppercase;
}

.od-fp-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: od-fp-pulse 1.4s ease-out infinite;
}

@keyframes od-fp-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.od-fp-status-min {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Legend under pitch */
.od-fp-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  margin-top: 8px;
  font-size: 12px;
  color: #94a3b8;
}

.od-fp-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  opacity: 0.95;
}

.od-fp-leg-muted {
  font-size: 10px;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.od-fp-form {
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 2px 8px;
  border-radius: 999px;
  background: #1e293b;
  color: #94a3b8;
  white-space: nowrap;
}

.od-fp-label {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 4px;
}

.od-fp-subs-title {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #fbbf24;
  font-weight: 700;
  margin: 10px 0 4px;
  border-top: 1px solid #334155;
  padding-top: 8px;
}

.od-fp-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.od-fp-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  line-height: 1.45;
  padding: 1px 0;
  color: #cbd5e1;
}

.od-fp-list-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.od-fp-side-home .od-fp-list-name {
  justify-content: flex-end;
}

.od-fp-list-num {
  width: 1.4rem;
  flex-shrink: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.od-fp-list-subs .od-fp-list-name {
  color: #94a3b8;
  font-size: 11px;
}

/* Utbytta / inbytta i listan */
.od-fp-li-out .od-fp-list-name {
  opacity: 0.55;
  text-decoration: line-through;
  text-decoration-color: rgba(248, 113, 113, 0.55);
}

.od-fp-li-in .od-fp-list-name {
  color: #86efac;
  font-weight: 600;
}

.od-fp-list-icons {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin: 0 2px;
}

.od-fp-list-badge {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 11px;
  line-height: 1;
}

.od-fp-list-badge small {
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.od-fp-list-badge-goal small { color: #6ee7b7; }
.od-fp-list-badge-og small { color: #fbbf24; }

.od-fp-center {
  min-width: 0;
}

/* ===== Flat 2D top-down pitch (no photo / no 3D) ===== */
.od-fp-pitch {
  position: relative;
  width: 100%;
  aspect-ratio: 105 / 68;
  max-height: 320px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  background: #1a7a3a;
}

.od-fp-compact .od-fp-pitch {
  max-height: 240px;
}

.od-fp-markings {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Flat striped grass – pure CSS, no perspective */
.od-fp-grass {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    #168a3c 0,
    #168a3c 7.14%,
    #1a9342 7.14%,
    #1a9342 14.28%
  );
}

.od-fp-outline {
  position: absolute;
  inset: 4.5% 3%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 2px;
  box-sizing: border-box;
}

.od-fp-halfway {
  position: absolute;
  top: 4.5%;
  bottom: 4.5%;
  left: 50%;
  width: 0;
  border-left: 2px solid rgba(255, 255, 255, 0.92);
  transform: translateX(-50%);
}

.od-fp-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18%;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
}

.od-fp-spot {
  position: absolute;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.od-fp-spot-c {
  top: 50%;
  left: 50%;
}

.od-fp-spot-l {
  top: 50%;
  left: 14.5%;
}

.od-fp-spot-r {
  top: 50%;
  left: 85.5%;
}

/* Penalty areas (horizontal pitch: left/right) */
.od-fp-pen {
  position: absolute;
  top: 22%;
  height: 56%;
  width: 14%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-sizing: border-box;
}

.od-fp-pen-l {
  left: 3%;
  border-left: none;
}

.od-fp-pen-r {
  right: 3%;
  border-right: none;
}

.od-fp-six {
  position: absolute;
  top: 34%;
  height: 32%;
  width: 5.5%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-sizing: border-box;
}

.od-fp-six-l {
  left: 3%;
  border-left: none;
}

.od-fp-six-r {
  right: 3%;
  border-right: none;
}

/* Penalty arc – half circle using border-radius clip */
.od-fp-arc {
  position: absolute;
  top: 50%;
  width: 7%;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  box-sizing: border-box;
  transform: translateY(-50%);
}

.od-fp-arc-l {
  left: 14%;
  clip-path: inset(0 0 0 50%);
}

.od-fp-arc-r {
  right: 14%;
  clip-path: inset(0 50% 0 0);
}

.od-fp-goal {
  position: absolute;
  top: 42%;
  height: 16%;
  width: 1.4%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.06);
}

.od-fp-goal-l {
  left: 1.2%;
  border-right: none;
}

.od-fp-goal-r {
  right: 1.2%;
  border-left: none;
}

/* Players on top of markings */
.od-fp-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
  cursor: default;
}

.od-fp-player {
  position: relative;
  width: 28px;
  height: 32px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
}

.od-fp-jersey {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.od-fp-num {
  position: absolute;
  left: 0;
  right: 0;
  top: 38%;
  transform: translateY(-50%);
  text-align: center;
  font-weight: 900;
  font-size: 11px;
  line-height: 1;
  pointer-events: none;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  letter-spacing: -0.02em;
  z-index: 2;
}

/* Dark kits (teal home, purple away GK) → light numbers */
.od-fp-num-light {
  color: #ffffff !important;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.85),
    0 1px 2px rgba(0, 0, 0, 0.7);
}

/* White / light kits → pure black numbers so they read on the pitch */
.od-fp-num-dark,
.od-fp-player-light .od-fp-num {
  color: #000000 !important;
  font-weight: 900;
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.95),
    0 0 2px rgba(255, 255, 255, 0.8),
    0 1px 0 rgba(255, 255, 255, 0.5);
  -webkit-text-stroke: 0.35px rgba(0, 0, 0, 0.25);
}

/* Extra contrast on white away shirts */
.od-fp-player-light .od-fp-num-dark {
  color: #000000 !important;
}

.od-fp-player-gk .od-fp-jersey {
  filter: drop-shadow(0 0 2px rgba(251, 191, 36, 0.35));
}

/* Inbytt på planen: lätt grön markering (utbytt visas inte alls på planen) */
.od-fp-player-in {
  filter: drop-shadow(0 0 3px rgba(34, 197, 94, 0.55));
}

/* Goal / card / sub badges on jersey */
.od-fp-badges {
  position: absolute;
  top: -6px;
  right: -8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  z-index: 3;
  pointer-events: none;
}

.od-fp-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6));
}

.od-fp-badge em {
  font-style: normal;
  font-size: 8px;
  font-weight: 800;
  color: #fff;
  background: #0f172a;
  border-radius: 999px;
  padding: 0 3px;
  margin-left: 1px;
  line-height: 1.2;
}

.od-fp-badge-goal {
  font-size: 12px;
}

/*
 * Sub arrows: pure CSS triangles (not Unicode ▲▼ — those often render as
 * monochrome emoji and ignore color). Green = in, red = out.
 */
.od-fp-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  flex-shrink: 0;
  vertical-align: middle;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
  /* hide any leftover glyph text if present */
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.55));
}

/* ▲ inbytt — grön uppåt-triangel */
.od-fp-arrow-in {
  border-style: solid;
  border-width: 0 5px 9px 5px;
  border-color: transparent transparent #22c55e transparent !important;
}

/* ▼ utbytt — röd nedåt-triangel */
.od-fp-arrow-out {
  border-style: solid;
  border-width: 9px 5px 0 5px;
  border-color: #ef4444 transparent transparent transparent !important;
}

.od-fp-badge-sub-in,
.od-fp-badge-sub-out {
  background: rgba(2, 6, 23, 0.72);
  border-radius: 999px;
  padding: 2px 3px;
  min-width: 14px;
  min-height: 14px;
}

.od-fp-badge-sub-in {
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.45);
}

.od-fp-badge-sub-out {
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.45);
}

.od-fp-badge-sub-in .od-fp-arrow-in {
  border-width: 0 5px 9px 5px;
}

.od-fp-badge-sub-out .od-fp-arrow-out {
  border-width: 9px 5px 0 5px;
}

.od-fp-list-badge-sub-in,
.od-fp-list-badge-sub-out {
  gap: 3px;
  padding: 1px 4px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.65);
}

.od-fp-list-badge-sub-in {
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.35);
}

.od-fp-list-badge-sub-out {
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.35);
}

.od-fp-list-badge-sub-in .od-fp-arrow-in {
  border-width: 0 4px 7px 4px;
}

.od-fp-list-badge-sub-out .od-fp-arrow-out {
  border-width: 7px 4px 0 4px;
}

.od-fp-list-badge-sub-in small {
  color: #4ade80 !important;
}

.od-fp-list-badge-sub-out small {
  color: #f87171 !important;
}

/* Legend uses same triangle classes */
.od-fp-legend .od-fp-arrow-in {
  border-width: 0 5px 8px 5px;
}
.od-fp-legend .od-fp-arrow-out {
  border-width: 8px 5px 0 5px;
}

.od-fp-forms {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
}

.od-fp-form-home { color: #34d399; }
.od-fp-form-away { color: #fb7185; }

.od-fp-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #94a3b8;
}

.od-fp-empty i {
  display: block;
  font-size: 2rem;
  opacity: 0.4;
  margin-bottom: 0.5rem;
}

.od-fp-note {
  font-size: 10px;
  color: #64748b;
  margin-top: 10px;
  padding: 0 2px;
  display: none; /* legend ersätter */
}

@media (max-width: 900px) {
  .od-fp {
    grid-template-columns: 1fr;
  }
  .od-fp-center {
    order: -1;
  }
  .od-fp-side-home .od-fp-list li,
  .od-fp-side-away .od-fp-list li {
    flex-direction: row;
    text-align: left;
  }
  .od-fp-side-home .od-fp-list-name {
    justify-content: flex-start;
  }
  .od-fp-side-home .od-fp-list-num,
  .od-fp-side-away .od-fp-list-num {
    margin-left: 0;
    margin-right: 8px;
    text-align: left;
  }
  .od-fp-pitch {
    max-height: 220px;
  }
  .od-fp-player {
    width: 24px;
    height: 28px;
  }
  .od-fp-num {
    font-size: 10px;
  }
  .od-fp-badge {
    font-size: 10px;
  }
}

@media (min-width: 901px) {
  .od-fp-player {
    width: 32px;
    height: 36px;
  }
  .od-fp-num {
    font-size: 12px;
  }
  .od-fp-pitch {
    max-height: 360px;
  }
}
