/* ---------------------------------------------
   RESET ET BASE
--------------------------------------------- */
body {
    margin: 0;
    font-family: Arial, sans-serif;
}

img {
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* ---------------------------------------------
   GRILLE
--------------------------------------------- */
.grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-gap: 10px;
    padding: 10px;
}

.grid-item {
    aspect-ratio: 1;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
}

.quadrant {
    width: 50%;
    height: 50%;
}

/* ---------------------------------------------
   COULEURS
--------------------------------------------- */
:root {
    --color1: #5475B9;
    --color2: #EC362C;
    --color3: #408E43;
    --color4: #4BA1D8;
    --color5: #FEE500;
    --color6: #000000;
    --color7: #FFFFFF;
}

/* ---------------------------------------------
   DIAPORAMA PLEIN ÉCRAN
--------------------------------------------- */
#fullScreenImage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    justify-content: center;
    align-items: center;
    background-color: rgba(0,0,0,0.9);
    z-index: 1000;
    transition: opacity 0.5s ease;
    opacity: 0;
}

#fullScreenImage.show {
    display: flex;
    opacity: 1;
}

#fullScreenImage img {
    max-width: 90%;
    max-height: 90%;
    transform: scale(0.8);
    transition: transform 0.5s ease;
    border-radius: 10px;
    object-fit: contain;
}

#fullScreenImage.show img {
    transform: scale(1);
}

/* ---------------------------------------------
   GAME OVER MESSAGE
--------------------------------------------- */
#gameOverMessage {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 0, 0, 0.9);
    color: white;
    font-size: 3rem;
    padding: 40px 60px;
    border-radius: 20px;
    z-index: 2000;
    text-align: center;
    box-shadow: 0 0 20px black;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#gameOverMessage.show { opacity: 1; }
.hidden { display: none; }

/* ---------------------------------------------
   ANIMATION SHAKE POUR GAME OVER
--------------------------------------------- */
@keyframes shake {
  0% { transform: translate(0px, 0px); }
  25% { transform: translate(-5px, 0px); }
  50% { transform: translate(5px, 0px); }
  75% { transform: translate(-5px, 0px); }
  100% { transform: translate(0px, 0px); }
}

.grid-item.game-over::after {
    content: "";
    position: absolute;
    top:0; left:0; right:0; bottom:0;
    background-color: rgba(255,0,0,0.5);
    pointer-events: none;
    z-index: 10;
}

.grid-item.game-over {
    animation: shake 0.5s;
    position: relative;
}

/* ---------------------------------------------
   SCROLL HINT
--------------------------------------------- */
.scroll-hint {
    position: fixed;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0.4;
    animation: fadeIn 1s ease forwards;
    transition: opacity 0.4s ease;
    z-index: 999;
    pointer-events: none;
}

.scroll-hint .arrow {
    font-size: 16px;
    color: #000;
    animation: pulse 1.8s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 0.4; }
}

/* ---------------------------------------------
   VIDEO DE SIGNATURE
--------------------------------------------- */
.signature-video {
  position: fixed;
  bottom: 20px;                /* distance depuis le bas */
  left: 50%;                   /* centré horizontalement */
  transform: translateX(-50%);
  width: 300px;                /* largeur plus grande */
  height: auto;
  opacity: 0.85;               /* légèrement visible */
  z-index: 1000;
  pointer-events: none;        /* n'interfère pas avec le diaporama */
  transition: opacity 1s ease;
  border-radius: 20px;         /* bords arrondis */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.signature-video video {
  width: 100% !important;
  height: auto !important;
  max-width: 300px !important;   /* correspond à la largeur du conteneur */
  max-height: 225px !important;  /* proportion 4:3 */
  object-fit: cover;             /* recadrage élégant si nécessaire */
  border-radius: 20px;           /* bords arrondis pour la vidéo elle-même */
}

/* ---------------------------------------------
   ANIMATIONS POUR LE DIAPORAMA
--------------------------------------------- */
@keyframes fadeInOut{0%{opacity:0;}20%,80%{opacity:1;}100%{opacity:0;}}
@keyframes zoomIn{0%{transform:scale(0.8);}50%{transform:scale(1.1);}100%{transform:scale(1);}}
@keyframes zoomOut{0%{transform:scale(1.2);}100%{transform:scale(1);}}
@keyframes slideLeft{0%{transform:translateX(100%);}100%{transform:translateX(0);}}
@keyframes slideRight{0%{transform:translateX(-100%);}100%{transform:translateX(0);}}
@keyframes rotateIn{0%{transform:rotate(-90deg) scale(0.5);}100%{transform:rotate(0) scale(1);}}
@keyframes glitch{0%{clip-path:inset(0 0 90% 0);}20%{clip-path:inset(10% 0 80% 0);}40%{clip-path:inset(20% 0 70% 0);}60%{clip-path:inset(30% 0 60% 0);}80%{clip-path:inset(10% 0 80% 0);}100%{clip-path:inset(0 0 90% 0);}}

#fullScreenImage img.animate-fade{animation:fadeInOut 3s ease;}
#fullScreenImage img.animate-zoom-in{animation:zoomIn 2s ease;}
#fullScreenImage img.animate-zoom-out{animation:zoomOut 2s ease;}
#fullScreenImage img.animate-slide-left{animation:slideLeft 1s ease;}
#fullScreenImage img.animate-slide-right{animation:slideRight 1s ease;}
#fullScreenImage img.animate-rotate{animation:rotateIn 1.2s ease;}
#fullScreenImage img.animate-glitch{animation:glitch 0.8s steps(8,end);}

.art-footer {
  text-align: left;
  padding: 30px;
  background-color: #f8f5ef;
  font-family: 'Playfair Display', serif;
  border-top: 2px solid #d4c4a8;
  color: #3b2f2f;
  font-style: italic;
}

.art-footer p {
  margin: 5px 0;
  font-size: 1.3em;
  letter-spacing: 0.5px;
}

.art-footer .en {
  color: #7a6f66;
  font-size: 0.9em;
}

#progress-container {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 500px;
    height: 20px;
    background: rgba(200,200,200,0.3);
    border-radius: 10px;
    overflow: hidden;
    z-index: 9999;
    display: flex;
    align-items: center;
}

#progress-bar {
    height: 100%;
    width: 0%; /* Commence à 0% */
    background: linear-gradient(90deg, #4caf50, #00e676, #4caf50);
    background-size: 200% 100%;
    border-radius: inherit;
    animation: moveGradient 3s linear infinite; /* gradient animé */
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.8);
    transition: width 0.4s ease; /* largeur animée */
}


#progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    font-weight: bold;
    color: #fff;
    font-size: 0.9em;
    pointer-events: none;
}

#video-container {
    padding: 20px;
    text-align: center;
    background-color: #f0f0f0;
    border-top: 2px solid #d4c4a8;
}

#video-container video {
    margin: 10px;
    max-width: 100%;
    border-radius: 10px;
}

/* Lien vers la page bonus vidéos */
#bonus-link {
    display: block;
    margin: 10px auto 0 auto;   /* Centré et avec un peu d'espace au-dessus */
    padding: 8px 15px;
    background-color: #4caf50;  /* Vert pour attirer l’œil */
    color: white;
    font-weight: bold;
    font-size: 1em;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    cursor: pointer;
    max-width: 250px;
}

#bonus-link:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

#progress-container {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 500px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    overflow: hidden;
    z-index: 9999;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

#progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4caf50, #00e676, #4caf50);
    background-size: 200% 100%;
    border-radius: inherit;
    animation: moveGradient 3s linear infinite;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.8);
    transition: width 0.4s ease;
}

@keyframes moveGradient {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

#progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    font-weight: 500;
    color: #fff;
    font-size: 0.9em;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
    letter-spacing: 0.5px;
}

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600&family=Cinzel:wght@500&display=swap');

#progress-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.0em;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 0 8px rgba(0,0,0,0.6);
    letter-spacing: 1px;
    font-style: italic;
    transition: transform 0.3s ease, text-shadow 0.3s ease;
}

#progress-text:hover {
    transform: scale(1.05);
    text-shadow: 0 0 15px rgba(255,255,255,0.8);
}

/* ---------------------------------------------
   EFFET VISUEL - PÉNALITÉ GAME OVER
--------------------------------------------- */
#progress-bar.penalty {
  animation: penaltyFlash 0.8s ease;
}

@keyframes penaltyFlash {
  0%   { background: linear-gradient(90deg, #ff1744, #ff5252); box-shadow: 0 0 15px rgba(255, 0, 0, 0.8); }
  50%  { background: linear-gradient(90deg, #b71c1c, #ff1744); box-shadow: 0 0 25px rgba(255, 0, 0, 1); }
  100% { background: linear-gradient(90deg, #4caf50, #81c784); box-shadow: none; }
}

/* ---------------------------------------------
   TRANSITIONS LÉGÈRES POUR LE DIAPORAMA
--------------------------------------------- */
#fullScreenImage img {
    transition: opacity 0.6s ease, transform 0.6s ease;
    opacity: 0;
    transform: scale(1);
}

#fullScreenImage img.show {
    opacity: 1;
}

.fade {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.fade.show {
    opacity: 1;
}

.zoom {
    transform: scale(0.95);
    transition: transform 0.6s ease, opacity 0.6s ease;
    opacity: 0;
}

.zoom.show {
    transform: scale(1);
    opacity: 1;
}

.slide-left {
    transform: translateX(20px);
    opacity: 0;
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.slide-left.show {
    transform: translateX(0);
    opacity: 1;
}

.slide-right {
    transform: translateX(-20px);
    opacity: 0;
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.slide-right.show {
    transform: translateX(0);
    opacity: 1;
}

/* ---------------------------------------------
   EFFET DE PROFONDEUR SUR LA GRILLE
--------------------------------------------- */

.grid {
  perspective: 800px; /* Nécessaire pour les effets 3D */
}

.grid-item {
  background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(0,0,0,0.05));
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transform-style: preserve-3d;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-item:hover {
  transform: translateY(-8px) rotateX(5deg) rotateY(-5deg);
  box-shadow: 0 15px 25px rgba(0,0,0,0.3);
}

.grid-item:active {
  transform: translateY(2px) scale(0.97);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2) inset;
}

/* Légère lueur interne pour effet "flottant" */
.grid-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255,255,255,0.25), transparent 70%);
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;
}

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@1,500&family=Great+Vibes&display=swap');

#intro-hint {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.6), rgba(255,255,255,0.15));
  backdrop-filter: blur(6px);
  padding: 1.5rem 2rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  color: #2c2c2c;
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
  text-align: center;
  text-shadow: 0 1px 2px rgba(255,255,255,0.8);
  opacity: 0;
  animation: fadeIn 2.5s ease-out forwards, fadeOut 3s ease-in 8s forwards, float 5s ease-in-out infinite;
  z-index: 9999;
}

#intro-hint span {
  background: linear-gradient(90deg, #5f4b8b, #c06c84, #f67280, #c06c84, #5f4b8b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -48%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}
@keyframes fadeOut {
  to { opacity: 0; visibility: hidden; }
}
@keyframes float {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, -52%); }
}

.grid-item.demo {
    animation: demoPulse 2.5s ease-in-out infinite;
    z-index: 10;
}

@keyframes demoPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 12px rgba(255,255,255,0.3); }
  25% { transform: scale(1.06); box-shadow: 0 0 30px rgba(255,255,255,0.6); }
  50% { transform: scale(1); box-shadow: 0 0 12px rgba(255,255,255,0.3); }
  75% { transform: scale(1.06); box-shadow: 0 0 30px rgba(255,255,255,0.6); }
}

.grid-item .halo-demo {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin-left: -12px;
    margin-top: -12px;
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: haloClick 1.6s ease-out forwards;
}

@keyframes haloClick {
    0% { transform: scale(1); opacity: 0.8; }
    70% { transform: scale(2.5); opacity: 0.2; }
    100% { transform: scale(3); opacity: 0; }
}

/* ---------------------------------------------
   SPLASH SCREEN FRANÇOIS GUITTON
--------------------------------------------- */
#splash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #0d0d0d;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  opacity: 1;
  transition: opacity 2s ease;
}

#splash img {
  max-width: 60%;
  height: auto;
  filter: drop-shadow(0 0 30px rgba(128, 0, 255, 0.6));
  animation: fadeInSplash 2s ease-in-out;
}

@keyframes fadeInSplash {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Quand le splash disparaît */
body.loaded #splash {
  opacity: 0;
  pointer-events: none;
}
