:root {
  --primary-light: #5f75a4;
  --primary-default: #1a49a0;
  --primary-dark: #142157;

  --secondary-default: #f9c738;

  --white: rgb(255, 255, 255);
  --gray-50: rgb(250, 250, 250);
  --gray-100: rgb(241, 241, 241);
  --gray-200: rgb(227, 227, 227);
  --gray-300: rgb(223, 223, 223);
  --gray-350: rgb(153, 153, 153);
  --gray-four00: rgb(146, 146, 146);
  --gray-500: rgb(102, 102, 102);
  --gray-600: rgb(72, 72, 72);
  --gray-700: rgb(51, 51, 51);
  --gray-eight00: rgb(34, 34, 34);
  --gray-900: rgb(17, 17, 17);
  --black: rgb(0, 0, 0);

  --stage-item-bg: #e0e2e1;

  --game-card-height: 98px;
}

p {
  margin-bottom: 0;
}

.fs-7 {
  font-size: 0.75rem;
}
.fs-8 {
  font-size: 0.5rem;
}
.fs-9 {
  font-size: 0.25rem;
}

.bebas-neue-regular {
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-style: normal;
}
.bg-primary {
  background: var(--primary-default) !important;
}
.bg-secondary {
  background: var(--secondary-default) !important;
}
.text-secondary {
  color: var(--secondary-default) !important;
}
.outfit-100 {
  font-family: "Outfit", sans-serif;
  font-optical-sizing: auto;
  font-weight: 100;
  font-style: normal;
}
.outfit-200 {
  font-family: "Outfit", sans-serif;
  font-optical-sizing: auto;
  font-weight: 200;
  font-style: normal;
}
.outfit-300 {
  font-family: "Outfit", sans-serif;
  font-optical-sizing: auto;
  font-weight: 300;
  font-style: normal;
}
.outfit-four00 {
  font-family: "Outfit", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}
.outfit-500 {
  font-family: "Outfit", sans-serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
}
.outfit-600 {
  font-family: "Outfit", sans-serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-style: normal;
}
.outfit-700 {
  font-family: "Outfit", sans-serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-style: normal;
}
.outfit-eight00 {
  font-family: "Outfit", sans-serif;
  font-optical-sizing: auto;
  font-weight: 800;
  font-style: normal;
}
.outfit-900 {
  font-family: "Outfit", sans-serif;
  font-optical-sizing: auto;
  font-weight: 900;
  font-style: normal;
}

.montserrat-100 {
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-weight: 100;
  font-style: normal;
}
.montserrat-200 {
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-weight: 200;
  font-style: normal;
}
.montserrat-300 {
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-weight: 300;
  font-style: normal;
}
.montserrat-400 {
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}
.montserrat-500 {
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
}
.montserrat-600 {
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-style: normal;
}
.montserrat-700 {
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-style: normal;
}
.montserrat-800 {
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-weight: 800;
  font-style: normal;
}
.montserrat-900 {
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-weight: 900;
  font-style: normal;
}

.btn-primary {
  background-color: var(--primary-default);
  border: none;
}
.btn-primary:active,
.btn-primary:hover {
  background-color: var(--primary-light);
}

.btn {
  border-radius: 0.8rem;
}

body {
  color: var(--white);
  min-height: 100dvh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  width: 100dvw;
  height: 100dvh;
  background-color: var(--primary-default);
  background-image: url(/public/assets/img/Quien_Gana_Fondo.jpg);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: -1;
}

.cursor-pointer {
  cursor: pointer;
}

.scroll-hidden {
  scroll-behavior: smooth;
  &::-webkit-scrollbar {
    width: 0px;
    height: 0px;
    background: transparent;
  }
  &::-webkit-scrollbar-thumb {
    width: 0px;
    height: 0px;
    background: transparent;
  }
  &:hover::-webkit-scrollbar-thumb {
    width: 0px;
    height: 0px;
    background: transparent;
  }
}

#rounds-container {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 50px 1fr;
  gap: 0.5rem;
  margin: 0 auto;
  max-width: calc(100dvw - 1rem);
  min-height: 80dvh;
  max-height: 80dvh;
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  border-radius: 1rem;
  border: 1px solid var(--white);
}

.bg-white-glass {
  margin: 0 auto;
  max-width: calc(100dvw - 1rem);
  min-height: 80dvh;
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  border-radius: 1rem;
  border: 1px solid var(--white);
}

.group-grid {
  display: grid;
  grid-template-columns: 180px 330px 200px;
  position: relative;
  overflow-x: auto;
  background: var(--primary-default);
}

.group-grid-col {
  display: grid;
  grid-template-rows: repeat(4, 40px);
}

.group-grid .group-teams {
  position: sticky;
  left: 0;
  background: var(--primary-default);
  box-shadow: -0.5rem 0 0 var(--primary-default);
  z-index: 1;
}

.group-teams .team-position {
  aspect-ratio: 1/1;
  width: 20px;
  height: 20px;
  display: flex;
  font-size: 0.8rem;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  background: var(--white);
  color: var(--primary-default);
  border-radius: 1rem;
}

.group-grid .row-stats {
  display: grid;
  grid-template-columns: repeat(8, 40px);
  align-items: center;
}
.group-grid .group-stats,
.group-grid .group-last-five {
  position: relative;
  z-index: 0;
}
.group-grid .group-stats::before,
.group-grid .group-last-five::before {
  position: absolute;
  content: "";
  width: 1px;
  background: var(--white);
  height: 100%;
  top: 0;
  left: 0;
}
.group-grid .row-last-five {
  display: grid;
  grid-template-columns: repeat(5, 40px);
  align-items: center;
}
.group-grid .row-last-five img {
  margin: 0 auto;
}

.group-grid .row-stats span {
  text-align: center;
}

.matches-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.matches-grid .match-game:last-child:nth-child(odd) {
  grid-column: span 2 / span 2;
}

.matches-team-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
}

#rounds-nav {
  grid-column: 1/-1;
  padding: 0.5rem;
}

#rounds-nav button {
  background-color: transparent;
  font-size: 1.2rem;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--white);
  transition: all;
  transition-duration: 300ms;
  box-sizing: content-box;
  min-width: 100px;
}
#rounds-nav a.active button {
  border-bottom: 3px solid var(--white);
}
#rounds-nav button:active {
  transform: translateY(0.2rem);
}

#rounds-section {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.9rem;
  scroll-snap-type: x mandatory;
}

.round-container {
  width: 100%;
  min-width: calc(85dvw - 1rem);
  padding: 0 1rem;
  height: fit-content;
  scroll-snap-align: start;
  display: grid;
  grid-template-rows: 1px repeat(16, minmax(var(--game-card-height), 1fr));
  align-items: center;
  gap: 1rem;
  position: relative;
  transition: all;
  transition-duration: 300ms;
}

#rounds-section.phase-16 .round-container {
  --game-card-height: 98px;
}
#rounds-section.phase-8 .round-container {
  --game-card-height: 49px;
  gap: 0.45rem;
}
#rounds-section.phase-4 .round-container {
  --game-card-height: 24.5px;
  gap: 0.225rem;
}
#rounds-section.phase-semi .round-container {
  --game-card-height: 12.25px;
  gap: 0.1rem;
  margin-top: 1rem;
}
#rounds-section.phase-final .round-container {
  --game-card-height: 6px;
  gap: 0.5rem;
  margin-top: 1rem;
}

.round-observer-section {
  opacity: 0;
  height: 1px;
  width: 100%;
  position: sticky;
  top: 0rem;
}

.round-game {
  padding: 0.5rem;

  border-radius: 1rem;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: all;
  transition-duration: 300ms;
}

.round-game::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--white);
  z-index: -1;
  transform: skewX(-10deg);
}
.round-game::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  transform: skewX(-10deg);
  border-right: 0.4rem solid var(--secondary-default);
}

.round-game:hover {
  box-shadow: 0px 0.5rem 2rem rgba(0, 0, 0, 0.2);
}

.round-game .team-name,
.round-game .score-1,
.round-game .score-2 {
  color: var(--gray-700);
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 1.15rem;
  margin-top: 0.1rem;
}
.round-game .score-1,
.round-game .score-2 {
  font-weight: 800;
}

.round-game.phase-16 {
  grid-row: span 1 / span 1;
}
.round-game.phase-8 {
  grid-row: span 2 / span 2;
}
.round-game.phase-4 {
  grid-row: span 4 / span 4;
}
.round-game.phase-semi {
  grid-row: span 8 / span 8;
}
.round-game.phase-final {
  grid-row: span 16 / span 16;
}

.round-game .center-line {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(0, -50%);
  height: 2px;
  width: calc(100% + 1.5rem);
  background: var(--white);
  z-index: -1;
  color: transparent;
}
.round-game .union-line {
  position: absolute;
  top: 50%;
  left: -1.55rem;
  transform: translateY(-50%);
  height: calc(100% + 1.1rem);
  width: 2px;
  background: var(--white);
  z-index: -1;
  color: transparent;
  transition: all;
  transition-duration: 300ms;
}
.round-game:not(.phase-16) .center-line {
  transform: translate(-50%, -50%);
  left: 50%;
  width: calc(100% + 3rem);
}
.round-game.phase-final .center-line {
  position: absolute;
  right: 0;
  left: unset;
  transform: translate(0, -50%);
  width: calc(100% + 1.5rem);
}

#rounds-section.phase-8 #phase-16_container .round-game,
#rounds-section.phase-4 #phase-8_container .round-game,
#rounds-section.phase-semi #phase-4_container .round-game,
#rounds-section.phase-final #phase-semi_container .round-game {
  padding: 0.1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
#rounds-section.phase-8 #phase-8_container .round-game .union-line {
  height: calc(var(--game-card-height) * 1 + 0.5rem);
}
#rounds-section.phase-4 #phase-4_container .round-game .union-line {
  height: calc(var(--game-card-height) * 2 + 0.5rem);
}
#rounds-section.phase-semi #phase-semi_container .round-game .union-line {
  height: calc(var(--game-card-height) * 4 + 0.5rem);
}

#rounds-section.phase-8 #phase-16_container .round-game .round-team .team-name,
#rounds-section.phase-8 #phase-16_container .round-game .round-team .score-1,
#rounds-section.phase-8 #phase-16_container .round-game .round-team .score-2,
#rounds-section.phase-4 #phase-8_container .round-game .round-team .team-name,
#rounds-section.phase-4 #phase-8_container .round-game .round-team .score-1,
#rounds-section.phase-4 #phase-8_container .round-game .round-team .score-2,
#rounds-section.phase-semi
  #phase-4_container
  .round-game
  .round-team
  .team-name,
#rounds-section.phase-semi #phase-4_container .round-game .round-team .score-1,
#rounds-section.phase-semi #phase-4_container .round-game .round-team .score-2,
#rounds-section.phase-final
  #phase-semi_container
  .round-game
  .round-team
  .team-name,
#rounds-section.phase-final
  #phase-semi_container
  .round-game
  .round-team
  .score-1,
#rounds-section.phase-final
  #phase-semi_container
  .round-game
  .round-team
  .score-2 {
  display: none;
}

#rounds-section.phase-4 #phase-16_container .round-game,
#rounds-section.phase-semi #phase-16_container .round-game,
#rounds-section.phase-final #phase-16_container .round-game,
#rounds-section.phase-semi #phase-8_container .round-game,
#rounds-section.phase-final #phase-8_container .round-game,
#rounds-section.phase-final #phase-4_container .round-game {
  display: none;
}

.round-team {
  display: grid;
  align-items: center;
  grid-template-columns: 40px 1fr 40px 40px;
}

@media (min-width: 768px) {
  .round-container {
    width: 100%;
    min-width: 300px;
  }

  .group-grid {
    overflow-x: visible;
  }

  #phase-4_container .round-game .union-line {
    position: absolute;
    top: 50%;
    left: -1.55rem;
    transform: translateY(-50%);
    height: calc(var(--game-card-height) * 2 + 2.1rem);
    width: 2px;
    background: var(--white);
    z-index: -1;
    color: transparent;
  }
  #phase-semi_container .round-game .union-line {
    position: absolute;
    top: 50%;
    left: -1.55rem;
    transform: translateY(-50%);
    height: calc(var(--game-card-height) * 4 + 4.1rem);
    width: 2px;
    background: var(--white);
    z-index: -1;
    color: transparent;
  }
  #phase-final_container .round-game .union-line {
    position: absolute;
    top: 50%;
    left: -1.55rem;
    transform: translateY(-50%);
    height: calc(var(--game-card-height) * 9 + 2rem);
    width: 2px;
    background: var(--white);
    z-index: -1;
    color: transparent;
  }
}
