/* ==================== MINECRAFT CLICKER ==================== */

/* ВКЛАДКИ */
.mc-tabs {
  display: flex;
  gap: 3px;
  background: #b0b0b0;
  border-bottom: 2px solid #808080;
  padding: 6px 6px 0 6px;
}
.mc-tab-btn {
  background: linear-gradient(180deg, #e8e8e8 0%, #c8c8c8 100%);
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  border-bottom: none;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 12px;
  font-weight: bold;
  color: #000;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  margin-bottom: -2px;
  transition: all 0.1s;
}
.mc-tab-btn:hover:not(.active) {
  background: linear-gradient(180deg, #f0f0f0 0%, #d8d8d8 100%);
}
.mc-tab-btn.active {
  background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 100%);
  border-color: #ffffff #808080 #c0c0c0 #ffffff;
  padding-bottom: 10px;
  box-shadow: inset 0 3px 0 #ffcc00;
}

/* СТАТИСТИКА */
.mc-stats-bar {
  display: flex;
  justify-content: space-around;
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
  color: #fff;
  padding: 8px 12px;
  font-size: 12px;
  border-bottom: 2px solid #000;
}
.mc-stats-bar b {
  color: #ffd700;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
}

/* БЛОК ЗЕМЛИ */
.dirt-block {
  width: 140px;
  height: 140px;
  margin: 8px auto;
  position: relative;
  cursor: pointer;
  background-color: #8B5A2B;
  border: 5px solid;
  border-color: #a0703e #5A3A1A #5A3A1A #a0703e;
  border-radius: 4px;
  transition: transform 0.08s;
  user-select: none;
  overflow: hidden;
  box-shadow: inset -6px -6px 12px rgba(0, 0, 0, 0.3),
              inset 6px 6px 12px rgba(255, 255, 255, 0.05),
              3px 3px 8px rgba(0, 0, 0, 0.4);
}
.dirt-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(0, 0, 0, 0.3) 6%, transparent 6%),
    radial-gradient(circle at 45% 12%, rgba(0, 0, 0, 0.25) 5%, transparent 5%),
    radial-gradient(circle at 78% 25%, rgba(0, 0, 0, 0.3) 7%, transparent 7%),
    radial-gradient(circle at 25% 55%, rgba(0, 0, 0, 0.28) 6%, transparent 6%),
    radial-gradient(circle at 62% 48%, rgba(0, 0, 0, 0.22) 5%, transparent 5%),
    radial-gradient(circle at 88% 62%, rgba(0, 0, 0, 0.28) 6%, transparent 6%),
    radial-gradient(circle at 18% 82%, rgba(0, 0, 0, 0.3) 7%, transparent 7%),
    radial-gradient(circle at 48% 88%, rgba(0, 0, 0, 0.22) 5%, transparent 5%),
    radial-gradient(circle at 75% 82%, rgba(0, 0, 0, 0.28) 6%, transparent 6%);
  pointer-events: none;
}
.dirt-block:active {
  transform: scale(0.93) translateY(2px);
}
.dirt-block.stage-dirt { background-color: #8B5A2B; }
.dirt-block.stage-stone { background-color: #9a9a9a; }
.dirt-block.stage-wood { background-color: #a0683a; }
.dirt-block.stage-coal { background-color: #3a3a3a; }
.dirt-block.stage-iron { background-color: #d8c8a8; }
.dirt-block.stage-gold { background-color: #ffd700; }
.dirt-block.stage-diamond { background-color: #5ee6e6; }
.dirt-block.stage-netherite { background-color: #5a4a4a; }

/* ПЛЮСИКИ */
.floater {
  position: absolute;
  color: #ffff00;
  font-weight: bold;
  font-size: 16px;
  pointer-events: none;
  animation: floatUp 0.7s ease-out forwards;
  text-shadow: 1px 1px 0 #000;
  z-index: 5;
}
@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-40px); }
}

/* ЧАСТИЦЫ */
.mine-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  pointer-events: none;
  animation: particleFly 0.6s ease-out forwards;
  z-index: 4;
}
@keyframes particleFly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); }
}

/* ПРОГРЕСС */
.mc-progress-bar {
  height: 16px;
  background: linear-gradient(180deg, #2a2a2a, #1a1a1a);
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}
.mc-progress-fill {
  height: 100%;
  background: linear-gradient(180deg, #1084d0 0%, #000080 100%);
  transition: width 0.2s ease-out;
  position: relative;
}
.mc-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0, transparent 8px,
              rgba(255, 255, 255, 0.15) 8px, rgba(255, 255, 255, 0.15) 10px);
}

/* ==================== ИНВЕНТАРЬ ==================== */
.inv-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px;
  background: linear-gradient(180deg, #6B4A2B 0%, #4A2E15 100%);
  border: 3px solid;
  border-color: #8B6F47 #2A1810 #2A1810 #8B6F47;
  border-radius: 4px;
  margin-bottom: 14px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4), 2px 2px 6px rgba(0, 0, 0, 0.3);
}

.inv-slot {
  aspect-ratio: 1;
  background: linear-gradient(180deg, #3A2410 0%, #2A1810 100%);
  border: 2px solid;
  border-color: #2A1810 #8B6F47 #8B6F47 #2A1810;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 4px 4px;
  position: relative;
  user-select: none;
  transition: all 0.15s;
  box-sizing: border-box;
  overflow: hidden;
  min-height: 70px;
}

.inv-slot:hover {
  background: linear-gradient(180deg, #4A2E15 0%, #3A2410 100%);
  box-shadow: inset 0 0 12px rgba(255, 215, 0, 0.25);
  transform: scale(1.03);
}

/* Картинка предмета в слоте */
.inv-slot .inv-icon-img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  object-fit: contain;
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.8));
  flex-shrink: 0;
}

/* Фолбэк эмодзи */
.inv-icon {
  font-size: 24px;
  line-height: 1;
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.8));
}

/* Название под картинкой */
.inv-name {
  font-size: 10px;
  color: #ddd;
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-family: inherit;
  margin-top: 2px;
}

/* Количество */
.inv-count {
  position: absolute;
  top: 3px;
  right: 4px;
  font-size: 11px;
  color: #fff;
  font-weight: bold;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
  font-family: "Courier New", monospace;
  z-index: 2;
}

/* Продажа */
.sell-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sell-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 100%);
  border: 2px solid #a0a0a0;
  border-left: 5px solid #ffcc00;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.sell-row:hover {
  background: linear-gradient(90deg, #ffffcc 0%, #fff8b0 100%);
  border-color: #ffcc00;
  transform: translateX(3px);
}
.sell-row span:last-child {
  color: #008000;
  font-weight: bold;
}
.sell-row .inv-icon-inline {
  vertical-align: middle;
}

/* ==================== КРАФТ ==================== */
.craft-recipe {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 100%);
  border: 2px solid #a0a0a0;
  border-left: 6px solid #a0a0a0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.craft-recipe:hover:not(.disabled):not(.maxed) {
  background: linear-gradient(90deg, #d0e0ff 0%, #e8f0ff 100%);
  border-color: #000080;
  border-left-color: #000080;
  transform: translateX(4px);
  box-shadow: -4px 4px 10px rgba(0, 0, 0, 0.15);
}
.craft-recipe.disabled {
  opacity: 0.5;
  cursor: default;
}
.craft-recipe.maxed {
  background: linear-gradient(90deg, #d0f0d0 0%, #e8ffe8 100%);
  border-color: #008000;
  border-left-color: #008000;
  cursor: default;
}

/* Иконка крафта слева */
.craft-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #3A2410 0%, #2A1810 100%);
  border: 2px solid;
  border-color: #2A1810 #8B6F47 #8B6F47 #2A1810;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  box-sizing: border-box;
}
.craft-icon-img {
  width: 100%;
  height: 100%;
  max-width: 40px;
  max-height: 40px;
  image-rendering: pixelated;
  object-fit: contain;
  display: block;
}

.craft-info {
  flex: 1;
  min-width: 0;
}
.craft-name {
  font-size: 13px;
  font-weight: bold;
  color: #000080;
  margin-bottom: 3px;
}
.craft-desc {
  font-size: 11px;
  color: #333;
  margin-bottom: 4px;
  font-style: italic;
}
.craft-cost {
  font-size: 11px;
  color: #800080;
  font-weight: bold;
  font-family: "Courier New", monospace;
  background: #f8e8f8;
  padding: 3px 6px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.craft-out {
  font-size: 11px;
  color: #008000;
  font-weight: bold;
  font-family: "Courier New", monospace;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* ==================== МАГАЗИН ==================== */
.upgrade-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 5px;
  background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 100%);
  border: 2px solid #a0a0a0;
  border-left: 5px solid #a0a0a0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}
.upgrade-item:hover:not(.disabled) {
  background: linear-gradient(90deg, #d0e0ff 0%, #e8f0ff 100%);
  border-color: #000080;
  border-left-color: #000080;
  transform: translateX(3px);
}
.upgrade-item.disabled {
  opacity: 0.5;
  cursor: default;
}

/* Иконка магазина слева */
.upgrade-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #3A2410 0%, #2A1810 100%);
  border: 2px solid;
  border-color: #2A1810 #8B6F47 #8B6F47 #2A1810;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  box-sizing: border-box;
}
.upgrade-icon-img {
  width: 100%;
  height: 100%;
  max-width: 36px;
  max-height: 36px;
  image-rendering: pixelated;
  object-fit: contain;
  display: block;
}

.upgrade-info {
  flex: 1;
  min-width: 0;
}
.upgrade-name {
  font-weight: bold;
  color: #000;
  font-size: 13px;
}
.upgrade-desc {
  font-size: 11px;
  color: #555;
  margin-top: 2px;
}
.upgrade-cost {
  font-weight: bold;
  color: #008000;
  margin-left: 8px;
  white-space: nowrap;
  font-size: 12px;
  background: #ffffcc;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid #808000;
}

/* ==================== ИНЛАЙН-ИКОНКИ 16x16 ==================== */
.inv-icon-inline {
  width: 16px;
  height: 16px;
  max-width: 16px;
  max-height: 16px;
  image-rendering: pixelated;
  vertical-align: middle;
  display: inline-block;
  margin: 0 2px;
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.4));
}

/* ==================== АРЕНА БОССА ==================== */
#bossArena {
  width: 200px;
  margin: 0 auto;
  text-align: center;
  animation: bossArenaIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes bossArenaIn {
  from { opacity: 0; transform: scale(0.4) rotate(-8deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}
.boss-arena-hp {
  height: 16px;
  background: #1a0000;
  border: 2px solid #fff;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 60, 60, 0.5);
  overflow: hidden;
  margin-bottom: 4px;
  border-radius: 2px;
}
.boss-arena-hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(180deg, #ff8080 0%, #ff2020 50%, #a00000 100%);
  transition: width 0.15s ease-out;
  box-shadow: 0 0 8px rgba(255, 60, 60, 0.9);
  position: relative;
}
.boss-arena-hp-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0, transparent 10px,
              rgba(255, 255, 255, 0.15) 10px, rgba(255, 255, 255, 0.15) 12px);
}
.boss-arena-name {
  font-size: 14px;
  font-weight: bold;
  color: #800000;
  margin-bottom: 2px;
  text-shadow: 0 0 8px rgba(255, 60, 60, 0.6);
  letter-spacing: 1px;
}
.boss-arena-timer {
  font-size: 12px;
  font-family: "Courier New", monospace;
  font-weight: bold;
  color: #cc0000;
  margin-bottom: 6px;
  animation: bossTimerPulse 1s ease-in-out infinite;
}
@keyframes bossTimerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.boss-arena-face {
  width: 140px;
  height: 140px;
  margin: 0 auto;
  cursor: pointer;
  transition: transform 0.06s;
  filter: drop-shadow(0 0 14px rgba(255, 60, 60, 0.8)) drop-shadow(0 0 30px rgba(255, 150, 0, 0.4));
  animation: bossFaceFloat 1.6s ease-in-out infinite;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}
@keyframes bossFaceFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}
.boss-arena-face:active {
  transform: scale(0.88) !important;
  animation-play-state: paused;
}
.boss-arena-face.shake {
  animation: bossFaceShake 0.2s ease-in-out;
}
@keyframes bossFaceShake {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-6px) rotate(-4deg) scale(0.96); }
  75% { transform: translateX(6px) rotate(4deg) scale(0.96); }
}
.boss-arena-face .inv-icon-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
  display: block;
  border: 4px solid #000;
  border-radius: 4px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
  object-fit: cover;
}
.boss-arena-hp-text {
  font-size: 11px;
  color: #800000;
  font-family: "Courier New", monospace;
  margin-top: 6px;
  font-weight: bold;
}

/* ==================== АДМИН ==================== */
.mc-admin {
  background: linear-gradient(180deg, #ffffcc 0%, #fff8a0 100%);
  border: 2px solid #808000;
  border-radius: 4px;
  padding: 12px;
}
.mc-admin h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: #800000;
  border-bottom: 1px solid #808000;
  padding-bottom: 6px;
}
.mc-admin-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.mc-admin-row input,
.mc-admin-row select {
  padding: 4px 8px;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
  font-family: inherit;
  font-size: 12px;
  background: #fff;
}
.mc-admin-row button {
  padding: 5px 12px;
  font-family: inherit;
  font-size: 11px;
  font-weight: bold;
  background: linear-gradient(180deg, #e8e8e8, #c8c8c8);
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  cursor: pointer;
  border-radius: 3px;
}
.mc-admin-row button:active {
  border-color: #808080 #ffffff #ffffff #808080;
  transform: translate(1px, 1px);
}
.mc-admin-row button.danger {
  background: linear-gradient(180deg, #ff9090, #d04040);
  color: #fff;
}
.mc-admin-row button.warn {
  background: linear-gradient(180deg, #ffe090, #e0b020);
}

/* ==================== ЭТАПЫ ==================== */
.stage-btn {
  padding: 5px 10px;
  font-size: 11px;
  background: linear-gradient(180deg, #e8e8e8, #c8c8c8);
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.stage-btn:hover:not(.locked) {
  background: linear-gradient(180deg, #f0f0f0, #d8d8d8);
}
.stage-btn.active {
  background: linear-gradient(180deg, #1084d0, #000080);
  color: #fff;
  border-color: #808080 #fff #fff #808080;
}
.stage-btn.locked {
  opacity: 0.4;
  cursor: default;
}

/* ==================== МОБИЛЬНАЯ ==================== */
@media (max-width: 640px) {
  .inv-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    padding: 8px;
  }
  .inv-slot {
    min-height: 60px;
    padding: 4px 2px 3px 2px;
  }
  .inv-slot .inv-icon-img {
    width: 26px;
    height: 26px;
  }
  .inv-name {
    font-size: 9px;
  }
  .mc-tab-btn {
    padding: 6px 8px;
    font-size: 10px;
  }
  .craft-icon {
    width: 40px;
    height: 40px;
  }
  .craft-icon-img {
    max-width: 32px;
    max-height: 32px;
  }
  .upgrade-icon {
    width: 38px;
    height: 38px;
  }
  .upgrade-icon-img {
    max-width: 30px;
    max-height: 30px;
  }
  .boss-arena-face {
    width: 110px;
    height: 110px;
  }
  .boss-arena-name {
    font-size: 12px;
  }
  .inv-icon-inline {
    width: 14px;
    height: 14px;
    max-width: 14px;
    max-height: 14px;
  }
}