/* Common styles for the game */

/* Base body styles */
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-size: 0.9em;
    font-weight: 800;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    /* background-color: rgb(59, 62, 71); */
    background: linear-gradient(to right, #12182a 0%, #360a0f 100%);
    user-select: none;
}


.paper_panel::after {
    content: "";
    position: absolute; inset: 0;
    background: url('/sprites/paper-texture.jpg') center/1000px repeat;
    mix-blend-mode: multiply;
    opacity: 0.5;
    pointer-events: none;
}

.paper_panel_light::after {
    content: "";
    position: absolute; inset: 0;
    background: url('/sprites/paper-texture.jpg') center/2000px repeat;
    mix-blend-mode: multiply;
    opacity: 0.1;
    pointer-events: none;
}

/* Common button styles */
button {
    padding: 0.5em 1em;
    border-radius: 0.5em;
    border: 1px solid #c6c6c6;
    font-family: inherit;
    cursor: pointer;
}

/* Common utility classes */
.image_contained {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.microbutton {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box;
    border: 1px solid grey;
    border-radius: 5px;
    transition-duration: 0.1s;
}

.microbutton:hover {
    background-color: rgb(255, 255, 255, 0.1);
    width: 65%;
}

.green_string {
    background-color: rgba(0, 160, 50, 0.35);
    border-radius: 6px;
    padding: 1px;
}

.red_removed_string {
    background-color: rgba(255, 30, 30, 0.35);
    border-radius: 6px;
    padding: 1px;
    text-decoration: line-through;
}

/* Common animations */
@keyframes pulse {
    0% {
        transform: scale(0.9);
    }
    50% {
        transform: scale(1);
    }
    100% {
        transform: scale(0.9);
    }
}

@keyframes shake-light {
    0%   { transform: translate3d(0px, 0px, 0) rotate(0deg); }
    20%  { transform: translate3d(-0.5px, 0.5px, 0) rotate(-0.2deg); }
    40%  { transform: translate3d(-0.5px, -0.5px, 0) rotate(0.2deg); }
    60%  { transform: translate3d(0.5px, 0.5px, 0) rotate(-0.2deg); }
    80%  { transform: translate3d(0.5px, -0.5px, 0) rotate(0.2deg); }
    100% { transform: translate3d(0px, 0px, 0) rotate(0deg); }
}

@keyframes shake-medium {
    0%   { transform: translate3d(0px, 0px, 0) rotate(0deg); }
    20%  { transform: translate3d(-1.5px, 1.5px, 0) rotate(-0.6deg); }
    40%  { transform: translate3d(-1.5px, -1.5px, 0) rotate(0.6deg); }
    60%  { transform: translate3d(1.5px, 1.5px, 0) rotate(-0.6deg); }
    80%  { transform: translate3d(1.5px, -1.5px, 0) rotate(0.6deg); }
    100% { transform: translate3d(0px, 0px, 0) rotate(0deg); }
}

@keyframes shake-heavy {
    0%   { transform: translate3d(0px, 0px, 0) rotate(0deg); }
    20%  { transform: translate3d(-2.5px, 2.5px, 0) rotate(-1deg); }
    40%  { transform: translate3d(-2.5px, -2.5px, 0) rotate(1deg); }
    60%  { transform: translate3d(2.5px, 2.5px, 0) rotate(-1deg); }
    80%  { transform: translate3d(2.5px, -2.5px, 0) rotate(1deg); }
    100% { transform: translate3d(0px, 0px, 0) rotate(0deg); }
}

.shake-light {
    will-change: transform;
    animation: shake-light 0.1s ease-out;
}

.shake-medium {
    will-change: transform;
    animation: shake-medium 0.2s ease-out;
}

.shake-heavy {
    will-change: transform;
    animation: shake-heavy 0.2s ease-out;
}

/* Common button styles */
.buy_button {
    width: 85%;
    height: 70%;
    padding: 2%;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.1);
    transition-duration: 0.1s;
    animation: pulse 2s infinite;
}

.buy_button.unavailable {
    animation: none;
}

.buy_button:not(.unavailable):hover {
    width: 95%;
    height: 80%;
    background-color: rgba(0, 0, 0, 0.2);
    animation: none;
}

.upgrade_button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 90%;
    height: 90%;
    transition-duration: 0.1s;
}

.upgrade_button:hover {
    width: 100%;
    height: 100%;
}