:root {
    --primary-color: #6a994e; /* Green */
    --secondary-color: #f7a325; /* Orange */
    --accent-color: #ffda79; /* Light Yellow */
    --sand-color: #f0e68c; /* Khaki for sand */
    --digging-bg: #d2b48c; /* Tan for under sand */
    --button-bg: #8c5d33; /* Brown for buttons */
    --button-text: #ffffff;
    --text-color: #333;
    --progress-bg: #ddd;
    --progress-fill: #4CAF50; /* Green for progress */
}

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background-color: #e0f2f7; /* Light blue sky */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: var(--text-color);
    overflow: hidden; /* Prevent scrollbars */
}

.game-container {
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    padding: 30px;
    text-align: center;
    max-width: 1000px;
    width: 95%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

h1 {
    color: var(--primary-color);
    font-size: 3em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 0 var(--secondary-color);
}

.top-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.progress-bar-container {
    width: 80%;
    max-width: 400px;
    background-color: var(--progress-bg);
    border-radius: 15px;
    height: 30px;
    position: relative;
    overflow: hidden;
    border: 3px solid var(--primary-color);
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background-color: var(--progress-fill);
    border-radius: 12px;
    transition: width 0.3s ease-out;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    box-sizing: border-box;
}

.progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 30px;
    color: var(--text-color);
    font-weight: bold;
    font-size: 1.1em;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.7);
}

.game-area {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.digging-area {
    position: relative;
    width: 550px; /* Fixed width for digging canvas */
    height: 400px; /* Fixed height for digging canvas */
    border: 5px solid var(--primary-color);
    border-radius: 15px;
    overflow: hidden;
    background-color: var(--digging-bg); /* Color seen under sand */
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

#sand-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: url('dino_brush.png') 15 15, crosshair; /* Custom cursor */
}

.bone-piece {
    position: absolute;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none; /* Bones should not intercept mouse events */
    image-rendering: pixelated; /* For crisp cartoon edges if images are pixel art */
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.display-area {
    width: 350px; /* Fixed width for display */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skeleton-display {
    min-height: 250px;
    background-color: #f8f8f8;
    border: 3px dashed var(--secondary-color);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.1);
}

#complete-skeleton-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.8s ease-in-out;
    opacity: 0; /* Hidden initially, shown via JS */
}

#complete-skeleton-img.visible {
    opacity: 1;
}

.fact-display {
    min-height: 120px;
    background-color: var(--accent-color);
    border: 3px solid var(--secondary-color);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#dino-name {
    color: var(--primary-color);
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 10px;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.7);
}

#dino-fact {
    font-size: 1.2em;
    line-height: 1.4;
    color: var(--text-color);
    margin: 0;
}

.controls {
    margin-top: 20px;
}

#reset-button {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 0 var(--secondary-color);
    transition: all 0.1s ease-out;
    outline: none;
}

#reset-button:hover {
    background-color: #a06e4a;
    box-shadow: 0 3px 0 var(--secondary-color);
    transform: translateY(2px);
}

#reset-button:active {
    background-color: #7b4f2c;
    box-shadow: 0 0 0 var(--secondary-color);
    transform: translateY(5px);
}

.hidden {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 990px) {
    .game-area {
        flex-direction: column;
        align-items: center;
    }
    .digging-area, .display-area {
        width: 90%;
        max-width: 550px;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 2.2em;
    }
    .game-container {
        padding: 20px;
        gap: 15px;
    }
    .digging-area {
        width: 100%;
        height: 350px;
    }
    .progress-bar-container {
        width: 95%;
    }
    #reset-button {
        padding: 12px 25px;
        font-size: 1.2em;
    }
    #dino-name {
        font-size: 1.5em;
    }
    #dino-fact {
        font-size: 1em;
    }
}

