html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}
html, body, button, table {
  margin: 0;
  padding: 0;
  font-family: 'Quicksand', 'Verdana', 'sans-serif';
  font-size: 12pt;
}
body {
  background-color: #f0f0f0;
}
h1 {
  font-size: 1.5em;
}
h2 {
  font-size: 1.25em;
}

/** Buttons */

button, input[type=submit], input[type=button] {
  font-family: inherit;
  font-size: inherit;
  border: 1px solid #ccc;
  background: #ddf;
  color: #05a;
  padding: 10px 16px;
  text-align: center;
  cursor: pointer
}
button.primary, input[type=submit].primary {
  border: 1px solid #39f;
  background: #07f;
  color: #fff;
  font-weight: bold;
}
button:disabled, input[type=submit]:disabled {
  background: #ccc;
  border: 1px solid #666;
}


button.compact {
  padding: 3px 7px;
  font-size: 0.9em;
}

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

/** App elements */

#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100px;
  background: #333;
  color: white;
  z-index: 1;
}

#title {
  position: relative;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 30pt;
  font-weight: bold;
  text-align: center;
  color: #07f;
}

/* Title Animation */
#title .text {
  /* text-transform: uppercase; */
  background-image: linear-gradient(
    -225deg,
    #07f 0%,
    #ca1 33%,
    #4af 66%,
    #07f 100%
  );
  background-size: auto auto;
  background-clip: border-box;
  background-size: 200% auto;
  color: #fff;
  background-clip: text;
  text-fill-color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textclip 10s linear infinite;
  animation-direction: reverse;
  display: inline-block;
}
@keyframes textclip {
  to {
    background-position: 200% center;
  }
}

/* Position the menu origin */
#menu {
  position: absolute;
  bottom: 0;
  left: 0;
}

#menuToggle {
  display: block;
  position: relative;
  padding: 0 0 15px 20px;
  
  z-index: 1;
  
  -webkit-user-select: none;
  user-select: none;
}

#menuToggle a {
  text-decoration: none;
  color: #ddd;
  
  transition: color 0.3s ease;
}

#menuToggle a:hover {
  color: #aaf;
}

#menuToggle input {
  display: block;
  width: 36px;
  height: 28px;
  position: absolute;
  transform: translate(-8px, -8px);
  
  cursor: pointer;
  
  opacity: 0; /* hide this */
  z-index: 2; /* and place it over the hamburger */
  
  -webkit-touch-callout: none;
}

/* Hamburger */
#menuToggle span {
  display: block;
  width: 28px;
  height: 3px;
  margin-bottom: 5px;
  position: relative;
  
  background: #ddd;
  border-radius: 3px;
  
  z-index: 1;
  
  transform-origin: 4px 0px;
  
  transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
              background 0.5s cubic-bezier(0.77,0.2,0.05,1.0),
              opacity 0.55s ease;
}
#menuToggle span:first-child {
  transform-origin: 0% 0%;
}
#menuToggle span:nth-last-child(2) {
  transform-origin: 0% 100%;
}

/* 
 * Mutate into an X.
 */
#menuToggle input:checked ~ span {
  opacity: 1;
  transform: rotate(45deg);
  background: #232323;
}
#menuToggle input:checked ~ span:nth-last-child(3) {
  opacity: 0;
  transform: rotate(0deg) scale(0.2, 0.2);
}
#menuToggle input:checked ~ span:nth-last-child(2) {
  transform: rotate(-45deg);
}

/*
 * Make this absolute positioned
 * at the top left of the screen
 */
#menuItems {
  position: absolute;
  top: -40px;
  left: -20px;
  padding: 60px 40px 30px;
  width: 280px;
  
  background: #555;
  list-style-type: none;
  -webkit-font-smoothing: antialiased;
  /* to stop flickering of text in safari */
  
  transform-origin: 0% 0%;
  transform: translate(-100%, 0);
  
  transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0);
}

#menuItems li {
  padding: 8px 0;
  font-size: 14pt;
}

/* Enter from left */
#menuToggle input:checked ~ ul {
  transform: none;
}

/* END Menu */

/* Google Signin Button */
.g_id_signin iframe {
  left: 50% !important;
  transform: translate(-50%, 0);
  margin: 0 !important;
}

/* Main Content */

#main {
  position: absolute;
  top: 100px;
  width: 100%;
  min-width: 800px;
  min-height: calc(100% - 100px - 2em);
}

#main>.margin {
  position: absolute;
  top: 0;
  width: 200px;
  min-height: 100%;
  padding: 1em 1em 0;
  text-align: center;
}
#mainLeft {
  left: 0;
}
#mainRight {
  right: 0;
}

#main>.margin>.affiliate {
  margin-bottom: 20px;
}
#main>.margin>.affiliate:last-child {
  margin-bottom: 0;
}

#mainCenter {
  position: absolute;
  top: 0;
  left: 200px;
  right: 200px;
  min-height: 100%;
  background-color: #fff;
  padding: 1em 2em 4em;
}

#footer {
  position: fixed;
  bottom: 0;
  text-align: center;
  left: 0;
  right: 0;
  height: 2em;
  background: #333;
  color: #ccc;
  padding: 4px;
}

/**
 * Loading
 */

.loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.2);
  z-index: 100;
}

.loading > div {
  position: relative;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/**
 * Loading spinner from https://loading.io/css/
 */.lds-ellipsis {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}

.lds-ellipsis div {
  position: absolute;
  top: 33px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.lds-ellipsis div:nth-child(1) {
  left: 8px;
  animation: lds-ellipsis1 0.6s infinite;
}

.lds-ellipsis div:nth-child(2) {
  left: 8px;
  animation: lds-ellipsis2 0.6s infinite;
}

.lds-ellipsis div:nth-child(3) {
  left: 32px;
  animation: lds-ellipsis2 0.6s infinite;
}

.lds-ellipsis div:nth-child(4) {
  left: 56px;
  animation: lds-ellipsis3 0.6s infinite;
}

@keyframes lds-ellipsis1 {
  0% {
    transform: scale(0);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes lds-ellipsis3 {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(0);
  }
}

@keyframes lds-ellipsis2 {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(24px, 0);
  }
}


/**
  * A titled box, e.g.
  * <div class="titled-box">
  *   <div class="title">This will overlap the border</div>
  *   <div class="content">...</div>
  * </div>
  */
.titled-box {
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 0 0.7em 0 0.7em;
  margin-top: 0.5em;
}
.titled-box>.title {
  /* Make the title a little smaller */
  font-size: 0.9em;

  /* Move the title up over the border and adjust the spacing 
     below to account for the container padding */
  margin: -0.7em 0 0.7em 0;

  padding: 0 4px;
  /* Shrink-wrap the text */
  width: fit-content;
  /* Hide the border underneath. There's no way to dynamically set this */
  background-color: white;
  color: #888;
}
.titled-box>.content {
  margin: 0.5em 0;
}

.help-icon {
  background: center / contain no-repeat url('/static/help_icon.png');
  width: 18px;
  height: 18px;
  margin: 4px;
  display: inline-block;
}

#rb-tooltip {
  position: absolute; 
  top: -100vw; 
  width: 300px;
  z-index: 10;
  background: #ffd;
  padding: 0.5em;
  border: 1px solid #666;
  font-size: 10pt;
}