JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Starstrike: Void Combat</title>
<style>
body { margin: 0; overflow: hidden; background: #000; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; color: white; user-select: none; }
canvas { display: block; }
/* UI Overlay Styles */
#ui-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.menu-overlay {
position: absolute; top: 0; left: 0; width: 100%; height: 100%;
background: rgba(0, 5, 15, 0.9); display: flex; flex-direction: column;
align-items: center; justify-content: center; pointer-events: auto;
}
h1 { font-size: 4rem; margin-bottom: 10px; letter-spacing: 10px; text-shadow: 0 0 20px #00f; }
.ship-selection { display: flex; gap: 30px; margin-top: 40px; }
.ship-card {
background: rgba(255, 255, 255, 0.05); border: 1px solid #444;
padding: 20px; width: 220px; text-align: center; cursor: pointer;
transition: transform 0.2s, border-color 0.2s;
}
.ship-card:hover { transform: translateY(-10px); border-color: #00f; background: rgba(0, 100, 255, 0.1); }
.ship-card h3 { margin: 10px 0; color: #0cf; }
/* Stat Bars */
.stat-container { text-align: left; margin-top: 15px; font-size: 0.8rem; }
.stat-row { margin: 5px 0; }
.stat-bar-bg { background: #222; height: 6px; width: 100%; border-radius: 3px; margin-top: 2px; }
.stat-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
/* HUD */
#hud { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none; pointer-events: none; }
#crosshair {
position: absolute; top:...