@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background: #E3E6DA;
    color: #2C2C2C;
    text-align: center;
    padding: 1em;
}

body, h1, h2, h3, p {
    font-family: 'Poppins', sans-serif;
    text-align: center;
}

/* ✅ Green Box Styling Applied via Class */
.green-box {
    background: #C5D1C6; /* Light green background */
    border-radius: 8px;
    padding: 15px;
    margin: 15px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 18px;
    font-weight: bold;
    color: #2C2C2C;
    text-align: center;
}

/* ✅ Ensure Cards are in a Row */
.content-container {
    display: flex;
    flex-wrap: wrap;  /* Allows wrapping if needed */
    justify-content: center; /* Centers content */
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
}

/* ✅ Default: Cards Are Flexible but Enforce a 2-2 Split */
.function-card, .enemy-card {
    flex: 1 1 calc(50% - 10px); /* Enforce two cards per row */
    max-width: 180px; /* Prevents oversizing */
    min-width: 120px; /* Ensures minimum width */
    aspect-ratio: 1 / 1.3; /* Keeps shape */
    height: auto; /* Default height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 8px;
    padding: 10px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.2);
}

/* ✅ Force 2-2 Split & Reduce Height When Wrapped */
@media (max-width: 700px) {
    .function-card, .enemy-card {
        flex: 1 1 48%; /* Ensures exactly two cards per row */
        #max-width: 48%; /* Prevents stretching to 3 cards */
        max-height: 100px; /* Reduce height when wrapping */
        min-width: 100px; /* Reduce height when wrapping */
    }
}



/* ✅ Function Cards */
.function-card {
    background: #FDF6C1;
    border: 3px solid #C8934D;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease;
}

/* ✅ Enemy Cards */
.enemy-card {
    background: #FFD9D9;
    border: 2px solid #A52A2A;
}


/* ✅ 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);
}

/* ✅ Wave-Turn Label Inside Current Wave Box */
#current-wave-label {
    background: transparent;
    padding: 10px 0;
}

/* ✅ Function & Enemy Cards */
.function-card, .enemy-card {
    flex: 1 1 calc(25% - 10px);
    max-width: 25%;
    aspect-ratio: 1 / 1.3;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.2);
}

.function-card {
    background: #FDF6C1;
    border: 3px solid #C8934D;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease;
}

.function-card:hover {
    transform: translateY(-5px);
    background: #FFF8C9;
    box-shadow: 4px 8px 12px rgba(0, 0, 0, 0.25);
}

.enemy-card {
    background: #FFD9D9;
    border: 2px solid #A52A2A;
}

.threat-card {
    background: #FF4C4C;
    border: 2px solid #8B0000;
}

.neutralized-card {
    background: #4CAF50;
    border: 2px solid #2E7D32;
}

/* ✅ Wave Box (For Grouping Past Waves) */
.wave-box {
    border: 2px solid #5A7A58;
    border-radius: 10px;
    padding: 12px;
    margin-top: 15px;
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.1);
}

/* ✅ Prevent Text Selection on Cards */
.function-card, .enemy-card {
    user-select: none;
}

/* ✅ Responsive Title */
.responsive-title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ✅ Shop Modal - Improve Styling */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75); /* Darker overlay */
    justify-content: center;
    align-items: center;
}

/* ✅ Modal Content - Styled More In-Game */
.modal-content {
    background: #D4C89E; /* Matching game aesthetic */
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    border: 4px solid #8B6F47; /* Darker golden border */
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.4);
}

/* ✅ Shop Title */
.modal-content h2 {
    font-size: 24px;
    font-weight: bold;
    color: #4C3B2A; /* Dark brown for fantasy look */
    margin-bottom: 10px;
}

/* ✅ New Function Card is Centered */
#shop-function-card {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px auto;
    width: 160px; /* Match game function card size */
    height: 200px;
}

/* ✅ Replace Options Layout */
#replace-options {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

/* ✅ Better Skip Button */
#skip-button {
    background: #B85C38; /* Dark red - fits game theme */
    color: white;
    border: 2px solid #8B3A23; /* Darker border */
    padding: 10px 20px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    margin-top: 15px;
    transition: background 0.3s, transform 0.2s;
}

#skip-button:hover {
    background: #923D26;
    transform: scale(1.05);
}
