.dungeon-active-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: radial-gradient(circle at center, #0a1118 0%, #05080c 100%);
  padding: 30px;
  gap: 25px;
  font-family: "Space Mono", monospace;
  color: #e0e6ed;
  box-sizing: border-box;
}

/* HEADER */
.dungeon-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid rgba(0, 212, 255, 0.3);
  padding-bottom: 15px;
  position: relative;
}

.dungeon-header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 3px;
  background: #00d4ff;
  box-shadow: 0 0 15px #00d4ff;
}

.progress-text {
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: #00d4ff;
  font-weight: bold;
}

.progress-bar {
  width: 250px;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  margin-top: 8px;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, #00d4ff, #0088ff);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
  transition: width 0.5s ease-in-out;
}

.dungeon-title-area {
  text-align: right;
}

.dungeon-name {
  font-family: "Orbitron", sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
}

.dungeon-status-tag {
  font-size: 0.7rem;
  color: #ff4444;
  animation: blink 1.5s infinite;
}

/* LAYOUT */
.battle-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  flex: 1;
  gap: 30px;
  min-height: 0; /* Важливо для overflow лога */
}

/* ENEMY CARD */
.enemy-display {
  position: relative;
  height: 100%;
}

.enemy-card {
  background: linear-gradient(
    180deg,
    rgba(255, 68, 68, 0.08) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  border: 1px solid rgba(255, 68, 68, 0.2);
  border-radius: 4px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.enemy-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.02) 3px
  );
  pointer-events: none;
}

.enemy-card.defeated {
  filter: grayscale(1) brightness(0.5);
  border-color: rgba(160, 172, 186, 0.2);
  background: rgba(0, 0, 0, 0.4);
}

.threat-tag {
  color: #ff4444;
  font-family: "Orbitron", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 4px;
  margin-bottom: 30px;
  text-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.enemy-icon {
  font-size: 6rem;
  color: #fff;
  margin-bottom: 25px;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.2));
}

.enemy-name {
  font-family: "Orbitron", sans-serif;
  font-size: 1.8rem;
  margin: 0 0 20px 0;
  color: #fff;
  text-transform: uppercase;
}

/* HP BAR MINI */
.enemy-hp-container {
  width: 60%;
  margin-bottom: 30px;
}

.hp-label {
  font-size: 0.6rem;
  color: #a0acba;
  margin-bottom: 6px;
  text-align: center;
  letter-spacing: 1px;
}

.hp-bar-mini {
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px;
}

.hp-fill-mini {
  height: 100%;
  background: #ff4444;
  box-shadow: 0 0 15px rgba(255, 68, 68, 0.6);
  transition: width 0.3s ease-out;
}

.enemy-info-footer {
  display: flex;
  gap: 20px;
  font-size: 0.75rem;
  color: rgba(160, 172, 186, 0.7);
}

/* COMBAT LOG */
.combat-log-wrapper {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(26, 38, 56, 0.8);
}

.log-header {
  background: rgba(26, 38, 56, 0.5);
  padding: 10px 15px;
  font-size: 0.7rem;
  font-weight: bold;
  letter-spacing: 1px;
  color: #00d4ff;
  border-bottom: 1px solid rgba(26, 38, 56, 0.8);
}

.combat-log {
  flex: 1;
  padding: 20px;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #1a2638 transparent;
}

.log-entry {
  line-height: 1.4;
  color: #a0acba;
  animation: slideIn 0.2s ease-out;
}

.log-arrow {
  color: #00d4ff;
  margin-right: 8px;
  font-weight: bold;
}

/* CONTROLS */
.dungeon-controls {
  display: flex;
  gap: 20px;
  height: 70px;
}

.ctrl-btn {
  flex: 1;
  border: none;
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 1rem;
  letter-spacing: 2px;
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
  transition: all 0.2s;
}

.ctrl-btn.combat {
  background: #ff4444;
  color: #000;
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
}
.ctrl-btn.loot {
  background: #ffaa00;
  color: #000;
  box-shadow: 0 0 20px rgba(255, 170, 0, 0.3);
}
.ctrl-btn.next {
  background: #00d4ff;
  color: #000;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.ctrl-btn:hover {
  filter: brightness(1.2);
  transform: scale(1.02);
}

.ctrl-btn:active {
  transform: scale(0.98);
}

/* UTILS */
.empty-room {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(0, 212, 255, 0.4);
  gap: 15px;
  border: 1px dashed rgba(0, 212, 255, 0.2);
}

.empty-room i {
  font-size: 3rem;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.custom-scroll::-webkit-scrollbar {
  width: 4px;
}
.custom-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: #1a2638;
  border-radius: 2px;
}

/* Вирівнювання футера картки */
.enemy-info-footer {
  display: flex;
  justify-content: space-between; /* Розносимо LVL та ID по боках */
  width: 80%; /* Щоб не були впритул до країв */
  margin-top: auto; /* Притискаємо до низу */
  padding-bottom: 20px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Ефект трясіння при атаці */
.enemy-card.taking-damage {
  animation: shake 0.2s ease-in-out;
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

@keyframes shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px) rotate(-1deg);
  }
  50% {
    transform: translateX(5px) rotate(1deg);
  }
  75% {
    transform: translateX(-5px);
  }
  100% {
    transform: translateX(0);
  }
}

/* Покращення читабельності лога */
.combat-log-wrapper {
  min-width: 300px; /* Щоб лог не стискався занадто сильно */
}
