@font-face {
  font-family: SoosLight;
  src: url('font/Doctor Soos Light 1.1.ttf');
}

@font-face {
  font-family: SoosBold;
  src: url('font/Doctor Soos Bold 2.1.ttf');
}

:root {
  --font1: SoosLight;
  --fontName: SoosBold;
  --hp-green: #4caf50;
  --hp-orange: #ff9800;
  --hp-red: #f44336;
}

/* HP Bars */
.hp-bar-container {
  width: 200px;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  overflow: hidden;
  margin: 5px auto;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hp-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--hp-green) 0%, #a8e063 100%);
  transition: width 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s ease;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.enemy-hp-bar-container {
  width: 150px;
  margin-top: 10px;
}

/* Hand Data Display */
.hand-data {
  margin-top: 10px;
  font-family: var(--fontName, sans-serif);
  font-size: 1.3rem;
  color: #ffeb3b;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  min-height: 1.5rem;
  transition: all 0.2s ease;
  transform: scale(1);
}

.hand-data.pop {
  transform: scale(1.1);
  color: #fff;
}

/* VFX Animations */
@keyframes shake {

  0%,
  100% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(-5px, 5px);
  }

  50% {
    transform: translate(5px, -5px);
  }

  75% {
    transform: translate(-5px, -5px);
  }
}

.shake {
  animation: shake 0.4s ease-in-out;
}

@keyframes flash-red {

  0%,
  100% {
    filter: brightness(1) sepia(0);
  }

  50% {
    filter: brightness(1.5) sepia(1) hue-rotate(-50deg) saturate(5);
  }
}

.flash {
  animation: flash-red 0.4s ease-in-out;
}

@keyframes card-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px) rotate(5deg);
  }

  to {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
}

.card.fade-in {
  animation: card-fade-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font1, 'Inter', sans-serif);
  user-select: none;
  transition: all 0.3s ease;
}

body {
  text-align: center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

#playerdatas {
  width: 100%;
  padding: 5px;
}

#playerCards {
  display: flex;
  justify-content: center;

  .card {
    /* width: 75px; */
    width: calc((100vw / 7) - 6px);
    /* min-width: 32px; */
    aspect-ratio: 1/1.35;
    border: 1px solid rgb(0, 0, 0);
    /* display: inline-block; */
    display: flex;
    margin: 1px;
    /* margin-right: calc( (100vw / 20)); */
    text-align: center;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    border-radius: 5px;
    background-color: beige;
    background-size: contain;

    &.selected {
      border: 2px solid #4CAF50;
      box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
      transform: translateY(-15px) scale(1.05);
      filter: brightness(1.1);
    }

    &.facedown {
      background-color: #888;
      color: #fff;
    }

    .value {
      position: absolute;
      top: 2px;
      left: 5px;
      font-size: 1.2rem;
      user-select: none;
    }

    .category {
      position: absolute;
      bottom: 0;
      right: 2px;
      font-size: 1.2rem;
      line-height: 1rem;
      user-select: none;
    }
  }

  .item-card {
    width: 90px;
    aspect-ratio: 1/1;
    border: 1px solid rgb(0, 0, 0);
    /* display: inline-block; */
    display: flex;
    margin: 1px;
    text-align: center;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    border-radius: 5px;
    background-color: beige;
    background-size: cover;
    background-position: center;
  }
}

.red {
  color: red;
}

.button {
  padding: 5px 5px;
  border-radius: 9px;

  &.nextstep {
    background-color: #fff;
  }
}

#buttons {
  margin-top: 20px;
}

#score {
  font-weight: bold;
  margin-top: 10px;
}


#game-messages {
  position: sticky;
  bottom: 0px;
  max-height: 15vh;
  overflow-y: auto;
  margin: 10px auto;
  padding: 15px;
  width: 95%;
  background: rgba(0, 0, 0, 0.6);
  /* Fond plus sombre pour le contraste */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.5);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* Inventory */
.inventory-container {
  width: 95%;
  margin: 10px auto;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  text-align: left;
}

.inventory-title {
  font-family: var(--fontName);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  margin-bottom: 8px;
  padding-left: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.inventory-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
}

.inventory-item {
  width: 40px;
  height: 40px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: help;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.inventory-item:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.5);
  z-index: 10;
}

#game-messages p {
  margin: 6px 0;
  font-size: 1rem;
  color: #ffffff;
  /* Texte blanc pur */
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  font-weight: 500;
}

/* Footer */
footer {
  width: 100%;
  padding: 20px 0;
  margin-top: auto;
  /* Pousse le footer vers le bas */
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.footer-content {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-left p {
  margin: 0;
}

.github-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.github-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.github-icon {
  fill: currentColor;
}

.version {
  color: #4CAF50;
  font-weight: bold;
}

/* enemys */
#stepdatas {
  position: relative;
  display: flex;
  justify-content: center;

  #stepboard {
    position: relative;
    background-position: top center;
    background-size: cover;
    background-repeat: no-repeat;
    width: 80vh;
    aspect-ratio: 16/9;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    .step-header {
      position: absolute;
      top: 5px;
      left: 5px;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      align-items: flex-start;

      /* 
        align-items: center; */
      .enemy-data {
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 12px;
        display: flex;
        padding: 8px 12px;
        margin: 4px;
        gap: 8px;
        font-size: 1.4rem;
        line-height: 1.4rem;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        color: white;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);

        .round-item {
          /* padding: 0px 2px 0 0; */
          font-size: 1rem;
          line-height: 1rem;
          color: #888;
          aspect-ratio: 1/1;
          position: relative;
          width: 16px;
          border-radius: 7px;

          &.actual {
            color: #000000;
            /* border: 1px solid rgb(255, 0, 0); */
            background-color: rgba(255, 208, 0, 0.808);
          }
        }

        &.hide {
          display: none;
        }

        &#enemy-name {
          font-family: var(--fontName);
        }

        &#enemy-hp {
          color: #ff5252;
          font-weight: bold;
        }

        &#enemy-round {
          color: #ffd740;
        }

      }

    }




    .enemy-tip {
      padding: 15px;
      margin: 10px;
      width: 85%;
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(15px);
      -webkit-backdrop-filter: blur(15px);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 15px;
      font-size: 1.3rem;
      line-height: 1.5rem;
      z-index: 2;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
      color: white;
      text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);

      &.hide {
        display: none;
      }

      &.fade {
        display: initial;
        animation: fadeOut 7s reverse;
        opacity: 0;
      }
    }

    #cursor {
      position: absolute;
      bottom: 0;
      display: flex;
      justify-content: center;
      height: 30px;
      gap: 5px;
      margin-bottom: 5px;
      font-size: 1.3rem;
      line-height: 1rem;

      &.hide {
        display: none;
      }

      .ico {
        height: 32px;
        background-color: #fff;
        border-radius: 9px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 1px 8px;

        &.hide {
          display: none;
        }
      }
    }
  }
}

.pile,
.discardPile {
  width: 75px;
  aspect-ratio: 1/1.5;
  border: 1px solid rgb(0, 0, 0);
  display: inline-block;
  margin: 10px;
  padding: 10px;
  text-align: center;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  position: relative;
  border-radius: 4px;
  /* background-color: beige; */
  background-image: url('../playcards/cover.jpg');
  background-size: cover;
  background-position: center;
  color: white;
}


@media (width > 600px) {
  #playerCards {
    display: flex;
    justify-content: center;

    .card {
      width: 120px;
      border-radius: 4px;

      &.selected {
        border: 2px solid #4CAF50;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
        transform: translateY(-15px) scale(1.05);
        filter: brightness(1.1);
      }

      .value {
        position: absolute;
        top: 5px;
        left: 8px;
        font-size: 2rem;
        user-select: none;
      }

      .category {
        position: absolute;
        bottom: 0px;
        right: 8px;
        font-size: 2rem;
        line-height: 2rem;
        user-select: none;
      }
    }
  }
}

@keyframes fadeOut {
  0% {
    opacity: 0;
  }

  20% {
    opacity: 0;
  }

  95% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}