:root { --accent: #7fd0ff; --accent2: #88aaff; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: #000; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #d6d6d6; }
#gl { position: fixed; inset: 0; display: block; cursor: crosshair; }

#hud-top { position: fixed; top: 0; left: 0; right: 0; z-index: 5; padding: 12px 14px;
  display: flex; align-items: center; gap: 16px; pointer-events: none;
  background: linear-gradient(#000c, #0000); text-shadow: 0 1px 3px #000; }
#brand { font-size: 22px; letter-spacing: 4px; font-weight: 700; color: #f0f0f0; }
#brand span { color: var(--accent); }
#hud-world { font-size: 13px; color: var(--accent2); letter-spacing: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hud-buttons { margin-left: auto; display: flex; gap: 8px; pointer-events: auto; }
#hud-buttons button { background: #0a0a0a; color: #d6d6d6; border: 1px solid #333;
  padding: 5px 14px; border-radius: 3px; font-family: inherit; cursor: pointer;
  text-transform: uppercase; letter-spacing: 1px; font-size: 11px; }
#hud-buttons button:hover { border-color: var(--accent); color: #fff; }
#hud-buttons button.on { background: #1a1a1a; border-color: var(--accent); color: var(--accent); }

#hud-bot { position: fixed; left: 14px; bottom: 14px; z-index: 5; width: 200px;
  text-shadow: 0 1px 2px #000; }
.bar { height: 8px; background: #111; border: 1px solid #333; border-radius: 2px; overflow: hidden; }
#hud-hp-fill { width: 100%; height: 100%; background: linear-gradient(90deg, #b32020, #ff5040); transition: width .15s; }

#crosshair { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 22px; color: #fff; z-index: 4; pointer-events: none; text-shadow: 0 0 6px #000; opacity: 0.6; }

#hud-weapon { position: fixed; bottom: 36px; right: 14px; font-size: 13px; color: var(--accent);
  letter-spacing: 2px; text-shadow: 0 1px 3px #000; z-index: 5; pointer-events: none; }
#hud-tip { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: #555; letter-spacing: 1px; text-shadow: 0 1px 3px #000; z-index: 5;
  pointer-events: none; }

#death { position: fixed; inset: 0; z-index: 15; display: none; align-items: center;
  justify-content: center; flex-direction: column; background: #000a; }
#death.open { display: flex; }
#death div:first-child { font-size: 42px; letter-spacing: 8px; color: #c02020; font-weight: 700; }
#death .sub { margin-top: 10px; font-size: 13px; color: #888; }

#nes-overlay { position: fixed; inset: 0; z-index: 20; display: none; align-items: center;
  justify-content: center; background: #000; }
#nes-overlay.open { display: flex; }
#nes-canvas { image-rendering: pixelated; border: 2px solid #333; max-width: 100vw; max-height: 100vh; }
#nes-hud { position: fixed; top: 10px; right: 14px; font-size: 12px; color: #aaa;
  letter-spacing: 1px; z-index: 21; pointer-events: none; }

#homeOverlay { position: fixed; inset: 0; z-index: 20; display: none; align-items: center;
  justify-content: center; background: rgba(0,0,0,0.85); backdrop-filter: blur(3px); }
#homeOverlay.open { display: flex; }
#homeCard { width: min(900px, 92vw); max-height: 82vh; background: #060606;
  border: 1px solid #2a2a2a; border-radius: 8px; padding: 22px; box-shadow: 0 0 60px #000; }
#homeTitle { font-size: 24px; letter-spacing: 4px; font-weight: 700; color: #f0f0f0; text-align: center; }
#homeTitle span { color: var(--accent); }
#homeSub { margin: 8px 0 14px; text-align: center; font-size: 12px; color: #888; }
#homeSearch { width: 100%; box-sizing: border-box; padding: 9px 12px; background: #0a0a0a;
  color: #d6d6d6; border: 1px solid #333; border-radius: 4px; font-family: inherit; font-size: 14px; }
#homeGrid { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px; max-height: 52vh; overflow-y: auto; padding: 2px; }
.hg { background: #0a0a0a; border: 1px solid #2a2a2a; border-radius: 5px; padding: 8px;
  cursor: pointer; transition: border-color .12s; }
.hg:hover { border-color: var(--accent); }
.hg.inworld { border-color: #3a3a3a; }
.hgsw { display: flex; height: 8px; border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.hgsw .sw { flex: 1; height: 100%; border: none; }
.hgnm { font-size: 11px; color: #eee; line-height: 1.3; height: 2.6em; overflow: hidden; }
.hggn { margin-top: 4px; font-size: 10px; color: var(--accent2); text-transform: uppercase;
  letter-spacing: 1px; }
