body {
  background: #f3f5f7;
}

.bg-white {
  background: #fff;
}

.table td, .table th {
  vertical-align: middle;
}

.match-list {
  display: grid;
  gap: 16px;
}

.match-card {
  overflow: hidden;
  border: 1px solid #d8dde3;
  border-radius: 8px;
  background: #fff;
}

.match-card__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: #edf1f4;
  color: #33404d;
}

.match-card__number {
  margin-right: 12px;
  color: #6b747d;
}

.match-card__teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 24px 16px 8px;
}

.team-name {
  font-size: 1.15rem;
  font-weight: 700;
  text-align: right;
}

.team-name--away {
  text-align: left;
}

.score-box {
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
}

.match-card__venue,
.match-card__hint {
  padding: 0 16px;
  color: #6b747d;
  text-align: center;
}

.prediction-form {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 10px;
  padding: 18px 16px 12px;
}

.prediction-form label {
  display: grid;
  gap: 4px;
  font-size: .78rem;
  color: #59636e;
}

.prediction-form input {
  width: 64px;
  height: 40px;
  border: 1px solid #aeb7c0;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
}

.prediction-form__separator {
  padding-bottom: 8px;
  font-weight: 800;
}

.match-card__hint {
  margin-bottom: 16px;
  font-size: .85rem;
}

.matches-bulk-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 0 0;
}

.revealed-predictions {
  padding: 16px;
  border-top: 1px solid #e1e5e9;
}

.revealed-predictions h2 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.revealed-prediction {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #edf0f2;
}

.revealed-prediction--mine {
  background: #eef7ee;
}

.points-badge {
  min-width: 48px;
  padding: 3px 7px;
  border-radius: 4px;
  background: #183d2a;
  color: #fff;
  font-size: .8rem;
  text-align: center;
}

.points-badge--pending {
  background: #6b747d;
}

.pitch-shell,
.roster-panel {
  border: 1px solid #d8dde3;
  border-radius: 10px;
  background: #fff;
}

.pitch-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  padding: 18px 20px 0;
}

.pitch-board {
  position: relative;
  display: grid;
  grid-template-rows: minmax(170px, 1fr) minmax(220px, 1fr) minmax(220px, 1fr) minmax(140px, auto);
  gap: 18px;
  min-height: 920px;
  margin: 18px;
  padding: 26px 22px 30px;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at center, rgba(255,255,255,.12) 0, rgba(255,255,255,.12) 110px, transparent 112px),
    linear-gradient(180deg, rgba(255,255,255,.08) 0, rgba(255,255,255,.04) 100%),
    repeating-linear-gradient(
      90deg,
      #287a44 0,
      #287a44 10%,
      #2f8650 10%,
      #2f8650 20%
    );
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.55);
}

.pitch-board__line,
.pitch-board__circle,
.pitch-board__box {
  position: absolute;
  border-color: rgba(255,255,255,.65);
  pointer-events: none;
}

.pitch-board__line--midfield {
  top: 50%;
  left: 0;
  width: 100%;
  border-top: 3px solid rgba(255,255,255,.65);
}

.pitch-board__circle {
  top: 50%;
  left: 50%;
  width: 180px;
  height: 180px;
  border: 3px solid rgba(255,255,255,.65);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.pitch-board__box {
  left: 50%;
  width: 46%;
  height: 120px;
  border: 3px solid rgba(255,255,255,.65);
  transform: translateX(-50%);
}

.pitch-board__box--top {
  top: 0;
  border-top: none;
}

.pitch-board__box--bottom {
  bottom: 0;
  border-bottom: none;
}

.pitch-slot {
  position: relative;
  width: clamp(140px, 16vw, 198px);
  flex: 1 1 clamp(140px, 16vw, 198px);
  max-width: 198px;
  padding: 9px 9px 10px;
  border-radius: 11px;
  background: rgba(7, 23, 16, .76);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 14px 32px rgba(0,0,0,.22);
  backdrop-filter: blur(6px);
  text-align: center;
  z-index: 1;
}

.pitch-slot[data-captain-id] {
  cursor: pointer;
}

.pitch-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.pitch-row--fwd {
  align-self: end;
}

.pitch-row--mid {
  align-self: center;
}

.pitch-row--def {
  align-self: center;
}

.pitch-row--gk {
  align-self: end;
}

.pitch-slot__player {
  display: grid;
  justify-items: center;
  gap: 3px;
  margin-bottom: 7px;
}

.pitch-slot__avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pitch-slot__position,
.roster-player-card__position {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: rgba(255,255,255,.92);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
}

.roster-player-card__position {
  background: #e8eef2;
  color: #3f4b56;
  margin-bottom: 2px;
}

.pitch-slot__avatar {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,.32);
  background: linear-gradient(180deg, #dbe4eb, #b6c3cb);
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
}

.pitch-slot__avatar--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f5fff8;
  font-weight: 800;
  font-size: 1.4rem;
  background:
    radial-gradient(circle at 50% 34%, #ffffff 0 18px, transparent 19px),
    radial-gradient(circle at 50% 86%, rgba(255,255,255,.9) 0 26px, transparent 27px),
    linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.08));
}

.pitch-slot__captain-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  color: rgba(255,255,255,.65);
  font-size: .65rem;
  font-weight: 700;
  line-height: 1;
}

.pitch-slot__captain-flag.is-active {
  background: #f2c94c;
  border-color: #f2c94c;
  color: #102c1d;
}

.pitch-slot__captain-flag--button {
  position: absolute;
  top: -6px;
  right: -6px;
}

.pitch-slot__name {
  color: #ffffff;
  font-size: .8rem;
  line-height: 1.2;
  font-weight: 700;
}

.pitch-slot__name--empty {
  color: #f0f7f2;
}

.pitch-slot__team {
  color: rgba(235,255,240,.86);
  font-size: .68rem;
  line-height: 1.25;
}

.pitch-slot__field {
  position: relative;
  display: grid;
  gap: 6px;
}

.pitch-slot__search-input {
  width: 100%;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  padding: 7px 10px;
  background: rgba(7, 26, 15, .28);
  color: #fff;
}

.pitch-slot__search-input::placeholder {
  color: rgba(255,255,255,.7);
}

.pitch-slot__search-meta {
  color: rgba(235,255,240,.72);
  font-size: .68rem;
  line-height: 1.2;
}

.pitch-slot__search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 10;
  display: grid;
  gap: 4px;
  max-height: 240px;
  padding: 8px;
  overflow: auto;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  background: rgba(4, 15, 9, .96);
  box-shadow: 0 16px 32px rgba(0,0,0,.25);
}

.pitch-slot__search-result,
.pitch-slot__search-empty {
  width: 100%;
  padding: 8px 9px;
  border: none;
  border-radius: 8px;
  text-align: left;
  color: #fff;
  background: rgba(255,255,255,.05);
}

.pitch-slot__search-result {
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  display: grid;
  gap: 2px;
  cursor: pointer;
}

.pitch-slot__search-result:hover,
.pitch-slot__search-result:focus-visible {
  background: rgba(255,255,255,.12);
  outline: none;
}

.pitch-slot__search-result-name {
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.15;
}

.pitch-slot__search-result-team {
  color: rgba(235,255,240,.72);
  font-size: .68rem;
  line-height: 1.15;
}

.pitch-slot__search-result-copy {
  display: grid;
  gap: 1px;
}

.pitch-slot__search-result-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  background: linear-gradient(180deg, #2f8650, #183d2a);
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
}

.pitch-slot__search-result-avatar--empty {
  background:
    radial-gradient(circle at 50% 34%, rgba(255,255,255,.95) 0 8px, transparent 9px),
    radial-gradient(circle at 50% 86%, rgba(255,255,255,.78) 0 13px, transparent 14px),
    linear-gradient(180deg, #2f8650, #183d2a);
}

.pitch-slot__search-empty {
  color: rgba(255,255,255,.7);
  font-size: .75rem;
}

.pitch-slot__field select,
.pitch-meta select,
.pitch-meta input {
  width: 100%;
  border: 1px solid #c9d1d9;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.pitch-slot__field select {
  display: none;
}

.pitch-slot__captain-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pitch-slot__field-errors {
  color: #ffd2d2;
  font-size: .7rem;
  line-height: 1.25;
}

.pitch-slot__captain-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.86);
  font-size: .72rem;
  cursor: pointer;
  user-select: none;
}

.pitch-slot__captain-toggle input {
  margin: 0;
}

.pitch-slot.is-captain {
  border-color: rgba(255, 215, 0, .8);
  box-shadow: 0 14px 34px rgba(0,0,0,.24), 0 0 0 2px rgba(255, 215, 0, .25);
}

.pitch-meta {
  display: grid;
  gap: 14px;
  padding: 0 18px 18px;
}

.pitch-meta__row {
  display: grid;
  gap: 6px;
}

.roster-panel {
  padding: 18px;
}

.roster-summary {
  display: grid;
  gap: 12px;
}

.roster-player-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e4e8ec;
  border-radius: 10px;
  background: #f8fafb;
}

.roster-player-card__photo {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: #dce3e8;
}

.roster-player-card__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  background:
    radial-gradient(circle at 50% 34%, rgba(255,255,255,.95) 0 16px, transparent 17px),
    radial-gradient(circle at 50% 86%, rgba(255,255,255,.82) 0 24px, transparent 25px),
    linear-gradient(180deg, #2f8650, #183d2a);
}

.roster-player-card__name {
  font-weight: 700;
}

.roster-player-card__meta {
  color: #64707c;
  font-size: .88rem;
}

.captain-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: 8px;
  border-radius: 999px;
  background: #102c1d;
  color: #fff;
  font-size: .78rem;
}

@media (max-width: 640px) {
  .match-card__header {
    display: grid;
  }

  .match-card__teams {
    grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
    gap: 8px;
  }

  .team-name {
    font-size: 1rem;
  }

  .prediction-form {
    flex-wrap: wrap;
  }

  .prediction-form .btn,
  .matches-bulk-actions .btn {
    width: 100%;
  }

  .pitch-board {
    grid-template-rows: none;
    gap: 14px;
    min-height: 0;
    padding: 12px;
  }

  .pitch-board__line,
  .pitch-board__circle,
  .pitch-board__box {
    display: none;
  }

  .pitch-row {
    display: grid;
    gap: 12px;
  }

  .pitch-slot {
    width: 100%;
    max-width: none;
    flex: initial;
  }

  .pitch-row--gk,
  .pitch-row--def,
  .pitch-row--mid,
  .pitch-row--fwd {
    grid-template-columns: initial;
  }

  .slot-gk,
  .slot-def-1,
  .slot-def-2,
  .slot-def-3,
  .slot-def-4,
  .slot-mid-1,
  .slot-mid-2,
  .slot-mid-3,
  .slot-mid-4,
  .slot-fwd-1,
  .slot-fwd-2 {
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    transform: none;
  }

  .pitch-slot__player {
    grid-template-columns: 58px minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    text-align: left;
  }

  .pitch-slot__position {
    grid-column: 1 / -1;
    justify-self: start;
    margin-bottom: 2px;
  }

  .pitch-slot__captain-toggle {
    justify-self: start;
    margin-top: 2px;
  }

  .pitch-slot__search-results {
    position: static;
    max-height: 180px;
  }

  .pitch-slot__avatar {
    width: 58px;
    height: 58px;
  }

  .pitch-slot__name {
    font-size: .92rem;
  }

  .pitch-slot__team {
    font-size: .76rem;
  }
}
