html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

.hidden { display: none !important; }

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}

.panel {
  background: rgba(0, 0, 0, 0.55);
  padding: 16px 28px;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1.5;
}
.panel small { opacity: 0.7; font-size: 14px; }

#intro {
  justify-content: flex-end;
  padding-bottom: 12vh;
  box-sizing: border-box;
}
#intro .title {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45), 0 0 30px rgba(0, 0, 0, 0.35);
  margin-bottom: 18px;
}
#intro .start {
  font-size: 24px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.45);
  padding: 10px 26px;
  border-radius: 6px;
}
#intro .help {
  margin-top: 14px;
  font-size: 14px;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

#hud { position: fixed; inset: 0; pointer-events: none; }

#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  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 { left: 0; top: 10px; width: 22px; height: 2px; }

#info {
  position: absolute;
  left: 10px;
  top: 8px;
  font-size: 13px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  white-space: pre;
}

#hotbar {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.42);
  border-radius: 6px;
  pointer-events: auto;
}
.slot {
  position: relative;
  width: 50px;
  height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
}
.slot canvas {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
}
.slot .key {
  position: absolute;
  left: 3px;
  top: 1px;
  font-size: 11px;
  opacity: 0.8;
  text-shadow: 0 1px 1px #000;
}
.slot.sel {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5);
}

#blockname {
  position: absolute;
  left: 50%;
  bottom: 82px;
  transform: translateX(-50%);
  font-size: 16px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  opacity: 0;
}
