*,*::after,*::before {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Playpen Sans", Tahoma, sans-serif;
    user-select: none;
}

:root {
    --xlarge-text: clamp(1rem,8vmin,6rem);
    --med-text: clamp(0.8rem,6vmin,4rem);
    --small-text: clamp(0.6rem,4vmin,2rem);
    --med-shadow: 2px 2px 3px 2px black;
    --card-shadow: 1px 1px 3px 1px black;
    --button-col: lightgreen;
    --dark-button: darkgreen;
    --hover-color: palegoldenrod;
    --back-color: lightblue;
    --topic-text: clamp(1rem, 3vh, 2rem);
    --button-text: clamp(1rem,4vh,3rem);
    --heavy-shadow: 1px 1px 15px 10px black;
    --wordbox-font: clamp(0.8rem, 5vh, 1.5rem);
    --highlight-low: rgba(255,255,255,0.2);
    --highlight-mid: rgba(255,255,255,0.5);
    --highlight-high: rgba(255,255,255,0.8);
    --lowlight-mid: rgba(0,0,0,0.2);
    --lowlight-low: rgba(0,0,0,0.5);
    --highlight-yellow: rgba(255, 255, 0, 0.6);
    --highlight-green: rgba(0,200,0,0.8);
}

html {
    height: 100dvh;
    width: 100vw;
}

body {
    background: url("/assets/homebackground.png");
    height: 100%;
    width: 100%;
    overflow: hidden;
    touch-action: none;
}
.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-between;
    align-items: center;
    /* padding-left: 10%; */
}
.ingame-button {
    width: 30%;
    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-button:hover {
    background-color: lightyellow;
}
.ingame-switch-case {
    width: 20%;
}
.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;
    border-radius: 9999px;
    cursor: pointer;
}
.menu-sound {
    box-shadow: 0 0 15px 15px white;
}
.menu-sound.available {
    animation: pulse 1000ms infinite ease-in-out;
}
@keyframes pulse {
    0% {
        scale: 1;
    }
    50% {
        scale: 1.2;
    }
    100% {
        scale: 1;
    }
}
.menu-sound-off {
    filter: grayscale(100);
    box-shadow: none;
}
.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;
}

.game-root-menu {
    height: 98%;
    width: 100%;
}

.game-select-screen {
    position: absolute;
    top: 10%;
    left: 5%;
    width: 90%;
    height: 88%;
    border-radius: 10px;
    box-shadow: var(--med-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    padding-top: 1%;
    padding-bottom: 1%;
    background-color: var(--button-col);
}
.game-select {
    width: 20%;
    height: 20%;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    background-color: var(--back-color);
    cursor: pointer;
}
.game-select-topics, .game-select-randomten {
    width: 80%;
    font-size: var(--med-text);
}
.game-select-numbers-text {
    display: flex;
    justify-content: center;
    align-items: center;
    width: fit-content;
    height: fit-content;
    font-size: var(--small-text);
}
.game-select-numbers {
    height: 30%;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 10px;
    padding-left: 5%;
    padding-right: 5%;
}
.game-select-numbers div {
    height: 100%;
    font-size: var(--small-text);
}
.game-select:hover {
    background-color: var(--hover-color);
}

.selected {
    box-shadow: 0 0 15px 3px red;
    border-radius: 15px;
}

.game-screen {
    height: 90%;
    width: 100%;
}
.outer-box {
    margin: 0 auto;
    height: 50%;
    width: 90%;
    display: flex;
    justify-content: space-around;
    align-items: center;
}
.image-box {
    width: 50%;
    min-width: 320px;
    height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid black;
    background-color: palegreen;
    box-shadow: var(--card-shadow);
    font-size: var(--small-text);
    border-radius: 6px;
    position: relative;
    cursor: pointer;
}
.xl-text {
    font-size: var(--xlarge-text);
}
.quiz-image {
    height: 100%;
    width: auto;
    max-width: 100%;
}
.help-button {
    position: absolute;
    height: 15vh;
    width: 25vw;
    background-color: var(--button-col);
    border-radius: 10px;
    font-size: var(--xlarge-text);
    display: flex;
    justify-content: center;
    align-items: center;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: var(--card-shadow);
    cursor: pointer;
}

.answer-box {
    margin: 0 auto;
    width: fit-content;
    margin-bottom: 10px;
    height: 15%;
    max-width: 90vw;
    font-size: var(--xlarge-text);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.stop-button {
    background-color: red;
}
.answer-space {
    position: relative;
    width: 10vmin;
    height: 12vmin;
    /* background-color: lightgray;
    box-shadow: var(--med-shadow); */
    /* text-align: center; */
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-left: 5px;
    margin-right: 5px;
    border: 1px solid gray;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}
.choose-box {
    margin: 0 auto;
    width: 90%;
    height: 30%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5%;
    cursor: pointer;
}
.choose-tile {
    width: 9%;
    height: 12vmin;
    border-radius: 8px;
    font-size: var(--med-text);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid gray;
    background-color: var(--highlight-low);
    box-shadow: var(--med-shadow);
    transition: box-shadow 100ms linear;
}
.answer-tile {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--highlight-mid);
    cursor: pointer;
}
.answer-tile.rotate {
    animation: flip 1000ms 1;
}
@keyframes flip {
    0% {
        transform: rotateX(0deg);
    }
    50% {
        transform: rotateX(90deg);
    }
    100% {
        transform: rotateX(0deg);
    }
}

.choose-tile:hover {
    background-color: var(--highlight-high);
}
.answer-space .answer-tile {
    position: absolute;
}
.box-mid-drag {
    position: absolute;
    pointer-events: none;
    opacity: 0.8;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 20;
}
.selected-tile {
    background-color: var(--lowlight-low);
    box-shadow: none;
}
.selected-tile:hover {
    background-color: var(--lowlight-mid);
}
.ghost-overlay {
    pointer-events: none;
    position: absolute;
    top: 0;
    height: 100%;
    width: 100%;
    background-color: var(--highlight-mid);
}
.check-button {
  position: absolute;
  height: 10vh;
  width: 12vw;
  min-width: fit-content;
  font-size: var(--button-text);
  border-radius: 10px;
  background-color: var(--highlight-high);
  top: 52%;
  left: 50%;
  transform: translate(-50%,-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: var(--heavy-shadow);
}
.check-button.move {
  animation: wobble 1000ms infinite;
}
@keyframes wobble {
  0% {
    transform: translate(-50%,-50%);
  }
  35% {
    transform: translate(-50%,-60%);
  }
  70% {
    transform: translate(-50%,-50%);
  }
}

.double-warning {
    background-color: red;
}
.warning {
    background-color: red;
}
.incorrect, .answered-incorrect {
  background-color: var(--lowlight-low);
}
.semicorrect, .answer-semicorrect {
  background-color: var(--highlight-yellow);
}
.correct, .answer-correct {
    background-color: var(--highlight-green);
}
.small{
    width: 7.5vmin;
    height: 9vmin;
    font-size: var(--med-text);
}
.vsmall{
    width: 5vmin;
    height: 6vmin;
    font-size: var(--small-text);
}
.go-blue {
    color: blue;
    box-shadow: 1px 1px 2px 1px darkblue;
}
.go-red {
    color: red;
    box-shadow: 1px 1px 2px 1px darkred;
}
.go-green {
    color: green;
    box-shadow: 0 0 5px 3px green;
    border: 2px solid silver;
}
.prompt-background {
    position: absolute;
    top: 0%;
    z-index: 2;
    height: 100vh;
    width: 100vw;
    background-color: rgba(51, 50, 50, 0.5);
}
.game-over-dialog {
    position: absolute;
    border-radius: 10px;
    z-index: 3;
    top: 28%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--button-col);
    box-shadow: var(--card-shadow);
    height: 40vh;
    width: 40vw;
    min-width: 500px;
}
.dialog-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    text-wrap: balance;
    height: 50%;
    font-size: var(--small-text);
}
.dialog-buttons {
    height: 50%;
    display: flex;
    justify-content: space-around;
    align-items: center;
}
.dialog-button {
    background-color: var(--dark-button);
    height: 50%;
    width: 40%;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    font-size: var(--small-text);
    font-weight: bold;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.answer-picture {
    position: absolute;
    height: 30vh;
    width: 40vw;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background-color: lightblue;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}
#ansImage {
    height: 100%;
    width: auto;
    max-width: 100%;
}
.topic-selected, .topic-selected:hover {
  background-color: pink;
}
@media (orientation:portrait) {
    .image-box {
        width: 100%;
    }
    .help-button {
        width: 50vw;
    }
}

.sounds-backdrop, .dialog-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;
}
.rotate-dialog {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.9);
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 1000;
}
.rotate-dialog-interior {
    position: relative;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}
.dismiss-rotate-dialog {
    position: absolute;
    top: 2%;
    right: 2%;
    height: 10%;
    display: flex;
    border-radius: 10px;
    gap: 5px;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
}
.dismiss-rotate-dialog:hover {
    box-shadow: 0 0 3px 1px white;
}
.dismiss-rotate-dialog img {
    height: 100%;
    width: auto;
    border: 2px solid white;
    padding: 5px;
    border-radius: 6px;
    background-color: darkred;
}
.rotate-text {
    max-width: 60%;
    font-size: var(--topic-text);
}
.rotate-arrow {
    height: auto;
    max-height: 20%;
    width: auto;
    transform: rotate(90deg);
}
.behind {
    display: none;
    z-index: -20;
}
span {
    text-align: center;
    height: fit-content;
}
.warning, .warning:hover {
    background-color: rgba(255, 0, 0, 0.8);
}