:root {
    color-scheme: light dark;
}

.special-elite-regular {
    font-family: "Special Elite", system-ui;
    font-weight: 400;
    font-style: normal;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0 10px 8px 20px;

    @media (prefers-color-scheme: dark) {
        background-color: #202020;
        color: #ffffff;
    }
}

#buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

button {
    padding: 8px 14px;
    margin-bottom: 10px;
    border: none;
    border-radius: 6px;
    background-color: #d49a3a;
    color: #1f160d;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

button:active {
    transform: scale(0.96);
}

#buttons button {
    font-family: "Special Elite", sans-serif;

}

#start-btn {
    background-color: #3f8f46;
    color: white;
}

#stop-btn {
    background-color: #9f2f2f;
}

#mode-btn {
    background-color: #4b5fa8;
    color: white;
}

#clear-btn {
    background-color: #d98732;
}

#print-btn {
    background-color: #5f5f5f;
}

#mute-btn {
    background-color: #0c553c;
}

header {
    flex: 0 0 auto;
    font-family: "Special Elite", sans-serif;
    text-align: center;
}

#monkey-gifs {
    flex: 0 0 40%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(55px, 1fr));
    gap: 4px;
    margin-top: 10px;
    overflow: hidden;
}

#monkey-gifs img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.monkey-shake {
    animation: monkeyShake 0.35s ease;
}

.monkey-bounce {
    animation: monkeyBounce 0.45s ease;
}

.monkey-spin {
    animation: monkeySpin 0.5s ease;
}

.monkey-glow {
    animation: monkeyGlow 0.6s ease;
}

@keyframes monkeyShake {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px) rotate(-4deg);
    }
    50% {
        transform: translateX(5px) rotate(4deg);
    }
    75% {
        transform: translateX(-5px) rotate(-4deg);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes monkeyBounce {
    0% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-12px) scale(1.08);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

@keyframes monkeySpin {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes monkeyGlow {
    0% {
        filter: brightness(1);
        box-shadow: none;
    }
    50% {
        filter: brightness(1.5);
        box-shadow: 0 0 14px #d49a3a;
    }
    100% {
        filter: brightness(1);
        box-shadow: none;
    }
}

#output-text {
    flex: 1;
    overflow-y: auto;
    font-family: "Special Elite", sans-serif;
    white-space: pre-wrap;
}

#speed-slider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.slider-label {
    font-size: 14px;
}

@media print {
    body * {
        visibility: hidden;
    }
    
    #output-text,
    #output-text * {
        visibility: visible;
    }
    
    #output-text {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: auto;
        overflow: visible;
    }
}