/*
 *
 * Sizes in this stylesheet are optimized for mini smarphones.
 * We use the file responsive.css to build up on this and
 * make the page look good on bigger devices too
 *
 */

/*
 *
 * Main
 *
 */

html {
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-width: 240px;
  background: url('../img/neon_theater_min.jpg') no-repeat center center fixed;
  background-size: cover;
}

div,
.deck,
h1,
footer {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

@font-face {
  font-family: 'Library3AM';
  src: url('../fonts/library3am.woff') format('woff');
}

header {
  margin: 5vh auto 4.5vh auto;
  width: 100%;
}

h1 {
  margin: 0;
  padding: 0;
  font-size: 9vw;
  font-family: 'Library3AM';
  text-transform: uppercase;
  text-shadow: -1px 0 #ab38c3, 0 1px #ab38c3, 1px 0 #ab38c3, 0 -1px #ab38c3;
  color: #ead5ff;
}

/*
 *
 * Score Panel
 *
 */

.top-container {
  flex-direction: row;
  margin: 1vmin;
  width: 70vw;
  max-width: 95vmin;
  padding: 0 1em 0 1em;
  font-family: 'Library3AM';
  color: #fff;
}

.score-panel {
  align-items: flex-start;
  width: 65%;
  font-size: 5.5vmin;
  text-shadow: -1px 0 #ab38c3, 0 1px #ab38c3, 1px 0 #ab38c3, 0 -1px #ab38c3;
}

/**
 *
 * New Game
 *
 */

.game-new {
  position: absolute;
  width: 30vw;
  min-width: 50px;
  max-width: 200px;
  height: 10vw;
  min-height: 50px;
  max-height: 100px;
  box-shadow: 0px 0px 42px 8px #92e1fc;
  border: 2px solid #92e1fc;
  border-radius: 8px;
  background: #1d1c6c;
  cursor: pointer;
  font-size: 0.55em;
  font-weight: bold;
  font-family: 'Library3AM';
  text-transform: uppercase;
  color: #fff;
}

.game-new:active {
  transform: scale(0.98);
  /* Scaling button to 0.98 to its original size */
  box-shadow: 0px 0px 30px 4px #92e1fc;
  /* Lowering the shadow */
}

.game-new.show {
  display: block;
}

.game-new.hidden {
  display: none;
}

/**
 *
 * Restart Game
 *
 */

.game-restart {
  align-items: flex-end;
  width: 35%;
  cursor: pointer;
  font-size: 7vw;
  text-shadow: -1px 0 #ab38c3, 0 1px #ab38c3, 1px 0 #ab38c3, 0 -1px #ab38c3;
  color: #ffc8fc;
}

#game-restart.show {
  display: block;
}

#game-restart.hidden {
  display: none;
}

/*
 *
 * Deck
 *
 */

.deck-container {
  align-items: center;
}

.deck {
  position: relative;
  width: 70vw;
  max-width: 95vmin;
  height: 70vw;
  max-height: 95vmin;
  padding: 2vw;
  border: 3px solid transparent;
  border-radius: 16px;
  background: #10003e;
  background-clip: padding-box;
}

.deck:after {
  content: '';
  position: absolute;
  z-index: -1;
  top: -3px;
  right: -3px;
  bottom: -3px;
  left: -3px;
  box-shadow: 0px 0px 42px 8px #92e1fc;
  border-radius: 16px;
  background: linear-gradient(0.25turn, #92e1fc, #ebf8e1, #fea2fe);
}

.deck .card {
  margin: auto;
  width: 22%;
  height: 22%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid #ead5ff;
  border-radius: 8px;
  background: linear-gradient(0.25turn, #340b69, #c140d3);
  cursor: pointer;
  font-size: 0;
  color: #10003e;
}

.deck .card.flipped {
  position: relative;
  transform: rotateY(0);
  border: 2px solid #92e1fc;
  background: #ead5ff;
  cursor: default;
  font-size: 9vmin;
}

.deck .card.match-trans {
  /* Somehow this animation does not work if you change the order of the transformations
   * to first scale and then rotate (?)
   */
  transform: rotateZ(+1080deg) scale(1.2);
  transition-duration: 0.7s;
}

.deck .card.open.match {
  cursor: default;
}

/**
 *
 * Footer
 *
 */

footer {
  position: relative;
  margin: 0.8em auto 1em auto;
  width: 85vw;
  padding: 0.4em 0.4em 0.4em 0.4em;
  text-align: center;
  color: #ead5ff;
}

footer ul {
  width: 100%;
  padding: 0 0 10px 0;
  margin: 0;
}

footer li {
  display: inline;
  margin: 0 0.5em;
  text-align: center;
}

footer a {
  text-decoration: none;
  color: #fff;
}

footer a:hover {
  color: #d230cf;
}

.footer-credits {
  align-content: center;
  width: 100%;
  padding: 0 0 10px 0;
  font-size: 0.7em;
}

.footer-credits-title {
  font-weight: 600;
}

/**
 *
 * Modal
 *
 */

.modal {
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  display: none;
  overflow: auto;
  width: 100%;
  height: 100%;
  background-color: rgb(0, 0, 0);
  background-color: rgba(0, 0, 0, 0.4);
}

.modal.show {
  display: block;
}

.modal.hidden {
  display: none;
}

.modal-content {
  display: block;
  margin: 30vh auto 0 auto;
  width: 90vw;
  max-width: 1000px;
  box-shadow: 0px 0px 42px 8px #92e1fc;
  border: 2px solid #81c7de;
  border-radius: 5px;
  background-color: #d6edff;
  font-size: 5vw;
  color: #1d1c6c;
}

.modal-buttons {
  flex-direction: row;
  justify-content: center;
  margin: 0 5vw 3vh 5vw;
}

.modal-buttons-hidden {
  display: none;
}

.modal-text {
  margin: 10% 5% 10% 5%;
}

.modal-close {
  top: 0;
  float: right;
  margin: 0 1vmin 0 0;
  font-size: 8vw;
  font-weight: bold;
  color: #1d1c6c;
}

.modal-button {
  border: 2px solid #92e1fc;
  border-radius: 8px;
  width: 30vw;
  max-width: 100px;
  height: 3em;
  max-height: 50px;
  background: #1d1c6c;
  cursor: pointer;
  font-size: 0.8em;
  font-weight: bold;
  font-family: 'Library3AM';
  text-transform: uppercase;
  color: #fff;
}

.modal-close:hover,
.modal-close:focus {
  cursor: pointer;
  text-decoration: none;
  color: #81c7de;
}
