* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0c0f14;
  font-family: monospace;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: none;
}

#controls-hint {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #e8e6e1;
  font-size: 14px;
  opacity: 0.7;
  transition: opacity 0.8s ease;
  pointer-events: none;
  z-index: 10;
  text-align: center;
}

#controls-hint.hidden {
  opacity: 0;
}

#back-link {
  position: fixed;
  top: 16px;
  left: 16px;
  color: #c8956c;
  font-size: 14px;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.3s;
  z-index: 10;
}

#back-link:hover {
  opacity: 1;
}

/* Mobile controls */
#mobile-controls {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  z-index: 20;
  pointer-events: none;
}

.dpad {
  position: absolute;
  bottom: 30px;
  left: 30px;
  width: 120px;
  height: 120px;
  pointer-events: auto;
}

.dpad-btn {
  position: absolute;
  width: 40px;
  height: 40px;
  background: rgba(232, 230, 225, 0.15);
  border: 1px solid rgba(232, 230, 225, 0.3);
  border-radius: 6px;
  color: #e8e6e1;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

.dpad-btn:active {
  background: rgba(200, 149, 108, 0.3);
}

.dpad-btn.up    { top: 0; left: 40px; }
.dpad-btn.down  { bottom: 0; left: 40px; }
.dpad-btn.left  { top: 40px; left: 0; }
.dpad-btn.right { top: 40px; right: 0; }

.action-btn {
  position: absolute;
  bottom: 50px;
  right: 40px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(200, 149, 108, 0.2);
  border: 2px solid rgba(200, 149, 108, 0.5);
  color: #c8956c;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

.action-btn:active {
  background: rgba(200, 149, 108, 0.4);
}

@media (pointer: coarse) {
  #mobile-controls {
    display: block;
  }
  #controls-hint {
    display: none;
  }
  #back-link {
    opacity: 0.8;
    font-size: 12px;
  }
}
