body {
    margin: 0;
    overflow: hidden; /* Prevent scrollbars */
    font-family: 'Inter', sans-serif;
    background-color: #111;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #eee;
    text-shadow: 2px 2px 8px rgba(0, 255, 255, 0.5);
    margin-bottom: 2rem;
}

canvas {
    display: block; /* Remove scrollbars */
}

.hidden {
    display: none !important;
}

/* When the game is active, it should be the only thing controlling the layout */
#game-section:not(.hidden) {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- Name Entry Screen Styles --- */
#name-entry-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.name-entry-box {
    background: #222;
    padding: 24px; 
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 200, 200, 0.2); 
    width: 100%;
    max-width: 300px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    border: 1px solid #333; 
}

.name-label-image {
    font-size: 1.125rem;
    font-weight: bold;
    color: #00bcd4; 
}

.name-input-image {
    padding: 10px;
    border: 2px solid #444; 
    border-radius: 0.5rem;
    width: 100%;
    text-align: center;
    font-size: 1rem;
    outline: none;
    background-color: #333;
    color: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.name-input-image:focus {
    border-color: #00bcd4;
    box-shadow: 0 0 0 1px #00bcd4;
}

.start-game-button-image {
    background-color: #444; 
    color: #888; 
    padding: 10px 20px;
    border-radius: 0.5rem;
    font-weight: bold;
    border: none;
    cursor: not-allowed;
    width: 100%;
    transition: background-color 0.2s, color 0.2s, transform 0.1s;
}

.start-game-button-image:not(:disabled) {
    background-color: #0097a7; 
    color: white;
    cursor: pointer;
}

.start-game-button-image:not(:disabled):hover {
    background-color: #00bcd4;
    transform: translateY(-1px);
}

.name-error-styled {
    font-size: 0.875rem; 
    color: #ff5252; 
    height: 1.2em;
}

.player-display {
    position: absolute;
    top: 60px;
    width: 100%;
    text-align: center;
    font-size: 1.2rem; 
    font-weight: bold;
    color: #ffeb3b; 
    text-shadow: 1px 1px 3px #000;
    z-index: 10;
}

#instructions, #winMessage {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 20px;
    color: white;
    font-size: 1.5em;
    text-shadow: 2px 2px 4px #000000;
    z-index: 10;
}

#winMessage {
    display: none;
    color: #4caf50;
}

/* --- Mobile Controls --- */
#mobile-controls {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    z-index: 20;
    pointer-events: none; /* Allows clicks to pass through the container */
}

@media (hover: none) and (pointer: coarse) {
    /* Show controls only on touch devices */
    #mobile-controls {
        display: flex;
    }
}

#mobile-controls .control-group {
    display: flex;
    flex-direction: column;
}

#mobile-controls button {
    pointer-events: auto; /* Re-enable pointer events for buttons */
    width: 60px;
    height: 60px;
    margin: 5px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background-color: rgba(0, 0, 0, 0.4);
    color: rgba(255, 255, 255, 0.8);
    font-size: 24px;
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10+ */
    user-select: none; /* Standard */
}

#mobile-controls button:active {
    background-color: rgba(0, 0, 0, 0.7);
}

#movement-controls {
    align-items: flex-start;
}

#rotation-controls {
    align-items: flex-end;
}