/* ====== *
 * Layout *
 * ====== */

body {
  background-color: #fff;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 1vw;
  }
  #wrapper {
    display: grid;
    grid-template-columns: 1fr 20%;
    grid-template-rows: 1fr 30%;
    width: 100vw;
    height: 100vh;
    }
    #viewer {
      background-color: #000;
      grid-column: 1 / 2;
      grid-row: 1 / 2;
      }
    #controls {
      background-color: #333;
      grid-column: 1 / 2;
      grid-row: 2 / 3;
      }
    #chat {
      color: #ddd;
      background-color: #555;
      grid-column: 2 / 3;
      grid-row: 1 / 2;
      overflow-y: scroll;
      }

/* ========= *
 * Chat Area *
 * ========= */

#chatmessages {
  list-style-type: none;
  margin: 0;
  padding: 0;
  }
  #chatmessages li {
    padding: 5px 10px;
    }
  #chatmessages li:nth-child(odd) {
    background: rgba(0,0,0,0.2);
    }
#chatinput {
  background-color: #444;
  color: #fff;
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  }
  #chatform {
    padding: 5px;
    bottom: 0;
    position: relative;
    }
    #chatform input {
      box-sizing: border-box;
      border: 0;
      width: 100%;
      padding: 10px;
      margin-bottom: 5px;
      }
    #chatform button {
      box-sizing: border-box;
      width: 100%;
      background: #222;
      color: #ccc;
      border: none;
      padding: 10px;
      border-radius: 5px;
      font-weight: bold;
      font-size: 1.2vw;
      }
#loggedinas {
  display: block;
  text-align: center;
  margin: 1vw;
  }
#username {
  display: block;
  text-align: center;
  font-weight: bold;
  font-style: italic;
  padding: 1vw;
  margin: 1vw;
  border-radius: 3px;
  }
  #username.teama {
    background: #ff0043;
    }
  #username.teamb {
    background: #0043ff;
    }

/* =========== *
 * Team Viewer *
 * =========== */

#game {
  height: 100%;
  color: #fff;
  }
  .team {
    display:block;
    height: 100%;
    width: 50%;
    float: left;
    overflow: hidden;
    }
    .team h2, .team h3 {
      padding: 0 20px;
      }
    .teampower {
      font-weight: bold;
      font-size: 2em;
      }
    .teammembercount {
      font-size: 0.8em;
      font-style: italic;
      }
    /*
    .teammembers {
      list-style-type: none;
      margin: 0;
      padding: 0;
      }
      .teammembers li {
        padding: 5px 10px;
        }
      .teammembers li:nth-child(odd) {
        background: rgba(0,0,0,0.2);
        }
    */
    .stance {
      font-weight: bold;
      font-style: italic;
      margin: 0 20px;
      text-transform: uppercase;
      }
      .teamstance {
        font-size: 1.4em;
        }
    .upgrades {
      }
      .upgrades ul {
        font-size: 1em;
        margin: 0 10px;
        padding: 0;
        list-style-type: none;
        }
        .upgrades ul li {
          font-weight: bold;
          display: block;
          float: left;
          margin: 10px;
          padding: 10px;
          border-radius: 10px;
          background: rgba(0,0,0,0.15);
          }
          #teamb .upgrades ul li {
            float: right;
          }
  #teama {
    background: #ff0043;
    }
  #teamb {
    background: #0043ff;
    text-align: right;
    }
#lobby {
  height: 100%;
  display: none;
  background: #000;
  text-align: center;
  color: #fff;
  }
  #lobby h2 {
    margin-top: 0;
    padding-top: 20px;
  }
  #lobby h3 {
    margin-bottom: 0;
  }
  #lobby.teama {
    background: #ff0043;
    }
  #lobby.teamb {
    background: #0043ff;
    }
  .lobbystats {
    }
    .lobbystats ul {
      margin-top: 0;
      list-style-type: none;
      padding: 0;
    }
    .lobbystats .stat {
      font-size: 1.3em;
      font-weight: bold;
    }
    #winnerstats {
      font-size: 1.2em;
    }
  #countdowntimer {
    font-weight: bold;
    font-size: 3em;
    }

/* ======== *
 * Controls *
 * ======== */

#buttons {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: 1fr 1fr;
  grid-gap: 10px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 10px;
  background: #333;
  color: #fff;
  }
  .button {
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -khtml-user-select: none; /* Konqueror HTML */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */
    font-size: 1.5em;
    font-weight: bold;
    display: block;
    padding: 10px;
    text-align: center;
    vertical-align: middle;
    border-radius: 10px;
    position: relative;
    min-height: 1em;
    z-index: 10;
    }
    .button:active {
      background: #fff;
      }
    .button.selected {
      border: 3px solid #fff;
      }
      .buttonbackground {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 10px;
        background: #987;
        z-index: -2;
        }
      .buttonfill {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        border-radius: 10px;
        z-index: -1;
        }
    #buttons.teama .buttonbackground {
      background: #cc1110;
      }
      #buttons.teama .buttonfill {
        background: #ff0043;
        }
    #buttons.teamb .buttonbackground {
      background: #3310cc;
      }
      #buttons.teamb .buttonfill {
        background: #0043ff;
        }
    .powerbuttontitle {
      display: block;
      }
    .powerbuttonsubtitle {
      font-size: 0.8em;
      font-style: italic;
      font-weight: normal;
      }
  #clickaggressive {
    grid-column: 1 / 3;
    grid-row: 1;
    }
  #click {
    grid-column: 3 / 5;
    grid-row: 1;
    }
  #clickdefensive {
    grid-column: 5 / 7;
    grid-row: 1;
    }
  .upgradebutton {
    font-size: 1.1em;
    }
    .upgradename {
      }
    .upgradelevel {
      }
    .upgradedescription {
      font-size: 0.8em;
      font-style: italic;
      font-weight: normal;
      }
    .upgradecost {
      font-size: 0.9em;
      }
    .upgradecostinfo {
      font-size: 0.8em;
      }

/* ========================== *
 * adaptive layout for mobile *
 * ========================== */

@media screen and (orientation: portrait) {
  #wrapper {
    grid-template-columns: 1fr 0%;
    grid-template-rows: 60% 40%;
    }
  #chat, #chatmessages, #chatinput {
    display: none;
    }
  body {
    font-size: 2vw;
    }
  .button {
    font-size: 3vw;
    }
  }


/* =============== *
 * jquery UI stuff *
 * =============== */

.ui-dialog-titlebar-close {
  display: none;
  }
.ui-widget-overlay {
  background: #000;
  opacity: 0.5;
  }
