/* *{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth; 
} */
#grille {
    width: calc(48vmin + 12px);
    height: calc(48vmin + 12px);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    background: #FDD7E4;
    border: solid #822e6b 4px;
    margin: 0 auto;
}
#grille .case {
    border: solid #822270 0.9px;
    display: grid;
    place-items: center;
    height: 16vmin;
    width: 16vmin;
    margin: 1.2px;
}
#grille .case:hover {
    background: #E1A1BF;
}

nav {
margin-top: 2em;
}

h1 {
    text-align: center;
    color: #7100A9;
    font-family: InstrumentSerif-Regular;
    font-size: 55px;
}

body {
  margin: 0;
  overflow: hidden;
}

.panel {
  position: fixed;
  top: 0;
  width: 50%;
  height: 100vh;
  background: #DAC3E8;
  transition: transform 1s ease;
}

.left {
  left: 0;
  transform: translateX(0);
}

.right {
  right: 0;
  transform: translateX(0);
}

.revealed .left {
  transform: translateX(-100%);
}

.revealed .right {
  transform: translateX(100%);
}

#revealBtn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);  
  z-index: 10;
  padding: 24px 60px;
  font-size: 32px;
  font-family: JockeyOne-Regular;
  color: #509C9F;
  cursor: pointer;
}

.cache {
  display: none;
}


#replay {
  color: #509C9F;
  margin: 0 auto;
  font-family: JockeyOne-Regular;
  display: block;
  margin: 0 auto;
  width: 140px;
  height: 40px;
  font-size: 16px;
}

footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  text-align: center;
  padding: 2px;
}


@font-face {
    font-family: JockeyOne-Regular;
    src: url(./fonts/JockeyOne-Regular.ttf);
}

@font-face {
    font-family: InstrumentSerif-Regular;
    src: url(./fonts/InstrumentSerif-Regular.ttf);
}

@font-face {
    font-family: IrishGrover-Regular;
    src: url(./fonts/IrishGrover-Regular.ttf);
}

#players {
    position: fixed;
    top: 18%;
    left: 50%;
    transform: translate(-50%);
    z-index: 2;
    font-family: IrishGrover-Regular;
    opacity: 0;
    transition: opacity 0.4s ease 0.8s;
}

.revealed #players {
    opacity: 1;
}

#players .left_player {
    position: fixed;
    transform: translateX(-35vw);
}
.left_player.player-n {
    color: #7100A9;
}

#players {
    color: #509C9F;
}

#players 
.right_player {
    position: relative;
    transform: translateX(35vw);
}
.right_player.player-s {
    color: #7100A9;
}

h2{
  font-size: 30px;
}

.chocolate::before,
.rainbow::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.chocolate::before {
    background-image: url("../img/chocolate.PNG");
    animation: place .75s cubic-bezier(0.51, 0.3, 0.2, 1);
}

.rainbow::before {
    background-image: url("../img/rainbow.PNG");
    animation: place .75s cubic-bezier(0.29, 0.89, 0.37, 0.51);
}

@keyframes place {
    0% {
        opacity: 0.2;
        transform: scale(1.5) rotate(10deg);

    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);

    }
}
.chocolate {
    position:absolute;
    height: 14vh;
    width: 14vh;
    max-width: 100%;
}


.rainbow {
    position:fixed;
    height: 16vh;
    width: 16vh;
    max-width: 100%;
}

.character-left,
.character-right {
    position: fixed;                    
    transform: translateY(-50%);
    width: 440px;
    height: 440px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent; 
    z-index: 1000;         
}

.character-left {
    left: 60px; 
    top: 47%;
}

.character-right {
    right: 40px; 
    top: 43%;
}

.character-left img,
.character-right img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#winner-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #509C9F;
  padding: 20px 40px;
  border-radius: 10px;
  text-align: center;
  color: white;
  font-size: 1.8em;
  display: none;
  z-index: 1000;
}

.star {
  position: fixed;
  top: -20px;
  font-size: 24px;
  animation: fall linear forwards;
  z-index: 999;
}

@keyframes fall {
  to {
    transform: translateY(110vh);
    opacity: 0;
  }
}

.win {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    justify-content: center;
    pointer-events: none;
    position:absolute;
    left: 0;
    top:0;
    height: 100%;
    width: 100%;
    opacity: 0%;
    background-color: var(--primary-green-50);
}

.boitegagnant {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    justify-content: center;
    background-color: var(--secondary-green);
    height: 30vh;
    width: 30vh;
    border-radius: 5vh;
    padding: 3vh;
    margin-bottom: 4vh;
}

.ligne-gagnante {
  position: absolute;
  height: 17px;
  margin-top: -4px;             
  border-radius: 4px;
  background: #822270;
  box-shadow: 0 0 8px rgba(113, 0, 169, 0.6);
  transform-origin: 0 50%;
  pointer-events: none;
  z-index: 8;
  animation: tracer 0.5s ease-out forwards;
}

@keyframes tracer {
  from { width: 0; }
  to   { width: var(--longueur); }
}

footer,
.character-left,
.character-right {
  opacity: 0;
  transition: opacity 0.4s ease 0.8s; 
}

.revealed footer,
.revealed .character-left,
.revealed .character-right {
  opacity: 1;
}

#message {
    font-family: InstrumentSerif-Regular;
    color: #509C9F;
}

#message {
    background-color: var(--primary-pink);
    font-size: larger;
    font-family: IrishGrover-Regular;
    text-align: center;
    border-radius: 3vh;
    padding: 1.5vh;
}

#message {
    background-color: var(--primary-pink);
    font-size: 1.3rem;
    font-family: IrishGrover-Regular, sans-serif;
    color: #509C9F;
    text-align: center;
    border-radius: 3vh;
    padding: 1.2vh;
}

#pluie-etoiles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}

.etoile {
  position: absolute;
  top: -50px;
  animation-name: chute;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes chute {
  to { transform: translateY(110vh) rotate(360deg); }
}

footer {
  background-color: #E1A1BF;
  color: #7e28a9;
  margin: bottom;
  bottom: 0%;
  font-family: JockeyOne-Regular;
  padding: 4px
}