/*
  Property of Peliah
  GitHub: https://github.com/Peliah
  Description: Neobrutalism-style Color Game.
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Mono', monospace;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.loading-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeOut 1s ease-in-out forwards;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #000;
    border-top: 4px solid #2c3e50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}

.game-container {
    background-color: #fff;
    border: 4px solid #000;
    border-radius: 20px;
    box-shadow: 8px 8px 0 #000;
    padding: 20px;
    width: min(100%, 500px);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out 1s forwards;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-container:hover {
    transform: translate(-4px, -4px);
    box-shadow: 12px 12px 0 #000;
}

.game-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    font-family: 'Poppins', sans-serif;
    color: #2c3e50;
}

.game-instructions {
    font-size: 16px;
    color: #555;
}

.color-box {
    width: 100%;
    height: 150px;
    margin: 0 auto 20px;
    border: 4px solid #000;
    border-radius: 10px;
    background-color: #fff;
}

.separator {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
    border: 4px solid #000;
    border-radius: 10px;
    background-color: #fff;
    padding: 10px 10px;
}

.color-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    margin-top: 40px;
}

.color-option {
    width: 100%;
    aspect-ratio: 1.1;
    border: 3px solid #000;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.color-option:hover {
    transform: translateY(-2px);
    box-shadow: 3px 3px 0 #000;
}

.game-status {
    font-size: 16px;
    color: #555;
}

.score {
    font-size: 16px;
    color: #555;
}

.btn-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
}

.instructions {
    background-color: #2c3e50;
    color: #fff;
    border: none;
    padding: 10px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.instructions:hover {
    background-color: #000;
    transform: translateY(-2px);
}

.instructions span {
    border-radius: 50%;
    border: 2px solid #f4f4f4;
    padding: 0 5px;
}

.new-game-button {
    background-color: #2c3e50;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.new-game-button:hover {
    background-color: #000;
    transform: translateY(-2px);
}

.toast {
    position: fixed;
    bottom: 40%;
    right: 20px;
    background-color: #fff;
    border: 3px solid #000;
    border-radius: 10px;
    box-shadow: 4px 4px 0 #000;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(200%);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    z-index: 1000;
}

.toast div {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
}

.toast-message {
    font-size: 14px;
    color: #000;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    font-weight: bold;
    color: #000;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #2c3e50;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff;
    border: 4px solid #000;
    border-radius: 20px;
    box-shadow: 8px 8px 0 #000;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    position: relative;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    font-weight: bold;
    color: #000;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #2c3e50;
}

.modal h2 {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    font-family: 'Poppins', sans-serif;
    color: #2c3e50;
}

.modal p {
    font-size: 16px;
    color: #555;
    line-height: 1.5;
}