body {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* justify-content: center; Removed to allow natural top alignment */
    height: 100vh;
    background-color: #000;
    color: #fff;
    margin: 0;
    font-family: 'Arial', sans-serif;
}

h1 {
    margin-bottom: 5px; /* Reduced margin */
    color: #0f0; /* Green text */
}

.canvas-wrapper {
    position: relative; /* Needed for absolute positioning of child */
    border: 1px solid #0f0; /* Apply border to wrapper */
    background-color: #111; /* Apply background to wrapper */
    margin: 5px auto; /* Reduced vertical margin, keep horizontal centering */
    width: 95%; /* Responsive width */
    max-width: 800px; /* Max pixel width for large screens */
    aspect-ratio: 600 / 400; /* Maintain 600x400 aspect ratio */
    max-height: 85vh; /* Limit height */
    display: flex; /* Use flex to easily center canvas */
    justify-content: center;
    align-items: center;
}

canvas {
    /* Remove border, background, margin, max-width, max-height, object-fit */
    display: block; /* Keep display block */
    width: 100%;  /* Fill wrapper width */
    height: 100%; /* Fill wrapper height */
}


.dynapuff-shooter {
    font-family: "DynaPuff", system-ui;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-variation-settings:
      "wdth" 100;
  }
.game-info {
    display: flex;
    justify-content: space-around;
    width: 90%;
    max-width: 800px;
    margin-bottom: 10px;
    font-size: 1.2em;
    color: #0f0;
}

.controls {
    margin-top: 5px; /* Reduced margin */
    display: flex;
    justify-content: space-between; /* Space between buttons */
    width: 90%; /* Use percentage width */
    max-width: 700px; /* 400px; Limit max width on larger screens */
    gap: clamp(20px, 8vw, 50px); /* Responsive gap */
}

.controls button {
    padding: clamp(10px, 3vw, 18px) clamp(8px, 2vw, 15px); /* Responsive padding */
    font-size: clamp(14px, 4vw, 18px); /* Responsive font size */
    flex-grow: 1; /* Allow buttons to grow and fill space */
    cursor: pointer;
    background-color: #0f0; /* Green buttons by default */
    color: #000; /* Black text for contrast with green */
    border: none;
    border-radius: 5px;
    user-select: none; /* Prevent text selection on mobile */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE/Edge */
    touch-action: manipulation; /* Prevent zoom/scroll on button press */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on iOS */
}

.controls button:active {
    background-color: #0a0; /* Darker green when pressed */
}

/* Specific style for the Fire button */
#fireButton {
    background-color: red;
    color: white;
}

#fireButton:active {
    background-color: #c00;
}
/* Add styling for the start button */
.start-button {
    position: absolute; /* Position over the canvas */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center the button */
    z-index: 10; /* Ensure it's above the canvas */
    padding: clamp(10px, 3vw, 20px) clamp(20px, 6vw, 40px); /* Responsive padding */
    font-size: clamp(16px, 5vw, 24px); /* Responsive font size */
    cursor: pointer;
    background-color: #0f0; /* Green button */
    color: #000; /* Black text */
    border: none;
    border-radius: 5px;
    /* margin-bottom: 10px; Removed */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.start-button:active {
    background-color: #0a0; /* Darker green when pressed */
}

.controls button:focus,
.start-button:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #0f0;
}

/* Media query for very small screens if needed */
@media (max-width: 360px) {
    h1 {
        font-size: 1.2em;
    }
    .controls button {
        font-size: 14px;
        padding: 12px 8px;
    }
}