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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #fff;
    overflow-x: hidden;
    background-color: #000;
}

.earth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.earth-image {
    max-width: 80%;
    max-height: 80%;
    animation: rotate 60s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    background-color: rgba(0, 0, 0, 0.6);
}

section {
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    max-width: 800px;
    width: 100%;
}

h1, h2 {
    margin-bottom: 1rem;
    color: #00ffff;
}

#begin-button {
    background-color: #0077be;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 1.2rem;
}

#begin-button:hover {
    background-color: #005fa3;
}

.board {
    display: inline-grid;
    grid-template-columns: repeat(7, minmax(30px, 50px));
    grid-gap: 5px;
    background-color: #0066cc;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 1rem;
    max-width: 100%;
}

.cell {
    width: 100%;
    padding-bottom: 100%; /* Creates a square aspect ratio */
    background-color: white;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.cell::after {
    content: '';
    position: absolute;
    top: 2%;
    left: 2%;
    width: 96%;
    height: 96%;
    border-radius: 50%;
}

.yellow::after {
    background-color: #ffdc00;
}

.piece {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.red {
    background-color: #ff4136;
}

@keyframes dropPiece {
    0% { transform: translateY(-500%); }
    70% { transform: translateY(10%); }
    85% { transform: translateY(-5%); }
    100% { transform: translateY(0); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15%); }
}

.piece {
    position: absolute;
    top: 2.5%;
    left: 2.5%;
    width: 95%;
    height: 95%;
    border-radius: 50%;
    animation: dropPiece 0.5s ease-in-out;
}

.piece.dropped {
    animation: bounce 0.3s ease-in-out 0.5s;
}

#message {
    margin: 1rem 0;
    font-weight: bold;
}

#reset, #difficultySelect {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    font-size: 1em;
    background-color: #0066cc;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

footer {
    text-align: center;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    width: 100%;
}

@media (max-width: 768px) {
    .board {
        grid-template-columns: repeat(7, minmax(25px, 40px));
    }

    #game h2 {
        font-size: 1.2rem;
    }

    #message {
        font-size: 0.9rem;
    }

    #reset, #difficultySelect {
        font-size: 0.9rem;
    }
}
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    padding: 0 1rem;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

#difficulty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#reset, #difficultySelect {
    margin-top: 0;
}
