/* Performance monitoring styles */
.performance-indicator {
    position: fixed;
    bottom: 60px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
    z-index: 999;
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.performance-indicator.warning {
    background: rgba(255, 50, 50, 0.7);
}

/* Touch event handling optimization for mobile */
#instructionCanvas {
    touch-action: none; /* Prevent browsers from handling touch events */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight */
    -webkit-touch-callout: none; /* Disable callout */
    -webkit-user-select: none; /* Disable selection */
    user-select: none; /* Disable selection */
    cursor: pointer; /* Show pointer cursor */
}

/* Add styles for the mobile test markers */
.mobile-test-marker {
    pointer-events: auto !important;
    cursor: pointer !important;
    transition: transform 0.2s, background-color 0.2s;
}

.mobile-test-marker:active {
    transform: translate(-50%, -50%) scale(1.2) !important;
    background-color: rgba(255, 0, 0, 0.4) !important;
}

/* Touch feedback styles */
.touch-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(2);
        opacity: 0;
    }
}

/* Add GPU acceleration hint */
.assembly-canvas {
    will-change: transform; /* Hint to browser that this element will change */
    transform: translateZ(0); /* Trigger GPU acceleration */
}

/* Device-specific styles */
@media (max-width: 767px) {
    /* Mobile optimizations */
    .assembly-canvas {
        image-rendering: optimizeSpeed; /* Older versions */
        image-rendering: -webkit-optimize-contrast; /* Safari */
        image-rendering: -o-crisp-edges; /* Opera */
        image-rendering: pixelated; /* Chrome & Firefox */
    }

    .hotspot {
        min-width: 44px; /* Accessibility minimum size */
        min-height: 44px;
    }
    
    /* Clearer feedback when touched */
    .assembly-canvas:active {
        opacity: 0.8; /* Stronger feedback when clicking on mobile */
    }
}

/* Hide certain elements on really small screens for better performance */
@media (max-width: 400px) {
    .debug-indicator label:nth-child(n+4) {
        display: none; /* Hide extra options on very small screens */
    }
}
