/* Style tổng quát cho Viewer */
html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    background: #000;
    overflow: hidden;
}

#renderCanvas {
    width: 100%;
    height: 100%;
    touch-action: none;
    outline: none;
}

/* Loader báo lỗi */
#loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-family: sans-serif;
    letter-spacing: 2px;
    display: none;
    z-index: 10;
}

/* Nút Fullscreen tối giản */
#fullscreenBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px); /* Làm mờ nhẹ nền phía sau nút nhìn cho sang */

    -webkit-tap-highlight-color: transparent; /* Tắt màu xanh khi chạm trên iPad */
    user-select: none;
}

#fullscreenBtn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

#fullscreenBtn svg {
    width: 20px;
    height: 20px;
    fill: rgba(255, 255, 255, 0.8);
}

/* =============================== */
/* BẢNG CHỌN MÀU (VARIANT SELECTOR)*/
/* =============================== */
#variantSelector {
    position: fixed;
    left: 10px; /* Đẩy sát lề trái */
    bottom: 1%;
    transform: translateY(-50%); /* Căn giữa dọc màn hình */
    display: flex;
    gap: 12px;
    padding: 10px;
    /* Loại bỏ background đen, dùng blur nhẹ nếu muốn hoặc để trống cho sạch */
    background: rgba(255, 255, 255, 0.2); 
    border-radius: 30px;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* Bóng đổ rất nhẹ */
}

.variant-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #e0e0e0; /* Viền xám nhẹ mặc định */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    padding: 0;
    background-color: #fff; /* Nền nút trắng */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.variant-btn:hover {
    transform: scale(1.15);
    border-color: #000;
}

.variant-btn.active {
    border-color: #000; /* Viền đen đậm khi được chọn */
    transform: scale(1.15);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.1); /* Hiệu ứng vòng ngoài khi chọn */
}

/* Set màu tĩnh cho các nút (có thể viết inline trong HTML cũng được) */
#btn-base-1 { background: #cfcfcf; } /* Màu ghi / Bạc */
#btn-base-2 { background: #2a5a8f; } /* Màu Xanh */