Files
the-nexus/style.css
Alexander Whitestone 2a7dbef0c9 feat: session power meter — 3D balance visualizer
Implements issue #16: visual 3D representation of session
resources/balance tied to subscription credits.

**3D scene object** placed at (-9, 0, 5) left of center:
- Glass cylinder housing (MeshPhysicalMaterial, transparent)
- Animated energy fill via custom GLSL shader — clips fragments
  by UV.y against uFill, teal→purple gradient, scan-line ripple,
  bright edge band at fill level
- Switches to red/orange palette when power drops below 20%
- Floating spinning orb that tracks fill height with subtle bob
- 3 accent rings that dim when above the fill level
- Dynamic PointLight tracks orb position and intensity
- Canvas label: SESSION POWER / Fund once · Ask many

**HUD panel** (top-right corner):
- Live percentage + gradient bar with glowing tip marker
- Credits counter (out of 10,000)
- SOVEREIGN tier badge
- Fund once · Ask many models tagline
- Low-power warning state (<20%) with red bar, pulsing border, and
  flashing warning text

Session power drains slowly over time (~1% per 5 seconds) to demo
the live visualization. Ready to wire to a real credits/subscription API.

Fixes #16

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 21:21:46 -04:00

503 lines
11 KiB
CSS

/* === NEXUS DESIGN SYSTEM === */
:root {
--font-display: 'Orbitron', sans-serif;
--font-body: 'JetBrains Mono', monospace;
--color-bg: #050510;
--color-surface: rgba(10, 15, 40, 0.85);
--color-border: rgba(74, 240, 192, 0.2);
--color-border-bright: rgba(74, 240, 192, 0.5);
--color-text: #c8d8e8;
--color-text-muted: #5a6a8a;
--color-text-bright: #e0f0ff;
--color-primary: #4af0c0;
--color-primary-dim: rgba(74, 240, 192, 0.3);
--color-secondary: #7b5cff;
--color-danger: #ff4466;
--color-warning: #ffaa22;
--color-gold: #ffd700;
--text-xs: 11px;
--text-sm: 13px;
--text-base: 15px;
--text-lg: 18px;
--text-xl: 24px;
--text-2xl: 36px;
--space-1: 4px;
--space-2: 8px;
--space-3: 12px;
--space-4: 16px;
--space-6: 24px;
--space-8: 32px;
--panel-blur: 16px;
--panel-radius: 8px;
--transition-ui: 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
width: 100%;
height: 100%;
overflow: hidden;
background: var(--color-bg);
font-family: var(--font-body);
color: var(--color-text);
-webkit-font-smoothing: antialiased;
}
canvas#nexus-canvas {
display: block;
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
}
/* === LOADING SCREEN === */
#loading-screen {
position: fixed;
inset: 0;
z-index: 1000;
background: var(--color-bg);
display: flex;
align-items: center;
justify-content: center;
transition: opacity 0.8s ease;
}
#loading-screen.fade-out {
opacity: 0;
pointer-events: none;
}
.loader-content {
text-align: center;
}
.loader-sigil {
margin-bottom: var(--space-6);
}
.loader-title {
font-family: var(--font-display);
font-size: var(--text-2xl);
font-weight: 700;
letter-spacing: 0.3em;
color: var(--color-primary);
text-shadow: 0 0 30px rgba(74, 240, 192, 0.4);
margin-bottom: var(--space-2);
}
.loader-subtitle {
font-size: var(--text-sm);
color: var(--color-text-muted);
letter-spacing: 0.1em;
margin-bottom: var(--space-6);
}
.loader-bar {
width: 200px;
height: 2px;
background: rgba(74, 240, 192, 0.15);
border-radius: 1px;
margin: 0 auto;
overflow: hidden;
}
.loader-fill {
height: 100%;
width: 0%;
background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
border-radius: 1px;
transition: width 0.3s ease;
}
/* === ENTER PROMPT === */
#enter-prompt {
position: fixed;
inset: 0;
z-index: 500;
background: rgba(5, 5, 16, 0.7);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: opacity 0.5s ease;
}
#enter-prompt.fade-out {
opacity: 0;
pointer-events: none;
}
.enter-content {
text-align: center;
}
.enter-content h2 {
font-family: var(--font-display);
font-size: var(--text-xl);
color: var(--color-primary);
letter-spacing: 0.2em;
text-shadow: 0 0 20px rgba(74, 240, 192, 0.3);
margin-bottom: var(--space-2);
}
.enter-content p {
font-size: var(--text-sm);
color: var(--color-text-muted);
animation: pulse-text 2s ease-in-out infinite;
}
@keyframes pulse-text {
0%, 100% { opacity: 0.5; }
50% { opacity: 1; }
}
/* === GAME UI (HUD) === */
.game-ui {
position: fixed;
inset: 0;
pointer-events: none;
z-index: 10;
font-family: var(--font-body);
color: var(--color-text);
}
.game-ui button, .game-ui input, .game-ui [data-interactive] {
pointer-events: auto;
}
/* Debug overlay */
.hud-debug {
position: absolute;
top: var(--space-3);
left: var(--space-3);
background: rgba(0, 0, 0, 0.7);
color: #0f0;
font-size: var(--text-xs);
line-height: 1.5;
padding: var(--space-2) var(--space-3);
border-radius: 4px;
white-space: pre;
pointer-events: none;
font-variant-numeric: tabular-nums lining-nums;
}
/* Location indicator */
.hud-location {
position: absolute;
top: var(--space-3);
left: 50%;
transform: translateX(-50%);
font-family: var(--font-display);
font-size: var(--text-sm);
font-weight: 500;
letter-spacing: 0.15em;
color: var(--color-primary);
text-shadow: 0 0 10px rgba(74, 240, 192, 0.3);
display: flex;
align-items: center;
gap: var(--space-2);
}
.hud-location-icon {
font-size: 16px;
animation: spin-slow 10s linear infinite;
}
@keyframes spin-slow {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
/* Controls hint */
.hud-controls {
position: absolute;
bottom: var(--space-3);
left: var(--space-3);
font-size: var(--text-xs);
color: var(--color-text-muted);
pointer-events: none;
}
.hud-controls span {
color: var(--color-primary);
font-weight: 600;
}
/* === CHAT PANEL === */
.chat-panel {
position: absolute;
bottom: var(--space-4);
right: var(--space-4);
width: 380px;
max-height: 400px;
background: var(--color-surface);
backdrop-filter: blur(var(--panel-blur));
border: 1px solid var(--color-border);
border-radius: var(--panel-radius);
display: flex;
flex-direction: column;
overflow: hidden;
pointer-events: auto;
transition: max-height var(--transition-ui);
}
.chat-panel.collapsed {
max-height: 42px;
}
.chat-header {
display: flex;
align-items: center;
gap: var(--space-2);
padding: var(--space-3) var(--space-4);
border-bottom: 1px solid var(--color-border);
font-family: var(--font-display);
font-size: var(--text-xs);
letter-spacing: 0.1em;
font-weight: 500;
color: var(--color-text-bright);
cursor: pointer;
flex-shrink: 0;
}
.chat-status-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--color-primary);
box-shadow: 0 0 6px var(--color-primary);
animation: dot-pulse 2s ease-in-out infinite;
}
@keyframes dot-pulse {
0%, 100% { opacity: 0.6; }
50% { opacity: 1; }
}
.chat-toggle-btn {
margin-left: auto;
background: none;
border: none;
color: var(--color-text-muted);
font-size: 14px;
cursor: pointer;
transition: transform var(--transition-ui);
}
.chat-panel.collapsed .chat-toggle-btn {
transform: rotate(180deg);
}
.chat-messages {
flex: 1;
overflow-y: auto;
padding: var(--space-3) var(--space-4);
display: flex;
flex-direction: column;
gap: var(--space-2);
max-height: 280px;
scrollbar-width: thin;
scrollbar-color: rgba(74,240,192,0.2) transparent;
}
.chat-msg {
font-size: var(--text-xs);
line-height: 1.6;
padding: var(--space-1) 0;
}
.chat-msg-prefix {
font-weight: 700;
}
.chat-msg-system .chat-msg-prefix { color: var(--color-text-muted); }
.chat-msg-timmy .chat-msg-prefix { color: var(--color-primary); }
.chat-msg-user .chat-msg-prefix { color: var(--color-gold); }
.chat-msg-error .chat-msg-prefix { color: var(--color-danger); }
.chat-input-row {
display: flex;
border-top: 1px solid var(--color-border);
flex-shrink: 0;
}
.chat-input {
flex: 1;
background: transparent;
border: none;
padding: var(--space-3) var(--space-4);
font-family: var(--font-body);
font-size: var(--text-xs);
color: var(--color-text-bright);
outline: none;
}
.chat-input::placeholder {
color: var(--color-text-muted);
}
.chat-send-btn {
background: none;
border: none;
border-left: 1px solid var(--color-border);
padding: var(--space-3) var(--space-4);
color: var(--color-primary);
font-size: 16px;
cursor: pointer;
transition: background var(--transition-ui);
}
.chat-send-btn:hover {
background: rgba(74, 240, 192, 0.1);
}
/* === FOOTER === */
.nexus-footer {
position: fixed;
bottom: var(--space-1);
left: 50%;
transform: translateX(-50%);
z-index: 5;
font-size: 10px;
opacity: 0.3;
}
.nexus-footer a {
color: var(--color-text-muted);
text-decoration: none;
}
.nexus-footer a:hover {
color: var(--color-primary);
}
/* === SESSION POWER METER HUD === */
.session-power-hud {
position: absolute;
top: var(--space-4);
right: var(--space-4);
width: 220px;
background: var(--color-surface);
backdrop-filter: blur(var(--panel-blur));
border: 1px solid var(--color-border);
border-radius: var(--panel-radius);
padding: var(--space-3) var(--space-4);
pointer-events: none;
transition: border-color var(--transition-ui);
}
.session-power-hud.low-power {
border-color: rgba(255, 68, 102, 0.5);
animation: spm-warn-pulse 1.5s ease-in-out infinite;
}
@keyframes spm-warn-pulse {
0%, 100% { box-shadow: 0 0 0 0 rgba(255, 68, 102, 0); }
50% { box-shadow: 0 0 12px 2px rgba(255, 68, 102, 0.25); }
}
.spm-header {
display: flex;
align-items: center;
gap: var(--space-2);
margin-bottom: var(--space-2);
}
.spm-icon {
font-size: 14px;
animation: spm-icon-pulse 2s ease-in-out infinite;
}
@keyframes spm-icon-pulse {
0%, 100% { opacity: 0.6; }
50% { opacity: 1; }
}
.spm-title {
font-family: var(--font-display);
font-size: var(--text-xs);
font-weight: 600;
letter-spacing: 0.12em;
color: var(--color-primary);
}
.spm-bar-wrap {
display: flex;
align-items: center;
gap: var(--space-2);
margin-bottom: var(--space-2);
}
.spm-bar {
flex: 1;
height: 8px;
background: rgba(74, 240, 192, 0.08);
border: 1px solid rgba(74, 240, 192, 0.2);
border-radius: 4px;
overflow: visible;
position: relative;
}
.spm-fill {
height: 100%;
width: 100%;
background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
border-radius: 4px;
transition: width 0.4s ease, background 0.4s ease;
}
.session-power-hud.low-power .spm-fill {
background: linear-gradient(90deg, var(--color-danger), #ff8844);
}
.spm-tip {
position: absolute;
right: 0;
top: 50%;
transform: translate(50%, -50%);
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--color-primary);
box-shadow: 0 0 8px var(--color-primary);
transition: background 0.4s ease, box-shadow 0.4s ease;
}
.session-power-hud.low-power .spm-tip {
background: var(--color-danger);
box-shadow: 0 0 8px var(--color-danger);
}
.spm-pct {
font-family: var(--font-display);
font-size: var(--text-xs);
font-weight: 700;
color: var(--color-primary);
min-width: 36px;
text-align: right;
transition: color 0.4s ease;
}
.session-power-hud.low-power .spm-pct {
color: var(--color-danger);
}
.spm-credits-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: var(--space-1);
}
.spm-label {
font-size: var(--text-xs);
color: var(--color-text-muted);
}
.spm-credits-val {
font-size: var(--text-xs);
color: var(--color-text);
font-variant-numeric: tabular-nums;
}
.spm-tier-row {
margin-bottom: var(--space-2);
}
.spm-tier-badge {
font-family: var(--font-display);
font-size: 9px;
letter-spacing: 0.15em;
font-weight: 700;
color: var(--color-gold);
background: rgba(255, 215, 0, 0.08);
border: 1px solid rgba(255, 215, 0, 0.25);
border-radius: 3px;
padding: 2px 6px;
}
.spm-tagline {
font-size: var(--text-xs);
color: var(--color-text-muted);
letter-spacing: 0.05em;
}
.spm-warn {
margin-top: var(--space-2);
font-size: var(--text-xs);
color: var(--color-danger);
animation: spm-warn-text 1.2s ease-in-out infinite;
}
@keyframes spm-warn-text {
0%, 100% { opacity: 0.5; }
50% { opacity: 1; }
}
/* Mobile adjustments */
@media (max-width: 480px) {
.chat-panel {
width: calc(100vw - 32px);
right: var(--space-4);
bottom: var(--space-4);
}
.hud-controls {
display: none;
}
}