* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@font-face {
  font-family: 'Material Icons';
  font-style: normal;
  font-weight: 400;
  src: url(font/MaterialIcons-Regular.eot); /* For IE6-8 */
  src: local('Material Icons'),
       local('MaterialIcons-Regular'),
       url(font/MaterialIcons-Regular.woff2) format('woff2'),
       url(font/MaterialIcons-Regular.woff) format('woff'),
       url(font/MaterialIcons-Regular.ttf) format('truetype');
}

.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;  /* Preferred icon size */
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;

  /* Support for all WebKit browsers. */
  -webkit-font-smoothing: antialiased;
  /* Support for Safari and Chrome. */
  text-rendering: optimizeLegibility;

  /* Support for Firefox. */
  -moz-osx-font-smoothing: grayscale;

  /* Support for IE. */
  -webkit-font-feature-settings: 'liga';
          font-feature-settings: 'liga';
}

:focus {
  outline: 0;
}

body {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 100vh;
  font-family: sans-serif;
}

header {
  align-items: center;
  background-color: #757575;
  color: #fff;
  display: flex;
  flex-direction: row;
  height: 50px;
  justify-content: space-between;
  padding: 10px;
}

header .title {
  color: #fff;
  font-size: 25px;
  font-style: italic;
}

.battle-header {
  background-color: #EEEEEE;
  color: #616161;
}

header > span {
  align-items: center;
  display: flex;
  width: 30%;
}

header > span:nth-child(2) {
  justify-content: center;
  text-align: center;
}

header > span:nth-child(3) {
  justify-content: flex-end;
  text-align: right;
}

footer {
  align-items: center;
  background-color: #D32F2F;
  color: #fff;
  display: flex;
  flex-direction: row;
  height: 50px;
  justify-content: center;
}

header a {
  color: #E0E0E0;
  text-decoration: none;
}

header a:hover {
  text-decoration: underline;
}

content {
  background-color: #F5F5F5;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: auto;
}

.centered {
  align-items: center;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: center;
}

h2 {
  color: #757575;
  font-weight: normal;
  padding-bottom: 10px;
  padding-top: 10px;
  text-align: center;
}

.subhead {
  color: #757575;
  padding-bottom: 5px;
  text-align: center;
}

h2.winner {
  font-size: 40px;
}

h3 {
  color: #757575;
  font-size: 30px;
  font-weight: normal;
  padding-bottom: 10px;
  padding-top: 10px;
  text-align: center;
}

.link {
  color: #0277BD;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.button {
  cursor: pointer;
  background-color: #0288D1;
  border: none;
  border-radius: 0;
  color: #fff;
  margin: 4px;
  min-width: 100px;
  padding: 8px;
  text-align: center;
  transition: all 0.2s;
}

.button:hover {
  background-color: #2196F3;
}

.button.red {
  background-color: #E53935;
}

.button.red:hover {
  background-color: #F44336;
}

.button:disabled {
  background-color: #616161;
  cursor: wait;
}

.button:disabled:hover {
  background-color: #757575;
}

.round {
  align-items: center;
  border-radius: 50%;
  display: flex;
  height: 40px;
  justify-content: center;
  min-width: 0;
  padding: 0;
  width: 40px;
}

.form-container {
  display: flex;
  flex-direction: column;
  position: relative;
}

.wiggle {
  animation: wiggle 1 0.5s ease-in-out;
}

.bobble {
  animation: bobble 1 0.5s ease-in-out;
}

.notify {
  animation: notify infinite 2s ease-in-out;
}

@keyframes wiggle {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-12px);
  }
  75% {
    transform: translateX(12px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes bobble {
  0% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(-25deg);
  } 
  75% {
    transform: rotate(25deg);
  }
  100% {
    transform: rotate(0);
  }
}

/* Sparkle and rock back and forth */
@keyframes notify {
  0% {
    background-color: #90CAF9;
    transform: rotate(0);
  }
  10% {
    transform: rotate(-25deg);
  } 
  30% {
    transform: rotate(25deg);
  }
  40% {
    background-color: #0288D1;
  }
  50% {
    transform: rotate(-10deg);
  } 
  70% {
    transform: rotate(10deg);
  }
  80%, 100% {
    background-color: #0288D1;
    transform: rotate(0);
  }
}

.input-container {
  display: flex;
  flex-direction: row-reverse;
  margin: 0 4px;
  padding: 4px 0;
}

.input-container i {
  color: #9E9E9E;
  margin: 4px;
}

.input-container input[type=text],
.input-container input[type=password] {
  padding: 4px;
}

.flex-grow {
  flex-grow: 1;
}

.login-info {
  text-align: right;
}

.chat-overlay {
  align-items: stretch;
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: flex-start;
  left: 0;
  position: fixed;
  top: 0;
  width: 100%;
}

.chat-overlay .message-header, .chat-overlay .message-row {
  flex-grow: 0;
  flex-shrink: 0;
}

.chat-overlay .message-container {
  flex-grow: 1;
  overflow-y: auto;
}

.chat-overlay .message-row {
  align-items: center;
  background-color: #757575;
  display: flex;
  flex-direction: row;
  height: 50px;
  justify-content: center;
}

.chat-overlay .message-row .input-container {
  flex-grow: 1;
  max-width: 800px;
}

.chat-overlay .message-row .input-container input {
  background-color: transparent;
  border: none;
  color: #fff;
  flex-grow: 1;
}

.chat-overlay .message-row .input-container input::placeholder {
  color: #ddd;
}

.chat-overlay .form-container {
  background-color: #000;
  border-radius: 4px;
  margin: 4px;
  padding: 10px;
}

.chat-overlay .form-container .round i.material-icons {
  color: #fff;
}

.chat-messages {
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
}

.chat-message {
  align-items: stretch;
  background-color: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin: 5px;
  padding: 10px;
  width: 60%;
}

.chat-message.own {
  align-self: flex-end;
}

.chat-message > .author {
  color: #0D47A1;
  font-size: 12px;
  font-style: italic;
  margin-bottom: 5px;
}

.chat-message > .body {
  color: #616161;
  font-size: 12px;
}

.battle-container, .battle-pane {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: flex-start;
}

.battle-pane {
  justify-content: space-between;
}

.classes {
  align-items: center;
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  margin: 0 16px;
}

.classes.enemy {
  align-self: flex-end;
}

.classes.team {
  align-self: flex-start;
}

.classes.vert {
  flex-direction: column;
  align-self: stretch;
}

.battle-pane .message {
  align-items: center;
  align-self: stretch;
  display: flex;
  flex-direction: row;
  min-height: 50px;
  justify-content: space-between;
}

.message > span {
  flex-grow: 0;
  padding: 10px;
  width: 100px;
}

.message-column {
  align-items: center;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: center;
  width: auto;
}

.message-column .instruction {
  color: #757575;
  font-size: 30px;
  text-align: center;
}

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

.howto-tree .class-card {
  height: 150px;
  width: 90px;
}

.howto-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
}

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

.howto-column.reverse {
  flex-direction: column-reverse;
}

.class-card {
  color: #fff;
  box-shadow: 0 0 0 #000;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 250px;
  justify-content: space-between;
  margin: 10px;
  position: relative;
  transform: translate(0, 0);
  transition: all 0.4s;
  width: 150px;
}

.class-card .name {
  color: #fff;
  text-transform: capitalize;
  font-weight: normal;
  top: 5px;
  word-break: keep-all;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.howto-tree .name {
  font-size: 13px;
}

.class-card:hover .hidden-buff {
  opacity: 1;
}

.class-card .hidden-buff {
  align-items: center;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 250px;
  justify-content: center;
  left: 50%;
  opacity: 0;
  padding: 8px;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.2s;
  width: 150px;
}

.hidden-buff > div {
  margin-bottom: 8px;
  margin-top: 8px;
}

.class-card.active:after {
  bottom: 0;
  content: 'arrow_upward';
  font-family: 'Material Icons';
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
}

.class-icon {
  background-image: url('/res/icons.png');
  background-position-x: 0;
  height: 31px;
  width: 31px;
  -webkit-font-smoothing: subpixel-antialiased;
}

.class-icon.future {
  background-position-y: 93px;
}

.class-icon.feudal {
  background-position-y: 124px;
}

.class-icon.fantasy {
  background-position-y: 0px;
}

.class-icon.feral {
  background-position-y: 31px;
}

.class-icon.fanatic {
  background-position-y: 62px;
}

.class-icon.attack {
  background-position-x: 93px;
}

.class-icon.defend {
  background-position-x: 62px;
}

.class-icon.power {
  background-position-x: 31px;
}

.lineup {
  align-items: center;
  display: flex;
  flex-direction: row;
  height: 100px;
  justify-content: center;
}

.lineup .card {
  align-items: center;
  border: 2px solid #aaa;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 80px;
  justify-content: center;
  margin: 4px;
  width: 70px;
  position: relative;
  transform: translate(0,0);
  transition: all 0.2s;
}

.lineup .card:hover {
  border: 2px solid #ccc;
}

.lineup .class-icon {
  zoom: 1.5;
}

.class-card .avatar {
  background-image: url('/res/sprites.png');
  height: 192px;
  position: absolute;
  top: calc(50% - 30px);
  left: 50%;
  transform: translate(-50%, -50%);
  background-position-x: 0;
  -webkit-font-smoothing: subpixel-antialiased;
  width: 192px;
}

.howto-tree .avatar {
  height: 115px;
  top: calc(50% - 15px);
  width: 115px;
  background-size: 690px 575px;
}

.class-card.attacked {
  animation: 0.5s pulse infinite linear;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
  100% {
    opacity: 1;
  }
}

.class-card.attacking .avatar, .class-card.recruit:hover .avatar {
  background-image: url('/res/sprites_attack.png');
}

.class-card.attacked {
  box-shadow: 0 0 30px #500;
}

.team .class-card.attacking {
  transform: translateY(-20px);
}

.enemy .class-card.attacking {
  transform: translateY(20px);
}


.class-card .avatar.future {
  background-position-y: 0;
}

.class-card .avatar.feudal {
  background-position-y: 768px;
}

.class-card .avatar.fantasy {
  background-position-y: 576px;
}

.class-card .avatar.feral {
  background-position-y: 383px;
}

.class-card .avatar.fanatic {
  background-position-y: 191px;
}

.class-card .avatar.sprite-0 {
  background-position-x: 0;
}

.class-card .avatar.sprite-1 {
  background-position-x: 960px;
}

.class-card .avatar.sprite-2 {
  background-position-x: 768px;
}

.class-card .avatar.sprite-3 {
  background-position-x: 576px;
}

.class-card .avatar.sprite-4 {
  background-position-x: 384px;
}

.class-card .avatar.sprite-5 {
  background-position-x: 192px;
}


.howto-tree .avatar.future {
  background-position-y: 0;
}

.howto-tree .avatar.feudal {
  background-position-y: 460px;
}

.howto-tree .avatar.fantasy {
  background-position-y: 345px;
}

.howto-tree .avatar.feral {
  background-position-y: 229px;
}

.howto-tree .avatar.fanatic {
  background-position-y: 114px;
}

.howto-tree .avatar.sprite-0 {
  background-position-x: 0;
}

.howto-tree .avatar.sprite-1 {
  background-position-x: 575px;
}

.howto-tree .avatar.sprite-2 {
  background-position-x: 460px;
}

.howto-tree .avatar.sprite-3 {
  background-position-x: 345px;
}

.howto-tree .avatar.sprite-4 {
  background-position-x: 230px;
}

.howto-tree .avatar.sprite-5 {
  background-position-x: 115px;
}

.class-card.dead {
  position: relative;
  opacity: 0.5;
}

.class-card.dead .avatar {
  transition: all 0.5s ease;
}

.team .dead .avatar, .enemy .dead .avatar {
  transform: rotate(180deg) translate(50%, 0);
}

.class-card.dead .commands {
  pointer-events: none;
}

.class-card.future {
  background: linear-gradient(transparent, #01579B);
}

.class-card.future:hover {
  background: linear-gradient(transparent, #1565C0);
}

.class-card.feudal {
  background: linear-gradient(transparent, #B71C1C);
}

.class-card.feudal:hover {
  background: linear-gradient(transparent, #C62828);
}

.class-card.fantasy {
  background: linear-gradient(transparent, #1B5E20);
}

.class-card.fantasy:hover {
  background: linear-gradient(transparent, #2E7D32);
}

.class-card.feral {
  background: linear-gradient(transparent, #876a2c);
}

.class-card.feral:hover {
  background: linear-gradient(transparent, #b57e36);
}

.class-card.fanatic {
  background: linear-gradient(transparent, #6c0f6d);
}

.class-card.fanatic:hover {
  background: linear-gradient(transparent, #941caf);
}

.status-bar {
  align-items: center;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  left: 0;
  padding: 8px;
  position: absolute;
  bottom: 0;
  width: 100%;
}

.status-bar .health {
  color: #fff;
  font-size: 20px;
  transition: all 0.2s ease;
}

.animateText.health {
  font-size: 30px;
  animation: 0.2s bobbleText infinite;
}

@keyframes bobbleText {
  0% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(-5deg);
  } 
  75% {
    transform: rotate(5deg);
  }
  100% {
    transform: rotate(0);
  }
}

.status-bar .stats {
  color: #fff;
  display: flex;
  flex-direction: row;
  font-size: 20px;
  width: 100%;
}

.status-bar .stats span {
  text-align: center;
}


.commands,
.defend-overlay {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  left: 0;
  position: absolute;
  top: 0;
  transition: all 0.2s;
  width: 100%;
}

.commands {
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
}

.commands.active, .commands:hover, .class-card.selecting .commands {
  opacity: 1;
}

.commands .action-button {
  align-items: center;
  border: 2px solid transparent;
  background-color: transparent;
  border-radius: 50%;
  display: flex;
  height: 80px;
  justify-content: center;
  margin: 5px;
  transition: all 0.2s;
  width: 80px;
}

.commands .action-button .class-icon {
  zoom: 2;
}

.defend-overlay .class-icon {
  transform: scale(3);
  animation: bumpZoom 1 0.5s ease-in-out;
}

@keyframes bumpZoom {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  80% {
    transform: scale(4);
  }
  100% {
    opacity: 1;
    transform: scale(3);
  }
}

.commands .action-button:hover,
.commands .action-button.active {
  border: 2px solid white;
}

.action-button:hover.attack {
  border-color: #faa;
}

.action-button:hover.defend {
  border-color: #aaf;
}

.commands .action-button.active {
  background-color: rgba(255, 255, 255, 0.2);
}

.round-counter {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  font-size: 30px;
  justify-content: flex-start;
  left: 30px;
  position: absolute;
  top: 80px;
}

.class-info-container {
  align-items: center;
  align-self: stretch;
  background-color: #E0E0E0;
  display: flex;
  flex-direction: row;
  margin: 10px;
  overflow-x: auto;
  padding: 10px;
}

.class-info-container > .class-card {
  margin: 0 8px 0 0;
}

.class-info {
  background-color: #F5F5F5;
  display: flex;
  flex-direction: row;
  width: 150px;
  height: 250px;
  justify-content: flex-start;
}

.class-info > .class-card {
  margin: 0 8px 0 0;
}

.stylish-table {
  font-size: 20px;
  padding: 10px;
}

.stylish-table td:first-child {
  font-weight: bold;
  word-wrap: normal;
  white-space: nowrap;
  min-width: 100px;
  padding-right: 5px;
  text-align: right;
}

.red {
  color: #900;
}

.blue {
  color: #009;
}

.green {
  color: #070;
}

.purple {
  color: #808;
}

.orange {
  color: #880;
}


.power-up {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.power-up .class-icon {
  transform: scale(3);
}

.show-ability {
  position: absolute;
  right: 5px;
  top: 5px;
}

.attack-speed {
  display: flex;
  flex-direction: column;
  left: 8px;
  position: absolute;
  bottom: 8px;
  font-family: monospace;
  font-size: 12px;
}

.attack-speed .animateText {
  font-size: 20px;
  animation: 0.2s bobbleText infinite;
}

.how-to {
  align-items: stretch;
  align-self: center;
  background-color: #EEEEEE;
  color: #616161;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  max-width: 800px;
  padding: 20px;
  margin: 20px auto;
}

.how-to ul {
  margin-left: 30px;
}

.how-to p {
  margin-bottom: 10px;
  margin-top: 10px;
}

.versus-dialog {
  align-items: center;
  animation: 4s fadeinout 1 ease-in-out;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: row;
  height: 100%;
  justify-content: center;
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 3;
}

label {
  display: flex;
  justify-content: center;
  align-items: center;
}

.versus-dialog .vs {
  color: #fff;
  font-size: 40px;
  padding: 10px;
}

.versus-dialog .player-name {
  color: #81D4FA;
  font-size: 40px;
  font-style: italic;
}

.slide-left {
  animation: slide-left 1 1s ease-in;
}

.slide-right {
  animation: slide-right 1 1s ease-in;
}

@keyframes slide-left {
  0%, 50% {
    opacity: 0;
    transform: translateX(-30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-right {
  0%, 50% {
    opacity: 0;
    transform: translateX(30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeinout {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

#preload-sprites {
  background: url(/res/sprites.png) no-repeat -9999px -9999px;
}
#preload-sprites-attack {
  background: url(/res/sprites_attack.png) no-repeat -9999px -9999px;
}
#preload-icons {
  background: url(/res/icons.png) no-repeat -9999px -9999px;
}
[id^="preload"] {
  height: 0;
  position: fixed;
  top: -9999px;
  left: -9999px;
  width: 0;
}

.leaderboard {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin-top: 30px;
}

.leaderboard h2 {
  font-size: 40px;
}

.leaderboard table {
  border: none;
  border-collapse: collapse;
  border-spacing: 0 5px;
  border-style: none;
  box-sizing: border-box;
  min-width: 600px;
  margin: 20px;
}

.leaderboard tr {
  background-color: #E0E0E0;
}

.leaderboard tr:nth-child(even) {
  background-color: #BDBDBD;
}


.leaderboard td, .leaderboard th {
  padding: 5px;
}

.leaderboard th {
  background-color: #F5F5F5;
  font-weight: bold;
  text-align: center;
}

.leaderboard td.index {
  color: #fff;
  background-color: #616161;
  font-weight: bold;
  text-align: center;
  width: 30px;
}

.leaderboard td.name {
  font-style: italic;
  width: 300px;
}

.leaderboard td.center {
  text-align: center;
}


@media screen and (max-width: 800px) {
  .how-to {
    flex-grow: 1;
    flex-shrink: 1;
    margin: 0;
    max-width: none;
    width: 100%;
  }

  .button {
    font-size: 25px;
    padding: 8px;
    min-width: 200px;
  }

  .message-row, .message-header, .input-container {
    height: 70px !important;
  }

  .input-container input {
    font-size: 30px;
  }

  .round {
    height: 70px;
    min-width: 70px;
    width: 70px;
    border-radius: 50%;
  }

  .round.select {
    height: 50px;
    min-width: 150px;
    border-radius: 8px;
  }

  .chat-message > .author {
    font-size: 25px;
  }

  .chat-message > .body {
    font-size: 25px;
  }
}