body {
  background-color:black;
}

#game-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

#game-root {
  position: relative;
}

#game-view {
  image-rendering: optimizeSpeed;
}

#background {
  background:url('../img/common/loading.png') no-repeat center center, #000;
}

.error #background {
  background:url('../img/common/loading-error.png') no-repeat center center, #000;
}

#background, #foreground { margin:0; padding:0;}

#canvas, 
#foreground, 
#background,
#game-view {
  -moz-user-select: none;
  -webkit-user-select: none;
  -o-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
#background, #foreground {
  margin:0;
  padding:0;
}

#game-loading {
  position: absolute;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
#game-loading.hide {
  animation: 1s fade-out;
  opacity: 0;
  pointer-events: none;
}
#game-loading > h1 {
  position: relative;
  top: -60px;
  font-size: 30pt;
  font-weight: bold;
  color: #f7931e;
  text-transform: uppercase;
  text-shadow: 1px 1px 4px black; 
}

@keyframes fade-in {
  from { opacity: 0; } 
  to { opacity: 1; }
}

@keyframes fade-out {
  from { 
    opacity: 1;
    visibility: visible;
  } 
  to { 
    opacity: 0; 
    visibility: hidden;
  }
}

#game-loading > .logo {
  content: url('../images/ui/logo.jpg');
}

#game-view {
  width:640px;height:360px;
  width: 100vw;
  height: calc(100vw * 9 / 16);
}


#foreground {
  color: white;
}

/******************************************************/
.dialog {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  pointer-events: none;
}

.dialog > .contents {
  position: relative;
  pointer-events: auto;
  border-style: solid;
  border-image: url("../images/ui/grey_panel.png") 4 4 fill;
  color: black;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.dialog > .contents > .nav-tabs {
  padding-left: 8px;
  flex: none;
}
.dialog > .contents > .tab-content {
  background-color: white;
  padding: 16px;
  border: 1px solid #ddd;
  border-top-width: 0px;
  border-radius: 0 0 5px;
  flex: 1 1 auto;
  overflow: auto;
}

.dialog > .contents > .dialog-buttons {
  display: flex;
  flex-flow: row nowrap;
  justify-content: flex-end;
}
.dialog > .contents > .dialog-buttons > button {
  margin: 0 4px;
}
.dialog > .contents > .dialog-buttons > button:first-child {
  margin-left: 0;
}
.dialog > .contents > .dialog-buttons > button:last-child {
  margin-right: 0;
}

.dialog.modal {
  background-color: rgba(0,0,0,0.7);
  z-index: 1;
  pointer-events: auto;
}

progress-overlay {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1;

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

progress-badge {
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0,0,0,0.9);
  border-radius: 10px;
  margin: -4px;
}

.spinner {
   height:50px;
   width:50px;
   animation: rotation .7s infinite linear;
   border-left:6px solid rgba(0,174,239,.4);
   border-right:6px solid rgba(0,174,239,.4);
   border-bottom:6px solid rgba(0,174,239,.4);
   border-top:6px solid rgba(0,174,239,.8);
   border-radius:100%;
}

@keyframes rotation {
   from {transform: rotate(0deg);}
   to {transform: rotate(359deg);}
}

/******************************************************/
#scoreboard {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 200px;
}

game-scoreboard {
  display: table;
}
game-scoreboard.hidden {
  display: none;
}

game-scoreboard .header {
  display: table-header-group;
}

game-scoreboard .header span:first-child {
  text-align: left;
}

game-scoreboard .header span {
  display: table-cell;
  padding: 0 5px;
  text-align: right;
  background-color: rgba(0,0,255,0.5);
}

scoreboard-item {
  display: table-row;
  background-color: rgba(0,0,0,0.5);
}

scoreboard-item:nth-child(even) {
  background-color: rgba(50,50,50,0.5);
}

scoreboard-item span {
  display: table-cell;
  padding: 0 5px;
  text-align: right;
}

scoreboard-item span:first-child {
  text-align: left;
}

/******************************************************/
login-ui {
  background-color: rgba(0,0,0,0.7);
}

login-ui .contents {
  max-width: 400px;
  animation: 0.5s fade-in;
}

login-ui .title {
  margin: 10px auto 25px;
  content: url('../images/ui/logo-md-narrow.png');
}

login-ui form {
  margin-bottom: 0;
}

.btn.btn-login {
}

.btn.btn-login > img {
  width: 18px;
  height: 18px;
  position: relative;
  top: -2px;
}

.btn.btn-login > img+span {
  padding-left: 8px;
}
.btn-twitter {
  background-color: #1DA1F2;
  border-color: #1DA1F2;
}
.btn-twitter:hover {
  background-color: #177fbf;
  border-color:#177fbf;
}

.btn-twitch {
  background-color: #6441A4;
  border-color: #6441A4;
}
.btn-twitch:hover {
  background-color: #442d70;
  border-color: #442d70;
}

.btn-facebook {
  background-color: #3b5998;
  border-color: #3b5998;
}
.btn-facebook:hover {
  background-color: #283a66;
  border-color: #283a66;
}

.btn-google {
  background-color: #fff;
  border-color: #fff;
  color: #757575;
}
.btn-google:hover {
  background-color: #ddd;
  border-color: #ddd;
  color: #757575;
}

.nav-bubble > li > a.nav-link {
  text-transform: uppercase;
  padding: 2px 12px;
  border: 1px solid darkgray;
  border-radius: 2px;
  background-color: white;
}
.nav-bubble > li > a.nav-link:hover {
  background-color: #eee;
}
.nav-bubble > li > a.nav-link:active {
  background-color: #ccc;
}
.nav-bubble > li > a.nav-link.active {
  color: white;
  background-color: red;
  border-color: red;
}
.nav-bubble > li+li {
  margin-left: 8px;
}

.simple-bubble {
  color: black;
  background-color: #fff;
  border: 1px solid black;
  padding: 8px;
}

.flex-spacer {
  flex: 1 1 auto;
}

.flex-row {
  display: flex;
  flex-flow: row;
}

.flex-column {
  display: flex;
  flex-flow: column;
}

/******************************************************/
menu-ui {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  align-items: center;
}

menu-ui > .ads {
  margin-right: 8px;
}

menu-ui > .ads > ad-container+ad-container {
  margin-top: 8px;
}

menu-ui > .main {
  align-items: center;
  width: 500px;
  height: 350px;
}

menu-ui > .main > .section-contents {
  overflow: auto;
}
menu-ui > .main > .simple-bubble+.simple-bubble {
  margin-top: 8px;
}
menu-ui > .main > .sections {
  align-self: stretch;
  align-content: center;
  flex: 0 0 auto;
}
menu-ui > .main > .section-contents {
  align-self: stretch;
  height: 400px;
}

/* footer links */
menu-ui >.main >  .footer-links {
  flex: 0 0 auto;
  display: flex;
  align-self: flex-end;
}

menu-ui > .main > .footer-links > span {
  padding: 0 4px;
}
menu-ui > .main > .footer-links > span + span:before {
  content: "|";
  padding-right: 8px;
}

.logo > .logo-image {
  content: url('../images/ui/logo-md-wide.png');
  padding-bottom: 0.5em;
}

@media screen and (min-width: 1000px) {
  menu-ui > .main {
    width: 600px;
    height: 450px;
  }
  
  .logo > .logo-image {
    content: url('../images/ui/logo-md-wide.png');
  }
}

@media screen and (min-width: 1280px) {
  menu-ui > .main {
    width: 600px;
    height: 600px;
  }
}

player-summary {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

player-summary > profile-name {
  margin-right: 0.5em;
}

player-summary .currency {
  border: 1px solid darkgray;
  border-radius: 2px;
  padding: 0px 8px;
}

/******************************************************/

.how-to-play {
  display: flex;
  flex-flow: row wrap;
}

.how-to-play > div {
  margin: 0px 6px;
}

.how-to-play .gun {
  content: url('../images/ui/weapon_gun_side.png');
}
.how-to-play .armor {
  content: url('../images/ui/armor_brown_side.png');
}
.how-to-play .ammo {
  content: url('../images/ui/pickup_ammo.png');
}

/******************************************************/

play-as {
  display: block;
}
play-as > .form-group > .form-check,
play-as > .form-group > .form-control {
  display: inline-block;
  width: auto;
}

.logo-xs {
  content: url('../images/ui/logo-xs.png');
}
.logo-md-narrow {
  content: url('../images/ui/logo-md-narrow.png');
}

/******************************************************/

.news-item+.news-item {
  margin-top: 8px;
}

.news-item {
  padding: 8px;
  border: 1px solid black;
}

.news-item > .title,
.news-item > .subtitle {
  display: inline;
}

.news-item > .subtitle {
  font-size: 80%;
  margin-left: 0.5rem;
  color: #666;

  position: relative;
  top: -1px;
}

.news-item ul {
  margin-bottom: 0;
}

markdown {
  display: block;
}
markdown > p {
  margin-bottom: 0;
}

/******************************************************/

matchresult .result {
  display: flex;
  flex-flow: row nowrap;
}

matchresult.dialog {
  justify-content: flex-start;
}
matchresult.dialog > .contents {
  margin-top: 20px;
  padding: 8px;
}

matchresult .result > div {
  margin: 24px;
  margin-bottom: 4px;
}
matchresult .result > div+div {
  margin-left: 0;
}

matchresult .actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}
matchresult .medal {
  flex: 1 1 auto;
  align-self: center;
}

matchresult .info {
  display: flex;
  flex-flow: column;
  flex: 0 0 auto;
}

matchresult .info > * {
  padding-bottom: 0.5em;
}

matchresult .info > .rank {
  font-weight: bold;
}

matchresult .info > .stats {
  font-size: 80%;
  display: flex;
  flex-flow: row wrap;
  justify-content: space-between;
}

matchresult .info > .stats div.stat {
  flex: 0 0 50%;
  white-space: nowrap;
}

matchresult .info > .stats .sprite {
  background-size: 50% 50%;
  display: none;
  border: 1px solid purple;
}

matchresult .death .killer {
  color: #36dd51;
}

player-info {
  display: inline-block;
}

player-name > .icon {
  display: inline-block;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  margin: -8px 0px;
}
player-name > .icon-twitter {
  background: url("../images/auth/twitter-color.svg") no-repeat center center;
}
player-name > .icon-twitch {
  background: url("../images/auth/twitch-color.png") no-repeat center center;
}
player-name > .icon-instagram {
  background: url("../images/auth/instagram-color.png") no-repeat center center;
}
player-name > .icon-facebook {
  background: url("../images/auth/facebook-color-29.png") no-repeat center center;
}
player-name > .icon-google {
  background: url("../images/auth/google-color-32.png") no-repeat center center;
}
player-name > .icon-anonymous {
  width: auto;
}
player-name > .icon-anonymous:before {
  margin-left: 8px;
  content: " ";
}

/******************************************************/
join-ui > .dialog > div {
  margin: 8px;
}

join-ui .form-group {
  margin-bottom: 0px;
}
join-ui .form-group+.form-group {
  margin-top: 4px;
}

join-ui > .queue {
  display: flex;
  flex-flow: row wrap;
  justify-content: space-around;
}

join-ui > .queue > .buttons {
  display: flex;
  flex-flow: column nowrap;
  align-self: center;

  padding: 4px;
}

join-ui .searching {
  display: flex;
  flex-flow: row wrap;
  justify-content: space-around;
}

join-ui {
  display: block;
  padding-bottom: 2em;
}

.queue > .header,
.searching > .header {
  flex: 1 1 100%;
}

.searching > .header h5 {
  display: inline-block;
}

img.social-provider {
  width: 32px;
  height: 32px;
}

.queue-info {
  display: flex;
  flex-direction: column;
}

.queue-info > .wait {
  display: flex;
  flex-flow: row nowrap;
  justify-content: flex-start;
}

.queue-info .spinner {
  width: 24px;
  height: 24px;
}
.queue-info .spinner+.duration {
  margin-left: 4px;
}
.queue-info .duration {
  min-width: 3em;
}

/******************************************************/

select-player-name .form input[type=text] {
  display: inline-block;
  width: auto;
}

select-player-name .form {
  margin: 8px 16px;
}

/******************************************************/

stats-require-login {
  display: block;
  text-align: center;
  margin: 2px;
}

.match-history {
  padding: 8px;
  border-style: solid;
  border-image: url("../images/ui/grey_panel.png") 4 4 fill;
  margin: 0 auto;
  margin-bottom: 8px;
  display: flex;
  flex-flow: column nowrap;
}

.match-history > h5 {
  text-align: center;
}

history-ui {
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  align-self: center;
  max-width: 28em;
}

history-entry {
  width: 5em;
  display: inline-block;
  box-sizing: border-box;
  margin: 4px;
  padding: 4px;
  text-align: center;
  border: 1px solid gray;
  border-radius: 5px;
}

history-entry > div {
  white-space: nowrap;
}

/******************************************************/
stats-ui {
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
}

stat-entry {
  display: flex;
  flex: 0 1 32%;
  box-sizing: border-box;
  margin-bottom: 4px;
  margin-right: 4px;
  padding: 2px 4px;
  border: 1px solid gray;
  border-radius: 2px;
  justify-content: center;
}

stat-entry > span.value {
  margin-left: 8px;
  white-space: nowrap;
}

/******************************************************/

leaderboard {
  display: table;
  width: 100%;
}

leaderboard > div {
  display: table-row;
}

leaderboard > div.header {
  font-weight: bold;
}

leaderboard > div.header > span,
leaderboard > div.header > stat-header {
  text-transform: uppercase;
}

leaderboard > div > span,
leaderboard > div > stat-header {
  display: table-cell;
  text-align: center;
  padding: 2px;
}

leaderboard > div:not(.header) > span.name {
  text-align: left;
}

leaderboard > div:nth-child(even) {
  background: #eee;
}

leaderboard > div.highlight {
  background: #0275D8;
  color: white;
}
leaderboard > div.highlight > span {
  padding: 12px 2px;
}

leaderboard > div.highlight a {
  color: white;
}

leaderboard player-name > .icon {
  width: 24px;
  height: 24px;
  background-size: 66%;
  margin: -4px 0px;
}

/******************************************************/

skin-ui {
  position: relative;
  display:  block;
}

balance-ui {
  position: fixed;
  /* left: 0; */
  /* bottom: 60px; */
  right: 20px;
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid gray;
  border-radius: 500px;
  padding: 2px 4px;
  z-index: 1;
}

skin-ui > ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 0px;
}

skin-ui > ul > li {
  display: inline-block;
  position: relative;

  border-radius: 2px;
  box-sizing: border-box;
  padding: 8px;
  border: 2px solid lightgray;
  margin: 2px;
  transition: background-color 0.2s linear;
}

skin-ui > ul > li:hover {
  border-color: gray;
  background-color: lightgray;
}

skin-ui > ul > li.selected {
  background-color: #0275d8;
  transition: background-color 0.01s linear;
}

skin-ui > ul > li:active {
  background-color: #388ed8;
}

skin-ui > ul > li.locked {
  border-color: lightgray;
  background-color: lightgray;
}

skin-ui > ul > li.locked:hover,
skin-ui > ul > li.locked:active {
  border-color: darkgray;
  background-color: #90b6d6;
}

skin-ui > ul > li.locked > image-frame {
  filter: brightness(0.8);
}

skin-ui > ul > li.spray,
skin-ui > ul > li.skin {
  min-width: 75px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

skin-ui > ul > li.spray > item-price,
skin-ui > ul > li.skin > item-price {
  position: absolute;
  bottom: 2px;
}

skin-ui > ul > li > .lock {
  position: absolute;
  left: 0px;
  top: 0px;

  transform-origin: 0 0;
  transform: scale(0.5);
}

.lock {
  display: block;
  content: url('../images/ui/locked.png');
}

skin-ui > ul > li.spray,
skin-ui > ul > li.skin {
  padding-bottom: 1.5em;
}

skin-ui item-price {
  font-size: 80%;
}

skin-ui > game-purchase,
skin-ui > login-required {
  display: block;
  text-align: center;

  border-radius: 2px;
  box-sizing: border-box;
  padding: 8px;
  border: 2px solid lightgray;
  margin: 2px;
}

.price-and-purchase {
  display: flex;
  justify-content: center;
  align-items: center;
}

.price-and-purchase > * {
  padding: 0px 6px;
}

purchase-button {
  display: inline-block;
  position: relative;
  top: 6px;
}

/******************************************************/
viewer-ui {
  flex-direction: column;
  align-content: center;
  justify-content: center;
  width: 100%;
  height:  100%;
}

viewer-ui > .drop-target {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-align: center;
}

viewer-ui > .drop-target > div {
  flex: 0 0 auto;
  padding: 1em;
}

viewer-ui .drop-target {
  border: 4px solid;
  border-color: transparent;
  border-radius: 4px;
}

viewer-ui .drop-target.dragging {
  border-style: dashed;
  border-color: grey;
}

/******************************************************/

purchase-popup > .contents {
  align-items: center;
}

purchase-popup > .contents > .name {
  font-weight: bold;
}

purchase-popup > .contents > *:not(:first-child) {
  margin-top: 12px;
}

/******************************************************/
countdown-ui {
  text-align: center;
  background-color: rgba(0,0,0,0.4);
  z-index: 1;
  pointer-events: auto;
}

countdown-ui > div.contents {
  width: 12em;
}

/******************************************************/
ad-container {
}

#preroll {
  position: absolute;
  display: block;
  width: 960;
  height: 540;
}

/******************************************************/
/***/
.dg input {
  line-height: normal;
}

