/*
 * ---------- Board ----------
 * Geometry mirrors the old 700x880 canvas. Everything inside is sized in
 * percentages or cqw (1cqw = 7 canvas px) so the board scales with its width.
 */
.s11-board {
  --line: 0.2857cqw;
  --kit-1: #1d3557;
  --kit-2: #E63946;
  --kit-text: #fff;
  position: relative;
  width: 100%;
  aspect-ratio: 700/880;
  container-type: inline-size;
  background: #457B9D;
  font-family: "Source Sans 3", Arial, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.s11-board *,
.s11-board *::before,
.s11-board *::after {
  box-sizing: border-box;
}

.s11-goal {
  position: absolute;
  left: 45.4286%;
  top: 0.2273%;
  width: 9.1429%;
  height: 2.0455%;
  border: var(--line) solid #c0c0c0;
}

.s11-goal-bottom {
  top: auto;
  bottom: 0.2273%;
}

.s11-pitch {
  position: absolute;
  left: 3.1429%;
  top: 2.2727%;
  width: 93.7143%;
  height: 95.4545%;
  background: repeating-linear-gradient(180deg, #00680a 0 3.5714cqw, #007b0c 3.5714cqw 7.1429cqw);
}
.s11-pitch.solid {
  background: #00680a;
}

.s11-markings {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: var(--line) solid #c0c0c0;
  pointer-events: none;
}

.s11-markings > div,
.s11-end > div {
  position: absolute;
}

.s11-halfway {
  left: 0;
  right: 0;
  top: 50%;
  border-top: var(--line) solid #c0c0c0;
  transform: translateY(-50%);
}

.s11-centre-circle {
  left: 50%;
  top: 50%;
  width: 31.2195%;
  aspect-ratio: 1;
  border: var(--line) solid #c0c0c0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.s11-spot {
  left: 50%;
  width: 0.8571cqw;
  height: 0.8571cqw;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}

.s11-centre-spot {
  top: 50%;
}

.s11-corner {
  width: 2.8571cqw;
  height: 2.8571cqw;
  border: var(--line) solid #c0c0c0;
  border-radius: 50%;
}

.s11-corner-tl {
  left: -1.4286cqw;
  top: -1.4286cqw;
}

.s11-corner-tr {
  right: -1.4286cqw;
  top: -1.4286cqw;
}

.s11-corner-bl {
  left: -1.4286cqw;
  bottom: -1.4286cqw;
}

.s11-corner-br {
  right: -1.4286cqw;
  bottom: -1.4286cqw;
}

/* One end of the pitch; the bottom end is the same markup rotated 180deg. */
.s11-end {
  left: 0;
  width: 100%;
  height: 50%;
}

.s11-end-top {
  top: 0;
}

.s11-end-bottom {
  top: 50%;
  transform: rotate(180deg);
}

.s11-pen-area {
  left: 19.5122%;
  top: 0;
  width: 60.9756%;
  height: 38.0952%;
  border: var(--line) solid #c0c0c0;
}

.s11-gk-area {
  left: 36.2805%;
  top: 0;
  width: 27.439%;
  height: 19.0476%;
  border: var(--line) solid #c0c0c0;
}

.s11-pen-spot {
  top: 20.9524%;
}

/* The "D": the part of a circle around the penalty spot outside the box. */
.s11-d {
  left: 50%;
  top: 38.0952%;
  width: 31.2195%;
  height: 7.2381%;
  overflow: hidden;
  transform: translateX(-50%);
}

.s11-d-circle {
  width: 100%;
  aspect-ratio: 1;
  /* percentage margins resolve against width, which keeps this circular */
  margin-top: -85.1563%;
  border: var(--line) solid #c0c0c0;
  border-radius: 50%;
}

.s11-team-name {
  position: absolute;
  left: 5.2857%;
  top: 3.2%;
  font-size: 5.7143cqw;
  font-weight: bold;
  line-height: 1;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 0.2857cqw 0.8571cqw rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.s11-watermark {
  position: absolute;
  right: 3.5%;
  bottom: 0.4%;
  font-size: 1.8571cqw;
  font-weight: bold;
  line-height: 1;
  color: #fff;
  pointer-events: none;
}

.s11-players {
  position: absolute;
  inset: 0;
}

.s11-player {
  position: absolute;
  width: calc(10.2857cqw * var(--kit-scale, 1));
  height: calc(9.8571cqw * var(--kit-scale, 1));
  transform: translate(-50%, -53.6%);
  cursor: grab;
  touch-action: none;
}
.s11-player.dragging {
  cursor: grabbing;
  z-index: 2;
}

.s11-shape-wrap {
  position: absolute;
  inset: 0;
  filter: drop-shadow(0 0 0.1429cqw rgba(0, 0, 0, 0.9)) drop-shadow(0.2857cqw 0.2857cqw 0.4286cqw rgba(0, 0, 0, 0.6));
}

.s11-shape {
  position: absolute;
  inset: 0;
  background: var(--kit-1);
}

[data-pattern=vertical-stripes] .s11-shape {
  background: repeating-linear-gradient(90deg, var(--kit-1) 0 9.5%, var(--kit-2) 9.5% 18%);
}

[data-pattern=horizontal-stripes] .s11-shape {
  background: repeating-linear-gradient(180deg, var(--kit-2) 7%, var(--kit-2) 17%, var(--kit-1) 17%, var(--kit-1) 33%);
}

[data-shape=kit] .s11-shape {
  clip-path: polygon(25% 100%, 75% 100%, 72.22% 33.33%, 79.17% 53.62%, 100% 44.93%, 79.17% 7.25%, 63.89% 0%, 58.33% 0%, 50% 8%, 41.67% 0%, 36.11% 0%, 20.83% 7.25%, 0% 44.93%, 20.83% 53.62%, 27.78% 33.33%);
}

[data-shape=circle] .s11-player,
[data-shape=rectangle] .s11-player {
  width: calc(9.1429cqw * var(--kit-scale, 1));
  height: calc(9.1429cqw * var(--kit-scale, 1));
  transform: translate(-50%, -65.6%);
}

[data-shape=circle] .s11-shape {
  border-radius: 50%;
}

.s11-kit-text {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: calc(3.2857cqw * var(--kit-scale, 1));
  font-weight: bold;
  line-height: 1;
  text-align: center;
  color: var(--kit-text);
  pointer-events: none;
}

[data-shape=kit] .s11-kit-text {
  top: 57%;
}

[data-bottom-text=show-number] .s11-kit-text {
  font-size: calc(3.7143cqw * var(--kit-scale, 1));
}

[data-shadow=show-shadow] .s11-kit-text {
  text-shadow: 0.2857cqw 0.2857cqw 0.8571cqw #000;
}

.s11-name {
  position: absolute;
  top: 100%;
  left: 50%;
  margin-top: 0.1429cqw;
  transform: translateX(-50%);
  font-size: calc(2.8571cqw * var(--kit-scale, 1));
  font-weight: bold;
  line-height: 1.1;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 0 0.2857cqw rgba(0, 0, 0, 0.6);
}

.match-pitch-panel {
  background: #a8dadc;
  padding: 8px;
  border: 1px solid #1d3557;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  color: #1d3557;
}

.match-pitch-header {
  padding: 8px;
  background: #1d3557;
  border: 1px solid #1d3557;
  border-radius: 2px;
  margin-bottom: 8px;
}
.match-pitch-header h3 {
  margin: 0;
  color: #f1faee;
}

.match-pitch-teams {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 600;
}

.match-pitch-team {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.match-pitch-team-away {
  justify-content: flex-end;
  text-align: right;
}

.match-pitch-team-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-pitch-formation {
  font-weight: normal;
  opacity: 0.8;
}

.match-pitch-swatch-wrap {
  flex: none;
  display: inline-flex;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.7));
}

.match-pitch-swatch {
  width: 16px;
  height: 15px;
  clip-path: polygon(25% 100%, 75% 100%, 72.22% 33.33%, 79.17% 53.62%, 100% 44.93%, 79.17% 7.25%, 63.89% 0%, 58.33% 0%, 50% 8%, 41.67% 0%, 36.11% 0%, 20.83% 7.25%, 0% 44.93%, 20.83% 53.62%, 27.78% 33.33%);
}

.match-pitch {
  --kit-scale: 0.62;
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 880/700;
  container-type: inline-size;
  overflow: hidden;
  background: #457B9D;
  font-family: "Source Sans 3", Arial, sans-serif;
}
.match-pitch *,
.match-pitch *::before,
.match-pitch *::after {
  box-sizing: border-box;
}

.match-pitch-rotor {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 79.5455%;
  aspect-ratio: 700/880;
  transform: translate(-50%, -50%) rotate(90deg);
  pointer-events: none;
}

.match-pitch-players {
  position: absolute;
  left: 2.2727%;
  top: 3.1429%;
  width: 95.4545%;
  height: 93.7143%;
}

.match-pitch-player {
  z-index: 1;
  color: inherit;
  text-decoration: none;
  cursor: default;
  touch-action: auto;
  transition: transform 0.15s ease;
}
.match-pitch-player .s11-shape-wrap {
  filter: drop-shadow(0.12cqw 0 0 var(--kit-border)) drop-shadow(-0.12cqw 0 0 var(--kit-border)) drop-shadow(0 0.12cqw 0 var(--kit-border)) drop-shadow(0 -0.12cqw 0 var(--kit-border)) drop-shadow(0.2cqw 0.2cqw 0.3cqw rgba(0, 0, 0, 0.6));
}
.match-pitch-player .s11-kit-text {
  text-shadow: 0 0 0.3cqw rgba(0, 0, 0, 0.35);
}
.match-pitch-player .s11-name {
  max-width: 9.4cqw;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: max(1.9cqw, 10px);
  font-weight: 600;
  text-align: center;
  text-shadow: 0 0 0.3cqw rgba(0, 0, 0, 0.9), 0 0 0.6cqw rgba(0, 0, 0, 0.6);
}

a.match-pitch-player {
  cursor: pointer;
}
a.match-pitch-player:hover, a.match-pitch-player:focus-visible {
  z-index: 3;
  transform: translate(-50%, -53.6%) scale(1.12);
}
a.match-pitch-player:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 4px;
}

.match-pitch-rating {
  position: absolute;
  top: -0.6cqw;
  right: -1.8cqw;
  padding: 0.25cqw 0.45cqw;
  border-radius: 0.6cqw;
  font-size: max(1.45cqw, 9px);
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #555;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.match-pitch-rating[data-tone=rating-dark-green] {
  background: #1b6a45;
  color: #fff;
}

.match-pitch-rating[data-tone=rating-green] {
  background: #279b65;
  color: #fff;
}

.match-pitch-rating[data-tone=rating-yellow] {
  background: #ffeb3b;
  color: #000;
}

.match-pitch-rating[data-tone=rating-orange] {
  background: #ff9800;
  color: #fff;
}

.match-pitch-rating[data-tone=rating-red] {
  background: #f44336;
  color: #fff;
}

.match-pitch-events {
  position: absolute;
  top: -0.6cqw;
  left: -1.9cqw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2cqw;
}

.match-pitch-goal {
  display: block;
  width: max(1.7cqw, 10px);
  height: max(1.7cqw, 10px);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.match-pitch-goal.is-own-goal {
  box-shadow: 0 0 0 0.2cqw #E63946, 0 1px 2px rgba(0, 0, 0, 0.5);
}

.match-pitch-card {
  display: block;
  width: max(1.1cqw, 7px);
  height: max(1.5cqw, 10px);
  border-radius: 0.15cqw;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.match-pitch-card.is-yellow {
  background: #f5c518;
}
.match-pitch-card.is-red {
  background: #d62828;
}

.match-pitch-sub {
  position: absolute;
  right: -2.2cqw;
  bottom: 0.2cqw;
  padding: 0.2cqw 0.35cqw;
  border-radius: 0.5cqw;
  font-size: max(1.3cqw, 9px);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.match-pitch-sub-arrow {
  margin-right: 0.2cqw;
  font-size: 0.8em;
  color: #ff6b6b;
}

@container (max-width: 420px) {
  .match-pitch-player .s11-name,
  .match-pitch-sub-minute {
    display: none;
  }
  .match-pitch-sub-arrow {
    margin-right: 0;
  }
}
.player-pitch-wrap {
  grid-column: 1/4;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 16px;
  padding: 8px;
}

.player-pitch {
  flex: 0 1 340px;
  max-width: 340px;
  border-radius: 2px;
}

.player-pitch-info {
  flex: 1 1 240px;
  min-width: 0;
}

.player-pitch-table {
  font-size: 14px;
}
.player-pitch-table th {
  font-size: 14px;
  white-space: nowrap;
}
.player-pitch-table td {
  padding: 6px 8px;
}
.player-pitch-table tbody tr.is-main {
  font-weight: 700;
}

.player-pitch-table__position {
  overflow-wrap: anywhere;
}

.player-pitch-table__role {
  white-space: nowrap;
}

.player-pitch-table__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  vertical-align: middle;
  width: 30px;
  height: 30px;
  border: 2px solid #a8dadc;
  border-radius: 50%;
  background: #1d3557;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.player-pitch-table__badge.is-main {
  border-color: #fff;
  background: #E63946;
  box-shadow: 0 0 0 1px #1d3557;
}

.player-pitch-dot {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: max(11cqw, 30px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: max(0.6cqw, 2px) solid #a8dadc;
  border-radius: 50%;
  background: #1d3557;
  color: #fff;
  font-size: max(3.6cqw, 11px);
  font-weight: 700;
  line-height: 1;
  opacity: 0.9;
  box-shadow: 0.2cqw 0.4cqw 0.8cqw rgba(0, 0, 0, 0.55);
  cursor: default;
  pointer-events: auto;
}
.player-pitch-dot.is-main {
  z-index: 1;
  border-color: #fff;
  background: #E63946;
  opacity: 1;
}

.player-position-history {
  grid-column: 1/4;
  margin: 0 8px 8px;
  width: calc(100% - 16px);
  font-size: 13px;
}
.player-position-history td {
  padding: 4px 8px;
  overflow-wrap: anywhere;
}

.player-position-history__season {
  width: 1%;
  white-space: nowrap;
  font-weight: 700;
}

.player-position-history__role {
  white-space: nowrap;
  cursor: default;
}
