/* === HUD === */
.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-color);
  padding: 0.4rem 0.6rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.hud-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.55rem;
}

.hud-health {
  font-size: 1.1rem;
  letter-spacing: 2px;
}

.hud-score {
  font-size: 0.7rem;
  color: var(--text-accent);
}

.hud-info {
  color: var(--text-secondary);
}

.hud-inventory {
  display: flex;
  gap: 0.5rem;
  font-size: 0.6rem;
}

.hud-inventory span {
  opacity: 0.8;
}

/* === GAME VIEWPORT === */
.game-viewport {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  bottom: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(20, 1fr);
  width: 100%;
  height: 100%;
  max-width: 450px;
  max-height: 600px;
  gap: 0px;
  background: #111;
}

/* === GRID TILES === */
.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: min(2vw, 18px);
  position: relative;
  transition: opacity 0.15s;
  border: 1px solid rgba(255,255,255,0.03);
}

/* Tile backgrounds */
.tile-empty {
  background: #1a1a2e;
}

.tile-dirt {
  background: #8B4513;
}

.tile-hard-rock {
  background: #696969;
}

.tile-indestructible {
  background: #333;
}

.tile-gold {
  background: #B8860B;
}

.tile-silver {
  background: #708090;
}

.tile-chest {
  background: #8B6914;
}

.tile-ladder {
  background: #1a1a2e;
}

.tile-torch {
  background: #1a1a2e;
}

.tile-monster {
  background: #2d1a1a;
}

.tile-player {
  background: #1a2d1a;
}

/* Fog of war overlay */
.tile-fog {
  position: relative;
}

.tile-fog::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, var(--fog-opacity, 0.85));
  pointer-events: none;
}

/* Dig animation */
.tile-digging {
  animation: shake 0.2s;
}

/* Hit flash */
.tile-hit {
  background: #ff0 !important;
}

/* === LEVEL TRANSITION === */
.level-announce {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  color: var(--text-accent);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
  z-index: 50;
  animation: fadeIn 0.5s, slideUp 0.5s;
  pointer-events: none;
}
