* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Playpen Sans", Tahoma, sans-serif;
    user-select: none;
}
:root {
  --card-shadow: 1px 1px 3px 1px black;
  --background-color: rgb(98, 220, 159);
  --big-text: clamp(1rem, 5vh, 3rem);
  --topic-text: clamp(1rem, 3vh, 2rem);
  --button-text: clamp(1rem,4vh,3rem);
  --button-col: palegoldenrod;
  --hover-color: lightgreen;
}

html {
  height: 100vh;
  width: 100vw;
}

body {
  background: url("/assets/homebackground.png");
  height: 100%;
  width: 100%;
  overflow: hidden;
}
.main-header {
  height: 10%;
  width: 100%;
  padding-left: 5%;
  padding-right: 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.plip-link {
  height: 80%;
  width: 15%;
  min-width: 120px;
  display: flex;
  align-items: center;
  text-align: center;
}
.plip-link img {
  padding: 2px;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  height: 100%;
  width: auto;
  margin-right: 5px;
}
.ingame-buttons {
  width: 70%;
  height: 100%;
  min-width: 200px;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.ingame-button {
  width: 35%;
  height: 90%;
  box-shadow: var(--card-shadow);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: var(--topic-text);
  cursor: pointer;
}
.ingame-settings {
  width: 15%;
}
.ingame-button:hover {
  background-color: lightyellow;
}
.topic-filters {
  justify-content: space-around;
  padding-right: 2%;
  cursor: auto;
}
.topic-filters:hover {
  background: rgba(255, 255, 255, 0.4);
}
.topic-filters-text {
  width: 50%;
}
.topic-filter {
  width: 12%;
  border-radius: 10px;
  background-color: var(--button-col);
  height: 50%;
  box-shadow: var(--card-shadow);
  cursor: pointer;
}
.filter-unit {
  background-color: lightblue;
}
.filter-unit.active-filter {
  background-color: rgba(0, 0, 0, 0.5);
}
.filter-extra {
  background-color: rgba(252, 255, 96,0.5);
}
.filter-extra.active-filter {
  background-color: rgba(150, 100, 0, 0.5);
}
.filter-lt {
  background-color: rgb(255, 199, 96);
}
.filter-lt.active-filter {
  background-color: rgba(188, 138, 44, 0.8);
}
.topic-filter:hover {
  box-shadow: 1px 1px 3px 1px white;
}
.sound-control {
  height: 100%;
  width: 10%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.sound-button {
  height: 80%;
  max-height: 60px;
  min-height: 30px;
  width: auto;
  max-width: 60px;
  min-width: 30px;
  cursor: pointer;
  border-radius: 9999px;
  box-shadow: 0 0 15px 15px white;
}
.sound-button.available {
  animation: pulse 800ms infinite ease-in-out;
}
.sound-off {
  filter: grayscale(100);
  box-shadow: none;
}
@keyframes pulse {
  0% {
    scale: 1;
  }
  50% {
    scale: 1.2
  }
  100% {
    scale: 1;
  }
}
.selection-mode-window {
  margin: 0 auto;
  width: 90%;
  height: 70%;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}
.selection-mode-button {
  height: 30%;
  width: 80%;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  font-size: var(--button-text);
  background-color: lightblue;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
}
.pre-game-controls {
  margin: 0 auto;
  margin-top: 2%;
  height: 15%;
  width: 90%;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.pre-game-control {
  width: 40%;
  height: 90%;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  background: rgba(255, 255, 255, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  font-size: var(--topic-text);
}
.topic-select-window, .unit-select-window {
  padding: 15px;
  height: 70%;
  width: 90%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}
.topic-select-window {
  overflow-y: scroll;
  @supports not selector(::-webkit-scrollbar) {
    scrollbar-color: lightblue transparent;
  }
}
.topic-select-window::-webkit-scrollbar, .book-select-window::-webkit-scrollbar {
  background: transparent;
  width: 10px;
}
.topic-select-window::-webkit-scrollbar-thumb, .book-select-window::-webkit-scrollbar {
  background: lightblue;
  border-radius: 8px;
  opacity: .5;
}
.topic-select-button {
    height: 25%;
    width: fit-content;
    min-width: 75px;
    max-width: 30%;
    padding: 5px 15px 5px 15px;
    background-color: lightblue;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    text-wrap: balance;
    box-shadow: var(--card-shadow);
    border-radius: 8px;
    font-size: var(--topic-text);
    cursor: pointer;
}
.topic-select-button img {
    height: 75%;
    width: auto;
    max-width: 100%;
}
.topic-select-button:hover {
  background-color: lightyellow;
}
.book-select-window {
  margin: 0 auto;
  padding-top: 3px;
  width: 90%;
  height: 60%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 20px;
  overflow-y: scroll;
  @supports not selector(::-webkit-scrollbar) {
    scrollbar-color: lightblue transparent;
  }
}
.book-select {
  height: 40%;
  width: 40%;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  font-size: var(--topic-text);
  background: rgba(255, 255, 255, 0.4);
}
.number-select-window {
  height: 30%;
  width: 90%;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
}
.number-select-number {
  width: 10%;
  height: 80%;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 3px;
  box-shadow: var(--card-shadow);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: var(--button-text);
  cursor: pointer;
}
.selected-book, .selected-unit {
  background: rgba(255, 255, 255, 0.8);
}
.book-select:hover, .number-select-number:hover {
  background-color: lightyellow;
}
.image-select-window {
  height: 80%;
  width: 90%;
  margin: 0 auto;
}
.image-select-buttons {
  height: 9%;
  margin-bottom: 1%;
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.image-select-button {
  width: 30%;
  height: 100%;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  background: rgba(255, 255, 255, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
}
.image-select-images {
  height: 90%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  padding-bottom: 50px;
  overflow-y: scroll;
  @supports not selector(::-webkit-scrollbar) {
    scrollbar-color: lightblue transparent;
  }
}
.image-select-images::-webkit-scrollbar {
  background: transparent;
  width: 10px;
}
.image-select-images::-webkit-scrollbar-thumb {
  background: lightblue;
  border-radius: 8px;
  opacity: .5;
}
.image-select-image {
  box-shadow: var(--card-shadow);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.4);
  width: 22%;
  height: 45%;
  min-width: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.image-select-image img {
  height: 90%;
  width: auto;
  max-width: 90%;
  cursor: pointer;
}
.letstry-topic {
  background-color: rgb(255, 199, 96);
}
.extra-topic {
  background-color: rgba(252, 255, 96,0.5);
}
.selected {
  box-shadow: 0 0 15px 3px red;
  border-radius: 15px;
}

.cards-container {
  height: 88%;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  padding-top: 15px;
  margin: 0 auto;
  align-content: center;
  justify-content: space-around;
  overflow: hidden;
}

.flip-card { 
  display: flex;
  background-color: transparent;
  width: 22%;
  height: 33%;
  /* perspective: 1000px; */
}

@media (orientation: portrait) {
  .flip-card {
    width: 40vw;
    height: 15vh;
  }
}

.flip-card-inner {
  position: relative;
  width: 100%;
   height: 100%;
   transition: transform 0.8s;
   transform-style: preserve-3d;
}
  
.flip-card-front, .flip-card-back {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  width: 100%;
  height: 90%;
  box-shadow: 2px 2px 2px 2px black;
  -webkit-backface-visibility: hidden; /* Safari */
  backface-visibility: hidden;
  cursor: pointer;
}
  
.flip-card-front {
  background: var(--button-col);
  border-radius: 5px;
}

.flip-card-front img {
  height: 100%;
  width: auto;
  overflow: hidden;
  border-radius: 5px;
}
.flip-card-back img {
  height: 100%;
  width: auto;
  overflow: hidden;
}

.flip-card-back {
  background-color: white;
  border-radius: 5px;
  transform: rotatey(180deg);
}

.settings-screen {
  position: absolute;
  height: 60vh;
  width: 60vw;
  top: 20%;
  left: 20%;
  background-color: var(--background-color);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
}
.settings-grid {
  height: 80%;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2,1fr);
  grid-template-rows: repeat(3,1fr);
}
.settings-back-container {
  height: 20%;
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.settings-back, .settings-cancel {
  height: 50%;
  background-color: orange;
  box-shadow: 0 0 2px 2px darkorange;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: var(--big-text);
  font-weight: bold;
  color: white;
  cursor: pointer;
}
.settings-back {
  width: 50%;
}
.settings-cancel {
  width: 30%;
}
.settings {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
}
.settings img {
  height: 12vh;
  width: 5vw;
}
.settings div {
  height: 12vh;
  width: 15vw;
  font-size: var(--big-text);
  color: black;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--card-shadow);
  border-radius: 10px;
  cursor: pointer;
}
span {
    width: fit-content;
    height: min-content;
}
.topic-selected, .topic-selected:hover {
background-color: pink;
}
.no-touch {
  pointer-events: none;
}

.no-touch.overrule {
  pointer-events: all;
}

.sounds-backdrop {
  position: absolute;
  height: 100vh;
  width: 100vw;
  top: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.4);
  opacity: 1;
  transition: opacity ease-in-out 300ms;
}

.nobackdrop {
  opacity: 0;
  pointer-events: none;
}

.isolate-backdrop {
  z-index: 21;
}
.behind {
display: none;
z-index: -20;
}
.warning, .warning:hover {
background-color: rgba(255, 0, 0, 0.8);
}
