.eventends {
  --countdown: "Event Ends:";
}

.eventweek {
  border-radius: 4px;
  overflow: hidden;
  margin-block: 32px;
  padding: 32px;

  background-size: cover;
  background-repeat: no-repeat;
  background-color: var(--color-weekly);

  filter: drop-shadow(0 3px 5px color-mix(in srgb, var(--color-weekly), transparent 80%));
}

@media (width <= 900px) {
  .eventweek {
    background-size: 200%;
  }
}

#week0 {
  --color-weekly: color-mix(in srgb, var(--color-background), goldenrod 10%);
  background-image: url('../images/bg-team.webp');
}

#week1 {
  --color-weekly: #a6584a;
  background-image: url('../images/bg-blackwidow.webp');
}

#week2 {
  --color-weekly: #959670;
  background-image: url('../images/bg-port.webp');
}

#week3 {
  --color-weekly: #6e86a0;
  background-image: url('../images/bg-eagleeye.webp');
}

#week4 {
  --color-weekly: #b09068;
  background-image: url('../images/bg-ankara.webp');
}

.eventweek > * {
  filter: drop-shadow(0 0 5px rgba(0,0,0,0.2));
}

.weekbar {
  display: flex;
  justify-content: space-between;
  margin-block-end: 24px;
}

@media (width <= 960px) {
  .weekbar {
    flex-direction: column;
    gap: 16px;
  }
}

@media (width <= 600px) {
  .weekbar {
    align-items: center;
    margin-block-end: 48px;
  }
  .heading .title,
  .heading .period {
    text-align: center;
  }
}

.missions {
  display: grid;
  align-items: flex-start;
  column-gap: 4px;
  row-gap: 20px;
}

.missions:has(div.mission:nth-child(2):last-child) {
  grid-template-columns: repeat(2, 1fr);
}

.missions:has(div.mission:nth-child(4):last-child) {
  grid-template-columns: repeat(4, 1fr);
}

@media (width <= 1200px) {
  .missions:has(div.mission:nth-child(4):last-child) {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (width <= 600px) {
  .missions:has(div.mission:nth-child(4):last-child),
  .missions:has(div.mission:nth-child(2):last-child) {
    grid-template-columns: 1fr;
  }
}

.mission {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.mission .userScore,
.mission .teamScore {
  font-size: 48px;
  margin-block-end: -8px;
}

.mission .userScoreLabel,
.mission .teamScoreLabel {
  font-size: 24px;
  font-weight: 300;
  text-transform: uppercase;
}

.missionLeads {
  width: min(100%, 260px);
  list-style-position: inside;
  padding-inline-start: 0;
  list-style: none;
}

@media (width <= 600px) {
  .missionLeads {
    width: 100%;
  }
}

.missionLeads li {
  display: grid;
  grid-template-columns: auto auto 1fr;
  grid-template-rows: 1fr 1fr;
  grid-template-areas:
    "dot team user"
    "dot team score";
  margin-block: 16px;
}

.missionLeads li::before {
  content: '●';
  font-size: 24px;
  grid-area: dot;
  align-self: center;
}

.missionLeads li:nth-child(1)::before {
  color: var(--color-gold);
}

.missionLead li:nth-child(2)::before {
  color: var(--color-silver);
}

.missionLeads li:nth-child(3)::before {
  color: var(--color-bronze);
}

.missionLeads li:nth-child(4)::before {
  color: black;
}

.missionLeads img[alt*="team"] {
  grid-area: team;
  align-self: center;
  margin-inline: 8px;
  background-color: color-mix(in srgb, var(--color-background), white 90%);
  border-radius: 4px;
}

.missionLeads .placeIGN,
.missionLeads .teamPplaceIGN {
  font-weight: 300;
}

.missionLeads .placeScore,
.missionLeads .teamPlaceScore {
  font-size: 18px;
  font-weight: bold;
}

#standings,
#rewards,
#rules {
  padding-block: 32px;
}

#allTeams {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  column-gap: 16px;
  row-gap: 32px;
  padding-block: 32px;
}

#allTeams .teamScore {
  font-size: 32px;
}

#allTeams .team:nth-child(1) {
  grid-column: 2;
}

#allTeams .team:nth-child(4) {
  grid-column: 1;
}

@media (width <= 1200px) {
  #allTeams {
    grid-template-columns: repeat(4, 1fr);
  }
  #allTeams .team:nth-child(1),
  #allTeams .team:nth-child(4) {
    grid-column: unset;
  }
}

@media (width <= 860px) {
  #allTeams {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (width <= 660px) {
  #allTeams {
    grid-template-columns: repeat(2, 1fr);
  }
}


#allTeams .team {
  --image-size: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#allTeams .team img {
  width: min(100%, var(--image-size));
  height: min(100%, var(--image-size));
}

#allTeams .team:nth-child(-n+3) {
  --image-size: 200px;
}

@media (width <= 1200px) {
  #allTeams .team:nth-child(-n+3) {
    --image-size: 120px;
  }
}

#allTeams .team img {
  border-width: 2px;
  border-style: solid;
  border-color: black;
  border-radius: 8px;
}

#allTeams .team:nth-child(1) img {
  border-color: var(--color-gold);
}

#allTeams .team:nth-child(2) img {
  border-color: var(--color-silver);
}

#allTeams .team:nth-child(3) img {
  border-color: var(--color-bronze);
}

#allTeams .teamName {
  margin-block: 8px 0px;
}

#allTeams .teamScore::after {
  content: "points";
  font-size: 0.4em;
  display: block;
  text-align: center;
  margin-block-start: -8px;
}

li.myteam {
  outline: 2px solid color-mix(in srgb, var(--color-myteam), white 10%);
  outline-offset: 2px;
  background-color: var(--color-myteam);
  border-radius: 4px;
}

div.myteam {
  position: relative;
}

div.myteam::after {
  content: 'My Team';
  position: absolute;
  display: block;
  text-wrap: nowrap;
  text-transform: uppercase;
  font-size: small;
  background-color: var(--color-myteam);
  padding: 4px 8px 2px;
  border-radius: 4px;
  inset-block-start: -10px;
}

div.myteam img[alt*="team"] {
  outline: 2px solid color-mix(in srgb, var(--color-myteam), white 10%);
  outline-offset: 2px;
}

#rulescontent {
  width: min(96%, 680px);
  margin-inline: auto;
  margin-block: 24px 64px;
}

#rulescontent details:not(:last-of-type) {
  margin-block-end: 4px;
}

#rulescontent details p {
  padding: 0 16px;
  margin: 8px 0;
}

#rulescontent details[open] summary {
  border: none;
}

#rulescontent details[open],
#rulescontent summary {
  border: 1px solid var(--color-background);
  border-radius: 4px;
}

#rulescontent details[open] {
  border-color: color-mix(in srgb, var(--color-background), white 20%);
}

#rulescontent summary {
  font-size: 24px;
  display: flex;
  padding: 8px;
  cursor: pointer;
}

#rulescontent summary::marker {
  font-size: 0.5em;
}

#pointstable {
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 8px;
}

#pointstable li {
  list-style: none;
  padding: 4px 8px;
}

#pointstable > li,
#pointstable > li ul {
  grid-column: 1/ span 3;
  display: grid;
  grid-template-columns: subgrid;
}

#pointstable > li:first-of-type {
  font-size: small;
  text-transform: uppercase;
}

#pointstable > li {
  outline: 1px solid #333;
}

#disclaimers {
  padding: 8px;
}

#disclaimers li {
  margin-inline-start: 16px;
  padding-block: 4px;
}

#rewardscontent {
  margin-block: 24px 64px;
}

#rewardscontent figure {
  border-radius: 4px;
  padding-block: 16px;
}

#rewardscontent figcaption {
  text-align: center;
  text-wrap: balance;
  padding: 8px;
}

#rewards-ncsp,
#rewards-crates {
  display: grid;
  margin-block-end: 32px;
  gap: clamp(32px, 3vw, 64px);
}

#rewards-ncsp {
  grid-template-columns: 1fr 1fr;
}

#rewards-crates {
  grid-template-columns: 1fr 1fr 1fr;
}

@media (width <= 780px) {
  #rewards-ncsp,
  #rewards-crates {
    grid-template-columns: repeat(4, 1fr);
  }
  #rewardscontent figure {
    grid-column: span 2;
  }
  #rewards-crates figure:nth-child(3) {
    grid-column: 2 /span 2;
  }
}

@media (width <= 600px) {
  #rewards-ncsp,
  #rewards-crates {
    grid-template-columns: 1fr;
  }
  #rewardscontent figure,
  #rewards-crates figure:nth-child(3) {
    grid-column: 1 / span 1;
  }
}

#rewards-ncsp figure {
  background-color: color-mix(in srgb, var(--color-background), black 35%);
}

#rewards-crates figure h3 {
  text-align: center;
  font-size: 24px;
}

#rewards-crates figure:nth-child(1) {
  background-color: color-mix(in srgb, var(--color-gold), transparent 90%);
}

#rewards-crates figure:nth-child(2) {
  background-color: color-mix(in srgb, var(--color-silver), transparent 90%);
}

#rewards-crates figure:nth-child(3) {
  background-color: color-mix(in srgb, var(--color-bronze), transparent 90%);
}