@keyframes shakeX {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
  100% { transform: translateX(0); }
}

* {
    font-family: 'Pacifico', cursive;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0px;
    padding: 0px;
    top: 0px;
    left: 0px;
/*    min-width: 100dvw !important;*/
    min-height: 100dvh !important;
    background: white;
    background-image: url(assets/bg.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: top center;
    flex-direction: column;
}

#calContainer {
    background-color: lightgray;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5vw;
    padding: 1.75vw;
    width: calc(100dvw / 1.5);
    border-radius: 2.25vw;
    background-color: #d50000;
    border: solid 2px white;
}

#calContainer > * {
    background: #ff1919;
    background: linear-gradient(180deg, rgba(255, 25, 25, 1) 0%, rgba(171, 0, 0, 1) 100%);
    border-radius: 1vw;
    box-shadow: 0px 0.35vw 0px black;
    border: 0.25vw solid black;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    user-select: none;
    aspect-ratio: 1.5/1;
    transition: filter 0.25s;
}

#calContainer > *.open {
    transform-origin: top;
    box-shadow: none;
    transform: translate(0px, 4px);
    filter: brightness(0.9);
}

#calContainer > * > p {
    font-size: 2vw;
}

.window {
    position: absolute;
    background-color: rgb(25, 123, 0);
    padding: 20px;
    border: solid 2.5px white;
    border-radius: 15px;
    color: white;
    width: calc(100dvw / 2);
    box-sizing: border-box;
    display: none;
}

.window > #exercise {
    font-size: 20px;
    width: 100%;
    margin-block: 8px;
}

.window > #title {
    font-size: 35px;
    margin: 0px;
    padding: 0px;
    line-height: 50px;
    margin-top: 17.5px;
}

button, input {
    background-color: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    padding: 5px;
    border-radius: 50vw;
}

input {
    width: 100%;
    font-size: 20px;
    padding-inline: 15px;
    font-family: "MathJax_Main", "Times New Roman", serif !important;
    transition: background-color 0.75s;
}

button {
    background-color: rgba(255, 255, 255, 0.2);
    padding-inline: 20px;
    transition: background-color 0.5s, filter 0.25s;
}

#inputandbutton {
    width: 100%;
    display: flex;
    gap: 10px;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-family: Pacifico;
    user-select: none;
}

mjx-container, mjx-container > * {
  all: revert;
}
mjx-container * {
  all: revert;
}

.closeWindow {
    position: absolute;
    top: 0px;
    right: 0px;
    margin: 17.5px;
    width: 25px;
    -webkit-user-drag: none;
    cursor: pointer;
}

#calContainer > *:nth-child(7),
#calContainer > *:nth-child(15),
#calContainer > *:nth-child(22),
#calContainer > *:nth-child(2),
#calContainer > *:nth-child(10),
#calContainer > *:nth-child(18) {
    grid-column: span 2;
    aspect-ratio: unset;
}

#solvedWindow {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: left;
}

#solvedWindow > #rewardImage {
    width: 15vw;
    border-radius: 16px;
}

#solvedWindow > button {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.15);
}

input.wrong {
    transition: background-color 0s;
    background-color: rgba(255, 0, 0, 1);
}

button:hover, #solvedWindow > button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

#mainTitle {
    padding-inline: auto;
    font-size: 5vw;
    z-index: 10000;
    color: white;
    text-shadow: 0px 0px 10px black;
}

form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

form > * {
    width: calc(100% - 30px);
}

#twoButtons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 100%;
}

#vignette {
    z-index: 99;
    position: fixed;
    top: 0px;
    right: 0px;
    bottom: 0px;
    left: 0px;
    backdrop-filter: blur(5px);
}

form > * {
    font-family: Pacifico !important;
}

form > * > button {
    padding-block: 7.5px !important;
    font-size: 15px;
}

#passwordThingy {
    display: flex;
    width: 100%;
    gap: 8px;
}

#passwordThingy > button {
    display: flex;
    justify-items: center;
    align-items: center;
    height: 35px;
}

hr {
    border: solid rgba(255, 255, 255, 0.5) 0.75px;
    border-radius: 50vw;
    margin-block: 5px;
}

#window > form > button {
    width: 100% !important;
}

#loginWindow > form > input, #loginWindow > form > * > input {
    height: 25px;
}

button:disabled {
    filter: opacity(0.5);
}

button:disabled:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#loginButton {
    position: fixed;
    top: 25px;
    right: 25px;
    color: white;
    background-color: #ff1919;
    border: solid 2px white;
}

#loginButton:hover {
    background-color: #d50000;
}

.done, .disabled {
    filter: brightness(0.8);
}

.disabled {
    filter: brightness(0.8) blur(2px);
}

#window {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 10000;
}

#exerciseimg {
    height: 30vh;
    border-radius: 16px;
}

#exerciseimg.fullscreen {
    object-fit: contain;
    position: fixed;
    inset: 0px;
    width: 100vw;
    height: 100vh;
}

.shake {
    animation: shakeX 0.3s ease-in-out;
}