/* ========================================================
   GAME BOARD & COMBAT CONTROLS : RPG-CARDS
   ======================================================== */

#stepdatas {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: var(--board-width);
  margin: 10px auto 5px;
}

#stepboard {
  position: relative;
  container-type: inline-size;
  background-position: top center;
  background-size: cover;
  background-repeat: no-repeat;
  width: var(--board-width);
  max-width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.step-header {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  z-index: 5;
}

.enemy-data {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  padding: 6px 12px;
  gap: 8px;
  font-size: 1.2rem;
  line-height: 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  color: #fff;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

#enemy-name {
  font-family: var(--fontName);
  color: #ffeb3b;
  font-size: 1.3rem;
}

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

#enemy-round {
  color: #ffd740;
}

.enemy-data .round-item {
  font-size: 0.9rem;
  line-height: 0.9rem;
  color: #888;
  aspect-ratio: 1 / 1;
  position: relative;
  width: 16px;
  border-radius: 4px;
}

.enemy-data .round-item.actual {
  color: #000;
  background-color: rgba(255, 208, 0, 0.9);
  font-weight: bold;
}

/* Jauges de Vie (HP Bars) */
.hp-bar-container {
  width: 220px;
  height: 14px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 7px;
  overflow: hidden;
  margin: 4px auto;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hp-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--hp-green) 0%, #8bc34a 100%);
  transition: width 0.4s ease, background 0.3s ease;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.enemy-hp-bar-container {
  width: 160px;
  height: 12px;
  padding: 0;
  margin: 3px 0;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7);
}

.player-hp-bar-container {
  margin: 2px auto;
}

/* Infobulles Ennemi */
.enemy-tip {
  padding: 12px 18px;
  margin: 8px;
  width: 85%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  font-size: 1.15rem;
  line-height: 1.4rem;
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  color: #fff;
  text-align: center;
}

/* Curseur et Icônes Tactiques */
#cursor {
  position: absolute;
  bottom: 8px;
  display: flex;
  gap: 8px;
  z-index: 5;
}

.ico {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.95rem;
  color: #ddd;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ico:hover {
  background: rgba(212, 175, 55, 0.4);
  color: #fff;
  transform: translateY(-2px);
  border-color: var(--gold-highlight);
}

/* Barre supérieure de statut (Topbar) */
.game-topbar {
  width: 100%;
  background: rgba(14, 11, 8, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.7);
  padding: 6px 16px;
  position: relative;
  z-index: 100;
}

.topbar-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.topbar-right {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.topbar-burger-btn {
  background: rgba(35, 28, 22, 0.9);
  border: 1px solid var(--gold-highlight);
  border-radius: 8px;
  color: #ffeb3b;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
  user-select: none;
}

.topbar-burger-btn:hover {
  background: rgba(55, 44, 34, 0.96);
  border-color: #ffd700;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.topbar-burger-btn:active {
  transform: translateY(0);
}

.ico-burger {
  display: block;
}

.burger-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--gold-highlight);
  color: #1a1612;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 10px;
  line-height: 1;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
}

/* Menu Déroulant du Burger */
.topbar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(16, 12, 9, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
  min-width: 220px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 250;
  animation: dropdownFadeIn 0.2s ease forwards;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  color: #fff8e7;
  font-family: var(--fontName);
  font-size: 0.95rem;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: rgba(212, 175, 55, 0.22);
  border-color: rgba(212, 175, 55, 0.4);
  color: #ffd700;
  transform: translateX(3px);
}

.btn-dropdown-besace .inventory-badge {
  margin-left: auto;
}

.topbar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-highlight);
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.5));
}

#playerdatas {
  font-family: var(--fontName);
  font-size: 1.12rem;
  color: #fff8e7;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.5px;
  margin: 0;
  text-align: center;
  flex: 1;
}

@media (max-width: 600px) {
  .game-topbar {
    padding: 5px 8px;
  }
  .topbar-content {
    gap: 6px;
  }
  .topbar-icon svg {
    width: 16px;
    height: 16px;
  }
  #playerdatas {
    font-size: 0.84rem;
    letter-spacing: 0px;
  }
}

.hand-data {
  margin: 8px auto;
  font-family: var(--fontName);
  font-size: 1.3rem;
  color: #ffeb3b;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  min-height: 1.6rem;
  text-align: center;
  transition: transform 0.2s ease, color 0.2s ease;
}

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

/* Boutons de Combat */
#buttons {
  margin: 14px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 20;
}

#buttons.hide {
  display: none !important;
}

button, .button {
  font-family: var(--fontName);
  font-size: 1.15rem;
  padding: 10px 22px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(30, 25, 20, 0.85);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  user-select: none;
}

button:hover, .button:hover {
  background: rgba(212, 175, 55, 0.3);
  border-color: var(--gold-highlight);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6);
}

button:active, .button:active {
  transform: translateY(0);
}

#attackButton {
  min-width: 140px;
  background: rgba(180, 40, 40, 0.85);
  border-color: #ff6b6b;
  font-weight: bold;
}

#attackButton:hover {
  background: rgba(220, 50, 50, 0.95);
  box-shadow: 0 0 12px rgba(244, 67, 54, 0.6);
}

#discardButton {
  min-width: 140px;
  background: rgba(60, 60, 70, 0.85);
  border-color: #90a4ae;
  font-weight: bold;
}

#discardButton:hover {
  background: rgba(90, 90, 110, 0.95);
  box-shadow: 0 0 12px rgba(144, 164, 174, 0.6);
}

.button.nextstep {
  position: absolute;
  bottom: 20px;
  background: rgba(46, 125, 50, 0.9);
  border-color: #81c784;
  font-size: 1.25rem;
  padding: 10px 24px;
  z-index: 15;
}

.button.nextstep:hover {
  background: rgba(56, 142, 60, 1);
  box-shadow: 0 0 16px rgba(76, 175, 80, 0.8);
}

/* Animations de Secousse et Flash */
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-6px, 6px); }
  50% { transform: translate(6px, -6px); }
  75% { transform: translate(-6px, -6px); }
}

.shake {
  animation: shake 0.35s 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.35s ease-in-out;
}

/* Footer & Navigation */
footer {
  width: 100%;
  padding: 18px 0;
  margin-top: auto;
  background: rgba(0, 0, 0, 0.5);
  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: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

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

.github-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

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