@import url('https://fonts.googleapis.com/css2?family=Luckiest+Guy&family=Outfit:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

.hidden {
    display: none !important;
}

body {
    background-color: #052205;
    /* Fallback */
    font-family: 'Luckiest Guy', cursive;
    overflow: hidden;
    color: white;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Settings Bar */
#settings-bar {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 100;
    pointer-events: auto;
}

.icon-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #ffcc0066;
    color: #ffcc00;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 204, 0, 0.2);
    transform: scale(1.1);
}

.icon-btn.off {
    opacity: 0.5;
    filter: grayscale(1);
}

/* Loading Screen Overhaul */
#loading-screen {
    background: radial-gradient(circle at center, #0a3d0a 0%, #052205 100%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#loading-screen h1 {
    font-size: clamp(2rem, 8vw, 3.5rem);
    color: #ffcc00;
    text-shadow: 0 0 30px rgba(255, 204, 0, 0.4);
    margin-bottom: 30px;
    letter-spacing: 4px;
    text-align: center;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-bar {
    width: 90%;
    max-width: 320px;
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 204, 0, 0.2);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

#progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ffcc00, #fffa85);
    transition: width 0.4s cubic-bezier(0.1, 0.7, 1.0, 0.1);
    box-shadow: 0 0 20px #ffcc00;
    border-radius: 20px;
}

.loader-content::after {
    content: 'Gathering Vines...';
    margin-top: 15px;
    font-size: 1.2rem;
    color: #ffcc0099;
    letter-spacing: 2px;
}

.tap-hint {
    margin-top: 30px;
    font-size: 18px;
    animation: pulse 1.5s infinite;
    color: #ffcc00;
}

h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    color: #ff6b6b;
    /* Fallback, overridden by config */
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #ff6b6b;
}

p {
    font-size: 1.5rem;
    animation: pulse 1.5s infinite;
}

.score-container {
    font-size: 1.2rem;
    margin: 10px 0;
    color: #cccccc;
}

button {
    margin-top: 30px;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-family: 'Outfit', sans-serif;
    font-weight: bold;
    color: white;
    background: #ff6b6b;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    transition: transform 0.1s, box-shadow 0.1s;
}

button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.4);
}

#hud {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 64px;
    letter-spacing: 2px;
    color: #ffcc00;
    text-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 204, 0, 0.5);
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 60px;
    border-radius: 80px;
    border: 3px solid #ffcc0044;
    pointer-events: none;
}

#score {
    font-size: 4rem;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

}

/* How to Play Tips */
.how-to-play {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 204, 0, 0.2);
    border-radius: 15px;
    backdrop-filter: blur(5px);
    pointer-events: none;
}

.tip-box {
    text-align: center;
}

.tip-box h3 {
    font-size: 1rem;
    color: #ffcc00;
    margin-bottom: 8px;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 1px;
}

.tip-box p {
    font-size: 0.9rem;
    margin: 2px 0;
    color: #ffffff;
    animation: none;
    font-family: 'Outfit', sans-serif;
}

@media (max-width: 600px) {
    .how-to-play {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .tip-box h3 {
        font-size: 0.9rem;
        margin-bottom: 4px;
    }
}