/* Enhanced Mobile Touch Controls
   Improves touch experience for Wedding Runner game */

/* Touch Feedback Effects */
.touch-feedback {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(210, 82, 127, 0.4);
    pointer-events: none;
    z-index: 10;
    animation: touch-ripple 0.6s ease-out;
    opacity: 0;
}

@keyframes touch-ripple {
    0% {
        transform: scale(0.5);
        opacity: 0.7;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Enhance mobile button controls */
.mobile-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 6;
    pointer-events: none; /* Container shouldn't block touches */
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    pointer-events: auto; /* Make buttons clickable */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(0);
    transition: all 0.2s ease;
}

.control-btn:active {
    background-color: rgba(210, 82, 127, 0.7);
    transform: translateY(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Specialized button appearance */
#left-control, #right-control {
    background-color: rgba(255, 255, 255, 0.8);
}

#jump-control {
    background-color: rgba(70, 200, 70, 0.8);
}

#slide-control {
    background-color: rgba(70, 130, 200, 0.8);
}

/* Alternative Float Controls - shows/hides based on user preference */
.float-controls {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 7;
    pointer-events: none;
}

.float-controls .control-btn {
    pointer-events: auto;
    opacity: 0.8;
}

/* Alternatively allows player to choose control style */
.controls-preference {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 20;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    padding: 5px;
}

.controls-toggle {
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: none;
    cursor: pointer;
}

/* Adaptive layout for different device orientations */

/* Portrait mode - adjust controls */
@media (orientation: portrait) {
    .swipe-areas .left-area {
        width: 40%;
    }
    
    .swipe-areas .right-area {
        width: 40%;
    }
    
    .swipe-areas .up-area, 
    .swipe-areas .down-area {
        left: 40%;
        width: 20%;
    }
    
    .mobile-controls {
        flex-direction: row;
        justify-content: space-around;
        padding: 0 10px 10px;
    }
    
    .mobile-controls .control-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* Landscape mode - optimize layout */
@media (orientation: landscape) {
    .mobile-controls {
        bottom: 10px;
    }
    
    .left-area, .right-area {
        width: 30%;
    }
    
    .up-area, .down-area {
        left: 30%;
        width: 40%;
    }
}

/* Small screens - scale down controls */
@media (max-height: 500px) {
    .mobile-controls .control-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* Prevent user scaling/zooming which can interfere with touch controls */
html, body {
    touch-action: pan-y; /* Allow vertical scrolling but prevent zooming */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none; /* Prevent pull-to-refresh */
}

/* Visual touch indicator - shows where user touched */
.touch-indicator {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(210, 82, 127, 0.8);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 100;
    animation: touch-indicator 0.6s forwards;
}

@keyframes touch-indicator {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}