/* ============================
   SCENE PAGE
   ============================ */

.scene-page {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: #F5F5F5;
}

/* === MODEL VIEWER === */
.scene-viewer {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.scene-viewer model-viewer {
    width: 100%;
    height: 100%;
    --poster-color: #F5F5F5;
}

/* === INFO PANEL (левый верхний угол) === */
.scene-info {
    position: absolute;
    top: 150px;
    left: 40px;
    z-index: 10;
    max-width: 470px;
}

.scene-info-title {
    font-size: 39px;
    font-weight: 700;
    color: #090909;
    line-height: 1.2;
}

.scene-info-author {
    font-size: 16px;
    font-weight: 500;
    color: #090909;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 25px;
    transition: color 0.2s ease;
}

.scene-info-author:hover {
    color: #4B96FF;
}

.scene-info-desc {
    font-size: 14px;
    font-weight: 400;
    color: #090909;
    line-height: 1.2;
    margin: 0 0 10px;
    opacity: 0.7;
}

/* Мета: размер + просмотры */
.scene-info-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
}

.scene-info-size {
    font-size: 14px;
    font-weight: 500;
    color: #4B96FF;
}

.scene-info-views {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 500;
    color: #4B96FF;
}

.scene-info-views svg {
    flex-shrink: 0;
}

/* === QR BLOCK === */
.scene-qr {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.scene-qr-box {
    width: 150px;
    height: 150px;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;    
}

.scene-qr-box canvas,
.scene-qr-box img {
    width: 120px !important;
    height: 120px !important;
    border-radius: 0;
}

.scene-qr-label {
    font-size: 12px;
    font-weight: 500;
    color: #090909;
    opacity: 0.4;
}

/* === MOBILE AR BUTTON === */
.scene-ar-btn {
    display: none;
}

/* === MOBILE HELP BUTTON === */
.scene-help-btn {
    display: none;
}

/* === INSTRUCTION POPUP === */
.instruction-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    pointer-events: none;
    transition: filter 0.4s ease;
}

.instruction-overlay.active {
    pointer-events: auto;
}

.instruction-popup {
    position: fixed;
    bottom: 105px;
    left: 20px;
    right: 20px;
    height: 290px;
    background: #090909;
    border-radius: 17px;
    z-index: 150;
    padding: 0;
    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.5s cubic-bezier(0.165, 0.84, 0.44, 1),
                transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    pointer-events: none;
}

.instruction-overlay.active .instruction-popup {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.instruction-title {
    font-size: 20px;
    font-weight: 700;
    color: #F5F5F5;
    margin: 0;
    padding: 0;
    /* 34px от верха блока до baseline ≈ ~14px padding-top + line-height */
    position: absolute;
    top: 14px;
    left: 34px;
}

.instruction-list {
    position: absolute;
    top: 70px;
    left: 10px;
    right: 17px;
    bottom: 20px;
    list-style: decimal;
    list-style-position: outside;
    margin: 0;
    padding: 0 0 0 20px;
    overflow-y: auto;
}

.instruction-list li {
    font-size: 13px;
    font-weight: 400;
    color: #F5F5F5;
    line-height: 1.55;
    margin-bottom: 10px;
    padding-left: 4px;
}

.instruction-list li::marker {
    color: #F5F5F5;
    font-weight: 500;
}

.instruction-close {
    position: absolute;
    top: 17px;
    right: 17px;
    width: 16px;
    height: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.instruction-close span {
    display: block;
    width: 22.6px;
    height: 2px;
    background: #F5F5F5;
    border-radius: 1px;
    position: absolute;
    top: 50%;
    left: 50%;
}

.instruction-close span:first-child {
    transform: translate(-50%, -50%) rotate(45deg);
}

.instruction-close span:last-child {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* ============================
   MOBILE
   ============================ */
@media (max-width: 768px) {

    .scene-page {
        height: 100vh;
        height: 100dvh;
    }

    .scene-info {
        top: 80px;
        left: 20px;
        right: 20px;
        max-width: none;
    }

    .scene-info-title {
        font-size: 22px;
    }

    .scene-info-author {
        font-size: 12px;
    }

    .scene-info-desc {
        font-size: 14px;       
    }

    /* QR прячем на мобилке */
    .scene-qr {
        display: none;
    }

    /* Кнопка AR */
    .scene-ar-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 35px;
        left: 50%;
        transform: translateX(-50%);
        height: 35px;
        padding: 0 17px;
        background: #4B96FF;
        color: #FFFFFF;
        font-size: 14px;
        font-weight: 600;
        border: none;
        border-radius: 18px;
        cursor: pointer;
        z-index: 15;
        text-decoration: none;
        white-space: nowrap;
        transition: background 0.2s ease;
    }

    .scene-ar-btn:active {
        background: #3A7FE0;
    }

    /* Кнопка ? */
    .scene-help-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 35px;
        left: 20px;
        width: 35px;
        height: 35px;
        background: #090909;
        color: #FFFFFF;
        font-size: 16px;
        font-weight: 700;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        z-index: 15;
    }

    /* Instruction popup на мобилке — fixed */
    .instruction-popup {
        position: fixed;
    }
}
