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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, #a8e6cf 0%, #88d8a8 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    width: 100%;
    max-width: 600px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

#back-btn {
    text-decoration: none;
    color: #2d3436;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.5);
}

#stars { font-size: 1.3rem; }

#farm-canvas {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 16px;
    display: block;
    touch-action: none;
}

.hidden { display: none !important; }

#overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    background: rgba(0,0,0,0.3);
}

#overlay-content {
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    text-align: center;
}

#overlay-message {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2d3436;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@media (max-width: 400px) {
    #overlay-message { font-size: 1.4rem; }
}
