@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

body, h1, h2, h3, p {
    font-family: 'Poppins', sans-serif;
    background: #E3E6DA;
    color: #2C2C2C;
    text-align: center;
    padding: 1em;
}

/* Stats Bar */
#stats-bar {
    background: #C5D1C6;
    padding: 10px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

/* ✅ Ensure Cards Fit 4 in a Row on Small Screens */
.card-container, .enemy-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

/* ✅ Adjust Card Size for Small Screens */
.card {
    width: 160px;
    height: 180px;
    background: #D2B48C; /* Light brown */
    border: 2px solid #8B5A2B; /* Dark brown */
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
    padding: 15px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
}

/* ✅ Shrink Cards to Fit 4 in a Row on Small Screens */
@media (max-width: 768px) {
    .card {
        width: 22%;  /* Allow 4 per row */
        height: auto; /* Auto height to maintain ratio */
        font-size: 14px; /* Smaller text for better readability */
        padding: 10px;
    }
}

/* ✅ Shrink Further on Extra Small Screens */
@media (max-width: 480px) {
    .card {
        width: 23%;  /* Ensure 4 per row on smaller devices */
        font-size: 12px;
        padding: 8px;
    }
}

/* ✅ Function Card Styling */
.function-card {
    background: #F8E8A6;
    border: 20px solid #C19A6B;
    text-align: center;
}

/* ✅ Make Function Cards Responsive */
@media (max-width: 768px) {
    .function-card {
        width: 100%; /* Ensure they fit inside the grid */
        height: auto;
        font-size: 14px;
        padding: 10px;
    }
}

/* ✅ Extra Small Screens */
@media (max-width: 480px) {
    .function-card {
        font-size: 12px;
        padding: 8px;
    }
}

/* Enemy Cards */
.enemy-card {
    background: #FFD9D9; /* Light red when alive (threat) */
    border: 2px solid #A52A2A; /* Dark red border */
}

/* Red for Threat Enemies */
.threat-card {
    background: #FF4C4C; /* Strong red */
    border: 2px solid #8B0000;
}

/* Green for Neutralized Enemies */
.neutralized-card {
    background: #4CAF50; /* Green */
    border: 2px solid #2E7D32;
}

/* ✅ Ensure Enemies Display in One Row */
.enemy-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto; /* Allows horizontal scrolling if needed */
    padding: 10px;
}

/* ✅ Ensure Functions Stay in One Row by Default */
#player-hand {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

/* ✅ Shrink Function Cards for Small Screens */
@media (max-width: 768px) {
    #player-hand {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* 2x2 Grid */
        gap: 10px;
        justify-content: center;
        align-items: center;
    }
}

/* ✅ Ensure 2x2 Layout on Extra Small Screens */
@media (max-width: 480px) {
    #player-hand {
        grid-template-columns: repeat(2, 1fr); /* 2 columns */
    }
}


/* Large HP Display */
.enemy-hp {
    font-size: 40px;
    font-weight: bold;
    color: #043927;
}

/* Smooth Fade-In */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
