.last_five_container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 95%;
  background: linear-gradient(135deg,
      var(--bg_color),
      var(--bg_color));
  border-left: 4px solid #ffffff;
  border-radius: 12px;
  padding-bottom: 0;
  padding: 0;
  margin-top: 50px;
}

/* --- OVERLAY GRAPHIC STYLES --- */
#graphic-container {
  margin-top: 20px;
  display: flex;

  /* Gold accent */

  /* box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6); */
  padding: 50px 0;
  width: 80%;
  justify-content: space-between;
  align-items: center;
  /* flex-direction: column; */
  gap: 20px;
  position: relative;
  padding-bottom: 20px;
}

/* Title banner */
.graphic-title {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text_white);
  color: #000;
  padding: 5px 30px;
  font-family: "Anton", "Arial Narrow", "Arial", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  /* box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); */
}




.team-image {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  /* overflow: hidden; */
}

.team-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;

  border-radius: 0%;
  margin-bottom: 0;
  /* box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); */
}


.form-row {
  display: flex;
  gap: 5px;
}

/* The W/D/L Badges */
.badge {
  width: 15px;
  height: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 6px;
  text-transform: uppercase;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  /* border: 2px solid rgba(255, 255, 255, 0.2); */
  color: var(--background_white_trans);
}

.w {
  background: linear-gradient(180deg, #28a745, #1e7e34);
}

/* Win - Green */
.d {
  background: linear-gradient(180deg, #6c757d, #495057);
}

/* Draw - Gray */
.l {
  background: linear-gradient(180deg, #dc3545, #bd2130);
}

/* Loss - Red */
.none {
  background: rgba(255, 255, 255, 0.1);
  color: transparent;
  border: 2px dashed rgba(255, 255, 255, 0.3);
}

.vs-divider {
  font-family: "Anton", "Arial Narrow", "Arial", sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
  display: none;
}

/* --- CONTROL PANEL STYLES --- */
#control-panel {
  margin-top: 80px;
  background: #222;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #444;
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 800px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #333;
  padding: 15px;
  border-radius: 6px;
}



.instructions {
  color: #aaa;
  font-size: 0.9rem;
  text-align: center;
}

.highlight {
  color: #ffffff;
  font-weight: bold;
}

.gfx-container.visible {
  transform: translateX(0);
  opacity: 1;
}

.gfx-container {
  width: 98%;
  /* background-color: turquoise; */
}

/* HEADER */
.header {
  border-bottom: 2px solid #333;
  padding-bottom: 15px;
  margin-bottom: 10px;
}

.header h1 {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1;
}

.header h1 span {
  color: var(--bafana-gold);
}


.match-date {
  font-size: small;
  color: #aaa;
  font-weight: 600;
}

.match-status {
  font-size: small;
  color: var(--bafana-green);
  font-weight: 900;
}

.match-venue {
  font-size: small;
  color: #aaa;
  font-weight: 600;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}



.teams-container {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

.team {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team.away {
  flex-direction: row-reverse;
  text-align: right;
}

.team-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;

}


.score-box {
  background: #000000a6;
  /* border: 2px solid #444; */
  padding: 6px;
  border-radius: 6px;
  font-size: medium;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--bafana-gold);
  width: 70px;
  text-align: center;
}

.score-box.win {
  background: linear-gradient(180deg, #28a745, #1e7e34);
}

.score-box.loss {
  background: linear-gradient(180deg, #dc3545, #bd2130);
}

.score-box.draw {
  background: linear-gradient(180deg, #6c757d, #495057);
}

/* Animations */
@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.matches-container {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  width: 100%;
  padding: 0;
  margin: 0 auto;
  /* background-color: #0fe9f1; */
}



.matches-container .home_five,
.matches-container .away_five {
  width: 95%;
  margin: 0 auto;
  display: none;
}

.away_five.active {
  display: block;
}

.home_five.active {
  display: block;
}

@media screen and (max-width: 768px) {
  .last_five_container {
    width: 100%;
    margin-top: 20px;
    border-left-width: 0;
    border-radius: 8px;
  }

  #graphic-container {
    width: 100%;
    padding: 35px 10px 15px;
    gap: 12px;
    box-sizing: border-box;
  }

  .graphic-title {
    top: -14px;
    width: max-content;
    max-width: calc(100% - 24px);
    padding: 4px 14px;
    font-size: 1rem;
    text-align: center;
    white-space: normal;
  }

  .team-image {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
  }

  .form-row {

    gap: 4px;
  }

  .badge {
    width: 10px;
    height: 10px;
    font-size: 0.65rem;
    border-radius: 3px;
    padding: 2px 4px;
  }

  .gfx-container {
    width: 100%;
  }

  .matches-container {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  .matches-container .home_five,
  .matches-container .away_five,
  .lastfive_home,
  .lastfive_away {
    width: 100%;
    min-width: 0;
  }

  .match-row {
    width: 100%;
    margin: 8px;
    box-sizing: border-box;
    border-radius: 8px;
  }



  .match-date,
  .match-status,
  .match-venue {
    min-width: 0;
    font-size: 0.68rem;
  }

  .match-venue {
    text-align: right;
  }

  .teams-container {
    width: 100%;
    padding: 0;
    gap: 6px;
    box-sizing: border-box;
  }

  .team {
    width: calc((100% - 64px) / 2);
    gap: 6px;
    min-width: 0;
  }

  .team.away {
    flex-direction: row-reverse;
    text-align: right;
  }

  .team-logo {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
  }

  .team-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.72rem;
    line-height: 1.15;
  }

  .score-box {
    width: 52px;
    min-width: 52px;
    padding: 5px 4px;
    font-size: 0.78rem;
    letter-spacing: 1px;
    flex-shrink: 0;
  }

  #control-panel {
    width: calc(100% - 24px);
    bottom: 12px;
    padding: 12px;
  }

  .control-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }
}

@media screen and (max-width: 420px) {
  #graphic-container {
    flex-wrap: wrap;
    justify-content: center;
  }

  .team-image {
    width: 50px;
    height: 50px;
  }



  .match-venue {
    grid-column: 1 / -1;
    text-align: left;
  }

  .team {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }

  .team.away {
    flex-direction: column;
    text-align: center;
  }

  .team-name {
    max-width: 100%;
    font-size: 0.6rem;
  }

  .score-box {
    width: 48px;
    min-width: 48px;
    font-size: 0.72rem;
  }
}