body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 640px;
    padding: 10px;
    box-sizing: border-box;
    text-align: center;
}

header h1 {
    font-size: 1.5rem;
    margin: 0 0 5px 0;
}

header p {
    font-size: 1rem;
    margin: 0 0 10px 0;
    color: #666;
}

#simulation-container {
    position: relative;
    width: 100%;
    /* Maintain 4:3 aspect ratio */
    padding-top: 75%;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}

#camera-feed,
#simulation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#camera-feed,
#simulation-canvas {
    /* Mirror effect */
    transform: scaleX(-1);
}

#controls {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#ball-slider {
    width: 70%;
    max-width: 300px;
}

#error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px;
    border-radius: 8px;
    z-index: 10;
}

/* For smaller screens */
@media (max-width: 640px) {
    header h1 {
        font-size: 1.2rem;
    }

    header p {
        font-size: 0.9rem;
    }
}