Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat(cybercity): high-def cyberpunk overhaul with skyline, volumetric lights, data rain, and neon signs
Adam Eivyd60735327e35
diff --git a/.changelog/v0.12.x.md b/.changelog/v0.12.x.mdindex 9fbea59026..02422f281e 100644--- a/.changelog/v0.12.x.md+++ b/.changelog/v0.12.x.md@@ -213,18 +213,21 @@ This release adds branch management and automated release workflow capabilities### Digital Twin — Genome Section- **Genome tab**: New "Genome" tab on the Digital Twin page for uploading and analyzing 23andMe raw genome data- **File upload**: Drag-and-drop or file picker for 23andMe TSV exports (~600K SNPs), parsed and indexed locally with 1-hour in-memory cache for O(1) rsid lookups-- **15 curated health markers**: Pre-built database covering longevity (FOXO3A, IGF1R, CETP, IPMK), tumor suppression (TP53), iron metabolism (HFE H63D, C282Y), methylation (MTHFR C677T/A1298C, COMT, AHCY), caffeine sensitivity (ADA), detoxification (CYP2B6, SOD2), and inflammation (IL-6)+- **34 curated health markers** across 13 categories: longevity (FOXO3A, IGF1R, CETP, IPMK, FTO), cardiovascular (Factor V Leiden, 9p21, Lp(a), Prothrombin), tumor suppression (TP53), iron metabolism (HFE H63D, C282Y), methylation (MTHFR C677T/A1298C, COMT, AHCY), nutrients (VDR, BCMO1, FUT2, VDBP), cognitive (BDNF), caffeine (ADA, CYP1A2), sleep (CLOCK, DEC2), athletic (ACTN3, ACE), detoxification (CYP2B6, SOD2, CYP2C19, NQO1), inflammation (IL-6, TNF-alpha), and skin (MC1R)- **Genotype classification**: Each marker's genotype is automatically classified as beneficial, typical, concern, or major_concern with evidence-based implications- **Category-grouped display**: Markers displayed in collapsible cards grouped by health category with color-coded status badges, expandable details, implications, and editable personal notes- **SNP search**: Look up any rsid in your genome data with instant results and optional save-to-markers- **Full CRUD**: Save custom markers, edit notes (with debounced auto-save), delete individual markers, or wipe all genome data with confirmation+- **ClinVar database integration**: One-click sync downloads NCBI's ClinVar variant database (~3M variants), stream-parses it to extract clinically significant SNPs (pathogenic, risk factors, drug response, protective), and builds a local search index. Scanning your genome against ClinVar surfaces hundreds of clinically annotated findings with severity levels, associated conditions, and ClinVar review star ratings+- **ClinVar results browser**: Filterable results view with severity tabs (Pathogenic, Risk Factor, Drug Response, Protective), minimum star filter, expandable details with conditions/classification/review status, and a 200-result paginated view- **Privacy-first**: All data stored locally on the server — genome file never leaves the machine**Server changes**:- `server/lib/curatedGenomeMarkers.js` — Curated SNP database with 15 markers, category config, `classifyGenotype()` and `formatGenotype()` functions- `server/lib/genomeValidation.js` — Zod schemas for upload, search, save, and notes update- `server/services/genome.js` — Core service with lazy-loaded in-memory Map index, upload/scan/search/CRUD/delete operations-- `server/routes/genome.js` — 8 REST endpoints mounted at `/api/digital-twin/genome`+- `server/services/clinvar.js` — ClinVar sync pipeline: streaming download of variant_summary.txt.gz from NCBI, gunzip + line-by-line parse, filtered index of actionable SNPs, genome cross-reference scan+- `server/routes/genome.js` — 12 REST endpoints mounted at `/api/digital-twin/genome` (including 4 ClinVar endpoints)**Client changes**:- `client/src/components/digital-twin/tabs/GenomeTab.jsx` — Main tab with upload drop-zone, stats bar, curated markers view, SNP search, and delete confirmation@@ -395,3 +398,34 @@ This release adds branch management and automated release workflow capabilities**Client changes**:- `client/src/components/CosDashboardWidget.jsx` — New widget component with 4-stat grid (Today, Streak, Pending, Learning), leverages existing `getCosQuickSummary()` and `getCosLearningSummary()` APIs- `client/src/pages/Dashboard.jsx` — Imported and rendered CosDashboardWidget above the app grid++### CyberCity — High-Def Cyberpunk Overhaul+- **Distant skyline backdrop**: 60 procedurally generated skyscraper silhouettes form a ring around the city perimeter at varying heights (5-30 units), each with shader-based lit windows and neon roof trim for a sprawling Blade Runner-esque horizon+- **Volumetric light beams**: Five upward-pointing volumetric light cones at city corners and center with GPU shader-based fade, shimmer, and ground glow discs — plus horizontal scan beams that sweep across the city at different altitudes+- **Matrix-style data rain**: 40 columns of cascading data glyphs fall from the sky with per-column phase offsets, atmospheric distance fade, and additive blending for a digital rain effect visible across the entire skybox+- **Rising ember particles**: 120 spark/ember particles float upward from street level with wind drift, multi-color palette (orange, cyan, pink, blue), hot white cores, and smooth fade transitions for a city-that-never-sleeps ambiance+- **Neon street signs**: Floating pixel-font signs positioned around the downtown perimeter reading PORTOS, SYSTEM ONLINE, CYBER, DIGITAL, NEURAL NET, DATA CORE — some with realistic neon flicker effects, all with glow halos and point lights that illuminate nearby geometry+- **Rooftop antenna arrays**: Every active building now has a rooftop antenna with one of 4 types (spire, dish, cross-bar, rotating array), each with a blinking red or accent-colored tip light — adds vertical detail and makes the skyline feel like a real communications hub+- **Vertical neon edge strips**: Animated neon bars on all 4 building corners pulse in and out of phase, adding depth and making buildings glow more dynamically when viewed from the side+- **Enhanced building windows**: More windows lit (50% vs 40%), brighter accent windows at 70% opacity, edge strips and top accent lines on the window texture itself for denser visual detail+- **Wet street puddles**: 20 scattered reflective patches on the ground with subtle ripple animations, colored with neon accent hues, creating a rain-slick street aesthetic+- **Ground fog layer**: Subtle cyan additive-blended fog plane hovering just above ground level for atmospheric haze+- **Enhanced lighting**: Stronger neon point lights with 2 additional accent lights (green and rose), extended fog distance (30-80), and brighter emissive building materials+- **Enhanced particles**: Doubled sparkle counts (120 cyan, 50 pink, 35 purple), added orange ground-level dust and blue high-altitude sparkles — 5 particle layers total+- **Cyberpunk HUD upgrade**: Glitching CYBERCITY title with chromatic aberration effect, system health bar under the clock, animated scan line in the vitals panel, corner bracket decorations on all HUD panels, neon text shadows, weather icons, agent pulse indicators, status footer, and decorative boot-sequence text+- **Enhanced CRT overlay**: CRT brightness flicker, stronger vignette (40% vs 50% transparent center), chromatic aberration with 3 color channels, and neon edge glow lines along top and bottom of screen+- **Extended orbit range**: maxDistance increased from 60 to 80, allowing the camera to pull back and take in the full skyline panorama++**Client changes**:+- `client/src/components/city/CityVolumetricLights.jsx` — New volumetric light beam cones + horizontal scan beams with GPU shaders+- `client/src/components/city/CitySkyline.jsx` — New distant skyline with 60 shader-lit buildings around the perimeter+- `client/src/components/city/CityDataRain.jsx` — New Matrix-style cascading data glyph columns+- `client/src/components/city/CityEmbers.jsx` — New rising ember/spark particles with wind drift+- `client/src/components/city/CityNeonSigns.jsx` — New neon street signs with flicker effects and glow halos+- `client/src/components/city/Building.jsx` — Added rooftop antennas (4 types), vertical neon edge strips, enhanced window textures+- `client/src/components/city/CityGround.jsx` — Added wet puddle patches and ground fog layer+- `client/src/components/city/CityLights.jsx` — Stronger lights, 2 additional accent lights, extended fog range+- `client/src/components/city/CityParticles.jsx` — Doubled counts, added 2 new particle layers+- `client/src/components/city/CityHud.jsx` — Glitch title, health bar, scan line, corner decorations, neon shadows+- `client/src/components/city/CityScanlines.jsx` — CRT flicker, stronger vignette, edge glow lines+- `client/src/components/city/CityScene.jsx` — Integrated all 5 new scene layers, extended orbit rangediff --git a/client/src/components/city/Building.jsx b/client/src/components/city/Building.jsxindex 55ee7f248f..5e61c04e09 100644--- a/client/src/components/city/Building.jsx+++ b/client/src/components/city/Building.jsx@@ -112,12 +112,15 @@ const createWindowTexture = (accentColor, width, height, seed) => {for (let r = 1; r < rowCount - 1; r++) {for (let c = 1; c < cols - 1; c++) {if (r % 3 === 0 || c % 3 === 0) continue;- if (rand() > 0.6) {+ if (rand() > 0.5) {const bright = rand();- if (bright > 0.8) {- ctx.fillStyle = accentColor + '50';- } else if (bright > 0.4) {- ctx.fillStyle = accentColor + '25';+ if (bright > 0.85) {+ // Bright window - full accent+ ctx.fillStyle = accentColor + '70';+ } else if (bright > 0.6) {+ ctx.fillStyle = accentColor + '40';+ } else if (bright > 0.3) {+ ctx.fillStyle = accentColor + '20';} else {ctx.fillStyle = '#0a0f1e';}@@ -140,12 +143,21 @@ const createWindowTexture = (accentColor, width, height, seed) => {ctx.fillStyle = accentColor;ctx.fillRect((startCol + c) * px, (startRow + r) * px, px, px);// Slight inner highlight for pixel art depth- ctx.fillStyle = 'rgba(255,255,255,0.15)';+ ctx.fillStyle = 'rgba(255,255,255,0.2)';ctx.fillRect((startCol + c) * px + 1, (startRow + r) * px + 1, px - 3, px - 3);}}}+ // Draw vertical neon accent strips on edges of the face+ ctx.fillStyle = accentColor + '30';+ ctx.fillRect(0, 0, 2, canvas.height);+ ctx.fillRect(canvas.width - 2, 0, 2, canvas.height);++ // Horizontal accent line at top+ ctx.fillStyle = accentColor + '60';+ ctx.fillRect(0, 0, canvas.width, 2);+const texture = new THREE.CanvasTexture(canvas);texture.minFilter = THREE.NearestFilter;texture.magFilter = THREE.NearestFilter;@@ -154,6 +166,107 @@ const createWindowTexture = (accentColor, width, height, seed) => {return texture;};+// Rooftop antenna component+function RooftopAntenna({ height, color, accentColor, seed, width }) {+ const antennaRef = useRef();+ const blinkRef = useRef();+ const type = seed % 4;++ useFrame(({ clock }) => {+ const t = clock.getElapsedTime();+ if (blinkRef.current) {+ // Blinking light on antenna tip+ blinkRef.current.material.opacity = (Math.sin(t * 4 + seed) > 0.3) ? 0.9 : 0.1;+ }+ if (antennaRef.current && type === 2) {+ // Slow rotation for dish type+ antennaRef.current.rotation.y = t * 0.3 + seed;+ }+ });++ const antennaHeight = 0.6 + (seed % 30) / 30 * 0.8;++ return (+ <group position={[0, height, 0]}>+ {/* Main antenna mast */}+ <mesh position={[0, antennaHeight / 2, 0]}>+ <cylinderGeometry args={[0.015, 0.025, antennaHeight, 4]} />+ <meshBasicMaterial color={color} transparent opacity={0.7} />+ </mesh>++ {/* Blinking tip light */}+ <mesh ref={blinkRef} position={[0, antennaHeight + 0.05, 0]}>+ <sphereGeometry args={[0.04, 6, 6]} />+ <meshBasicMaterial+ color={seed % 2 === 0 ? '#ef4444' : accentColor}+ transparent+ opacity={0.9}+ />+ </mesh>+ <pointLight+ position={[0, antennaHeight + 0.05, 0]}+ color={seed % 2 === 0 ? '#ef4444' : accentColor}+ intensity={0.15}+ distance={3}+ decay={2}+ />++ {/* Type-specific details */}+ {type === 1 && (+ // Dish antenna+ <group ref={antennaRef} position={[0, antennaHeight * 0.7, 0]}>+ <mesh rotation={[0.3, 0, 0]}>+ <ringGeometry args={[0.05, 0.18, 8]} />+ <meshBasicMaterial color={accentColor} transparent opacity={0.4} side={THREE.DoubleSide} />+ </mesh>+ </group>+ )}+ {type === 2 && (+ // Array of small elements+ <group ref={antennaRef} position={[0, antennaHeight * 0.6, 0]}>+ {[0, 1, 2].map(i => (+ <mesh key={i} position={[0, i * 0.12, 0]} rotation={[Math.PI / 2, 0, (i * Math.PI) / 3]}>+ <planeGeometry args={[0.2, 0.03]} />+ <meshBasicMaterial color={accentColor} transparent opacity={0.5} side={THREE.DoubleSide} />+ </mesh>+ ))}+ </group>+ )}+ {type === 3 && (+ // Cross-bar antenna+ <>+ <mesh position={[0, antennaHeight * 0.75, 0]}>+ <boxGeometry args={[0.3, 0.015, 0.015]} />+ <meshBasicMaterial color={color} transparent opacity={0.6} />+ </mesh>+ <mesh position={[0, antennaHeight * 0.55, 0]}>+ <boxGeometry args={[0.2, 0.015, 0.015]} />+ <meshBasicMaterial color={color} transparent opacity={0.5} />+ </mesh>+ </>+ )}+ </group>+ );+}++// Vertical neon strip on building edge+function NeonEdgeStrip({ position, height, color, delay }) {+ const ref = useRef();++ useFrame(({ clock }) => {+ if (!ref.current) return;+ const t = clock.getElapsedTime();+ ref.current.material.opacity = 0.3 + Math.sin(t * 1.2 + delay) * 0.2;+ });++ return (+ <mesh ref={ref} position={position}>+ <boxGeometry args={[0.03, height, 0.03]} />+ <meshBasicMaterial color={color} transparent opacity={0.4} />+ </mesh>+ );+}+export default function Building({ app, position, agentCount, onClick }) {const meshRef = useRef();const glowRef = useRef();@@ -191,13 +304,13 @@ export default function Building({ app, position, agentCount, onClick }) {if (!meshRef.current) return;const t = clock.getElapsedTime();- const baseIntensity = isOnline ? 0.2 : 0.05;- const pulse = isOnline ? Math.sin(t * 2 + seed) * 0.08 : 0;- const hoverBoost = hovered ? 0.25 : 0;+ const baseIntensity = isOnline ? 0.25 : 0.08;+ const pulse = isOnline ? Math.sin(t * 2 + seed) * 0.1 : 0;+ const hoverBoost = hovered ? 0.3 : 0;meshRef.current.material.emissiveIntensity = baseIntensity + pulse + hoverBoost;if (glowRef.current) {- glowRef.current.material.opacity = 0.2 + (isOnline ? Math.sin(t * 1.5) * 0.08 : 0) + (hovered ? 0.15 : 0);+ glowRef.current.material.opacity = 0.25 + (isOnline ? Math.sin(t * 1.5) * 0.1 : 0) + (hovered ? 0.2 : 0);}});@@ -215,7 +328,7 @@ export default function Building({ app, position, agentCount, onClick }) {<meshStandardMaterialcolor={CITY_COLORS.buildingBody}emissive={edgeColor}- emissiveIntensity={0.1}+ emissiveIntensity={0.15}map={windowTexture}transparentopacity={app.archived ? 0.75 : 0.95}@@ -237,10 +350,20 @@ export default function Building({ app, position, agentCount, onClick }) {<meshBasicMaterialcolor={edgeColor}transparent- opacity={app.archived ? 0.2 : 0.4}+ opacity={app.archived ? 0.2 : 0.5}/></mesh>+ {/* Vertical neon edge strips on corners */}+ {!app.archived && (+ <>+ <NeonEdgeStrip position={[width / 2, height / 2, depth / 2]} height={height} color={accentColor} delay={0} />+ <NeonEdgeStrip position={[-width / 2, height / 2, depth / 2]} height={height} color={accentColor} delay={1} />+ <NeonEdgeStrip position={[width / 2, height / 2, -depth / 2]} height={height} color={accentColor} delay={2} />+ <NeonEdgeStrip position={[-width / 2, height / 2, -depth / 2]} height={height} color={accentColor} delay={3} />+ </>+ )}+{/* Building name on front face - pixel font */}<Textposition={[0, height * 0.88, depth / 2 + 0.02]}@@ -282,13 +405,13 @@ export default function Building({ app, position, agentCount, onClick }) {{displayName}</Text>- {/* Base glow circle */}+ {/* Base glow circle - wider and brighter */}<mesh ref={glowRef} rotation={[-Math.PI / 2, 0, 0]} position={[0, 0.01, 0]}>- <circleGeometry args={[1.5, 32]} />+ <circleGeometry args={[1.8, 32]} /><meshBasicMaterialcolor={edgeColor}transparent- opacity={0.2}+ opacity={0.25}side={THREE.DoubleSide}/></mesh>@@ -307,6 +430,17 @@ export default function Building({ app, position, agentCount, onClick }) {</>)}+ {/* Rooftop antenna */}+ {!app.archived && (+ <RooftopAntenna+ height={height}+ color={edgeColor}+ accentColor={accentColor}+ seed={seed}+ width={width}+ />+ )}+{/* Floating hologram above building */}<BuildingHologramposition={[0, height + 0.8, 0]}diff --git a/client/src/components/city/CityDataRain.jsx b/client/src/components/city/CityDataRain.jsxnew file mode 100644index 0000000000..f2ef8b6993--- /dev/null+++ b/client/src/components/city/CityDataRain.jsx@@ -0,0 +1,135 @@+import { useRef, useMemo } from 'react';+import { useFrame } from '@react-three/fiber';+import * as THREE from 'three';++// Matrix-style cascading data columns falling through the sky++const DATA_RAIN_VERT = `+ attribute float charIndex;+ attribute float columnPhase;+ attribute float speed;+ attribute float brightness;+ uniform float uTime;+ varying float vBrightness;+ varying float vFade;++ void main() {+ vec3 pos = position;++ // Each character falls independently within its column+ float t = mod(uTime * speed + columnPhase + charIndex * 0.05, 1.0);+ pos.y = mix(30.0, -5.0, t);++ // Head of the column is brightest, tail fades+ float headDist = t;+ vBrightness = brightness * smoothstep(0.0, 0.05, t) * smoothstep(1.0, 0.3, t);++ // Atmospheric fade with distance+ vec4 mvPosition = modelViewMatrix * vec4(pos, 1.0);+ vFade = smoothstep(-80.0, -20.0, mvPosition.z);++ gl_PointSize = (1.8 + brightness * 1.2) * (120.0 / -mvPosition.z);+ gl_Position = projectionMatrix * mvPosition;+ }+`;++const DATA_RAIN_FRAG = `+ varying float vBrightness;+ varying float vFade;+ uniform vec3 uColor;++ void main() {+ vec2 uv = gl_PointCoord - vec2(0.5);+ float d = length(uv);+ if (d > 0.5) discard;++ // Sharp rectangular glyph shape+ float rect = step(abs(uv.x), 0.35) * step(abs(uv.y), 0.4);+ float alpha = rect * vBrightness * vFade * 0.6;++ // Bright center, colored edges+ vec3 color = mix(uColor, vec3(1.0), vBrightness * 0.3);+ gl_FragColor = vec4(color, alpha);+ }+`;++export default function CityDataRain() {+ const pointsRef = useRef();+ const matRef = useRef();++ const { positions, charIndices, columnPhases, speeds, brightnesses, count } = useMemo(() => {+ const columns = 40;+ const charsPerColumn = 12;+ const total = columns * charsPerColumn;++ const pos = new Float32Array(total * 3);+ const chars = new Float32Array(total);+ const phases = new Float32Array(total);+ const spd = new Float32Array(total);+ const bright = new Float32Array(total);++ // Seeded random+ let s = 77;+ const rand = () => { s = (s * 16807 + 0) % 2147483647; return (s & 0x7fffffff) / 2147483647; };++ for (let col = 0; col < columns; col++) {+ const x = (rand() - 0.5) * 70;+ const z = (rand() - 0.5) * 70;+ const colPhase = rand();+ const colSpeed = 0.15 + rand() * 0.25;++ for (let ch = 0; ch < charsPerColumn; ch++) {+ const idx = col * charsPerColumn + ch;+ pos[idx * 3] = x + (rand() - 0.5) * 0.3;+ pos[idx * 3 + 1] = 0; // Will be animated in shader+ pos[idx * 3 + 2] = z + (rand() - 0.5) * 0.3;++ chars[idx] = ch / charsPerColumn;+ phases[idx] = colPhase;+ spd[idx] = colSpeed;+ // Head chars are brightest, tail dims out+ bright[idx] = 1.0 - (ch / charsPerColumn) * 0.7;+ }+ }++ return {+ positions: pos,+ charIndices: chars,+ columnPhases: phases,+ speeds: spd,+ brightnesses: bright,+ count: total,+ };+ }, []);++ useFrame(({ clock }) => {+ if (matRef.current) {+ matRef.current.uniforms.uTime.value = clock.getElapsedTime();+ }+ });++ return (+ <points ref={pointsRef}>+ <bufferGeometry>+ <bufferAttribute attach="attributes-position" count={count} array={positions} itemSize={3} />+ <bufferAttribute attach="attributes-charIndex" count={count} array={charIndices} itemSize={1} />+ <bufferAttribute attach="attributes-columnPhase" count={count} array={columnPhases} itemSize={1} />+ <bufferAttribute attach="attributes-speed" count={count} array={speeds} itemSize={1} />+ <bufferAttribute attach="attributes-brightness" count={count} array={brightnesses} itemSize={1} />+ </bufferGeometry>+ <shaderMaterial+ ref={matRef}+ vertexShader={DATA_RAIN_VERT}+ fragmentShader={DATA_RAIN_FRAG}+ uniforms={{+ uTime: { value: 0 },+ uColor: { value: new THREE.Color('#06b6d4') },+ }}+ transparent+ blending={THREE.AdditiveBlending}+ depthWrite={false}+ fog={false}+ />+ </points>+ );+}diff --git a/client/src/components/city/CityEmbers.jsx b/client/src/components/city/CityEmbers.jsxnew file mode 100644index 0000000000..59957b9cbf--- /dev/null+++ b/client/src/components/city/CityEmbers.jsx@@ -0,0 +1,119 @@+import { useRef, useMemo } from 'react';+import { useFrame } from '@react-three/fiber';+import * as THREE from 'three';++// Rising ember/spark particles that float upward from the city streets++const EMBER_VERT = `+ attribute float size;+ attribute float speed;+ attribute float phase;+ attribute vec3 emberColor;+ uniform float uTime;+ varying vec3 vColor;+ varying float vAlpha;++ void main() {+ vColor = emberColor;+ vec3 pos = position;++ // Rise upward with drift+ float t = mod(uTime * speed + phase, 1.0);+ pos.y = mix(-1.0, 18.0, t);+ pos.x += sin(uTime * 0.5 + phase * 6.28) * 1.5 * t;+ pos.z += cos(uTime * 0.4 + phase * 3.14) * 1.0 * t;++ // Fade in at bottom, fade out at top+ vAlpha = smoothstep(0.0, 0.1, t) * smoothstep(1.0, 0.6, t);++ vec4 mvPosition = modelViewMatrix * vec4(pos, 1.0);+ gl_PointSize = size * (100.0 / -mvPosition.z);+ gl_Position = projectionMatrix * mvPosition;+ }+`;++const EMBER_FRAG = `+ varying vec3 vColor;+ varying float vAlpha;++ void main() {+ float d = length(gl_PointCoord - vec2(0.5));+ if (d > 0.5) discard;++ // Bright core, soft edge+ float core = smoothstep(0.5, 0.0, d);+ float alpha = core * vAlpha * 0.7;++ // Hot white center+ vec3 color = mix(vColor, vec3(1.0, 0.95, 0.9), core * 0.4);++ gl_FragColor = vec4(color, alpha);+ }+`;++export default function CityEmbers() {+ const pointsRef = useRef();+ const matRef = useRef();++ const { positions, sizes, speeds, phases, colors, count } = useMemo(() => {+ const n = 120;+ const pos = new Float32Array(n * 3);+ const sz = new Float32Array(n);+ const spd = new Float32Array(n);+ const ph = new Float32Array(n);+ const col = new Float32Array(n * 3);++ const palette = [+ [1.0, 0.6, 0.1], // orange+ [1.0, 0.3, 0.1], // red-orange+ [0.0, 0.7, 0.8], // cyan+ [0.9, 0.4, 0.9], // pink+ [0.4, 0.3, 1.0], // blue+ ];++ for (let i = 0; i < n; i++) {+ // Spread across the city area+ pos[i * 3] = (Math.random() - 0.5) * 50;+ pos[i * 3 + 1] = 0; // Animated in shader+ pos[i * 3 + 2] = (Math.random() - 0.5) * 50;++ sz[i] = 0.8 + Math.random() * 1.5;+ spd[i] = 0.03 + Math.random() * 0.06;+ ph[i] = Math.random();++ const c = palette[Math.floor(Math.random() * palette.length)];+ col[i * 3] = c[0];+ col[i * 3 + 1] = c[1];+ col[i * 3 + 2] = c[2];+ }++ return { positions: pos, sizes: sz, speeds: spd, phases: ph, colors: col, count: n };+ }, []);++ useFrame(({ clock }) => {+ if (matRef.current) {+ matRef.current.uniforms.uTime.value = clock.getElapsedTime();+ }+ });++ return (+ <points ref={pointsRef}>+ <bufferGeometry>+ <bufferAttribute attach="attributes-position" count={count} array={positions} itemSize={3} />+ <bufferAttribute attach="attributes-size" count={count} array={sizes} itemSize={1} />+ <bufferAttribute attach="attributes-speed" count={count} array={speeds} itemSize={1} />+ <bufferAttribute attach="attributes-phase" count={count} array={phases} itemSize={1} />+ <bufferAttribute attach="attributes-emberColor" count={count} array={colors} itemSize={3} />+ </bufferGeometry>+ <shaderMaterial+ ref={matRef}+ vertexShader={EMBER_VERT}+ fragmentShader={EMBER_FRAG}+ uniforms={{ uTime: { value: 0 } }}+ transparent+ blending={THREE.AdditiveBlending}+ depthWrite={false}+ />+ </points>+ );+}diff --git a/client/src/components/city/CityGround.jsx b/client/src/components/city/CityGround.jsxindex e09fb35abd..5ccc22bad1 100644--- a/client/src/components/city/CityGround.jsx+++ b/client/src/components/city/CityGround.jsx@@ -1,19 +1,82 @@+import { useRef, useMemo } from 'react';+import { useFrame } from '@react-three/fiber';import { Grid } from '@react-three/drei';+import * as THREE from 'three';import { CITY_COLORS } from './cityConstants';+// Reflective puddle/wet-ground patches+function WetPatch({ position, size, color }) {+ const ref = useRef();++ useFrame(({ clock }) => {+ if (!ref.current) return;+ const t = clock.getElapsedTime();+ ref.current.material.opacity = 0.08 + Math.sin(t * 0.8 + position[0] * 3) * 0.03;+ });++ return (+ <mesh ref={ref} rotation={[-Math.PI / 2, 0, 0]} position={position}>+ <circleGeometry args={[size, 16]} />+ <meshBasicMaterial+ color={color}+ transparent+ opacity={0.08}+ blending={THREE.AdditiveBlending}+ side={THREE.DoubleSide}+ />+ </mesh>+ );+}+export default function CityGround() {+ const puddles = useMemo(() => {+ const result = [];+ let s = 137;+ const rand = () => { s = (s * 16807 + 0) % 2147483647; return (s & 0x7fffffff) / 2147483647; };+ const colors = CITY_COLORS.neonAccents;++ for (let i = 0; i < 20; i++) {+ result.push({+ id: `puddle-${i}`,+ position: [(rand() - 0.5) * 40, 0.005, (rand() - 0.5) * 40],+ size: 0.5 + rand() * 2,+ color: colors[Math.floor(rand() * colors.length)],+ });+ }+ return result;+ }, []);+return (- <Grid- infiniteGrid- cellSize={1}- sectionSize={4}- cellColor={CITY_COLORS.ground}- sectionColor={CITY_COLORS.ground}- cellThickness={0.4}- sectionThickness={1}- fadeDistance={50}- fadeStrength={1}- position={[0, -0.01, 0]}- />+ <group>+ <Grid+ infiniteGrid+ cellSize={1}+ sectionSize={4}+ cellColor={CITY_COLORS.ground}+ sectionColor={CITY_COLORS.ground}+ cellThickness={0.4}+ sectionThickness={1}+ fadeDistance={50}+ fadeStrength={1}+ position={[0, -0.01, 0]}+ />++ {/* Wet street reflective patches */}+ {puddles.map(p => (+ <WetPatch key={p.id} position={p.position} size={p.size} color={p.color} />+ ))}++ {/* Subtle ground fog layer */}+ <mesh rotation={[-Math.PI / 2, 0, 0]} position={[0, 0.1, 0]}>+ <planeGeometry args={[80, 80]} />+ <meshBasicMaterial+ color="#06b6d4"+ transparent+ opacity={0.015}+ blending={THREE.AdditiveBlending}+ side={THREE.DoubleSide}+ />+ </mesh>+ </group>);}diff --git a/client/src/components/city/CityHud.jsx b/client/src/components/city/CityHud.jsxindex 92777c694c..e6fd8e579c 100644--- a/client/src/components/city/CityHud.jsx+++ b/client/src/components/city/CityHud.jsx@@ -1,4 +1,4 @@-import { useState, useEffect, useMemo } from 'react';+import { useState, useEffect, useMemo, useRef } from 'react';import CityActivityLog from './CityActivityLog';import CityAgentBar from './CityAgentBar';@@ -14,16 +14,89 @@ const formatUptime = (seconds) => {// Weather status text based on system healthconst getWeatherStatus = (onlineRatio) => {- if (onlineRatio >= 1.0) return { text: 'CLEAR', color: 'text-emerald-400' };- if (onlineRatio >= 0.8) return { text: 'FAIR', color: 'text-cyan-400' };- if (onlineRatio >= 0.5) return { text: 'OVERCAST', color: 'text-amber-400' };- if (onlineRatio >= 0.2) return { text: 'RAIN', color: 'text-orange-400' };- return { text: 'STORM', color: 'text-red-400' };+ if (onlineRatio >= 1.0) return { text: 'CLEAR', color: 'text-emerald-400', icon: '//' };+ if (onlineRatio >= 0.8) return { text: 'FAIR', color: 'text-cyan-400', icon: '~' };+ if (onlineRatio >= 0.5) return { text: 'OVERCAST', color: 'text-amber-400', icon: '%%' };+ if (onlineRatio >= 0.2) return { text: 'RAIN', color: 'text-orange-400', icon: '||' };+ return { text: 'STORM', color: 'text-red-400', icon: '!!' };};+// Animated corner decoration for HUD panels+function HudCorner({ position = 'tl', color = 'cyan' }) {+ const corners = {+ tl: 'top-0 left-0 border-t border-l',+ tr: 'top-0 right-0 border-t border-r',+ bl: 'bottom-0 left-0 border-b border-l',+ br: 'bottom-0 right-0 border-b border-r',+ };++ return (+ <div+ className={`absolute w-2 h-2 ${corners[position]} border-${color}-400/60`}+ style={{ borderWidth: '1px' }}+ />+ );+}++// Glitch text effect - brief visual corruption+function GlitchTitle({ text, className }) {+ const [glitching, setGlitching] = useState(false);+ const intervalRef = useRef(null);++ useEffect(() => {+ intervalRef.current = setInterval(() => {+ if (Math.random() > 0.92) {+ setGlitching(true);+ setTimeout(() => setGlitching(false), 100 + Math.random() * 150);+ }+ }, 2000);+ return () => clearInterval(intervalRef.current);+ }, []);++ return (+ <div className={`relative ${className}`}>+ <span className={glitching ? 'opacity-0' : ''}>{text}</span>+ {glitching && (+ <>+ <span+ className="absolute inset-0 text-red-400/60"+ style={{ transform: 'translateX(2px)' }}+ >+ {text}+ </span>+ <span+ className="absolute inset-0 text-cyan-400/60"+ style={{ transform: 'translateX(-2px)' }}+ >+ {text}+ </span>+ </>+ )}+ </div>+ );+}++// System health bar visualization+function HealthBar({ value, max, color }) {+ const pct = max > 0 ? (value / max) * 100 : 0;+ return (+ <div className="w-full h-1 bg-gray-800/60 rounded-full overflow-hidden">+ <div+ className="h-full rounded-full transition-all duration-1000"+ style={{+ width: `${pct}%`,+ backgroundColor: color,+ boxShadow: `0 0 4px ${color}`,+ }}+ />+ </div>+ );+}+export default function CityHud({ cosStatus, cosAgents, agentMap, eventLogs, connected, apps, productivityData }) {const [time, setTime] = useState(new Date());const [uptimeSeconds, setUptimeSeconds] = useState(0);+ const [scanLine, setScanLine] = useState(0);useEffect(() => {const interval = setInterval(() => {@@ -33,6 +106,14 @@ export default function CityHud({ cosStatus, cosAgents, agentMap, eventLogs, conreturn () => clearInterval(interval);}, []);+ // Animated scan line in the vitals panel+ useEffect(() => {+ const interval = setInterval(() => {+ setScanLine(prev => (prev + 1) % 100);+ }, 50);+ return () => clearInterval(interval);+ }, []);+const activeApps = apps.filter(a => !a.archived && a.overallStatus === 'online').length;const stoppedApps = apps.filter(a => !a.archived && a.overallStatus === 'stopped').length;const totalApps = apps.filter(a => !a.archived).length;@@ -49,35 +130,63 @@ export default function CityHud({ cosStatus, cosAgents, agentMap, eventLogs, con<div className="absolute inset-0 pointer-events-none overflow-hidden">{/* Top-left: Clock + system status + vitals */}<div className="absolute top-3 left-3 pointer-events-auto">- <div className="bg-black/70 backdrop-blur-sm border border-cyan-500/30 rounded-lg px-4 py-2.5">- <div className="font-pixel text-cyan-400 text-lg tracking-wider">+ <div className="relative bg-black/80 backdrop-blur-sm border border-cyan-500/30 rounded-lg px-4 py-2.5 overflow-hidden">+ <HudCorner position="tl" />+ <HudCorner position="tr" />+ <HudCorner position="bl" />+ <HudCorner position="br" />++ <div className="font-pixel text-cyan-400 text-lg tracking-wider" style={{ textShadow: '0 0 8px rgba(6,182,212,0.5)' }}>{time.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit' })}</div><div className="font-pixel text-[10px] text-cyan-600 tracking-wide">{activeApps}/{totalApps} SYSTEMS ONLINE</div>++ {/* System health bar */}+ <div className="mt-1.5">+ <HealthBar value={activeApps} max={totalApps} color="#06b6d4" />+ </div></div>{/* System Vitals panel */}- <div className="mt-2 bg-black/70 backdrop-blur-sm border border-cyan-500/20 rounded-lg px-3 py-2 space-y-1">- <div className="font-pixel text-[9px] text-cyan-500/60 tracking-wider mb-1">VITALS</div>+ <div className="relative mt-2 bg-black/80 backdrop-blur-sm border border-cyan-500/20 rounded-lg px-3 py-2 space-y-1 overflow-hidden">+ <HudCorner position="tl" />+ <HudCorner position="tr" />+ <HudCorner position="bl" />+ <HudCorner position="br" />++ {/* Animated scan line */}+ <div+ className="absolute left-0 right-0 h-px bg-cyan-400/10 pointer-events-none"+ style={{ top: `${scanLine}%` }}+ />++ <div className="font-pixel text-[9px] text-cyan-500/60 tracking-wider mb-1">+ SYSTEM VITALS+ </div>{/* Uptime */}<div className="flex items-center justify-between gap-4"><span className="font-pixel text-[9px] text-gray-500 tracking-wide">UPTIME</span>- <span className="font-pixel text-[10px] text-cyan-400">{formatUptime(uptimeSeconds)}</span>+ <span className="font-pixel text-[10px] text-cyan-400" style={{ textShadow: '0 0 4px rgba(6,182,212,0.3)' }}>+ {formatUptime(uptimeSeconds)}+ </span></div>{/* Weather (system health) */}<div className="flex items-center justify-between gap-4"><span className="font-pixel text-[9px] text-gray-500 tracking-wide">WEATHER</span>- <span className={`font-pixel text-[10px] ${weather.color}`}>{weather.text}</span>+ <span className={`font-pixel text-[10px] ${weather.color}`}>+ <span className="opacity-50 mr-1">{weather.icon}</span>{weather.text}+ </span></div>{/* Active agents */}<div className="flex items-center justify-between gap-4"><span className="font-pixel text-[9px] text-gray-500 tracking-wide">AGENTS</span><span className={`font-pixel text-[10px] ${activeAgentCount > 0 ? 'text-emerald-400' : 'text-gray-600'}`}>+ {activeAgentCount > 0 && <span className="inline-block w-1.5 h-1.5 rounded-full bg-emerald-400 mr-1 animate-pulse" />}{activeAgentCount} ACTIVE</span></div>@@ -86,7 +195,9 @@ export default function CityHud({ cosStatus, cosAgents, agentMap, eventLogs, con{stoppedApps > 0 && (<div className="flex items-center justify-between gap-4"><span className="font-pixel text-[9px] text-gray-500 tracking-wide">STOPPED</span>- <span className="font-pixel text-[10px] text-amber-400">{stoppedApps}</span>+ <span className="font-pixel text-[10px] text-amber-400" style={{ textShadow: '0 0 4px rgba(245,158,11,0.3)' }}>+ {stoppedApps}+ </span></div>)}@@ -102,7 +213,7 @@ export default function CityHud({ cosStatus, cosAgents, agentMap, eventLogs, con{productivityData?.todaySucceeded > 0 && (<div className="flex items-center justify-between gap-4"><span className="font-pixel text-[9px] text-gray-500 tracking-wide">TASKS</span>- <span className="font-pixel text-[10px] text-purple-400">+ <span className="font-pixel text-[10px] text-purple-400" style={{ textShadow: '0 0 4px rgba(168,85,247,0.3)' }}>{productivityData.todaySucceeded} TODAY</span></div>@@ -117,27 +228,47 @@ export default function CityHud({ cosStatus, cosAgents, agentMap, eventLogs, con</span></div>)}++ {/* Divider */}+ <div className="border-t border-cyan-500/10 mt-1 pt-1">+ <div className="flex items-center justify-between">+ <span className="font-pixel text-[8px] text-cyan-500/30 tracking-widest">SYS.OK</span>+ <span className="font-pixel text-[8px] text-cyan-500/30 tracking-widest">+ {new Date().toLocaleDateString('en-US', { month: 'short', day: 'numeric' }).toUpperCase()}+ </span>+ </div>+ </div></div></div>- {/* Top-center: CyberCity title */}+ {/* Top-center: CyberCity title with glitch effect */}<div className="absolute top-3 left-1/2 -translate-x-1/2 pointer-events-none">- <div className="font-pixel text-cyan-400/40 text-xs tracking-[0.3em]">- CYBERCITY+ <GlitchTitle+ text="CYBERCITY"+ className="font-pixel text-cyan-400/50 text-sm tracking-[0.4em]"+ />+ <div className="font-pixel text-[8px] text-cyan-400/20 tracking-[0.2em] text-center mt-0.5">+ v{totalApps}.{activeApps}.{activeAgentCount}</div></div>{/* Top-right: Connection + CoS status */}<div className="absolute top-3 right-3 pointer-events-auto">- <div className="bg-black/70 backdrop-blur-sm border border-cyan-500/30 rounded-lg px-3 py-2 flex items-center gap-3">+ <div className="relative bg-black/80 backdrop-blur-sm border border-cyan-500/30 rounded-lg px-3 py-2 flex items-center gap-3">+ <HudCorner position="tl" />+ <HudCorner position="tr" />+ <HudCorner position="bl" />+ <HudCorner position="br" />+<div className="flex items-center gap-1.5">- <span className={`w-2 h-2 rounded-full ${connected ? 'bg-emerald-400' : 'bg-red-400'}`} />+ <span className={`w-2 h-2 rounded-full ${connected ? 'bg-emerald-400 shadow-[0_0_6px_rgba(34,197,94,0.5)]' : 'bg-red-400 shadow-[0_0_6px_rgba(239,68,68,0.5)]'}`} /><span className="font-pixel text-[10px] text-gray-400 tracking-wide">{connected ? 'LINK' : 'OFFLINE'}</span></div>+ <div className="w-px h-4 bg-cyan-500/20" /><div className="flex items-center gap-1.5">- <span className={`w-2 h-2 rounded-full ${cosStatus?.running ? 'bg-cyan-400 animate-pulse' : 'bg-gray-600'}`} />+ <span className={`w-2 h-2 rounded-full ${cosStatus?.running ? 'bg-cyan-400 animate-pulse shadow-[0_0_6px_rgba(6,182,212,0.5)]' : 'bg-gray-600'}`} /><span className="font-pixel text-[10px] text-gray-400 tracking-wide">CoS {cosStatus?.running ? 'RUN' : 'IDLE'}</span>@@ -150,6 +281,15 @@ export default function CityHud({ cosStatus, cosAgents, agentMap, eventLogs, con{/* Bottom: Agent status bar */}<CityAgentBar cosAgents={cosAgents} agentMap={agentMap} />++ {/* Bottom-left corner decoration */}+ <div className="absolute bottom-16 left-3 pointer-events-none">+ <div className="font-pixel text-[8px] text-cyan-500/15 tracking-widest leading-tight">+ {'>'} SYS.INIT<br/>+ {'>'} NET.LINK<br/>+ {'>'} HUD.READY+ </div>+ </div></div>);}diff --git a/client/src/components/city/CityLights.jsx b/client/src/components/city/CityLights.jsxindex f3404beb86..25a486b8b2 100644--- a/client/src/components/city/CityLights.jsx+++ b/client/src/components/city/CityLights.jsx@@ -3,19 +3,23 @@ import { CITY_COLORS } from './cityConstants';export default function CityLights() {return (<>- <ambientLight intensity={0.05} color={CITY_COLORS.ambient} />- {/* Main overhead cyan */}- <pointLight position={[0, 25, 0]} intensity={0.5} color="#06b6d4" distance={70} />- {/* Magenta accent from left */}- <pointLight position={[-20, 10, -15]} intensity={0.35} color="#ec4899" distance={50} />- {/* Blue accent from right */}- <pointLight position={[20, 10, 15]} intensity={0.35} color="#3b82f6" distance={50} />- {/* Purple from behind */}- <pointLight position={[0, 12, -25]} intensity={0.2} color="#8b5cf6" distance={45} />- {/* Warm orange ground level */}- <pointLight position={[10, 3, 5]} intensity={0.15} color="#f97316" distance={25} />- {/* Deep fog for depth fade */}- <fog attach="fog" args={[CITY_COLORS.fog, 25, 70]} />+ <ambientLight intensity={0.06} color={CITY_COLORS.ambient} />+ {/* Main overhead cyan - brighter */}+ <pointLight position={[0, 25, 0]} intensity={0.6} color="#06b6d4" distance={80} />+ {/* Magenta accent from left - stronger */}+ <pointLight position={[-20, 10, -15]} intensity={0.45} color="#ec4899" distance={55} />+ {/* Blue accent from right - stronger */}+ <pointLight position={[20, 10, 15]} intensity={0.45} color="#3b82f6" distance={55} />+ {/* Purple from behind - more presence */}+ <pointLight position={[0, 15, -25]} intensity={0.3} color="#8b5cf6" distance={50} />+ {/* Warm orange ground level accent */}+ <pointLight position={[10, 3, 5]} intensity={0.2} color="#f97316" distance={30} />+ {/* Additional green accent - ground level from opposite side */}+ <pointLight position={[-12, 2, 8]} intensity={0.12} color="#22c55e" distance={20} />+ {/* Red warning accent from below-right */}+ <pointLight position={[15, 1, -10]} intensity={0.08} color="#f43f5e" distance={18} />+ {/* Deep fog for depth fade - pushes out further */}+ <fog attach="fog" args={[CITY_COLORS.fog, 30, 80]} /></>);}diff --git a/client/src/components/city/CityNeonSigns.jsx b/client/src/components/city/CityNeonSigns.jsxnew file mode 100644index 0000000000..89e5d17366--- /dev/null+++ b/client/src/components/city/CityNeonSigns.jsx@@ -0,0 +1,267 @@+import { useRef, useMemo } from 'react';+import { useFrame } from '@react-three/fiber';+import { Text } from '@react-three/drei';+import * as THREE from 'three';+import { CITY_COLORS, PIXEL_FONT_URL } from './cityConstants';++// Floating neon street-level signs with animated glow++function NeonSign({ position, rotation, text, color, fontSize = 0.4, flickerRate = 0, phase = 0 }) {+ const textRef = useRef();+ const backRef = useRef();+ const glowRef = useRef();++ useFrame(({ clock }) => {+ const t = clock.getElapsedTime();++ // Flicker effect for some signs+ let opacity = 0.9;+ if (flickerRate > 0) {+ const flicker = Math.sin(t * flickerRate + phase);+ // Occasional rapid flicker+ if (flicker > 0.85) opacity = 0.3 + Math.random() * 0.5;+ else if (flicker > 0.7) opacity = 0.1;+ }++ if (textRef.current) {+ textRef.current.fillOpacity = opacity;+ }+ if (backRef.current) {+ backRef.current.material.opacity = 0.5 * opacity;+ }+ if (glowRef.current) {+ glowRef.current.material.opacity = 0.15 * opacity;+ }+ });++ const textWidth = text.length * fontSize * 0.55;+ const textHeight = fontSize * 1.4;++ return (+ <group position={position} rotation={rotation}>+ {/* Dark backing panel */}+ <mesh ref={backRef} position={[0, 0, -0.02]}>+ <planeGeometry args={[textWidth + 0.3, textHeight + 0.15]} />+ <meshBasicMaterial color="#020208" transparent opacity={0.5} side={THREE.DoubleSide} />+ </mesh>++ {/* Neon text */}+ <Text+ ref={textRef}+ fontSize={fontSize}+ color={color}+ anchorX="center"+ anchorY="middle"+ font={PIXEL_FONT_URL}+ >+ {text}+ </Text>++ {/* Glow halo behind text */}+ <mesh ref={glowRef} position={[0, 0, -0.03]}>+ <planeGeometry args={[textWidth + 0.8, textHeight + 0.6]} />+ <meshBasicMaterial+ color={color}+ transparent+ opacity={0.15}+ blending={THREE.AdditiveBlending}+ side={THREE.DoubleSide}+ />+ </mesh>++ {/* Point light for neon glow effect on surroundings */}+ <pointLight color={color} intensity={0.3} distance={4} decay={2} />+ </group>+ );+}++// Vertical neon bar decoration+function NeonBar({ position, rotation, color, height = 2 }) {+ const ref = useRef();++ useFrame(({ clock }) => {+ if (!ref.current) return;+ const t = clock.getElapsedTime();+ ref.current.material.opacity = 0.4 + Math.sin(t * 2 + position[0]) * 0.15;+ });++ return (+ <mesh ref={ref} position={position} rotation={rotation}>+ <boxGeometry args={[0.04, height, 0.04]} />+ <meshBasicMaterial color={color} transparent opacity={0.4} />+ </mesh>+ );+}++export default function CityNeonSigns({ positions }) {+ const signs = useMemo(() => {+ if (!positions || positions.size < 2) return [];++ const entries = [];+ positions.forEach((pos) => {+ if (pos.district === 'downtown') entries.push(pos);+ });++ if (entries.length < 2) return [];++ let minX = Infinity, maxX = -Infinity, minZ = Infinity, maxZ = -Infinity;+ entries.forEach(p => {+ minX = Math.min(minX, p.x);+ maxX = Math.max(maxX, p.x);+ minZ = Math.min(minZ, p.z);+ maxZ = Math.max(maxZ, p.z);+ });++ const colors = CITY_COLORS.neonAccents;+ const pad = 3;+ const result = [];++ // Signs along the perimeter of downtown+ const signTexts = [+ 'PORTOS', 'SYSTEM ONLINE', 'CYBER', 'DIGITAL',+ 'NEURAL NET', 'DATA CORE', 'QUANTUM', 'UPLINK',+ 'OVERRIDE', 'SYNC', 'MATRIX', 'NEON',+ ];++ // Front signs+ result.push({+ id: 'sign-front-1',+ position: [minX - pad + 2, 2.5, minZ - pad + 1],+ rotation: [0, 0, 0],+ text: signTexts[0],+ color: colors[0],+ fontSize: 0.5,+ flickerRate: 0,+ phase: 0,+ });+ result.push({+ id: 'sign-front-2',+ position: [maxX + pad - 2, 1.8, minZ - pad + 1],+ rotation: [0, 0, 0],+ text: signTexts[1],+ color: colors[1],+ fontSize: 0.35,+ flickerRate: 8,+ phase: 1,+ });++ // Right side signs+ result.push({+ id: 'sign-right-1',+ position: [maxX + pad, 3.2, (minZ + maxZ) / 2 - 3],+ rotation: [0, -Math.PI / 2, 0],+ text: signTexts[2],+ color: colors[4],+ fontSize: 0.6,+ flickerRate: 0,+ phase: 2,+ });+ result.push({+ id: 'sign-right-2',+ position: [maxX + pad, 1.5, (minZ + maxZ) / 2 + 2],+ rotation: [0, -Math.PI / 2, 0],+ text: signTexts[3],+ color: colors[5],+ fontSize: 0.3,+ flickerRate: 12,+ phase: 3,+ });++ // Left side signs+ result.push({+ id: 'sign-left-1',+ position: [minX - pad, 2.8, (minZ + maxZ) / 2],+ rotation: [0, Math.PI / 2, 0],+ text: signTexts[4],+ color: colors[2],+ fontSize: 0.35,+ flickerRate: 0,+ phase: 4,+ });++ // Back signs+ result.push({+ id: 'sign-back-1',+ position: [(minX + maxX) / 2, 2, maxZ + pad - 1],+ rotation: [0, Math.PI, 0],+ text: signTexts[5],+ color: colors[3],+ fontSize: 0.4,+ flickerRate: 6,+ phase: 5,+ });++ return result;+ }, [positions]);++ const bars = useMemo(() => {+ if (!positions || positions.size < 2) return [];++ const entries = [];+ positions.forEach((pos) => {+ if (pos.district === 'downtown') entries.push(pos);+ });++ if (entries.length < 2) return [];++ let minX = Infinity, maxX = -Infinity, minZ = Infinity, maxZ = -Infinity;+ entries.forEach(p => {+ minX = Math.min(minX, p.x);+ maxX = Math.max(maxX, p.x);+ minZ = Math.min(minZ, p.z);+ maxZ = Math.max(maxZ, p.z);+ });++ const colors = CITY_COLORS.neonAccents;+ const pad = 3;+ const result = [];++ // Vertical neon bars at corners+ const corners = [+ [minX - pad, minZ - pad],+ [maxX + pad, minZ - pad],+ [minX - pad, maxZ + pad],+ [maxX + pad, maxZ + pad],+ ];++ corners.forEach(([x, z], i) => {+ result.push({+ id: `bar-${i}`,+ position: [x, 1.5, z],+ rotation: [0, 0, 0],+ color: colors[i % colors.length],+ height: 3,+ });+ });++ return result;+ }, [positions]);++ if (signs.length === 0) return null;++ return (+ <group>+ {signs.map(sign => (+ <NeonSign+ key={sign.id}+ position={sign.position}+ rotation={sign.rotation}+ text={sign.text}+ color={sign.color}+ fontSize={sign.fontSize}+ flickerRate={sign.flickerRate}+ phase={sign.phase}+ />+ ))}+ {bars.map(bar => (+ <NeonBar+ key={bar.id}+ position={bar.position}+ rotation={bar.rotation}+ color={bar.color}+ height={bar.height}+ />+ ))}+ </group>+ );+}diff --git a/client/src/components/city/CityParticles.jsx b/client/src/components/city/CityParticles.jsxindex fba6212dd7..e2a787c15f 100644--- a/client/src/components/city/CityParticles.jsx+++ b/client/src/components/city/CityParticles.jsx@@ -5,30 +5,50 @@ export default function CityParticles() {<>{/* Cyan ambient sparkles - main atmosphere */}<Sparkles- count={80}- scale={[40, 15, 40]}- size={1.5}+ count={120}+ scale={[50, 20, 50]}+ size={1.8}speed={0.3}- opacity={0.25}+ opacity={0.3}color="#06b6d4"/>{/* Pink/magenta secondary sparkles */}<Sparkles- count={30}- scale={[30, 10, 30]}+ count={50}+ scale={[40, 15, 40]}+ size={1.2}+ speed={0.25}+ opacity={0.2}+ color="#ec4899"+ />+ {/* Purple deep sparkles */}+ <Sparkles+ count={35}+ scale={[45, 15, 45]}size={1}speed={0.2}opacity={0.15}- color="#ec4899"+ color="#8b5cf6"/>- {/* Purple deep sparkles */}+ {/* Orange warm dust near ground */}<Sparkles- count={20}- scale={[35, 12, 35]}+ count={25}+ scale={[35, 5, 35]}size={0.8}speed={0.15}+ opacity={0.12}+ color="#f97316"+ position={[0, 2, 0]}+ />+ {/* Blue high-altitude sparkles */}+ <Sparkles+ count={30}+ scale={[50, 8, 50]}+ size={0.6}+ speed={0.1}opacity={0.1}- color="#8b5cf6"+ color="#3b82f6"+ position={[0, 15, 0]}/></>);diff --git a/client/src/components/city/CityScanlines.jsx b/client/src/components/city/CityScanlines.jsxindex 741e0e5138..5eaa74bef2 100644--- a/client/src/components/city/CityScanlines.jsx+++ b/client/src/components/city/CityScanlines.jsx@@ -1,48 +1,54 @@-import { useRef, useEffect } from 'react';+import { useState, useEffect } from 'react';// CSS-based CRT scanline + vignette overlay for cyberpunk atmosphereexport default function CityScanlines() {- const canvasRef = useRef(null);+ const [flicker, setFlicker] = useState(1);+ // Random subtle brightness flicker like a CRT monitoruseEffect(() => {- const canvas = canvasRef.current;- if (!canvas) return;- const ctx = canvas.getContext('2d');- canvas.width = 4;- canvas.height = 4;-- // Draw a tiny 4x4 scanline pattern (repeating)- ctx.clearRect(0, 0, 4, 4);- ctx.fillStyle = 'rgba(0, 0, 0, 0.06)';- ctx.fillRect(0, 0, 4, 1);- ctx.fillRect(0, 2, 4, 1);+ const interval = setInterval(() => {+ setFlicker(0.97 + Math.random() * 0.03);+ }, 150);+ return () => clearInterval(interval);}, []);return (<>- {/* Scanline pattern (generated from hidden canvas) */}- <canvas ref={canvasRef} className="hidden" />{/* Scanline overlay */}<divclassName="absolute inset-0 pointer-events-none z-10"style={{- backgroundImage: 'repeating-linear-gradient(0deg, rgba(0,0,0,0.04) 0px, rgba(0,0,0,0.04) 1px, transparent 1px, transparent 3px)',+ backgroundImage: 'repeating-linear-gradient(0deg, rgba(0,0,0,0.05) 0px, rgba(0,0,0,0.05) 1px, transparent 1px, transparent 3px)',backgroundSize: '100% 3px',mixBlendMode: 'multiply',+ opacity: flicker,}}/>- {/* Vignette effect */}+ {/* Vignette effect - stronger */}<divclassName="absolute inset-0 pointer-events-none z-10"style={{- background: 'radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.4) 100%)',+ background: 'radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.5) 100%)',+ }}+ />+ {/* Chromatic aberration glow at edges */}+ <div+ className="absolute inset-0 pointer-events-none z-10 opacity-[0.025]"+ style={{+ boxShadow: 'inset 0 0 120px 30px rgba(6, 182, 212, 0.4), inset 0 0 80px 15px rgba(139, 92, 246, 0.3), inset 0 0 40px 10px rgba(236, 72, 153, 0.15)',+ }}+ />+ {/* Edge glow lines - top and bottom neon strips */}+ <div+ className="absolute top-0 left-0 right-0 h-px pointer-events-none z-10"+ style={{+ background: 'linear-gradient(90deg, transparent, rgba(6,182,212,0.15) 30%, rgba(6,182,212,0.3) 50%, rgba(6,182,212,0.15) 70%, transparent)',}}/>- {/* Subtle chromatic aberration glow at edges */}<div- className="absolute inset-0 pointer-events-none z-10 opacity-[0.015]"+ className="absolute bottom-0 left-0 right-0 h-px pointer-events-none z-10"style={{- boxShadow: 'inset 0 0 100px 20px rgba(6, 182, 212, 0.3), inset 0 0 60px 10px rgba(139, 92, 246, 0.2)',+ background: 'linear-gradient(90deg, transparent, rgba(139,92,246,0.15) 30%, rgba(139,92,246,0.3) 50%, rgba(139,92,246,0.15) 70%, transparent)',}}/></>diff --git a/client/src/components/city/CityScene.jsx b/client/src/components/city/CityScene.jsxindex 1d7fde3ebe..01610a268d 100644--- a/client/src/components/city/CityScene.jsx+++ b/client/src/components/city/CityScene.jsx@@ -13,6 +13,11 @@ import CityRoads from './CityRoads';import CityWeather from './CityWeather';import CityBillboards from './CityBillboards';import CityShootingStars from './CityShootingStars';+import CityVolumetricLights from './CityVolumetricLights';+import CitySkyline from './CitySkyline';+import CityDataRain from './CityDataRain';+import CityNeonSigns from './CityNeonSigns';+import CityEmbers from './CityEmbers';export default function CityScene({ apps, agentMap, onBuildingClick, cosStatus, productivityData }) {const [positions, setPositions] = useState(null);@@ -36,6 +41,7 @@ export default function CityScene({ apps, agentMap, onBuildingClick, cosStatus,<CityStarfield /><CityShootingStars /><CityCelestial />+ <CitySkyline /><CityGround /><CityRoads positions={positions} /><BuildingCluster@@ -52,12 +58,16 @@ export default function CityScene({ apps, agentMap, onBuildingClick, cosStatus,cosStatus={cosStatus}productivityData={productivityData}/>+ <CityVolumetricLights positions={positions} />+ <CityNeonSigns positions={positions} /><CityWeather stoppedCount={stoppedCount} totalCount={totalCount} />+ <CityDataRain />+ <CityEmbers /><CityParticles /><OrbitControlsmaxPolarAngle={Math.PI / 2.2}minDistance={5}- maxDistance={60}+ maxDistance={80}enableDampingdampingFactor={0.05}/>diff --git a/client/src/components/city/CitySkyline.jsx b/client/src/components/city/CitySkyline.jsxnew file mode 100644index 0000000000..22a92d6463--- /dev/null+++ b/client/src/components/city/CitySkyline.jsx@@ -0,0 +1,130 @@+import { useMemo } from 'react';+import * as THREE from 'three';++// Distant cyberpunk skyline silhouettes with neon trim+// Creates a ring of faint skyscraper outlines around the city perimeter++const SKYLINE_VERT = `+ varying vec2 vUv;+ varying float vHeight;+ void main() {+ vUv = uv;+ vHeight = position.y;+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);+ }+`;++const SKYLINE_FRAG = `+ uniform vec3 uColor;+ uniform vec3 uAccent;+ uniform float uMaxHeight;+ varying vec2 vUv;+ varying float vHeight;+ void main() {+ // Dark body that fades near top+ float bodyAlpha = 0.15 * (1.0 - vUv.y * 0.5);++ // Window dots - grid of small lit windows+ float cellX = fract(vUv.x * 8.0);+ float cellY = fract(vUv.y * 20.0);+ float window = step(0.3, cellX) * step(cellX, 0.7) * step(0.3, cellY) * step(cellY, 0.65);++ // Only some windows lit (pseudo-random via position)+ float lit = step(0.55, fract(sin(floor(vUv.x * 8.0) * 127.1 + floor(vUv.y * 20.0) * 311.7) * 43758.5453));+ window *= lit;++ vec3 color = mix(vec3(0.02, 0.02, 0.05), uAccent, window * 0.5);+ float alpha = bodyAlpha + window * 0.15;++ // Neon trim at top edge+ float topLine = smoothstep(0.98, 1.0, vUv.y);+ color = mix(color, uAccent, topLine);+ alpha = max(alpha, topLine * 0.4);++ // Neon trim at bottom+ float bottomLine = smoothstep(0.02, 0.0, vUv.y);+ color = mix(color, uColor, bottomLine);+ alpha = max(alpha, bottomLine * 0.3);++ // Fade with distance (atmospheric perspective)+ alpha *= 0.7;++ gl_FragColor = vec4(color, alpha);+ }+`;++// Create a single skyline building silhouette+function DistantBuilding({ position, width, height, color, accent }) {+ const colorVec = useMemo(() => new THREE.Color(color), [color]);+ const accentVec = useMemo(() => new THREE.Color(accent), [accent]);++ return (+ <mesh position={[position[0], height / 2, position[2]]}>+ <boxGeometry args={[width, height, width * 0.3]} />+ <shaderMaterial+ vertexShader={SKYLINE_VERT}+ fragmentShader={SKYLINE_FRAG}+ uniforms={{+ uColor: { value: colorVec },+ uAccent: { value: accentVec },+ uMaxHeight: { value: height },+ }}+ transparent+ side={THREE.DoubleSide}+ depthWrite={false}+ />+ </mesh>+ );+}++export default function CitySkyline() {+ const buildings = useMemo(() => {+ const result = [];+ const colors = ['#06b6d4', '#ec4899', '#8b5cf6', '#3b82f6', '#22c55e', '#f97316'];+ const accents = ['#06b6d4', '#ec4899', '#8b5cf6', '#3b82f6', '#f43f5e', '#a855f7'];++ // Seeded random for consistent skyline+ let s = 42;+ const rand = () => { s = (s * 16807 + 0) % 2147483647; return (s & 0x7fffffff) / 2147483647; };++ const radius = 55;+ const count = 60;++ for (let i = 0; i < count; i++) {+ const angle = (i / count) * Math.PI * 2 + rand() * 0.1;+ const r = radius + rand() * 15 - 7;+ const x = Math.cos(angle) * r;+ const z = Math.sin(angle) * r;++ const bWidth = 1.5 + rand() * 4;+ const bHeight = 5 + rand() * 25;+ const colorIdx = Math.floor(rand() * colors.length);++ result.push({+ id: `skyline-${i}`,+ position: [x, 0, z],+ width: bWidth,+ height: bHeight,+ color: colors[colorIdx],+ accent: accents[colorIdx],+ });+ }++ return result;+ }, []);++ return (+ <group>+ {buildings.map(b => (+ <DistantBuilding+ key={b.id}+ position={b.position}+ width={b.width}+ height={b.height}+ color={b.color}+ accent={b.accent}+ />+ ))}+ </group>+ );+}diff --git a/client/src/components/city/CityVolumetricLights.jsx b/client/src/components/city/CityVolumetricLights.jsxnew file mode 100644index 0000000000..5a54f66041--- /dev/null+++ b/client/src/components/city/CityVolumetricLights.jsx@@ -0,0 +1,199 @@+import { useRef, useMemo } from 'react';+import { useFrame } from '@react-three/fiber';+import * as THREE from 'three';+import { CITY_COLORS } from './cityConstants';++// Volumetric light cone shader+const CONE_VERT = `+ varying vec2 vUv;+ varying float vHeight;+ void main() {+ vUv = uv;+ vHeight = position.y;+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);+ }+`;++const CONE_FRAG = `+ uniform vec3 uColor;+ uniform float uTime;+ uniform float uIntensity;+ varying vec2 vUv;+ varying float vHeight;+ void main() {+ // Fade from bottom to top+ float alpha = (1.0 - vUv.y) * 0.12 * uIntensity;+ // Radial fade from center+ float radial = 1.0 - abs(vUv.x - 0.5) * 2.0;+ alpha *= radial * radial;+ // Slow shimmer+ alpha *= 0.8 + 0.2 * sin(uTime * 0.5 + vHeight * 2.0);+ // Noise-like variation+ float noise = sin(vUv.y * 30.0 + uTime) * 0.1;+ alpha += noise * 0.02;+ alpha = max(alpha, 0.0);+ gl_FragColor = vec4(uColor, alpha);+ }+`;++// A single volumetric light beam (upward cone)+function LightBeam({ position, color, height = 15, radius = 2, intensity = 1, phase = 0 }) {+ const matRef = useRef();++ const coneGeom = useMemo(() => {+ const geom = new THREE.CylinderGeometry(radius * 0.3, radius, height, 8, 16, true);+ return geom;+ }, [radius, height]);++ useFrame(({ clock }) => {+ if (!matRef.current) return;+ matRef.current.uniforms.uTime.value = clock.getElapsedTime() + phase;+ });++ const colorVec = useMemo(() => new THREE.Color(color), [color]);++ return (+ <group position={position}>+ <mesh geometry={coneGeom} position={[0, height / 2, 0]}>+ <shaderMaterial+ ref={matRef}+ vertexShader={CONE_VERT}+ fragmentShader={CONE_FRAG}+ uniforms={{+ uColor: { value: colorVec },+ uTime: { value: 0 },+ uIntensity: { value: intensity },+ }}+ transparent+ blending={THREE.AdditiveBlending}+ side={THREE.DoubleSide}+ depthWrite={false}+ />+ </mesh>+ {/* Ground glow disc */}+ <mesh rotation={[-Math.PI / 2, 0, 0]} position={[0, 0.03, 0]}>+ <circleGeometry args={[radius, 16]} />+ <meshBasicMaterial+ color={color}+ transparent+ opacity={0.08 * intensity}+ blending={THREE.AdditiveBlending}+ side={THREE.DoubleSide}+ />+ </mesh>+ </group>+ );+}++// Horizontal scanning laser beam between two points+function ScanBeam({ start, end, color, speed = 0.2, delay = 0 }) {+ const meshRef = useRef();++ const { length, midX, midZ, angle } = useMemo(() => {+ const dx = end[0] - start[0];+ const dz = end[2] - start[2];+ return {+ length: Math.sqrt(dx * dx + dz * dz),+ midX: (start[0] + end[0]) / 2,+ midZ: (start[2] + end[2]) / 2,+ angle: Math.atan2(dz, dx),+ };+ }, [start, end]);++ useFrame(({ clock }) => {+ if (!meshRef.current) return;+ const t = clock.getElapsedTime();+ // Slowly fade in and out+ const cycle = ((t * speed + delay) % 4.0);+ meshRef.current.material.opacity = cycle < 2 ?+ Math.sin((cycle / 2) * Math.PI) * 0.06 : 0;+ });++ const y = 3 + Math.sin(delay * 7) * 2;++ return (+ <mesh+ ref={meshRef}+ position={[midX, y, midZ]}+ rotation={[-Math.PI / 2, 0, angle]}+ >+ <planeGeometry args={[length, 0.03]} />+ <meshBasicMaterial+ color={color}+ transparent+ opacity={0.05}+ blending={THREE.AdditiveBlending}+ side={THREE.DoubleSide}+ />+ </mesh>+ );+}++export default function CityVolumetricLights({ positions }) {+ const beams = useMemo(() => {+ if (!positions || positions.size < 2) return { lights: [], scans: [] };++ const entries = [];+ positions.forEach((pos) => {+ if (pos.district === 'downtown') entries.push(pos);+ });++ let minX = Infinity, maxX = -Infinity, minZ = Infinity, maxZ = -Infinity;+ entries.forEach(p => {+ minX = Math.min(minX, p.x);+ maxX = Math.max(maxX, p.x);+ minZ = Math.min(minZ, p.z);+ maxZ = Math.max(maxZ, p.z);+ });++ const pad = 5;+ const colors = CITY_COLORS.neonAccents;++ // Spotlight beams at corners and edges of the city+ const lights = [+ { pos: [minX - pad, 0, minZ - pad], color: colors[0], height: 20, radius: 2.5, intensity: 0.8, phase: 0 },+ { pos: [maxX + pad, 0, minZ - pad], color: colors[1], height: 18, radius: 2, intensity: 0.7, phase: 1.5 },+ { pos: [minX - pad, 0, maxZ + pad], color: colors[4], height: 16, radius: 2, intensity: 0.6, phase: 3 },+ { pos: [maxX + pad, 0, maxZ + pad], color: colors[5], height: 22, radius: 3, intensity: 0.9, phase: 4.5 },+ // Center beam - tall and bright+ { pos: [(minX + maxX) / 2, 0, (minZ + maxZ) / 2], color: colors[0], height: 25, radius: 1.5, intensity: 0.5, phase: 2 },+ ];++ // Scanning laser beams across the city+ const scans = [+ { start: [minX - pad - 3, 0, minZ], end: [maxX + pad + 3, 0, minZ], color: colors[0], speed: 0.15, delay: 0 },+ { start: [minX, 0, minZ - pad - 3], end: [minX, 0, maxZ + pad + 3], color: colors[1], speed: 0.12, delay: 1 },+ { start: [minX - pad, 0, maxZ], end: [maxX + pad, 0, maxZ], color: colors[4], speed: 0.18, delay: 2 },+ ];++ return { lights, scans };+ }, [positions]);++ if (beams.lights.length === 0) return null;++ return (+ <group>+ {beams.lights.map((beam, i) => (+ <LightBeam+ key={`beam-${i}`}+ position={beam.pos}+ color={beam.color}+ height={beam.height}+ radius={beam.radius}+ intensity={beam.intensity}+ phase={beam.phase}+ />+ ))}+ {beams.scans.map((scan, i) => (+ <ScanBeam+ key={`scan-${i}`}+ start={scan.start}+ end={scan.end}+ color={scan.color}+ speed={scan.speed}+ delay={scan.delay}+ />+ ))}+ </group>+ );+}