
        body {
            font-family: 'Inter', sans-serif;
            background-color: #1e293b; /* Slate-800 */
            color: #f8fafc; /* Slate-50 */
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start; /* Align content to the top */
            min-height: 100vh;
            margin: 0;
            padding: 0; 
            box-sizing: border-box;
            overflow: hidden; /* Prevent body scroll bars */
        }

        canvas {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: block;
            background-color: #222; 
            touch-action: none;
        }
        
        #world-space-ui {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none; 
            overflow: hidden;
            z-index: 500;
        }

        #map-container {
            position: absolute;
            top: 10px;
            left: 10px;
            width: 200px;
            height: 200px;
            background-color: rgba(0, 0, 0, 0.5);
            border: 2px solid #334155;
            border-radius: 8px;
            z-index: 1002;
            overflow: hidden;
        }

        #mapCanvas {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
        }

        #player-dot {
            position: absolute;
            width: 8px;
            height: 8px;
            background-color: #f87171;
            border-radius: 50%;
            border: 2px solid #fff;
            transform: translate(-50%, -50%);
        }

        .other-player-dot {
            position: absolute;
            width: 6px;
            height: 6px;
            background-color: #60a5fa;
            border-radius: 50%;
            transform: translate(-50%, -50%);
        }

        .controls-info {
            position: absolute;
            top: 10px;
            right: 10px;
            padding: 10px;
            background-color: rgba(0, 0, 0, 0.5);
            border-radius: 8px;
            color: #93c5fd;
            z-index: 1001;
            font-size: 0.8rem;
        }

        .key-label {
            display: inline-block;
            background-color: #0f172a; 
            color: #93c5fd; 
            padding: 3px 6px;
            margin: 0 3px;
            border-radius: 3px;
            border-bottom: 2px solid #1e293b;
            font-weight: bold;
        }

        .touch-controls {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 120px; /* Fixed height for controls */
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 20px;
            background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
            z-index: 1000;
            pointer-events: none; /* Allow clicks to pass through the container */
        }
        
        .steer-controls, .speed-controls {
            display: flex;
            gap: 10px;
            pointer-events: all; /* Re-enable pointer events for the button groups */
        }
        
        .speed-controls {
            flex-direction: column;
            gap: 5px;
        }

        .touch-button {
            width: 70px;
            height: 70px;
            background-color: #3b82f6; /* Blue-500 */
            color: white;
            border: none;
            border-radius: 10px;
            font-size: 14px;
            font-weight: bold;
            box-shadow: 0 5px #1d4ed8; /* Blue-700 */
            transition: all 0.1s ease;
            cursor: pointer;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
            touch-action: manipulation;
        }
        
        .touch-button:active {
            box-shadow: 0 2px #1d4ed8;
            transform: translateY(3px);
            background-color: #60a5fa; 
        }

        .touch-button.up {
            height: 50px;
            width: 70px;
            box-shadow: 0 5px #10b981; /* Emerald-500 */
            background-color: #059669; /* Emerald-600 */
        }
        .touch-button.down {
            height: 50px;
            width: 70px;
            box-shadow: 0 5px #ef4444; /* Red-500 */
            background-color: #dc2626; /* Red-600 */
        }
        .touch-button.up:active {
             box-shadow: 0 2px #10b981;
             background-color: #34d399; 
        }
        .touch-button.down:active {
             box-shadow: 0 2px #ef4444;
             background-color: #f87171; 
        }

        .steer-controls {
            padding-bottom: 30px; 
        }

        #toggle-chat-btn {
            position: fixed;
            bottom: 130px;
            right: 10px;
            width: 70px;
            height: 40px;
            background-color: #3b82f6; /* Blue-500 */
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: bold;
            box-shadow: 0 4px #1d4ed8; /* Blue-700 */
            cursor: pointer;
            z-index: 1001;
            transition: all 0.2s ease;
        }

        #toggle-chat-btn:active {
            box-shadow: 0 2px #1d4ed8;
            transform: translateY(2px);
        }

        #chat-container {
            position: fixed;
            bottom: 130px; /* Position above touch controls */
            left: 10px;
            width: 350px;
            max-width: 90%;
            height: 200px;
            background-color: rgba(15, 23, 42, 0.8); /* Slate-900 with transparency */
            border: 1px solid #334155; /* Slate-700 */
            border-radius: 8px;
            display: flex;
            flex-direction: column;
            z-index: 1000;
            font-size: 0.9rem;
            backdrop-filter: blur(5px); /* Frosty glass effect */
            transition: all 0.3s ease-in-out;
        }
        #chat-container.hidden {
            opacity: 0;
            pointer-events: none;
            transform: translateY(20px) scale(0.95);
        }

        #chat-messages {
            flex-grow: 1;
            overflow-y: auto;
            padding: 10px;
            display: flex;
            flex-direction: column-reverse; /* New messages appear at the bottom */
        }

        #chat-messages .message {
            margin-bottom: 5px;
            line-height: 1.4;
            word-wrap: break-word;
        }

        #chat-messages .message-sender {
            font-weight: bold;
        }

        #chat-form {
            display: flex;
        }

        #chat-input {
            flex-grow: 1;
            border: none;
            border-top: 1px solid #334155; /* Slate-700 */
            padding: 10px;
            background-color: rgba(30, 41, 59, 0.8); /* Slate-800 with transparency */
            color: #f8fafc; /* Slate-50 */
            font-family: 'Inter', sans-serif;
            outline: none; /* Remove focus outline */
            border-bottom-left-radius: 8px;
            border-bottom-right-radius: 8px;
        }
        #chat-input:focus {
            background-color: rgba(51, 65, 85, 0.9); /* Slate-700 on focus */
        }

        /* In-world chat bubbles */
        .chat-bubble {
            position: absolute;
            background-color: rgba(15, 23, 42, 0.85); 
            color: white;
            padding: 8px 12px;
            border-radius: 10px;
            font-size: 14px;
            max-width: 200px;
            word-wrap: break-word;
            transform: translate(-50%, -110%);
            transition: opacity 0.3s ease-in-out;
            opacity: 1;
            pointer-events: none;
            white-space: pre-wrap;
            border: 1px solid rgba(51, 65, 85, 0.9);
            backdrop-filter: blur(3px);
        }

        .chat-bubble::after {
            content: '';
            position: absolute;
            bottom: -8px;
            left: 50%;
            transform: translateX(-50%);
            width: 0; 
            height: 0; 
            border-left: 8px solid transparent;
            border-right: 8px solid transparent;
            border-top: 8px solid rgba(15, 23, 42, 0.85);
        }
