/* Mobile loading screen */
.mobile-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.mobile-loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.mobile-loader-content {
    position: relative;
    width: 100%;
    height: 100%;
}

.mobile-loader-icon {
    position: absolute;
    top: calc(50% - 1.5px);
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    overflow: hidden;
}

.mobile-loader-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mobile-loader-progress-bg {
    position: absolute;
    top: calc(50% + 15px);
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background-color: #e3e3e3;
    border-radius: 1px;
    overflow: hidden;
}

.mobile-loader-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30px;
    background: linear-gradient(90deg, #e3e3e3 0%, #222 100%);
    border-radius: 1px;
    animation: mobile-loading 1.5s infinite linear;
}

@keyframes mobile-loading {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(500%);
    }
}

/* Loader now used across all devices; no desktop-specific hide */

/* Mobile-specific zoom limits using CSS */

@media only screen and (max-width: 768px), 
       only screen and (hover: none) and (pointer: coarse) {
    
    /* Only keep touch-action controls, remove transform overrides */
    html, body {
        touch-action: pan-x pan-y;
    }
    
    .canvas-container {
        touch-action: pinch-zoom pan-x pan-y;
    }
    
    /* Ensure text items maintain proper letter spacing on mobile */
    .text-item {
        letter-spacing: normal !important;
        text-rendering: optimizeLegibility !important;
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
    }
    
    /* Prevent mobile browsers from adjusting letter spacing */
    .text-item * {
        letter-spacing: inherit !important;
    }
}

