* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: #87ceeb; font-family: system-ui, "Segoe UI", sans-serif; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#crosshair {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -52%);
  color: rgba(255,255,255,.85); font-size: 26px; font-weight: 300;
  text-shadow: 0 0 2px rgba(0,0,0,.7);
}
#info, #fps {
  position: absolute; left: 10px; top: 10px; color: #fff;
  background: rgba(0,0,0,.45); padding: 3px 8px; border-radius: 5px;
  font-size: 13px; font-variant-numeric: tabular-nums;
}
#fps { left: auto; right: 10px; top: 10px; }
#clock {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%);
  color: #fff; background: rgba(0,0,0,.45); padding: 3px 12px; border-radius: 5px;
  font-size: 13px; letter-spacing: .5px;
}
#toast {
  position: absolute; left: 50%; top: 46px; transform: translateX(-50%);
  color: #fff; background: rgba(0,0,0,.6); padding: 6px 16px; border-radius: 6px;
  font-size: 13.5px; opacity: 0; transition: opacity .3s; white-space: nowrap;
}
#toast.show { opacity: 1; }
#block-name {
  position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%);
  color: #fff; background: rgba(0,0,0,.5); padding: 3px 12px; border-radius: 5px;
  font-size: 14px; opacity: 0; transition: opacity .35s;
}
#block-name.show { opacity: 1; }
#hotbar {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: flex; gap: 4px; background: rgba(0,0,0,.35); padding: 5px; border-radius: 8px;
}
.slot {
  position: relative; width: 52px; height: 52px; border: 2px solid rgba(255,255,255,.25);
  border-radius: 5px; background: rgba(0,0,0,.35);
}
.slot.sel { border-color: #fff; box-shadow: 0 0 8px rgba(255,255,255,.5); }
.slot canvas { width: 100%; height: 100%; image-rendering: pixelated; border-radius: 3px; }
.slot .num {
  position: absolute; top: 1px; left: 3px; color: rgba(255,255,255,.75);
  font-size: 10px; text-shadow: 0 1px 1px #000;
}

#overlay {
  position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(30,60,90,.88), rgba(10,20,35,.95));
  backdrop-filter: blur(2px);
}
#overlay.hidden { display: none; }
#panel { text-align: center; color: #eaf2f8; max-width: 460px; padding: 24px; }
#panel h1 { font-size: 52px; letter-spacing: 1px; margin-bottom: 6px; text-shadow: 0 3px 0 rgba(0,0,0,.4); }
#panel h1 span { color: #7ec850; }
#panel .sub { color: #9fb4c8; margin-bottom: 18px; font-size: 14px; }
#loading { margin: 18px 0; font-size: 14px; color: #cfe0ef; }
#load-track { height: 10px; background: rgba(255,255,255,.15); border-radius: 5px; margin-top: 8px; overflow: hidden; }
#load-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #5cb85c, #7ec850); transition: width .1s; }
#start-btn {
  pointer-events: auto; cursor: pointer; font-size: 18px; font-weight: 600;
  padding: 12px 34px; margin: 6px 0 20px; border: none; border-radius: 8px;
  background: #5aa832; color: #fff; box-shadow: 0 4px 0 #3e7a21;
}
#start-btn:disabled { opacity: .45; cursor: default; }
#start-btn:not(:disabled):hover { background: #69bd3d; }
.keys { margin: 0 auto; border-collapse: collapse; font-size: 13.5px; color: #c6d6e4; }
.keys td { padding: 3px 10px; text-align: left; }
.keys td:first-child { text-align: right; white-space: nowrap; }
kbd {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  border-radius: 4px; padding: 1px 7px; font-family: inherit; font-size: 12.5px; color: #fff;
}
