app/assets/stylesheets/controllers/matches.css.scss
/*
  Match Regular View
*/

#match {
  $perspective: 300;

  // override background colors on bars for teams
  // FIXME: we only ever have 2 teams - disable condensed view for FFA!
  .top .teams .team1 .info .flag { @include team-background(1); }
  .top .teams .team2 .info .flag { @include team-background(2); }

  .dlbutton {
    margin-top: 10px;
  }

  .botbutbox {
    margin-top: 10px;
    display: block;
    min-width: 100px;
  }

  .midbutbox {
    margin-top: 30px;
    display: block;
    min-width: 145px;
  }

  .atstyle {
    margin-left: 23px;
  }
  
  .lilreddit {
    margin-top: 1px;
    margin-left: 35px;
  }

  .spoiler {
    position: relative;
    
    .button2 {
      // maximum sc2 name length is 12 iirc, this fits 12 at our font size
      width: 110px;
    }
    
    .front, .back {
      position: absolute;
      @include backface-visibility(hidden);
      @include single-transition(transform);
    }
        
    .front {
      @include transform3d(perspective($perspective) rotateX(0));
      z-index: 3;
    }
        
    .back {
      @include rotateX(-180deg);
      z-index: 2;
    }
  }

  .spoiled {
    .front {
      @include transform(rotateX(180deg));
      @include transform3d(perspective($perspective) rotateX(180deg));
    }
    
    .back {
      z-index: 4; // fallback for ye olde IE9
      @include transform(rotateX(0deg));
      @include transform3d(perspective($perspective) rotateX(0deg));
    }
  }

  .button-team1 { background: nth($team-colors, 1); }
  .button-team2 { background: nth($team-colors, 2); }

  .top, .bottom {
    @include center;
  }

  // army directive for each entity - general army directive styling is in
  // directives/army.css.scss
  .army {
  }

  .armychart {
    width: 100%;
    clear: both;
    
    .canvas {
      width: 1024px;
      height: 170px;
    }
  }

  .top {
    padding-bottom: 10px;

    // so that sidebarad can be positioned relative to it
    position: relative;

    // condense collapse/expand button
    .condense {
      @include button2(#f7a725, black);
      display: block;
      width: 100px;
      margin: 0px auto;
    }

    // teams
    .teams {
      display: block;
      clear: both;
      padding: 7px 0px;
      margin-top: 10px;
      position: relative;

      background: image-url('match/teamsep.png') 50% 0% no-repeat;
      
      // match time sitting directly below the "vs" image above
      .sep {
        display: block;
        position: absolute;
        top: 50%;
        left: 50%;
        margin-left: -25px;
        margin-top: -40px;

        text-align: center;
        font-weight: bold;
        
        background: $bg;
        border: 10px $bg solid;
        border-left: none;
        border-right: none;
        
        .vs {
          display: block;
          font-weight: bold;
          font-size: 20px;
          color: darken($bg, 15%);
          text-align: center;
          padding-bottom: 5px;
        }

        .time {
          display: block;
          width: 40px;
          padding: 5px;
          color: black;
          background: $bg;
          border: darken($bg, 15%) 1px solid;
          @include border-radius(2px);
        }
      }

      .team {
        // @include debug-highlight;

        padding: 0px 20px;
        width: 440px;

        display: inline-block;

        .info { 
          @include entity-header;

          // team info header hidden in regular view
          display: none; 
        }
      }

      .team:nth-child(even) {
        float: left;
        text-align: left;
      }
    
      .team:nth-child(odd) {
        float: right;
        text-align: right;

        // .entity is defined in army.css
        // just turning around floats for split teams
        .entity, .info {
          .name {
            float: right;

            .flag {
              float: right;
              margin-right: 0px;
              margin-left: 15px;
            }
          }
          
          .stats {
            float: left;
          }
        }

        .army .unit {
          margin: 0px 5px 5px 0px;
        }
      }
    } //.teams
  }

  .middle {
    padding: 15px 0px;
    margin: 0px 0px 25px 0px;

    // Not sure about these colors at all, but felt like it needed to be offset
    @include background(linear-gradient(darken($bg, 5%), darken($bg, 7%)));
    @include box-shadow(inset 0px 0px 6px rgba(0,0,0,0.2));
    border-top: 1px white solid;
    border-bottom: 1px white solid;

    .content {
      @include center;
    }

    .middlepicker {
      display: inline-block;
      vertical-align: top;
      padding: 20px;

      .pickerbutton {
        width: 65px;
        @include button2(#f7a725, black);
        margin-bottom: 10px;
        
      }
      .selected {
        font-weight: bold;
      }
    }


    .midbox {
      display: inline-block;
    }
    
    .statbox {
      display: inline-block;
      width: 800px;
    }

    // players table
    // TODO: I'm going a little overboard with the nth-child usage below..
    // it could be done much more elegantly, not so much all over the place
    table.players {
      tbody.team {
        // border-bottom: darken($bg, 25%) 3px double;

        tr.player td.name { border-left: nth($team-colors, 1) 10px solid; }

        tr:nth-child(2) {
          td { border-top: darken($bg, 25%) 1px solid; }
        }

        &:nth-last-child(1) {
          border-bottom: none;

          tr.player td.name { border-left: nth($team-colors, 2) 10px solid; }
        }
      }

      tr {
        th {
          white-space: normal !important;
          font-size: 10px;
          text-transform: lowercase;
          color: $gray-dark;
          padding: 0px 5px;
          text-align: center;
          
          display: none;
        }
      }

      // show all table headings on the first team and the first heading on
      // all teams (containing the team name)

      tbody.team1 {
        th { display: table-cell; }
      }

      // team table heading
      tbody.team {
        th:nth-child(1) { 
          display: table-cell; 
          font-size: 12px;
          text-align: left;
          vertical-align: bottom;
          text-transform: uppercase;
          padding: 14px 12px 2px 12px;
        }
      }

      tr {
        td { border-bottom: darken($bg, 25%) 1px solid; }
      }

      tr.player {
        td {
          &:nth-last-child(1) {
            border-right: darken($bg, 25%) 1px solid;
          }

          padding: 8px 14px;
          font-size: 14px;
        
          text-align: center;
        }
      
        td.name {
          font-size: 16px;
          font-weight: bold;
          text-align: left;
        }
      }
    }
  }

  .matchnote {
    padding-left: 30px;
    padding-top: 20px;
    display: inline-block;

    textarea {
      font-size: 16px;
      font-family: $font-default;
    }
    .title {
      text-align: left;
    }
    .status {
      float: right;
      padding: 8px 14px;
    }
    .button {
      float: right;
      position: relative;
      right: 2px;
    }
  }

  .matchmgmt {
    padding-left: 30px;
    padding-top: 20px;
    display: inline-block;
    height: 136px;

    .title {
      text-align: left;
    }
  }
}  // #match

.statsblock {
  display: inline-block;
  width: 100px;
}

.ytplayer {
  display: inline-block;
}

#matches {
  .center {
    @include center;
    margin: 0px auto 70px auto;
  }

  ul.filters {
    li.category { display: none; }
  }

  // Toggle various fields when displaying matches in matches#index
  .matches table {
    .team1, .team2 { display: table-cell; }
    .num, .type, .duration, .apm, .wpm, .sq, .result, .race, .spending_skill, .saturation_skill, .racemacro, .sat_skill_1, .sat_skill_2, .sat_skill_3 { display: none; }
  }
}

div#matches.matchessearch {
  .matches table {
    .team1, .team2 { width: 150px; }
    .duration { display: table-cell; }
  }
  .winner {
    font-weight: bold;
  }
}

/*
  Match Condensed View and Transition States
  
  This might be confusing: I'm not adding from/to transition states to the 
  general styling of #match below (Regular Styling) because these states
  (height, opacity, etc.) are specifically here to have a state to transition
  from.
  
  Removing both this and the condensed section should not influence the general
  styling at all if possible. </lecture>
*/

$match-transition: 300ms ease-in-out;

#match {
  .top .teams {
    .army {
      .entity {
        @include transition($match-transition);
        overflow: hidden;
        height: 20px;
        margin-bottom: 15px;
        @include opacity(1.0);
      }
    }
    
    .team .info {
      @include transition($match-transition);
      display: block;
      overflow: hidden;
      margin-bottom: 15px;
      @include opacity(0.5);
      
      .stats {
        @include opacity(0.0);
      }
    }
  }

  // Show individual player bars
  .team-bar .bar {
    @include transition($match-transition);
    @include opacity(1.0);
  }
  
  // And to be safe, remove the background on team-bar
  .bars .team1,
  .bars .team2 {
    background-color: transparent;
  }
}

#match.condensed {
  .bars .team1 { @include team-background(1); }
  .bars .team2 { @include team-background(2); }

  // reverse right side
  .top .teams {
    .army {
      // individual .entity headers are hidden
      .entity { 
        // display: none;
        height: 0px;
        margin-bottom: 0px;
        @include opacity(0.0);
      }

      .units {
        // The player's color is a border on .army instead
        // (border color is set in the army directive template)
        border-left-width: 10px;
        border-left-style: solid;
        padding-left: 10px;
      }
    
      // and give it a margin on the bottom instead
      margin-bottom: 10px;
    }

    .team .info {
      margin-bottom: 15px;
      @include opacity(1.0);

      .stats {
        @include opacity(1.0);
      }
    }

    .team:nth-child(odd) {
      .army .units {
        border-left-width: 0px;
        border-right-width: 10px;
        border-right-style: solid;
        padding-left: 0px;
        padding-right: 10px;
      }
    }
  }

  // Hide individual team player bars to show the underlying team-bar
  .team-bar .bar {
    @include opacity(0);
  }
}

// it makes no sense to condense a 1v1!
#match.type-1v1 {
  .condense { display: none; }
  .top .teams .team .info { display: none; }
}

.matches {
  table {
    @extend table.default;
  }

  .slider {
    margin-bottom: 20px;
  }
}
