.darkfall-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a0a;
}

#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.game-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 10;
}

.hud-left, .hud-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #000000b3;
  border-radius: 20px;
  padding: 6px 12px;
  min-width: 140px;
}

.stat-icon {
  font-size: 18px;
}

.stat-fill {
  flex: 1;
  height: 12px;
  background: #fff3;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.health-bar .stat-fill:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #e74c3c, #c0392b);
  transition: width .3s;
}

.hunger-bar .stat-fill:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #f39c12, #d68910);
  transition: width .3s;
}

.stat-text {
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  min-width: 30px;
  text-align: right;
}

.hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.day-display {
  background: #000000b3;
  border-radius: 12px;
  padding: 8px 20px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.day-label {
  color: #ffffffb3;
  font-size: 14px;
}

#day-number {
  font-size: 24px;
  font-weight: bold;
  color: #f1c40f;
}

.time-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #000000b3;
  border-radius: 12px;
  padding: 8px 15px;
}

.time-icon {
  font-size: 20px;
}

.time-bar {
  width: 120px;
  height: 8px;
  background: #fff3;
  border-radius: 4px;
  overflow: hidden;
}

.time-progress {
  height: 100%;
  background: linear-gradient(90deg, #f39c12, #e74c3c);
  transition: width .5s, background .5s;
}

.light-meter {
  background: #000000b3;
  border-radius: 12px;
  padding: 8px 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  color: #f39c12;
}

.inventory-bar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  background: #000c;
  padding: 10px;
  border-radius: 12px;
  z-index: 10;
}

.inv-slot {
  width: 50px;
  height: 50px;
  background: #ffffff1a;
  border: 2px solid #ffffff4d;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}

.inv-slot:hover {
  border-color: #f39c12;
}

.inv-slot.selected {
  border-color: #f1c40f;
  box-shadow: 0 0 10px #f1c40f80;
}

.inv-slot .item-icon {
  font-size: 24px;
}

.inv-slot .item-count {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 11px;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
}

.inv-slot .slot-key {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 10px;
  color: #ffffff80;
}

.crafting-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #14141ef2;
  border: 2px solid #ffc86466;
  border-radius: 16px;
  padding: 25px;
  min-width: 320px;
  z-index: 100;
}

.crafting-panel h3 {
  color: #f1c40f;
  margin: 0 0 20px;
  text-align: center;
  font-size: 22px;
}

.recipes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.recipe {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff0d;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
}

.recipe:hover {
  background: #ffc86426;
}

.recipe.disabled {
  opacity: .4;
  cursor: not-allowed;
}

.recipe .recipe-icon {
  font-size: 28px;
}

.recipe .recipe-info {
  flex: 1;
}

.recipe .recipe-name {
  color: #fff;
  font-weight: bold;
}

.recipe .recipe-cost {
  color: #fff9;
  font-size: 12px;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 5px 10px;
}

.message-log {
  position: absolute;
  bottom: 100px;
  left: 20px;
  max-width: 350px;
  z-index: 10;
  pointer-events: none;
}

.message {
  background: #000000b3;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 14px;
  animation: .3s fadeIn;
}

.message.warning {
  border-left: 3px solid #e74c3c;
}

.message.success {
  border-left: 3px solid #2ecc71;
}

.message.info {
  border-left: 3px solid #3498db;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000000e6;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
}

.overlay-content {
  background: linear-gradient(145deg, #1e1e32f2, #0f0f19f2);
  border: 2px solid #ffc8644d;
  border-radius: 20px;
  padding: 40px 50px;
  text-align: center;
  max-width: 450px;
}

.overlay-content h2 {
  font-size: 36px;
  color: #f1c40f;
  margin-bottom: 15px;
}

.tagline {
  color: #fffc;
  font-size: 16px;
  margin-bottom: 25px;
}

.instructions-list {
  text-align: left;
  margin: 20px 0;
}

.instruction {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  color: #fffc;
}

.instruction .key {
  background: #ffc86433;
  border: 1px solid #ffc86466;
  border-radius: 6px;
  padding: 5px 12px;
  font-family: monospace;
  color: #fff;
  min-width: 50px;
  text-align: center;
}

.hint {
  color: #f39c12;
  font-style: italic;
  margin: 20px 0;
}

button {
  background: linear-gradient(145deg, #d68910, #b9770e);
  border: none;
  border-radius: 12px;
  padding: 15px 40px;
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  transition: all .3s;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px #d6891066;
}

.gameover h2 {
  color: #e74c3c;
}

.gameover #death-reason {
  font-size: 20px;
  color: #fff;
  margin: 15px 0;
  text-shadow: 0 2px 4px #00000080;
}

.gameover #survival-stats {
  font-size: 24px;
  font-weight: bold;
  color: #f1c40f;
  margin: 20px 0 25px;
  text-shadow: 0 2px 4px #00000080;
}

[hidden] {
  display: none !important;
}
