.hm-container {
  background-color: #050505;
  color: #c0392b;
  font-family: 'Orbitron', sans-serif;
  padding: 20px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(192, 57, 43, 0.1);
  min-height: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Atmospheric scanlines effect */
.hm-container::after {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  z-index: 10;
  background-size: 100% 4px, 3px 100%;
  pointer-events: none;
}

.hm-stats {
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.9rem;
  display: flex;
  gap: 30px;
  color: #7f8c8d;
}

.hm-stat-val { color: #e74c3c; font-weight: bold; text-shadow: 0 0 10px rgba(231, 76, 60, 0.5); }

.hm-grid {
  display: grid;
  grid-template-columns: repeat(12, 35px);
  grid-template-rows: repeat(12, 35px);
  gap: 2px;
  background-color: #000;
  border: 4px solid #1a1a1a;
  position: relative;
}

.hm-cell {
  width: 35px;
  height: 35px;
  background-color: #000;
  position: relative;
  transition: background-color 0.2s;
}

/* Darkness / Fog of War */
.hm-cell.dark { background-color: #000 !important; }
.hm-cell.wall { background-color: #1a1a1a; box-shadow: inset 0 0 10px #000; }
.hm-cell.floor { background-color: #0d0d0d; }
.hm-cell.player { background-color: #e74c3c; box-shadow: 0 0 15px #e74c3c; z-index: 5; }
.hm-cell.exit { background-color: #27ae60; box-shadow: 0 0 15px #27ae60; z-index: 5; animation: hm-pulse 1.5s infinite; }
.hm-cell.trap { background-color: #1e0000; } /* Subtle trap color */

@keyframes hm-pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.hm-controls {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, 60px);
  gap: 10px;
}

.hm-btn {
  width: 60px;
  height: 60px;
  background: #1a1a1a;
  border: 1px solid #333;
  color: #e74c3c;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  font-size: 1.5rem;
  transition: all 0.2s;
  user-select: none;
}

.hm-btn:active { background: #c0392b; color: white; transform: scale(0.9); }
.hm-btn.up { grid-column: 2; }
.hm-btn.left { grid-column: 1; grid-row: 2; }
.hm-btn.down { grid-column: 2; grid-row: 2; }
.hm-btn.right { grid-column: 3; grid-row: 2; }

/* Glitch effect on death */
@keyframes hm-glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-5px, 5px); filter: hue-rotate(90deg); }
  40% { transform: translate(5px, -5px); }
  60% { transform: translate(-5px, -5px); filter: hue-rotate(180deg); }
  80% { transform: translate(5px, 5px); }
  100% { transform: translate(0); }
}

.hm-glitch-active {
  animation: hm-glitch 0.1s infinite;
  background-color: #4c0000 !important;
}

.hm-msg {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.9);
  padding: 2rem;
  border: 2px solid #e74c3c;
  text-align: center;
  z-index: 100;
  display: none;
}

.hm-reset {
  margin-top: 1rem;
  background: #e74c3c;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-family: inherit;
}
