* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: #ffffff; /* Weißer Hintergrund für Transmission-Sichtbarkeit */
    font-family: system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
}

#scene, #canvas2d {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100vw;
    height: 100vh;
    background: #ffffff; /* Weißer Canvas-Hintergrund */
    touch-action: none; /* Wichtig für Touch-Interaktion */
    cursor: grab; /* Visual feedback für Interaktivität */
    /* Optimiert für High-DPI Displays */
    image-rendering: auto;
    image-rendering: -webkit-optimize-contrast;
}

#scene:active, #canvas2d:active {
    cursor: grabbing;
}

.fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none;
}

/* Control Panel Styling */
.controls {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 280px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: system-ui, -apple-system, sans-serif;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.controls h3 {
    margin: 0 0 20px 0;
    color: #333;
    text-align: center;
    font-size: 18px;
}

.control-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    min-width: 100px;
}

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

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.control-group span {
    min-width: 35px;
    font-size: 11px;
    color: #666;
    font-family: monospace;
    text-align: right;
}

#reset {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease;
    margin-top: 10px;
}

#reset:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    #scene, #canvas2d {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none; /* Prevent iOS callout */
        -webkit-tap-highlight-color: transparent; /* Remove tap highlights */
    }
    
    body {
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        overscroll-behavior: none; /* Prevent overscroll effects */
    }
}