body {
    margin: 0;
    overflow: hidden;
    background-color: #333;
    font-family: 'Roboto', sans-serif;
}

#title {
    position: absolute;
    top: 12px;
    left: 12px;
    color: #ffffff;
    font-weight: 700;
    font-family: 'Roboto', sans-serif;
    font-size: 20px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
    pointer-events: none;
    z-index: 50;
}

#game-canvas {
    display: block;
    background-color: #6aaa64; /* A grassy green */
}

#ui-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    text-align: center;
    z-index: 100;
}

#game-over-screen h1 {
    margin: 0;
    font-size: 3em;
}

#game-over-screen p {
    margin-top: 10px;
    font-size: 1em;
}

#stats {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column; /* Changed to column */
    align-items: center;
    gap: 8px; /* Adjusted gap */
}

#hp-container, #level-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

#level-container {
    font-size: 24px;
    font-weight: bold;
}

#hp-label {
    font-size: 24px;
    font-weight: bold;
    color: #f87171; /* red-400 */
}

#hp-bar-container {
    width: 300px;
    height: 20px;
    background-color: #4b5563; /* gray-600 */
    border-radius: 10px;
    border: 2px solid #f9fafb; /* gray-50 */
    overflow: hidden;
}

#hp-bar {
    width: 100%;
    height: 100%;
    background-color: #f87171; /* red-400 */
    border-radius: 8px 0 0 8px; /* Keep left radius */
    transition: width 0.3s ease-in-out;
}

#hp-text {
    font-size: 16px;
    font-weight: bold;
    white-space: nowrap;
}

#xp-bar-container {
    width: 300px;
    height: 20px;
    background-color: #4b5563; /* gray-600 */
    border-radius: 10px;
    border: 2px solid #f9fafb; /* gray-50 */
    overflow: hidden;
}

#xp-bar {
    width: 0%;
    height: 100%;
    background-color: #a78bfa; /* violet-400 */
    border-radius: 8px 0 0 8px; /* Keep left radius */
    transition: width 0.3s ease-in-out;
}

#xp-text {
    font-size: 16px;
    font-weight: bold;
    white-space: nowrap;
}