body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    max-height: 100vh;
    max-width: 100vw;
    overflow: hidden;
    font-size: 16px;
}

.white{
    color: white;
}
.fs-3{
    font-size: 3rem;
}
.mw-80{
    max-width: 80%;
    margin: 0 auto;
}
.text-center{
    text-align: center;
}
/* =================================
    STYLES COMMUNS DES BOUTONS
    ================================= */

button, .btn {
    padding: 20px 40px;
    font-size: 18px;
    font-weight: bold;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    transform-style: preserve-3d;
    position: relative;
}

button:hover:not(:disabled), .btn:hover:not(:disabled) {
    transform: translateY(-2px) rotateZ(3deg);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

button:active:not(:disabled), .btn:active:not(:disabled),
button.clicked:not(:disabled), .btn.clicked:not(:disabled) {
    animation: flipButton 0.45s ease;
}

button:disabled, .btn:disabled {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes flipButton {
    0% {
        transform: perspective(600px) rotateZ(3deg);
    }
    80% {
        transform: perspective(600px) rotateZ(30deg);
        color: transparent;
    }
    100% {
        transform: perspective(600px) rotateZ(-5deg) rotateX(60deg);
        color:transparent;
    }
}

/* Overlay d'introduction */

.title-container{
    position: relative;
}
.title-container .hand {
    position: absolute;
    font-size: 48px;
    transition: all 0.8s ease-out;
}
.title-container .hand.first {
    top:0;
    left: -60px;
}
.title-container .hand.second {
    bottom:0;
    right: -60px;
}
body.introduction .title-container .hand.first {
    left: -400px;
    top: -200px;
    opacity: 0.4;
}
body.introduction .title-container .hand.second {
    right: -400px;
    bottom: -200px;
    opacity: 0.4;
}
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000000eb 0%, #0000005f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(28px);
}

.intro-content {
    text-align: center;
    color: white;
    padding: 40px;
    max-width: 600px;
}

.intro-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    animation: fadeInDown 0.8s ease;
}

.intro-content p {
    font-size: 20px;
    margin-bottom: 40px;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease 0.2s both;
}

#intro-btn {
    /*animation: fadeInUp 0.8s ease 0.4s both;*/
}
#intro-btn.disabled {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
}
.intro-button-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}
.choose-player-number-btn{
    padding: 15px 30px;
    font-size: 16px;
    background-color: #ccc;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}
.choose-player-number-btn.selected {
    background-color: #28a745;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Écran d'accueil */
#start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000c2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 41;
    overflow: hidden;

    backdrop-filter: blur(28px);
}
#start-overlay.hidden {
    display: none;
}

#start-btn {
    padding: 30px 60px;
    font-size: 32px;
    margin-top: 30px;
    margin-bottom: 30px;
}

#start-btn.ready {
    background-color: #28a745;
    color: white;
}

/* Container des challenges */
.challenges-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    max-width: 1400px;
    width: 100%;
    padding: 0;
    
    position: absolute;
    z-index: 42;
    width: 20vw;
    height: 100vh;
    background: #00c3ff70;
    left: 0;
    overflow: auto;

    display: none; /* masqué dev */
}

/* Scrollbar personnalisée pour Chrome/Edge/Safari */
.challenges-container::-webkit-scrollbar {
    width: 6px;
}

.challenges-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.challenges-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.challenges-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Scrollbar pour Firefox */
.challenges-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.1);
}

.icon{
    font-size: 6em;
}

#colors_container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    
}
.color-encart{
    width: 10%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 2px solid #fff;
}
.color-encart.bleu{
    background-color: #0e12df;
}
.color-encart.rouge{
    background-color: #ff0000;
}
.color-encart.vert{
    background-color: #00ff00;
}
.color-encart.jaune{
    background-color: #ffff00;
}
.color-encart.violet{
    background-color: #8a2be2;
}
.color-encart.rose{
    background-color: #ff69b4;
}
.color-encart.orange {
    background-color: #f8510f;
}
.color-encart.gris {
    background-color: #808080;
}
/* Cartes de menu */
/*
.menu__container {
width: 200px;
height: 300px;
border-radius: 5px;
cursor: pointer;
box-shadow: 0 10px 40px 2px rgba(0, 0, 0, 0.4);
background: #000;
transform-origin: center center 0px;
transition: all 0.5s ease-out;
animation-name: animate;
animation-duration: 3s;
animation-iteration-count: infinite;
transform: perspective(1000px) rotateX(35deg) rotateY(4deg) rotateZ(-30deg) scale(0.75);
z-index: 1;
}

.menu__container.active {
animation: activateCard 2s cubic-bezier(0.4, 0.0, 0.2, 1.2) forwards;
}

.menu__container.removeActive {
animation: deactivateCard 2s cubic-bezier(0.6, 0.0, 0.4, 1) forwards;
}


.menu__container.active::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border-radius: 5px;
background: linear-gradient(135deg, #ff8c00 0%, #ff8c00 10%, #ffb152 16%, #ff8c00 19%,#ff6600 50%, #ff8c00 100%);
opacity: 0;
animation: fadeInGradient 3s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
z-index: -1;
}

.menu__container.removeActive::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border-radius: 5px;
background: linear-gradient(135deg, #ff8c00 0%, #ff8c00 10%, #ffb152 16%, #ff8c00 19%,#ff6600 50%, #ff8c00 100%);
opacity: 1;
animation: fadeOutGradient 2s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
z-index: -1;
}

@keyframes activateCard {
0% {
transform: perspective(1000px) rotateX(35deg) rotateY(4deg) rotateZ(-30deg) translateY(0px) translateX(0px) scale(0.75);
}

100% {
transform: perspective(1000px) rotateX(0deg) rotateY(0deg) rotateZ(0deg) translateY(4px) translateX(0px) scale(1);
}
}

@keyframes deactivateCard {
0% {
transform: perspective(1000px) rotateX(0deg) rotateY(0deg) rotateZ(0deg) translateY(4px) translateX(0px) scale(1);
}

100% {
transform: perspective(1000px) rotateX(35deg) rotateY(4deg) rotateZ(-30deg) translateY(0px) translateX(0px) scale(0.75);
}
}

@keyframes fadeInGradient {
0% {
opacity: 0;
}

100% {
opacity: 1;
}
}

@keyframes fadeOutGradient {
0% {
opacity: 1;
}

100% {
opacity: 0;
}
}

.challenge-content {
text-align: center;
}

.challenge-name {
font-size: 20px;
font-weight: bold;
margin-bottom: 15px;
color: #fff;
}

.challenge-notice {
font-size: 14px;
line-height: 1.5;
color: #ddd;
}

.menu__container:not(.active) .challenge-name,
.menu__container:not(.active) .challenge-notice,
.menu__container:not(.active) .icon {
filter: blur(6px);
}

@keyframes animate {
0% {
transform: perspective(1000px) rotateX(35deg) rotateY(4deg) rotateZ(-30deg) translateY(0px) scale(0.75);
}

50% {
transform: perspective(1000px) rotateX(35deg) rotateY(4deg) rotateZ(-30deg) translateY(-10px) scale(0.75);
}

100% {
transform: perspective(1000px) rotateX(35deg) rotateY(4deg) rotateZ(-30deg) translateY(0px) scale(0.75);
}
}

*/

/* simple menu */
.menu__container .icon {
    display: none;
}
.menu{
    padding: 0 10px;
    margin: 10px 0;
}
.menu__container {
    width: 200px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    background: #667eea;
    transform-origin: center center 0px;
    transition: all 0.3s ease;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;        
    align-items: center;
    transform-style: preserve-3d;
}   

.menu__container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.menu__container:active {
    animation: flipButton 0.6s ease;
}

.menu__container.active {
    background: linear-gradient(135deg, #ff8c00 0%, #ff8c00 10%, #ffb152 16%, #ff8c00 19%,#ff6600 50%, #ff8c00 100%);
}

.menu__container.removeActive {
    background: #667eea;
}
.challenges-list{
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
}











.menu {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    height: 100%;
    color: #fff;
    padding: 20px;
}



/* Interface principale */
#main-interface {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    /*aspect-ratio: 4 / 3;*/
    height: 100vh;
    width: 100vw;
}
#video-wrapper{
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    background: #090909;
}
#video {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#canvas {
    display: none;
}        
#overlay-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}        
.countdown {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    z-index: 39;
    transition: background 1s ease-out;
}

.countdown.transparent-bg {
    background: rgba(0, 0, 0, 0);
}

.countdown-number {
    font-size: 200px;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.8),
    0 0 60px rgba(255, 255, 255, 0.6);
    animation: pulse 1s ease-in-out infinite;
    transition: font-size 10s ease-out, opacity 3s ease-out;
}

.countdown-number.shrink {
    font-size: 100px;
}

.countdown-number.fade-out {
    opacity: 0.6;
    top: 70%;
    left: 80%;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0;
    }
    50% {
        transform: scale(1.4);
        opacity: 0.8;
    }
}        
.toggle-btn {
    padding: 10px 20px;
    font-size: 14px;
    background-color: #667eea;
    z-index: 5;
}

.toggle-btn.active {
    background-color: #28a745;
}
.controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 5;

    display: none; /* masqué dev */
}

.capture-btn {
    padding: 15px 30px;
    font-size: 18px;
    background-color: #667eea;
}
.instruction-panel {
    position: fixed;
    top: 5%;
    bottom: 0%;
    right: 50%;
    transform: translateX(50%);
    width: 80vw;
    max-width: 800px;
    background: transparent;
    color: white;
    padding: 40px 60px;
    border-radius: 20px;
    z-index: 39;
    text-align: left;
    transition: all 1.5s ease-in-out;
}
.instruction-panel h2 {
    font-size: 48px;
    margin: 0 0 20px 0;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transition: all .5s ease-in-out;
}

.instruction-panel p {
    font-size: 32px;
    margin: 0;
    line-height: 1.4;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    transition: all .5s ease-in-out;
}
.instruction-panel.invisible {
    display: none;
}
.instruction-panel.hidden {

    pointer-events: none;
    bottom: auto;
    top: 70%;
    right: 0%;
    left: auto;
    width: 30%;
    transform: translateX(0);
}
.instruction-panel.hidden h2{
    font-size: 24px;
    opacity: 0;
}
.instruction-panel.hidden p{
    font-size: 16px;
    opacity: 0;
}
#photo-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    z-index: 200;
}
#photo-container #stars-container{
    display: flex;
    gap: 10px;
    justify-content: center;
    font-size: 40px;
}
#photo-container #stars-container .star{
    color: #202020;
}
#photo-container #stars-container .star.filled {
    color: #dfc902;
}
#photo {
    max-width: 80vw;
    max-height: 70vh;
    border: 2px solid #333;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    display: block;
}

.close-photo-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 201;
}

.close-photo-btn:hover {
    background: rgba(255, 0, 0, 0.8);
}

/* Debug upload */
.debug-upload-wrapper {
    text-align: center;
    background: #eaeaea;
    padding: 10px;
    width: 50%;
    margin: 20px auto 0 auto;
    border-radius: 6px;
}

.debug-upload-label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.debug-upload-input {
    font-size: 12px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    cursor: pointer;
}

#rate-wrapper {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translate(-50%, 10vh);
    z-index: 200;
}
#rate-btn {
    padding: 15px 30px;
    font-size: 18px;
    background-color: #28a745;
    display: none;
    z-index: 200;
}
.loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 5px solid #f3f3f3;
    border-top: 5px solid #007bff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    display: none;
    z-index: 231;
}
@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
#result {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 30px;
    border-radius: 5px;
    display: none;
    z-index: 232;
    font-size: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
#result.success {
    background-color: #d4eddaab;
    color: #155724;
    border: 1px solid #c3e6cb96;
}
#result.error {
    background-color: #f8d7dacc;
    color: #721c24;
    border: 1px solid #f5c6cbe7;
}

/* =================================
    PLAYER AUDIO D'AMBIANCE
    ================================= */

#ambiance-player {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
}

.ambiance-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.ambiance-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.ambiance-btn:active {
    transform: scale(0.95);
}

.volume-menu {
    position: absolute;
    bottom: 70px;
    left: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.volume-menu.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.volume-btn {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: #f0f0f0;
    border: 2px solid transparent;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.volume-btn:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.volume-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #764ba2;
}

.volume-btn:active {
    transform: scale(0.95);
}

/* =================================
    MENU TOGGLE (BURGER)
    ================================= */

#menu-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.menu-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: white;
}

.menu-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.menu-btn:active {
    transform: scale(0.95);
}

.menu-dropdown {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 250px;
}

.menu-dropdown.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.menu-item {
    padding: 12px 16px;
    border-radius: 8px;
    background: #f0f0f0;
    border: 2px solid transparent;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    white-space: nowrap;
    color: #333;
}

.menu-item:hover {
    background: #e0e0e0;
    transform: translateX(-3px);
}

.menu-item:active {
    transform: scale(0.98);
}

#debug-status {
    font-weight: bold;
    color: #667eea;
}
