@font-face {
  font-family: 'LazyDog';
  src: url('/assets/fonts/lazy_dog.ttf') format('truetype');
}

@font-face {
  font-family: 'OctoberCrow';
  src: url('/assets/fonts/October_Crow.ttf') format('truetype');
}

:root {
    --primary-color: hsla(268, 100%, 7%, 0.851);
    --secondary-color: hsl(270, 100%, 14%);
    --text-color: hsl(0, 0%, 86%);
    --accent-color: hsl(141, 76%, 46%);
    --box-size: 100px;
    --game-max-width: 800px;
    --border-radius: 11px;
}

.game-container {
    max-width: var(--game-max-width);
    margin: 0 auto;
    padding: 50px;
    text-align: center;
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
}

.game-header h1 {
    color: var(--accent-color);
    font-size: 3rem;
    margin-top: 4rem;
    font-family: 'OctoberCrow', sans-serif;
    text-shadow: 0 0 10px hsl(141, 76%, 46%);
    font-weight: lighter;
}


.game-header h2 {
    color: var(--text-color);
    font-size: 1rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-family: 'LazyDog', sans-serif;
    text-shadow: 0 0 10px hsl(141, 76%, 46%);
    font-weight: lighter;
}


.game-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    background-color: var(--primary-color);
    padding: 15px;
    border-radius: var(--border-radius);
    border: 1px dashed var(--accent-color);
}

.game-options label {
    color: var(--text-color);
    font-family: 'LazyDog', sans-serif;
    text-transform: uppercase;
    font-size: 1rem;
}

.game-select {
    padding: 8px 12px;
    border-radius: var(--border-radius);
    border: 1px dashed var(--accent-color);
    background-color: var(--primary-color);
    color: var(--text-color);
    font-family: 'LazyDog', sans-serif;
    cursor: pointer;
}

.game-button {
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    border-radius: var(--border-radius);
    background-color: var(--accent-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'LazyDog', sans-serif;
    text-transform: uppercase;
}

.game-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 0 10px var(--accent-color);
}

#game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--box-size), 1fr));
    gap: 15px;
    justify-content: center;
    margin: 20px auto;
    padding: 11px;
    border-radius: var(--border-radius);
    border: 1px solid;
    border-image: linear-gradient(to top, #090013, #1cce5b, #090013) 1;
    max-width: calc(var(--box-size) * 5 + 100px);
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(6px);
    box-shadow: 0 0 10px #000000, inset 0 0 5px #000000;
    transform-style: preserve-3d;
}



.game-rules {
  background: #110024d9;
  backdrop-filter: blur(4px);
  padding: 1rem 1.5rem;
  border-radius: 10px;
  border: 1px solid;
  border-image: linear-gradient(to right, #090013, #1cce5b, #090013) 1;
  margin-top: 2rem;
      line-height: 1.5;
      text-align: center;
}

.game-rules h3 {
  font-size: 1.3rem;
  font-weight: lighter;
  color: #1cce5b;
  margin-bottom: 1rem;
    border-bottom: 1px solid;
  border-image: linear-gradient(to right, #090013, #1cce5b, #090013) 1;
}

.game-rules p {
  font-size: 1rem;
  margin-bottom: 1rem;
}
.game-rules strong {
  font-weight: lighter;
  color: #1cce5b;
}


.game-box.opened {
    background-color: hsla(141, 76%, 46%, 0.3);
    transform: rotate(-5deg);
    border: 1px solid var(--accent-color);
}

.game-box span {
    font-size: 3rem; /* plus gros qu’avant */
    font-weight: lighter;
    color: var(--text-color);
    font-family: 'LazyDog', sans-serif;
    text-align: center;
    text-shadow: 0 0 5px var(--accent-color);
    line-height: 1.2;
}


.box-content {
    width: 100%;
    height: 100%;
    padding: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.95rem;
    text-transform: uppercase;
    font-family: 'LazyDog', sans-serif;
    color: var(--text-color);
    text-align: center;
    line-height: 1.2;
    text-shadow: 0 0 2px #000;
    box-sizing: border-box;
    white-space: normal;           /* permet le retour a la ligne */
    overflow-wrap: normal;         /* ne force pas la coupure de mot */
    word-break: normal;            /* ne casse pas les mots */
    hyphens: none;     
                /* desactive les cesures automatiques */
}




.fullscreen-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 600px;
    background-color: var(--secondary-color);
    border: 1px dashed var(--accent-color);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    font-size: 1.5rem;
    color: var(--text-color);
    z-index: 1000;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
    opacity: 1;
    transition: opacity 0.5s ease;
    font-family: 'LazyDog', sans-serif;
    text-transform: uppercase;
}

.fullscreen-content.fade-out {
    opacity: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

@media (max-width: 768px) {
    :root {
        --box-size: 80px;
    }
    
    .game-header h1 {
        font-size: 2rem;
        padding-top: 50px;
    }
    
    .game-options {
        flex-direction: column;
    }
    
    .box-content {
        font-size: 0.7rem; /* Taille plus petite sur mobile */
        padding: 3px; /* Padding reduit sur mobile */
    }
}

@media (max-width: 480px) {
    :root {
        --box-size: 70px;
    }
    
    #game-grid {
        grid-template-columns: repeat(auto-fill, minmax(var(--box-size), 1fr));
        gap: 10px;
    }
    
    .fullscreen-content {
        font-size: 1.2rem;
        padding: 20px;
    }

    .box-content {
        font-size: 0.6rem;
    }
}






.challenge-header .game-controls {
    margin-bottom: 20px;
}



.game-box {
    aspect-ratio: 1;
    background-color: hsla(270, 100%, 33%, 0.247);
    border: 1px solid var(--accent-color);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-align: center;
    padding: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 10px #000000;
    font-family: 'LazyDog', sans-serif;
    text-transform: uppercase;
    color: var(--text-color);
    font-size: 0.8rem;
}

.game-box:hover {
    background-color: hsla(141, 76%, 46%, 0.37);
    transform: translateY(-3px);
    box-shadow: 0 0 10px hsl(141, 76%, 46%);
}



.box-bg {
  position: fixed;
  inset: 0;
background: url('/assets/images/FONDECRAN1.webp') no-repeat center center;
  background-size: cover;
  z-index: -1;
  animation: fantomeFloat 10s ease-in-out infinite;
  will-change: transform, background-position;
  pointer-events: none;
}

@keyframes fantomeFloat {
  0%   { transform: scale(1); background-position: 50% 50%; }
  50%  { transform: scale(1.05); background-position: 48% 52%; }
  100% { transform: scale(1); background-position: 50% 50%; }
}


/* Particules flottantes */
.particles-floating {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background-color: #1cce5b;
  border-radius: 50%;
  opacity: 0.5;
  animation: floatParticle ease-in-out infinite;
}

@keyframes floatParticle {
  0% {
    transform: translate(0, 0) scale(var(--scale));
    opacity: 0.4;
  }
  50% {
    transform: translate(var(--x), var(--y)) scale(var(--scale));
    opacity: 0.9;
  }
  100% {
    transform: translate(0, 0) scale(var(--scale));
    opacity: 0.4;
  }
}




#ghost-container {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
}

.ghost-sprite {
  position: absolute;
  width: 60px;
  height: 60px;
  opacity: 0;
  filter: drop-shadow(0 0 10px rgba(28, 206, 91, 0.4));
  transition: transform 0.6s ease, opacity 0.6s ease;
  will-change: transform, opacity;
}



.alt-options {
  flex-direction: column;
  gap: 10px;
  background-color: transparent;
  border: none;
  padding: 0;
}

.box-count-choices {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'LazyDog', sans-serif;
  color: var(--text-color);
  gap: 10px;
  margin-bottom: 10px;
}

.box-count-choices span {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.choice-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.choice-button {
  padding: 12px 20px;
  font-size: 1rem;
  border-radius: 12px;
  border: 1px solid var(--accent-color);
  background-color: var(--primary-color);
  color: var(--text-color);
  font-family: 'LazyDog', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.choice-button:hover,
.choice-button.active {
  background-color: var(--accent-color);
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 0 10px var(--accent-color);
}
