@keyframes bounce {
  0%   { transform: scale(1,1)      translateY(0); }
  10%  { transform: scale(1.1,.9)   translateY(0); }
  30%  { transform: scale(.9,1.1)   translateY(-150px); }
  50%  { transform: scale(1.05,.95) translateY(0); }
  57%  { transform: scale(1,1)      translateY(-7px); }
  64%  { transform: scale(1,1)      translateY(0); }
  100% { transform: scale(1,1)      translateY(0); }
}

body {
  position: relative;
  height: 100vh;
  width: 100%;
  padding: 0;
  margin: 0;
  font: 12px "HelveticaNeue-Light", sans-serif;
  background-color: #302f2e;
  /* Light theme */
  background: url("https://4kwallpapers.com/images/walls/thumbs_3t/8945.jpg");
  background-size: 100%;
  background-position: 0 0;
  background-size: cover;
}
#dark-mode-toggle {
  position: absolute;
  top: 0;
  right: 70px;
  background: #4d4945;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  padding: 1px 7px;
  cursor: pointer;
  z-index: 9;
}
#word-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
  background-color: #302f2e;
  display: none;
}
.words-bg #word-background {
  display: block;
}
.bg-word {
  position: absolute;
  font-family: "HelveticaNeue-Light", sans-serif;
  color: #fff;
  font-weight: 300;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  will-change: transform;
}
#main {
  position: relative;
  max-width: 850px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 30px 0 50px;
  background-color: #aabcc4;
  /* Light theme */
  background-color: rgba(100, 80, 140, 0.3);
}
.words-bg #main {
  background-color: rgba(0, 0, 0, 0.4);
}
.stars-bg #main {
  background-color: rgba(0, 0, 0, 0.4);
}
#nav {
  position: absolute;
  top: 20px;
  left: 70px;
  color: white
}
#nav > * {
  padding: 0 5px;
}
#nav a {
  cursor: pointer;
}
.reset-link {
  position: relative;
  left: -1px;
  top: 2px;
}
#name-input {
  position: relative;
  top: -5px;
  font-size: 16px;
  font-weight: normal;
  color: #2b4957;
  padding: 10px;
  width: 300px;
  vertical-align: middle;
}

h1 {
  display: inline-block;
  font-size: 50px;
  font-weight: normal;
  /* color: #2b4957; */
  color: #e2dfef;
  margin: 60px 10px 30px 20px;
}
.words-bg h1 {
  color: #fff;
}
.stars-bg h1 {
  color: #fff;
}
#title {
  cursor: pointer;
}
#help-icon {
  position: relative;
  top: 10px;
  display: inline-block;
  font-size: 50px;
}
#rewards {
  float: right;
  position: absolute;
  top: 60px;
  right: 70px;
  font-size: 30px;
  line-height: 75px;
  color: white;
  animation: bounce 0.6s ease-out 1;
  cursor: pointer;
  user-select: none;
}
a {
  color: white;
  font-size: 13px;
}
#complete-overlay {
  position: fixed;
  left: -100px;
  top: 0;
  bottom: 0;
  z-index: 10;
  min-height: 100%;
  background: url("../img/sloth.webp");
  background-color: #222;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
}
#complete-overlay img {
  width: 100%;
}
#results-link {
  cursor: pointer;
  color: white;
  font-size: 13px;
  margin: 23px 20px 20px;
  display: none;
}
#results-title {
  display: none;
  font-weight: normal;
  color: white;
  margin: 20px;
}
#results-title span {
  cursor: pointer;
  color: white;
  font-size: 13px;
}
#results {
  display: none;
  flex-wrap: wrap;
  padding: 0 20px;
}
.complete-message {
  margin-bottom: 30px;
}
.spacer {
  height: 14px;
}

.tooltip {
  cursor: pointer;
  position:relative;
}
.tooltip .balloon {
  min-width:200px;
  top:66px;
  left:50%;
  transform:translate(-50%, 0);
  padding:10px 20px;
  color:#666666;
  background-color:#EEEEEE;
  font-weight:normal;
  font-size:13px;
  border-radius:8px;
  position:absolute;
  z-index:1;
  box-sizing:border-box;
  box-shadow:0 1px 8px rgba(0,0,0,0.5);
  display:none;
}
.tooltip .balloon p {
  padding: 0;
  margin: 0 0 5px;
}
/* when hover is supported */
@media (hover: hover) {
  .tooltip:hover .balloon {
    display:block;
  }
}
.tooltip .balloon i {
  position:absolute;
  bottom:100%;
  left:50%;
  margin-left:-12px;
  width:24px;
  height:12px;
  overflow:hidden;
}
.tooltip .balloon i::after {
  content:'';
  position:absolute;
  width:12px;
  height:12px;
  left:50%;
  transform:translate(-50%,50%) rotate(45deg);
  background-color:#EEEEEE;
  box-shadow:0 1px 8px rgba(0,0,0,0.5);
}
.tooltip .balloon.show {
  display: block;
}

@media only screen and (max-width: 630px) {
  #main {
    padding: 0 15px;
  }
  #title {
    display: none;
  }
  #nav {
    padding-top: 5px;
    padding-left: 10px;
  }
  #rewards {
    line-height: 1;
    font-size: 24px;
    top: 24px;
    right: 12px;
  }
  #dark-mode-toggle {
    right: 10px;
  }
  #complete-overlay {
    background-size: cover;
  }
  .multiplication #form-fields {
    padding-top: 18px;
  }
  .tooltip .balloon {
    margin-left: 80px;
  }
  .tooltip .balloon i {
    left: 16%;
  }
  #word-background {
    opacity: 0.6;
  }
  .bg-word {
    font-size: 16px !important;
  }
}

.pulse-border {
  border: 5px solid #FFD93B; /* yellow */
  border-radius: 6px;
  animation: pulse-border 1s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% {
    border-color: #FFD93B; /* yellow */
  }
  50% {
    border-color: #FFC857; /* soft orange */
  }
}
