* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #87ceeb;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  user-select: none;
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Crosshair */
#crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  mix-blend-mode: difference;
}
#crosshair::before, #crosshair::after {
  content: "";
  position: absolute;
  background: #fff;
}
#crosshair::before { left: 10px; top: 0; width: 2px; height: 22px; }
#crosshair::after  { top: 10px; left: 0; height: 2px; width: 22px; }

/* Info */
#info {
  position: fixed;
  top: 10px;
  left: 12px;
  color: #fff;
  font: 13px/1.5 monospace;
  text-shadow: 1px 1px 2px #000;
  pointer-events: none;
  white-space: pre;
}

#blockname {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 16px;
  text-shadow: 1px 1px 3px #000;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
#blockname.show { opacity: 1; transition: none; }

/* Hotbar */
#hotbar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 6px;
  pointer-events: none;
}
.slot {
  position: relative;
  width: 54px;
  height: 54px;
  background: rgba(255, 255, 255, 0.12);
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slot canvas {
  width: 36px;
  height: 36px;
  image-rendering: pixelated;
}
.slot .num {
  position: absolute;
  top: 1px;
  left: 4px;
  font-size: 11px;
  color: #fff;
  text-shadow: 1px 1px 1px #000;
}
.slot.active {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.08);
}

/* Overlay */
#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 20, 30, 0.6);
  backdrop-filter: blur(3px);
  z-index: 10;
}
#overlay.hidden { display: none; }

.card {
  background: rgba(30, 34, 40, 0.95);
  color: #eee;
  padding: 28px 36px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  max-width: 92vw;
}
.card h1 {
  font-size: 44px;
  letter-spacing: 3px;
  color: #7ed957;
  text-shadow: 3px 3px 0 #2d5a1a;
  margin-bottom: 4px;
}
.card .sub { color: #aab; margin-bottom: 18px; font-size: 14px; }

button {
  cursor: pointer;
  border: none;
  background: #4caf50;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 8px;
  transition: background 0.15s, transform 0.1s;
}
button:hover { background: #5dc261; }
button:active { transform: scale(0.97); }
button.small {
  margin-top: 16px;
  font-size: 12px;
  padding: 6px 14px;
  background: #555;
  font-weight: 400;
}
button.small:hover { background: #a33; }

.controls {
  margin: 20px auto 0;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}
.controls td { padding: 4px 10px; }
.controls td:first-child {
  color: #ffd75e;
  font-family: monospace;
  white-space: nowrap;
}