* {
    box-sizing: border-box;
}

@font-face {
    font-family: Herculanum;
    src: url('../fonts/Herculanum.ttf') format('truetype'),
        url('../fonts/Herculanum.woff') format('woff');
}

@font-face {
    font-family: HerculanumPro;
    src: url('../fonts/HerculanumLTPro.TTF') format('truetype'),
        url('../fonts/HerculanumLTPro.woff') format('woff');
}

body {
    margin: 0;
    font-family: Herculanum, 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
}

#game {
    position: absolute;
    width: 100vw;
    height: 100vh;
    margin: auto;

    background: url("../img/IMG_7189.PNG");
    background-size: cover;
    background-position: center;

    @supports (background-image: url("../img/IMG_7189.webp")) {
        background-image: url("../img/IMG_7189.webp");
    }
}

.fullscreen {
    height: 100%;
    width: 100%;

    overflow: hidden;
}


.center-children {
    position: absolute;
    left: 0;
    
    display: flex;
    justify-content: center;
    align-items: center;
}

.horizontal-layout {
    position: absolute;
    display: flex;
    padding: 2%;
    gap: 2%; /* horizontal space between boxes */
    justify-content: center;
    align-items: center;
    max-width: 100%;
}

#plate {
    position: absolute;
    width: 50%;
    aspect-ratio: 1;

    background-image: url("../img/Tree_Of_Life 2.png");
    background-size: cover;
    background-position: center;

    @supports (background-image: url("../img/Tree_Of_Life 2.webp")) {
        background-image: url("../img/Tree_Of_Life 2.webp");
    }
}

#spinner {
    position: absolute;
    width: 8%;
    cursor: pointer;

    border-radius: 50%;
    z-index: 9999;

    background-image: url("../img/spinner.png");
    background-size: cover;
    background-position: center;

    aspect-ratio: 1;

    @supports (background-image: url("../img/spinner.webp")) {
        background-image: url("../img/spinner.webp");
    }

    animation: animateShadow 3s infinite linear;
}

#spinner.no-animation {
    animation: none;
}
#spinner.no-z-index {
    z-index: 0;
}

@keyframes animateShadow {
  0% {
    -webkit-box-shadow: 0px 0px 4em 0em rgba(154, 58, 232, 1.0);
    -moz-box-shadow:    0px 0px 4em 0em rgba(154, 58, 232, 1.0);
    box-shadow:         0px 0px 4em 0em rgba(154, 58, 232, 1.0);
  }
  50% {
    -webkit-box-shadow: 0px 0px 3em 2.5em rgb(154, 58, 232, 1.0);
    -moz-box-shadow:    0px 0px 3em 2.5em rgba(154, 58, 232, 1.0);
    box-shadow:         0px 0px 3em 2.5em rgba(154, 58, 232, 1.0);
  }
  100% {
    -webkit-box-shadow: 0px 0px 4em 0em rgba(154, 58, 232, 1.0);
    -moz-box-shadow:    0px 0px 4em 0em rgba(154, 58, 232, 1.0);
    box-shadow:         0px 0px 4em 0em rgba(154, 58, 232, 1.0);
  }
}

.disabled {
    pointer-events: none;
    transform: translateY(400%);
}

.card {
    flex: 1 1 0;
    aspect-ratio: 1/1.414;
    background-color: white;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: translate 1s, scale 1s, rotate 0.6s;
    transform: 0px rotateX(90deg);
    transform-style: preserve-3d; /* Enables 3D transform for children */

    box-shadow: 0 5px 10px rgba(0,0,0,0.5);
}

.card::after {
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Transition to showing the bigger shadow on hover */
.card:hover::after {
    opacity: 1;
}

.card:hover {
    scale: 150%;
    z-index: 1000;
    transform: rotateX(180deg);
}

.card.selected {
    transform: rotateX(180deg);
}

.card-image {
    width: 100%;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.card-front .card-image {
    width: 70%;
    aspect-ratio: 1;
}
.card-back {
    border-radius: 4px;
    background-color: white;
    color: white;
    transform: rotateX(180deg); /* Backside starts rotated */
}

.card .more-info {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;

    color: #433c2e;
    font-weight: bold;
    
    padding: 10%;

    text-align: center;

    opacity: 0;

    transition: opacity 1s linear;
}
.card:hover .more-info {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.5);
}

a.button {
    text-decoration: none;

    border: solid 1px #e1b522;
    border-radius: 2px;
    padding: 2px;
    background-color: #f7ddac;

    -webkit-transition: background-color 200ms linear;
    -ms-transition: background-color 200ms linear;
    transition: background-color 200ms linear;
}
a.button:hover {
    background-color: #c29b1c;
}
a.button:visited {
    color: #433c2e;
}