/* Mobile CSS - Clean overrides for mobile devices */

@media (max-width: 768px) {
    /* Game Header - Mobile */
    #game-header {
        padding: 0.5rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
        text-align: center;
    }
    
    .level-display, .score-display, .accuracy-display, .fouls-display {
        font-size: 0.9rem;
        flex: 1 1 45%;
    }
    
    .difficulty-display {
        font-size: 0.8rem;
        padding: 0.2rem 0.8rem;
        flex: 1 1 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Court Container - Mobile */
    #court-container {
        width: 90vw;
        height: calc(90vw * 0.75);
        max-width: 600px;
        max-height: 450px;
        margin: 1rem auto;
    }
    
    /* Player Markers - Mobile */
    .player-marker {
        width: 120px !important;
        height: 120px !important;
        /* Keep percentage positioning with transform */
    }
    
    /* Number Display - Mobile */
    .number-container {
        top: 25%;
    }
    
    #current-number {
        font-size: 3rem !important;
        padding: 10px 20px !important;
        background: rgba(0, 0, 0, 0.9) !important;
        border: 2px solid #FFD700 !important;
    }
    
    /* Hide number during input phase */
    #input-phase:not(.hidden) .number-container,
    #input-phase:not(.hidden) #number-display {
        display: none !important;
    }
    
    /* Input Phase - Mobile */
    #input-phase {
        padding: 10px;
        overflow-y: auto;
    }
    
    /* Recall Court - Mobile */
    #recall-court {
        width: 90vw;
        height: calc(90vw * 0.75);
        max-width: 600px;
        max-height: 450px;
    }
    
    /* Draggable Players - Mobile */
    .draggable-player {
        width: 120px !important;
        height: 120px !important;
    }
    
    .draggable-player:hover {
        transform: none; /* Disable hover effects on touch */
    }
    
    /* Spot Indicators - Mobile (CRITICAL) */
    .spot-indicator {
        width: 20px !important;
        height: 20px !important;
        border: 2px solid #FFD700 !important;
        background: rgba(255, 215, 0, 0.6) !important;
        animation: none !important; /* Disable animation for performance */
        /* DO NOT SET transform: none - keep percentage positioning */
    }
    
    /* IMPORTANT: Preserve transform for percentage positioned spots */
    .spot-indicator[style*="left"][style*="%"] {
        /* Elements with percentage positioning MUST keep their transform */
    }
    
    .spot-indicator:hover,
    .spot-indicator:active {
        background: rgba(255, 215, 0, 0.8) !important;
        /* Do not add transform scale */
    }
    
    .spot-indicator.original-spot {
        border-color: #2ecc71 !important;
        background: rgba(46, 204, 113, 0.6) !important;
    }
    
    /* Number Input - Mobile */
    .number-input-container {
        top: 30%;
        background: rgba(0, 0, 0, 0.9);
        padding: 15px;
        border-radius: 10px;
    }
    
    .number-input-container h3 {
        font-size: 1.5rem;
    }
    
    #number-input {
        font-size: 2.5rem;
        width: 100px;
        padding: 8px 15px;
    }
    
    /* Position Instruction - Mobile */
    .position-instruction {
        font-size: 1.1rem;
        margin: 0.5rem 1rem;
    }
    
    /* Submit Button - Mobile */
    .submit-btn {
        font-size: 1.2rem;
        padding: 0.8rem 2rem;
        margin-top: 1rem;
    }
    
    /* Menu - Mobile */
    .menu h1 {
        font-size: 2.5rem;
    }
    
    .menu p {
        font-size: 1.2rem;
        margin-bottom: 2rem;
    }
    
    .menu-btn {
        font-size: 1.2rem;
        padding: 0.8rem 2rem;
    }
    
    /* Modal - Mobile */
    .modal-content {
        padding: 2rem;
        margin: 1rem;
        max-width: 90%;
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    /* Further reduce sizes */
    #court-container,
    #recall-court {
        width: 85vw;
        height: calc(85vw * 0.75);
    }
    
    .player-marker,
    .draggable-player {
        width: 90px !important;
        height: 90px !important;
    }
    
    /* Even smaller spot indicators */
    .spot-indicator {
        width: 16px !important;
        height: 16px !important;
        border-width: 1.5px !important;
    }
    
    #current-number {
        font-size: 2rem !important;
        padding: 8px 16px !important;
    }
    
    .menu h1 {
        font-size: 2rem;
    }
}

/* Landscape orientation for mobile */
@media (orientation: landscape) and (max-height: 600px) {
    #game-container {
        height: 100vh;
        overflow: hidden;
    }
    
    #game-header {
        padding: 0.3rem 1rem;
    }
    
    .level-display, .score-display, .accuracy-display, .fouls-display {
        font-size: 0.8rem;
    }
    
    #court-container,
    #recall-court {
        height: calc(100vh - 80px);
        width: auto;
        max-height: 100%;
    }
    
    #basketball-court,
    #recall-canvas {
        max-height: 100%;
        max-width: 100%;
        width: auto;
        height: calc(100vh - 80px);
        object-fit: contain;
    }
    
    /* Smaller players in landscape */
    .player-marker,
    .draggable-player {
        width: 60px !important;
        height: 60px !important;
    }
    
    /* Tiny spot indicators in landscape */
    .spot-indicator {
        width: 15px !important;
        height: 15px !important;
        border-width: 1px !important;
    }
    
    #current-number {
        font-size: 1.5rem !important;
        padding: 4px 8px !important;
    }
}