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

:root {
    --soil-dark: #0f172a;
    /* Secondary */
    --soil-light: #2563eb;
    /* Primary */
    --leaf-green: #f59e0b;
    /* Accent */
    --sky-blue: #f8fafc;
    /* bg-alt */
    --text-color: #1e293b;
    /* gray-800 */
}

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

body {
    background-color: #f1f8e9;
    /* Light green tint */
    background-image: radial-gradient(#dcedc8 1px, transparent 1px);
    background-size: 20px 20px;
    font-family: 'Fredoka', sans-serif;
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 700px;
}

/* Header */
.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.back-link {
    text-decoration: none;
    color: var(--soil-dark);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    background: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.back-link:hover {
    transform: translateY(-2px);
}

h1 {
    font-size: 2rem;
    color: var(--soil-dark);
}

.highlight {
    color: var(--leaf-green);
}

/* Info Panel */
#game-info {
    display: flex;
    gap: 20px;
}

.info-panel {
    background: #fff;
    padding: 10px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 0 var(--soil-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.label {
    font-size: 0.8rem;
    color: #9e9e9e;
    font-weight: bold;
}

.value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--soil-dark);
}

#timeDisplay {
    color: #e53935;
    /* Red timer */
    font-family: monospace;
    font-size: 1.4rem;
}

/* Canvas */
.canvas-wrapper {
    position: relative;
    padding: 10px;
    background: var(--soil-dark);
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

canvas {
    display: block;
    background-color: #fff3e0;
    /* Dirt/Sand color */
    border-radius: 5px;
    cursor: pointer;
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

.nature-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(93, 64, 55, 0.2);
    border: 4px solid var(--leaf-green);
    max-width: 400px;
}

.nature-card h2 {
    color: var(--leaf-green);
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.nature-card p {
    color: var(--soil-dark);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.controls-hint {
    margin: 20px 0;
    font-size: 1.5rem;
}

.nature-btn {
    background: var(--leaf-green);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 0 #388e3c;
    transition: transform 0.1s, box-shadow 0.1s;
}

.nature-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #388e3c;
}

.nature-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #388e3c;
}

.game-footer {
    margin-top: 10px;
    color: var(--soil-light);
    font-size: 0.9rem;
}

@media (max-width: 650px) {
    canvas {
        width: 100%;
        height: auto;
    }

    .canvas-wrapper {
        width: 95%;
    }
}
/* Mobile Controls */
.mobile-controls {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.horizontal-controls {
    display: flex;
    gap: 20px;
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 4px 0 var(--soil-light);
    color: var(--soil-dark);
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.1s;
}

.control-btn:active {
    transform: translateY(4px);
    box-shadow: none;
    background: var(--leaf-green);
    color: white;
}

@media (max-width: 768px) {
    .mobile-controls {
        display: flex;
    }
    
    .game-header h1 {
        font-size: 1.5rem;
    }
}

