* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #000; overflow: hidden; font-family: 'Knewave', cursive; cursor: crosshair; }
canvas { display: block; }

/* HUD */
#ui { position: absolute; top: 15px; left: 15px; color: #fff; pointer-events: none; z-index: 10; }
#score { font-size: 28px; font-weight: bold; text-shadow: 0 0 8px rgba(255,200,50,0.4); color: #ffd700; }
#combo { font-size: 18px; color: #ff6b6b; text-shadow: 0 0 5px rgba(255,107,107,0.3); min-height: 24px; }
#ammo { font-size: 16px; color: #7bf; margin-top: 3px; }
#roundInfo { font-size: 14px; color: #aaa; margin-top: 3px; }
#coins { font-size: 16px; color: #ffd700; margin-top: 3px; }

/* In-Game Buttons */
#gameButtons { position: absolute; top: 15px; right: 220px; z-index: 10; display: flex; gap: 8px; }
.hud-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; font-family: 'Knewave', cursive; font-size: 13px; font-weight: normal; padding: 6px 14px; border-radius: 20px; cursor: pointer; transition: all 0.2s; backdrop-filter: blur(4px); letter-spacing: 0.5px; }
.hud-btn:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.4); transform: scale(1.05); }
.hud-btn svg { vertical-align: -2px; margin-right: 2px; }

/* Controls & Legend */
#controls { position: absolute; bottom: 15px; right: 15px; color: rgba(255,255,255,0.35); pointer-events: none; z-index: 10; font-size: 12px; text-align: right; line-height: 1.6; }
#legend { position: absolute; bottom: 15px; left: 15px; color: #fff; pointer-events: none; z-index: 10; font-size: 12px; line-height: 1.8; opacity: 0.5; }
.leg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 3px; vertical-align: middle; }
.leg-diamond { display: inline-block; width: 10px; height: 10px; transform: rotate(45deg); margin-right: 3px; vertical-align: middle; }

/* Message */
#message { position: absolute; top: 45%; left: 50%; transform: translate(-50%,-50%); color: #fff; font-size: 48px; font-weight: bold; text-shadow: 0 0 10px rgba(255,200,50,0.4); pointer-events: none; opacity: 0; transition: opacity 0.3s; z-index: 10; text-align: center; }

/* Overlays */
.overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 100; overflow-y: auto; }
.overlay.overlay-bg { justify-content: flex-start; padding: 30px 10px 40px; }
.overlay-bg { background: rgba(0,0,0,0.88); }

/* Start Screen */
#startScreen { background: radial-gradient(ellipse at center, #1a0a2e 0%, #000 70%); }
#startScreen h1 { font-size: 64px; color: #ffd700; text-shadow: 0 0 15px rgba(255,200,50,0.35), 0 0 30px rgba(255,100,50,0.15); margin-bottom: 8px; letter-spacing: 4px; }
#startScreen .subtitle { font-size: 20px; color: #aab; margin-bottom: 30px; }
.instructions { margin-top: 25px; color: #889; font-size: 14px; text-align: center; line-height: 1.8; }

/* Buttons */
.btn { font-size: 24px; padding: 12px 50px; color: #fff; border: none; border-radius: 50px; cursor: pointer; font-weight: normal; letter-spacing: 2px; text-transform: uppercase; transition: all 0.2s; margin: 6px; }
.btn:hover { transform: scale(1.08); }
.btn-yeet { background: linear-gradient(135deg, #ff6b35, #ff3366); box-shadow: 0 0 15px rgba(255,50,100,0.25); }
.btn-yeet:hover { box-shadow: 0 0 25px rgba(255,50,100,0.45); }
.btn-blue { background: linear-gradient(135deg, #35c9ff, #3366ff); box-shadow: 0 0 15px rgba(50,100,255,0.25); }
.btn-blue:hover { box-shadow: 0 0 25px rgba(50,100,255,0.45); }
.btn-green { background: linear-gradient(135deg, #35ff6b, #33cc66); box-shadow: 0 0 15px rgba(50,255,100,0.25); font-size: 18px; padding: 10px 35px; }
.btn-green:hover { box-shadow: 0 0 25px rgba(50,255,100,0.45); }
.btn-purple { background: linear-gradient(135deg, #a855f7, #7c3aed); box-shadow: 0 0 15px rgba(120,50,255,0.25); }
.btn-purple:hover { box-shadow: 0 0 25px rgba(120,50,255,0.45); }
.btn-small { font-size: 14px; padding: 8px 24px; letter-spacing: 1px; }
.btn:disabled { opacity: 0.35; cursor: default; transform: none !important; }

/* Shop */
#shopScreen h2 { font-size: 42px; color: #ffd700; text-shadow: 0 0 10px rgba(255,200,50,0.3); margin-bottom: 5px; }
.roundComplete { font-size: 20px; color: #7bf; margin-bottom: 5px; }
.shopCoins { font-size: 22px; color: #ffd700; margin-bottom: 15px; }
.section-title { font-size: 18px; color: #aab; margin: 15px 0 8px; text-transform: uppercase; letter-spacing: 2px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; max-width: 820px; width: 92%; margin-bottom: 10px; }
.shop-item { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 12px; padding: 12px; text-align: center; transition: all 0.2s; }
.shop-item:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.25); }
.shop-item.maxed { opacity: 0.4; }
.shop-item.owned { border-color: rgba(100,255,100,0.3); }
.shop-item .name { color: #fff; font-size: 15px; font-weight: bold; margin-bottom: 3px; }
.shop-item .desc { color: #aaa; font-size: 11px; margin-bottom: 5px; min-height: 28px; }
.shop-item .level { color: #7bf; font-size: 11px; margin-bottom: 6px; }
.shop-item .cost { color: #ffd700; font-size: 12px; margin-bottom: 6px; }

/* Game Over */
#gameOver h2 { font-size: 48px; color: #ff6b6b; text-shadow: 0 0 10px rgba(255,100,100,0.3); margin-bottom: 8px; }
.finalScore { font-size: 30px; color: #ffd700; margin-bottom: 5px; }
.stats { color: #aaa; font-size: 14px; margin-bottom: 20px; line-height: 1.6; }

/* Crew Screen */
#crewScreen h2 { font-size: 42px; color: #a78bfa; text-shadow: 0 0 10px rgba(167,139,250,0.3); margin-bottom: 5px; }
.crew-subtitle { color: #aab; font-size: 14px; margin-bottom: 15px; }
.crew-list { display: flex; flex-wrap: wrap; gap: 12px; max-width: 650px; justify-content: center; margin-bottom: 20px; }
.crew-card { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 12px; padding: 12px; width: 130px; text-align: center; }
.crew-card canvas { display: block; margin: 0 auto 6px; border-radius: 8px; background: rgba(0,0,30,0.5); }
.crew-card .cname { color: #fff; font-size: 14px; font-weight: bold; }
.crew-card .crew-btns { display: flex; gap: 4px; justify-content: center; margin-top: 8px; }
.crew-card .crew-btns button { font-size: 11px; padding: 4px 10px; cursor: pointer; border: none; border-radius: 6px; color: #fff; font-weight: bold; }
.crew-card .crew-btns .edit-btn { background: #3b82f6; }
.crew-card .crew-btns .del-btn { background: #ef4444; }
.active-toggle { display: block; width: 90%; margin: 6px auto 0; padding: 3px 8px; font-size: 10px; font-weight: bold; border: none; border-radius: 10px; cursor: pointer; color: #fff; text-transform: uppercase; letter-spacing: 0.5px; transition: all 0.15s; }
.active-on { background: #27ae60; }
.active-off { background: #555; }
.active-toggle:hover { transform: scale(1.08); }
.crew-card.crew-inactive { opacity: 0.45; }
.crew-card.crew-inactive canvas { filter: grayscale(0.6); }
.shop-item.selected-galaxy { border-color: rgba(100,180,255,0.5); background: rgba(100,180,255,0.08); }

/* Crew Edit */
#crewEdit h2 { font-size: 36px; color: #a78bfa; margin-bottom: 10px; }
.crew-form { max-width: 360px; width: 90%; text-align: left; }
.crew-form label { color: #aab; font-size: 13px; display: block; margin-top: 10px; margin-bottom: 4px; }
.crew-form input[type="text"] { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 8px 12px; border-radius: 8px; font-size: 16px; width: 100%; outline: none; }
.crew-form input[type="text"]:focus { border-color: rgba(167,139,250,0.6); }
.color-picker { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 0; }
.color-swatch { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: all 0.15s; }
.color-swatch:hover, .color-swatch.sel { border-color: #fff; transform: scale(1.15); }
.outfit-picker { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 0; }
.outfit-opt { padding: 5px 12px; border-radius: 8px; cursor: pointer; font-size: 12px; color: #fff; border: 2px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.06); transition: all 0.15s; }
.outfit-opt:hover, .outfit-opt.sel { border-color: #a78bfa; background: rgba(167,139,250,0.2); }
.outfit-opt.locked { opacity: 0.3; cursor: default; }
#crewPreviewWrap { margin: 15px auto; text-align: center; }
#crewPreviewCanvas { border-radius: 10px; background: rgba(0,0,30,0.6); border: 1px solid rgba(255,255,255,0.1); }

/* Custom Modal */
.modal-overlay { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.7); display:flex; align-items:center; justify-content:center; z-index:200; }
.modal-box { background:rgba(10,0,40,0.95); border:2px solid rgba(255,100,150,0.4); border-radius:16px; padding:30px 40px; text-align:center; max-width:400px; box-shadow:0 0 30px rgba(255,50,100,0.2); }
.modal-text { color:#fff; font-size:18px; margin-bottom:20px; line-height:1.5; }
.modal-btns { display:flex; gap:12px; justify-content:center; }

/* Zoom HUD */
#zoomHUD { position:fixed; bottom:15px; right:15px; display:flex; align-items:center; gap:6px; z-index:30; }
.zoom-btn { padding:6px 8px !important; min-width:auto !important; font-size:12px !important; }
#zoomLevel { color:rgba(255,255,255,0.6); font-size:13px; min-width:40px; text-align:center; }

/* Overlay Close Button */
.overlay-close-btn { position:absolute; top:12px; right:18px; background:none; border:none; color:rgba(255,255,255,0.6); font-size:32px; cursor:pointer; z-index:10; line-height:1; padding:4px 8px; transition:color 0.2s, transform 0.2s; }
.overlay-close-btn:hover { color:#fff; transform:scale(1.2); }

/* Cheat Panel */
#cheatPanel h2 { color:#5f5; text-shadow:0 0 10px rgba(50,255,50,0.3); }
