body {
  background: #111 url(../img/chessdle_background.jpg) no-repeat center center / cover;
  font-family: "Atkinson Hyperlegible", verdana, sans-serif;
}
main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
#game {
  text-align: center;
  text-transform: uppercase;
  position: relative;
  background: #382104;
  padding: 10px;
  border-radius: 5px;
}   

#grid {
  position: relative; 
  /*border: 1px solid #597284;*/
  /*overflow: hidden;*/

  height: calc( 100vh - 150px );
  width: calc( 100vh - 150px );

  max-height: 800px;
  max-width: 800px;
  aspect-ratio: 1;
  box-sizing: content-box;
  margin: 0 auto;
  border: 2px solid #281803;
  border-right-color: #4a2c06;
  border-bottom-color: #4a2c06;
  border-radius: 2px;
  /*border: 5px solid #78480a;*/
}         

.grid-column {
  height: 100%;
}          

/* GRID CELL DEFAULT */  
.grid-row {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  position: relative;
  transition: all 400ms ease;
  border-radius: 5px;
}  

  .grid-column:nth-child(even) .grid-row:nth-child(even) {
    background: #2d1910;
  }
  .grid-column:nth-child(even) .grid-row:nth-child(odd) {
    background: #734e31;
  }
  .grid-column:nth-child(odd) .grid-row:nth-child(even) {
    background: #734e31;
  }
  .grid-column:nth-child(odd) .grid-row:nth-child(odd) {
    background: #2d1910;
  }

  .grid-row .lettre {
    font-size: 30px;
    color: #111;

    width: 60px;
    text-align: center;
    height: 60px;
    line-height: 60px;
    border-radius: 50%;
    /*background: transparent;
    border: 2px solid #333;*/
    background: #ccc;
    transition: all 400ms ease;

    box-shadow: inset 2px 4px 1px 4px rgba(255,255,255,.3), 2px 4px 5px 5px rgb(0, 0, 0);
    text-shadow: 1px 1px 1px rgba(255,255,255,.7);
  }

  .grid-row .bg {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    opacity: 0;
    transition: all 400ms ease;
  }
    /*.grid-row .bg span {
      position: absolute;
      width: 10px;
      height: 10px;
    }
    .grid-row .bg .bg-tl {            
      top: 0;
      left: 0;            
      border-top: 1px solid #ccc;
      border-left: 1px solid #ccc;
    }
    .grid-row .bg .bg-tr {            
      top: 0;
      right: 0;            
      border-top: 1px solid #ccc;
      border-right: 1px solid #ccc;
    }
    .grid-row .bg .bg-bl {            
      bottom: 0;
      left: 0;            
      border-bottom: 1px solid #ccc;
      border-left: 1px solid #ccc;
    }
    .grid-row .bg .bg-br {            
      bottom: 0;
      right: 0;            
      border-bottom: 1px solid #ccc;
      border-right: 1px solid #ccc;
    }*/

/* USED */
.grid-used {
  background: #000;
}
  .grid-used .lettre {
    border-color: #000;
    color: #999;
    background: #000;
    transform: scale(.6);
    border-radius: 0;
    box-shadow: inset 1px 1px 1px 1px rgba(255,255,255,.3), 2px 4px 5px 5px rgb(0, 0, 0);
  }

/* START */
.grid-start {
  
}
  .grid-start .lettre {          
    
  }

.grid-center {

}
  .grid-center .lettre {
    background: #333;
  }

/* PLAYBABLE */
.grid-current {
  /*background: #fff !important;*/
}
  .grid-current .lettre {
    
  }

  .grid-current[data-movement='roi'] {
    background: #fff url(../img/roi.png) no-repeat top center / 60% auto !important;
  }
  .grid-current[data-movement='reine'] {
    background: #fff url(../img/reine.png) no-repeat top center / 60% auto !important;
  }
  .grid-current[data-movement='tour'] {
    background: #fff url(../img/tour.png) no-repeat top center / 60% auto !important;
  }
  .grid-current[data-movement='fou'] {
    background: #fff url(../img/fou.png) no-repeat top center / 60% auto !important;
  }
  .grid-current[data-movement='cavalier'] {
    background: #fff url(../img/cavalier.png) no-repeat top center / 60% auto !important;
  }
  .grid-current .lettre {
    align-self: end;   
    transform: scale(.5) translateY(10px);       
  }

.grid-move-available {
  cursor: pointer;
  background: rgba(255,255,0,.3);        
}
  .grid-move-available .lettre {
    transform: scale(1.3);
    background: #eec258;
    box-shadow: none;
  }
  .grid-move-available .bg {
    
  }

  .is-playing .grid-row:not(.grid-move-available):not(.grid-current):not(.grid-empty) {
    /*background: #000;*/

  }
  .is-playing .grid-row:not(.grid-move-available):not(.grid-current) .lettre {
    transform: scale(.5);
    /*opacity: .5;*/
  } 

  .grid-move-available:hover {
    
  }

.grid-row.lettreActive:not(.grid-used) .lettre {
  background: #ff0;
}

.grid-empty {
  /*background: #000;

  background-color: #999;
  opacity: 0.8;
  background-size: 4px 4px;
  background-image: repeating-linear-gradient(45deg, #000000 0, #000000 0.4px, #999 0, #999 50%);*/
  border-color: transparent;
}

#game .grid-column .grid-row.grid-hover {
  background: #eec258 !important;        
}


/*      
.grid-row.lettreActive .lettre {
  color: #f00;
  background: #efefef;
}

.word-hover {
  background: rgba(255,255,255,.3);
}
.grid-hover {
  background: #fff;        
}
  .grid-hover .lettre {
    color: #000;
  }

*/

/* BOARD */
#board-wrapper {
  margin-right: 20px;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  position: relative;
  align-self: stretch;
}

  #board-logo {
    position: relative;
    margin-bottom: 10px;
  }
    #board-logo img {
      max-width: 180px;
      border: 2px solid #382104;
      border-left-color: #673f0d;
      border-top-color: #673f0d;

      border-radius: 5px;
      box-shadow:inset -5px -5px 5px rgba(255,255,255,.2), 3px 3px 5px rgba(0,0,0,.5);
    }
    #board-logo .go-history {
      position: absolute;
      left: 0;
      top: 0;
      border: 2px solid #673f0d;
      border-right-color:#382104;
      border-bottom-color:#382104;
      border-radius: 5px;
      padding: 1px 6px 3px;
      background: #734e31;
      box-shadow: 3px 3px 5px rgba(0,0,0,.2);
      color: #fff;
      cursor: pointer;
      font-size: 10px;
    }
    #board-logo .go-history svg {
      width: 20px;
      vertical-align: bottom;
    }
      #board-logo .go-history.active {
        background: #efc175;
        border: 2px solid #f9d683;
        border-right-color: #d7a631;
        border-bottom-color: #d7a631;
      }

  #mouvments {
    margin: 0 40px;
  }
    .mouvment {
      position: relative;
      width: 80px;
      transition: all 400ms ease;
    }
    .mouvment small {
      position: absolute;
      bottom: 1px;
      left: 50%;
      transform: translateX(-50%);
      background: #fff;
      padding: 2px 4px;
      border-radius: 5px 5px 2px 2px;
      display: inline-block;
      font-size: 11px;
      line-height: 12px;
      color: #111;
      min-width: 50px;
      border-bottom: 2px solid #ccc;
    }

    .is-playing .mouvment:not(.active) {
      opacity: .3;
    }

  .flip-zone {
    position: relative;
  }
  .flip-zone #history {
    display: none;
  }
  .flip-zone.history #history {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #382104;
    padding: 25px 10px;
  }
    .table-history {
      width: 100%;
      color: #efefef;
    }
    .table-history table {
      width: 100%;
      border: none;
    }
    .table-history th {
      padding: 5px;
      border-bottom: 1px solid #fff;
    }
    .table-history td {
      padding: 5px;            
      border-bottom: 1px dotted #fff;
    }
    .table-history .history-pseudo {
      font-weight: bold;
      text-align: left;
      text-transform: none;
    }

    .table-history .history-total {
      font-weight: bold;
      text-align: right;
    }

    .table-history .history-end {
      color: #efc175;
    }
    .table-history .history-me {
      color: yellow;
    }
    .table-history .history-level-0 {
      opacity: .3;
    }
    

  .cartes {
    position: relative;
    transition: all 400ms ease;
    border: 2px solid transparent;
    /*border-left: 0;*/
  }
    .is-playing .cartes {
      opacity: .5;
    }
    /*.cartes:before {
      content: '';
      display: block;
      position: absolute;
      top: -2px;
      bottom: -2px;
      left: 0;
      width: 0;
      background: rgba(255,255,255,.2);
      border: 2px solid transparent;
      border-top: 2px solid transparent;
      border-bottom: 2px solid transparent;
      transition: all 200ms ease;
      opacity: 0;
    }*/
    .is-playing .cartes-active {
      background: rgba(255,255,255,.2);
      opacity: 1;
    }
    .is-playing .cartes-active:before {
      opacity: 1;           
      /*left: -20px;
      width: 20px;*/
    }
  .carte {
    color: #111 !important;
    background: rgba(255,255,255,.1);  
    border-bottom: 5px solid transparent;
    width: 60px;    
    height: fit-content; 
    aspect-ratio: 1;
    margin: 10px;
    margin: 6px;
  }
    .is-playing .cartes-active .carte {
      background: rgba(255,255,255,.3);  
    }
  .carte .symbole {
    max-height: 100%;
    transition: all 400ms ease;
  }
  .carte .lettre {
    max-height: 0%;
    font-size: 0;
    opacity: 0;
    display: block;
    aspect-ratio: 1;
    width: fit-content;
    border-radius: 50%;
    transition: all 400ms ease;
  }

  .carte-show {
    /*background: rgba(255,255,255,.5);  */
  }        
    .carte-show .symbole {
      max-height: 0;
    }
    .carte-show .lettre {
      max-height: 100%;
      font-size: 30px;
      opacity: 1;
      color: #111;            
    }
    

  .carte-hover {
    cursor: pointer;
    box-shadow: 0 0 5px 10px rgba(255,255,255,.2);
  }

  

  .carte-from {
    background: #fff !important;
  }
  .carte-active {
    background: #eec258 !important;
  }

  .carte-used {
    background: #efefef;
  }

  .carte-given {

  }
    .carte-given .lettre {
      color: #111;
    }

  .carte-start,
  .carte-center {
    border-color: #2b9348;
  }
    .carte-start .lettre,
    .carte-center .lettre {
      color: #111;
    }

  .carte-guess {
    border-color: #ff9759;  
  }

  .cartes[data-result='win'] .carte-used {
    border-color: #2b9348 !important;
  }
  .cartes[data-result='lose'] .carte-used {
    border-color: #b96161 !important;
  }  
  .carte-center-unknown {
    border-color: #666 !important;
    cursor: pointer;
  }

  /**/
  .action {
    position: absolute;
    left: -50px;
    top: 10px;
    bottom: 10px;
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 400ms ease;
  }
    .cartes:hover .action {
      opacity: 1;
    }
    .action a {
      width: 26px;
      height: 26px;
      background: #ccc;
      border-radius: 1px;
      margin: 2px 0;
      display: flex;
      justify-content: center;
      align-items: center;            
    }
      .action a.action-remove {
        background: #f00;
        cursor: pointer;
      }

      .action a.action-result {

      }
      .action a.action-result span {
        display: none;
      }
      .cartes[data-result='unknown'] .action a.action-result span.action-result-unknown {
        display: block;
      }
      .cartes[data-result='lose'] .action a.action-result span.action-result-lose {
        display: block;
      }
      .cartes[data-result='win'] .action a.action-result span.action-result-win {
        display: block;
      }

  #score {
    padding: 0 20px;
    height: 130px;
    margin-top: auto;
    background: #160d01;
    border-radius: 4px;
    border: 2px solid #281803;
    border-right-color: #4a2c06;
    border-bottom-color: #4a2c06;
    box-shadow: inset 5px 6px 6px rgba(0,0,0,.5);
    margin-right: 10px;
    margin-bottom: 0;
    margin-left: 150px;
    position: relative;
  }

    #points {
      height: 126px;
      align-items: end;
    }
      .level {
        /*transform: scale(.9);*/
        height: 100%;
        display: flex;
        flex-direction: column;
      }
      .level strong {
        display: block;
        font-size: 15px;
        margin-bottom: 5px;
        line-height: 40px;
      }
      .level span {
        background: #160d01;
        display: inline-block;
        width: 50px;
        height: 50px;
        line-height: 50px;
        text-align: center;
        border-radius: 3px 3px 0 0;
        color: #111;
        font-size: 18px;
        border: 2px solid #160d01;
        border-bottom: 0;
        margin-top: auto;
        text-shadow: 1px 1px #160d01;
        transition: all 400ms ease;
      }
        .level-used strong {
          color: #fff;
          font-size: 20px;
        }
        .level-used span {
          background: #382104;
          color: #fff;
          border-color: #281803;
          border-left-color: #4a2c06;                
          border-top-color: #4a2c06;  
          margin-bottom: -2px;              
        }
        .level-active {
          
        }
        .level-active strong {
          color: #efc175;
          font-size: 25px;
        }
        .level-active span {
          background: #382104;
          color: #efc175;
          border-color: #281803;
          border-left-color: #4a2c06;                
          border-top-color: #4a2c06;                 
          height: 70px;
          font-size: 30px;
          margin-bottom: -2px;              
        }

      #total:before {
        content: 'Total';
        display: block;
        font-size: 25px;
        line-height: 25px;
        text-align: center;
        margin-bottom: 20px;
        margin-top: 10px;
      }
      #total {
        font-weight: 700;
        display: inline-block;
        padding: 2px 10px;
        background: #efc175;
        border-radius: 5px;
        color: #fff;
        text-align: center;
        font-size: 45px;
        position: absolute;
        top: 0;
        bottom: 0;
        left: -140px;
        width: 125px;
        box-shadow: 5px 5px 5px rgba(0,0,0,.5);
        border: 2px solid #f9d683;   
        border-right-color: #d7a631;
        border-bottom-color: #d7a631;           
      }

#keyboard-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  overflow: hidden;
  
  border-bottom: 1px solid transparent;
  transition: all 400ms ease;
}
#keyboard-wrapper-in {
  padding: 20px;
  transform: translateY(-100%);
  transition: all 400ms ease;
  background: #221606;
  max-width: 860px;
  margin: 0 auto;
  border: 5px solid #9d6316;
  border-radius: 0 0 5px 5px;
  border-top: 0;
}
#letter-guess > div {
  background: #ecd9cb;        
  /*border: 1px solid #ccc;*/
  border-radius: 4px;
  margin-right: 20px;
  cursor: pointer;
}      
  #letter-guess img {
    max-height: 180px;
  }
#keyboard {        

}
  #keyboard .keyboard-row {

  }

  /* default */
  #keyboard .keyboard-letter {
    background: #a6754f;
    height: 50px;
    line-height: 50px;
    width: 50px;
    margin: 0 10px 10px 0;
    text-align: center;
    border: 2px solid #d9aa6b;
    border-radius: 2px;
    box-sizing: content-box;
    font-size: 24px;
    color: #111;   
    cursor: pointer;       
  }   
  #keyboard .keyboard-letter:hover {     
    background: #ecd9cb;
  }

  #keyboard .keyboard-letter.letter-lose {
    background: red;
    opacity: .5;
    color: #fff;
  }
  #keyboard .keyboard-letter.letter-win_max {
    background: green;
    opacity: .5;
    color: #fff;
  }

  #keyboard .keyboard-back {
    background: #111;
    color: #fff;
  }
  #keyboard .keyboard-reset {
    background: #666;
    color: #fff;
  }
  #keyboard .keyboard-enter {
    width: 110px;
    background: #fff;
    color: <?= $color_win_max ?>;
  }

.with-keyboard #keyboard-wrapper {
  z-index: 999;
  overflow: visible;
  height: auto;
}
  .with-keyboard #keyboard-wrapper #keyboard-wrapper-in {
    transform: translateY(0);
  }

.next {
  position: absolute;
  bottom: -2px;
  left: -2px;
  right: -2px;
  z-index: 9;
  height: 130px;
}
  .next-inner {

    background: #160d01;
    border-radius: 4px;
    border: 2px solid #281803;
    border-right-color: #4a2c06;
    border-bottom-color: #4a2c06;
    box-shadow: inset 5px 6px 6px rgba(0,0,0,.5);
    
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .next-button {
    padding: 10px 25px;
    font-size: 35px;
    background: rgba(20, 149, 215, 1);
    color: #fff !important;
    text-transform: uppercase;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 5px 5px 5px rgba(0,0,0,.5);
    border: 2px solid rgb(43, 162, 223);
    border-right-color: rgb(16, 104, 149);
    border-bottom-color: rgb(16, 104, 149);

  }

.finalwin {
  font-size: 20px; 
  color: #efefef;
}
.finalwin h2{
  font-size: 30px; 
}