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

body {
  overflow: hidden;
  background: #1a1a2e;
  font-family: 'Courier New', monospace;
  color: #fff;
}

#game-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

/* HUD */
#hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 10;
}

#hud-top {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}

#level-title {
  font-size: 20px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
  letter-spacing: 3px;
  color: #ffd700;
}

#hud-bottom {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 8px;
  padding: 8px 16px;
}

.hud-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: #aaa;
}

.hud-value {
  font-size: 28px;
  font-weight: bold;
  color: #ffd700;
}

#inventory {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 8px;
  padding: 8px;
}

.key-slot {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
}

.key-slot.has-key {
  border-color: currentColor;
  box-shadow: 0 0 8px currentColor;
}

#key-blue.has-key { color: #4488ff; background: rgba(68,136,255,0.2); }
#key-red.has-key { color: #ff4444; background: rgba(255,68,68,0.2); }
#key-green.has-key { color: #44ff44; background: rgba(68,255,68,0.2); }
#key-yellow.has-key { color: #ffdd44; background: rgba(255,221,68,0.2); }

/* Hint box */
#hint-box {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #ffd700;
  border-radius: 8px;
  padding: 12px 24px;
  z-index: 20;
  max-width: 500px;
  text-align: center;
  transition: opacity 0.3s;
}

#hint-text {
  font-size: 14px;
  line-height: 1.5;
  color: #eee;
}

/* Win screen */
#win-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#win-content {
  text-align: center;
}

#win-content h1 {
  font-size: 48px;
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  margin-bottom: 16px;
}

#win-content p {
  font-size: 18px;
  color: #ccc;
  margin-bottom: 8px;
}

.win-sub {
  margin-top: 24px !important;
  font-size: 14px !important;
  color: #888 !important;
}

kbd {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  padding: 2px 8px;
  font-family: inherit;
}

/* Controls help */
#controls-help {
  position: fixed;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 1px;
  z-index: 10;
  pointer-events: none;
}

.hidden {
  display: none !important;
}
