/* MineClone HUD + menus.
   Aesthetic: chunky voxel-game UI — hard edges, beveled gray buttons,
   pixel-hard drop shadows, dirt-tiled menu (texture injected at runtime
   from the procedural atlas). No border-radius anywhere: everything is a block. */

:root {
  --font: Consolas, "Lucida Console", "Courier New", monospace;
  --text: #ececec;
  --text-dim: #a8a8a8;
  --splash: #ffff55;
  --btn-face: #6e6e6e;
  --btn-face-hover: #7f8caf;
  --btn-hilite: rgba(255, 255, 255, 0.28);
  --btn-shadow: rgba(0, 0, 0, 0.45);
  --danger-face: #7a4a42;
  --hud-bg: rgba(12, 12, 14, 0.55);
  --slot-frame: #8b8b8b;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: var(--font);
  -webkit-user-select: none;
  user-select: none;
}

#game { display: block; width: 100vw; height: 100vh; cursor: crosshair; }

.hidden { display: none !important; }

/* ---------- full-screen menu ---------- */

#overlay, #nogl {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  text-align: center;
  z-index: 10;
  image-rendering: pixelated;
  background-color: #101010;
  background-size: 96px 96px; /* dirt tile url set at runtime */
}

/* paused: let the frozen world show through instead of dirt */
#overlay.paused {
  background-image: none !important;
  background-color: rgba(8, 10, 14, 0.68);
}

.panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(420px, 92vw);
  image-rendering: auto;
  animation: panel-in 0.25s ease-out;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel h1 {
  margin: 0 0 2px;
  font-size: 56px;
  letter-spacing: 4px;
  font-weight: 900;
  color: #fff;
  text-shadow: 4px 4px 0 #3f3f3f, 8px 8px 0 rgba(0, 0, 0, 0.35);
}

.panel .subtitle {
  margin: 0 0 10px;
  color: var(--splash);
  font-style: italic;
  font-size: 14px;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
  animation: splash-bob 1.6s ease-in-out infinite;
}

@keyframes splash-bob {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

.panel button {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  width: 100%;
  padding: 12px 0;
  cursor: pointer;
  background: var(--btn-face);
  border: 2px solid #000;
  border-radius: 0;
  box-shadow: inset 2px 2px 0 var(--btn-hilite), inset -2px -3px 0 var(--btn-shadow);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}
.panel button:hover { background: var(--btn-face-hover); outline: 2px solid #fff; }
.panel button:active {
  box-shadow: inset -2px -2px 0 var(--btn-hilite), inset 2px 3px 0 var(--btn-shadow);
  transform: translateY(1px);
}

#play-btn { font-size: 19px; }

.settings {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}
.settings label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid #000;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.12);
  padding: 8px 6px;
  color: var(--text);
}
.settings select {
  font-family: var(--font);
  background: #2a2a2a;
  color: var(--text);
  border: 1px solid #000;
  border-radius: 0;
  padding: 2px 4px;
}
.settings input[type="checkbox"] { accent-color: #6a9c46; width: 16px; height: 16px; }
.settings .danger {
  flex: 1;
  width: auto;
  padding: 8px 6px;
  font-size: 13px;
  background: var(--danger-face);
}
.settings .danger:hover { background: #97564a; }

.help {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.5;
}
.help b { color: var(--text); }

#save-note { min-height: 1em; margin: 2px 0 0; font-size: 12px; color: var(--text-dim); }

/* ---------- HUD ---------- */

#crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  pointer-events: none;
  z-index: 5;
}
#crosshair::before, #crosshair::after {
  content: "";
  position: absolute;
  background: #ddd;
}
#crosshair::before { left: 9px; top: 0; width: 4px; height: 22px; }
#crosshair::after { left: 0; top: 9px; width: 22px; height: 4px; }

#hotbar {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--hud-bg);
  border: 2px solid rgba(0, 0, 0, 0.8);
  z-index: 5;
}
#hotbar .slot {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--slot-frame);
  background: rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}
#hotbar .slot canvas { image-rendering: pixelated; }
#hotbar .slot span {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 1px 1px 0 #000;
}
#hotbar .slot.selected {
  border-color: #fff;
  outline: 2px solid #fff;
  background: rgba(255, 255, 255, 0.12);
}

#debug {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 5;
  pointer-events: none;
  font-size: 12px;
  color: #fff;
  line-height: 1.15;
}
#debug div {
  background: rgba(16, 16, 16, 0.55);
  padding: 2px 6px;
  width: fit-content;
  margin-bottom: 2px;
}

#water-overlay {
  position: fixed;
  inset: 0;
  background: rgba(21, 58, 130, 0.35);
  pointer-events: none;
  z-index: 4;
}

/* ---------- WebGL-missing screen ---------- */
#nogl { background: #1a1a1e; }
#nogl p { font-size: 15px; line-height: 1.6; color: var(--text-dim); }
