@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #2d5016 0%, #4a7c2c 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    height: 100vh;
    /* Full viewport height */
    width: 100vw;
    /* Full viewport width */
    overflow: hidden;
    /* Prevent scrolling */
}

#game-container {
    position: relative;
    width: 1000px;
    height: 800px;

    /* Responsive Scaling */
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1000/800;

    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.1),
        0 10px 20px rgba(0, 0, 0, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px);
    overflow: hidden;

    /* Center in flexing parent */
    margin: auto;
}

/* Top UI Bar */
.top-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: rgba(20, 40, 10, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.ui-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ui-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.ui-btn span {
    font-size: 1.1rem;
}

.score-display {
    margin-left: auto;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

#scoreValue {
    color: #ffd700;
    font-size: 1.2rem;
    margin-left: 0.5rem;
}

.lives-display {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.heart {
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.heart.lost {
    opacity: 0.2;
    filter: grayscale(100%);
}

/* Game Canvas */
#gameCanvas {
    flex: 1;
    background: #6b8e6b;
    cursor: pointer;
    image-rendering: pixelated;
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    animation: fadeIn 0.3s ease;
}

.overlay.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.overlay-content {
    background: linear-gradient(135deg, rgba(30, 50, 20, 0.95), rgba(50, 80, 40, 0.95));
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.overlay-content h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.overlay-content p {
    color: #e0e0e0;
    font-size: 1.3rem;
    margin-bottom: 2rem;
}

.instructions {
    text-align: left;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.instructions p {
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 1.1rem;
}

.cta-btn {
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #ff8a00, #e52e71);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(229, 46, 113, 0.4);
}

.cta-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 40px rgba(229, 46, 113, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .top-bar {
        flex-wrap: wrap;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .ui-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .score-display,
    .lives-display {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}