/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: #0d0d1a; overflow: hidden; font-family: 'Segoe UI', system-ui, monospace; color: #f0f0f0; user-select: none; -webkit-user-select: none; }
#canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.panel { background: rgba(0,0,0,0.65); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; backdrop-filter: blur(4px); }
.panel-title { font-size: 12px; font-weight: 700; color: #ffd93d; letter-spacing: 0.05em; }

#player-info { position: absolute; top: 14px; left: 14px; padding: 8px 14px; background: rgba(0,0,0,0.65); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; font-size: 13px; font-weight: 600; backdrop-filter: blur(4px); }
#mode-indicator { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); padding: 6px 16px; background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.08); border-radius: 20px; font-size: 11px; color: #999; white-space: nowrap; backdrop-filter: blur(4px); }

#leaderboard { position: absolute; top: 14px; right: 14px; padding: 12px 14px; min-width: 170px; background: rgba(0,0,0,0.65); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; font-size: 12px; backdrop-filter: blur(4px); pointer-events: all; }
.lb-row { display: flex; align-items: center; gap: 7px; padding: 3px 0; }
.lb-rank  { color: #555; width: 14px; font-size: 11px; }
.lb-name  { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ccc; }
.lb-count { font-weight: 700; color: #ffd93d; }

#bottom-hud { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: all; }

/* Help Button */
.help-btn { background: #333; color: white; border: 1px solid #555; border-radius: 50%; width: 20px; height: 20px; font-size: 12px; cursor: pointer; font-weight: bold; }
.help-btn:hover { background: #555; }

/* Color Picker */
input[type="color"] { border: none; width: 30px; height: 30px; padding: 0; border-radius: 5px; background: transparent; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 2px solid rgba(255,255,255,0.5); border-radius: 5px; }

#cooldowns { display: flex; flex-direction: column; gap: 5px; width: 290px; background: rgba(0,0,0,0.65); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 10px 12px; backdrop-filter: blur(4px); }
.cd-row { display: flex; align-items: center; gap: 8px; }
.cd-icon { font-size: 14px; width: 22px; text-align: center; }
.cd-bar-wrap { flex: 1; background: rgba(255,255,255,0.08); height: 7px; border-radius: 4px; overflow: hidden; }
.cd-bar { height: 100%; border-radius: 4px; transition: width 0.1s linear; }
.place-bar   { background: linear-gradient(90deg, #6bcb77, #4d96ff); }
.destroy-bar { background: linear-gradient(90deg, #ff6b6b, #ffd93d); }
.cd-text { font-size: 11px; color: #999; width: 40px; text-align: right; }

#crosshair { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 22px; line-height: 1; color: rgba(255,255,255,0.65); text-shadow: 0 0 6px rgba(0,0,0,0.9); pointer-events: none; }
#tooltip { position: absolute; top: calc(50% - 80px); left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.82); border: 1px solid rgba(255,255,255,0.18); border-radius: 8px; padding: 8px 14px; font-size: 12px; line-height: 1.7; pointer-events: none; white-space: nowrap; }
#tt-owner    { color: #fff; font-weight: bold;}
#tt-age      { color: #888; }
#toast { position: absolute; bottom: 200px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.85); border: 1px solid rgba(255,165,0,0.35); border-radius: 8px; padding: 9px 20px; font-size: 13px; color: #ffd93d; pointer-events: none; transition: opacity 0.4s ease; }

.hidden { display: none !important; }

#help-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 100; display: flex; align-items: center; justify-content: center; pointer-events: all; }
.help-modal-content { padding: 20px; max-width: 400px; width: 100%; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }

/* Tools */
.tool-slot { padding: 5px 10px; border: 2px solid transparent; cursor: pointer; border-radius: 4px; font-weight: bold; background: rgba(0,0,0,0.5); transition: all 0.2s; }
.tool-slot.active { border-color: #ffd93d; background: rgba(255, 217, 61, 0.2); }
.tool-key { display: inline-block; background: #333; padding: 2px 6px; border-radius: 3px; border: 1px solid #555; margin-right: 5px; font-size: 0.9em; }

/* Minimap */
#minimap-container { position: absolute; top: 52px; left: 14px; padding: 6px; text-align: center; pointer-events: none; }
#minimap { display: block; border-radius: 4px; image-rendering: pixelated; }
#minimap-label { font-size: 10px; color: #888; margin-top: 3px; }

/* Coordinates */
#coords-display { position: absolute; bottom: 16px; left: 14px; padding: 6px 12px; display: flex; gap: 12px; font-size: 12px; font-family: monospace; pointer-events: none; color: #ccc; }
#coord-x { color: #ff6b6b; }
#coord-y { color: #6bcb77; }
#coord-z { color: #4d96ff; }
