body {
    font-family: 'Inter', sans-serif;
    background-image: url('../images/maps/symbiotic-surface.png');
    background-size: cover;
    background-position: center;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: -1;
}

#game-container {
    text-align: center;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 20px;
}

#game-mode-selection button {
    padding: 15px 30px;
    font-size: 1.2em;
    cursor: pointer;
    border: none;
    border-radius: 10px;
    background-color: #ffc107;
    color: #000;
    font-weight: bold;
    margin: 10px;
}

#game-info {
    margin-bottom: 15px;
    font-size: 1.5em;
    font-weight: bold;
}

#character-selection {
    margin-bottom: 20px;
}

#character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    max-width: 800px;
    margin: 0 auto;
}

.character-card {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
}

.character-card:hover {
    transform: scale(1.05);
    border-color: #ffc107;
}

.character-card.selected {
    border-color: #28a745;
    box-shadow: 0 0 10px #28a745;
}

.character-card img {
    width: 100%;
    height: auto;
    display: block;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(7, 80px);
    grid-template-rows: repeat(6, 80px);
    gap: 8px;
    background: linear-gradient(145deg, #1a2a6c, #b21f1f, #fdbb2d);
    border: 5px solid #111;
    padding: 10px;
    border-radius: 20px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

@keyframes cell-appear {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.board-cell {
    width: 80px;
    height: 80px;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
    animation: cell-appear 0.5s ease-out forwards;
    opacity: 0;
}

.board-cell:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

@keyframes drop-piece {
    from {
        transform: translateY(-300px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.board-cell.player1 {
    background-size: cover;
    background-position: center;
}

.board-cell.player2 {
    background-size: cover;
    background-position: center;
}

.dropping {
    animation: drop-piece 0.5s ease-out forwards;
}

#reset-button {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #ffc107;
    color: #000;
    font-weight: bold;
}

#how-to-play {
    margin-top: 2rem;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 193, 7, 0.2);
    text-align: center;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

#how-to-play h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #ffc107;
}

#how-to-play p {
    margin: 0;
    line-height: 1.6;
}

#how-to-play strong {
    color: #fff;
    font-weight: 700;
}

@media (max-width: 768px) {
    #game-board {
        grid-template-columns: repeat(7, 60px);
        grid-template-rows: repeat(6, 60px);
        gap: 5px;
        padding: 5px;
    }

    .board-cell {
        width: 60px;
        height: 60px;
    }

    #character-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

@media (max-width: 480px) {
    #game-board {
        grid-template-columns: repeat(7, 40px);
        grid-template-rows: repeat(6, 40px);
    }

    .board-cell {
        width: 40px;
        height: 40px;
    }

    h1 {
        font-size: 2em;
    }

    #game-info {
        font-size: 1.2em;
    }

    #winner-message {
        font-size: 1.8em;
    }

    #play-again-button {
        padding: 10px 20px;
        font-size: 1em;
    }
}

.hidden {
    display: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #1f1f1f;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#winner-message {
    font-size: 2.5em;
    margin-bottom: 20px;
}

#play-again-button {
    padding: 15px 30px;
    font-size: 1.2em;
    cursor: pointer;
    border: none;
    border-radius: 10px;
    background-color: #ffc107;
    color: #000;
    font-weight: bold;
}
