/* ===== boss-fight.css — мини-игра боя с боссом (Minecraft RPG) ===== */

#screen-boss {
  display: none;
  padding: 56px 12px 40px;
  background-image:
    linear-gradient(180deg, rgba(20,10,10,.92) 0%, rgba(26,29,41,.95) 100%),
    url('../img/minecraft/loc5-stronghold.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh;
}
#screen-boss.active { display: block; }

.boss-fight-wrap {
  max-width: 700px;
  margin: 0 auto;
}

.boss-fight-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.boss-fight-title {
  font-size: 24px; font-weight: 900; color: var(--rb-red);
  text-shadow: 2px 2px 0 #000;
  animation: pulse 1s infinite;
}

.boss-arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  background: rgba(0,0,0,.4);
  border: 3px solid var(--rb-dark-3);
  border-radius: var(--rb-radius-l);
  padding: 20px;
}

.boss-side, .player-side {
  text-align: center;
}

.boss-img-wrap, .player-img-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 8px;
}
.boss-img {
  width: 140px; height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(226,35,26,.4));
  transition: transform .2s;
}
.boss-img-active {
  animation: bossShake .5s infinite;
}
@keyframes bossShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
.boss-emoji {
  position: absolute;
  top: -8px; right: -8px;
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.8));
}
.player-img {
  width: 120px; height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,166,81,.4));
  transition: transform .2s;
}
.player-img-active {
  animation: playerBob 1s infinite;
}
@keyframes playerBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.boss-name, .player-name {
  font-size: 18px; font-weight: 800; margin-bottom: 6px;
}
.boss-name { color: var(--rb-red); }
.player-name { color: var(--rb-green); }

.boss-hp-bar, .player-hp-bar {
  position: relative;
  width: 100%;
  height: 24px;
  background: var(--rb-dark);
  border: 2px solid var(--rb-dark-3);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 6px;
}
.boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rb-red), #FF6B6B);
  transition: width .4s;
}
.player-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rb-green), #7EE3A8);
  transition: width .4s;
}
.boss-hp-text, .player-hp-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
}

.boss-hearts, .player-hearts {
  font-size: 14px;
  letter-spacing: 1px;
  min-height: 20px;
}
.boss-heart.empty, .player-heart.empty {
  opacity: .3;
}

.player-gear {
  display: flex; gap: 6px; justify-content: center; flex-wrap: wrap;
  margin-top: 8px;
}
.gear-chip {
  background: var(--rb-dark-3);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}

.vs-divider {
  font-size: 32px;
  animation: pulse 1s infinite;
  color: var(--rb-yellow);
}

.boss-log {
  background: rgba(0,0,0,.5);
  border: 2px solid var(--rb-dark-3);
  border-radius: var(--rb-radius);
  padding: 10px 14px;
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 16px;
  font-size: 13px;
}
.log-entry {
  padding: 2px 0;
  line-height: 1.4;
}
.log-entry.player { color: #7EE3A8; }
.log-entry.boss { color: #FF9B96; }
.log-entry.dodge { color: var(--rb-cyan); }
.log-entry.win { color: var(--rb-yellow); font-weight: 800; }
.log-entry.lose { color: var(--rb-red); font-weight: 800; }

.boss-actions {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}
.boss-turn-wait {
  font-size: 18px;
  color: var(--rb-yellow);
  font-weight: 800;
  animation: pulse 1s infinite;
  padding: 16px;
}

.boss-result {
  text-align: center;
  padding: 20px;
}
.boss-win {
  font-size: 36px;
  font-weight: 900;
  color: var(--rb-green);
  text-shadow: 3px 3px 0 #000;
  margin-bottom: 16px;
  animation: bounceIn .5s;
}
.boss-lose {
  font-size: 36px;
  font-weight: 900;
  color: var(--rb-red);
  text-shadow: 3px 3px 0 #000;
  margin-bottom: 16px;
  animation: shake .5s;
}

/* ===== Инвентарь (на карте) ===== */
.inventory-panel {
  background: linear-gradient(180deg, var(--rb-dark-3), var(--rb-dark-2));
  border: 3px solid var(--rb-dark-3);
  border-radius: var(--rb-radius-l);
  padding: 14px;
  margin-bottom: 16px;
}
.inventory-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--rb-yellow);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 8px;
}
.inv-slot {
  background: var(--rb-dark);
  border: 2px solid var(--rb-dark-3);
  border-radius: 6px;
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
  position: relative;
}
.inv-slot.has {
  border-color: var(--rb-yellow);
  box-shadow: 0 0 6px rgba(255,215,0,.2);
}
.inv-slot-icon {
  font-size: 24px;
  display: block;
  line-height: 1;
}
.inv-slot-count {
  font-weight: 800;
  color: var(--rb-yellow);
  font-size: 13px;
}
.inv-slot-label {
  color: var(--rb-gray-l);
  font-size: 9px;
  margin-top: 2px;
}

.gear-panel {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}
.gear-slot {
  background: var(--rb-dark);
  border: 2px solid var(--rb-dark-3);
  border-radius: 8px;
  padding: 8px 14px;
  text-align: center;
  font-size: 13px;
}
.gear-slot-label {
  color: var(--rb-gray-l);
  font-size: 10px;
  margin-bottom: 2px;
}
.gear-slot-value {
  font-weight: 800;
  color: var(--rb-yellow);
}

/* Кнопка крафта */
.craft-btn {
  width: 100%;
  margin-top: 8px;
}
.craft-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* Кнопка боя с боссом на карте */
.boss-fight-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(180deg, #FF3A30, var(--rb-red));
  color: #fff;
  border: 3px solid rgba(0,0,0,.2);
  border-radius: var(--rb-radius);
  font-size: 18px;
  font-weight: 900;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--rb-shadow), inset 0 -4px 0 rgba(0,0,0,.2);
  animation: pulse 1.5s infinite;
  margin-top: 12px;
}
.boss-fight-btn:hover { filter: brightness(1.1); }
.boss-fight-btn:active { transform: translateY(3px); }
.boss-fight-btn.defeated {
  background: linear-gradient(180deg, #00C961, var(--rb-green));
  animation: none;
}
