body {
  font-family: "Atkinson Hyperlegible", sans-serif;
  font-weight: 500;
  background: #0293d4;
}

body.error {
  animation: 1s bodyerror;
}

@keyframes bodyerror {
  0% {
    background: #0293d4;
  }

  50% {
    background: #f00;
  }

  100% {
    background: #0293d4;
  }
}

.btn {
  color: #fff !important;
}

main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game {
  text-align: center;
  text-transform: uppercase;
  position: relative;
}

#game-container {
  position: relative;
}

#word-wrapper {
  height: 60px;
  display: flex;
  justify-content: center;
}

#word {
  display: inline-block;
  min-width: 50px;
  height: 55px;
  line-height: 53px;
  text-align: center;
  color: #000;
  font-size: 30px;
  padding: 0 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .7);
  border-bottom: 2px solid rgba(255, 255, 255, .5);
  margin: 0 5px;
  position: relative;
}

#word span {
  display: inline-block;
  height: 55px;
  width: 30px;
  line-height: 53px;
  text-align: center;
  color: #000;
  margin: 0 2px;
}

#word em {
  position: absolute;
  right: 0;
  top: -35px;
  background: rgb(200, 247, 223);
  border: 2px solid green;
  padding: 5px 10px;
  color: green;
  font-weight: 700;
  font-size: 18px;
  line-height: 18px;
  border-radius: 8px;
}

#word em:before {
  content: "+";
}

/*#addscore {
      height: 55px;
      padding: 0 15px;
      line-height: 50px;
      text-align: center;
      color: green;
      font-size: 30px;
      margin: 0 0 0 15px;
      border-radius: 10px;
      background: rgba(255,255,255,.7);
      border-bottom: 2px solid rgba(255,255,255,.5);
    }
      #addscore:before {
        content: "+";
      }*/

#grid {}

.grid-row {
  display: flex;
  justify-content: center;
}

.grid-cell {
  /*width: 100px;
        height: 100px;*/
  margin: -10px 5px;

  height: 120px;
  /* adjust to control the size  */
  aspect-ratio: cos(30deg);
  clip-path: polygon(-50% 50%, 50% 100%, 150% 50%, 50% 0);
  /*background: rgba(0,0,0,.2);*/
  box-shadow: inset 0 0 80px rgba(0, 0, 0, .05);
  z-index: 0;
  position: relative;
}

.grid-cell.futurDestruction:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 120px;
  /* adjust to control the size  */
  aspect-ratio: cos(30deg);
  clip-path: polygon(-50% 50%, 50% 100%, 150% 50%, 50% 0);
  display: none;
  background: red;
  display: block;
  z-index: 3;
  opacity: 1;
  animation: 3s infinite destruction;
}

#bottom {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
}

.grid-bottom {
  position: absolute;
  width: 115px;
  height: 100px;
  line-height: 100px;
  text-align: center;
  color: #fff;
  font-size: 35px;
  z-index: 0;
}

.grid-bottom:before {
  content: "";
  position: absolute;
  top: -10px;
  left: 5px;
  height: 120px;
  /* adjust to control the size  */
  aspect-ratio: cos(30deg);
  clip-path: polygon(-50% 50%, 50% 100%, 150% 50%, 50% 0);
  background: #169edb;
  animation: 8s infinite waves;
  z-index: 2;
}

@keyframes waves {
  0% {
    transform: scale(1.5);
    background: #169edb;
    z-index: 2;
  }

  60% {
    transform: scale(1.2);
    background: #7cc0df;
    z-index: 2;
  }

  100% {
    transform: scale(1.5);
    background: #169edb;
    z-index: 2;
  }
}

#letters {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

#letters .letter {
  position: absolute;
  width: 115px;
  height: 100px;
  line-height: 100px;
  text-align: center;
  color: #fff;
  font-size: 35px;
  transition: all 200ms ease;
}

#letters .letter:before {
  content: "";
  display: block;
  position: absolute;
  top: -10px;
  left: 5px;
  height: 120px;
  /* adjust to control the size  */
  aspect-ratio: cos(30deg);
  clip-path: polygon(-50% 50%, 50% 100%, 150% 50%, 50% 0);
  /*background: #ccc;*/
}

#letters .letter:after {
  content: "";
  position: absolute;
  top: -10px;
  left: 5px;
  height: 120px;
  /* adjust to control the size  */
  aspect-ratio: cos(30deg);
  clip-path: polygon(-50% 50%, 50% 100%, 150% 50%, 50% 0);
  display: none;
}

#letters .letter span {
  position: relative;
}

#letters .letter div.pts {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  font-size: 14px;
  line-height: 14px;
}

#letters .letter div.pts strong {
  transform: scale(1);
  transition: all 200ms ease;
}

#letters .letter div.pts em {
  font-size: 10px;
}

/* INDEX = 0 : case au sol */
#letters .letter[data-index='0'] {
  z-index: 5;
  margin: 0;
}

#letters .letter[data-index='0']:before {
  z-index: 4;
  background: #82eacb;
}

#letters .letter[data-index='0'] span {
  z-index: 6;
}

#letters .letter[data-index='1'] {
  z-index: 10;
  margin: -3px 0 0 1px;
}

#letters .letter[data-index='1']:before {
  z-index: 9;
  background: #f1ca3b;
}

#letters .letter[data-index='1'] span {
  z-index: 11;
}

#letters .letter[data-index='2'] {
  z-index: 10;
  margin: -6px 0 0 2px;
}

#letters .letter[data-index='2']:before {
  z-index: 9;
  background: #9ebf47;
}

#letters .letter[data-index='2'] span {
  z-index: 11;
}

#letters .letter[data-index='3'] {
  z-index: 10;
  margin: -9px 0 0 3px;
}

#letters .letter[data-index='3']:before {
  z-index: 9;
  background: #015e31;
}

#letters .letter[data-index='3'] span {
  z-index: 11;
}

#letters .letter[data-index='4'] {
  z-index: 10;
  margin: -12px 0 0 4px;
}

#letters .letter[data-index='4']:before {
  z-index: 9;
  background: #737664;
}

#letters .letter[data-index='4'] span {
  z-index: 11;
}

#letters .letter[data-db-playable='1'][data-playable='1'] {
  cursor: pointer;
}

#letters .letter[data-db-playable='1'][data-playable='1'] span {
  z-index: 12;
}

/*#letters .letter[data-db-playable='1'][data-playable='1']:after {
        background: #ffff2e;
        display: block;
        z-index: 11;
      }
      @keyframes available {
        0% {
          opacity: .8;
        }
        100% {
          opacity: 0.2;
        }
      }*/

#letters .letter:not(.active):not(.futurDestruction):hover {
  transform: translateY(-4px);
}

#letters .letter.active {
  transform: translateY(-10px);
}

#letters .letter.active span,
#letters .letter.active div.pts {
  color: #000;
}

#letters .letter.active div.pts strong {
  display: inline-block;
  background: green;
  padding: 4px;
  border-radius: 4px;
  color: #fff;
  transform: scale(1.2);
}

#letters .letter.active div.pts em {
  display: none;
}

#letters .letter.active:before {
  background: yellow !important;
}

#letters .letter.current-active span,
#letters .letter.current-active div.pts {
  color: #fff;
}

#letters .letter.current-active:before {
  background: black !important;
}

/*#letters .letter.nextDestruction {
      z-index: 20;
    }
    #letters .letter.nextDestruction span {
      z-index: 22;
    }
    #letters .letter.nextDestruction[data-db-playable='1']:after {
      background: red;
      display: block;
      z-index: 21;
      opacity: 0.5;
      animation: 3s infinite destruction;
    }
      @keyframes destruction {
        0% {
          transform: scale(1);
          opacity: .6;
        }
        100% {
          transform: scale(2);
          opacity: 0;
        }
      }*/

#letters .letter.futurDestruction[data-db-playable='1']:not(.active) {
  z-index: 20;
}

#letters .letter.futurDestruction[data-db-playable='1'] {
  margin: 0;
}

#letters .letter.futurDestruction[data-db-playable='1']:not(.active) span,
#letters .letter.futurDestruction[data-db-playable='1']:not(.active) div.pts {
  z-index: 22;
}

#letters .letter.futurDestructionCell[data-db-playable='0'] {
  display: none;
}

#letters .letter.futurDestructionCell[data-db-playable='1']:not(.active):before {
  animation: 3s infinite celldestruction;
}

@keyframes celldestruction {
  0% {
    opacity: .6;
    transform: scale(.5);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: .6;
    transform: scale(.5);
  }
}

#letters .letter.futurDestruction[data-db-playable='1']:not(.active):after {
  background: red;
  display: block;
  z-index: 21;
  opacity: 1;
  animation: 3s infinite destruction;
}

@keyframes destruction {
  0% {
    opacity: 0.8;
    transform: scale(1);
  }

  50% {
    opacity: .2;
    transform: scale(.5);
  }

  100% {
    opacity: 0.8;
    transform: scale(1);
  }
}

#letters .letter.nextFuturDestruction[data-db-playable='1']:not(.active) {
  z-index: 20;
}

#letters .letter.nextFuturDestruction[data-db-playable='1']:not(.active) span,
#letters .letter.nextFuturDestruction[data-db-playable='1']:not(.active) div.pts {
  z-index: 22;
}

#letters .letter.nextFuturDestruction[data-db-playable='1']:not(.active):after {
  background: red;
  display: block;
  z-index: 21;
  opacity: 1;
  opacity: .5;
  transform: scale(0.9);
  clip-path: polygon(-50% 50%, 50% 100%, 150% 50%);
  /*animation: 3s infinite nextdestruction;*/


  box-shadow: 0 0 30px 30px red;
  opacity: 1;
  clip-path: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  top: 50%;
  left: 50%;
  height: 1px;
  aspect-ratio: 1;
  animation: 3s infinite nextdestruction;
}

@keyframes nextdestruction {
  0% {
    box-shadow: 0 0 30px 30px red;
    opacity: 1;
  }

  50% {
    box-shadow: 0 0 40px 40px red;
    opacity: .6;
  }

  100% {
    box-shadow: 0 0 30px 30px red;
    opacity: 1;
  }
}

#board-wrapper {
  width: 360px;
  margin-left: 60px;
  min-height: 100%;
  position: relative;
  /*background: url(../img/boardmiddle.png) repeat-y center center / 100% auto;
      position: relative;*/
}

/*#board-wrapper:before {
        content: '';
        background: url(../img/boardtop.png) no-repeat center bottom / 100% auto;
        display: block;
        height: 70px;
        position: absolute;
        top: -70px;
        left: 0;
        right: 0;
      }
      #board-wrapper:after {
        content: '';
        background: url(../img/boardbottom.png) no-repeat center top / 100% auto;
        display: block;
        height: 70px;
        position: absolute;
        bottom: -70px;
        left: 0;
        right: 0;
      }*/

/*#board-wrapper:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  border-radius: 20px;
  background: #169edb;
  z-index: -1;
  animation: 8s infinite waves_board;
}

@keyframes waves_board {
  0% {
    transform: scale(1.2, 1.08) rotate(1deg);
    background: #169edb;
    box-shadow: 0 0 50px rgba(255, 255, 255, .1);
  }

  60% {
    transform: scale(1.03, 1.01) rotate(-1deg);
    background: #7cc0df;
    box-shadow: 0 0 5px rgba(255, 255, 255, .5);
  }

  100% {
    transform: scale(1.2, 1.08) rotate(1deg);
    background: #169edb;
    box-shadow: 0 0 50px rgba(255, 255, 255, .1);
  }
}

#board-wrapper:after {}*/

#logo {
  margin-bottom: 20px;
}

#board {
  /*background: rgba(255, 255, 255, .7);*/
  background: #894b0d;
  border: 1px solid #aa905f;
  border-bottom: 2px solid #aa905f;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  position: relative;
}


#situation {
  padding: 10px 20px;
  background: #65350a;
  border: 1px solid #260e00;
  border-bottom: 2px solid #260e00;
  border-radius: 10px;
  margin: 20px 0;
}

#situation>div {
  font-size: 20px;
  line-height: 20px;
  color: #111;
  display: flex;
  justify-content: space-between;
  text-transform: none;
  margin-bottom: 6px;
  color: #f7dd9a;
}

#situation>div img {
  margin-right: 10px;
  vertical-align: bottom;
}

#situation>div.global-situation {}

#situation>div.current-situation {}

#situation>div.dead-situation {
  color: #e41e03;
}

#situation>div.saved-situation {
  color: #22ae32;
  margin-bottom: 0;
}

/*#score {
  font-size: 28px;
  line-height: 30px;
  color: #fff;
  display: flex;
  justify-content: space-between;
}
#score svg {
  vertical-align: middle;
}*/

#allscores {
  
}

#allscores .table-title {
  background: #7a2906;
  padding: 2px 10px;
  color: #f9c035;
  text-transform: uppercase;
  border: 1px solid #3f1b02;
  border-bottom: 2px solid #3f1b02;
  border-radius: 5px;
  image-rendering: pixelated;
  font-weight: bold;
}

#board-allscores {
  margin-bottom: 10px;
}

#board-allscores > div,
#board-bestturnscore > div {    
  color: #fdf2cc;
  background: #5f2f05;
  margin-top: 3px;
  padding: 2px 5px;
  border-radius: 4px;
  box-shadow: inset 2px 2px 2px 1px rgba(0,0,0,.5);
}
  #board-allscores > div .user_pseudo,
  #board-bestturnscore > div .user_pseudo {    
      
  }
  #board-allscores > div .user_score,
  #board-bestturnscore > div .user_score {    
    
  }      



/*#allscores .allscores,
#allscores .bestturnscore {
  color: #111;
  font-size: 12px;
  width: 100%;
  margin-top: 10px;
}

#allscores .allscores th,
#allscores .bestturnscore th {
  text-align: left;
  border-top: 1px dotted #fff;
  padding: 3px 0;
}

#allscores .allscores td.user_pseudo,
#allscores .bestturnscore td.user_pseudo {
  text-align: left;
  border-top: 1px dotted #fff;
  padding: 3px 0;
}

#allscores .allscores td.user_score,
#allscores .bestturnscore td.user_score {
  font-weight: bold;
  text-align: right;
  border-top: 1px dotted #fff;
  padding: 3px 0;
}*/

#actions {
  position: absolute;
  bottom: -2px;
  right: -58px;
}
  #actions .own-btn {
    border-radius: 5px;
    line-height: 46px;
    display: block;
    height: 50px;
    width: 50px;
    text-align: center;
    margin-top: 5px;
  }
  #actions .own-btn svg {
    width: 16px;
    height: 16px;
  }

.own-btn {
  color: #fff !important;
  margin: 0;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  background: #dc3545;
  border-bottom: 2px solid rgba(255, 255, 255, .5);
  padding: 10px;
  cursor: pointer;
  height: 55px;
  padding: 0 15px;
  line-height: 53px;
}

.own-btn.btn-play {
  background: green;
}

.own-btn.btn-back {
  background: orange;
}

.own-btn.btn-reset {
  background: red;
}

.own-btn.btn-new {
  background: blue;
}

#explain {
  display: flex;
  flex-wrap: wrap;
  background: #004b48;
  padding: 10px 20px;
  margin: 20px -20px 0;
  border-top: 2px solid #092d30;
  border-radius: 0 0 10px 10px;
}

#explain>div {
  margin-top: 2px;
  color: #f8de9b;
  text-align: left;
  font-size: 10px;

  flex: 0 0 auto;
  width: 50%;
}

#explain>div span {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px;
  background: #fff;
  margin-right: 4px;
  vertical-align: middle;
}

#explain>div.index-4 span {
  background-color: #737664;
}

#explain>div.index-3 span {
  background-color: #015e31;
}

#explain>div.index-2 span {
  background-color: #9ebf47;
}

#explain>div.index-1 span {
  background-color: #f1ca3b;
}

#explain>div.index-0 span {
  background-color: #82eacb;
}

#explain>div.index-red span {
  background-color: red;
}

.lemmings-wrapper {
  position: absolute;
  top: 0;
  left: 55px;
  right: 0;
  bottom: 0;
  z-index: -1;
  height: 100vh;
  width: calc(100vw - 55px);
  background: url(../img/lemming-bg.png) repeat-x center bottom;
  image-rendering: pixelated;
  padding-bottom: 6px;
  overflow: hidden;
}

.lemmings-start {
  position: absolute;
  bottom: -20px;
  left: 0;
  background: url(../img/lemming-start.png) no-repeat center bottom / cover;
  image-rendering: pixelated;
  height: 250px;
  width: 120px;
  transform: scaleX(-1) rotate(7deg);
}

.lemmings-statue {
  position: absolute;
  bottom: -20px;
  left: 85%;
  background: url(../img/lemming-start.png) no-repeat center bottom / cover;
  image-rendering: pixelated;
  height: 120px;
  width: 60px;
  transform: rotate(5deg);
  z-index: -1;
}

.lemming {
  width: 30px;
  height: 45px;
  background-size: 30px auto;
  /* border: 2px solid #000; */
  /* border-radius: 50%; */
  position: absolute;
  bottom: 0;
  left: 50%;
  z-index: -1;
  transform: translateX(-50%);
}

.lemming.falling {
  transform: translateX(0%);
}

.lemmings-wrapper .camp {
  background: url(../img/camp.png) no-repeat center bottom / auto 100%;
  image-rendering: pixelated;
  position: absolute;
  bottom: 2px;
  left: -10px;
  height: 80px;
  width: 100px;
}

.lemmings-wrapper .camp-2 {
  left: 150px;
  height: 90px;
  z-index: -1;
}

.lemmings-wrapper .camp-3 {
  left: auto;
  right: 0;
  z-index: -1;
}

.lemmings-wrapper .palmier {
  background: url(../img/palmier.png) no-repeat center bottom / auto 100%;
  image-rendering: pixelated;
  position: absolute;
  bottom: -5px;
  left: 280px;
  height: 110px;
  width: 60px;
}

.lemmings-wrapper .palmier-2 {
  left: 235px;
  z-index: 2;
  height: 120px;
  transform: scaleX(-1);
}

.lemmings-wrapper .palmier-3 {
  left: 500px;
  height: 80px;
  z-index: -1;
}

.lemmings-wrapper .palmier-4 {
  left: 60%;
  z-index: -1;
}

.lemmings-wrapper .palmier-5 {
  left: 55%;
  height: 120px;
  transform: scaleX(-1) rotate(-3deg);
}

.lemmings-wrapper .palmier-6 {
  left: auto;
  right: 0;
  height: 130px;
  transform: scaleX(-1) rotate(3deg);
  z-index: 2;
}



/**/
@media screen and (max-width: 1400px) {

  .grid-cell,
  #letters .letter::after,
  #letters .letter::before,
  .grid-bottom::before,
  .grid-bottom::after {
    height: 100px;
  }

  #letters .letter,
  .grid-bottom {
    width: 100px;
    height: 80px;
    line-height: 70px;
    font-size: 30px;
  }

  #word {
    height: 40px;
    line-height: 38px;
    font-size: 25px;
  }
    #word span {
      height: 40px;
      line-height: 38px;
      width: 25px;
    }
  #word-wrapper .own-btn {
    height: 40px;
    line-height: 38px;
    padding: 0 10px;
  }

  #actions {
    right: -55px;
  }
  #actions .own-btn {
    width: auto;
    height: 40px;
    line-height: 36px;
  }

  #board-wrapper {
    width: 280px;
    margin-left: 40px;
  }
    #board {
      padding: 0 10px;
    }
    #situation {
      margin: 10px 0;
      padding: 10px;
    }
    #allscores {
      font-size: 12px;
    }
    #explain {
      padding: 10px;
      margin: 10px -10px 0;
    }

}