html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #05070d;
  color: #fff;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  -webkit-user-select: none;
  user-select: none;
  cursor: default;
}

#game {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  outline: none;
}

.ui {
  position: fixed;
  pointer-events: none;
}

/* ---- crosshair ---- */
#crosshair {
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  opacity: 0.35;
}
#crosshair::before,
#crosshair::after {
  content: "";
  position: absolute;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
}
#crosshair::before { left: 10px; top: 2px; width: 2px; height: 18px; }
#crosshair::after { left: 2px; top: 10px; width: 18px; height: 2px; }

/* ---- underwater tint ---- */
#underwater {
  inset: 0;
  opacity: 0;
  background: radial-gradient(ellipse at center, rgba(20, 90, 150, 0.22) 0%, rgba(4, 40, 90, 0.55) 100%);
}

/* ---- attract mode ---- */
#attract {
  inset: 0;
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55), 0 0 18px rgba(0, 0, 0, 0.45);
}
#attract h1 {
  margin: 13vh 0 0;
  font-size: clamp(34px, 7.2vw, 96px);
  letter-spacing: 0.22em;
  padding-left: 0.22em;
  font-weight: 800;
}
#attract .tag {
  margin: 0.6em 0 0;
  font-size: clamp(13px, 1.5vw, 20px);
  letter-spacing: 0.3em;
  opacity: 0.9;
}
#startHint {
  margin: auto 0 0;
  padding: 0.55em 1.4em;
  font-size: clamp(18px, 2.4vw, 30px);
  font-weight: 700;
  letter-spacing: 0.12em;
  background: rgba(8, 12, 22, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.85);
}
#attract .keys {
  margin: 1.1em 1em 122px;
  font-size: clamp(11px, 1.15vw, 15px);
  opacity: 0.92;
}

/* ---- clock and help ---- */
#clock {
  left: 14px;
  top: 12px;
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 5px 9px;
  background: rgba(8, 12, 22, 0.45);
  white-space: pre;
}
#help {
  left: 14px;
  top: 48px;
  opacity: 0;
  font-size: 12.5px;
  line-height: 1.75;
  padding: 9px 13px;
  background: rgba(8, 12, 22, 0.55);
}
#help b {
  display: inline-block;
  min-width: 96px;
  color: #ffe9a8;
  font-weight: 700;
}

/* ---- pause ---- */
#pause {
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 12, 0.45);
  text-align: center;
}
#pause .panel {
  padding: 22px 44px;
  background: rgba(8, 12, 22, 0.78);
  border: 2px solid rgba(255, 255, 255, 0.8);
  font-size: 15px;
  letter-spacing: 0.08em;
}
#pause .big {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.2em;
  margin-bottom: 8px;
}

/* ---- hotbar ---- */
#hotbar {
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 5px;
  background: rgba(8, 12, 22, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.25);
}
#hotbar .slot {
  position: relative;
  width: 50px;
  height: 50px;
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}
#hotbar .slot.sel {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.24);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5), 0 0 14px rgba(255, 255, 255, 0.35);
}
#hotbar .slot canvas {
  position: absolute;
  left: 5px;
  top: 5px;
  width: 36px;
  height: 36px;
  image-rendering: pixelated;
}
#hotbar .slot span {
  position: absolute;
  left: 3px;
  top: 1px;
  font-size: 10px;
  opacity: 0.85;
  text-shadow: 0 1px 0 #000;
}
#blockName {
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  opacity: 0;
  font-size: 14px;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  background: rgba(8, 12, 22, 0.55);
  white-space: nowrap;
}

/* ---- loading ---- */
#loading {
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a1020;
  text-align: center;
}
#loading h1 {
  margin: 0 0 22px;
  font-size: clamp(28px, 5vw, 60px);
  letter-spacing: 0.22em;
  padding-left: 0.22em;
}
#loadText {
  font-size: 14px;
  letter-spacing: 0.08em;
  opacity: 0.85;
  min-height: 1.4em;
}
#loading .bar {
  width: min(360px, 70vw);
  height: 10px;
  margin: 14px auto 0;
  border: 2px solid rgba(255, 255, 255, 0.7);
}
#loadBar {
  width: 0;
  height: 100%;
  background: #8fd16a;
}
