static/scss/bracket-view.scss
@import "globals";

#page-results {
  margin: 0;

  h1 {
    display: none;
  }

  #nav-header,
  .bracket-nav {
    position: fixed;
    width: 100%;
    top: 0;
    box-sizing: border-box;
  }

  .bracket-nav {
    top: 82px;
  }

  footer {
    display: none;
  }
}

$voted-dot-radius: 10px;
$ENTRANT_HEIGHT: 50px;
$ENTRANT_WIDTH: 225px;
$ENTRANT_SPACING: 25px;
$ENTRANT_AFTER: 18px;

.results {
  position: relative;
  margin-top: 160px;
  z-index: $BASE-INDEX + 1;

  header {
    padding-bottom: spacing(6);

    .title {
      @include subheading;
      text-align: center;
      margin: 25px 0 20px;
      text-shadow: 0 0 2px rgba(0, 0, 0, .15);
    }

    ul {
      font: 18px/1 'Roboto', sans-serif;
      background: #fff;
      list-style: none;
      width: 200px;
      box-shadow: 0 2px 2px rgba(0, 0, 0, .25);
      position: absolute;
      z-index: 9002;
      left: 50%;
      transform: translateX(-50%);

      &:after {
        content: '';
        display: block;
        border: 5px solid transparent;
        border-top: 5px solid #666;
        position: absolute;
        right: 10px;
        top: 16px;
      }

      li {
        cursor: pointer;
        padding: 11px 20px;
        font-size: 14px;
        margin: 0;
        display: none;
        text-align: center;
        &.selected {
          display: block;
          border: 1px solid #eee;
          @include border-box();
        }

      }

      &:hover {
        li {

          &.selected {
            border: 0;
            background: $light;
          }

          &:first-child {
            border: 1px solid #eee;
            border-bottom: 0;
          }

          &:hover {
            color: $dark;
          }

          display: block;
          border-top: 1px solid #eee;
          @include border-box();
        }
      }

    }
  }

  #content {
    overflow: hidden;
    margin-top: 60px;
  }

  .bracket-display {
    margin: 0 auto;
  }

  .tier {
    list-style: none;
    margin: 0;
    padding: 0;
    float: left;

    .round {
      margin-top: 0;
      position: relative;

      &:before {
        display: block;
        position: absolute;
        content: '';
        top: 50%;
        height: 2px;
        border-top: 1px solid $standard;
        left: $ENTRANT_WIDTH + $ENTRANT_AFTER / 2;
        right: 0;
      }

      &.highlighted:before {
        border-color: $dark !important;
      }

      &.single-entrant {
        &:before {
          left: $ENTRANT_WIDTH;
        }

        .entrant {
          &:before {
            border-width: 0 !important;
          }
        }
      }

    }

    .winner {
      text-align: center;
      width: $ENTRANT_WIDTH + $ENTRANT_AFTER;

      h2 {
        @include heading();
        font-size: 36px;
        color: get-color(white);
      }

      img {
        width: 150px;
        height: 150px;
      }

      dl {
        width: $ENTRANT_WIDTH + $ENTRANT_AFTER;
        position: absolute;
        height: 200px;
        top: 50%;
        margin-top: -100px;
        &:before {
          display: block;
          content: '';
          position: absolute;
          top: 50%;
          left: 0;
          right: 0;
          border-top: 1px solid $standard;
          z-index: -9001;
        }

        dt {
          position: absolute;
          left: -9999px;
          top: -9999px;
        }
      }
    }

    .entrant {
      width: $ENTRANT_WIDTH + $ENTRANT_AFTER;
      position: relative;
      line-height: 1;
      color: $dark;
      position: relative;

      &.user-voted dl:before {
        content: '';
        display: block;
        position: absolute;
        border: $voted-dot-radius solid get-color(red);
        border-radius: $voted-dot-radius;
        right: -$voted-dot-radius;
        top: -$voted-dot-radius;
        box-shadow: 1px 1px 3px rgba(0, 0, 0, .5);
        z-index: 9001;
        @include border-box();
      }

      &:before {
        display: block;
        position: absolute;
        border-right: 1px solid $standard;
        content: '';
        left: $ENTRANT_WIDTH;
        right: 8px;
      }

      &.entrant-top:before {
        top: 50%;
        bottom: 0;
        border-top: 1px solid $standard;
      }

      &.entrant-bottom:before {
        top: 0;
        bottom: 50%;
        border-bottom: 1px solid $standard;
      }

      &.nobody {
        opacity: 0.25;
      }

      .entrant-info {
        @include border-box();
        border: 1px solid $standard;
        background: #fff;
        height: $ENTRANT_HEIGHT;
        width: $ENTRANT_WIDTH;
        margin-top: $ENTRANT_HEIGHT / 2 * -1;
        top: 50%;
        position: absolute;

        dd {
          position: absolute;
        }

        dt {
          position: absolute;
          left: -9999px;
          top: -9999px;
        }

        .name {
          left: $ENTRANT_HEIGHT + 5px;
          right: $ENTRANT_HEIGHT + 5px;
          height: $ENTRANT_HEIGHT - 2px;
          display: flex;
          align-items: center;
          overflow: hidden;

          .text {
            display: block;
            font: bold 18px/1 'Roboto Condensed', sans-serif;
            max-height: $ENTRANT_HEIGHT;
            overflow: hidden;
            text-overflow: ellipsis;
          }
        }

        .image {
          img {
            width: $ENTRANT_HEIGHT - 2px;
            height: $ENTRANT_HEIGHT - 2px;
            display: block;
          }
        }

        .source {
          display: none;
        }

        .votes {
          @include border-box();
          display: flex;
          align-items: center;
          right: 0;
          width: $ENTRANT_HEIGHT;
          height: $ENTRANT_HEIGHT - 2px;
          background: $dark;

          .text {
            display: block;
            width: 100%;
            font: bold 14px/1 'Roboto', sans-serif;
            text-align: center;
            color: #fff;
          }
        }

        .seed {
          border: 1px solid $dark;
          position: absolute;
          bottom: -1px;
          width: 22px;
          text-align: center;
          left: -1px;
          padding: 2px;
          font: 12px/1 'Roboto', sans-serif;
          font: 12px/1 'Roboto', sans-serif;
          background: $dark;
          color: #fff;
        }

      }

      .stats-popup {
        position: absolute;
        background: #fff;
        width: 300px;
        padding: 20px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
        top: 50%;
        margin-top: -138px;
        left: 320px;
        z-index: 9000;

        &:after {
          content: '';
          display: block;
          border: 20px solid transparent;
          border-right-color: #fff;
          position: absolute;
          left: -40px;
          top: 118px;
        }

        dt {
          font-size: 16px;
          margin-top: 10px;
          &:first-child {
            margin-top: 0;
          }
        }

        dd {
          background: none;
          font: 14px sans-serif;
          color: #000;
        }

        .also-voted-for {
          overflow: hidden;
          list-style: none;
          li {
            float: left;
            position: relative;
            margin-right: 10px;
            img {
              width: 50px;
              height: 50px;
              display: block;
            }
            .percent {
              display: block;
              background: #000;
              color: #fff;
              padding: 2px;
              text-align: center;
              font-size: 12px;
            }
          }
        }

        &.out-bounds-top {
          margin-top: -59px;
          &:after {
            top: 39px;
          }
        }

        &.out-bounds-bottom {
          margin-top: 0;
          top: auto;
          bottom: 5px;
          &:after {
            top: auto;
            bottom: 29px;
          }
        }

      }

      &.highlighted {
        dl {
          background: $light;
        }
        &:before {
          border-color: $dark !important;
        }
      }

    }

    &.right {

      .round {
        &:before {
          left: -$ENTRANT_AFTER;
          right: $ENTRANT_WIDTH + 25px;
        }

        &.single-entrant:before {
          left: -8px;
          right: $ENTRANT_WIDTH + $ENTRANT_AFTER;
        }
      }

      .entrant {

        &:before {
          border-left: 1px solid $standard;
          border-right: 0;
          content: '';
          right: $ENTRANT_WIDTH + $ENTRANT_AFTER;
          left: -8px;
        }

        &.user-voted dl:before {
          left: -$voted-dot-radius;
          right: auto;
        }

        dl {
          background-position: right 0;
        }

        .image {
          left: auto;
          right: 0;
        }

        dd {
          text-align: right;
        }

        .seed {
          right: -1px;
          left: auto;
        }

        .votes {
          left: 0;
          right: auto;
        }

        .stats-popup {
          left: -380px;
          &:after {
            border-right-color: transparent;
            border-left-color: #fff;
            left: auto;
            right: -40px;
          }
          dd {
            text-align: left;
          }
        }

      }
    }

  }

  //
  // MOBILE STYLES
  //

  @media screen and (max-width: $MOBILE-WIDTH) {
    top: 60px;
    margin-top: 20px;

    header {
      padding-bottom: 50px;
      .title {
        font-size: 30px;
        margin-top: 0;
      }
    }
  }

}
