body {
    margin: 0;
    overflow: hidden;
    font-family: 'Arial', sans-serif;
    background-color: #000;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#ui-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none; /* Allow clicks to pass through to canvas */
}

.ui-panel {
    background-color: rgba(0, 0, 0, 0.7); /* Fallback color */
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.ui-panel h1 {
    margin-top: 0;
    color: #ff4444;
}
.ui-panel h2 {
    color: #ff6666;
}

#start-screen {
    width: 100%; /* Ensure it spans the full width of its container */
    height: 100%; /* Ensure it spans the full height of its container */
    background-image: url('https://play.rosebud.ai/assets/start-screen-background.jpg?yJAJ');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex; /* Keep flex for content alignment if needed */
    flex-direction: column;
    justify-content: center; /* Keeps it vertically centered */
    align-items: center;     /* Revert to center alignment for horizontal */
}
#game-over-screen {
    background-image: url('https://play.rosebud.ai/assets/game-over-background.jpg?9vnc');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
#start-screen img, #game-over-screen img { /* Style for new image buttons */
    margin-top: 40px 50px 0px 10px;
    cursor: pointer;
    pointer-events: all; /* Enable click for image buttons */
    max-width: 300px; /* Adjust as needed */
    height: auto; /* Maintain aspect ratio */
    transition: transform 0.2s ease-in-out;
    transform: translateX(-200px);
}
#start-screen img:hover, #game-over-screen img:hover {
    transform: translateX(-200px) scale(1.05); /* Maintain X offset and apply zoom */
}
/* Remove old button styles if they are no longer needed or adjust them */
/* Commenting out old button styles as we are using images now */
/*
#start-button {
    padding: 10px 20px;
    background-color: #550000;
    color: white;
    border: 2px solid #880000;
    border-radius: 5px;
    cursor: pointer;
    pointer-events: all;
}
#start-button:hover {
    background-color: #770000;
}
#play-again-button {
    padding: 10px 20px;
    background-color: #550000;
    color: white;
    border: 2px solid #880000;
    border-radius: 5px;
    cursor: pointer;
    pointer-events: all; 
}
#play-again-button:hover {
    background-color: #770000;
}
*/
#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
    pointer-events: all; /* Allow clicks/taps on the HUD for sniff activation */
    cursor: pointer; /* Indicate it's clickable */
}
.enemy-status {
    margin-top: 10px;
    font-size: 1.1em;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}
#minimap-container {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 200px; 
    height: 150px;
    border: 1px solid #666;
    background-color: rgba(15, 15, 25, 0.8); /* Darker, slightly blueish translucent background */
    z-index: 100; 
    box-shadow: 0 0 8px rgba(0,0,0,0.4);
    overflow: hidden; /* Ensures canvas stays within border */
}
#minimap-canvas {
    width: 100%;
    height: 100%;
    display: block;
}
canvas { /* General canvas styling, applies to main game canvas too */
    display: block;
}
#joystick-container {
    position: absolute;
    bottom: 30px; /* More space from bottom */
    left: 30px;  /* More space from left */
    z-index: 1000; /* Ensure it's above most other UI elements, but below popups like game over if needed */
    user-select: none; /* Prevent text selection when interacting */
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10+ */
    touch-action: none; /* Prevent default touch actions like scrolling or zooming on the joystick itself */
}
#joystick-base {
    width: 120px; /* Larger base */
    height: 120px; /* Larger base */
    background-color: rgba(80, 80, 80, 0.4); /* Darker, slightly more transparent */
    border-radius: 50%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Subtle shadow for depth */
    border: 2px solid rgba(200, 200, 200, 0.3); /* Light border */
}
#joystick-stick {
    width: 60px; /* Larger stick */
    height: 60px; /* Larger stick */
    background-color: rgba(150, 150, 150, 0.6); /* Lighter stick, still transparent */
    border-radius: 50%;
    position: absolute; /* Positioned relative to joystick-base */
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5); /* Inner shadow for 3D effect */
    border: 1px solid rgba(220, 220, 220, 0.5); /* Light border for stick */
    /* Transition for snapping back, handled by JS for drag */
}
#camera-joystick-container {
    position: absolute;
    bottom: 30px;
    right: 30px; /* Position on the right */
    z-index: 1000;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    touch-action: none;
}
#camera-joystick-base {
    width: 120px;
    height: 120px;
    background-color: rgba(80, 80, 80, 0.4);
    border-radius: 50%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(200, 200, 200, 0.3);
}
#camera-joystick-stick {
    width: 60px;
    height: 60px;
    background-color: rgba(150, 150, 150, 0.6);
    border-radius: 50%;
    position: absolute;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(220, 220, 220, 0.5);
}