:root {
  --red: #ee0000;
  --purple: darkorchid;
  --green: green;
  --board-color: #071f45;
  /* --shadow-color: #a0a2db; */
  --shadow-color: rgba(255, 255, 255, 0.5);
  --selected-displacement-x: 4px;
  --selected-displacement-y: 7px;
  --hint-color: yellow;
  --statistics-value-color: lightblue;
}

html, body {
  height: 100vh;
  width: 100vw;
  padding: 0;
  margin: 0;
  border: 0;
  user-select: none;
}

input, label, button, .top-btn, .game-btn, .card, #fullscreenBtn {
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.hidden {
  display: none !important;
}

.container {
  height: 100%;
  background-color: var(--board-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mistake-flash {
  animation: mistake-flash 0.8s;
}

.top-bar {
  height: 50px;
  display: grid;
  grid-template-columns: 1fr 50px 50px;
  grid-template-rows: 1fr;
}

#deckProgress {
  height: 30px;
  grid-column: 1;
  grid-row: 1;
  margin: auto 0 auto 5px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid gray;
}

#deckProgress > div {
  height: 100%;
  background-color: #0075ff;
  transition: width 0.4s ease;
}

#deckProgressLabel {
  grid-column: 1;
  grid-row: 1;
  margin: auto;
  text-align: center;
  font-size: 120%;
  color: black;
  text-shadow: -1px -1px 1px lightblue, 1px -1px 1px lightblue, -1px 1px 1px lightblue, 1px 1px 1px lightblue;
}

#settingsBtn {
  background: content-box url('gear-2.svg') center/80% no-repeat;
}

#settingsBtn.glowing {
  background: content-box url('gear-2-glowing.svg') center/80% no-repeat;
}

#shareBtn {
  background: content-box url('share.svg') center/80% no-repeat;
}

.game-buttons-container {
  display: flex;
}

.game-btn {
  width: 100%;
  height: 50px;
  margin: 15px;
  border-radius: 5px;
  border: 1px solid black;
}

.game-board {
  height: 100%;
  width: 100%;
  max-width: 60vh;
  align-self: center;
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  align-content: space-evenly;
  justify-content: space-evenly;
  padding: 0 6px;
}

.card {
  margin: 5px;
  width: calc(33.33% - 10px);
  padding-top: 20%;
  position: relative;
  perspective: 1000px;
  border-radius: 10px;
  margin: 5px;
}

.card-content {
  background: whitesmoke;
  border-radius: 10px;
  height: 100%;
  width: 100%;
  padding: 15px;
  display: flex;
  justify-content: center;
  position: absolute;
  top: 0;
  box-sizing: border-box;
  backface-visibility: hidden;
}

.card-content.new {
  animation: new-card-flip 0.4s ease;
}

.card-content.old {
  transform: rotateX(180deg);
  animation: old-card-flip 0.4s ease;
}

.card-content svg {
  height: 100%;
  margin: 0 1.5%;
}

.card.selected {
  box-shadow: var(--selected-displacement-x) var(--selected-displacement-y) var(--shadow-color);
  left: calc(var(--selected-displacement-x) * -1);
  top: calc(var(--selected-displacement-y) * -1);
}

.card.hinted {
  box-shadow: -5px -5px 5px var(--hint-color), 5px -5px 5px var(--hint-color), -5px 5px 5px var(--hint-color), 5px 5px 5px var(--hint-color);
  /* transition: box-shadow 0.4s ease; */
}

.card.selected.hinted {
  box-shadow: var(--selected-displacement-x) var(--selected-displacement-y) 5px 2px var(--hint-color);
  /* transition: none; */
}

.card path {
  stroke-width: 6;
}

.pattern path {
  stroke-width: 8;
}

.red path {
  stroke: var(--red);
}

.purple path {
  stroke: var(--purple);
}

.green path {
  stroke: var(--green);
}

.toast {
  font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  font-size: x-large;
  position: absolute;
  /* bottom: calc(50px + attr(data-position) * (20px + 1em)); */
  margin-left: auto;
  margin-right: auto;
  left: 0;
  right: 0;
  width: fit-content;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  animation: toast-card-flip 0.4s ease;
}

.toast.dead {
  animation: toast-card-flip-out 0.4s ease;
}

.modal {
  height: 0;
  width: 0;
  overflow: hidden;
  font-size: xx-large;
}

.modal.active {
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: fixed;
  background-color: rgba(0, 0, 0, 0.5);
  left: 0;
  top: 0;
}

.modal > .modal-content {
  position: relative;
  left: 0;
  right: 0;
  top: 50%;
  background: white;
  display: flex;
  flex-direction: column;
  width: fit-content;
  max-width: 95%;
  max-height: 95%;
  margin: auto;
  padding: 10px;
  vertical-align: middle;
  transform: translateY(-50%);
  border-radius: 10px;
}

.modal > .modal-content button {
  font-size: x-large;
}

.modal > .modal-content > .row {
  display: flex;
  align-items: center;
}

.modal > .modal-content > .row > button {
  font-size: large;
}

.modal > .modal-content > .row > * {
  margin-right: 10px;
}

.modal > .modal-content > .row > *:last-child {
  margin-right: 0;
}

.modal > .modal-content > .buttons > * {
  float: right;
  margin-left: 0.2em;
  margin-top: 0.2em;
  font-size: x-large;
}

.modal > .modal-content > button {
  margin-top: 5px;
  margin-bottom: 5px;
}

.defaultColorBtn::before {
  content: "Default";
}

#qrcode {
  width: 80vmin;
  height: 80vmin;
  max-width: 10cm;
  max-height: 10cm;
}

#fullscreenBtn {
  position: fixed;
  right: 15px;
  bottom: 15px;
  width: 80px;
  height: 80px;
  color: white;
  opacity: 0.5;
  border-radius: 10px;
  background: content-box url('fullscreen.svg') center/80% no-repeat, black;
}

#installBtn {
  animation: glow 1.5s infinite;
}

.end-game-screen {
  color: whitesmoke;
  align-self: center;
  width: 100%;
}

.end-game-screen > .title {
  font-size: xx-large;
  margin-top: 20px;
  margin-bottom: 50px;
  text-align: center;
}

.end-game-screen > .statistic {
  font-size: x-large;
  margin-left: 10%;
  margin-top: 10px;
}

.end-game-screen > .statistic > span {
  color: var(--statistics-value-color);
  font-weight: bold;
}

.end-game-screen > button {
  display: block;
  font-size: xx-large;
  margin: 2em auto;
  padding: 0.5em;
}

@media (display-mode: fullscreen) {
  #fullscreenBtn {
    display: none;
  }
}

@media (display-mode: standalone) {
  #fullscreenBtn {
    display: none;
  }
}

@keyframes mistake-flash {
  0% {
    background-color: darkred;
  }
  1000% {
    background-color: inherit;
  }
}

@keyframes new-card-flip {
  0% {
    transform: rotateX(180deg);
  }
  100% {
    transform: rotateX(0deg);
  }
}

@keyframes old-card-flip {
  0% {
    transform: rotateX(0deg);
  }
  100% {
    transform: rotateX(-180deg);
  }
}

@keyframes toast-card-flip {
  0% {
    transform: rotateX(90deg);
  }
  100% {
    transform: rotateX(0deg);
  }
}

@keyframes toast-card-flip-out {
  0% {
    transform: rotateX(0deg);
  }
  100% {
    transform: rotateX(90deg);
  }
}

@keyframes glow {
  0%,100% {
    box-shadow: none;
  }
  50% {
    box-shadow: -5px -5px 5px var(--hint-color), 5px -5px 5px var(--hint-color), -5px 5px 5px var(--hint-color), 5px 5px 5px var(--hint-color);
  }
}