@import "base";

$card-width: 150px;

$clr-dodo: #FF6900;
$line-radius-dodo: 8px;
$card-width-dodo: 200px;
$clr-dodo-secondary: rgb(156, 168, 174);

$line-radius-second: 4px;
$clt-cardBg-second: #5cb3ff;

@font-face {
  font-family: 'Dodo';
  font-style: normal;
  src: url("/DoDo-VF.woff2") format('woff2');
}

main {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
}

@media screen and (max-width: 780px) {
  main {
    padding: 0;
  }
}

.season {
  position: relative;
  padding: 64px;
  overflow: hidden;

  &__title {
    display: flex;
    gap: 10px;
    align-items: baseline;
    position: relative;
    font-weight: 800;
    font-size: 64px;
    margin-bottom: 64px;
    z-index: 10;
  }

  &__subtitle {
    font-size: 16px;
    font-weight: 400;
  }

  &--first {
    background: #f5f2f2;
    font-family: Dodo;
    font-weight: 400;

    .bracketMatch {
      &::after {
        border-color: $clr-dodo-secondary;
      }
    
      &--down {
        &::after {
          border-top-right-radius: $line-radius-dodo;
        }
      }
    
      &--up {
        &::after {
          border-bottom-right-radius: $line-radius-dodo;
        }
      }
    
      &--straight {
        &::after {
          border-bottom-right-radius: $line-radius-dodo;
          width: calc($card-width-dodo + 60px);
          right: calc(-62px - $card-width-dodo);
        }
      }
    }

    .bracketCard {
      width: $card-width-dodo;
    
      &::before, &::after {
        border-color: $clr-dodo-secondary;
      }
    
      &::before {
        border-bottom-left-radius: $line-radius-dodo;
      }
    
      &::after {
        border-top-left-radius: $line-radius-dodo;
      }
    
      &--bottomExtendo {
        &::after {
          border-top-left-radius: $line-radius-dodo;
        } 
      }
    
      &__name {
        &--winner {
          color: $clr-dodo;
        }
      }
    }
  }

  &--second {
    background-image: url("/white-texture.jpg");
    background-size: cover;
    font-family: Arial, Helvetica, sans-serif;
    padding-bottom: 128px;

    .season {
      &__title {
        font-weight: 500;
        border: 1px dotted gray;
        padding: 0 12px;
        margin-bottom: 10px;
      }

      &__fakeSubtitle {
        border: 1px dotted gray;
        padding: 12px;
        box-sizing: border-box;
        margin-bottom: 64px;
        background: none;
        display: block;
        width: 100%;
        text-align: center;
        font-size: 18px;

        &:focus {
          outline: none;
        }
      }
    }

    .bracketMatch {
      &::after {
        
      }
    
      &--down {
        &::after {
          border-top-right-radius: $line-radius-second;
        }
      }
    
      &--up {
        &::after {
          border-bottom-right-radius: $line-radius-second;
        }
      }
    
      &--straight {
        &::after {
          border-bottom-right-radius: $line-radius-second;
        }
      }
    }

    .bracketCard {
      background: $clt-cardBg-second;
      border: 2px solid black;

      &::before, &::after {
      }
    
      &::before {
        border-bottom-left-radius: $line-radius-second;
      }
    
      &::after {
        border-top-left-radius: $line-radius-second;
      }
    
      &--bottomExtendo {
        &::after {
          border-top-left-radius: $line-radius-second;
        } 
      }
    
      &__name {
        &--winner {
          
        }
      }
    }
  }

  &__cardboard {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(40%, -50%) rotate(-45deg);
    width: 500px;
    filter: drop-shadow(1px 1px 2px #222);
  }

  &__sharpie {
    position: absolute;
    top: 72px;
    right: 28px;
    transform: rotate(150deg);
    width: 300px;
    filter: drop-shadow(2px 2px 4px #222);
  }
}

.tournament {
  padding: 32px;
}

.bracket {
  position: relative;
  display: flex;
  z-index: 10;

  &__columnWrapper {
    display: flex;
    padding: 20px;
    flex-direction: column;
    align-items: center;
    gap: 32px;

    h2 {
      text-align: center;
      font-weight: 600;
      font-size: 18px;
    }
  }

  &__column {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    gap: 32px;
  }
}

.bracketMatch {
  position: relative;

  &::after {
    position: absolute;
    right: -22px;
    content: '';
    display: block;
    width: 20px;
    height: 45%;
    border: 0 solid gray;
  }

  &--down {
    &::after {
      top: 50%;
      border-width: 2px 2px 0 0;
    }
  }

  &--up {
    &::after {
      bottom: 50%;
      border-width: 0 2px 2px 0;
    }
  }

  &--straight {
    &::after {
      bottom: 50%;
      border-width: 0 2px 2px 0;
      width: calc($card-width + 60px);
      right: calc(-62px - $card-width);
    }
  }
}

.bracketCard {
  padding: 16px 32px;
  background: white;
  border-radius: 6px;
  width: $card-width;
  box-sizing: border-box;

  &::before, &::after {
    border: 0 solid gray;
    position: absolute;
    left: -20px;
    content: '';
    display: block;
    width: 18px;
    height: 45%;
  }

  &::before {
    border-width: 0 0 2px 2px;
    top: 0;
  }

  &::after {
    border-width: 2px 0 0 2px;
    top: 50%;
  }

  &--bottomExtendo {
    &::after {
      border-width: 2px 0 0 2px;
      top: 50%;
      height: 87px;
    } 
  }

  &--singleIn {
    &::before {
      display: none;
    }

    &::after {
      border-top-left-radius: 0 !important;
      border-width: 2px 0 0 0;
      top: 50%;
      width: 40px;
      left: -40px;
    } 
  }

  &__name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 24px;

    &--winner {
      font-weight: 800;
    }
  }

  &__trophy {
    height: 100%;
  }
}

.bracket__columnWrapper:first-child {
  .bracketCard {
    &::before, &::after {
      display: none;
    }
  }
}

.screen {
  box-sizing: border-box;
  position: relative;
  width: 800px;
  padding: 48px 40px 29px 34px;
  display: flex;
  align-items: center;
  justify-content: center;

  &__image {
    left: 0;
    top: 0;
    position: absolute;
    width: 100%;
    filter: drop-shadow(0 6px 6px #222);
  }

  .bracket {
    background: #ffffff4a;
    padding: 50px 67px;

    &::before {
      position: absolute;
      display: block;
      content: '';
      width: 100%;
      height: 30px;
      background: rgba(255, 68, 0, 0.575);
      left: 0;
      bottom: 0;
    }
  }
}

@media screen and (max-width: 780px) {
  .screen {
    width: 100%;
    min-width: 0;
    padding: 0;

    &__image {
      display: none;
    }

    .bracket {
      padding: 16px;
    }
  }
}

.laptopTable {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 50%;
  max-width: 600px;
  display: block;
  z-index: 100;
  filter: drop-shadow(0 10px 32px #11111160);
}

.footer {
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  &__logo {
    height: 32px;
  }

  &__disclaimer {
    text-align: right;
  }
}

@media screen and (max-width: 780px) {
  .season {
    padding: 8px;

    &__sharpie {
      display: none;
    }

    &__title {
      flex-direction: column;
      align-items: center;
      margin-bottom: 32px;
    }

    &--second {
      padding-bottom: 128px;
    }
  }

  .tournament {
    padding: 32px 0;
  }

  .bracket {
    flex-direction: column;
    width: 100%;

    &__columnWrapper {
      padding: 32px 0;
      border-bottom: 2px dashed $clr-dodo-secondary;

      &:last-child {
        border-bottom: 0;
      }
    }

    &__column {
      width: 100%;
    }
  }

  .bracketMatch {
    width: 100%;

    &::before, &::after {
      display: none;
    }
  }

  .bracketCard {
    width: 100% !important;

    &::before, &::after {
      display: none;
    }
  }

  .laptopTable {
    width: 100%;
  }
}