        body {
            margin: 0;
            padding: 0;
            font-family: Arial, sans-serif;
            touch-action: none;
            overflow: hidden;
            position: fixed;
            width: 100%;
            height: 100vh;
            height: 100dvh; /* Dynamic viewport height for mobile */
            -webkit-user-select: none;
            user-select: none;
            -webkit-touch-callout: none;
        }
        
        #gameContainer {
            width: 100vw;
            height: 100vh;
            height: 100dvh; /* Dynamic viewport height for mobile */
            display: flex;
            flex-direction: column;
            padding-bottom: env(safe-area-inset-bottom);
        }
        
        #canvas {
            flex: 1;
            background: linear-gradient(to bottom, #87CEEB 0%, #E0F6FF 100%);
            touch-action: none;
            width: 100%;
        }
        
        #controls {
            padding: 8px 10px;
            background: #333;
            color: white;
            display: flex;
            flex-direction: column;
            align-items: center;
            flex-shrink: 0;
            gap: 6px;
        }

        button {
            border: none;
            border-radius: 6px;
            color: white;
            cursor: pointer;
        }

        #setBallBtn {
            padding: 12px 25px;
            font-size: 18px;
            font-weight: bold;
            background: #4CAF50;
            width: 85%;
            max-width: 350px;
        }

        #resetBtn, #settingsBtn {
            padding: 6px 12px;
            font-size: 12px;
            background: #666;
            margin: 2px;
        }

        #recordBtn, #replayBtn {
            padding: 6px 12px;
            font-size: 12px;
        }
        
        #settingsBtn {
            background: #2196F3;
        }
        
        button:disabled {
            background: #444;
            cursor: not-allowed;
            opacity: 0.5;
        }
        
        /* Settings Modal */
        #settingsModal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 1000;
            overflow-y: auto;
        }
        
        #settingsModal.active {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        #settingsPanel {
            background: #333;
            color: white;
            padding: 20px;
            border-radius: 10px;
            width: 90%;
            max-width: 500px;
            max-height: 90vh;
            overflow-y: auto;
        }
        
        #settingsPanel h2 {
            margin-top: 0;
            text-align: center;
            color: #4CAF50;
        }
        
        .setting-group {
            margin: 15px 0;
            padding: 10px;
            background: #444;
            border-radius: 5px;
        }
        
        .setting-group h3 {
            margin: 0 0 10px 0;
            font-size: 16px;
            color: #2196F3;
        }
        
        .setting-item {
            margin: 10px 0;
            display: flex;
            flex-direction: column;
        }
        
        .setting-item label {
            margin-bottom: 5px;
            font-size: 14px;
        }
        
        .setting-item input[type="number"],
        .setting-item input[type="range"] {
            padding: 8px;
            font-size: 16px;
            background: #555;
            color: white;
            border: 1px solid #666;
            border-radius: 4px;
        }
        
        .setting-item input[type="checkbox"] {
            width: 30px;
            height: 30px;
        }
        
        .range-value {
            display: inline-block;
            margin-left: 10px;
            font-weight: bold;
            color: #4CAF50;
        }
        
        .button-group {
            display: flex;
            gap: 10px;
            margin-top: 20px;
        }
        
        .button-group button {
            flex: 1;
            padding: 15px;
            font-size: 16px;
        }
        
        #saveSettingsBtn {
            background: #4CAF50;
        }
        
        #cancelSettingsBtn {
            background: #666;
        }
        
        #status {
            margin: 3px 0;
            font-size: 13px;
            font-weight: bold;
            line-height: 1.2;
            width: 100%;
            text-align: center;
            word-wrap: break-word;
            overflow-wrap: break-word;
            padding: 2px 6px;
            box-sizing: border-box;
        }
        
        #debug {
            font-size: 11px;
            font-family: monospace;
            background: #222;
            padding: 5px;
            margin-top: 5px;
            max-height: 80px;
            overflow-y: auto;
            line-height: 1.2;
            width: 100%;
            box-sizing: border-box;
        }
