        /* ---------- GLOBAL ---------- */
        body {
            margin: 0;
            background: #202020;
            color: #fff;
            font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
            overflow: hidden;
        }

        /* Main WebGL canvas only */
        .main-canvas {
            position: fixed;
            inset: 0;
            z-index: 0;
        }

        /* ---------- UI CONTAINER ---------- */
        #ui {
            position: absolute;
            top: 10px;
            left: 10px;
            z-index: 10;

            width: 220px;
            padding: 14px;

            background: rgba(30, 30, 30, 0.65);
            backdrop-filter: blur(6px);
            border-radius: 16px;

            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);

            /* NEW */
            max-height: calc(100vh - 20px);
            /* keep margins */
            overflow-y: auto;
        }

        /* Optional: nicer scrollbar */
        #ui::-webkit-scrollbar {
            width: 6px;
        }

        #ui::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.25);
            border-radius: 6px;
        }


        /* ---------- FOOTER ---------- */
        #footer {
            position: fixed;
            bottom: 10px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 10;

            padding: 10px 20px;
            background: rgba(30, 30, 30, 0.65);
            backdrop-filter: blur(6px);
            border-radius: 16px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);

            font-size: 12px;
            text-align: center;
            opacity: 0.8;
        }

        /* ---------- HEADERS ---------- */
        #ui h2 {
            margin: 10px 0 8px;
            font-size: 14px;
            font-weight: 600;
            opacity: 0.9;
        }

        /* ---------- COMMON BUTTON ---------- */
        #ui button {
            background: rgba(0, 0, 0, 0.55);
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 10px;
            padding: 8px 12px;
            cursor: pointer;
            font-size: 13px;

            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;

            transition: background 0.15s ease;
        }

        #ui button:hover {
            background: rgba(197, 131, 55, 0.85);
        }

        #ui button:active {
            background: rgba(197, 131, 55, 1);
        }

        /* ---------- CIRCLE BUTTON ---------- */
        #ui button.circle {
            width: 40px;
            height: 40px;
            padding: 0;
            border-radius: 50%;
            font-size: 16px;
        }

        /* ---------- SLIDERS ---------- */
        #ui input[type="range"] {
            width: 150px;
            margin-top: 4px;
            accent-color: #c58337;
        }

        /* ---------- HR ---------- */
        #ui hr {
            border: none;
            height: 1px;
            background: rgba(255, 255, 255, 0.15);
            margin: 12px 0;
        }

        /* ---------- JOYSTICK ---------- */
        #ui .joystick {
            position: relative;
            width: 150px;
            height: 150px;
            margin: 8px auto;

            border-radius: 50%;
            background: radial-gradient(circle at center,
                    rgba(255, 255, 255, 0.35),
                    rgba(200, 200, 200, 0.25));

            box-shadow:
                inset 0 0 8px rgba(0, 0, 0, 0.25),
                0 4px 10px rgba(0, 0, 0, 0.3);
        }

        #ui .joystick button {
            position: absolute;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            font-size: 1.4rem;
        }

        /* Directions */
        #ui .up {
            top: 8px;
            left: 50%;
            transform: translateX(-50%);
        }

        #ui .down {
            bottom: 8px;
            left: 50%;
            transform: translateX(-50%);
        }

        #ui .left {
            left: 8px;
            top: 50%;
            transform: translateY(-50%);
        }

        #ui .right {
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
        }

        /* ---------- FORWARD / BACK ---------- */
        #ui .fb-container {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin-top: 6px;
        }

        #ui .fb-container button {
            height: 40px;
            flex: 1;
            font-size: 12px;
        }

        /* ---------- ROTATE PANEL ---------- */
        #ui .rotate-panel {
            background: rgba(0, 0, 0, 0.4);
            border-radius: 14px;
            padding: 10px;
            width: 70%;
        }

        #ui .rotate-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 6px;
        }

        #ui .rotate-label {
            width: 55px;
            font-size: 12px;
            opacity: 0.75;
        }

        #ui .rotate-buttons {
            display: flex;
            gap: 6px;
        }


        /* COLOR INPUT (Pickr) */
        .color-input {
            display: inline-block;
        }

        /* The Pickr button itself */
        .color-input .pcr-button {
            width: 45px;
            height: 45px;
            border: 2px solid #fff;
            background-color: #202020;
            cursor: pointer;
            box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4);
        }

        /* Remove default Pickr pseudo-icons */
        .color-input .pcr-button::before,
        .color-input .pcr-button::after {
            display: none;
        }