* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    background: #0a0a1a;
    font-family: 'Arial', sans-serif;
    height: 100vh;
    width: 100vw;
}

#scene {
    position: relative;
    width: 100%;
    height: 100vh;
    perspective: 1200px;
    overflow: hidden;
}

#background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    z-index: -2;
}

#background::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 40%),
                radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 60%);
    animation: ripple 8s infinite alternate;
    filter: blur(2px);
    opacity: 0.7;
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1.2);
        opacity: 0.9;
    }
}

#cube-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
}

#cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.face {
    position: absolute;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1),
                inset 0 0 20px rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.face::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(255, 255, 255, 0.1), 
        transparent, 
        rgba(255, 255, 255, 0.1), 
        transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.front  { transform: translateZ(150px); }
.back   { transform: rotateY(180deg) translateZ(150px); }
.right  { transform: rotateY(90deg) translateZ(150px); }
.left   { transform: rotateY(-90deg) translateZ(150px); }
.top    { transform: rotateX(90deg) translateZ(150px); }
.bottom { transform: rotateX(-90deg) translateZ(150px); }

.face-content {
    color: white;
    font-size: 24px;
    text-align: center;
    padding: 20px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
    font-weight: bold;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 20px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    width: 80%;
    height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-placeholder {
    color: rgba(255, 255, 255, 0.8);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-size: contain; /* Better for preserving aspect ratio */
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent; /* Important for transparency */
    cursor: pointer;
    transition: all 0.3s ease;
    /* Keep the glass effect visible behind transparent parts */
    mix-blend-mode: lighten; /* Optional: helps transparent images blend with glass */
}

.image-placeholder:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* You can replace the placeholders with actual images by adding background-image to these selectors */
.top .image-placeholder {
    background-image: url('image1.png');
}

.bottom .image-placeholder {
    background-image: url('image2.png');
}

/* For faces with text, ensure the text is visible */
.face:not(.top):not(.bottom) .image-placeholder {
    background: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .face {
        width: 200px;
        height: 200px;
    }
    
    .face-content {
        font-size: 18px;
        padding: 15px;
    }
    
    #cube-container {
        width: 200px;
        height: 200px;
    }
    
    .front  { transform: translateZ(100px); }
    .back   { transform: rotateY(180deg) translateZ(100px); }
    .right  { transform: rotateY(90deg) translateZ(100px); }
    .left   { transform: rotateY(-90deg) translateZ(100px); }
    .top    { transform: rotateX(90deg) translateZ(100px); }
    .bottom { transform: rotateX(-90deg) translateZ(100px); }
}