*, *::before, *::after {
            box-sizing: border-box;
        }

        body {
            background-color: #1a1a1a;
            color: #fff;
            font-family: sans-serif;
            padding: 20px;
            margin: 0;
            overflow-x: hidden;
            max-width: 100vw;
        }

        h1 {
            margin-bottom: 20px;
            word-wrap: break-word;
        }

        canvas {
            width: 100%;
            max-width: 100%;
            border: 1px solid #444;
            display: block;
            margin-bottom: 20px;
        }

        .roadContainer {
            min-height: 100px;
            overflow-x: auto;
            overflow-y: hidden;
            width: 100%;
            max-width: 100%;
        }

        #road1, #road2 {
            width: 100%;
            max-width: 100%;
            margin-bottom: 30px;
        }

        .controls {
            display: flex;
            gap: 40px;
            flex-wrap: wrap;
            margin-bottom: 20px;
        }

        .control-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
            min-width: 200px;
        }

        .control-group label {
            font-weight: bold;
            font-size: 14px;
        }

        .control-group .slider-row {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .control-group input[type="range"] {
            flex: 1;
            height: 6px;
            -webkit-appearance: none;
            appearance: none;
            background: #444;
            border-radius: 3px;
            outline: none;
        }

        .control-group input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 18px;
            height: 18px;
            background: #3498db;
            border-radius: 50%;
            cursor: pointer;
            transition: background 0.2s;
        }

        .control-group input[type="range"]::-webkit-slider-thumb:hover {
            background: #2980b9;
        }

        .control-group input[type="range"]::-moz-range-thumb {
            width: 18px;
            height: 18px;
            background: #3498db;
            border-radius: 50%;
            cursor: pointer;
            border: none;
        }

        .control-group .value {
            min-width: 40px;
            text-align: right;
            font-family: monospace;
            font-size: 14px;
            color: #3498db;
        }

        .control-group .description {
            font-size: 12px;
            color: #888;
        }

        .advanced-toggle {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 15px;
            cursor: pointer;
            user-select: none;
        }

        .advanced-toggle input[type="checkbox"] {
            width: 18px;
            height: 18px;
            cursor: pointer;
        }

        .advanced-toggle label {
            font-size: 14px;
            color: #888;
            cursor: pointer;
        }

        .advanced-controls {
            display: none;
            gap: 40px;
            flex-wrap: wrap;
            margin-bottom: 20px;
            padding: 15px;
            background: #252525;
            border-radius: 8px;
            border: 1px solid #333;
        }

        .advanced-controls.visible {
            display: flex;
        }

        .advanced-controls .control-group {
            min-width: 180px;
        }

        .advanced-controls .control-group label {
            color: #aaa;
            font-size: 13px;
        }

        .advanced-controls input[type="range"] {
            background: #555;
        }

        .advanced-controls .value {
            color: #e67e22;
        }

        .stats {
            display: flex;
            flex-wrap: wrap;
            gap: 15px 30px;
            align-items: center;
            margin-top: -10px;
            margin-bottom: 30px;
            padding: 10px 15px;
            background: #252525;
            border-radius: 6px;
            border: 1px solid #333;
        }

        .stat-item {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .stat-item .stat-label {
            font-size: 13px;
            color: #888;
        }

        .stat-item .stat-value {
            font-family: monospace;
            font-size: 16px;
            font-weight: bold;
            color: #2ecc71;
        }

        .reset-btn {
            background: #e74c3c;
            color: #fff;
            border: none;
            padding: 8px 16px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            font-weight: bold;
            transition: background 0.2s;
        }

        .reset-btn:hover {
            background: #c0392b;
        }

        /* Mobile Responsive Styles */
        @media (max-width: 768px) {
            body {
                padding: 10px;
            }

            h1 {
                font-size: 1.5rem;
                margin-bottom: 15px;
            }

            .controls {
                gap: 20px;
            }

            .control-group {
                min-width: 100%;
            }

            .control-group input[type="range"] {
                height: 8px;
            }

            .control-group input[type="range"]::-webkit-slider-thumb {
                width: 24px;
                height: 24px;
            }

            .control-group input[type="range"]::-moz-range-thumb {
                width: 24px;
                height: 24px;
            }

            .advanced-controls {
                gap: 20px;
                padding: 12px;
            }

            .advanced-controls .control-group {
                min-width: 100%;
            }

            .stats {
                gap: 12px 20px;
                padding: 12px;
            }

            .stat-item {
                flex-wrap: wrap;
                gap: 4px;
            }

            .reset-btn {
                width: 100%;
                padding: 12px 16px;
                font-size: 16px;
                margin-top: 5px;
            }

            canvas {
                height: auto;
                min-height: 60px;
            }

            .roadContainer {
                width: 100%;
            }
        }

        @media (max-width: 480px) {
            body {
                padding: 8px;
            }

            h1 {
                font-size: 1.25rem;
            }

            .control-group label {
                font-size: 13px;
            }

            .control-group .description {
                font-size: 11px;
            }

            .control-group .value {
                min-width: 35px;
                font-size: 13px;
            }

            .stat-item .stat-label {
                font-size: 12px;
            }

            .stat-item .stat-value {
                font-size: 14px;
            }

            .advanced-toggle label {
                font-size: 13px;
            }
        }