/* ============================================
   LumiBot — Sci-Fi Robot Companion Interface
   Design System Extension v1.0
   Extends Zaylo Premium Design System v3.0
   ============================================ */

/* ---- Sci-Fi Color Tokens ---- */
:root {
  --cyber-cyan: #00f0ff;
  --cyber-cyan-dim: rgba(0, 240, 255, 0.55);
  --cyber-cyan-glow: rgba(0, 240, 255, 0.35);
  --cyber-cyan-subtle: rgba(0, 240, 255, 0.10);
  --cyber-blue: #0080ff;
  --cyber-blue-glow: rgba(0, 128, 255, 0.35);
  --cyber-purple: #b44aff;
  --cyber-purple-glow: rgba(180, 74, 255, 0.3);
  --cyber-green: #00ff88;
  --cyber-green-glow: rgba(0, 255, 136, 0.3);
  --cyber-red: #ff3366;
  --cyber-red-glow: rgba(255, 51, 102, 0.35);
  --cyber-amber: #ffaa00;
  --cyber-gradient: linear-gradient(135deg, #00f0ff 0%, #0080ff 50%, #b44aff 100%);
  --cyber-gradient-subtle: linear-gradient(135deg, rgba(0,240,255,0.12) 0%, rgba(0,128,255,0.08) 50%, rgba(180,74,255,0.06) 100%);
  --hud-border: rgba(0, 240, 255, 0.15);
  --hud-border-strong: rgba(0, 240, 255, 0.3);
  --hud-bg: rgba(0, 240, 255, 0.04);
  --hud-scanline: rgba(0, 240, 255, 0.03);
  --robot-card-bg: linear-gradient(145deg, rgba(8,18,28,0.92) 0%, rgba(4,10,18,0.96) 100%);
}

[data-theme="light"] {
  --hud-border: rgba(0, 160, 220, 0.15);
  --hud-border-strong: rgba(0, 160, 220, 0.3);
  --hud-bg: rgba(0, 160, 220, 0.04);
  --hud-scanline: rgba(0, 0, 0, 0.02);
  --robot-card-bg: linear-gradient(145deg, rgba(240,248,255,0.95) 0%, rgba(230,240,250,0.98) 100%);
  --cyber-cyan: #0099bb;
  --cyber-cyan-dim: rgba(0, 153, 187, 0.55);
  --cyber-cyan-glow: rgba(0, 153, 187, 0.2);
}

/* ---- Keyframe Animations ---- */
@keyframes radarSweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes cyberpulse {
  0%, 100% { opacity: 0.6; filter: brightness(1); }
  50% { opacity: 1; filter: brightness(1.3); }
}
@keyframes cyberBreathe {
  0%, 100% { transform: scale(1) translateY(0); filter: drop-shadow(0 0 8px var(--cyber-cyan-glow)); }
  50% { transform: scale(1.015) translateY(-4px); filter: drop-shadow(0 0 18px var(--cyber-cyan-glow)); }
}
@keyframes holoRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes energyFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
@keyframes dataPulse {
  0%, 100% { opacity: 0.3; transform: scaleX(0.5); }
  50% { opacity: 1; transform: scaleX(1); }
}
@keyframes scanLine {
  0% { top: -2px; }
  100% { top: 100%; }
}
@keyframes nodeGlow {
  0%, 100% { box-shadow: 0 0 12px var(--cyber-cyan-glow), 0 0 24px transparent; }
  50% { box-shadow: 0 0 20px var(--cyber-cyan-glow), 0 0 40px var(--cyber-cyan-glow); }
}
@keyframes timerProgress {
  from { stroke-dashoffset: var(--timer-circumference, 880); }
  to { stroke-dashoffset: 0; }
}
@keyframes breatheIn {
  0% { transform: scale(0.5); opacity: 0.4; }
  50% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.5); opacity: 0.4; }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideRight {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes hudFlicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.6; }
  94% { opacity: 1; }
  96% { opacity: 0.8; }
  97% { opacity: 1; }
}
@keyframes typingDots {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
@keyframes chargePulse {
  0% { box-shadow: 0 0 10px var(--cyber-green-glow); }
  50% { box-shadow: 0 0 25px var(--cyber-green-glow), 0 0 50px rgba(0,255,136,0.15); }
  100% { box-shadow: 0 0 10px var(--cyber-green-glow); }
}
@keyframes edgeWarn {
  0%, 100% { border-color: transparent; }
  50% { border-color: var(--cyber-red); }
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(15px,10px) scale(1.03); }
  66% { transform: translate(-10px,-8px) scale(0.98); }
}
@keyframes slideTabIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes waveform {
  0%, 100% { height: 12%; }
  25% { height: 60%; }
  50% { height: 30%; }
  75% { height: 80%; }
}

/* ---- Page Layout ---- */
.robot-app {
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  font-family: var(--font-family);
  color: var(--text-primary);
  height: 100%;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  overflow: hidden;
  position: relative;
  z-index: 1;
  transition: background 1s ease;
}

/* ---- Ambient Cyber Orbs ---- */
.cyber-ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.cyber-orb { position: absolute; border-radius: 50%; filter: blur(110px); opacity: 0.12; will-change: transform; }
.cyber-orb-1 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(0,240,255,0.6) 0%, transparent 70%); top: -10%; left: -12%; animation: orbFloat 22s ease-in-out infinite; }
.cyber-orb-2 { width: 350px; height: 350px; background: radial-gradient(circle, rgba(0,128,255,0.45) 0%, transparent 70%); bottom: -12%; right: -8%; animation: orbFloat 28s ease-in-out infinite reverse; }
.cyber-orb-3 { width: 250px; height: 250px; background: radial-gradient(circle, rgba(180,74,255,0.35) 0%, transparent 70%); top: 45%; left: 60%; opacity: 0.08; animation: orbFloat 18s ease-in-out infinite 5s; }
[data-theme="light"] .cyber-orb { opacity: 0.04; filter: blur(130px); }

/* ---- Header ---- */
.robot-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(14px,4vw,20px) clamp(16px,5vw,24px);
  padding-top: max(16px, env(safe-area-inset-top));
  z-index: 10; position: relative;
  animation: fadeSlideUp 0.5s cubic-bezier(0.16,1,0.3,1);
}
.robot-brand { display: flex; align-items: center; gap: 12px; }
.robot-brand-icon {
  width: 42px; height: 42px; border-radius: 13px;
  background: var(--cyber-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; box-shadow: 0 4px 16px var(--cyber-cyan-glow);
  position: relative; overflow: hidden;
}
.robot-brand-icon::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
}
.robot-brand-name {
  font-size: clamp(20px,5vw,24px); font-weight: 800;
  background: var(--cyber-gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
  letter-spacing: -0.02em;
}
.robot-brand-sub { font-size: 11px; color: var(--text-tertiary); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }
.robot-header-actions { display: flex; gap: 8px; }
.robot-header-btn {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--bg-glass-strong); border: 1px solid var(--hud-border);
  color: var(--text-primary); font-size: 16px; cursor: pointer;
  transition: all 0.3s var(--smooth);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
}
.robot-header-btn:active { transform: scale(0.92); }

/* ---- Tab Content ---- */
.robot-content {
  flex: 1; position: relative; overflow: hidden; z-index: 1;
}
.robot-tab-panel {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 0 clamp(16px,5vw,24px) clamp(24px,6vw,32px);
  opacity: 0; pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.35s var(--smooth), transform 0.35s var(--smooth);
  will-change: opacity, transform;
}
.robot-tab-panel.active {
  opacity: 1; pointer-events: auto;
  transform: translateY(0) scale(1);
}
.robot-tab-panel.active > * {
  animation: fadeSlideUp 0.4s cubic-bezier(0.16,1,0.3,1) both;
}
.robot-tab-panel.active > *:nth-child(1) { animation-delay: 0s; }
.robot-tab-panel.active > *:nth-child(2) { animation-delay: 0.06s; }
.robot-tab-panel.active > *:nth-child(3) { animation-delay: 0.12s; }
.robot-tab-panel.active > *:nth-child(4) { animation-delay: 0.18s; }
.robot-tab-panel.active > *:nth-child(5) { animation-delay: 0.24s; }
.robot-tab-panel.active > *:nth-child(6) { animation-delay: 0.30s; }

/* ---- Bottom Tab Bar ---- */
.robot-tabs {
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px 12px; padding-bottom: max(10px, calc(8px + env(safe-area-inset-bottom)));
  background: var(--bg-glass-strong);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--hud-border);
  position: relative; z-index: 20;
}
.robot-tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 14px; border: none; background: transparent;
  color: var(--text-tertiary); font-family: var(--font-family);
  cursor: pointer; transition: all 0.3s var(--smooth);
  border-radius: 12px; position: relative;
  -webkit-tap-highlight-color: transparent;
}
.robot-tab-icon { font-size: 20px; line-height: 1; transition: transform 0.3s var(--spring); display: flex; align-items: center; justify-content: center; }
.robot-tab-icon svg { width: 22px; height: 22px; }
.robot-tab-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.robot-tab.active { color: var(--cyber-cyan); }
.robot-tab.active .robot-tab-icon { transform: scale(1.1); }
.robot-tab.active::after {
  content: ''; position: absolute; top: -1px; left: 25%; right: 25%;
  height: 2px; background: var(--cyber-cyan);
  border-radius: 0 0 2px 2px; box-shadow: 0 0 8px var(--cyber-cyan-glow);
}
.robot-tab:active { transform: scale(0.92); }

/* ---- Shared Card ---- */
.cyber-card {
  background: var(--robot-card-bg);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--hud-border);
  border-radius: clamp(16px,4vw,22px);
  padding: clamp(16px,4vw,22px);
  position: relative; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15), 0 8px 32px rgba(0,0,0,0.1);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.cyber-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--hud-border-strong), transparent);
}
.cyber-card:active { border-color: var(--hud-border-strong); }
[data-theme="light"] .cyber-card {
  box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06);
}
.cyber-card-title {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--cyber-cyan);
  margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
}
.cyber-card-title::before {
  content: ''; width: 3px; height: 12px;
  background: var(--cyber-gradient); border-radius: 2px;
}

/* ---- Screen 1: Digital Twin Dashboard ---- */

/* Robot Avatar */
.avatar-container {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 0 10px; position: relative;
}
.avatar-holo-ring {
  width: clamp(180px,45vw,220px); height: clamp(180px,45vw,220px);
  border-radius: 50%; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.avatar-holo-ring::before {
  content: ''; position: absolute; inset: -3px;
  border-radius: 50%; padding: 2px;
  background: var(--cyber-gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: holoRing 8s linear infinite;
}
.avatar-holo-ring::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle, var(--hud-bg) 0%, transparent 70%);
}
.avatar-body {
  width: 100%; height: 100%; position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  animation: cyberBreathe 4s ease-in-out infinite;
}
.avatar-robot {
  width: 110px; height: 130px; position: relative;
}
/* CSS Robot Illustration */
.robot-head {
  width: 72px; height: 52px; margin: 0 auto;
  background: linear-gradient(180deg, #1a2a3a 0%, #0d1820 100%);
  border-radius: 20px 20px 16px 16px;
  border: 2px solid var(--hud-border-strong);
  position: relative; z-index: 2;
  box-shadow: 0 0 15px var(--cyber-cyan-glow), inset 0 -4px 12px rgba(0,0,0,0.3);
}
.robot-face {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  width: 44px; height: 26px; border-radius: 10px;
  background: #000; border: 1px solid var(--hud-border);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  overflow: hidden;
}
.robot-eye {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyber-cyan);
  box-shadow: 0 0 6px var(--cyber-cyan), 0 0 12px var(--cyber-cyan-glow);
  transition: all 0.3s ease;
}
.robot-eye.happy { height: 4px; border-radius: 4px 4px 0 0; }
.robot-antenna {
  width: 3px; height: 14px; background: var(--hud-border-strong);
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  border-radius: 2px;
}
.robot-antenna::after {
  content: ''; position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyber-cyan);
  box-shadow: 0 0 8px var(--cyber-cyan);
  animation: cyberpulse 2s ease-in-out infinite;
}
.robot-torso {
  width: 56px; height: 36px; margin: -2px auto 0;
  background: linear-gradient(180deg, #15222e 0%, #0a1518 100%);
  border-radius: 8px 8px 12px 12px;
  border: 2px solid var(--hud-border);
  border-top: none; position: relative; z-index: 1;
}
.robot-chest-light {
  width: 18px; height: 4px; background: var(--cyber-cyan);
  border-radius: 2px; margin: 10px auto 0;
  box-shadow: 0 0 8px var(--cyber-cyan-glow);
  animation: cyberpulse 3s ease-in-out infinite 0.5s;
}
.robot-wheel-group {
  display: flex; justify-content: space-between; width: 68px;
  margin: 2px auto 0; position: relative;
}
.robot-wheel {
  width: 16px; height: 22px;
  background: linear-gradient(180deg, #2a2a2a 0%, #111 100%);
  border-radius: 4px; border: 1px solid rgba(255,255,255,0.08);
  position: relative;
}
.robot-wheel::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%); width: 6px; height: 6px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,0.15);
}

/* State Badge */
.robot-state-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px;
  background: var(--hud-bg); border: 1px solid var(--hud-border);
  font-size: 11px; font-weight: 700; color: var(--cyber-cyan);
  letter-spacing: 0.04em; margin-top: 14px;
  text-transform: uppercase;
}
.robot-state-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyber-cyan);
  box-shadow: 0 0 6px var(--cyber-cyan);
  animation: cyberpulse 2s ease-in-out infinite;
}

/* Vitals Grid */
.vitals-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: clamp(10px,3vw,14px); margin-top: 16px;
}
.vital-card {
  background: var(--robot-card-bg);
  border: 1px solid var(--hud-border);
  border-radius: 16px; padding: 14px;
  position: relative; overflow: hidden;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.vital-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--hud-border-strong), transparent);
}
.vital-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-tertiary); margin-bottom: 6px;
}
.vital-value {
  font-size: clamp(22px,6vw,28px); font-weight: 800;
  color: var(--cyber-cyan); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.vital-value .vital-unit { font-size: 12px; font-weight: 600; color: var(--text-tertiary); margin-left: 2px; }
.vital-icon { position: absolute; top: 12px; right: 12px; font-size: 18px; opacity: 0.4; }
.vital-bar {
  height: 3px; border-radius: 2px; margin-top: 8px;
  background: rgba(255,255,255,0.06); overflow: hidden;
}
.vital-bar-fill {
  height: 100%; border-radius: 2px;
  background: var(--cyber-gradient);
  transition: width 0.8s var(--smooth);
  box-shadow: 0 0 6px var(--cyber-cyan-glow);
}

/* Battery ring */
.battery-ring-container { position: relative; width: 48px; height: 48px; margin: 0 auto 4px; }
.battery-ring-container svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.battery-ring-bg { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 4; }
.battery-ring-fill { fill: none; stroke: var(--cyber-cyan); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 1s var(--smooth), stroke 0.5s ease; }
.battery-ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: var(--cyber-cyan); }

/* Predictive actions */
.action-bar { margin-top: 16px; }
.action-bar-title {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text-tertiary); margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.action-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 16px;
  background: var(--robot-card-bg);
  border: 1px solid var(--hud-border);
  cursor: pointer; transition: all 0.3s var(--smooth);
  margin-bottom: 8px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.action-card:active { transform: scale(0.97); border-color: var(--cyber-cyan); }
.action-icon {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--cyber-gradient-subtle);
  border: 1px solid var(--hud-border);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  flex-shrink: 0;
}
.action-text { flex: 1; }
.action-text-main { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.action-text-sub { font-size: 11px; color: var(--text-tertiary); }
.action-go {
  font-size: 10px; font-weight: 700; color: var(--cyber-cyan);
  padding: 6px 12px; border-radius: 8px; background: var(--cyber-cyan-subtle);
  border: 1px solid var(--hud-border);
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* ---- Screen 2: Sensor Matrix ---- */
.radar-container {
  width: 100%; aspect-ratio: 1; max-width: 340px;
  margin: 0 auto; position: relative;
  border-radius: 50%; overflow: hidden;
}
.radar-canvas {
  width: 100%; height: 100%; display: block;
  border-radius: 50%;
  box-shadow: 0 0 30px var(--cyber-cyan-glow), inset 0 0 30px rgba(0,0,0,0.5);
  border: 1px solid var(--hud-border-strong);
}
.radar-label {
  position: absolute; font-size: 8px; font-weight: 700;
  color: var(--cyber-cyan-dim); text-transform: uppercase;
  letter-spacing: 0.08em;
}
.radar-label-top { top: 8px; left: 50%; transform: translateX(-50%); }
.radar-label-right { right: 8px; top: 50%; transform: translateY(-50%); }
.radar-label-bottom { bottom: 8px; left: 50%; transform: translateX(-50%); }
.radar-label-left { left: 8px; top: 50%; transform: translateY(-50%); }

/* HUD Instruments */
.hud-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 14px; }
.hud-gauge {
  text-align: center; padding: 12px 6px; border-radius: 14px;
  background: var(--robot-card-bg); border: 1px solid var(--hud-border);
  position: relative; overflow: hidden;
}
.hud-gauge::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, var(--hud-scanline) 3px, var(--hud-scanline) 4px);
  pointer-events: none;
}
.hud-gauge-label { font-size: 8px; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }
.hud-gauge-value { font-size: 20px; font-weight: 800; color: var(--cyber-cyan); font-variant-numeric: tabular-nums; }
.hud-gauge-unit { font-size: 9px; color: var(--text-tertiary); }

/* Joystick */
.joystick-section { margin-top: 16px; }
.joystick-container {
  width: clamp(160px,42vw,200px); height: clamp(160px,42vw,200px);
  margin: 0 auto; position: relative;
  border-radius: 50%; background: var(--hud-bg);
  border: 2px solid var(--hud-border);
  box-shadow: inset 0 0 30px rgba(0,0,0,0.3);
  touch-action: none;
}
.joystick-container::before {
  content: ''; position: absolute; inset: 20%;
  border-radius: 50%; border: 1px dashed var(--hud-border);
}
.joystick-nub {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--cyber-gradient);
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 15px var(--cyber-cyan-glow), 0 4px 12px rgba(0,0,0,0.3);
  transition: box-shadow 0.2s ease;
  pointer-events: none; z-index: 2;
}
.joystick-nub.active {
  box-shadow: 0 0 25px var(--cyber-cyan-glow), 0 0 40px var(--cyber-cyan-glow), 0 4px 12px rgba(0,0,0,0.4);
}
.joystick-direction {
  position: absolute; font-size: 8px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
}
.joystick-dir-n { top: 6px; left: 50%; transform: translateX(-50%); }
.joystick-dir-s { bottom: 6px; left: 50%; transform: translateX(-50%); }
.joystick-dir-e { right: 6px; top: 50%; transform: translateY(-50%); }
.joystick-dir-w { left: 6px; top: 50%; transform: translateY(-50%); }
.joystick-warning {
  position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color 0.3s ease;
  pointer-events: none;
}
.joystick-warning.edge-detected { animation: edgeWarn 0.6s ease-in-out infinite; }

/* ---- Screen 3: Focus Hub ---- */
.focus-timer-container { display: flex; flex-direction: column; align-items: center; padding: 10px 0 6px; }
.focus-ring-wrap { position: relative; width: clamp(220px,56vw,280px); height: clamp(220px,56vw,280px); }
.focus-ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.focus-ring-bg { fill: none; stroke: rgba(255,255,255,0.05); stroke-width: 6; }
.focus-ring-fill {
  fill: none; stroke: url(#focusGradient); stroke-width: 6;
  stroke-linecap: round; transition: stroke-dashoffset 1s linear;
}
.focus-ring-glow {
  fill: none; stroke: url(#focusGradient); stroke-width: 10;
  stroke-linecap: round; opacity: 0.25; filter: blur(6px);
  transition: stroke-dashoffset 1s linear;
}
.focus-time-display {
  position: absolute; inset: 0; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
}
.focus-time-value {
  font-size: clamp(40px,12vw,56px); font-weight: 800;
  color: var(--text-primary); font-variant-numeric: tabular-nums;
  line-height: 1;
}
.focus-time-label { font-size: 11px; color: var(--text-tertiary); font-weight: 600; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.08em; }
.focus-presets { display: flex; gap: 8px; margin-top: 16px; }
.focus-preset-btn {
  padding: 8px 18px; border-radius: 12px;
  background: var(--hud-bg); border: 1px solid var(--hud-border);
  color: var(--text-secondary); font-family: var(--font-family);
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all 0.25s var(--smooth);
}
.focus-preset-btn.active {
  background: var(--cyber-gradient); border-color: transparent;
  color: #fff; box-shadow: 0 0 14px var(--cyber-cyan-glow);
}
.focus-preset-btn:active { transform: scale(0.94); }
.focus-start-btn {
  width: 100%; padding: 14px; border-radius: 16px;
  background: var(--cyber-gradient); border: none;
  color: #fff; font-family: var(--font-family);
  font-size: 15px; font-weight: 700; cursor: pointer;
  margin-top: 16px; position: relative; overflow: hidden;
  box-shadow: 0 4px 20px var(--cyber-cyan-glow);
  transition: all 0.3s var(--smooth);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.focus-start-btn:active { transform: scale(0.97); }
.focus-start-btn.running { background: var(--cyber-red); box-shadow: 0 4px 20px var(--cyber-red-glow); }

/* Ambient Sound */
.sound-card { margin-top: 14px; }
.waveform-display {
  display: flex; align-items: center; justify-content: center;
  gap: 2px; height: 40px; margin: 10px 0;
}
.waveform-bar {
  width: 3px; border-radius: 2px;
  background: var(--cyber-cyan);
  opacity: 0.6;
}
.waveform-bar.active { animation: waveform 1.2s ease-in-out infinite; }
.sound-genres { display: flex; gap: 6px; flex-wrap: wrap; }
.sound-genre-btn {
  padding: 6px 12px; border-radius: 10px;
  background: var(--hud-bg); border: 1px solid var(--hud-border);
  color: var(--text-tertiary); font-family: var(--font-family);
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: all 0.2s ease;
}
.sound-genre-btn.active { background: var(--cyber-gradient-subtle); border-color: var(--cyber-cyan); color: var(--cyber-cyan); }
.sound-genre-btn:active { transform: scale(0.94); }

/* Volume slider */
.volume-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.volume-icon { font-size: 16px; color: var(--text-tertiary); }
.volume-slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; background: rgba(255,255,255,0.08);
  border-radius: 2px; outline: none;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--cyber-cyan);
  box-shadow: 0 0 8px var(--cyber-cyan-glow);
  cursor: pointer;
}

/* Breathing exercise */
.breathing-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.92);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.5s ease;
}
.breathing-overlay.active { opacity: 1; pointer-events: auto; }
.breathing-ring {
  width: 200px; height: 200px; border-radius: 50%;
  border: 3px solid var(--cyber-cyan);
  box-shadow: 0 0 30px var(--cyber-cyan-glow), inset 0 0 30px var(--cyber-cyan-glow);
  display: flex; align-items: center; justify-content: center;
  transition: transform 4s ease-in-out, box-shadow 4s ease-in-out;
}
.breathing-ring.inhale { transform: scale(1.3); box-shadow: 0 0 50px var(--cyber-cyan-glow), inset 0 0 50px var(--cyber-cyan-glow); }
.breathing-ring.exhale { transform: scale(0.7); box-shadow: 0 0 15px var(--cyber-cyan-glow), inset 0 0 10px var(--cyber-cyan-glow); }
.breathing-text { font-size: 18px; font-weight: 700; color: var(--cyber-cyan); }
.breathing-instruction { margin-top: 24px; font-size: 14px; color: var(--text-secondary); }
.breathing-close {
  position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ---- Screen 4: Neural Command Center ---- */

/* Environment Nodes */
.nodes-map { position: relative; padding: 30px 0; min-height: 200px; }
.env-node {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--robot-card-bg); border: 2px solid var(--hud-border);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  cursor: pointer; transition: all 0.35s var(--smooth);
  position: absolute; z-index: 2;
}
.env-node:active { transform: scale(0.92); }
.env-node.active { border-color: var(--cyber-cyan); animation: nodeGlow 2s ease-in-out infinite; }
.env-node-icon { font-size: 22px; }
.env-node-label { font-size: 7px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-tertiary); }
.env-node.active .env-node-label { color: var(--cyber-cyan); }

.node-center {
  left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 80px; height: 80px; border-color: var(--cyber-cyan);
  background: var(--cyber-gradient-subtle); pointer-events: none;
}
.node-blinds { left: 12%; top: 20%; }
.node-lights { right: 12%; top: 20%; transform: translateX(0); }
.node-speaker { left: 12%; bottom: 10%; }
.node-mic { right: 12%; bottom: 10%; transform: translateX(0); }

/* Connection lines (SVG) */
.nodes-lines {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
}
.node-line {
  stroke: var(--hud-border); stroke-width: 1.5;
  stroke-dasharray: 4 4; fill: none;
}
.node-line.active {
  stroke: var(--cyber-cyan); stroke-width: 2;
  stroke-dasharray: none; filter: drop-shadow(0 0 4px var(--cyber-cyan-glow));
  animation: energyFlow 2s linear infinite;
}

/* Node Status Badges */
.node-status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.node-status-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 14px;
  background: var(--robot-card-bg); border: 1px solid var(--hud-border);
}
.node-status-left { display: flex; align-items: center; gap: 8px; }
.node-status-icon { font-size: 18px; }
.node-status-name { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.node-status-state { font-size: 10px; color: var(--text-tertiary); }

/* Toggle Switch */
.cyber-toggle {
  width: 44px; height: 24px; border-radius: 12px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--hud-border);
  position: relative; cursor: pointer; transition: all 0.3s ease;
  flex-shrink: 0;
}
.cyber-toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-tertiary);
  transition: all 0.3s var(--spring); box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.cyber-toggle.on { background: var(--cyber-gradient); border-color: transparent; }
.cyber-toggle.on::after { left: calc(100% - 20px); background: #fff; box-shadow: 0 0 8px var(--cyber-cyan-glow); }

/* Mic Transcript */
.transcript-card { margin-top: 14px; }
.transcript-feed {
  max-height: 200px; overflow-y: auto; padding: 4px 0;
  display: flex; flex-direction: column; gap: 6px;
}
.transcript-bubble {
  padding: 10px 14px; border-radius: 14px 14px 14px 4px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--hud-border);
  font-size: 13px; color: var(--text-secondary);
  animation: fadeSlideUp 0.3s ease both;
  max-width: 85%;
}
.transcript-bubble.user {
  align-self: flex-end; border-radius: 14px 14px 4px 14px;
  background: var(--cyber-gradient-subtle); border-color: var(--hud-border-strong);
  color: var(--text-primary);
}
.transcript-time { font-size: 9px; color: var(--text-muted); margin-top: 3px; }
.transcript-input-row { display: flex; gap: 8px; margin-top: 10px; }
.transcript-input {
  flex: 1; padding: 10px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--hud-border);
  color: var(--text-primary); font-family: var(--font-family);
  font-size: 13px; outline: none;
  transition: border-color 0.3s ease;
}
.transcript-input:focus { border-color: var(--cyber-cyan); }
.transcript-input::placeholder { color: var(--text-muted); }
.transcript-send-btn {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--cyber-gradient); border: none;
  color: #fff; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease;
}
.transcript-send-btn:active { transform: scale(0.9); }

/* Command Grid */
.command-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 14px; }
.command-tile {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 16px 8px; border-radius: 16px;
  background: var(--robot-card-bg); border: 1px solid var(--hud-border);
  cursor: pointer; transition: all 0.3s var(--smooth);
}
.command-tile:active { transform: scale(0.93); border-color: var(--cyber-cyan); box-shadow: 0 0 12px var(--cyber-cyan-glow); }
.command-tile-icon {
  font-size: 24px; width: 44px; height: 44px; border-radius: 14px;
  background: var(--cyber-gradient-subtle); border: 1px solid var(--hud-border);
  display: flex; align-items: center; justify-content: center;
}
.command-tile-label { font-size: 10px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---- Utility & Responsive ---- */
.section-gap { margin-top: clamp(14px,4vw,20px); }
.text-center { text-align: center; }
@media (max-width: 360px) {
  .vitals-grid { grid-template-columns: 1fr; }
  .hud-row { grid-template-columns: 1fr 1fr; }
  .command-grid { grid-template-columns: repeat(2, 1fr); }
}
