#end-screen {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.05);
    z-index: 1001;
    backdrop-filter: blur(4px);
}

#end-screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: forwards fadeInScale 0.5s ease;
}

.end-content {
    text-align: center;
    padding: 60px 80px;
    border-radius: 20px;
    user-select: none;
}

.end-content h2 {
    font-size: 72px;
    margin: 0 0 20px 0;
    text-shadow: #000 1px 1px 4px;
    font-family: 'Rye', sans-serif;
    letter-spacing: 10px;
}

#end-screen.win h2 {
    color: #2ecc71;
    text-shadow: 0 0 20px rgba(46, 204, 113, 0.5);
}

#end-screen.lose h2 {
    color: #e74c3c;
    text-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
}

#end-message {
    font-size: 24px;
    text-shadow: #000 1px 1px 4px;
    color: #ecf0f1;
    margin: 0 0 40px 0;
}

.end-buttons {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.end-buttons .game-btn {
    width: 300px;
    padding: 18px 40px;
    font-size: 24px;
    color: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'zabars', sans-serif;
}

.end-buttons .game-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.6);
}

#next-level-btn {
    border-color: rgb(0, 200, 0);
    border: rgb(0, 200, 0) 3px solid;
    background: none;
}

#next-level-btn:hover {
    background: rgb(0, 200, 0);
}

.end-buttons .leave-btn {
    background: none;
    border: rgb(207, 47, 47) 3px solid;
}

.end-buttons .leave-btn:hover {
    background-color: rgb(207, 47, 47);
}

.end-screen-btn {
    padding: 15px 50px;
    width: 300px;
    font-size: 24px;
    color: white;
    background: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Rye', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-shadow: #000 2px 2px 4px;
}

.end-screen-btn .button-icon {
    display: none;
    width: 24px;
    height: 24px;
    transition: opacity 0.3s ease;
    flex-shrink: 0;
}

.end-screen-btn:hover {
    transform: scale(1.05);
}

.end-screen-btn:hover .button-icon {
    display: inline-block;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}