:root {
    --text: #fff8dc;
    --text-secondary: #e8f5d0;

    --accent: #a8d08d;
    --link: #b8dcff;
    --button: #e4f58a;

    --dark: #182116;
    --bg-top: #76b852;
    --bg-bottom: #3f7d3b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family: "JetBrains Mono", sans-serif;
    color: var(--text);

    background:
        linear-gradient(
            180deg,
            var(--bg-top) 0%,
            var(--bg-bottom) 100%
        );

    display: flex;
    flex-direction: column;
    gap: 18px;

    padding: 14px;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;

    font-family: "Geist Pixel", sans-serif;
    color: var(--text);

    text-shadow: 2px 2px 0 var(--dark);
}

p {
    color: var(--text-secondary);
    text-shadow: 1px 1px 0 var(--dark);
    line-height: 1.6;
}

a {
    color: var(--link);
    text-shadow: 1px 1px 0 var(--dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}


/* NAV */

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 12px 16px;

    background: rgba(20, 35, 15, 0.35);
    border: 2px solid rgba(255, 248, 220, 0.15);
    border-radius: 12px;

    box-shadow: 0 4px 0 rgba(24, 33, 22, 0.35);
}

.nav h1 {
    margin: 0;
    font-size: 26px;
}

.title{
    color: inherit;
    text-decoration: none;
}

.nav-contents {
    display: flex;
    align-items: center;
    gap: 14px;
}


/* MAIN */

.main {
    width: fit-content;
    max-width: 700px;

    margin: auto;
    padding: 40px 30px;

    text-align: center;
}


/* BUTTON */

button {
    font-family: "Pixelify Sans", sans-serif;
    font-size: 18px;

    color: var(--dark);
    background: var(--button);

    padding: 12px 24px;

    border: 2px solid var(--dark);
    border-radius: 8px;

    box-shadow: 0 4px 0 var(--dark);

    cursor: pointer;

    transition:
        transform 0.1s ease,
        box-shadow 0.1s ease,
        filter 0.1s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--dark);
    filter: brightness(1.05);
}

button:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 var(--dark);
}

/* OTHER STUFF */

.global-counter {
    font-size: large;
    font-weight: bold;
}

/* ANIMATIONS */

.main {
    animation: fade-in 0.75s ease-out;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

#grass-count {
    display: inline-block;
    transition: transform 0.15s ease;
}

#grass-count.updated {
    transform: scale(1.2);
}

/* CONFETTI */

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 10;
}

.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;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* STREAK + TIMESTAMP */

.info-line {
    font-size: 0.9em;
    opacity: 0.8;
    margin-top: 8px;
}

.streak-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 4px 12px;
    margin-top: 10px;
    font-size: 0.9em;
}

/* GRASS ACTIONS */

.grass-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* RESPONSIVE */

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .nav {
        padding: 10px 12px;
    }

    .nav h1 {
        font-size: 22px;
    }

    .main {
        padding: 30px 16px;
    }

    .main h1 {
        font-size: 1.6em;
    }

    button {
        font-size: 16px;
        padding: 10px 20px;
    }

    .global-counter {
        font-size: 1em;
    }
}