body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align items to the top */
    min-height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
    color: #333;
    flex-wrap: wrap; /* Allow items to wrap to the next line on smaller screens */
    gap: 30px; /* Space between game area and shop */
    padding: 20px; /* Add some padding around the content */
    box-sizing: border-box;
}

.main-game-area { /* New container for game elements */
    text-align: center;
    background-color: #fff;
    padding: 30px 50px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid #ccc;
    max-width: 400px; /* Limit width for the game panel */
    width: 100%; /* Take full width when wrapped */
    box-sizing: border-box;
    flex-grow: 1; /* Allow it to grow to fill space */
}

h1 {
    color: #4CAF50; /* A nice green for a game title */
    margin-bottom: 20px;
}

.cookie-count, .cps-display {
    font-size: 1.5em; /* Slightly smaller for multiple lines */
    font-weight: bold;
    margin-bottom: 10px; /* Reduced margin */
    color: #663300; /* Cookie-ish brown */
}

#oreo {
    width: 250px;
    height: 250px;
    cursor: pointer;
    transition: transform 0.1s ease-out; /* Smooth press effect */
    user-select: none; /* Prevent selection of the image */
    margin: 20px auto; /* Center the cookie image */
    display: block; /* Ensure margin auto works */
}

#oreo:active {
    transform: scale(0.95); /* Shrink on click */
}

/* Optional: Animation for clicking, using GSAP in JS */
.cookie-popup {
    position: absolute;
    font-size: 2em;
    color: #000; /* Black for Oreo filling */
    pointer-events: none;
    opacity: 0;
    transform: translateY(0);
    user-select: none;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.7);
}

.shop-container {
    background-color: #fff; /* Match main game area background */
    padding: 30px; /* Consistent padding */
    border-radius: 15px; /* Consistent border radius */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); /* Consistent shadow */
    border: 2px solid #ccc; /* Consistent border */
    max-width: 350px; /* Limit width for the shop panel */
    width: 100%; /* Take full width when wrapped */
    box-sizing: border-box;
    flex-grow: 1; /* Allow it to grow to fill space */
}

.shop-container h2 {
    color: #007bff; /* Blue for shop title */
    margin-bottom: 20px;
}

/* Style for placeholder dots in advanced number formatting */
.placeholder-dots {
    font-size: 0.7em;
    vertical-align: super; /* Align dots slightly higher */
    margin: 0 2px; /* Small horizontal spacing */
}

.shop-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.shop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.shop-item-info {
    text-align: left;
    flex-grow: 1;
    padding-right: 10px;
}

.shop-item-info h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1.2em;
}

.shop-item-info p {
    margin: 0;
    font-size: 0.9em;
    color: #666;
}

.shop-item-cost {
    font-weight: bold;
    color: #e44d26; /* Red-orange for cost */
    font-size: 1.1em;
    margin-right: 15px;
    white-space: nowrap; /* Prevent cost from wrapping */
}

.shop-item button {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.shop-item button:hover:not(:disabled) {
    background-color: #45a049;
    transform: translateY(-2px);
}

.shop-item button:active:not(:disabled) {
    transform: scale(0.98);
}

.shop-item button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Rebirth Section Styles */
.rebirth-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid #ccc;
    max-width: 400px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    margin-top: 30px; /* Space from shop or game area when wrapped */
    flex-grow: 1;
}

.rebirth-container h2 {
    color: #9C27B0; /* A distinct purple color */
    margin-bottom: 15px;
}

.rebirth-container p {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 20px;
}

#rebirthCostDisplay {
    font-weight: bold;
    color: #333; /* Default color */
    margin-bottom: 15px;
}

#rebirthButton {
    background-color: #9C27B0; /* Purple button */
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px 25px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    font-weight: bold;
}

#rebirthButton:hover:not(:disabled) {
    background-color: #7B1FA2;
    transform: translateY(-2px);
}

#rebirthButton:active:not(:disabled) {
    transform: scale(0.98);
}

#rebirthButton:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        flex-direction: column; /* Stack vertically on small screens */
        align-items: center; /* Center items when stacked */
    }
    .main-game-area, .shop-container, .rebirth-container {
        max-width: 90%; /* Adjust width for small screens */
    }
    .rebirth-container {
        margin-top: 20px; /* Less margin when stacked */
    }
}