:root {
    --main-v-color: #d7ccff;
    --bg-v-color: rgba(134, 102, 159, 0.3);
}

body {
    margin: 0;
    overflow: hidden;
    /* Using a system font stack for a modern feel */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(-135deg, #100021 25%, #2a0055 100%); /* Made gradient a bit darker/richer */
}

h1, h2 {
    font-family: 'Jura', sans-serif;
}

#menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    /* Removed gap from here, moved to .menu-card */
}

.menu-card {
    position: relative; /* For pseudo-element */
    z-index: 1; /* Establishes stacking context */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border: 1px solid white;
    min-width: 25vw; /* Adjusted min-width */
    max-width: 25vw; /* Changed max-width */
    clip-path: polygon(20px 0, calc(100% - 20px) 0, 100% 20px, 100% calc(100% - 20px), calc(100% - 20px) 100%, 20px 100%, 0 calc(100% - 20px), 0 20px);
}





#menu h1 {
    color: #f0e8ff;
    font-size: 3rem;
    font-weight: 300; /* Thinner font */
    margin: 0;
    text-shadow: 0 0 15px rgba(200, 180, 255, 0.5), 0 0 30px rgba(200, 180, 255, 0.3);
}
#menu h2 {
    color: #d7ccff;
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0;
}
#hud {
    position:absolute;
    top:20px;
    left:20px;
    /*border: 1px solid var(--main-v-color);*/
    border-radius:8px;
    color:var(--main-v-color);
    /*text-shadow: 0 0 10px var(--main-v-color), 0 0 20px var(--main-v-color);*/
}
#timer { font-size:1.2rem; color:#fff; }
#level { font-size:1.3rem; margin-bottom:10px; }

#health-display {
         position: absolute;
         top: 20px; /* Ajustez selon vos besoins */
         left: 50%;
         transform: translateX(-50%);
         display: flex;
         align-items: center;
         padding: 10px 16px 10px 15px;
    gap: 1em;
         font-family: 'Roboto', monospace; /* Ou une police de votre choix */
    font-weight: bold;
    letter-spacing: 3px;
    color: darkgrey;
         font-size: 20px;
         z-index: 1000; /* Assurez-vous qu'il est au-dessus des autres éléments */
     }

#health-display-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

#health-bar-container {
    width: 18vw;
    height: 25px;
    background-color: rgba(0, 0, 0, 0.4);
    clip-path: polygon(
            10px 0%,
            100% 0%,
            100% 100%,
            10px 100%,
            0% 80%,
            0% 20%
    );
}

 #health-bar-fill {
            height: 100%;
            width: 100%; /* Sera ajusté par JavaScript */
            background: linear-gradient(to right, #BC2727, #601C1C); /* Dégradé rouge-orange */
            transition: width 0.3s ease-in-out; /* Animation douce lors du changement de largeur */
     clip-path: polygon(
             10px 0%,
             100% 0%,
             100% 100%,
             10px 100%,
             0% 80%,
             0% 20%
     );
        }

#health-text {
           min-width: 40px; /* Pour éviter que le texte ne bouge trop */
           text-align: right;
       }


#quitBtn-wrapper {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100; /* Ensure it's on top */
}

.victory-buttons {
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    gap: 0.5rem; /* Space between buttons */
    width: 100%; /* Ensure it takes full width */
    align-items: center; /* Center buttons horizontally within this container */
}

.victory-buttons button.dl-btn {
    margin: 0; /* Remove all inherent margins */
}

#victory,#defeat {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* display is handled by JS and inline style */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background: rgba(0,0,0,0.5); /* Semi-transparent black background */
    backdrop-filter: blur(5px);
    color: #f0e8ff; /* Light text color for contents */
}

#victory p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--main-v-color);
}

.victory-stats {
    display: grid;
    grid-template-columns: auto auto;
    gap: 10px 15px;
    padding: 15px 20px; /* Add padding */
    /*background-color: rgba(0, 0, 0, 0.3); !* Slightly darker background *!*/
    border-radius: 8px; /* Rounded corners */
    font-size: 1.2rem;
    align-items: center;
    width: 100%; /* Take full available width */
    box-sizing: border-box; /* Include padding and border in the element's total width */
}

.victory-stats-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Small gap between h2 and stats table */
    width: 100%; /* Ensure it spans full width */
    align-items: center; /* Center its content */
}

.victory-stats-section > div { /* Targets the direct div children of .victory-stats-section */
    width: 100%;
}

.victory-buttons-section {
    width: 100%;
}

#victory h2 {
    width: 100%;
    color: #d7ccff;
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0; /* Set margin to 0 to let parent gap control spacing */
    padding: 8px 0; /* Add padding */
    background-color: rgba(0, 0, 0, 0.2); /* Slightly darker background */
    border-radius: 5px; /* Rounded corners */
    text-align: center;
}

#victory h1 {
    margin: 0; /* Remove default browser margins */
}

.stat-label {
    font-weight: bold;
    text-align: left;
    color: #fff;
}

.stat-value {
    text-align: right;
    color: var(--main-v-color);
}

#levelSelector {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem; /* Adjusted gap */
    padding: 1rem;
}

#levelSelector .dl-btn {
    width: 60px !important;
    height: 60px !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#startBtn {
    width: auto !important; /* Override width: 100% from dl-btn */
    padding: 10px 40px !important; /* Set a reasonable padding */
    margin: 0 !important;
}

#levelSelector .dl-btn.active {
    border-color: white;
    /* Active state uses the same gradient as dl-btn:hover */
    background-image: linear-gradient(45deg, #601C1C, #BC2727) !important;
}

#pause-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background: rgba(0,0,0,0.5); /* Semi-transparent black background */
    backdrop-filter: blur(5px);
}
#pause-menu .menu-card {
    min-width: 20%;
    max-width: 20%;
}

#pause-menu .menu-card .dl-btn {
    width: 100%;
    margin: 0.5rem 0;
    padding: 10px 30px;
}

#minimap-wrapper {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 200px;
    height: 200px;
    background: rgba(40, 40, 40, 0.7);
    clip-path: polygon(55px 0, calc(100% - 55px) 0, 100% 55px, 100% calc(100% - 55px), calc(100% - 55px) 100%, 55px 100%, 0 calc(100% - 55px), 0 55px);
    transition: all 0.3s ease-in-out;
}

#minimap-wrapper.large-map {
    width: 600px;
    height: 600px;
    /* Keep it in the bottom right corner */
    bottom: 20px;
    right: 20px;
    transform: none; /* Remove previous transform for centering */
    clip-path: none; /* Optional: remove clipping for the large map */
    border-radius: 15px; /* Optional: add some rounding */
    border: 2px solid lightgrey; /* Add a CSS border for the large map */
}

#minimap {
    width: 100%;
    height: 100%;
}

#victory h1, #defeat h1 {
    display: flex;
    justify-content: center;
    font-size: larger;
    padding: 10px 20px;
    border-radius: 8px;
}

#victory h1 {
    /* Styles moved to .victory-title */
}

.challenge-title {
    /*margin-bottom: 20px; !* Space below the title *!*/
    width: 100%;
}

.victory-title {
    background-color: rgba(0, 100, 0, 0.5); /* Green background for victory title */
    border-radius: 8px;
}

.defeat-title {
    background-color: rgba(100, 0, 0, 0.5); /* Red background for defeat title */
    border-radius: 8px;
}


