html, body { 
    margin: 0; 
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; 
    background: #000; 
    font-family: 'Montserrat', sans-serif; 
    user-select: none; 
    -webkit-user-select: none; 
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overscroll-behavior: none; /* Clause 1.10.2 */
}

canvas { 
    display: block; 
    outline: none; 
    width: 100%;
    height: 100%;
}

/* ПРЕДОТВРАЩЕНИЕ ВЫДЕЛЕНИЯ И КОНТЕКСТНОГО МЕНЮ (Clause 1.6.1.8) */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

input, textarea {
    user-select: auto;
    -webkit-user-select: auto;
}

/* UI ОВЕРЛЕЙ */
#ui-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }

/* ЗАГРУЗОЧНЫЙ ЭКРАН НА КАНВАСЕ */
#loading-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #00A2FF;
    z-index: 9999999;
    transition: opacity 0.5s ease, visibility 0.5s;
}

#loading-canvas.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Экран паузы / старта */
#start-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); display: flex; flex-direction: column;
    justify-content: center; align-items: center; color: white; pointer-events: auto;
}
button {
    padding: 15px 40px; font-size: 24px; background: #00AAFF; color: white;
    border: none; border-radius: 8px; cursor: pointer; margin-top: 20px;
    font-weight: bold; box-shadow: 0 5px 0 #0077CC;
}
button:active { transform: translateY(5px); box-shadow: none; }

#mobile-controls {
    display: none; /* Включается через JS если мобилка */
}

/* МАГАЗИН В НЕОНОВОМ ФУТУРИСТИЧЕСКОМ СТИЛЕ */
#shop-left {
    position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
    display: flex; flex-direction: column; gap: 15px; pointer-events: auto;
}
.shop-item {
    width: 65px; height: 65px; 
    background: rgba(0, 170, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(0, 170, 255, 0.5);
    border-radius: 12px;
    display: flex; justify-content: center; align-items: center; cursor: pointer;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    position: relative;
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.2);
}
.shop-item:hover { 
    transform: scale(1.1); 
    background: rgba(0, 170, 255, 0.2);
    border-color: #00AAFF;
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.6);
}
.shop-item.owned { 
    border-color: rgba(255, 215, 0, 0.4);
}
.shop-item.active { 
    background: rgba(0, 255, 150, 0.2);
    border-color: #00FF96;
    box-shadow: 0 0 15px rgba(0, 255, 150, 0.5), inset 0 0 10px rgba(0, 255, 150, 0.2);
}
.shop-item .icon { 
    font-size: 32px; 
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}
.shop-item .price-tag {
    position: absolute; bottom: -8px; right: -5px;
    background: #FFD700; color: #000; font-size: 11px; font-weight: 900;
    padding: 2px 6px; border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
.shop-item .tooltip {
    position: absolute; left: 85px; background: rgba(0, 20, 40, 0.9);
    color: #fff; padding: 10px 15px; border-radius: 8px; font-size: 14px;
    white-space: nowrap; display: none; pointer-events: none;
    z-index: 100; border: 1px solid #00AAFF;
    font-weight: bold;
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.shop-item:hover .tooltip { display: block; }

/* ТУТОРИАЛ МЫШИ */
#mouse-tutorial {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.mouse-icon {
    width: 50px;
    height: 80px;
    border: 4px solid #fff;
    border-radius: 25px;
    position: relative;
    animation: mouseRotate 2s infinite ease-in-out;
    margin-bottom: 20px;
}

.mouse-wheel {
    width: 6px;
    height: 12px;
    background: #00FFFF;
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 3px;
    box-shadow: 0 0 10px #00FFFF;
}

.tutorial-text {
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    text-shadow: 0 0 10px #00FFFF;
    font-family: 'Montserrat', sans-serif;
}

@keyframes mouseRotate {
    0% { transform: translateX(-60px) rotate(-20deg); }
    50% { transform: translateX(60px) rotate(20deg); }
    100% { transform: translateX(-60px) rotate(-20deg); }
}

/* ПОВОРОТ ЭКРАНА (Clause 1.6.1.3) */
#orientation-prompt {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #00AAFF;
    z-index: 999999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

#orientation-prompt h2 {
    font-size: 24px;
    margin: 10px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

#orientation-prompt p {
    font-size: 18px;
    opacity: 0.9;
}

.phone-icon {
    width: 60px;
    height: 100px;
    border: 4px solid white;
    border-radius: 10px;
    margin-bottom: 20px;
    animation: rotatePhone 2s infinite ease-in-out;
    position: relative;
}

.phone-icon::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    border: 2px solid white;
    border-radius: 50%;
}

@keyframes rotatePhone {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
    100% { transform: rotate(0deg); }
}

/* ЗАГРУЗЧИК ДЛЯ ПЕРЕХОДА МЕЖДУ МИРАМИ */
.loader {
    width: 50px;
    height: 50px;
    border: 5px solid #FFF;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* АДАПТИВНОСТЬ */
@media screen and (max-width: 800px) {
    #progress-bar-wrapper {
        width: 250px;
        height: 25px;
    }
    #progress-text {
        font-size: 14px;
    }
    .level-nav-btn {
        width: 45px;
        height: 45px;
        font-size: 24px;
    }
    #top-left-ui, #top-right-ui {
        top: 10px;
    }
    #progress-container {
        top: 10px;
    }
}



