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

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0a0a12;
  font-family: "Courier New", Courier, monospace;
  color: #fff;
  user-select: none;
  overflow: hidden;
}

#game-wrapper {
  position: relative;
  border: 4px solid #222;
  box-shadow:
    0 0 0 2px #555,
    0 12px 40px rgba(0, 0, 0, 0.6);
  background: #5c94fc;
  line-height: 0;
}

#hud {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 20px 4px;
  background: #000;
  font-size: 14px;
  letter-spacing: 1px;
  line-height: 1.3;
}

.hud-item {
  text-align: center;
  min-width: 90px;
}

.hud-item .label {
  color: #fff;
  font-weight: bold;
  font-size: 13px;
}

#score,
#world,
#time,
#coins {
  font-weight: bold;
  font-size: 16px;
}

#game {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: 768px;
  height: 432px;
  max-width: 100vw;
  background: #5c94fc;
}

#overlay {
  position: absolute;
  inset: 0;
  top: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  line-height: 1.5;
  z-index: 10;
}

#overlay.hidden {
  display: none;
}

#overlay-content {
  text-align: center;
  padding: 24px;
}

#overlay-title {
  font-size: 36px;
  color: #e52521;
  text-shadow:
    3px 3px 0 #000,
    -1px -1px 0 #fff;
  margin-bottom: 16px;
  letter-spacing: 2px;
}

#overlay-msg {
  font-size: 18px;
  margin-bottom: 12px;
  color: #fff;
}

.hint {
  font-size: 12px;
  color: #aaa;
  margin-top: 8px;
}

#controls-hint {
  margin-top: 14px;
  font-size: 13px;
  color: #888;
  text-align: center;
  max-width: 768px;
  padding: 0 12px;
  line-height: 1.5;
}

@media (max-width: 800px) {
  #game {
    width: 100vw;
    height: auto;
    aspect-ratio: 768 / 432;
  }

  #hud {
    font-size: 11px;
    padding: 6px 10px 2px;
  }

  .hud-item {
    min-width: 60px;
  }

  #score,
  #world,
  #time,
  #coins {
    font-size: 13px;
  }
}
