* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-image: url("bgimg.jpg");
    background-size: cover;
    background-repeat: no-repeat;
}

.backdrop {
    background-color: rgba(33, 33, 33, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    padding: 20px;
    backdrop-filter: blur(20px);
}

header {
    position: fixed;
    width: 100%;
    color: white;
    padding: 10px 0;
    text-align: center;

    
}   
h1 {
    letter-spacing: 5px;
}
h2 {
    font-weight: lighter;
}

main {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#content {
    width:60%;
    height: 60%;
    margin: 0 auto;

    display: flex;
    justify-content: space-evenly;
    align-items: center;
    flex-direction: column;

    border-radius: 10px;
}

button {
    padding: 20px;
    background-image: linear-gradient(to right, #ff5f5f, #ffb6b6);
    border: none;
    border-radius: 5px;

    transition: 0.3s;
}

button:hover {
    transform: scale(1.05);
    cursor: pointer;

    transition: 0.3s;
}

button:disabled {
    background-image: linear-gradient(to right, #ff5f5f, #ffb6b6);
    cursor: not-allowed;
}
button:disabled:hover {
    transform: scale(1);
    cursor: not-allowed;
}

#yengame {
    position: relative;
    width: 200px;
    height: 200px;
    border: 1px solid #ccc;

    text-align: center;
    line-height: 200px;

    color: white;

    user-select: none;
}

#yen {
    position: fixed;
    width: 150px;
    height: 150px;

    top: 0;

}

#yen:not(:has(#yenimg)) {
    pointer-events: none;
}

#yenimg {
    display:inline-block;
    position: absolute;
    top: 25px;
    left: 25px;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

#yen #yenimg {
    animation: quickbreathandslowspin 10s ease infinite;
}

@keyframes quickbreathandslowspin {
    0% {
        transform: rotate(0deg) scale(0.9);
    }
    10% {
        transform: rotate(36deg) scale(1.1);
    }
    20% {
        transform: rotate(72deg) scale(0.9);
    }
    30% {
        transform: rotate(108deg) scale(1.1);
    }
    40% {
        transform: rotate(144deg) scale(0.9);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
    60% {
        transform: rotate(216deg) scale(0.9);
    }
    70% {
        transform: rotate(252deg) scale(1.1);
    }
    80% {
        transform: rotate(288deg) scale(0.9);
    }
    90% {
        transform: rotate(324deg) scale(1.1);
    }
    100% {
        transform: rotate(360deg) scale(0.9);
    }
}


#fortunepanel {
    width: 100vw;
    height: 100vh;

    position: fixed;
    top: 0;
    left: 0;

    animation: showup 0.5s ease-in-out;
    animation-fill-mode: forwards;
}

@keyframes showup {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.fortune {
    position: fixed;

    width: 300px;
    height: 300px;
    top: 50%;
    left: 50%;
    margin-top: -150px;
    margin-left: -150px;

    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);

    background-color: white;
    border-radius: 20px;

    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;

    padding: 20px;
}

#fortunefront {
    animation: shake 2s ease-in-out infinite 1s;
    cursor: pointer;
}

#fortunefront.reverse {
    animation: rotateFront 0.5s ease-in-out;
    animation-fill-mode: forwards;
    pointer-events: none;
}

#fortuneback {
    opacity: 0;
    pointer-events: none;
}

#fortuneback.reverse {
    animation: rotateBack 0.5s ease-in-out;
    animation-fill-mode: forwards;
    pointer-events: auto;
}

@keyframes rotateFront {
    0% {
        opacity: 1;
        transform: rotateY(0deg);
    }
    49% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
    100% {
        opacity: 0;
        transform: rotateY(180deg);
    }
}

@keyframes rotateBack {
    0% {
        opacity: 0;
        transform: rotateY(180deg);
    }
    49% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: rotateY(0deg);
    }
}

.hidden {
    display: none;
}

.fixedwrapper {
    position: fixed;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;

    z-index: 1000;
}

#resetbtn {
    position: fixed;
    opacity: 0;
}

.fixedwrapper:has(#resetbtn) {
    bottom: 20%;
}

#fortunepanel:has(.reverse) #resetbtn {
    opacity: 1;

    transition: 0.5s;
}

button:enabled:not(:hover) {
    animation: shake 2s ease-in-out infinite 1s; 
}

@keyframes shake {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(2deg); }
    20% { transform: rotate(-2deg); }
    30% { transform: rotate(2deg); }
    40% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    color: white;
    text-align: center;
    word-spacing: 10px;
    opacity: 0.7;
}