html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

body {
    background-color: #5c94fc;
    display: flex;
    justify-content: center;
    align-items: center;
}

#mainScreen {
    text-align: center;
    color: white;
    font-family: Arial, sans-serif;
}

#mainScreen h1 {
    font-size: 64px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#mainScreen p {
    font-size: 24px;
}

#lastScore {
    font-weight: bold;
}

#howToPlayBtn {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 18px;
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#howToPlayBtn:hover {
    background-color: #cc0000;
}

#gameCanvas {
    border: 1px solid black;
    background-color: #5c94fc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.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;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    font-family: Arial, sans-serif;
}

.modal-content h2 {
    margin-top: 0;
    color: #ff4444;
    font-size: 36px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.modal-content ul {
    padding-left: 20px;
    text-align: left;
}

.modal-content p {
    margin: 15px 0;
    font-size: 20px;
    color: #333;
}

#finalScore {
    font-weight: bold;
    color: #ff4444;
    font-size: 36px;
}

#restartPrompt {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

#closeModalBtn {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #444;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#closeModalBtn:hover {
    background-color: #222;
}

#restartBtn {
    padding: 12px 24px;
    font-size: 18px;
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#restartBtn:hover {
    background-color: #cc0000;
}

@media (max-width: 800px) {
    #gameCanvas {
        width: 100%;
        height: auto;
    }
    #mainScreen h1 {
        font-size: 48px;
    }
    #mainScreen p {
        font-size: 18px;
    }
    .modal-content {
        max-width: 90%;
        padding: 20px;
    }
    .modal-content h2 {
        font-size: 28px;
    }
    .modal-content p {
        font-size: 16px;
    }
    #finalScore {
        font-size: 22px;
    }
    #restartPrompt {
        font-size: 14px;
    }
    #restartBtn {
        padding: 10px 20px;
        font-size: 16px;
    }
}

.social-links {
    position: fixed;
    top: 130px;
    left: 130px;
    display: flex;
    flex-direction: column;
    gap: 50px;
    z-index: 100;
    transition: opacity 0.3s;
}
.social-links-right {
    position: fixed;
    top: 130px; 
    right: 130px;
    display: flex;
    flex-direction: column;
    gap: 50px; /* Тот же промежуток */
    z-index: 100;
    transition: opacity 0.3s;
}

#mainScreen:not([style*="display: none"]) ~ .social-links,
#mainScreen:not([style*="display: none"]) ~ .social-links-right {
    opacity: 1;
}

#mainScreen[style*="display: none"] ~ .social-links,
#mainScreen[style*="display: none"] ~ .social-links-right {
    opacity: 0;
    pointer-events: none;
}

.goats-title {
    position: absolute; 
    top:  -70px; 
    left: 50%; 
    transform: translateX(-50%); 
    color: #ffffff; 
    font-family: 'SuperMario', sans-serif; 
    font-size: 48px; 
    text-shadow: 
        -2px -2px 0 #000,  
        2px -2px 0 #000,  
        -2px  2px 0 #000,  
        2px  2px 0 #000; 
    margin: 0; 
}

.frens-title {
    position: absolute;
    top:  -70px; 
    left: 50%; 
    transform: translateX(-50%); 
    color: #ffffff; 
    font-family: 'SuperMario', sans-serif; 
    font-size: 48px; 
    text-shadow: 
        -2px -2px 0 #000,  
        2px -2px 0 #000,  
        -2px  2px 0 #000,  
        2px  2px 0 #000; 
    margin: 0; 
}

.social-link {
    display: block;
    width: 70px;
    height: 70px;
    transition: transform 0.2s;
    border: 5px solid #2545F6;
    border-radius: 5px;
    
}

.social-link:hover {
    transform: scale(1.1);
}

.social-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
