body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: Arial, sans-serif;
    -webkit-overflow-scrolling: touch; /* Enable smooth scrolling on iOS */
}

.container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    padding: 0;
    box-sizing: border-box;
}

h1 {
    text-align: center;
    margin: 10px 0;
    height: 40px; /* Fixed height for the header */
}

.game-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    width: 100%;
    height: calc(100vh - 50px); /* Take up all remaining space */
    margin: 0 auto;
    padding: 0 10px 10px 10px;
    box-sizing: border-box;
}

.game-section {
    flex: 2;
    position: relative;
    height: 100%; /* Full height */
    background-color: #f7f7f7;
    border-radius: 8px;
    overflow: hidden;
}

#webcam-container {
    flex: 1;
    position: relative;
    height: 100%; /* Full height */
    border-radius: 8px;
    overflow: hidden;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #f7f7f7;
}

#calibration {
    text-align: center;
}

#calibration-progress {
    font-size: 48px;
    margin: 20px 0;
}

#loading-status {
    margin-top: 10px;
    color: #666;
}

#game-canvas {
    width: 100%;
    height: 100%;
}

#webcam {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Remove the hardcoded opacity, will be set by JS */
    z-index: 1;
    transform: scaleX(-1); /* Flip horizontally to create mirror effect */
}

#pose-canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    /* Remove the transform property to prevent flipping the canvas */
}

.hidden {
    display: none;
}

.game-info {
    display: none;
}

.controls {
    padding: 10px;
    text-align: center;
    background-color: #f0f0f0;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .game-container {
        gap: 15px;
    }
}

@media (min-width: 1240px) {
    .container {
        max-width: 100%;
        padding: 20px;
    }
    
    .game-container {
        flex-direction: row;
        gap: 20px;
    }
    
    #webcam-container {
        width: 400px;
        height: 300px;
    }
}

@media (orientation: landscape) {
    .game-container {
        flex-direction: row;
    }
    
    .game-section {
        flex: 2;
    }
    
    #webcam-container {
        flex: 1;
    }
}

@media (orientation: portrait) {
    .game-container {
        flex-direction: column;
    }
    
    .game-section, #webcam-container {
        flex: none;
        width: 100%;
    }
}

/* Add these styles for touch devices */
@media (pointer: coarse) {
    body, html {
        overflow-y: auto; /* Allow vertical scrolling */
        height: auto; /* Don't restrict height */
        position: relative;
    }
    
    .container {
        height: auto;
        min-height: 100vh;
    }
    
    .game-container {
        height: auto;
        min-height: calc(100vh - 60px);
    }
    
    .game-section, #webcam-container {
        position: relative;
        overflow: visible;
    }
    
    /* Make sure the canvas is responsive */
    #game-canvas {
        touch-action: manipulation; /* Improve touch responsiveness */
    }
    
    /* Ensure the webcam container is properly sized */
    #webcam-container {
        height: 40vh;
        min-height: 250px;
    }
    
    /* Make sure the game section is properly sized */
    .game-section {
        height: 50vh;
        min-height: 300px;
    }
}

/* Add specific styles for iPad */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
    .game-container {
        flex-direction: column;
    }
    
    .game-section, #webcam-container {
        width: 100%;
        max-width: 100%;
    }
    
    .game-section {
        height: 60vh;
    }
    
    #webcam-container {
        height: 35vh;
    }
    
    /* Ensure buttons are large enough for touch */
    button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Ensure the tutorial and settings panels are scrollable */
.tutorial-panel, .settings-panel {
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Add this to ensure the leaderboard is scrollable */
.leaderboard-table-container {
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Make sure the settings content is scrollable */
.settings-content {
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Ensure the high score prompt is scrollable if needed */
.high-score-prompt {
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
} 