/*! HTML5 Boilerplate v7.2.0 | MIT License | https://html5boilerplate.com/ */

/* main.css 2.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
}

body {
    font-family: "Skatta Sans Medium", Arial, Helvetica, sans-serif;
    background: url(../img/kalapolut_tausta_1920x1080.png) #cb4700 no-repeat center top;
    /*background-size: auto 100%;*/
    background-size: cover;
    width: 100vw;
    height: 100vh;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Vendor-prefixed and regular ::selection selectors cannot be combined:
 * https://stackoverflow.com/a/16982510/7133471
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Browser Upgrade Prompt
   ========================================================================== */

.browserupgrade {
  margin: 0.2em 0;
  background: #ccc;
  color: #000;
  padding: 0.2em 0;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

.green {
    color: #009639;
}

html {
  font-size: 0.75vw;
}

#gameArea {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
    height: 100%;
    width: 100%;
}
img#aspectRatio {
	width: auto;
    height: 100%;
}
#startScreen,
#gameScreen,
#resultScreen {
    display: none;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    /*max-height: 1920px;*/
}
#gameScreen {
  width: 80vw;
  height: 80vh;
  max-width: 1500px;
  max-height: 890px;
  left: 10vw;
  top: 15vh;
  background: #fff;
}
#yhteistyossa {
  position: absolute;
  z-index: 11;
  left: 5vw;
  width: 9vw;
  top: 0;
  opacity: 0;
  display: block;
  transition: all 500ms ease;
}
.minimal #yhteistyossa {
  left: 0;
}
#gameLogo {
  width: 50vw;
  margin-left: 25vw;
  margin-top: 24vh;
  transition: all 500ms ease;
}
#yhteistyossa img,
#gameLogo img {
  width: 100%;
  height: auto;
}
.minimal #gameLogo {
  width: 20vw;
  margin-left: 40vw;
  margin-top: 4vh;
}
#startScreen h1 {
  text-align: center;
  top: 40%;
  position: relative;
  font-size: 4.5em;
  font-weight: bold;
  color: #009638;
}
#startBtn,
#restartBtn {
  font-family: "Skatta Sans Black", Arial, Helvetica, sans-serif;
  position: absolute;
  z-index: 11;
  background-color: rgba(255,255,255,1);
  top: 60vh;
  left: 50vw;
  width: 12vw;
  height: 12vw;
  font-size: 2em;
  font-weight: bold;
  text-transform: uppercase;
  transition: all 0.4s ease-in-out;
  display: inline-block;
  border: 0.5vh solid #fff;
  border-radius: 1000vh;
  text-align: center;
  text-decoration: none;
  color: #cb4700;
  cursor: pointer;
  padding: 0;
  transform: translateX(-50%);
  transition: all 250ms top 500ms ease;
}
#startBtn:hover {
  width: 12.4vw;
  height: 12.4vw;
  top: 58.8vh;
  border-width: 0.2vw;
}
#startBtn span,
#restartBtn span {
  position: absolute;
  width: 100%;
  left: 0;
  top: 50%;
  text-align: center;
  transform: translateY(-50%);
}
.circle {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 0.3vw solid #f1f2f6;
  top: 0;
  left: 0;
  border-radius: 50%;
}
#restartBtn {
  top: 82vh;
  width: 17vh;
  height: 17vh;
  font-size: 1.8em;
}
#restartBtn:hover {
  width: 17.4vh;
  height: 17.4vh;
  top: 81.2vh;
  border-width: 0.2vw;
}
.minimal #startBtn {
  top: 40%;
  opacity: 0;
}
#top {
  position: absolute;
  left: 0;
  top: 0;
}
#bottom {
  position: absolute;
  left: 0;
  bottom: 0;
}
#top img, #bottom img {
  width: 100%;
  height: auto;
}
#buttonHolder {
  display: flex;
  width: 60%;
  margin: 0 20%;
  position: absolute;
  z-index: 11;
  bottom: 5%;
}
.answerButton {
  position: relative;
  /*flex: 1;*/
  transition: all 250ms;
  overflow: hidden;
  border: 1vh solid #cb4700;
  margin: 1vh;
  border-radius: 50%;
}
#question {
  text-align: center;
  position: relative;
  z-index: 11;
  margin-top: 2%;
  margin-bottom: 0;
  font-size: 5em;
  font-weight: bold;
  color: #000;
}
.answerTitle {
  position: absolute;
  z-index: 10;
  width: 100%;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  font-size: 3em;
  font-weight: bold;
  color: #cb4700;
  margin: 0 auto;
}
.answerImage {
  position: absolute;
  bottom: 5%;
  left: 13%;
  width: 74%;
  height: auto;
  border: 1px solid #fff;
  border-radius: 1000px;
  background: #fff;
}
.answerBg {
  position: relative;
}
.answerCorrect, .answerIncorrect {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 9;
  opacity: 0;
  transition: opacity 500ms ease;
  transition-delay: 100ms;
}
.answerBg img,
.answerCorrect img,
.answerIncorrect img {
  width: 102%;
  height: auto;
  margin-top: -1%;
  margin-left: -1%;
}
.correct .answerCorrect,
/*.correct-answer .answerCorrect,*/
.incorrect .answerIncorrect {
	opacity: 1;
}
.explanation {
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    text-align: center;
    font-size: 1.8em;
    padding: 1vh;
    color: #fff;
}
.explanation {
    opacity: 0;
}
.correct {
  border-color: #009639;
}
.incorrect {
  border-color: darkred;
}
.incorrect.correct-answer {
  border-color: #cb4700;
}
/*
.incorrect .answerTitle,
.incorrect .answerImage {
    opacity: 0;
}

.incorrect .explanation {
    opacity: 1;
    top: 50%;
    transform: translateY(-50%);
}
*/
#result {
  text-align: center;
  position: relative;
  z-index: 11;
  width: 70%;
  margin-left: 15%;
  text-align: center;
  margin-top: 2%;
  margin-bottom: 0;
  font-size: 5em;
  font-weight: bold;
  display: none;
}
#result.correct {
  color: #009639;
}
#result.incorrect {
  color: darkred;
  background-color: transparent;
}
#questionImage {
  display: none;
  width: 60%;
  margin-left: 20%;
  position: absolute;
  top: 15%;
}
#questionImage img {
  width: 100%;
  height: auto;
  transition: all 1s;
}
#questionImage img:nth-child(2) {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 10;
  opacity: 0;
}
#questionImage.answered img:nth-child(2) {
	opacity: 1;
}
#questionImage.answered img:nth-child(1) {
	opacity: 0;
}
#nextQuestionBtn,
#resultsBtn {
  visibility: hidden;
  position: absolute;
  top: 90%;
  left: 50%;
  font-size: 3em;
  font-weight: bold;
  transition: all 0.4s ease-in-out;
  display: inline-block;
  border: 0.5vh solid #65b1fb;
  border-radius: 1000vh;
  line-height: 2.8125rem;
  text-align: center;
  text-decoration: none;
  color: #65b1fb;
  padding: 2vh 4vh;
  transform: translateX(-50%);
  white-space: nowrap;
}
div#score {
  font-size: 2em;
  font-weight: bold;
  position: absolute;
  left: 22%;
  bottom: 3%;
  z-index: 10;
  color: #fff;
  text-align: center;
}
#score span {
  display: block;
  font-size: 2.5em;
  line-height: 1;
}
#scoreContainer,
#resultContainer {
  background-color: #FFF;
  width: 80vw;
  height: 80vh;
  max-width: 1500px;
  max-height: 890px;
  left: 10vw;
  top: 15vh;
  padding: 2vh;
  position: absolute;
  border-radius: 2vh;
}
#scoreContainer {
    display: block;
    z-index: 1;
}
#resultContainer {
    display: none;
    z-index: 10;
}
#finalResult {
  font-size: 5em;
  color: #fff;
  line-height: 1.2;
  text-align: center;
}
#finalResult span {
  font-size: 70%;
}
#scoreText {
    text-align: center;
    font-size: 5em;
    margin-top: 30%;
    transform: translateY(-50%);
    font-weight: 700;
    color: #cb4700;
}
#resultText {
  padding: 1vh;
  border-radius: 1vh;
  text-align: center;
  font-size: 2.8vh;
  margin: 0;
}
#resultText h3 {
  color: #fc6900;
  text-transform: uppercase;
  font-size: 1em;
}
p.entry {
  width: 50%;
  float: left;
  text-align: left;
  font-size: 0.75em;
  padding-right: 2vw;
  line-height: 1;
}
.entry img {
  width: 55%;
  height: auto;
  clear: both;
}

@media screen and (max-width: 1024px) {
  #buttonHolder {
    width: 60%;
    margin: 0 20%;
  }
  .answerButton {
    border: 0.8vh solid #cb4700;
  }
  #startBtn,
  #startBtn:hover {
    top: 51vh;
    width: 17vw;
    height: 17vw;
    font-size: 3em;
  }
  #restartBtn,
  #restartBtn:hover {
    top: 81vh;
    width: 10vw;
    height: 10vw;
    font-size: 2em;
  }
  #scoreContainer,
  #resultContainer {
    width: 90%;
    top: 13%;
    left: 5%;
  }
  #finalResult {
    font-size: 3em;
  }
  #resultText h3 {
    font-size: 1em;
    margin-bottom: 2vh;
  }
  p.entry {
    font-size: 0.8em;
    line-height: 1.1;
  }
  .entry img {
    width: 45%;
  }
}

@media screen and (max-width: 1024px) and (min-width: 769px) and (max-height: 400px) {
  #scoreContainer,
  #resultContainer {
    width: 80%;
    top: 13%;
    left: 10%;
  }
  #buttonHolder {
      width: 54%;
      margin: 0 23%;
  }
  #questionImage {
      width: 50%;
      margin-left: 25%;
  }
  .entry img {
      width: 50%;
  }
  #restartBtn,
  #restartBtn:hover {
      top: auto;
      width: 8vw;
      height: 8vw;
      font-size: 1.7em;
      bottom: 1vh;
  }
}

@media screen and (min-width: 1024px) and (max-width: 1279px) and (min-height: 769px) {
  #buttonHolder {
    width: 70%;
    margin: 0 15%;
  }
}

@media screen and (max-width: 768px) {
  .minimal #gameLogo {
    width: 40vw;
    margin-left: 30vw;
  }
  #startBtn {
    top: 50vh;
    width: 20vw;
    height: 20vw;
    font-size: 4em;
  }
  #restartBtn,
  #restartBtn:hover {
    top: 85vh;
    width: 15vw;
    height: 15vw;
    font-size: 3em;
  }
  .minimal #startBtn {
      top: 50vh;
  }
  #startBtn:hover {
    width: 22.4vw;
    height: 22.4vw;
    top: 49.8vh;
    border-width: 0.6vw;
  }
  #gameScreen {
    height: 70vh;
    top: 15vh;
  }
  #buttonHolder {
    width: 90%;
    margin: 0px 5%;
  }
  .answerTitle {
    font-size: 3.4em;
  }
  #question, #result {
      font-size: 7em;
  }
  #result {
    width: 90%;
    margin-left: 5%;
  }
  #questionImage {
    width: 80%;
    margin-left: 10%;
  }
  #scoreContainer,
  #resultContainer {
    width: 90%;
    top: 13%;
    left: 5%;
  }
  #scoreText {
    font-size: 10em;
    margin-top: 50%;
  }
  #finalResult {
    font-size: 3em;
  }
  #resultText h3 {
    font-size: 0.8em;
  }
  p.entry {
    font-size: 0.6em;
  }
  .entry img {
    width: 70%;
    height: auto;
    clear: both;
  }
}
@media screen and (max-width: 667px) {
  .answerTitle {
    font-size: 3em;
  }
}
@media screen and (max-width: 490px) {
  #yhteistyossa {
    width: 15vw;
  }
  #gameLogo {
    width: 70vw;
    margin-left: 15vw;
    margin-top: 29vh;
  }
  #startBtn {
    width: 30vw;
    height: 30vw;
    font-size: 5em;
    top: 52vh;
  }
  #startBtn:hover {
    width: 32vw;
    height: 32vw;
    top: 51vh;
    font-size: 5em;
  }
  #restartBtn,
  #restartBtn:hover {
    width: 30vw;
    height: 30vw;
    font-size: 5em;
    top: auto;
    bottom: 3vh;
  }
  #gameScreen {
    height: 110vw;
    top: 15vh;
  }
  #question, #result {
      width: 80%;
      margin-left: 10%;
  }
  #buttonHolder {
    width: 80%;
    margin: 0 10%;
    flex-wrap: wrap;
    justify-content: space-evenly;
  }
  .answerButton {
    border: 0.75vh solid #cb4700;
    margin: 0.75vh;
    flex-basis: 40%;
  }
  .answerTitle {
    font-size: 5em;
  }
}
@media screen and (max-height: 640px) and (min-width: 568px) and (max-width: 767px) {
  .minimal #yhteistyossa {
    left: 0;
  }
  .minimal #gameLogo {
    width: 26vw;
    margin-left: 36vw;
  }
  #gameScreen {
    top: 15vh;
    height: 80vh;
  }
  #question, #result {
    font-size: 5em;
  }
  #questionImage {
    width: 70%;
    margin-left: 15%;
  }
  #buttonHolder {
    width: 70%;
    margin: 0px 15%;
  }
  #scoreContainer, #resultContainer {
    height: 80%;
  }
  #scoreText {
    margin-top: 20%;
  }
  #resultText h3 {
    font-size: 1.4em;
  }
  p.entry {
    width: 45%;
    margin-left: 5%;
    font-size: 0.9em;
    line-height: 1;
  }
  .entry img {
    width: 40%;
  }
  #restartBtn,
  #restartBtn:hover {
      top: 80vh;
      width: 10vw;
      height: 10vw;
      font-size: 2em;
      z-index: 11;
  }
}
@media screen and (max-width: 568px) and (max-height: 320px) {
  #yhteistyossa {
    width: 8vw;
  }
  #startBtn {
    top: 55vh;
    width: 15vw;
    height: 15vw;
    font-size: 3em;
  }
  #scoreText {
    margin-top: 20%;
  }
  #resultText h3 {
    font-size: 1.4em;
    margin-bottom: 3vh;
    margin-top: 3vh;
  }
  p.entry {
    width: 24%;
    margin-left: 1%;
    font-size: 1.2em;
  }
  .entry img {
    width: 70%;
  }
  #resultText .clearfix {
	display: none;
  }
}
@media screen and (max-width: 375px) {
  #scoreText {
    font-size: 10em;
    margin-top: 50%;
  }
  #restartBtn,
  #restartBtn:hover {
    top: 87vh;
    width: 20vw;
    height: 20vw;
    font-size: 4em;
  }
}

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden {
  display: none !important;
}

/*
* Hide only visually, but have it available for screen readers:
* https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
*
* 1. For long content, line feeds are not interpreted as spaces and small width
*    causes content to wrap 1 word per line:
*    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
*/

.sr-only {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
  /* 1 */
}

/*
* Extends the .sr-only class to allow the element
* to be focusable when navigated to via the keyboard:
* https://www.drupal.org/node/897638
*/

.sr-only.focusable:active,
.sr-only.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

/*
* Hide visually and from screen readers, but maintain layout
*/

.invisible {
  visibility: hidden;
}

/*
* Clearfix: contain floats
*
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
*    `contenteditable` attribute is included anywhere else in the document.
*    Otherwise it causes space to appear at the top and bottom of elements
*    that receive the `clearfix` class.
* 2. The use of `table` rather than `block` is only necessary if using
*    `:before` to contain the top-margins of child elements.
*/

.clearfix:before,
.clearfix:after {
  content: " ";
  /* 1 */
  display: table;
  /* 2 */
}

.clearfix:after {
  clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
  /* Style adjustments for viewports that meet the condition */
}

@media print,
  (-webkit-min-device-pixel-ratio: 1.25),
  (min-resolution: 1.25dppx),
  (min-resolution: 120dpi) {
  /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
  *,
  *:before,
  *:after {
    background: transparent !important;
    color: #000 !important;
    /* Black prints faster */
    -webkit-box-shadow: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  a,
  a:visited {
    text-decoration: underline;
  }
  a[href]:after {
    content: " (" attr(href) ")";
  }
  abbr[title]:after {
    content: " (" attr(title) ")";
  }
  /*
     * Don't show links that are fragment identifiers,
     * or use the `javascript:` pseudo protocol
     */
  a[href^="#"]:after,
  a[href^="javascript:"]:after {
    content: "";
  }
  pre {
    white-space: pre-wrap !important;
  }
  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }
  /*
     * Printing Tables:
     * https://web.archive.org/web/20180815150934/http://css-discuss.incutio.com/wiki/Printing_Tables
     */
  thead {
    display: table-header-group;
  }
  tr,
  img {
    page-break-inside: avoid;
  }
  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }
  h2,
  h3 {
    page-break-after: avoid;
  }
}

