body {
    font-family: sans-serif;
    max-width: 600px;
    margin: auto;
    text-align: center;
    padding: 1rem;
    background-color: #121212;
    color: #eee;
}

input {
    padding: 0.5rem;
    width: 60%;
    margin: 0.5rem 0;
    font-size: 1rem;
    border-radius: 6px;
    border: none;
    outline: none;
    box-shadow: 0 0 5px #444;
    background-color: #222;
    color: #eee;
}

#suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #222;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    max-height: 320px;
    overflow-y: auto;
    width: 100%;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    cursor: pointer;
    gap: 10px;
    color: #eee;
    user-select: none;
}

.suggestion-item:hover {
    background-color: #333;
}

.suggestion-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

#guesses {
    margin-top: 5px;
    display: flex;
    gap: 10px;
}

.guess-result {
    max-width: 500px;
    margin: 5px auto;
    padding: 0.5rem;
    border: 1px solid #555;
    background-color: #222;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 6px;
    user-select: none;
}

.guess-card {
    display: flex;
    align-items: center;
}

.guess-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
}

.stats-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-box {
    opacity: 0;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    color: white;
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    box-shadow: 0 0 10px rgb(0, 0, 0, 1);
    text-align: center;
    line-height: 1.2;
    animation: fadeIn 1s ease forwards;
}

@keyframes glowCorrect {
    from {
        opacity: 0;
        transform: translateY(-5px);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    }
}

.stat-box.correct {
    background-color: #4caf50;
    animation: glowCorrect 1s ease forwards;
}

.stat-box.wrong {
    background-color: #f44336;
}

.stat-box.arrow-up,
.stat-box.arrow-down {
    background-color: #f44336;
}

.stat-box.partial {
    background-color: orange;
}

#guess-counter {
    margin-top: 6px;
    margin-bottom: 10px;
    font-weight: bold;
    color: #ccc;
}

#score-counter {
    font-weight: bold;
    margin-bottom: 5px;
}

#highscore-counter {
    font-weight: bold;
    margin-bottom: 10px;
}

.header-row .stat-label {
    text-align: center;
    font-size: 0.85rem;
    color: #aaa;
}

.stat-label {
    font-weight: bold;
    color: #aaa;
    font-size: 0.85rem;
    user-select: none;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background-color: #222;
    color: #eee;
    padding: 2rem;
    padding-top: 0px;
    border-radius: 8px;
    text-align: center;
    max-width: 90%;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
    animation: zoomIn 0.5s ease forwards;
    perspective: 1000px;
}

@keyframes zoomIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

#modal-image-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
    margin: auto;
    margin-bottom: 100px;
    animation: spinY 4.5s linear infinite;
    transform-style: preserve-3d;
    perspective: 1000px;
}

#modal-image,
#modal-image-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 150px;
    backface-visibility: hidden;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

#modal-image-backdrop {
    transform: rotateY(180deg);
    z-index: 1;
}

#modal-image {
    z-index: 2;
}

@keyframes spinY {
    from {
        transform: rotateY(0deg);
    }

    to {
        transform: rotateY(360deg);
    }
}

.modal button {
    padding: 0.5rem 1rem;
    margin: 0 0.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    background-color: #444;
    color: white;
    cursor: pointer;
}

.modal button:hover {
    background-color: #666;
}

.hidden {
    display: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 0.5rem 1.5rem;
    justify-content: center;
    font-size: 1rem;
    text-align: left;
}

.stats-grid .stat-label {
    font-weight: bold;
    font-size: 1rem;
    color: #ccc;
}

.stats-grid .stat-value {
    color: #fff;
}

.time-taken {
    font-size: 1rem;
    color: #333;
    text-align: center;
}
