/* Réinitialisation de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Dégradé radial pour un effet de profondeur */
    background: radial-gradient(circle, #1a0b2e 0%, #090511 100%);
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 5%;
    border-radius: 20px;
    /* Bordure subtile et lueur violette */
    border: 1px solid rgba(138, 43, 226, 0.3);
    box-shadow: 0 0 40px rgba(138, 43, 226, 0.2), 
                inset 0 0 20px rgba(138, 43, 226, 0.1);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    backdrop-filter: blur(5px);
    background-image: url('./img/background.png');
    width: 80%;
    height: 80%;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    overflow: hidden;
}

.crystal {
    position: absolute;
    clip-path: polygon(41% 0%, 38% 2%, 35% 4%, 35% 5%, 37% 7%, 38% 9%, 38% 11%, 39% 12%, 41% 14%, 24% 26%, 17% 28%, 15% 29%, 14% 32%, 10% 34%, 4% 36%, 0% 43%, 0% 46%, 8% 53%, 25% 49%, 25% 85%, 49% 100%, 74% 85%, 72% 48%, 91% 54%, 100% 45%, 96% 36%, 82% 31%, 80% 28%, 80% 28%, 78% 26%, 74% 26%, 57% 13%, 59% 11%, 61% 9%, 60% 8%, 62% 6%, 61% 4%, 60% 2%, 59% 1%, 57% 0%);
    transition: all 0.3s ease;
    transform-origin: top center;
    animation: swing 3s ease-in-out infinite;
    height: 30%;
}

@keyframes swing {
    0% {
        transform: rotate(-3deg);
    }
    50% {
        transform: rotate(3deg);
    }
    100% {
        transform: rotate(-3deg);
    }
}

.crystal:hover {
    animation-play-state: paused;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 1));
    cursor: pointer;
}

#balance {
    position: relative;
    height: 70%;
    max-width: 90%;
    aspect-ratio: 1 / 1; 

    background-image: url('./img/balance.png');
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
}

#crystal1 {
    top: 16%;
    left: 0;
}

#crystal2 {
    top: 16%;
    right: 0;
}

#crystal3 {
    top: 21.5%;
    left: 15%;
}

#crystal4 {
    top: 21.5%;
    right: 15%;
}

#crystal5 {
    top: 52%;
    left: 13%;
}

#crystal6 {
    top: 53%;
    right: 13%;
}

#crystal7 {
    top: 43.5%;
    left: 28%;
}

#crystal8 {
    top: 43.5%;
    right: 28%;
}

#info-window {
    position: absolute;
    display: block;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8); /* Centrage parfait et un peu plus petit */
    
    width: 150%;
    padding: 20px;
    background: rgba(26, 11, 46, 0.95); /* Violet très sombre et opaque */
    border: 1px solid rgba(157, 78, 221, 0.5);
    border-radius: 15px;
    color: white;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    
    /* État initial : Invisible */
    opacity: 0;
    pointer-events: none; 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Effet de rebond */
    z-index: 100;
}

#info-window.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

#close-btn {
    margin-top: 15px;
    background: transparent;
    border: 1px solid #bf7bff;
    color: #bf7bff;
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
}

#close-btn:hover {
    background: #bf7bff;
    color: white;
}

.memories {
    width: 49%;
}

.img-container {
    display: flex;
    justify-content: center;
    align-items: center;
}
