body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative; /* For background emojis */
    overflow: hidden; /* To contain background */
}

/* Background Emojis */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.5; /* Adjust opacity as needed */
    font-size: 30em; /* Even larger font size for xxxxl emojis */
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    line-height: 1; /* Prevent extra space around emojis */
}

body.bg-splash::before {
    content: '🥬 🎰 🎲';
}

body.bg-menu::before {
    content: '🥬 👩‍🌾 🌱';
}

body.bg-scratch::before {
    content: '🌱 🥬 👩‍🌾';
}

body.bg-slots::before {
    content: '🎰 🥬 👩‍🌾';
}

body.bg-monte::before {
    content: '🎲 🥬 🌱';
}

.container {
    text-align: center;
    background-color: white;
    padding: 30px 20px 20px 20px; /* Added top padding to avoid balance overlap */
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 80%;
    max-width: 800px;
    position: relative;
}

.balance-bar {
    position: absolute;
    top: 5px; /* Adjusted top position */
    left: 10px;
    font-size: 1.2em; /* Slightly reduced font size */
    color: #2ecc71;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 10; /* Ensure it's above loading bar */
}

.loading {
    position: absolute;
    top: 30px; /* Adjusted to be below balance */
    left: 10px;
    width: 150px; /* Adjust width as needed */
    height: 12px; /* Slightly increased height */
    background-color: #f0f0f0; /* Light gray background */
    border-radius: 6px;
    overflow: hidden;
    z-index: 5;
    border: 1px solid #ccc; /* Added a border */
}

.loading-bar {
    width: 0;
    height: 100%;
    background-color: #27ae60; /* More visible green */
    animation: loading 1.2s infinite; /* Slightly faster animation */
    border-radius: 6px;
}

.loading-text {
    position: absolute;
    top: 45px; /* Adjust position below loading bar */
    left: 10px;
    font-size: 0.8em;
    color: #555;
    z-index: 5;
}

@keyframes loading {
    0% { width: 0; }
    50% { width: 100%; }
    100% { width: 0; }
}

h1 {
    font-size: 2.5em;
    margin: 10px 0;
    color: #2ecc71;
}

h2 {
    font-size: 1.8em;
    margin: 10px 0;
    color: #f1c40f;
}

button {
    font-size: 1.5em;
    padding: 10px 20px;
    margin: 5px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background-color: #2980b9;
}

input {
    font-size: 1.5em;
    padding: 10px;
    margin: 10px;
    width: 80%;
    max-width: 400px;
    border: 2px solid #3498db;
    border-radius: 5px;
}

.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hidden {
    display: none;
}

.game {
    margin-top: 20px;
    font-size: 2em;
    display: grid;
    gap: 10px;
}

.game span {
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-9 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.grid-12 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(4, 1fr); } /* Updated to 3 columns */
.grid-6 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

.scratch-spot, .monte-card {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-size: 2em;
    transition: background-color 0.3s;
}

.scratch-spot.revealed {
    background-color: #fff; /* Style for revealed spot */
}

.monte-card:hover {
    background-color: #fff;
}

.kale-card {
    color: green; /* Highlight the kale card if needed */
}

.dialogue {
    margin-top: 20px;
    font-size: 1.5em;
    color: #333;
    min-height: 2em;
}

.coming-soon {
    background-color: #999; /* Grayed out color */
    cursor: not-allowed; /* Indicate it's not clickable */
    color: #ddd;
}

.coming-soon:hover {
    background-color: #999; /* Keep the gray color on hover */
}
