html {
    height: 100%
}

body {
  font-family: sans-serif;
  color: #59595c;
  background-color: #e9eaed;
  margin: 0;
  padding: 0;
  position: relative;
  min-height: 100%;
}

select {
  font-size: 1.5rem;
  max-width: 80vw;
}

a {
  color: #59595c;
}

textarea {
  font-size: 1.25em;
}

#register input {
  border: 1px solid #888;
  font-size: 1.5em;
  height: 1.5em;
  width: 5em;
  text-transform: uppercase;
  text-align: center;
}

#register #email {
  width: 90%;
  text-transform: none;
}

.message {
  color: #c00;
}

.button {
  padding: 15px 25px;
  color: #fff;
  font-weight: bold;
  text-align: center;
  background: #3a5795;
  display: inline-block;
  margin: 5px;
  border-radius: 5px;
  cursor: pointer;
}

.button[hidden] {
  display: none; /* The rule above was overriding "hidden" */
}

.bigbutton {
  width: calc(50% - 10px);
  height: 75px;
  position: relative;
  float: left;
  color: #fff;
  font-weight: bold;
  text-align: center;
  margin: 5px;
  background: #6d84b4;
  text-decoration: none;
  border-radius: 5px;
  cursor: pointer;
}

.bigbutton.tall {
  height: 125px;
}

.bigbutton.wide {
  width: calc(100% - 10px);
}

.bigbutton .content {
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  display: block;
}

.bigbutton img,
.button img {
  vertical-align: sub;
  margin-right: 0.5em;
}

.block {
  width: calc(100% - 40px);
  margin: 10px auto;
  padding: 10px;
  background-color: #fff;
  border: 1px solid #d0d1d5;
  border-radius: 3px;
  overflow: auto;
}

.overlay {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  text-align: center;
}

.alertbox {
  display: inline-block;
  padding: 20px 40px;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  background-color: #fff;
  border: 1px solid #888;
  overflow: auto;
  max-width: calc(95% - 80px);
  max-height: calc(95% - 40px);
}

#debugmsgs {
  overflow: auto;
  border: 1px solid #ccc;
  padding: 0.5em;
  background: #eee;
  margin: 1em;
  text-align: left;
}

/*** Page Header Styles ***/
#header {
  width: 100%;
  height: 3em;
  line-height: 3em;
  color: #fff;
  background-color: #3a5795;
  font-weight: bold;
}

#pagename {
  display: none;
  max-width: calc(100% - 220px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 10px;
}

#offlinepagename {
  display: inline-block;
  padding-left: 10px;
}

.activated #pagename {
  display: inline-block;
}

.activated #offlinepagename {
  display: none;
}

#sessionid {
  float: right;
  font-weight: normal;
  font-size: 75%;
}

#settings {
  float: right;
  height: 3em;
  width: 3em;
  background: url(/img/settings.png) no-repeat center center;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0 10px;
  margin-left: 10px;
  cursor: pointer;
}

#settings.active {
  background-color: #24355c;
}

/*** Footer Styles ***/
#footer {
  text-align: right;
  font-size: 0.8em;
  color: #333;
}

#copyright {
  display: inline-block;
  padding: 25px;
}

/*** Main Page Styles ***/
#caption {
  margin: auto;
  width: calc(100% - 10px);
  height: 50px;
}

#login .button {
  position: relative;
  top: 50%;
  transform: translateY(-50%);
}

#photos {
  margin: 0;
  padding: 0;
}

#photos li {
  margin: 5px;
  padding: 0;
  list-style: none;
  position: relative;
}

#photos li:last-child {
  animation: fadeIn 1s ease;
}

#photos img {
  width: 100%;
}

.closeimg {
  position: absolute;
  display: block;
  width: 34px;
  height: 34px;
  right: 10px;
  top: 10px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.35) url(/img/close.png) no-repeat center center;
  cursor: pointer;
}

/*** sliding overlays ***/
.slidein {
  overflow: hidden;
  max-height: 0;
  animation: stretchOut 0.25s ease;
}

.slidein.active {
  max-height: 100%;
  animation: stretchIn 0.25s ease;
}

/*** Card selector preview ***/
#preview {
  display: inline-block;
  width: 90px;
  height: 126px;
  background-image: url(/img/card-sprite.png);
  background-size: 1235px; /* half size */
  border-radius: 5px;
  box-shadow: #888 2px 2px 5px;
}

#value option,
#suit option {
	display: none;
}

#cardselectors {
	margin: 0;
}

#cardselectors select {
	margin: 16px 8px; 
}
#cardselectors.regular option.regular,
#cardselectors.esp option.esp,
#cardselectors.santa option.santa,
#cardselectors.ministry #value option.ministry,
#suit.animals .animals,
#suit.faces .faces,
#suit.pink .pink,
#suit.green .green,
#suit.other .other {
	display:block;
}


/*** Webcam Styles ***/
#webcam .block {  /* height/width controlled by JS :( */
  position: relative;
  margin: auto;
}

#monitor {
  width: auto;
  height: 100%;
  background-color: #e9eaed;
}

.frontcam #monitor {
  transform: rotateY(180deg);
}

#monitorwrap {
  display: inline-block;
  position: relative;
  width: auto;
  height: calc(100% - 180px);
  outline: 1px solid #d0d1d5;
}


.countdown #monitorwrap::after {
    content: "";
    display: block;
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: auto;
    text-align: center;
    font-size: 50vh;
    transform: translateY(-50%);
    color: #ffffff;
    text-shadow: 0 0 20px #000000;
    animation: 3s countdown linear;
}

#vguide {
  pointer-events: none;
  border-left: 1px solid rgba(255, 255, 255, 0.5);
  border-right: 1px solid rgba(255, 255, 255, 0.5);
  position: absolute;
  top: 0;
  left: 33.333%;
  width: 33.333%;
  height: 100%;
}

#hguide {
  pointer-events: none;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  position: absolute;
  top: 33.333%;
  left: 0;
  width: 100%;
  height: 33.333%;
}

#flash {
  opacity: 0.75;
  width: 50px;
  height: 50px;
  position: absolute;
  top: 5px;
  right: 5px;
  background-image: url(/img/flash_off.png);
  background-size: 30px;
  background-color: #0006;
  border-radius: 25px;
  background-position: center;
  background-repeat: no-repeat;
  display: none;
}

#flash.on {
  background-image: url(/img/flash_on.png);
}

.flash #flash {
  display: block;
}

#shutter {
  margin-top: 10px;
}

.frontcamimage {
  display: inline-block;
}

.backcamimage {
  display: none;
}

.frontcam .frontcamimage {
  display: none;
}

.frontcam .backcamimage {
  display: inline-block;
}

/* min-aspect prevents weirdness on too-close-to-square screens */
@media (orientation: landscape) and (min-aspect-ratio: 5/3) {
  #webcam {
    padding: 0;
    text-align: left;
  }

  #monitorwrap {
    height: calc(100% - 4px);
  }

  #webcam .bigbutton {
    position: absolute;
    width: 155px;
    height: calc(50% - 20px);
    top: 10px;
    right: 10px;
    margin: 0;
  }

  #webcam #rotate {
    height: calc(25% - 10px);
    top: 50%;
  }

  #webcam #closecam {
    height: calc(25% - 10px);
    top: 75%;
  }
}

/*** Settings Styles ***/
#settingsoverlay {
  top: 3em;
  position: absolute;
  padding: 0;
  height: calc(100% - 3em);
}

#settingsoverlay .block {
  margin-top: 0;
  border-radius: 0 0 3px 3px;
}

#settingsoverlay .block > div {
  padding: 20px;
}

#settingsoverlay .menu {
  border-bottom: 1px solid rgba(89, 89, 82, 0.25);
  cursor: pointer;
}

#settingsoverlay .linkfooter a {
  color: #b5b5b4;
  display: inline-block;
  padding: 10px;
}

/* hidden unless logged in/activated */
#settings-logout,
#settings-activate {
  display: none;
}

#settings-login span {
  display: inline-block;
  background: #3a5795 url(/img/flogo.png) 0.55em center/1.5em no-repeat;
  color: white;
  padding: 0.75em 0.75em 0.75em 2.75em;
  border-radius: 3px;
}

/* shown when logged in/activated */
.loggedin #settings-activate,
.loggedin #settings-logout {
  display: block;
}

/* hidden when logged in/activated */
.loggedin #settings-login,
.loggedin.activated #settings-activate {
  display: none;
}

/*** Spinner Classes ***/
#loading {
  display: none;
}

.loading #loading,
.spriteloading #loading {
  display: block;
}

#loading > div {
  width: 50px;
  height: 50px;
  padding: 0;
  margin: auto;
  background-color: rgba(255, 255, 255, 0.75);
  border: 1px solid #888;
  border-radius: 50%;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
}

.loader {
  margin: 2px;
  position: relative;
  text-indent: -9999em;
  border-top: 5px solid rgba(58, 87, 149, 0.2);
  border-right: 5px  solid rgba(58, 87, 149, 0.2);
  border-bottom: 5px  solid rgba(58, 87, 149, 0.2);
  border-left: 5px  solid #3a5795;
  transform: translateZ(0);
  animation: spin 1.1s infinite linear;
}

.loader,
.loader::after {
  border-radius: 50%;
  width: calc(100% - 14px);
  height: calc(100% - 14px);
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes stretchIn {
  from {
    background-color: rgba(0, 0, 0, 0);
    max-height: 0;
  }

  to {
    background-color: rgba(0, 0, 0, 0.8);
    max-height: 100vh;
  }
}

@keyframes stretchOut {
  from {
    background-color: rgba(0, 0, 0, 0.8);
    max-height: 100vh;
  }

  to {
    background-color: rgba(0, 0, 0, 0);
    max-height: 0;
  }
}

@keyframes countdown {
  0% {
    content:"3";
    opacity: 1;
  }
  33% {
    content:"2";
    opacity: 1;
  }
  66% {
    content:"1";
    opacity: 1;
  }
  32%,
  65%,
  100% {
    content:"";
    opacity: 0;
  }
}
